From 6ace44f6b5b747289479ee0df31e0129858a1ded Mon Sep 17 00:00:00 2001 From: olefirenque Date: Thu, 30 Nov 2023 13:12:15 +0300 Subject: [PATCH 001/197] [#131] client: add basic netmap dialer Signed-off-by: olefirenque --- client/client.go | 22 ++++++++++++++++++++++ client/client_test.go | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/client/client.go b/client/client.go index 014b3d7..d4a3e3b 100644 --- a/client/client.go +++ b/client/client.go @@ -5,6 +5,10 @@ import ( "crypto/ecdsa" "crypto/tls" "errors" + "fmt" + netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" + "net/url" + "slices" "time" v2accounting "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" @@ -110,6 +114,22 @@ func (c *Client) Dial(ctx context.Context, prm PrmDial) error { return nil } +func (c *Client) NetMapDial(ctx context.Context, endpoint string) error { + u, err := url.Parse(endpoint) + if err != nil { + return err + } + if u.Scheme == "frostfs" { + nodes := c.prm.NetMap.GetNodes() + for _, node := range nodes { + if slices.Equal([]byte(u.Host), node.PublicKey) { + return c.Dial(ctx, PrmDial{Endpoint: node.Addresses[0]}) + } + } + } + return fmt.Errorf("dial failure: endpoint %s isn't valid", endpoint) +} + // sets underlying provider of frostFSAPIServer. The method is used for testing as an approach // to skip Dial stage and override FrostFS API server. MUST NOT be used outside test code. // In real applications wrapper over git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client @@ -141,6 +161,8 @@ type PrmInit struct { ResponseInfoCallback func(ResponseMetaInfo) error + NetMap *netmap.Netmap + NetMagic uint64 } diff --git a/client/client_test.go b/client/client_test.go index d2e5274..e09fc11 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -5,6 +5,8 @@ import ( "crypto/ecdsa" "crypto/elliptic" "crypto/rand" + "fmt" + netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" "testing" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" @@ -65,3 +67,40 @@ func TestClient_DialContext(t *testing.T) { assert(ctx, context.DeadlineExceeded) } + +func TestClient_NetMapDialContext(t *testing.T) { + var prmInit PrmInit + var c Client + publicKey := "foo" + endpoint := "localhost:8080" + + prmInit.NetMap = &netmap.Netmap{ + Epoch: 0, + Nodes: []*netmap.NodeInfo{ + { + PublicKey: []byte(publicKey), + Addresses: []string{endpoint}, + }, + }, + } + + c.Init(prmInit) + + assert := func(ctx context.Context, errExpected error) { + // expect particular context error according to Dial docs + //require.ErrorIs(t, c.Dial(ctx, prm), errExpected) + require.ErrorIs(t, c.NetMapDial(ctx, fmt.Sprintf("frostfs://%s", publicKey)), errExpected) + } + + // create pre-abandoned context + ctx, cancel := context.WithCancel(context.Background()) + cancel() + + assert(ctx, context.Canceled) + + // create "pre-deadlined" context + ctx, cancel = context.WithTimeout(context.Background(), 0) + defer cancel() + + assert(ctx, context.DeadlineExceeded) +} From dd8fb59efe31f94aa830ea254434ad47da805933 Mon Sep 17 00:00:00 2001 From: olefirenque Date: Thu, 30 Nov 2023 13:26:21 +0300 Subject: [PATCH 002/197] [#131] client: get rid of slices.Equal Signed-off-by: olefirenque --- client/client.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/client/client.go b/client/client.go index d4a3e3b..5148838 100644 --- a/client/client.go +++ b/client/client.go @@ -8,7 +8,6 @@ import ( "fmt" netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" "net/url" - "slices" "time" v2accounting "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" @@ -119,10 +118,23 @@ func (c *Client) NetMapDial(ctx context.Context, endpoint string) error { if err != nil { return err } + + isEqualSlices := func(a, b []byte) bool { + if len(a) != len(b) { + return false + } + for i := range a { + if a[i] != b[i] { + return false + } + } + return true + } + if u.Scheme == "frostfs" { nodes := c.prm.NetMap.GetNodes() for _, node := range nodes { - if slices.Equal([]byte(u.Host), node.PublicKey) { + if isEqualSlices([]byte(u.Host), node.PublicKey) { return c.Dial(ctx, PrmDial{Endpoint: node.Addresses[0]}) } } From cf4677ecb914bf0ab8ae184866c48843ba36265a Mon Sep 17 00:00:00 2001 From: olefirenque Date: Thu, 30 Nov 2023 14:28:44 +0300 Subject: [PATCH 003/197] [#131] client: refactor netmap dialer Signed-off-by: olefirenque --- client/client.go | 29 ++++++++++++----------------- client/client_test.go | 18 ++++++++---------- 2 files changed, 20 insertions(+), 27 deletions(-) diff --git a/client/client.go b/client/client.go index 5148838..ddc9b33 100644 --- a/client/client.go +++ b/client/client.go @@ -1,18 +1,19 @@ package client import ( + "bytes" "context" "crypto/ecdsa" "crypto/tls" "errors" "fmt" - netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" "net/url" "time" v2accounting "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" "google.golang.org/grpc" ) @@ -113,29 +114,23 @@ func (c *Client) Dial(ctx context.Context, prm PrmDial) error { return nil } +func (c *Client) netMapDialNode(ctx context.Context, node *netmap.NodeInfo) error { + // TODO: implement dialing options + addresses := node.ExternalAddresses() + return c.Dial(ctx, PrmDial{Endpoint: addresses[0]}) +} + func (c *Client) NetMapDial(ctx context.Context, endpoint string) error { u, err := url.Parse(endpoint) if err != nil { return err } - isEqualSlices := func(a, b []byte) bool { - if len(a) != len(b) { - return false - } - for i := range a { - if a[i] != b[i] { - return false - } - } - return true - } - if u.Scheme == "frostfs" { - nodes := c.prm.NetMap.GetNodes() + nodes := c.prm.NetMap.Nodes() for _, node := range nodes { - if isEqualSlices([]byte(u.Host), node.PublicKey) { - return c.Dial(ctx, PrmDial{Endpoint: node.Addresses[0]}) + if bytes.Equal([]byte(u.Host), node.PublicKey()) { + return c.netMapDialNode(ctx, &node) } } } @@ -173,7 +168,7 @@ type PrmInit struct { ResponseInfoCallback func(ResponseMetaInfo) error - NetMap *netmap.Netmap + NetMap *netmap.NetMap NetMagic uint64 } diff --git a/client/client_test.go b/client/client_test.go index e09fc11..f3c97c9 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -6,10 +6,10 @@ import ( "crypto/elliptic" "crypto/rand" "fmt" - netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" "testing" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" "github.com/stretchr/testify/require" ) @@ -74,15 +74,13 @@ func TestClient_NetMapDialContext(t *testing.T) { publicKey := "foo" endpoint := "localhost:8080" - prmInit.NetMap = &netmap.Netmap{ - Epoch: 0, - Nodes: []*netmap.NodeInfo{ - { - PublicKey: []byte(publicKey), - Addresses: []string{endpoint}, - }, - }, - } + node := netmap.NodeInfo{} + node.SetPublicKey([]byte(publicKey)) + node.SetExternalAddresses(endpoint) + netMap := &netmap.NetMap{} + netMap.SetNodes([]netmap.NodeInfo{node}) + + prmInit.NetMap = netMap c.Init(prmInit) From 7b03c3a6a16a88162b39203d3aa44aba4a9398df Mon Sep 17 00:00:00 2001 From: olefirenque Date: Thu, 7 Dec 2023 11:40:03 +0300 Subject: [PATCH 004/197] [#131] client: implement dialing config Signed-off-by: olefirenque --- client/client.go | 85 +++++++++++++++++++++++++++++++++---------- client/client_test.go | 6 +-- pool/pool.go | 20 ++++++---- 3 files changed, 81 insertions(+), 30 deletions(-) diff --git a/client/client.go b/client/client.go index ddc9b33..05d2baf 100644 --- a/client/client.go +++ b/client/client.go @@ -114,13 +114,47 @@ func (c *Client) Dial(ctx context.Context, prm PrmDial) error { return nil } -func (c *Client) netMapDialNode(ctx context.Context, node *netmap.NodeInfo) error { - // TODO: implement dialing options +func (c *Client) netMapDialNode(ctx context.Context, node *netmap.NodeInfo, prm PrmNetMapDial) error { addresses := node.ExternalAddresses() - return c.Dial(ctx, PrmDial{Endpoint: addresses[0]}) + + dialAddr := func(addr string) error { + err := c.Dial(ctx, PrmDial{Endpoint: addr}) + if err != nil { + if !prm.FallbackToAvailableAddress { + return err + } + if !errors.Is(err, context.Canceled) && !errors.Is(err, context.DeadlineExceeded) { + return err + } + } + return nil + } + + if prm.UseRandomAddress { + // Use map for randomized iteration over addresses + addressesMap := make(map[string]struct{}) + for _, addr := range addresses { + addressesMap[addr] = struct{}{} + } + + for addr := range addressesMap { + err := dialAddr(addr) + if err != nil { + return err + } + } + } + + for _, addr := range addresses { + err := dialAddr(addr) + if err != nil { + return err + } + } + return nil } -func (c *Client) NetMapDial(ctx context.Context, endpoint string) error { +func (c *Client) NetMapDial(ctx context.Context, endpoint string, prm PrmNetMapDial) error { u, err := url.Parse(endpoint) if err != nil { return err @@ -130,7 +164,7 @@ func (c *Client) NetMapDial(ctx context.Context, endpoint string) error { nodes := c.prm.NetMap.Nodes() for _, node := range nodes { if bytes.Equal([]byte(u.Host), node.PublicKey()) { - return c.netMapDialNode(ctx, &node) + return c.netMapDialNode(ctx, &node, prm) } } } @@ -210,12 +244,7 @@ const ( defaultStreamTimeout = 10 * time.Second ) -// PrmDial groups connection parameters for the Client. -// -// See also Dial. -type PrmDial struct { - Endpoint string - +type PrmDialOptions struct { TLSConfig *tls.Config // If DialTimeout is non-positive, then it's set to defaultDialTimeout. @@ -227,6 +256,24 @@ type PrmDial struct { GRPCDialOptions []grpc.DialOption } +// PrmDial groups connection parameters for the Dial call in the Client. +// +// See also Dial. +type PrmDial struct { + Endpoint string + + PrmDialOptions +} + +// PrmNetMapDial groups connection parameters for the NetMapDial call in the Client. +type PrmNetMapDial struct { + UseExternalAddresses bool + UseRandomAddress bool + FallbackToAvailableAddress bool + + PrmDialOptions +} + // SetServerURI sets server URI in the FrostFS network. // Required parameter. // @@ -251,30 +298,30 @@ func (x *PrmDial) SetServerURI(endpoint string) { // // See also SetServerURI. // -// Depreacted: Use PrmDial.TLSConfig instead. -func (x *PrmDial) SetTLSConfig(tlsConfig *tls.Config) { +// Deprecated: Use PrmDialOptions.TLSConfig instead. +func (x *PrmDialOptions) SetTLSConfig(tlsConfig *tls.Config) { x.TLSConfig = tlsConfig } // SetTimeout sets the timeout for connection to be established. // MUST BE positive. If not called, 5s timeout will be used by default. // -// Deprecated: Use PrmDial.DialTimeout instead. -func (x *PrmDial) SetTimeout(timeout time.Duration) { +// Deprecated: Use PrmDialOptions.DialTimeout instead. +func (x *PrmDialOptions) SetTimeout(timeout time.Duration) { x.DialTimeout = timeout } // SetStreamTimeout sets the timeout for individual operations in streaming RPC. // MUST BE positive. If not called, 10s timeout will be used by default. // -// Deprecated: Use PrmDial.StreamTimeout instead. -func (x *PrmDial) SetStreamTimeout(timeout time.Duration) { +// Deprecated: Use PrmDialOptions.StreamTimeout instead. +func (x *PrmDialOptions) SetStreamTimeout(timeout time.Duration) { x.StreamTimeout = timeout } // SetGRPCDialOptions sets the gRPC dial options for new gRPC client connection. // -// Deprecated: Use PrmDial.GRPCDialOptions instead. -func (x *PrmDial) SetGRPCDialOptions(opts ...grpc.DialOption) { +// Deprecated: Use PrmDialOptions.GRPCDialOptions instead. +func (x *PrmDialOptions) SetGRPCDialOptions(opts ...grpc.DialOption) { x.GRPCDialOptions = opts } diff --git a/client/client_test.go b/client/client_test.go index f3c97c9..e6b7f6e 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -81,13 +81,13 @@ func TestClient_NetMapDialContext(t *testing.T) { netMap.SetNodes([]netmap.NodeInfo{node}) prmInit.NetMap = netMap - c.Init(prmInit) + prmNetMapDial := PrmNetMapDial{} + assert := func(ctx context.Context, errExpected error) { // expect particular context error according to Dial docs - //require.ErrorIs(t, c.Dial(ctx, prm), errExpected) - require.ErrorIs(t, c.NetMapDial(ctx, fmt.Sprintf("frostfs://%s", publicKey)), errExpected) + require.ErrorIs(t, c.NetMapDial(ctx, fmt.Sprintf("frostfs://%s", publicKey), prmNetMapDial), errExpected) } // create pre-abandoned context diff --git a/pool/pool.go b/pool/pool.go index 48f2ee1..1d34095 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -342,10 +342,12 @@ func (c *clientWrapper) dial(ctx context.Context) error { } prmDial := sdkClient.PrmDial{ - Endpoint: c.prm.address, - DialTimeout: c.prm.dialTimeout, - StreamTimeout: c.prm.streamTimeout, - GRPCDialOptions: c.prm.dialOptions, + Endpoint: c.prm.address, + PrmDialOptions: sdkClient.PrmDialOptions{ + DialTimeout: c.prm.dialTimeout, + StreamTimeout: c.prm.streamTimeout, + GRPCDialOptions: c.prm.dialOptions, + }, } if err = cl.Dial(ctx, prmDial); err != nil { @@ -381,10 +383,12 @@ func (c *clientWrapper) restartIfUnhealthy(ctx context.Context) (healthy, change cl.Init(prmInit) prmDial := sdkClient.PrmDial{ - Endpoint: c.prm.address, - DialTimeout: c.prm.dialTimeout, - StreamTimeout: c.prm.streamTimeout, - GRPCDialOptions: c.prm.dialOptions, + Endpoint: c.prm.address, + PrmDialOptions: sdkClient.PrmDialOptions{ + DialTimeout: c.prm.dialTimeout, + StreamTimeout: c.prm.streamTimeout, + GRPCDialOptions: c.prm.dialOptions, + }, } if err := cl.Dial(ctx, prmDial); err != nil { From aa536d4a4de0477034d8a7c76e96f975fa4eeaba Mon Sep 17 00:00:00 2001 From: olefirenque Date: Thu, 7 Dec 2023 12:14:13 +0300 Subject: [PATCH 005/197] [#131] client: pass PrmDialOptions to dial call Signed-off-by: olefirenque --- client/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/client.go b/client/client.go index 05d2baf..b849e22 100644 --- a/client/client.go +++ b/client/client.go @@ -118,7 +118,7 @@ func (c *Client) netMapDialNode(ctx context.Context, node *netmap.NodeInfo, prm addresses := node.ExternalAddresses() dialAddr := func(addr string) error { - err := c.Dial(ctx, PrmDial{Endpoint: addr}) + err := c.Dial(ctx, PrmDial{Endpoint: addr, PrmDialOptions: prm.PrmDialOptions}) if err != nil { if !prm.FallbackToAvailableAddress { return err From 110b7e41706e9a560ed69d9011def86c18d67aa6 Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Wed, 17 Jan 2024 17:42:01 +0300 Subject: [PATCH 006/197] [#200] pre-commit: Fix linter invocation target Signed-off-by: Alexander Chuprov --- .pre-commit-config.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f7f66f1..f63f3e9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,10 +18,13 @@ repos: - id: end-of-file-fixer exclude: "(.key|.interp|.tokens)$" - - repo: https://github.com/golangci/golangci-lint - rev: v1.51.2 + - repo: local hooks: - - id: golangci-lint + - id: make-lint + name: Run Make Lint + entry: make lint + language: system + pass_filenames: false - repo: https://github.com/jorisroovers/gitlint rev: v0.18.0 From 7efff9d53dc2144624131a4ef94da3d6f5055bbd Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 26 Jan 2024 12:19:07 +0300 Subject: [PATCH 007/197] [#201] .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 a5614a5..c8aa5e3 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 65b4525b3bf061848e40ccfd87ff24a93ac4e2b5 Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Fri, 26 Jan 2024 14:41:55 +0300 Subject: [PATCH 008/197] [#198] object/user: Add ScriptHash method Signed-off-by: Alexander Chuprov --- user/id.go | 5 +++++ user/id_test.go | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/user/id.go b/user/id.go index 8535b01..31ff9b6 100644 --- a/user/id.go +++ b/user/id.go @@ -72,6 +72,11 @@ func (x *ID) SetScriptHash(scriptHash util.Uint160) { copy(x.w[21:], hash.Checksum(x.w[:21])) } +// ScriptHash calculates and returns script hash of ID. +func (x *ID) ScriptHash() (util.Uint160, error) { + return util.Uint160DecodeBytesBE(x.w[1:21]) +} + // WalletBytes returns FrostFS user ID as Neo3 wallet address in a binary format. // // Return value MUST NOT be mutated: to do this, first make a copy. diff --git a/user/id_test.go b/user/id_test.go index 6b1d0f8..00b0884 100644 --- a/user/id_test.go +++ b/user/id_test.go @@ -8,6 +8,7 @@ import ( . "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user" usertest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user/test" "github.com/mr-tron/base58" + "github.com/nspcc-dev/neo-go/pkg/encoding/address" "github.com/nspcc-dev/neo-go/pkg/util" "github.com/nspcc-dev/neo-go/pkg/util/slice" "github.com/stretchr/testify/require" @@ -47,6 +48,19 @@ func TestID_SetScriptHash(t *testing.T) { require.True(t, id2.Equals(id)) } +func TestID_ScriptHash(t *testing.T) { + userID := usertest.ID() + + scriptHash, err := userID.ScriptHash() + require.NoError(t, err) + + ownerAddress := userID.EncodeToString() + decodedScriptHash, err := address.StringToUint160(ownerAddress) + require.NoError(t, err) + + require.True(t, scriptHash.Equals(decodedScriptHash)) +} + func TestV2_ID(t *testing.T) { id := usertest.ID() var m refs.OwnerID From 3a00fd51e400c8bb1acacad45f3f1ea79e6eef77 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Thu, 15 Feb 2024 15:03:22 +0300 Subject: [PATCH 009/197] [#202] go.mod: Update api-go version Signed-off-by: Dmitrii Stepanov --- go.mod | 4 ++-- go.sum | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 3ede75c..0f566af 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.20 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.15.1-0.20230802075510-964c3edb3f44 + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240215114728-2a124b95bc02 git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 git.frostfs.info/TrueCloudLab/hrw v1.2.1 @@ -17,6 +17,7 @@ require ( go.uber.org/zap v1.24.0 google.golang.org/grpc v1.55.0 google.golang.org/protobuf v1.30.0 + gopkg.in/yaml.v3 v3.0.1 ) require ( @@ -42,5 +43,4 @@ require ( 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 2f9e78f..e7f5d23 100644 --- a/go.sum +++ b/go.sum @@ -31,8 +31,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl 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-api-go/v2 v2.15.1-0.20230802075510-964c3edb3f44 h1:v6JqBD/VzZx3QSxbaXnUwnnJ1KEYheU4LzLGr3IhsAE= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.15.1-0.20230802075510-964c3edb3f44/go.mod h1:pKJJRLOChW4zDQsAt1e8k/snWKljJtpkiPfxV53ngjI= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240215114728-2a124b95bc02 h1:SAoUNpK1KBcY9NwP3ZZwDMXB5bvGCQiHxpXCw6wdpAI= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240215114728-2a124b95bc02/go.mod h1:uY0AYmCznjZdghDnAk7THFIe1Vlg531IxUcus7ZfUJI= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb h1:S/TrbOOu9qEXZRZ9/Ddw7crnxbBUQLo68PSzQWYrc9M= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb/go.mod h1:nkR5gaGeez3Zv2SE7aceP0YwxG2FzIB5cGKpQO2vV2o= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= From aa41f71dcc9880269eeb9a6ff3a23feb4e9c0af3 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Thu, 15 Feb 2024 15:10:56 +0300 Subject: [PATCH 010/197] [#202] eacl: Drop storage group test Signed-off-by: Dmitrii Stepanov --- eacl/record_test.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/eacl/record_test.go b/eacl/record_test.go index 0bdc37f..a1738fc 100644 --- a/eacl/record_test.go +++ b/eacl/record_test.go @@ -225,14 +225,6 @@ func TestReservedRecords(t *testing.T) { key: v2acl.FilterObjectType, value: "TOMBSTONE", }, - { - f: func(r *Record) { - require.True(t, typ.FromString("STORAGE_GROUP")) - r.AddObjectTypeFilter(MatchStringEqual, *typ) - }, - key: v2acl.FilterObjectType, - value: "STORAGE_GROUP", - }, } for n, testCase := range testSuit { From a86170f53af79b48315e43b7d34794ee92cf4b61 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Thu, 15 Feb 2024 15:12:22 +0300 Subject: [PATCH 011/197] [#202] object: Reset marshal data on `CutPayload` Signed-off-by: Dmitrii Stepanov --- object/object.go | 1 + 1 file changed, 1 insertion(+) diff --git a/object/object.go b/object/object.go index 2685a24..fde26ae 100644 --- a/object/object.go +++ b/object/object.go @@ -571,6 +571,7 @@ func (o *Object) CutPayload() *Object { ov2 := new(object.Object) *ov2 = *(*object.Object)(o) ov2.SetPayload(nil) + ov2.SetMarshalData(nil) return (*Object)(ov2) } From a5fab572ffa4420a55ecf137efc401fca83d980a Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Fri, 1 Mar 2024 15:16:16 +0300 Subject: [PATCH 012/197] [#206] Add session tokens for container read operations Signed-off-by: Denis Kirillov --- client/container_eacl.go | 15 +++++++++- client/container_get.go | 15 +++++++++- client/container_list.go | 15 +++++++++- pool/pool.go | 61 ++++++++++++++++++++++++---------------- pool/pool_test.go | 13 ++++----- 5 files changed, 83 insertions(+), 36 deletions(-) diff --git a/client/container_eacl.go b/client/container_eacl.go index 87d32d1..8e9fd40 100644 --- a/client/container_eacl.go +++ b/client/container_eacl.go @@ -13,6 +13,7 @@ import ( apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/eacl" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session" ) // PrmContainerEACL groups parameters of ContainerEACL operation. @@ -21,6 +22,8 @@ type PrmContainerEACL struct { XHeaders []string ContainerID *cid.ID + + Session *session.Container } // SetContainer sets identifier of the FrostFS container to read the eACL table. @@ -46,9 +49,19 @@ func (x *PrmContainerEACL) buildRequest(c *Client) (*v2container.GetExtendedACLR reqBody := new(v2container.GetExtendedACLRequestBody) reqBody.SetContainerID(&cidV2) + var meta v2session.RequestMetaHeader + writeXHeadersToMeta(x.XHeaders, &meta) + + if x.Session != nil { + var tokv2 v2session.Token + x.Session.WriteToV2(&tokv2) + + meta.SetSessionToken(&tokv2) + } + var req v2container.GetExtendedACLRequest req.SetBody(reqBody) - c.prepareRequest(&req, new(v2session.RequestMetaHeader)) + c.prepareRequest(&req, &meta) return &req, nil } diff --git a/client/container_get.go b/client/container_get.go index a6dd6f2..da8166f 100644 --- a/client/container_get.go +++ b/client/container_get.go @@ -14,6 +14,7 @@ import ( apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session" ) // PrmContainerGet groups parameters of ContainerGet operation. @@ -22,6 +23,8 @@ type PrmContainerGet struct { XHeaders []string ContainerID *cid.ID + + Session *session.Container } // SetContainer sets identifier of the container to be read. @@ -47,9 +50,19 @@ func (prm *PrmContainerGet) buildRequest(c *Client) (*v2container.GetRequest, er reqBody := new(v2container.GetRequestBody) reqBody.SetContainerID(&cidV2) + var meta v2session.RequestMetaHeader + writeXHeadersToMeta(prm.XHeaders, &meta) + + if prm.Session != nil { + var tokv2 v2session.Token + prm.Session.WriteToV2(&tokv2) + + meta.SetSessionToken(&tokv2) + } + var req v2container.GetRequest req.SetBody(reqBody) - c.prepareRequest(&req, new(v2session.RequestMetaHeader)) + c.prepareRequest(&req, &meta) return &req, nil } diff --git a/client/container_list.go b/client/container_list.go index 4e88135..6d2efb6 100644 --- a/client/container_list.go +++ b/client/container_list.go @@ -12,6 +12,7 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user" ) @@ -20,6 +21,8 @@ type PrmContainerList struct { XHeaders []string Account user.ID + + Session *session.Container } // SetAccount sets identifier of the FrostFS account to list the containers. @@ -41,9 +44,19 @@ func (x *PrmContainerList) buildRequest(c *Client) (*v2container.ListRequest, er reqBody := new(v2container.ListRequestBody) reqBody.SetOwnerID(&ownerV2) + var meta v2session.RequestMetaHeader + writeXHeadersToMeta(x.XHeaders, &meta) + + if x.Session != nil { + var tokv2 v2session.Token + x.Session.WriteToV2(&tokv2) + + meta.SetSessionToken(&tokv2) + } + var req v2container.ListRequest req.SetBody(reqBody) - c.prepareRequest(&req, new(v2session.RequestMetaHeader)) + c.prepareRequest(&req, &meta) return &req, nil } diff --git a/pool/pool.go b/pool/pool.go index 48f2ee1..0b83728 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -467,7 +467,12 @@ func (c *clientWrapper) containerPut(ctx context.Context, prm PrmContainerPut) ( idCnr := res.ID() - err = waitForContainerPresence(ctx, c, idCnr, prm.WaitParams) + getPrm := PrmContainerGet{ + ContainerID: idCnr, + Session: prm.ClientParams.Session, + } + + err = waitForContainerPresence(ctx, c, getPrm, prm.WaitParams) if err = c.handleError(ctx, nil, err); err != nil { return cid.ID{}, fmt.Errorf("wait container presence on client: %w", err) } @@ -484,6 +489,7 @@ func (c *clientWrapper) containerGet(ctx context.Context, prm PrmContainerGet) ( cliPrm := sdkClient.PrmContainerGet{ ContainerID: &prm.ContainerID, + Session: prm.Session, } start := time.Now() @@ -508,7 +514,8 @@ func (c *clientWrapper) containerList(ctx context.Context, prm PrmContainerList) } cliPrm := sdkClient.PrmContainerList{ - Account: prm.ownerID, + Account: prm.OwnerID, + Session: prm.Session, } start := time.Now() @@ -555,7 +562,12 @@ func (c *clientWrapper) containerDelete(ctx context.Context, prm PrmContainerDel return fmt.Errorf("invalid wait parameters: %w", err) } - return waitForContainerRemoved(ctx, c, &prm.ContainerID, prm.WaitParams) + getPrm := PrmContainerGet{ + ContainerID: prm.ContainerID, + Session: prm.Session, + } + + return waitForContainerRemoved(ctx, c, getPrm, prm.WaitParams) } // containerEACL invokes sdkClient.ContainerEACL parse response status to error and return result as is. @@ -567,6 +579,7 @@ func (c *clientWrapper) containerEACL(ctx context.Context, prm PrmContainerEACL) cliPrm := sdkClient.PrmContainerEACL{ ContainerID: &prm.ContainerID, + Session: prm.Session, } start := time.Now() @@ -614,12 +627,13 @@ func (c *clientWrapper) containerSetEACL(ctx context.Context, prm PrmContainerSe return fmt.Errorf("invalid wait parameters: %w", err) } - var cIDp *cid.ID - if cID, set := prm.Table.CID(); set { - cIDp = &cID + cnrID, _ := prm.Table.CID() + eaclPrm := PrmContainerEACL{ + ContainerID: cnrID, + Session: prm.Session, } - err = waitForEACLPresence(ctx, c, cIDp, &prm.Table, prm.WaitParams) + err = waitForEACLPresence(ctx, c, eaclPrm, &prm.Table, prm.WaitParams) if err = c.handleError(ctx, nil, err); err != nil { return fmt.Errorf("wait eacl presence on client: %w", err) } @@ -1624,6 +1638,8 @@ func (x *PrmContainerPut) SetWaitParams(waitParams WaitParams) { // PrmContainerGet groups parameters of GetContainer operation. type PrmContainerGet struct { ContainerID cid.ID + + Session *session.Container } // SetContainerID specifies identifier of the container to be read. @@ -1635,12 +1651,16 @@ func (prm *PrmContainerGet) SetContainerID(cnrID cid.ID) { // PrmContainerList groups parameters of ListContainers operation. type PrmContainerList struct { - ownerID user.ID + OwnerID user.ID + + Session *session.Container } // SetOwnerID specifies identifier of the FrostFS account to list the containers. +// +// Deprecated: Use PrmContainerList.OwnerID instead. func (x *PrmContainerList) SetOwnerID(ownerID user.ID) { - x.ownerID = ownerID + x.OwnerID = ownerID } // PrmContainerDelete groups parameters of DeleteContainer operation. @@ -1679,9 +1699,13 @@ func (x *PrmContainerDelete) SetWaitParams(waitParams WaitParams) { // PrmContainerEACL groups parameters of GetEACL operation. type PrmContainerEACL struct { ContainerID cid.ID + + Session *session.Container } // SetContainerID specifies identifier of the FrostFS container to read the eACL table. +// +// Deprecated: Use PrmContainerEACL.ContainerID instead. func (x *PrmContainerEACL) SetContainerID(cnrID cid.ID) { x.ContainerID = cnrID } @@ -2745,10 +2769,7 @@ func (p Pool) Statistic() Statistic { } // waitForContainerPresence waits until the container is found on the FrostFS network. -func waitForContainerPresence(ctx context.Context, cli client, cnrID cid.ID, waitParams *WaitParams) error { - var prm PrmContainerGet - prm.SetContainerID(cnrID) - +func waitForContainerPresence(ctx context.Context, cli client, prm PrmContainerGet, waitParams *WaitParams) error { return waitFor(ctx, waitParams, func(ctx context.Context) bool { _, err := cli.containerGet(ctx, prm) return err == nil @@ -2756,12 +2777,7 @@ func waitForContainerPresence(ctx context.Context, cli client, cnrID cid.ID, wai } // waitForEACLPresence waits until the container eacl is applied on the FrostFS network. -func waitForEACLPresence(ctx context.Context, cli client, cnrID *cid.ID, table *eacl.Table, waitParams *WaitParams) error { - var prm PrmContainerEACL - if cnrID != nil { - prm.ContainerID = *cnrID - } - +func waitForEACLPresence(ctx context.Context, cli client, prm PrmContainerEACL, table *eacl.Table, waitParams *WaitParams) error { return waitFor(ctx, waitParams, func(ctx context.Context) bool { eaclTable, err := cli.containerEACL(ctx, prm) if err == nil { @@ -2772,12 +2788,7 @@ func waitForEACLPresence(ctx context.Context, cli client, cnrID *cid.ID, table * } // waitForContainerRemoved waits until the container is removed from the FrostFS network. -func waitForContainerRemoved(ctx context.Context, cli client, cnrID *cid.ID, waitParams *WaitParams) error { - var prm PrmContainerGet - if cnrID != nil { - prm.SetContainerID(*cnrID) - } - +func waitForContainerRemoved(ctx context.Context, cli client, prm PrmContainerGet, waitParams *WaitParams) error { return waitFor(ctx, waitParams, func(ctx context.Context) bool { _, err := cli.containerGet(ctx, prm) return sdkClient.IsErrContainerNotFound(err) diff --git a/pool/pool_test.go b/pool/pool_test.go index e953aba..c8721b9 100644 --- a/pool/pool_test.go +++ b/pool/pool_test.go @@ -9,7 +9,6 @@ import ( "time" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" - cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" @@ -480,9 +479,7 @@ func TestWaitPresence(t *testing.T) { cancel() }() - var idCnr cid.ID - - err := waitForContainerPresence(ctx, mockCli, idCnr, &WaitParams{ + err := waitForContainerPresence(ctx, mockCli, PrmContainerGet{}, &WaitParams{ Timeout: 120 * time.Second, PollInterval: 5 * time.Second, }) @@ -492,8 +489,8 @@ func TestWaitPresence(t *testing.T) { t.Run("context deadline exceeded", func(t *testing.T) { ctx := context.Background() - var idCnr cid.ID - err := waitForContainerPresence(ctx, mockCli, idCnr, &WaitParams{ + + err := waitForContainerPresence(ctx, mockCli, PrmContainerGet{}, &WaitParams{ Timeout: 500 * time.Millisecond, PollInterval: 5 * time.Second, }) @@ -503,8 +500,8 @@ func TestWaitPresence(t *testing.T) { t.Run("ok", func(t *testing.T) { ctx := context.Background() - var idCnr cid.ID - err := waitForContainerPresence(ctx, mockCli, idCnr, &WaitParams{ + + err := waitForContainerPresence(ctx, mockCli, PrmContainerGet{}, &WaitParams{ Timeout: 10 * time.Second, PollInterval: 500 * time.Millisecond, }) From 6fe4e2541d0bf1af85ec2666c5502024d14a9237 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 1 Mar 2024 17:30:10 +0300 Subject: [PATCH 013/197] [#207] netmap: Fix string escape in PlacementPolicy.String() Signed-off-by: Evgenii Stratonikov --- netmap/policy.go | 10 +++++++--- netmap/policy_decode_test.go | 5 +++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/netmap/policy.go b/netmap/policy.go index 5d85897..e28c89e 100644 --- a/netmap/policy.go +++ b/netmap/policy.go @@ -940,10 +940,14 @@ func operationFromString(s string) (op netmap.Operation) { return } -// escapeString returns single quote wrapped string if it contains special -// characters '-' and whitespace. +// escapeString returns single quote wrapped string. +// Wrapping rules must be kept in sync with QueryLexer.g4. +// Currently only ASCII letters, digits and underscore can be parsed without quotes. func escapeString(s string) string { - if strings.ContainsAny(s, " -\t") { + for _, r := range s { + if 'a' <= r && r <= 'z' || 'A' <= r && r <= 'Z' || '0' <= r && r <= '9' || r == '_' { + continue + } return "'" + s + "'" } return s diff --git a/netmap/policy_decode_test.go b/netmap/policy_decode_test.go index c38b608..0c78fa8 100644 --- a/netmap/policy_decode_test.go +++ b/netmap/policy_decode_test.go @@ -36,6 +36,11 @@ FILTER City EQ SPB AND SSD EQ true OR City EQ SPB AND Rating GE 5 AS SPBSSD`, SELECT 1 IN City FROM SPBSSD AS SPB FILTER NOT (NOT (City EQ SPB) AND SSD EQ true OR City EQ SPB AND Rating GE 5) AS SPBSSD`, + `REP 1 IN FNODE +CBF 1 +SELECT 1 FROM F AS FNODE +FILTER Node EQ '10.78.8.11' AS F`, + `UNIQUE REP 1 REP 1`, From 6a7ef9d8c3da25779b8861d9b2544294f6d119bf Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Wed, 6 Mar 2024 13:20:50 +0300 Subject: [PATCH 014/197] [#208] 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 0f566af..fc878ff 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.8.3 go.uber.org/zap v1.24.0 google.golang.org/grpc v1.55.0 - google.golang.org/protobuf v1.30.0 + google.golang.org/protobuf v1.33.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/go.sum b/go.sum index e7f5d23..b568f15 100644 --- a/go.sum +++ b/go.sum @@ -698,8 +698,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 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/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= +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/abiosoft/ishell.v2 v2.0.0/go.mod h1:sFp+cGtH6o4s1FtpVPTMcHq2yue+c4DGOVohJCPUzwY= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 8081445ff2f3627e2885e85052ae77d8c5179131 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Wed, 6 Mar 2024 13:34:04 +0300 Subject: [PATCH 015/197] [#208] go.mod: Bump frostfs-api-go version 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 fc878ff..48c9453 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.20 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240215114728-2a124b95bc02 + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240306101814-c1c7b344b9c0 git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 git.frostfs.info/TrueCloudLab/hrw v1.2.1 diff --git a/go.sum b/go.sum index b568f15..33959db 100644 --- a/go.sum +++ b/go.sum @@ -31,8 +31,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl 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-api-go/v2 v2.16.1-0.20240215114728-2a124b95bc02 h1:SAoUNpK1KBcY9NwP3ZZwDMXB5bvGCQiHxpXCw6wdpAI= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240215114728-2a124b95bc02/go.mod h1:uY0AYmCznjZdghDnAk7THFIe1Vlg531IxUcus7ZfUJI= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240306101814-c1c7b344b9c0 h1:4iyAj9k7W29YpyzUTwMuMBbL3G3M96kMbX62OwGNGfE= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240306101814-c1c7b344b9c0/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb h1:S/TrbOOu9qEXZRZ9/Ddw7crnxbBUQLo68PSzQWYrc9M= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb/go.mod h1:nkR5gaGeez3Zv2SE7aceP0YwxG2FzIB5cGKpQO2vV2o= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= From 7212f3811576847f8c8d05cad6497fd67b487179 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 14 Mar 2024 12:25:39 +0300 Subject: [PATCH 016/197] [#209] 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 f63f3e9..c498fce 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,9 +25,3 @@ repos: entry: make lint language: system pass_filenames: false - - - repo: https://github.com/jorisroovers/gitlint - rev: v0.18.0 - hooks: - - id: gitlint - stages: [commit-msg] From 64b83f8220c0afb346e0ed7c22a5355b9f09f283 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 14 Mar 2024 12:27:43 +0300 Subject: [PATCH 017/197] [#209] Makefile: Update golangci-lint to 1.56.2 Signed-off-by: Evgenii Stratonikov --- Makefile | 2 +- pool/pool.go | 2 +- pool/tree/pool.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 84e18a9..e150980 100755 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ ANTLR_VERSION="4.13.0" TMP_DIR := .cache -LINT_VERSION ?= 1.55.0 +LINT_VERSION ?= 1.56.2 TRUECLOUDLAB_LINT_VERSION ?= 0.0.2 OUTPUT_LINT_DIR ?= $(shell pwd)/bin LINT_DIR = $(OUTPUT_LINT_DIR)/golangci-lint-$(LINT_VERSION)-v$(TRUECLOUDLAB_LINT_VERSION) diff --git a/pool/pool.go b/pool/pool.go index 0b83728..7392e48 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -2049,7 +2049,7 @@ func (p *Pool) updateNodesHealth(ctx context.Context, buffers [][]float64) { wg.Add(1) bufferWeights := buffers[i] - go func(i int, innerPool *innerPool) { + go func(i int, _ *innerPool) { defer wg.Done() p.updateInnerNodesHealth(ctx, i, bufferWeights) }(i, inner) diff --git a/pool/tree/pool.go b/pool/tree/pool.go index bffe6e9..38ef09e 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -677,7 +677,7 @@ func (p *Pool) updateNodesHealth(ctx context.Context, buffers [][]bool) { for i, inner := range p.innerPools { wg.Add(1) - go func(i int, innerPool *innerPool) { + go func(i int, _ *innerPool) { defer wg.Done() p.updateInnerNodesHealth(ctx, i, buffers[i]) }(i, inner) From d9ec7c19880772eed64170b730b6fe7cb670eca3 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 14 Mar 2024 12:29:00 +0300 Subject: [PATCH 018/197] [#209] Makefile: Allow to override test flags Signed-off-by: Evgenii Stratonikov --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e150980..0b4011f 100755 --- a/Makefile +++ b/Makefile @@ -8,8 +8,9 @@ OUTPUT_LINT_DIR ?= $(shell pwd)/bin LINT_DIR = $(OUTPUT_LINT_DIR)/golangci-lint-$(LINT_VERSION)-v$(TRUECLOUDLAB_LINT_VERSION) # Run tests +test: GOFLAGS ?= "-cover -count=1" test: - @go test ./... -cover -count=1 + @GOFLAGS=$(GOFLAGS) go test ./... # Pull go dependencies dep: From edd40474e89ad11aeb6c94b736555700764b00f8 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 14 Mar 2024 12:29:36 +0300 Subject: [PATCH 019/197] [#209] 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 c498fce..0c5b130 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,6 +18,15 @@ repos: - id: end-of-file-fixer exclude: "(.key|.interp|.tokens)$" + - repo: local + hooks: + - id: go-unit-tests + name: go unit tests + entry: make test GOFLAGS='' + pass_filenames: false + types: [go] + language: system + - repo: local hooks: - id: make-lint From 6f248436a590eb6c74514f0806557d7e569d7812 Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Tue, 19 Mar 2024 15:36:51 +0300 Subject: [PATCH 020/197] [#210] client/put_transformer: Fix error handling Signed-off-by: Alexander Chuprov --- client/object_put_transformer.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/object_put_transformer.go b/client/object_put_transformer.go index c671b55..523603c 100644 --- a/client/object_put_transformer.go +++ b/client/object_put_transformer.go @@ -47,6 +47,10 @@ func (x *objectWriterTransformer) WritePayloadChunk(ctx context.Context, chunk [ } func (x *objectWriterTransformer) Close(ctx context.Context) (*ResObjectPut, error) { + if x.err != nil { + return nil, x.err + } + ai, err := x.ot.Close(ctx) if err != nil { return nil, err From d33b54d2802adfb16bb85aa52eeae42ace67bf5b Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 20 Mar 2024 12:40:43 +0300 Subject: [PATCH 021/197] [#205] go.mod: Update api-go Signed-off-by: Evgenii Stratonikov --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 48c9453..84be6b5 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.20 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240306101814-c1c7b344b9c0 + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240319122301-1772b921826b git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 git.frostfs.info/TrueCloudLab/hrw v1.2.1 diff --git a/go.sum b/go.sum index 33959db..e11d2e8 100644 --- a/go.sum +++ b/go.sum @@ -31,8 +31,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl 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-api-go/v2 v2.16.1-0.20240306101814-c1c7b344b9c0 h1:4iyAj9k7W29YpyzUTwMuMBbL3G3M96kMbX62OwGNGfE= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240306101814-c1c7b344b9c0/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240319122301-1772b921826b h1:PoGgzbf+uU+aPJb8etqAqaeoImLYRickZyf/nQ7+vcY= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240319122301-1772b921826b/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb h1:S/TrbOOu9qEXZRZ9/Ddw7crnxbBUQLo68PSzQWYrc9M= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb/go.mod h1:nkR5gaGeez3Zv2SE7aceP0YwxG2FzIB5cGKpQO2vV2o= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= From 70e9e40c7f3d0045050b900357cd2e3d8cdbdeda Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 22 Feb 2024 22:29:25 +0300 Subject: [PATCH 022/197] [#205] netmap: Add EC statement to placement policy Signed-off-by: Evgenii Stratonikov --- netmap/netmap.go | 26 +- netmap/parser/Query.g4 | 6 +- netmap/parser/Query.interp | 7 +- netmap/parser/Query.tokens | 64 +-- netmap/parser/QueryLexer.g4 | 2 + netmap/parser/QueryLexer.interp | 8 +- netmap/parser/QueryLexer.tokens | 64 +-- netmap/parser/query_base_visitor.go | 6 +- netmap/parser/query_lexer.go | 242 +++++----- netmap/parser/query_parser.go | 711 ++++++++++++++++++++-------- netmap/parser/query_visitor.go | 5 +- netmap/policy.go | 72 ++- netmap/policy_decode_test.go | 2 + 13 files changed, 809 insertions(+), 406 deletions(-) diff --git a/netmap/netmap.go b/netmap/netmap.go index 530b06d..f0ece7d 100644 --- a/netmap/netmap.go +++ b/netmap/netmap.go @@ -209,6 +209,25 @@ func (m NetMap) SelectFilterNodes(expr *SelectFilterExpr) ([][]NodeInfo, error) return ret, nil } +func countNodes(r netmap.Replica) uint32 { + if r.GetCount() != 0 { + return r.GetCount() + } + return r.GetECDataCount() + r.GetECParityCount() +} + +func (p PlacementPolicy) isUnique() bool { + if p.unique { + return true + } + for _, r := range p.replicas { + if r.GetECDataCount() != 0 || r.GetECParityCount() != 0 { + return true + } + } + return false +} + // ContainerNodes returns two-dimensional list of nodes as a result of applying // given PlacementPolicy to the NetMap. Each line of the list corresponds to a // replica descriptor. Line order corresponds to order of ReplicaDescriptor list @@ -230,6 +249,7 @@ func (m NetMap) ContainerNodes(p PlacementPolicy, pivot []byte) ([][]NodeInfo, e return nil, err } + unique := p.isUnique() result := make([][]NodeInfo, len(p.replicas)) // Note that the cached selectors are not used when the policy contains the UNIQUE flag. @@ -240,7 +260,7 @@ func (m NetMap) ContainerNodes(p PlacementPolicy, pivot []byte) ([][]NodeInfo, e sName := p.replicas[i].GetSelector() if sName == "" && !(len(p.replicas) == 1 && len(p.selectors) == 1) { var s netmap.Selector - s.SetCount(p.replicas[i].GetCount()) + s.SetCount(countNodes(p.replicas[i])) s.SetFilter(mainFilterName) nodes, err := c.getSelection(s) @@ -250,14 +270,14 @@ func (m NetMap) ContainerNodes(p PlacementPolicy, pivot []byte) ([][]NodeInfo, e result[i] = append(result[i], flattenNodes(nodes)...) - if p.unique { + if unique { c.addUsedNodes(result[i]...) } continue } - if p.unique { + if unique { if c.processedSelectors[sName] == nil { return nil, fmt.Errorf("selector not found: '%s'", sName) } diff --git a/netmap/parser/Query.g4 b/netmap/parser/Query.g4 index 72fa880..0a5b314 100644 --- a/netmap/parser/Query.g4 +++ b/netmap/parser/Query.g4 @@ -4,10 +4,14 @@ options { tokenVocab = QueryLexer; } -policy: UNIQUE? repStmt+ cbfStmt? selectStmt* filterStmt* EOF; +policy: UNIQUE? (repStmt | ecStmt)+ cbfStmt? selectStmt* filterStmt* EOF; selectFilterExpr: cbfStmt? selectStmt? filterStmt* EOF; +ecStmt: + EC Data = NUMBER1 DOT Parity = NUMBER1 // erasure code configuration + (IN Selector = ident)?; // optional selector name + repStmt: REP Count = NUMBER1 // number of object replicas (IN Selector = ident)?; // optional selector name diff --git a/netmap/parser/Query.interp b/netmap/parser/Query.interp index a8fb219..3f7a9ad 100644 --- a/netmap/parser/Query.interp +++ b/netmap/parser/Query.interp @@ -6,6 +6,7 @@ null null 'UNIQUE' 'REP' +'EC' 'IN' 'AS' 'CBF' @@ -13,6 +14,7 @@ null 'FROM' 'FILTER' '*' +'.' 'SAME' 'DISTINCT' '(' @@ -32,6 +34,7 @@ OR_OP SIMPLE_OP UNIQUE REP +EC IN AS CBF @@ -39,6 +42,7 @@ SELECT FROM FILTER WILDCARD +DOT CLAUSE_SAME CLAUSE_DISTINCT L_PAREN @@ -53,6 +57,7 @@ WS rule names: policy selectFilterExpr +ecStmt repStmt cbfStmt selectStmt @@ -69,4 +74,4 @@ identWC atn: -[4, 1, 23, 154, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 1, 0, 3, 0, 32, 8, 0, 1, 0, 4, 0, 35, 8, 0, 11, 0, 12, 0, 36, 1, 0, 3, 0, 40, 8, 0, 1, 0, 5, 0, 43, 8, 0, 10, 0, 12, 0, 46, 9, 0, 1, 0, 5, 0, 49, 8, 0, 10, 0, 12, 0, 52, 9, 0, 1, 0, 1, 0, 1, 1, 3, 1, 57, 8, 1, 1, 1, 3, 1, 60, 8, 1, 1, 1, 5, 1, 63, 8, 1, 10, 1, 12, 1, 66, 9, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 74, 8, 2, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 83, 8, 4, 1, 4, 3, 4, 86, 8, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 92, 8, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 107, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 115, 8, 6, 10, 6, 12, 6, 118, 9, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 131, 8, 8, 1, 9, 1, 9, 3, 9, 135, 8, 9, 1, 10, 1, 10, 1, 10, 3, 10, 140, 8, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 148, 8, 13, 1, 14, 1, 14, 3, 14, 152, 8, 14, 1, 14, 0, 1, 12, 15, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 0, 3, 1, 0, 14, 15, 1, 0, 20, 21, 2, 0, 6, 8, 10, 12, 160, 0, 31, 1, 0, 0, 0, 2, 56, 1, 0, 0, 0, 4, 69, 1, 0, 0, 0, 6, 75, 1, 0, 0, 0, 8, 78, 1, 0, 0, 0, 10, 93, 1, 0, 0, 0, 12, 106, 1, 0, 0, 0, 14, 119, 1, 0, 0, 0, 16, 130, 1, 0, 0, 0, 18, 134, 1, 0, 0, 0, 20, 139, 1, 0, 0, 0, 22, 141, 1, 0, 0, 0, 24, 143, 1, 0, 0, 0, 26, 147, 1, 0, 0, 0, 28, 151, 1, 0, 0, 0, 30, 32, 5, 5, 0, 0, 31, 30, 1, 0, 0, 0, 31, 32, 1, 0, 0, 0, 32, 34, 1, 0, 0, 0, 33, 35, 3, 4, 2, 0, 34, 33, 1, 0, 0, 0, 35, 36, 1, 0, 0, 0, 36, 34, 1, 0, 0, 0, 36, 37, 1, 0, 0, 0, 37, 39, 1, 0, 0, 0, 38, 40, 3, 6, 3, 0, 39, 38, 1, 0, 0, 0, 39, 40, 1, 0, 0, 0, 40, 44, 1, 0, 0, 0, 41, 43, 3, 8, 4, 0, 42, 41, 1, 0, 0, 0, 43, 46, 1, 0, 0, 0, 44, 42, 1, 0, 0, 0, 44, 45, 1, 0, 0, 0, 45, 50, 1, 0, 0, 0, 46, 44, 1, 0, 0, 0, 47, 49, 3, 14, 7, 0, 48, 47, 1, 0, 0, 0, 49, 52, 1, 0, 0, 0, 50, 48, 1, 0, 0, 0, 50, 51, 1, 0, 0, 0, 51, 53, 1, 0, 0, 0, 52, 50, 1, 0, 0, 0, 53, 54, 5, 0, 0, 1, 54, 1, 1, 0, 0, 0, 55, 57, 3, 6, 3, 0, 56, 55, 1, 0, 0, 0, 56, 57, 1, 0, 0, 0, 57, 59, 1, 0, 0, 0, 58, 60, 3, 8, 4, 0, 59, 58, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 64, 1, 0, 0, 0, 61, 63, 3, 14, 7, 0, 62, 61, 1, 0, 0, 0, 63, 66, 1, 0, 0, 0, 64, 62, 1, 0, 0, 0, 64, 65, 1, 0, 0, 0, 65, 67, 1, 0, 0, 0, 66, 64, 1, 0, 0, 0, 67, 68, 5, 0, 0, 1, 68, 3, 1, 0, 0, 0, 69, 70, 5, 6, 0, 0, 70, 73, 5, 20, 0, 0, 71, 72, 5, 7, 0, 0, 72, 74, 3, 26, 13, 0, 73, 71, 1, 0, 0, 0, 73, 74, 1, 0, 0, 0, 74, 5, 1, 0, 0, 0, 75, 76, 5, 9, 0, 0, 76, 77, 5, 20, 0, 0, 77, 7, 1, 0, 0, 0, 78, 79, 5, 10, 0, 0, 79, 85, 5, 20, 0, 0, 80, 82, 5, 7, 0, 0, 81, 83, 3, 10, 5, 0, 82, 81, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 86, 3, 26, 13, 0, 85, 80, 1, 0, 0, 0, 85, 86, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 88, 5, 11, 0, 0, 88, 91, 3, 28, 14, 0, 89, 90, 5, 8, 0, 0, 90, 92, 3, 26, 13, 0, 91, 89, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 9, 1, 0, 0, 0, 93, 94, 7, 0, 0, 0, 94, 11, 1, 0, 0, 0, 95, 96, 6, 6, -1, 0, 96, 97, 5, 1, 0, 0, 97, 98, 5, 16, 0, 0, 98, 99, 3, 12, 6, 0, 99, 100, 5, 17, 0, 0, 100, 107, 1, 0, 0, 0, 101, 102, 5, 16, 0, 0, 102, 103, 3, 12, 6, 0, 103, 104, 5, 17, 0, 0, 104, 107, 1, 0, 0, 0, 105, 107, 3, 16, 8, 0, 106, 95, 1, 0, 0, 0, 106, 101, 1, 0, 0, 0, 106, 105, 1, 0, 0, 0, 107, 116, 1, 0, 0, 0, 108, 109, 10, 4, 0, 0, 109, 110, 5, 2, 0, 0, 110, 115, 3, 12, 6, 5, 111, 112, 10, 3, 0, 0, 112, 113, 5, 3, 0, 0, 113, 115, 3, 12, 6, 4, 114, 108, 1, 0, 0, 0, 114, 111, 1, 0, 0, 0, 115, 118, 1, 0, 0, 0, 116, 114, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 13, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 119, 120, 5, 12, 0, 0, 120, 121, 3, 12, 6, 0, 121, 122, 5, 8, 0, 0, 122, 123, 3, 26, 13, 0, 123, 15, 1, 0, 0, 0, 124, 125, 5, 18, 0, 0, 125, 131, 3, 26, 13, 0, 126, 127, 3, 18, 9, 0, 127, 128, 5, 4, 0, 0, 128, 129, 3, 20, 10, 0, 129, 131, 1, 0, 0, 0, 130, 124, 1, 0, 0, 0, 130, 126, 1, 0, 0, 0, 131, 17, 1, 0, 0, 0, 132, 135, 3, 26, 13, 0, 133, 135, 5, 22, 0, 0, 134, 132, 1, 0, 0, 0, 134, 133, 1, 0, 0, 0, 135, 19, 1, 0, 0, 0, 136, 140, 3, 26, 13, 0, 137, 140, 3, 22, 11, 0, 138, 140, 5, 22, 0, 0, 139, 136, 1, 0, 0, 0, 139, 137, 1, 0, 0, 0, 139, 138, 1, 0, 0, 0, 140, 21, 1, 0, 0, 0, 141, 142, 7, 1, 0, 0, 142, 23, 1, 0, 0, 0, 143, 144, 7, 2, 0, 0, 144, 25, 1, 0, 0, 0, 145, 148, 3, 24, 12, 0, 146, 148, 5, 19, 0, 0, 147, 145, 1, 0, 0, 0, 147, 146, 1, 0, 0, 0, 148, 27, 1, 0, 0, 0, 149, 152, 3, 26, 13, 0, 150, 152, 5, 13, 0, 0, 151, 149, 1, 0, 0, 0, 151, 150, 1, 0, 0, 0, 152, 29, 1, 0, 0, 0, 20, 31, 36, 39, 44, 50, 56, 59, 64, 73, 82, 85, 91, 106, 114, 116, 130, 134, 139, 147, 151] \ No newline at end of file +[4, 1, 25, 165, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 1, 0, 3, 0, 34, 8, 0, 1, 0, 1, 0, 4, 0, 38, 8, 0, 11, 0, 12, 0, 39, 1, 0, 3, 0, 43, 8, 0, 1, 0, 5, 0, 46, 8, 0, 10, 0, 12, 0, 49, 9, 0, 1, 0, 5, 0, 52, 8, 0, 10, 0, 12, 0, 55, 9, 0, 1, 0, 1, 0, 1, 1, 3, 1, 60, 8, 1, 1, 1, 3, 1, 63, 8, 1, 1, 1, 5, 1, 66, 8, 1, 10, 1, 12, 1, 69, 9, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 79, 8, 2, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 85, 8, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 94, 8, 5, 1, 5, 3, 5, 97, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 103, 8, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 118, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 126, 8, 7, 10, 7, 12, 7, 129, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 142, 8, 9, 1, 10, 1, 10, 3, 10, 146, 8, 10, 1, 11, 1, 11, 1, 11, 3, 11, 151, 8, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 3, 14, 159, 8, 14, 1, 15, 1, 15, 3, 15, 163, 8, 15, 1, 15, 0, 1, 14, 16, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 0, 3, 1, 0, 16, 17, 1, 0, 22, 23, 3, 0, 6, 6, 8, 9, 11, 13, 172, 0, 33, 1, 0, 0, 0, 2, 59, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 80, 1, 0, 0, 0, 8, 86, 1, 0, 0, 0, 10, 89, 1, 0, 0, 0, 12, 104, 1, 0, 0, 0, 14, 117, 1, 0, 0, 0, 16, 130, 1, 0, 0, 0, 18, 141, 1, 0, 0, 0, 20, 145, 1, 0, 0, 0, 22, 150, 1, 0, 0, 0, 24, 152, 1, 0, 0, 0, 26, 154, 1, 0, 0, 0, 28, 158, 1, 0, 0, 0, 30, 162, 1, 0, 0, 0, 32, 34, 5, 5, 0, 0, 33, 32, 1, 0, 0, 0, 33, 34, 1, 0, 0, 0, 34, 37, 1, 0, 0, 0, 35, 38, 3, 6, 3, 0, 36, 38, 3, 4, 2, 0, 37, 35, 1, 0, 0, 0, 37, 36, 1, 0, 0, 0, 38, 39, 1, 0, 0, 0, 39, 37, 1, 0, 0, 0, 39, 40, 1, 0, 0, 0, 40, 42, 1, 0, 0, 0, 41, 43, 3, 8, 4, 0, 42, 41, 1, 0, 0, 0, 42, 43, 1, 0, 0, 0, 43, 47, 1, 0, 0, 0, 44, 46, 3, 10, 5, 0, 45, 44, 1, 0, 0, 0, 46, 49, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, 47, 48, 1, 0, 0, 0, 48, 53, 1, 0, 0, 0, 49, 47, 1, 0, 0, 0, 50, 52, 3, 16, 8, 0, 51, 50, 1, 0, 0, 0, 52, 55, 1, 0, 0, 0, 53, 51, 1, 0, 0, 0, 53, 54, 1, 0, 0, 0, 54, 56, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 56, 57, 5, 0, 0, 1, 57, 1, 1, 0, 0, 0, 58, 60, 3, 8, 4, 0, 59, 58, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 62, 1, 0, 0, 0, 61, 63, 3, 10, 5, 0, 62, 61, 1, 0, 0, 0, 62, 63, 1, 0, 0, 0, 63, 67, 1, 0, 0, 0, 64, 66, 3, 16, 8, 0, 65, 64, 1, 0, 0, 0, 66, 69, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 70, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 70, 71, 5, 0, 0, 1, 71, 3, 1, 0, 0, 0, 72, 73, 5, 7, 0, 0, 73, 74, 5, 22, 0, 0, 74, 75, 5, 15, 0, 0, 75, 78, 5, 22, 0, 0, 76, 77, 5, 8, 0, 0, 77, 79, 3, 28, 14, 0, 78, 76, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 79, 5, 1, 0, 0, 0, 80, 81, 5, 6, 0, 0, 81, 84, 5, 22, 0, 0, 82, 83, 5, 8, 0, 0, 83, 85, 3, 28, 14, 0, 84, 82, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 7, 1, 0, 0, 0, 86, 87, 5, 10, 0, 0, 87, 88, 5, 22, 0, 0, 88, 9, 1, 0, 0, 0, 89, 90, 5, 11, 0, 0, 90, 96, 5, 22, 0, 0, 91, 93, 5, 8, 0, 0, 92, 94, 3, 12, 6, 0, 93, 92, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 97, 3, 28, 14, 0, 96, 91, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 99, 5, 12, 0, 0, 99, 102, 3, 30, 15, 0, 100, 101, 5, 9, 0, 0, 101, 103, 3, 28, 14, 0, 102, 100, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 11, 1, 0, 0, 0, 104, 105, 7, 0, 0, 0, 105, 13, 1, 0, 0, 0, 106, 107, 6, 7, -1, 0, 107, 108, 5, 1, 0, 0, 108, 109, 5, 18, 0, 0, 109, 110, 3, 14, 7, 0, 110, 111, 5, 19, 0, 0, 111, 118, 1, 0, 0, 0, 112, 113, 5, 18, 0, 0, 113, 114, 3, 14, 7, 0, 114, 115, 5, 19, 0, 0, 115, 118, 1, 0, 0, 0, 116, 118, 3, 18, 9, 0, 117, 106, 1, 0, 0, 0, 117, 112, 1, 0, 0, 0, 117, 116, 1, 0, 0, 0, 118, 127, 1, 0, 0, 0, 119, 120, 10, 4, 0, 0, 120, 121, 5, 2, 0, 0, 121, 126, 3, 14, 7, 5, 122, 123, 10, 3, 0, 0, 123, 124, 5, 3, 0, 0, 124, 126, 3, 14, 7, 4, 125, 119, 1, 0, 0, 0, 125, 122, 1, 0, 0, 0, 126, 129, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 127, 128, 1, 0, 0, 0, 128, 15, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 130, 131, 5, 13, 0, 0, 131, 132, 3, 14, 7, 0, 132, 133, 5, 9, 0, 0, 133, 134, 3, 28, 14, 0, 134, 17, 1, 0, 0, 0, 135, 136, 5, 20, 0, 0, 136, 142, 3, 28, 14, 0, 137, 138, 3, 20, 10, 0, 138, 139, 5, 4, 0, 0, 139, 140, 3, 22, 11, 0, 140, 142, 1, 0, 0, 0, 141, 135, 1, 0, 0, 0, 141, 137, 1, 0, 0, 0, 142, 19, 1, 0, 0, 0, 143, 146, 3, 28, 14, 0, 144, 146, 5, 24, 0, 0, 145, 143, 1, 0, 0, 0, 145, 144, 1, 0, 0, 0, 146, 21, 1, 0, 0, 0, 147, 151, 3, 28, 14, 0, 148, 151, 3, 24, 12, 0, 149, 151, 5, 24, 0, 0, 150, 147, 1, 0, 0, 0, 150, 148, 1, 0, 0, 0, 150, 149, 1, 0, 0, 0, 151, 23, 1, 0, 0, 0, 152, 153, 7, 1, 0, 0, 153, 25, 1, 0, 0, 0, 154, 155, 7, 2, 0, 0, 155, 27, 1, 0, 0, 0, 156, 159, 3, 26, 13, 0, 157, 159, 5, 21, 0, 0, 158, 156, 1, 0, 0, 0, 158, 157, 1, 0, 0, 0, 159, 29, 1, 0, 0, 0, 160, 163, 3, 28, 14, 0, 161, 163, 5, 14, 0, 0, 162, 160, 1, 0, 0, 0, 162, 161, 1, 0, 0, 0, 163, 31, 1, 0, 0, 0, 22, 33, 37, 39, 42, 47, 53, 59, 62, 67, 78, 84, 93, 96, 102, 117, 125, 127, 141, 145, 150, 158, 162] \ No newline at end of file diff --git a/netmap/parser/Query.tokens b/netmap/parser/Query.tokens index 6376ea2..b873682 100644 --- a/netmap/parser/Query.tokens +++ b/netmap/parser/Query.tokens @@ -4,38 +4,42 @@ OR_OP=3 SIMPLE_OP=4 UNIQUE=5 REP=6 -IN=7 -AS=8 -CBF=9 -SELECT=10 -FROM=11 -FILTER=12 -WILDCARD=13 -CLAUSE_SAME=14 -CLAUSE_DISTINCT=15 -L_PAREN=16 -R_PAREN=17 -AT=18 -IDENT=19 -NUMBER1=20 -ZERO=21 -STRING=22 -WS=23 +EC=7 +IN=8 +AS=9 +CBF=10 +SELECT=11 +FROM=12 +FILTER=13 +WILDCARD=14 +DOT=15 +CLAUSE_SAME=16 +CLAUSE_DISTINCT=17 +L_PAREN=18 +R_PAREN=19 +AT=20 +IDENT=21 +NUMBER1=22 +ZERO=23 +STRING=24 +WS=25 'NOT'=1 'AND'=2 'OR'=3 'UNIQUE'=5 'REP'=6 -'IN'=7 -'AS'=8 -'CBF'=9 -'SELECT'=10 -'FROM'=11 -'FILTER'=12 -'*'=13 -'SAME'=14 -'DISTINCT'=15 -'('=16 -')'=17 -'@'=18 -'0'=21 +'EC'=7 +'IN'=8 +'AS'=9 +'CBF'=10 +'SELECT'=11 +'FROM'=12 +'FILTER'=13 +'*'=14 +'.'=15 +'SAME'=16 +'DISTINCT'=17 +'('=18 +')'=19 +'@'=20 +'0'=23 diff --git a/netmap/parser/QueryLexer.g4 b/netmap/parser/QueryLexer.g4 index c9b5ae6..3e4e924 100644 --- a/netmap/parser/QueryLexer.g4 +++ b/netmap/parser/QueryLexer.g4 @@ -7,6 +7,7 @@ SIMPLE_OP : 'EQ' | 'NE' | 'GE' | 'GT' | 'LT' | 'LE'; UNIQUE : 'UNIQUE'; REP : 'REP'; +EC : 'EC'; IN : 'IN'; AS : 'AS'; CBF : 'CBF'; @@ -14,6 +15,7 @@ SELECT : 'SELECT'; FROM : 'FROM'; FILTER : 'FILTER'; WILDCARD : '*'; +DOT : '.'; CLAUSE_SAME : 'SAME'; CLAUSE_DISTINCT : 'DISTINCT'; diff --git a/netmap/parser/QueryLexer.interp b/netmap/parser/QueryLexer.interp index 95db144..c4d6296 100644 --- a/netmap/parser/QueryLexer.interp +++ b/netmap/parser/QueryLexer.interp @@ -6,6 +6,7 @@ null null 'UNIQUE' 'REP' +'EC' 'IN' 'AS' 'CBF' @@ -13,6 +14,7 @@ null 'FROM' 'FILTER' '*' +'.' 'SAME' 'DISTINCT' '(' @@ -32,6 +34,7 @@ OR_OP SIMPLE_OP UNIQUE REP +EC IN AS CBF @@ -39,6 +42,7 @@ SELECT FROM FILTER WILDCARD +DOT CLAUSE_SAME CLAUSE_DISTINCT L_PAREN @@ -57,6 +61,7 @@ OR_OP SIMPLE_OP UNIQUE REP +EC IN AS CBF @@ -64,6 +69,7 @@ SELECT FROM FILTER WILDCARD +DOT CLAUSE_SAME CLAUSE_DISTINCT L_PAREN @@ -90,4 +96,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 23, 213, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 85, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 5, 18, 152, 8, 18, 10, 18, 12, 18, 155, 9, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 163, 8, 21, 10, 21, 12, 21, 166, 9, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 5, 23, 173, 8, 23, 10, 23, 12, 23, 176, 9, 23, 1, 23, 1, 23, 1, 23, 1, 23, 5, 23, 182, 8, 23, 10, 23, 12, 23, 185, 9, 23, 1, 23, 3, 23, 188, 8, 23, 1, 24, 1, 24, 1, 24, 3, 24, 193, 8, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 4, 29, 208, 8, 29, 11, 29, 12, 29, 209, 1, 29, 1, 29, 0, 0, 30, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 0, 41, 0, 43, 20, 45, 21, 47, 22, 49, 0, 51, 0, 53, 0, 55, 0, 57, 0, 59, 23, 1, 0, 8, 1, 0, 48, 57, 3, 0, 65, 90, 95, 95, 97, 122, 1, 0, 49, 57, 9, 0, 34, 34, 39, 39, 47, 47, 92, 92, 98, 98, 102, 102, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 3, 0, 0, 31, 39, 39, 92, 92, 3, 0, 0, 31, 34, 34, 92, 92, 3, 0, 9, 10, 13, 13, 32, 32, 220, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 1, 61, 1, 0, 0, 0, 3, 65, 1, 0, 0, 0, 5, 69, 1, 0, 0, 0, 7, 84, 1, 0, 0, 0, 9, 86, 1, 0, 0, 0, 11, 93, 1, 0, 0, 0, 13, 97, 1, 0, 0, 0, 15, 100, 1, 0, 0, 0, 17, 103, 1, 0, 0, 0, 19, 107, 1, 0, 0, 0, 21, 114, 1, 0, 0, 0, 23, 119, 1, 0, 0, 0, 25, 126, 1, 0, 0, 0, 27, 128, 1, 0, 0, 0, 29, 133, 1, 0, 0, 0, 31, 142, 1, 0, 0, 0, 33, 144, 1, 0, 0, 0, 35, 146, 1, 0, 0, 0, 37, 148, 1, 0, 0, 0, 39, 156, 1, 0, 0, 0, 41, 158, 1, 0, 0, 0, 43, 160, 1, 0, 0, 0, 45, 167, 1, 0, 0, 0, 47, 187, 1, 0, 0, 0, 49, 189, 1, 0, 0, 0, 51, 194, 1, 0, 0, 0, 53, 200, 1, 0, 0, 0, 55, 202, 1, 0, 0, 0, 57, 204, 1, 0, 0, 0, 59, 207, 1, 0, 0, 0, 61, 62, 5, 78, 0, 0, 62, 63, 5, 79, 0, 0, 63, 64, 5, 84, 0, 0, 64, 2, 1, 0, 0, 0, 65, 66, 5, 65, 0, 0, 66, 67, 5, 78, 0, 0, 67, 68, 5, 68, 0, 0, 68, 4, 1, 0, 0, 0, 69, 70, 5, 79, 0, 0, 70, 71, 5, 82, 0, 0, 71, 6, 1, 0, 0, 0, 72, 73, 5, 69, 0, 0, 73, 85, 5, 81, 0, 0, 74, 75, 5, 78, 0, 0, 75, 85, 5, 69, 0, 0, 76, 77, 5, 71, 0, 0, 77, 85, 5, 69, 0, 0, 78, 79, 5, 71, 0, 0, 79, 85, 5, 84, 0, 0, 80, 81, 5, 76, 0, 0, 81, 85, 5, 84, 0, 0, 82, 83, 5, 76, 0, 0, 83, 85, 5, 69, 0, 0, 84, 72, 1, 0, 0, 0, 84, 74, 1, 0, 0, 0, 84, 76, 1, 0, 0, 0, 84, 78, 1, 0, 0, 0, 84, 80, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 85, 8, 1, 0, 0, 0, 86, 87, 5, 85, 0, 0, 87, 88, 5, 78, 0, 0, 88, 89, 5, 73, 0, 0, 89, 90, 5, 81, 0, 0, 90, 91, 5, 85, 0, 0, 91, 92, 5, 69, 0, 0, 92, 10, 1, 0, 0, 0, 93, 94, 5, 82, 0, 0, 94, 95, 5, 69, 0, 0, 95, 96, 5, 80, 0, 0, 96, 12, 1, 0, 0, 0, 97, 98, 5, 73, 0, 0, 98, 99, 5, 78, 0, 0, 99, 14, 1, 0, 0, 0, 100, 101, 5, 65, 0, 0, 101, 102, 5, 83, 0, 0, 102, 16, 1, 0, 0, 0, 103, 104, 5, 67, 0, 0, 104, 105, 5, 66, 0, 0, 105, 106, 5, 70, 0, 0, 106, 18, 1, 0, 0, 0, 107, 108, 5, 83, 0, 0, 108, 109, 5, 69, 0, 0, 109, 110, 5, 76, 0, 0, 110, 111, 5, 69, 0, 0, 111, 112, 5, 67, 0, 0, 112, 113, 5, 84, 0, 0, 113, 20, 1, 0, 0, 0, 114, 115, 5, 70, 0, 0, 115, 116, 5, 82, 0, 0, 116, 117, 5, 79, 0, 0, 117, 118, 5, 77, 0, 0, 118, 22, 1, 0, 0, 0, 119, 120, 5, 70, 0, 0, 120, 121, 5, 73, 0, 0, 121, 122, 5, 76, 0, 0, 122, 123, 5, 84, 0, 0, 123, 124, 5, 69, 0, 0, 124, 125, 5, 82, 0, 0, 125, 24, 1, 0, 0, 0, 126, 127, 5, 42, 0, 0, 127, 26, 1, 0, 0, 0, 128, 129, 5, 83, 0, 0, 129, 130, 5, 65, 0, 0, 130, 131, 5, 77, 0, 0, 131, 132, 5, 69, 0, 0, 132, 28, 1, 0, 0, 0, 133, 134, 5, 68, 0, 0, 134, 135, 5, 73, 0, 0, 135, 136, 5, 83, 0, 0, 136, 137, 5, 84, 0, 0, 137, 138, 5, 73, 0, 0, 138, 139, 5, 78, 0, 0, 139, 140, 5, 67, 0, 0, 140, 141, 5, 84, 0, 0, 141, 30, 1, 0, 0, 0, 142, 143, 5, 40, 0, 0, 143, 32, 1, 0, 0, 0, 144, 145, 5, 41, 0, 0, 145, 34, 1, 0, 0, 0, 146, 147, 5, 64, 0, 0, 147, 36, 1, 0, 0, 0, 148, 153, 3, 41, 20, 0, 149, 152, 3, 39, 19, 0, 150, 152, 3, 41, 20, 0, 151, 149, 1, 0, 0, 0, 151, 150, 1, 0, 0, 0, 152, 155, 1, 0, 0, 0, 153, 151, 1, 0, 0, 0, 153, 154, 1, 0, 0, 0, 154, 38, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 156, 157, 7, 0, 0, 0, 157, 40, 1, 0, 0, 0, 158, 159, 7, 1, 0, 0, 159, 42, 1, 0, 0, 0, 160, 164, 7, 2, 0, 0, 161, 163, 3, 39, 19, 0, 162, 161, 1, 0, 0, 0, 163, 166, 1, 0, 0, 0, 164, 162, 1, 0, 0, 0, 164, 165, 1, 0, 0, 0, 165, 44, 1, 0, 0, 0, 166, 164, 1, 0, 0, 0, 167, 168, 5, 48, 0, 0, 168, 46, 1, 0, 0, 0, 169, 174, 5, 34, 0, 0, 170, 173, 3, 49, 24, 0, 171, 173, 3, 57, 28, 0, 172, 170, 1, 0, 0, 0, 172, 171, 1, 0, 0, 0, 173, 176, 1, 0, 0, 0, 174, 172, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 177, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 177, 188, 5, 34, 0, 0, 178, 183, 5, 39, 0, 0, 179, 182, 3, 49, 24, 0, 180, 182, 3, 55, 27, 0, 181, 179, 1, 0, 0, 0, 181, 180, 1, 0, 0, 0, 182, 185, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 186, 1, 0, 0, 0, 185, 183, 1, 0, 0, 0, 186, 188, 5, 39, 0, 0, 187, 169, 1, 0, 0, 0, 187, 178, 1, 0, 0, 0, 188, 48, 1, 0, 0, 0, 189, 192, 5, 92, 0, 0, 190, 193, 7, 3, 0, 0, 191, 193, 3, 51, 25, 0, 192, 190, 1, 0, 0, 0, 192, 191, 1, 0, 0, 0, 193, 50, 1, 0, 0, 0, 194, 195, 5, 117, 0, 0, 195, 196, 3, 53, 26, 0, 196, 197, 3, 53, 26, 0, 197, 198, 3, 53, 26, 0, 198, 199, 3, 53, 26, 0, 199, 52, 1, 0, 0, 0, 200, 201, 7, 4, 0, 0, 201, 54, 1, 0, 0, 0, 202, 203, 8, 5, 0, 0, 203, 56, 1, 0, 0, 0, 204, 205, 8, 6, 0, 0, 205, 58, 1, 0, 0, 0, 206, 208, 7, 7, 0, 0, 207, 206, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, 207, 1, 0, 0, 0, 209, 210, 1, 0, 0, 0, 210, 211, 1, 0, 0, 0, 211, 212, 6, 29, 0, 0, 212, 60, 1, 0, 0, 0, 12, 0, 84, 151, 153, 164, 172, 174, 181, 183, 187, 192, 209, 1, 6, 0, 0] \ No newline at end of file +[4, 0, 25, 222, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 89, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 5, 20, 161, 8, 20, 10, 20, 12, 20, 164, 9, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 172, 8, 23, 10, 23, 12, 23, 175, 9, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 5, 25, 182, 8, 25, 10, 25, 12, 25, 185, 9, 25, 1, 25, 1, 25, 1, 25, 1, 25, 5, 25, 191, 8, 25, 10, 25, 12, 25, 194, 9, 25, 1, 25, 3, 25, 197, 8, 25, 1, 26, 1, 26, 1, 26, 3, 26, 202, 8, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 4, 31, 217, 8, 31, 11, 31, 12, 31, 218, 1, 31, 1, 31, 0, 0, 32, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 0, 45, 0, 47, 22, 49, 23, 51, 24, 53, 0, 55, 0, 57, 0, 59, 0, 61, 0, 63, 25, 1, 0, 8, 1, 0, 48, 57, 3, 0, 65, 90, 95, 95, 97, 122, 1, 0, 49, 57, 9, 0, 34, 34, 39, 39, 47, 47, 92, 92, 98, 98, 102, 102, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 3, 0, 0, 31, 39, 39, 92, 92, 3, 0, 0, 31, 34, 34, 92, 92, 3, 0, 9, 10, 13, 13, 32, 32, 229, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 1, 65, 1, 0, 0, 0, 3, 69, 1, 0, 0, 0, 5, 73, 1, 0, 0, 0, 7, 88, 1, 0, 0, 0, 9, 90, 1, 0, 0, 0, 11, 97, 1, 0, 0, 0, 13, 101, 1, 0, 0, 0, 15, 104, 1, 0, 0, 0, 17, 107, 1, 0, 0, 0, 19, 110, 1, 0, 0, 0, 21, 114, 1, 0, 0, 0, 23, 121, 1, 0, 0, 0, 25, 126, 1, 0, 0, 0, 27, 133, 1, 0, 0, 0, 29, 135, 1, 0, 0, 0, 31, 137, 1, 0, 0, 0, 33, 142, 1, 0, 0, 0, 35, 151, 1, 0, 0, 0, 37, 153, 1, 0, 0, 0, 39, 155, 1, 0, 0, 0, 41, 157, 1, 0, 0, 0, 43, 165, 1, 0, 0, 0, 45, 167, 1, 0, 0, 0, 47, 169, 1, 0, 0, 0, 49, 176, 1, 0, 0, 0, 51, 196, 1, 0, 0, 0, 53, 198, 1, 0, 0, 0, 55, 203, 1, 0, 0, 0, 57, 209, 1, 0, 0, 0, 59, 211, 1, 0, 0, 0, 61, 213, 1, 0, 0, 0, 63, 216, 1, 0, 0, 0, 65, 66, 5, 78, 0, 0, 66, 67, 5, 79, 0, 0, 67, 68, 5, 84, 0, 0, 68, 2, 1, 0, 0, 0, 69, 70, 5, 65, 0, 0, 70, 71, 5, 78, 0, 0, 71, 72, 5, 68, 0, 0, 72, 4, 1, 0, 0, 0, 73, 74, 5, 79, 0, 0, 74, 75, 5, 82, 0, 0, 75, 6, 1, 0, 0, 0, 76, 77, 5, 69, 0, 0, 77, 89, 5, 81, 0, 0, 78, 79, 5, 78, 0, 0, 79, 89, 5, 69, 0, 0, 80, 81, 5, 71, 0, 0, 81, 89, 5, 69, 0, 0, 82, 83, 5, 71, 0, 0, 83, 89, 5, 84, 0, 0, 84, 85, 5, 76, 0, 0, 85, 89, 5, 84, 0, 0, 86, 87, 5, 76, 0, 0, 87, 89, 5, 69, 0, 0, 88, 76, 1, 0, 0, 0, 88, 78, 1, 0, 0, 0, 88, 80, 1, 0, 0, 0, 88, 82, 1, 0, 0, 0, 88, 84, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 89, 8, 1, 0, 0, 0, 90, 91, 5, 85, 0, 0, 91, 92, 5, 78, 0, 0, 92, 93, 5, 73, 0, 0, 93, 94, 5, 81, 0, 0, 94, 95, 5, 85, 0, 0, 95, 96, 5, 69, 0, 0, 96, 10, 1, 0, 0, 0, 97, 98, 5, 82, 0, 0, 98, 99, 5, 69, 0, 0, 99, 100, 5, 80, 0, 0, 100, 12, 1, 0, 0, 0, 101, 102, 5, 69, 0, 0, 102, 103, 5, 67, 0, 0, 103, 14, 1, 0, 0, 0, 104, 105, 5, 73, 0, 0, 105, 106, 5, 78, 0, 0, 106, 16, 1, 0, 0, 0, 107, 108, 5, 65, 0, 0, 108, 109, 5, 83, 0, 0, 109, 18, 1, 0, 0, 0, 110, 111, 5, 67, 0, 0, 111, 112, 5, 66, 0, 0, 112, 113, 5, 70, 0, 0, 113, 20, 1, 0, 0, 0, 114, 115, 5, 83, 0, 0, 115, 116, 5, 69, 0, 0, 116, 117, 5, 76, 0, 0, 117, 118, 5, 69, 0, 0, 118, 119, 5, 67, 0, 0, 119, 120, 5, 84, 0, 0, 120, 22, 1, 0, 0, 0, 121, 122, 5, 70, 0, 0, 122, 123, 5, 82, 0, 0, 123, 124, 5, 79, 0, 0, 124, 125, 5, 77, 0, 0, 125, 24, 1, 0, 0, 0, 126, 127, 5, 70, 0, 0, 127, 128, 5, 73, 0, 0, 128, 129, 5, 76, 0, 0, 129, 130, 5, 84, 0, 0, 130, 131, 5, 69, 0, 0, 131, 132, 5, 82, 0, 0, 132, 26, 1, 0, 0, 0, 133, 134, 5, 42, 0, 0, 134, 28, 1, 0, 0, 0, 135, 136, 5, 46, 0, 0, 136, 30, 1, 0, 0, 0, 137, 138, 5, 83, 0, 0, 138, 139, 5, 65, 0, 0, 139, 140, 5, 77, 0, 0, 140, 141, 5, 69, 0, 0, 141, 32, 1, 0, 0, 0, 142, 143, 5, 68, 0, 0, 143, 144, 5, 73, 0, 0, 144, 145, 5, 83, 0, 0, 145, 146, 5, 84, 0, 0, 146, 147, 5, 73, 0, 0, 147, 148, 5, 78, 0, 0, 148, 149, 5, 67, 0, 0, 149, 150, 5, 84, 0, 0, 150, 34, 1, 0, 0, 0, 151, 152, 5, 40, 0, 0, 152, 36, 1, 0, 0, 0, 153, 154, 5, 41, 0, 0, 154, 38, 1, 0, 0, 0, 155, 156, 5, 64, 0, 0, 156, 40, 1, 0, 0, 0, 157, 162, 3, 45, 22, 0, 158, 161, 3, 43, 21, 0, 159, 161, 3, 45, 22, 0, 160, 158, 1, 0, 0, 0, 160, 159, 1, 0, 0, 0, 161, 164, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 42, 1, 0, 0, 0, 164, 162, 1, 0, 0, 0, 165, 166, 7, 0, 0, 0, 166, 44, 1, 0, 0, 0, 167, 168, 7, 1, 0, 0, 168, 46, 1, 0, 0, 0, 169, 173, 7, 2, 0, 0, 170, 172, 3, 43, 21, 0, 171, 170, 1, 0, 0, 0, 172, 175, 1, 0, 0, 0, 173, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 48, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 176, 177, 5, 48, 0, 0, 177, 50, 1, 0, 0, 0, 178, 183, 5, 34, 0, 0, 179, 182, 3, 53, 26, 0, 180, 182, 3, 61, 30, 0, 181, 179, 1, 0, 0, 0, 181, 180, 1, 0, 0, 0, 182, 185, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 186, 1, 0, 0, 0, 185, 183, 1, 0, 0, 0, 186, 197, 5, 34, 0, 0, 187, 192, 5, 39, 0, 0, 188, 191, 3, 53, 26, 0, 189, 191, 3, 59, 29, 0, 190, 188, 1, 0, 0, 0, 190, 189, 1, 0, 0, 0, 191, 194, 1, 0, 0, 0, 192, 190, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 195, 1, 0, 0, 0, 194, 192, 1, 0, 0, 0, 195, 197, 5, 39, 0, 0, 196, 178, 1, 0, 0, 0, 196, 187, 1, 0, 0, 0, 197, 52, 1, 0, 0, 0, 198, 201, 5, 92, 0, 0, 199, 202, 7, 3, 0, 0, 200, 202, 3, 55, 27, 0, 201, 199, 1, 0, 0, 0, 201, 200, 1, 0, 0, 0, 202, 54, 1, 0, 0, 0, 203, 204, 5, 117, 0, 0, 204, 205, 3, 57, 28, 0, 205, 206, 3, 57, 28, 0, 206, 207, 3, 57, 28, 0, 207, 208, 3, 57, 28, 0, 208, 56, 1, 0, 0, 0, 209, 210, 7, 4, 0, 0, 210, 58, 1, 0, 0, 0, 211, 212, 8, 5, 0, 0, 212, 60, 1, 0, 0, 0, 213, 214, 8, 6, 0, 0, 214, 62, 1, 0, 0, 0, 215, 217, 7, 7, 0, 0, 216, 215, 1, 0, 0, 0, 217, 218, 1, 0, 0, 0, 218, 216, 1, 0, 0, 0, 218, 219, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 221, 6, 31, 0, 0, 221, 64, 1, 0, 0, 0, 12, 0, 88, 160, 162, 173, 181, 183, 190, 192, 196, 201, 218, 1, 6, 0, 0] \ No newline at end of file diff --git a/netmap/parser/QueryLexer.tokens b/netmap/parser/QueryLexer.tokens index 6376ea2..b873682 100644 --- a/netmap/parser/QueryLexer.tokens +++ b/netmap/parser/QueryLexer.tokens @@ -4,38 +4,42 @@ OR_OP=3 SIMPLE_OP=4 UNIQUE=5 REP=6 -IN=7 -AS=8 -CBF=9 -SELECT=10 -FROM=11 -FILTER=12 -WILDCARD=13 -CLAUSE_SAME=14 -CLAUSE_DISTINCT=15 -L_PAREN=16 -R_PAREN=17 -AT=18 -IDENT=19 -NUMBER1=20 -ZERO=21 -STRING=22 -WS=23 +EC=7 +IN=8 +AS=9 +CBF=10 +SELECT=11 +FROM=12 +FILTER=13 +WILDCARD=14 +DOT=15 +CLAUSE_SAME=16 +CLAUSE_DISTINCT=17 +L_PAREN=18 +R_PAREN=19 +AT=20 +IDENT=21 +NUMBER1=22 +ZERO=23 +STRING=24 +WS=25 'NOT'=1 'AND'=2 'OR'=3 'UNIQUE'=5 'REP'=6 -'IN'=7 -'AS'=8 -'CBF'=9 -'SELECT'=10 -'FROM'=11 -'FILTER'=12 -'*'=13 -'SAME'=14 -'DISTINCT'=15 -'('=16 -')'=17 -'@'=18 -'0'=21 +'EC'=7 +'IN'=8 +'AS'=9 +'CBF'=10 +'SELECT'=11 +'FROM'=12 +'FILTER'=13 +'*'=14 +'.'=15 +'SAME'=16 +'DISTINCT'=17 +'('=18 +')'=19 +'@'=20 +'0'=23 diff --git a/netmap/parser/query_base_visitor.go b/netmap/parser/query_base_visitor.go index 981106f..5816dfe 100644 --- a/netmap/parser/query_base_visitor.go +++ b/netmap/parser/query_base_visitor.go @@ -1,4 +1,4 @@ -// Code generated from Query.g4 by ANTLR 4.13.0. DO NOT EDIT. +// Code generated from /repo/frostfs/sdk-go/netmap/parser/Query.g4 by ANTLR 4.13.0. DO NOT EDIT. package parser // Query @@ -16,6 +16,10 @@ func (v *BaseQueryVisitor) VisitSelectFilterExpr(ctx *SelectFilterExprContext) i return v.VisitChildren(ctx) } +func (v *BaseQueryVisitor) VisitEcStmt(ctx *EcStmtContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BaseQueryVisitor) VisitRepStmt(ctx *RepStmtContext) interface{} { return v.VisitChildren(ctx) } diff --git a/netmap/parser/query_lexer.go b/netmap/parser/query_lexer.go index c1ae141..85a0336 100644 --- a/netmap/parser/query_lexer.go +++ b/netmap/parser/query_lexer.go @@ -1,4 +1,4 @@ -// Code generated from QueryLexer.g4 by ANTLR 4.13.0. DO NOT EDIT. +// Code generated from /repo/frostfs/sdk-go/netmap/parser/QueryLexer.g4 by ANTLR 4.13.0. DO NOT EDIT. package parser @@ -43,119 +43,123 @@ func querylexerLexerInit() { "DEFAULT_MODE", } staticData.LiteralNames = []string{ - "", "'NOT'", "'AND'", "'OR'", "", "'UNIQUE'", "'REP'", "'IN'", "'AS'", - "'CBF'", "'SELECT'", "'FROM'", "'FILTER'", "'*'", "'SAME'", "'DISTINCT'", - "'('", "')'", "'@'", "", "", "'0'", + "", "'NOT'", "'AND'", "'OR'", "", "'UNIQUE'", "'REP'", "'EC'", "'IN'", + "'AS'", "'CBF'", "'SELECT'", "'FROM'", "'FILTER'", "'*'", "'.'", "'SAME'", + "'DISTINCT'", "'('", "')'", "'@'", "", "", "'0'", } staticData.SymbolicNames = []string{ - "", "NOT_OP", "AND_OP", "OR_OP", "SIMPLE_OP", "UNIQUE", "REP", "IN", - "AS", "CBF", "SELECT", "FROM", "FILTER", "WILDCARD", "CLAUSE_SAME", + "", "NOT_OP", "AND_OP", "OR_OP", "SIMPLE_OP", "UNIQUE", "REP", "EC", + "IN", "AS", "CBF", "SELECT", "FROM", "FILTER", "WILDCARD", "DOT", "CLAUSE_SAME", "CLAUSE_DISTINCT", "L_PAREN", "R_PAREN", "AT", "IDENT", "NUMBER1", "ZERO", "STRING", "WS", } staticData.RuleNames = []string{ - "NOT_OP", "AND_OP", "OR_OP", "SIMPLE_OP", "UNIQUE", "REP", "IN", "AS", - "CBF", "SELECT", "FROM", "FILTER", "WILDCARD", "CLAUSE_SAME", "CLAUSE_DISTINCT", - "L_PAREN", "R_PAREN", "AT", "IDENT", "Digit", "Nondigit", "NUMBER1", - "ZERO", "STRING", "ESC", "UNICODE", "HEX", "SAFECODEPOINTSINGLE", "SAFECODEPOINTDOUBLE", - "WS", + "NOT_OP", "AND_OP", "OR_OP", "SIMPLE_OP", "UNIQUE", "REP", "EC", "IN", + "AS", "CBF", "SELECT", "FROM", "FILTER", "WILDCARD", "DOT", "CLAUSE_SAME", + "CLAUSE_DISTINCT", "L_PAREN", "R_PAREN", "AT", "IDENT", "Digit", "Nondigit", + "NUMBER1", "ZERO", "STRING", "ESC", "UNICODE", "HEX", "SAFECODEPOINTSINGLE", + "SAFECODEPOINTDOUBLE", "WS", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 23, 213, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 0, 25, 222, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, - 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 1, 0, 1, 0, 1, - 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 85, 8, 3, 1, 4, - 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, - 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, - 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, - 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, - 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, - 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 5, 18, 152, 8, - 18, 10, 18, 12, 18, 155, 9, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, - 5, 21, 163, 8, 21, 10, 21, 12, 21, 166, 9, 21, 1, 22, 1, 22, 1, 23, 1, - 23, 1, 23, 5, 23, 173, 8, 23, 10, 23, 12, 23, 176, 9, 23, 1, 23, 1, 23, - 1, 23, 1, 23, 5, 23, 182, 8, 23, 10, 23, 12, 23, 185, 9, 23, 1, 23, 3, - 23, 188, 8, 23, 1, 24, 1, 24, 1, 24, 3, 24, 193, 8, 24, 1, 25, 1, 25, 1, - 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, - 4, 29, 208, 8, 29, 11, 29, 12, 29, 209, 1, 29, 1, 29, 0, 0, 30, 1, 1, 3, - 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, - 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 0, 41, 0, 43, - 20, 45, 21, 47, 22, 49, 0, 51, 0, 53, 0, 55, 0, 57, 0, 59, 23, 1, 0, 8, - 1, 0, 48, 57, 3, 0, 65, 90, 95, 95, 97, 122, 1, 0, 49, 57, 9, 0, 34, 34, - 39, 39, 47, 47, 92, 92, 98, 98, 102, 102, 110, 110, 114, 114, 116, 116, - 3, 0, 48, 57, 65, 70, 97, 102, 3, 0, 0, 31, 39, 39, 92, 92, 3, 0, 0, 31, - 34, 34, 92, 92, 3, 0, 9, 10, 13, 13, 32, 32, 220, 0, 1, 1, 0, 0, 0, 0, - 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, - 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, - 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, - 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, - 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, - 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 1, 61, 1, 0, 0, 0, 3, 65, - 1, 0, 0, 0, 5, 69, 1, 0, 0, 0, 7, 84, 1, 0, 0, 0, 9, 86, 1, 0, 0, 0, 11, - 93, 1, 0, 0, 0, 13, 97, 1, 0, 0, 0, 15, 100, 1, 0, 0, 0, 17, 103, 1, 0, - 0, 0, 19, 107, 1, 0, 0, 0, 21, 114, 1, 0, 0, 0, 23, 119, 1, 0, 0, 0, 25, - 126, 1, 0, 0, 0, 27, 128, 1, 0, 0, 0, 29, 133, 1, 0, 0, 0, 31, 142, 1, - 0, 0, 0, 33, 144, 1, 0, 0, 0, 35, 146, 1, 0, 0, 0, 37, 148, 1, 0, 0, 0, - 39, 156, 1, 0, 0, 0, 41, 158, 1, 0, 0, 0, 43, 160, 1, 0, 0, 0, 45, 167, - 1, 0, 0, 0, 47, 187, 1, 0, 0, 0, 49, 189, 1, 0, 0, 0, 51, 194, 1, 0, 0, - 0, 53, 200, 1, 0, 0, 0, 55, 202, 1, 0, 0, 0, 57, 204, 1, 0, 0, 0, 59, 207, - 1, 0, 0, 0, 61, 62, 5, 78, 0, 0, 62, 63, 5, 79, 0, 0, 63, 64, 5, 84, 0, - 0, 64, 2, 1, 0, 0, 0, 65, 66, 5, 65, 0, 0, 66, 67, 5, 78, 0, 0, 67, 68, - 5, 68, 0, 0, 68, 4, 1, 0, 0, 0, 69, 70, 5, 79, 0, 0, 70, 71, 5, 82, 0, - 0, 71, 6, 1, 0, 0, 0, 72, 73, 5, 69, 0, 0, 73, 85, 5, 81, 0, 0, 74, 75, - 5, 78, 0, 0, 75, 85, 5, 69, 0, 0, 76, 77, 5, 71, 0, 0, 77, 85, 5, 69, 0, - 0, 78, 79, 5, 71, 0, 0, 79, 85, 5, 84, 0, 0, 80, 81, 5, 76, 0, 0, 81, 85, - 5, 84, 0, 0, 82, 83, 5, 76, 0, 0, 83, 85, 5, 69, 0, 0, 84, 72, 1, 0, 0, - 0, 84, 74, 1, 0, 0, 0, 84, 76, 1, 0, 0, 0, 84, 78, 1, 0, 0, 0, 84, 80, - 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 85, 8, 1, 0, 0, 0, 86, 87, 5, 85, 0, 0, - 87, 88, 5, 78, 0, 0, 88, 89, 5, 73, 0, 0, 89, 90, 5, 81, 0, 0, 90, 91, - 5, 85, 0, 0, 91, 92, 5, 69, 0, 0, 92, 10, 1, 0, 0, 0, 93, 94, 5, 82, 0, - 0, 94, 95, 5, 69, 0, 0, 95, 96, 5, 80, 0, 0, 96, 12, 1, 0, 0, 0, 97, 98, - 5, 73, 0, 0, 98, 99, 5, 78, 0, 0, 99, 14, 1, 0, 0, 0, 100, 101, 5, 65, - 0, 0, 101, 102, 5, 83, 0, 0, 102, 16, 1, 0, 0, 0, 103, 104, 5, 67, 0, 0, - 104, 105, 5, 66, 0, 0, 105, 106, 5, 70, 0, 0, 106, 18, 1, 0, 0, 0, 107, - 108, 5, 83, 0, 0, 108, 109, 5, 69, 0, 0, 109, 110, 5, 76, 0, 0, 110, 111, - 5, 69, 0, 0, 111, 112, 5, 67, 0, 0, 112, 113, 5, 84, 0, 0, 113, 20, 1, - 0, 0, 0, 114, 115, 5, 70, 0, 0, 115, 116, 5, 82, 0, 0, 116, 117, 5, 79, - 0, 0, 117, 118, 5, 77, 0, 0, 118, 22, 1, 0, 0, 0, 119, 120, 5, 70, 0, 0, - 120, 121, 5, 73, 0, 0, 121, 122, 5, 76, 0, 0, 122, 123, 5, 84, 0, 0, 123, - 124, 5, 69, 0, 0, 124, 125, 5, 82, 0, 0, 125, 24, 1, 0, 0, 0, 126, 127, - 5, 42, 0, 0, 127, 26, 1, 0, 0, 0, 128, 129, 5, 83, 0, 0, 129, 130, 5, 65, - 0, 0, 130, 131, 5, 77, 0, 0, 131, 132, 5, 69, 0, 0, 132, 28, 1, 0, 0, 0, - 133, 134, 5, 68, 0, 0, 134, 135, 5, 73, 0, 0, 135, 136, 5, 83, 0, 0, 136, - 137, 5, 84, 0, 0, 137, 138, 5, 73, 0, 0, 138, 139, 5, 78, 0, 0, 139, 140, - 5, 67, 0, 0, 140, 141, 5, 84, 0, 0, 141, 30, 1, 0, 0, 0, 142, 143, 5, 40, - 0, 0, 143, 32, 1, 0, 0, 0, 144, 145, 5, 41, 0, 0, 145, 34, 1, 0, 0, 0, - 146, 147, 5, 64, 0, 0, 147, 36, 1, 0, 0, 0, 148, 153, 3, 41, 20, 0, 149, - 152, 3, 39, 19, 0, 150, 152, 3, 41, 20, 0, 151, 149, 1, 0, 0, 0, 151, 150, - 1, 0, 0, 0, 152, 155, 1, 0, 0, 0, 153, 151, 1, 0, 0, 0, 153, 154, 1, 0, - 0, 0, 154, 38, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 156, 157, 7, 0, 0, 0, - 157, 40, 1, 0, 0, 0, 158, 159, 7, 1, 0, 0, 159, 42, 1, 0, 0, 0, 160, 164, - 7, 2, 0, 0, 161, 163, 3, 39, 19, 0, 162, 161, 1, 0, 0, 0, 163, 166, 1, - 0, 0, 0, 164, 162, 1, 0, 0, 0, 164, 165, 1, 0, 0, 0, 165, 44, 1, 0, 0, - 0, 166, 164, 1, 0, 0, 0, 167, 168, 5, 48, 0, 0, 168, 46, 1, 0, 0, 0, 169, - 174, 5, 34, 0, 0, 170, 173, 3, 49, 24, 0, 171, 173, 3, 57, 28, 0, 172, - 170, 1, 0, 0, 0, 172, 171, 1, 0, 0, 0, 173, 176, 1, 0, 0, 0, 174, 172, - 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 177, 1, 0, 0, 0, 176, 174, 1, 0, - 0, 0, 177, 188, 5, 34, 0, 0, 178, 183, 5, 39, 0, 0, 179, 182, 3, 49, 24, - 0, 180, 182, 3, 55, 27, 0, 181, 179, 1, 0, 0, 0, 181, 180, 1, 0, 0, 0, - 182, 185, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, - 186, 1, 0, 0, 0, 185, 183, 1, 0, 0, 0, 186, 188, 5, 39, 0, 0, 187, 169, - 1, 0, 0, 0, 187, 178, 1, 0, 0, 0, 188, 48, 1, 0, 0, 0, 189, 192, 5, 92, - 0, 0, 190, 193, 7, 3, 0, 0, 191, 193, 3, 51, 25, 0, 192, 190, 1, 0, 0, - 0, 192, 191, 1, 0, 0, 0, 193, 50, 1, 0, 0, 0, 194, 195, 5, 117, 0, 0, 195, - 196, 3, 53, 26, 0, 196, 197, 3, 53, 26, 0, 197, 198, 3, 53, 26, 0, 198, - 199, 3, 53, 26, 0, 199, 52, 1, 0, 0, 0, 200, 201, 7, 4, 0, 0, 201, 54, - 1, 0, 0, 0, 202, 203, 8, 5, 0, 0, 203, 56, 1, 0, 0, 0, 204, 205, 8, 6, - 0, 0, 205, 58, 1, 0, 0, 0, 206, 208, 7, 7, 0, 0, 207, 206, 1, 0, 0, 0, - 208, 209, 1, 0, 0, 0, 209, 207, 1, 0, 0, 0, 209, 210, 1, 0, 0, 0, 210, - 211, 1, 0, 0, 0, 211, 212, 6, 29, 0, 0, 212, 60, 1, 0, 0, 0, 12, 0, 84, - 151, 153, 164, 172, 174, 181, 183, 187, 192, 209, 1, 6, 0, 0, + 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, + 31, 7, 31, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, + 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, + 1, 3, 3, 3, 89, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, + 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, + 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, + 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, + 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, + 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, + 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 5, 20, 161, 8, 20, 10, + 20, 12, 20, 164, 9, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, + 172, 8, 23, 10, 23, 12, 23, 175, 9, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, + 25, 5, 25, 182, 8, 25, 10, 25, 12, 25, 185, 9, 25, 1, 25, 1, 25, 1, 25, + 1, 25, 5, 25, 191, 8, 25, 10, 25, 12, 25, 194, 9, 25, 1, 25, 3, 25, 197, + 8, 25, 1, 26, 1, 26, 1, 26, 3, 26, 202, 8, 26, 1, 27, 1, 27, 1, 27, 1, + 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 4, 31, + 217, 8, 31, 11, 31, 12, 31, 218, 1, 31, 1, 31, 0, 0, 32, 1, 1, 3, 2, 5, + 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, + 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, + 0, 45, 0, 47, 22, 49, 23, 51, 24, 53, 0, 55, 0, 57, 0, 59, 0, 61, 0, 63, + 25, 1, 0, 8, 1, 0, 48, 57, 3, 0, 65, 90, 95, 95, 97, 122, 1, 0, 49, 57, + 9, 0, 34, 34, 39, 39, 47, 47, 92, 92, 98, 98, 102, 102, 110, 110, 114, + 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 3, 0, 0, 31, 39, 39, 92, + 92, 3, 0, 0, 31, 34, 34, 92, 92, 3, 0, 9, 10, 13, 13, 32, 32, 229, 0, 1, + 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, + 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, + 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, + 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, + 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, + 0, 0, 0, 41, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, + 0, 0, 0, 0, 63, 1, 0, 0, 0, 1, 65, 1, 0, 0, 0, 3, 69, 1, 0, 0, 0, 5, 73, + 1, 0, 0, 0, 7, 88, 1, 0, 0, 0, 9, 90, 1, 0, 0, 0, 11, 97, 1, 0, 0, 0, 13, + 101, 1, 0, 0, 0, 15, 104, 1, 0, 0, 0, 17, 107, 1, 0, 0, 0, 19, 110, 1, + 0, 0, 0, 21, 114, 1, 0, 0, 0, 23, 121, 1, 0, 0, 0, 25, 126, 1, 0, 0, 0, + 27, 133, 1, 0, 0, 0, 29, 135, 1, 0, 0, 0, 31, 137, 1, 0, 0, 0, 33, 142, + 1, 0, 0, 0, 35, 151, 1, 0, 0, 0, 37, 153, 1, 0, 0, 0, 39, 155, 1, 0, 0, + 0, 41, 157, 1, 0, 0, 0, 43, 165, 1, 0, 0, 0, 45, 167, 1, 0, 0, 0, 47, 169, + 1, 0, 0, 0, 49, 176, 1, 0, 0, 0, 51, 196, 1, 0, 0, 0, 53, 198, 1, 0, 0, + 0, 55, 203, 1, 0, 0, 0, 57, 209, 1, 0, 0, 0, 59, 211, 1, 0, 0, 0, 61, 213, + 1, 0, 0, 0, 63, 216, 1, 0, 0, 0, 65, 66, 5, 78, 0, 0, 66, 67, 5, 79, 0, + 0, 67, 68, 5, 84, 0, 0, 68, 2, 1, 0, 0, 0, 69, 70, 5, 65, 0, 0, 70, 71, + 5, 78, 0, 0, 71, 72, 5, 68, 0, 0, 72, 4, 1, 0, 0, 0, 73, 74, 5, 79, 0, + 0, 74, 75, 5, 82, 0, 0, 75, 6, 1, 0, 0, 0, 76, 77, 5, 69, 0, 0, 77, 89, + 5, 81, 0, 0, 78, 79, 5, 78, 0, 0, 79, 89, 5, 69, 0, 0, 80, 81, 5, 71, 0, + 0, 81, 89, 5, 69, 0, 0, 82, 83, 5, 71, 0, 0, 83, 89, 5, 84, 0, 0, 84, 85, + 5, 76, 0, 0, 85, 89, 5, 84, 0, 0, 86, 87, 5, 76, 0, 0, 87, 89, 5, 69, 0, + 0, 88, 76, 1, 0, 0, 0, 88, 78, 1, 0, 0, 0, 88, 80, 1, 0, 0, 0, 88, 82, + 1, 0, 0, 0, 88, 84, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 89, 8, 1, 0, 0, 0, + 90, 91, 5, 85, 0, 0, 91, 92, 5, 78, 0, 0, 92, 93, 5, 73, 0, 0, 93, 94, + 5, 81, 0, 0, 94, 95, 5, 85, 0, 0, 95, 96, 5, 69, 0, 0, 96, 10, 1, 0, 0, + 0, 97, 98, 5, 82, 0, 0, 98, 99, 5, 69, 0, 0, 99, 100, 5, 80, 0, 0, 100, + 12, 1, 0, 0, 0, 101, 102, 5, 69, 0, 0, 102, 103, 5, 67, 0, 0, 103, 14, + 1, 0, 0, 0, 104, 105, 5, 73, 0, 0, 105, 106, 5, 78, 0, 0, 106, 16, 1, 0, + 0, 0, 107, 108, 5, 65, 0, 0, 108, 109, 5, 83, 0, 0, 109, 18, 1, 0, 0, 0, + 110, 111, 5, 67, 0, 0, 111, 112, 5, 66, 0, 0, 112, 113, 5, 70, 0, 0, 113, + 20, 1, 0, 0, 0, 114, 115, 5, 83, 0, 0, 115, 116, 5, 69, 0, 0, 116, 117, + 5, 76, 0, 0, 117, 118, 5, 69, 0, 0, 118, 119, 5, 67, 0, 0, 119, 120, 5, + 84, 0, 0, 120, 22, 1, 0, 0, 0, 121, 122, 5, 70, 0, 0, 122, 123, 5, 82, + 0, 0, 123, 124, 5, 79, 0, 0, 124, 125, 5, 77, 0, 0, 125, 24, 1, 0, 0, 0, + 126, 127, 5, 70, 0, 0, 127, 128, 5, 73, 0, 0, 128, 129, 5, 76, 0, 0, 129, + 130, 5, 84, 0, 0, 130, 131, 5, 69, 0, 0, 131, 132, 5, 82, 0, 0, 132, 26, + 1, 0, 0, 0, 133, 134, 5, 42, 0, 0, 134, 28, 1, 0, 0, 0, 135, 136, 5, 46, + 0, 0, 136, 30, 1, 0, 0, 0, 137, 138, 5, 83, 0, 0, 138, 139, 5, 65, 0, 0, + 139, 140, 5, 77, 0, 0, 140, 141, 5, 69, 0, 0, 141, 32, 1, 0, 0, 0, 142, + 143, 5, 68, 0, 0, 143, 144, 5, 73, 0, 0, 144, 145, 5, 83, 0, 0, 145, 146, + 5, 84, 0, 0, 146, 147, 5, 73, 0, 0, 147, 148, 5, 78, 0, 0, 148, 149, 5, + 67, 0, 0, 149, 150, 5, 84, 0, 0, 150, 34, 1, 0, 0, 0, 151, 152, 5, 40, + 0, 0, 152, 36, 1, 0, 0, 0, 153, 154, 5, 41, 0, 0, 154, 38, 1, 0, 0, 0, + 155, 156, 5, 64, 0, 0, 156, 40, 1, 0, 0, 0, 157, 162, 3, 45, 22, 0, 158, + 161, 3, 43, 21, 0, 159, 161, 3, 45, 22, 0, 160, 158, 1, 0, 0, 0, 160, 159, + 1, 0, 0, 0, 161, 164, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 162, 163, 1, 0, + 0, 0, 163, 42, 1, 0, 0, 0, 164, 162, 1, 0, 0, 0, 165, 166, 7, 0, 0, 0, + 166, 44, 1, 0, 0, 0, 167, 168, 7, 1, 0, 0, 168, 46, 1, 0, 0, 0, 169, 173, + 7, 2, 0, 0, 170, 172, 3, 43, 21, 0, 171, 170, 1, 0, 0, 0, 172, 175, 1, + 0, 0, 0, 173, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 48, 1, 0, 0, + 0, 175, 173, 1, 0, 0, 0, 176, 177, 5, 48, 0, 0, 177, 50, 1, 0, 0, 0, 178, + 183, 5, 34, 0, 0, 179, 182, 3, 53, 26, 0, 180, 182, 3, 61, 30, 0, 181, + 179, 1, 0, 0, 0, 181, 180, 1, 0, 0, 0, 182, 185, 1, 0, 0, 0, 183, 181, + 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 186, 1, 0, 0, 0, 185, 183, 1, 0, + 0, 0, 186, 197, 5, 34, 0, 0, 187, 192, 5, 39, 0, 0, 188, 191, 3, 53, 26, + 0, 189, 191, 3, 59, 29, 0, 190, 188, 1, 0, 0, 0, 190, 189, 1, 0, 0, 0, + 191, 194, 1, 0, 0, 0, 192, 190, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, + 195, 1, 0, 0, 0, 194, 192, 1, 0, 0, 0, 195, 197, 5, 39, 0, 0, 196, 178, + 1, 0, 0, 0, 196, 187, 1, 0, 0, 0, 197, 52, 1, 0, 0, 0, 198, 201, 5, 92, + 0, 0, 199, 202, 7, 3, 0, 0, 200, 202, 3, 55, 27, 0, 201, 199, 1, 0, 0, + 0, 201, 200, 1, 0, 0, 0, 202, 54, 1, 0, 0, 0, 203, 204, 5, 117, 0, 0, 204, + 205, 3, 57, 28, 0, 205, 206, 3, 57, 28, 0, 206, 207, 3, 57, 28, 0, 207, + 208, 3, 57, 28, 0, 208, 56, 1, 0, 0, 0, 209, 210, 7, 4, 0, 0, 210, 58, + 1, 0, 0, 0, 211, 212, 8, 5, 0, 0, 212, 60, 1, 0, 0, 0, 213, 214, 8, 6, + 0, 0, 214, 62, 1, 0, 0, 0, 215, 217, 7, 7, 0, 0, 216, 215, 1, 0, 0, 0, + 217, 218, 1, 0, 0, 0, 218, 216, 1, 0, 0, 0, 218, 219, 1, 0, 0, 0, 219, + 220, 1, 0, 0, 0, 220, 221, 6, 31, 0, 0, 221, 64, 1, 0, 0, 0, 12, 0, 88, + 160, 162, 173, 181, 183, 190, 192, 196, 201, 218, 1, 6, 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -202,21 +206,23 @@ const ( QueryLexerSIMPLE_OP = 4 QueryLexerUNIQUE = 5 QueryLexerREP = 6 - QueryLexerIN = 7 - QueryLexerAS = 8 - QueryLexerCBF = 9 - QueryLexerSELECT = 10 - QueryLexerFROM = 11 - QueryLexerFILTER = 12 - QueryLexerWILDCARD = 13 - QueryLexerCLAUSE_SAME = 14 - QueryLexerCLAUSE_DISTINCT = 15 - QueryLexerL_PAREN = 16 - QueryLexerR_PAREN = 17 - QueryLexerAT = 18 - QueryLexerIDENT = 19 - QueryLexerNUMBER1 = 20 - QueryLexerZERO = 21 - QueryLexerSTRING = 22 - QueryLexerWS = 23 + QueryLexerEC = 7 + QueryLexerIN = 8 + QueryLexerAS = 9 + QueryLexerCBF = 10 + QueryLexerSELECT = 11 + QueryLexerFROM = 12 + QueryLexerFILTER = 13 + QueryLexerWILDCARD = 14 + QueryLexerDOT = 15 + QueryLexerCLAUSE_SAME = 16 + QueryLexerCLAUSE_DISTINCT = 17 + QueryLexerL_PAREN = 18 + QueryLexerR_PAREN = 19 + QueryLexerAT = 20 + QueryLexerIDENT = 21 + QueryLexerNUMBER1 = 22 + QueryLexerZERO = 23 + QueryLexerSTRING = 24 + QueryLexerWS = 25 ) diff --git a/netmap/parser/query_parser.go b/netmap/parser/query_parser.go index db19c93..33f1cf0 100644 --- a/netmap/parser/query_parser.go +++ b/netmap/parser/query_parser.go @@ -1,4 +1,4 @@ -// Code generated from Query.g4 by ANTLR 4.13.0. DO NOT EDIT. +// Code generated from /repo/frostfs/sdk-go/netmap/parser/Query.g4 by ANTLR 4.13.0. DO NOT EDIT. package parser // Query @@ -33,88 +33,93 @@ var QueryParserStaticData struct { func queryParserInit() { staticData := &QueryParserStaticData staticData.LiteralNames = []string{ - "", "'NOT'", "'AND'", "'OR'", "", "'UNIQUE'", "'REP'", "'IN'", "'AS'", - "'CBF'", "'SELECT'", "'FROM'", "'FILTER'", "'*'", "'SAME'", "'DISTINCT'", - "'('", "')'", "'@'", "", "", "'0'", + "", "'NOT'", "'AND'", "'OR'", "", "'UNIQUE'", "'REP'", "'EC'", "'IN'", + "'AS'", "'CBF'", "'SELECT'", "'FROM'", "'FILTER'", "'*'", "'.'", "'SAME'", + "'DISTINCT'", "'('", "')'", "'@'", "", "", "'0'", } staticData.SymbolicNames = []string{ - "", "NOT_OP", "AND_OP", "OR_OP", "SIMPLE_OP", "UNIQUE", "REP", "IN", - "AS", "CBF", "SELECT", "FROM", "FILTER", "WILDCARD", "CLAUSE_SAME", + "", "NOT_OP", "AND_OP", "OR_OP", "SIMPLE_OP", "UNIQUE", "REP", "EC", + "IN", "AS", "CBF", "SELECT", "FROM", "FILTER", "WILDCARD", "DOT", "CLAUSE_SAME", "CLAUSE_DISTINCT", "L_PAREN", "R_PAREN", "AT", "IDENT", "NUMBER1", "ZERO", "STRING", "WS", } staticData.RuleNames = []string{ - "policy", "selectFilterExpr", "repStmt", "cbfStmt", "selectStmt", "clause", - "filterExpr", "filterStmt", "expr", "filterKey", "filterValue", "number", - "keyword", "ident", "identWC", + "policy", "selectFilterExpr", "ecStmt", "repStmt", "cbfStmt", "selectStmt", + "clause", "filterExpr", "filterStmt", "expr", "filterKey", "filterValue", + "number", "keyword", "ident", "identWC", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 23, 154, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 25, 165, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, - 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 1, 0, 3, 0, - 32, 8, 0, 1, 0, 4, 0, 35, 8, 0, 11, 0, 12, 0, 36, 1, 0, 3, 0, 40, 8, 0, - 1, 0, 5, 0, 43, 8, 0, 10, 0, 12, 0, 46, 9, 0, 1, 0, 5, 0, 49, 8, 0, 10, - 0, 12, 0, 52, 9, 0, 1, 0, 1, 0, 1, 1, 3, 1, 57, 8, 1, 1, 1, 3, 1, 60, 8, - 1, 1, 1, 5, 1, 63, 8, 1, 10, 1, 12, 1, 66, 9, 1, 1, 1, 1, 1, 1, 2, 1, 2, - 1, 2, 1, 2, 3, 2, 74, 8, 2, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 3, - 4, 83, 8, 4, 1, 4, 3, 4, 86, 8, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 92, 8, - 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, - 6, 1, 6, 3, 6, 107, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 115, - 8, 6, 10, 6, 12, 6, 118, 9, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, - 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 131, 8, 8, 1, 9, 1, 9, 3, 9, 135, 8, 9, 1, - 10, 1, 10, 1, 10, 3, 10, 140, 8, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, - 1, 13, 3, 13, 148, 8, 13, 1, 14, 1, 14, 3, 14, 152, 8, 14, 1, 14, 0, 1, - 12, 15, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 0, 3, 1, - 0, 14, 15, 1, 0, 20, 21, 2, 0, 6, 8, 10, 12, 160, 0, 31, 1, 0, 0, 0, 2, - 56, 1, 0, 0, 0, 4, 69, 1, 0, 0, 0, 6, 75, 1, 0, 0, 0, 8, 78, 1, 0, 0, 0, - 10, 93, 1, 0, 0, 0, 12, 106, 1, 0, 0, 0, 14, 119, 1, 0, 0, 0, 16, 130, - 1, 0, 0, 0, 18, 134, 1, 0, 0, 0, 20, 139, 1, 0, 0, 0, 22, 141, 1, 0, 0, - 0, 24, 143, 1, 0, 0, 0, 26, 147, 1, 0, 0, 0, 28, 151, 1, 0, 0, 0, 30, 32, - 5, 5, 0, 0, 31, 30, 1, 0, 0, 0, 31, 32, 1, 0, 0, 0, 32, 34, 1, 0, 0, 0, - 33, 35, 3, 4, 2, 0, 34, 33, 1, 0, 0, 0, 35, 36, 1, 0, 0, 0, 36, 34, 1, - 0, 0, 0, 36, 37, 1, 0, 0, 0, 37, 39, 1, 0, 0, 0, 38, 40, 3, 6, 3, 0, 39, - 38, 1, 0, 0, 0, 39, 40, 1, 0, 0, 0, 40, 44, 1, 0, 0, 0, 41, 43, 3, 8, 4, - 0, 42, 41, 1, 0, 0, 0, 43, 46, 1, 0, 0, 0, 44, 42, 1, 0, 0, 0, 44, 45, - 1, 0, 0, 0, 45, 50, 1, 0, 0, 0, 46, 44, 1, 0, 0, 0, 47, 49, 3, 14, 7, 0, - 48, 47, 1, 0, 0, 0, 49, 52, 1, 0, 0, 0, 50, 48, 1, 0, 0, 0, 50, 51, 1, - 0, 0, 0, 51, 53, 1, 0, 0, 0, 52, 50, 1, 0, 0, 0, 53, 54, 5, 0, 0, 1, 54, - 1, 1, 0, 0, 0, 55, 57, 3, 6, 3, 0, 56, 55, 1, 0, 0, 0, 56, 57, 1, 0, 0, - 0, 57, 59, 1, 0, 0, 0, 58, 60, 3, 8, 4, 0, 59, 58, 1, 0, 0, 0, 59, 60, - 1, 0, 0, 0, 60, 64, 1, 0, 0, 0, 61, 63, 3, 14, 7, 0, 62, 61, 1, 0, 0, 0, - 63, 66, 1, 0, 0, 0, 64, 62, 1, 0, 0, 0, 64, 65, 1, 0, 0, 0, 65, 67, 1, - 0, 0, 0, 66, 64, 1, 0, 0, 0, 67, 68, 5, 0, 0, 1, 68, 3, 1, 0, 0, 0, 69, - 70, 5, 6, 0, 0, 70, 73, 5, 20, 0, 0, 71, 72, 5, 7, 0, 0, 72, 74, 3, 26, - 13, 0, 73, 71, 1, 0, 0, 0, 73, 74, 1, 0, 0, 0, 74, 5, 1, 0, 0, 0, 75, 76, - 5, 9, 0, 0, 76, 77, 5, 20, 0, 0, 77, 7, 1, 0, 0, 0, 78, 79, 5, 10, 0, 0, - 79, 85, 5, 20, 0, 0, 80, 82, 5, 7, 0, 0, 81, 83, 3, 10, 5, 0, 82, 81, 1, - 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 86, 3, 26, 13, 0, - 85, 80, 1, 0, 0, 0, 85, 86, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 88, 5, - 11, 0, 0, 88, 91, 3, 28, 14, 0, 89, 90, 5, 8, 0, 0, 90, 92, 3, 26, 13, - 0, 91, 89, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 9, 1, 0, 0, 0, 93, 94, 7, - 0, 0, 0, 94, 11, 1, 0, 0, 0, 95, 96, 6, 6, -1, 0, 96, 97, 5, 1, 0, 0, 97, - 98, 5, 16, 0, 0, 98, 99, 3, 12, 6, 0, 99, 100, 5, 17, 0, 0, 100, 107, 1, - 0, 0, 0, 101, 102, 5, 16, 0, 0, 102, 103, 3, 12, 6, 0, 103, 104, 5, 17, - 0, 0, 104, 107, 1, 0, 0, 0, 105, 107, 3, 16, 8, 0, 106, 95, 1, 0, 0, 0, - 106, 101, 1, 0, 0, 0, 106, 105, 1, 0, 0, 0, 107, 116, 1, 0, 0, 0, 108, - 109, 10, 4, 0, 0, 109, 110, 5, 2, 0, 0, 110, 115, 3, 12, 6, 5, 111, 112, - 10, 3, 0, 0, 112, 113, 5, 3, 0, 0, 113, 115, 3, 12, 6, 4, 114, 108, 1, - 0, 0, 0, 114, 111, 1, 0, 0, 0, 115, 118, 1, 0, 0, 0, 116, 114, 1, 0, 0, - 0, 116, 117, 1, 0, 0, 0, 117, 13, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 119, - 120, 5, 12, 0, 0, 120, 121, 3, 12, 6, 0, 121, 122, 5, 8, 0, 0, 122, 123, - 3, 26, 13, 0, 123, 15, 1, 0, 0, 0, 124, 125, 5, 18, 0, 0, 125, 131, 3, - 26, 13, 0, 126, 127, 3, 18, 9, 0, 127, 128, 5, 4, 0, 0, 128, 129, 3, 20, - 10, 0, 129, 131, 1, 0, 0, 0, 130, 124, 1, 0, 0, 0, 130, 126, 1, 0, 0, 0, - 131, 17, 1, 0, 0, 0, 132, 135, 3, 26, 13, 0, 133, 135, 5, 22, 0, 0, 134, - 132, 1, 0, 0, 0, 134, 133, 1, 0, 0, 0, 135, 19, 1, 0, 0, 0, 136, 140, 3, - 26, 13, 0, 137, 140, 3, 22, 11, 0, 138, 140, 5, 22, 0, 0, 139, 136, 1, - 0, 0, 0, 139, 137, 1, 0, 0, 0, 139, 138, 1, 0, 0, 0, 140, 21, 1, 0, 0, - 0, 141, 142, 7, 1, 0, 0, 142, 23, 1, 0, 0, 0, 143, 144, 7, 2, 0, 0, 144, - 25, 1, 0, 0, 0, 145, 148, 3, 24, 12, 0, 146, 148, 5, 19, 0, 0, 147, 145, - 1, 0, 0, 0, 147, 146, 1, 0, 0, 0, 148, 27, 1, 0, 0, 0, 149, 152, 3, 26, - 13, 0, 150, 152, 5, 13, 0, 0, 151, 149, 1, 0, 0, 0, 151, 150, 1, 0, 0, - 0, 152, 29, 1, 0, 0, 0, 20, 31, 36, 39, 44, 50, 56, 59, 64, 73, 82, 85, - 91, 106, 114, 116, 130, 134, 139, 147, 151, + 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, + 1, 0, 3, 0, 34, 8, 0, 1, 0, 1, 0, 4, 0, 38, 8, 0, 11, 0, 12, 0, 39, 1, + 0, 3, 0, 43, 8, 0, 1, 0, 5, 0, 46, 8, 0, 10, 0, 12, 0, 49, 9, 0, 1, 0, + 5, 0, 52, 8, 0, 10, 0, 12, 0, 55, 9, 0, 1, 0, 1, 0, 1, 1, 3, 1, 60, 8, + 1, 1, 1, 3, 1, 63, 8, 1, 1, 1, 5, 1, 66, 8, 1, 10, 1, 12, 1, 69, 9, 1, + 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 79, 8, 2, 1, 3, 1, + 3, 1, 3, 1, 3, 3, 3, 85, 8, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, + 3, 5, 94, 8, 5, 1, 5, 3, 5, 97, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 103, + 8, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, + 1, 7, 1, 7, 3, 7, 118, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, + 126, 8, 7, 10, 7, 12, 7, 129, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, + 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 142, 8, 9, 1, 10, 1, 10, 3, 10, 146, + 8, 10, 1, 11, 1, 11, 1, 11, 3, 11, 151, 8, 11, 1, 12, 1, 12, 1, 13, 1, + 13, 1, 14, 1, 14, 3, 14, 159, 8, 14, 1, 15, 1, 15, 3, 15, 163, 8, 15, 1, + 15, 0, 1, 14, 16, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, + 30, 0, 3, 1, 0, 16, 17, 1, 0, 22, 23, 3, 0, 6, 6, 8, 9, 11, 13, 172, 0, + 33, 1, 0, 0, 0, 2, 59, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 80, 1, 0, 0, 0, + 8, 86, 1, 0, 0, 0, 10, 89, 1, 0, 0, 0, 12, 104, 1, 0, 0, 0, 14, 117, 1, + 0, 0, 0, 16, 130, 1, 0, 0, 0, 18, 141, 1, 0, 0, 0, 20, 145, 1, 0, 0, 0, + 22, 150, 1, 0, 0, 0, 24, 152, 1, 0, 0, 0, 26, 154, 1, 0, 0, 0, 28, 158, + 1, 0, 0, 0, 30, 162, 1, 0, 0, 0, 32, 34, 5, 5, 0, 0, 33, 32, 1, 0, 0, 0, + 33, 34, 1, 0, 0, 0, 34, 37, 1, 0, 0, 0, 35, 38, 3, 6, 3, 0, 36, 38, 3, + 4, 2, 0, 37, 35, 1, 0, 0, 0, 37, 36, 1, 0, 0, 0, 38, 39, 1, 0, 0, 0, 39, + 37, 1, 0, 0, 0, 39, 40, 1, 0, 0, 0, 40, 42, 1, 0, 0, 0, 41, 43, 3, 8, 4, + 0, 42, 41, 1, 0, 0, 0, 42, 43, 1, 0, 0, 0, 43, 47, 1, 0, 0, 0, 44, 46, + 3, 10, 5, 0, 45, 44, 1, 0, 0, 0, 46, 49, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, + 47, 48, 1, 0, 0, 0, 48, 53, 1, 0, 0, 0, 49, 47, 1, 0, 0, 0, 50, 52, 3, + 16, 8, 0, 51, 50, 1, 0, 0, 0, 52, 55, 1, 0, 0, 0, 53, 51, 1, 0, 0, 0, 53, + 54, 1, 0, 0, 0, 54, 56, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 56, 57, 5, 0, 0, + 1, 57, 1, 1, 0, 0, 0, 58, 60, 3, 8, 4, 0, 59, 58, 1, 0, 0, 0, 59, 60, 1, + 0, 0, 0, 60, 62, 1, 0, 0, 0, 61, 63, 3, 10, 5, 0, 62, 61, 1, 0, 0, 0, 62, + 63, 1, 0, 0, 0, 63, 67, 1, 0, 0, 0, 64, 66, 3, 16, 8, 0, 65, 64, 1, 0, + 0, 0, 66, 69, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 70, + 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 70, 71, 5, 0, 0, 1, 71, 3, 1, 0, 0, 0, + 72, 73, 5, 7, 0, 0, 73, 74, 5, 22, 0, 0, 74, 75, 5, 15, 0, 0, 75, 78, 5, + 22, 0, 0, 76, 77, 5, 8, 0, 0, 77, 79, 3, 28, 14, 0, 78, 76, 1, 0, 0, 0, + 78, 79, 1, 0, 0, 0, 79, 5, 1, 0, 0, 0, 80, 81, 5, 6, 0, 0, 81, 84, 5, 22, + 0, 0, 82, 83, 5, 8, 0, 0, 83, 85, 3, 28, 14, 0, 84, 82, 1, 0, 0, 0, 84, + 85, 1, 0, 0, 0, 85, 7, 1, 0, 0, 0, 86, 87, 5, 10, 0, 0, 87, 88, 5, 22, + 0, 0, 88, 9, 1, 0, 0, 0, 89, 90, 5, 11, 0, 0, 90, 96, 5, 22, 0, 0, 91, + 93, 5, 8, 0, 0, 92, 94, 3, 12, 6, 0, 93, 92, 1, 0, 0, 0, 93, 94, 1, 0, + 0, 0, 94, 95, 1, 0, 0, 0, 95, 97, 3, 28, 14, 0, 96, 91, 1, 0, 0, 0, 96, + 97, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 99, 5, 12, 0, 0, 99, 102, 3, 30, + 15, 0, 100, 101, 5, 9, 0, 0, 101, 103, 3, 28, 14, 0, 102, 100, 1, 0, 0, + 0, 102, 103, 1, 0, 0, 0, 103, 11, 1, 0, 0, 0, 104, 105, 7, 0, 0, 0, 105, + 13, 1, 0, 0, 0, 106, 107, 6, 7, -1, 0, 107, 108, 5, 1, 0, 0, 108, 109, + 5, 18, 0, 0, 109, 110, 3, 14, 7, 0, 110, 111, 5, 19, 0, 0, 111, 118, 1, + 0, 0, 0, 112, 113, 5, 18, 0, 0, 113, 114, 3, 14, 7, 0, 114, 115, 5, 19, + 0, 0, 115, 118, 1, 0, 0, 0, 116, 118, 3, 18, 9, 0, 117, 106, 1, 0, 0, 0, + 117, 112, 1, 0, 0, 0, 117, 116, 1, 0, 0, 0, 118, 127, 1, 0, 0, 0, 119, + 120, 10, 4, 0, 0, 120, 121, 5, 2, 0, 0, 121, 126, 3, 14, 7, 5, 122, 123, + 10, 3, 0, 0, 123, 124, 5, 3, 0, 0, 124, 126, 3, 14, 7, 4, 125, 119, 1, + 0, 0, 0, 125, 122, 1, 0, 0, 0, 126, 129, 1, 0, 0, 0, 127, 125, 1, 0, 0, + 0, 127, 128, 1, 0, 0, 0, 128, 15, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 130, + 131, 5, 13, 0, 0, 131, 132, 3, 14, 7, 0, 132, 133, 5, 9, 0, 0, 133, 134, + 3, 28, 14, 0, 134, 17, 1, 0, 0, 0, 135, 136, 5, 20, 0, 0, 136, 142, 3, + 28, 14, 0, 137, 138, 3, 20, 10, 0, 138, 139, 5, 4, 0, 0, 139, 140, 3, 22, + 11, 0, 140, 142, 1, 0, 0, 0, 141, 135, 1, 0, 0, 0, 141, 137, 1, 0, 0, 0, + 142, 19, 1, 0, 0, 0, 143, 146, 3, 28, 14, 0, 144, 146, 5, 24, 0, 0, 145, + 143, 1, 0, 0, 0, 145, 144, 1, 0, 0, 0, 146, 21, 1, 0, 0, 0, 147, 151, 3, + 28, 14, 0, 148, 151, 3, 24, 12, 0, 149, 151, 5, 24, 0, 0, 150, 147, 1, + 0, 0, 0, 150, 148, 1, 0, 0, 0, 150, 149, 1, 0, 0, 0, 151, 23, 1, 0, 0, + 0, 152, 153, 7, 1, 0, 0, 153, 25, 1, 0, 0, 0, 154, 155, 7, 2, 0, 0, 155, + 27, 1, 0, 0, 0, 156, 159, 3, 26, 13, 0, 157, 159, 5, 21, 0, 0, 158, 156, + 1, 0, 0, 0, 158, 157, 1, 0, 0, 0, 159, 29, 1, 0, 0, 0, 160, 163, 3, 28, + 14, 0, 161, 163, 5, 14, 0, 0, 162, 160, 1, 0, 0, 0, 162, 161, 1, 0, 0, + 0, 163, 31, 1, 0, 0, 0, 22, 33, 37, 39, 42, 47, 53, 59, 62, 67, 78, 84, + 93, 96, 102, 117, 125, 127, 141, 145, 150, 158, 162, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -159,42 +164,45 @@ const ( QuerySIMPLE_OP = 4 QueryUNIQUE = 5 QueryREP = 6 - QueryIN = 7 - QueryAS = 8 - QueryCBF = 9 - QuerySELECT = 10 - QueryFROM = 11 - QueryFILTER = 12 - QueryWILDCARD = 13 - QueryCLAUSE_SAME = 14 - QueryCLAUSE_DISTINCT = 15 - QueryL_PAREN = 16 - QueryR_PAREN = 17 - QueryAT = 18 - QueryIDENT = 19 - QueryNUMBER1 = 20 - QueryZERO = 21 - QuerySTRING = 22 - QueryWS = 23 + QueryEC = 7 + QueryIN = 8 + QueryAS = 9 + QueryCBF = 10 + QuerySELECT = 11 + QueryFROM = 12 + QueryFILTER = 13 + QueryWILDCARD = 14 + QueryDOT = 15 + QueryCLAUSE_SAME = 16 + QueryCLAUSE_DISTINCT = 17 + QueryL_PAREN = 18 + QueryR_PAREN = 19 + QueryAT = 20 + QueryIDENT = 21 + QueryNUMBER1 = 22 + QueryZERO = 23 + QuerySTRING = 24 + QueryWS = 25 ) // Query rules. const ( QueryRULE_policy = 0 QueryRULE_selectFilterExpr = 1 - QueryRULE_repStmt = 2 - QueryRULE_cbfStmt = 3 - QueryRULE_selectStmt = 4 - QueryRULE_clause = 5 - QueryRULE_filterExpr = 6 - QueryRULE_filterStmt = 7 - QueryRULE_expr = 8 - QueryRULE_filterKey = 9 - QueryRULE_filterValue = 10 - QueryRULE_number = 11 - QueryRULE_keyword = 12 - QueryRULE_ident = 13 - QueryRULE_identWC = 14 + QueryRULE_ecStmt = 2 + QueryRULE_repStmt = 3 + QueryRULE_cbfStmt = 4 + QueryRULE_selectStmt = 5 + QueryRULE_clause = 6 + QueryRULE_filterExpr = 7 + QueryRULE_filterStmt = 8 + QueryRULE_expr = 9 + QueryRULE_filterKey = 10 + QueryRULE_filterValue = 11 + QueryRULE_number = 12 + QueryRULE_keyword = 13 + QueryRULE_ident = 14 + QueryRULE_identWC = 15 ) // IPolicyContext is an interface to support dynamic dispatch. @@ -209,6 +217,8 @@ type IPolicyContext interface { UNIQUE() antlr.TerminalNode AllRepStmt() []IRepStmtContext RepStmt(i int) IRepStmtContext + AllEcStmt() []IEcStmtContext + EcStmt(i int) IEcStmtContext CbfStmt() ICbfStmtContext AllSelectStmt() []ISelectStmtContext SelectStmt(i int) ISelectStmtContext @@ -300,6 +310,47 @@ func (s *PolicyContext) RepStmt(i int) IRepStmtContext { return t.(IRepStmtContext) } +func (s *PolicyContext) AllEcStmt() []IEcStmtContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IEcStmtContext); ok { + len++ + } + } + + tst := make([]IEcStmtContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IEcStmtContext); ok { + tst[i] = t.(IEcStmtContext) + i++ + } + } + + return tst +} + +func (s *PolicyContext) EcStmt(i int) IEcStmtContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IEcStmtContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IEcStmtContext) +} + func (s *PolicyContext) CbfStmt() ICbfStmtContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { @@ -422,7 +473,7 @@ func (p *Query) Policy() (localctx IPolicyContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(31) + p.SetState(33) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -431,7 +482,7 @@ func (p *Query) Policy() (localctx IPolicyContext) { if _la == QueryUNIQUE { { - p.SetState(30) + p.SetState(32) p.Match(QueryUNIQUE) if p.HasError() { // Recognition error - abort rule @@ -440,27 +491,46 @@ func (p *Query) Policy() (localctx IPolicyContext) { } } - p.SetState(34) + p.SetState(37) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for ok := true; ok; ok = _la == QueryREP { - { - p.SetState(33) - p.RepStmt() + for ok := true; ok; ok = _la == QueryREP || _la == QueryEC { + p.SetState(37) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit } - p.SetState(36) + switch p.GetTokenStream().LA(1) { + case QueryREP: + { + p.SetState(35) + p.RepStmt() + } + + case QueryEC: + { + p.SetState(36) + p.EcStmt() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + + p.SetState(39) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(39) + p.SetState(42) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -469,12 +539,12 @@ func (p *Query) Policy() (localctx IPolicyContext) { if _la == QueryCBF { { - p.SetState(38) + p.SetState(41) p.CbfStmt() } } - p.SetState(44) + p.SetState(47) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -483,18 +553,18 @@ func (p *Query) Policy() (localctx IPolicyContext) { for _la == QuerySELECT { { - p.SetState(41) + p.SetState(44) p.SelectStmt() } - p.SetState(46) + p.SetState(49) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(50) + p.SetState(53) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -503,11 +573,11 @@ func (p *Query) Policy() (localctx IPolicyContext) { for _la == QueryFILTER { { - p.SetState(47) + p.SetState(50) p.FilterStmt() } - p.SetState(52) + p.SetState(55) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -515,7 +585,7 @@ func (p *Query) Policy() (localctx IPolicyContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(53) + p.SetState(56) p.Match(QueryEOF) if p.HasError() { // Recognition error - abort rule @@ -687,7 +757,7 @@ func (p *Query) SelectFilterExpr() (localctx ISelectFilterExprContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(56) + p.SetState(59) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -696,12 +766,12 @@ func (p *Query) SelectFilterExpr() (localctx ISelectFilterExprContext) { if _la == QueryCBF { { - p.SetState(55) + p.SetState(58) p.CbfStmt() } } - p.SetState(59) + p.SetState(62) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -710,12 +780,12 @@ func (p *Query) SelectFilterExpr() (localctx ISelectFilterExprContext) { if _la == QuerySELECT { { - p.SetState(58) + p.SetState(61) p.SelectStmt() } } - p.SetState(64) + p.SetState(67) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -724,11 +794,11 @@ func (p *Query) SelectFilterExpr() (localctx ISelectFilterExprContext) { for _la == QueryFILTER { { - p.SetState(61) + p.SetState(64) p.FilterStmt() } - p.SetState(66) + p.SetState(69) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -736,7 +806,7 @@ func (p *Query) SelectFilterExpr() (localctx ISelectFilterExprContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(67) + p.SetState(70) p.Match(QueryEOF) if p.HasError() { // Recognition error - abort rule @@ -757,6 +827,227 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } +// IEcStmtContext is an interface to support dynamic dispatch. +type IEcStmtContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetData returns the Data token. + GetData() antlr.Token + + // GetParity returns the Parity token. + GetParity() antlr.Token + + // SetData sets the Data token. + SetData(antlr.Token) + + // SetParity sets the Parity token. + SetParity(antlr.Token) + + // GetSelector returns the Selector rule contexts. + GetSelector() IIdentContext + + // SetSelector sets the Selector rule contexts. + SetSelector(IIdentContext) + + // Getter signatures + EC() antlr.TerminalNode + DOT() antlr.TerminalNode + AllNUMBER1() []antlr.TerminalNode + NUMBER1(i int) antlr.TerminalNode + IN() antlr.TerminalNode + Ident() IIdentContext + + // IsEcStmtContext differentiates from other interfaces. + IsEcStmtContext() +} + +type EcStmtContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + Data antlr.Token + Parity antlr.Token + Selector IIdentContext +} + +func NewEmptyEcStmtContext() *EcStmtContext { + var p = new(EcStmtContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = QueryRULE_ecStmt + return p +} + +func InitEmptyEcStmtContext(p *EcStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = QueryRULE_ecStmt +} + +func (*EcStmtContext) IsEcStmtContext() {} + +func NewEcStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EcStmtContext { + var p = new(EcStmtContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = QueryRULE_ecStmt + + return p +} + +func (s *EcStmtContext) GetParser() antlr.Parser { return s.parser } + +func (s *EcStmtContext) GetData() antlr.Token { return s.Data } + +func (s *EcStmtContext) GetParity() antlr.Token { return s.Parity } + +func (s *EcStmtContext) SetData(v antlr.Token) { s.Data = v } + +func (s *EcStmtContext) SetParity(v antlr.Token) { s.Parity = v } + +func (s *EcStmtContext) GetSelector() IIdentContext { return s.Selector } + +func (s *EcStmtContext) SetSelector(v IIdentContext) { s.Selector = v } + +func (s *EcStmtContext) EC() antlr.TerminalNode { + return s.GetToken(QueryEC, 0) +} + +func (s *EcStmtContext) DOT() antlr.TerminalNode { + return s.GetToken(QueryDOT, 0) +} + +func (s *EcStmtContext) AllNUMBER1() []antlr.TerminalNode { + return s.GetTokens(QueryNUMBER1) +} + +func (s *EcStmtContext) NUMBER1(i int) antlr.TerminalNode { + return s.GetToken(QueryNUMBER1, i) +} + +func (s *EcStmtContext) IN() antlr.TerminalNode { + return s.GetToken(QueryIN, 0) +} + +func (s *EcStmtContext) Ident() IIdentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentContext) +} + +func (s *EcStmtContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *EcStmtContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *EcStmtContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case QueryVisitor: + return t.VisitEcStmt(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *Query) EcStmt() (localctx IEcStmtContext) { + localctx = NewEcStmtContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 4, QueryRULE_ecStmt) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(72) + p.Match(QueryEC) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(73) + + var _m = p.Match(QueryNUMBER1) + + localctx.(*EcStmtContext).Data = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(74) + p.Match(QueryDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(75) + + var _m = p.Match(QueryNUMBER1) + + localctx.(*EcStmtContext).Parity = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(78) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == QueryIN { + { + p.SetState(76) + p.Match(QueryIN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(77) + + var _x = p.Ident() + + localctx.(*EcStmtContext).Selector = _x + } + + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + // IRepStmtContext is an interface to support dynamic dispatch. type IRepStmtContext interface { antlr.ParserRuleContext @@ -876,12 +1167,12 @@ func (s *RepStmtContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *Query) RepStmt() (localctx IRepStmtContext) { localctx = NewRepStmtContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 4, QueryRULE_repStmt) + p.EnterRule(localctx, 6, QueryRULE_repStmt) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(69) + p.SetState(80) p.Match(QueryREP) if p.HasError() { // Recognition error - abort rule @@ -889,7 +1180,7 @@ func (p *Query) RepStmt() (localctx IRepStmtContext) { } } { - p.SetState(70) + p.SetState(81) var _m = p.Match(QueryNUMBER1) @@ -899,7 +1190,7 @@ func (p *Query) RepStmt() (localctx IRepStmtContext) { goto errorExit } } - p.SetState(73) + p.SetState(84) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -908,7 +1199,7 @@ func (p *Query) RepStmt() (localctx IRepStmtContext) { if _la == QueryIN { { - p.SetState(71) + p.SetState(82) p.Match(QueryIN) if p.HasError() { // Recognition error - abort rule @@ -916,7 +1207,7 @@ func (p *Query) RepStmt() (localctx IRepStmtContext) { } } { - p.SetState(72) + p.SetState(83) var _x = p.Ident() @@ -1024,10 +1315,10 @@ func (s *CbfStmtContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *Query) CbfStmt() (localctx ICbfStmtContext) { localctx = NewCbfStmtContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 6, QueryRULE_cbfStmt) + p.EnterRule(localctx, 8, QueryRULE_cbfStmt) p.EnterOuterAlt(localctx, 1) { - p.SetState(75) + p.SetState(86) p.Match(QueryCBF) if p.HasError() { // Recognition error - abort rule @@ -1035,7 +1326,7 @@ func (p *Query) CbfStmt() (localctx ICbfStmtContext) { } } { - p.SetState(76) + p.SetState(87) var _m = p.Match(QueryNUMBER1) @@ -1270,12 +1561,12 @@ func (s *SelectStmtContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *Query) SelectStmt() (localctx ISelectStmtContext) { localctx = NewSelectStmtContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 8, QueryRULE_selectStmt) + p.EnterRule(localctx, 10, QueryRULE_selectStmt) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(78) + p.SetState(89) p.Match(QuerySELECT) if p.HasError() { // Recognition error - abort rule @@ -1283,7 +1574,7 @@ func (p *Query) SelectStmt() (localctx ISelectStmtContext) { } } { - p.SetState(79) + p.SetState(90) var _m = p.Match(QueryNUMBER1) @@ -1293,7 +1584,7 @@ func (p *Query) SelectStmt() (localctx ISelectStmtContext) { goto errorExit } } - p.SetState(85) + p.SetState(96) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1302,14 +1593,14 @@ func (p *Query) SelectStmt() (localctx ISelectStmtContext) { if _la == QueryIN { { - p.SetState(80) + p.SetState(91) p.Match(QueryIN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(82) + p.SetState(93) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1318,13 +1609,13 @@ func (p *Query) SelectStmt() (localctx ISelectStmtContext) { if _la == QueryCLAUSE_SAME || _la == QueryCLAUSE_DISTINCT { { - p.SetState(81) + p.SetState(92) p.Clause() } } { - p.SetState(84) + p.SetState(95) var _x = p.Ident() @@ -1333,7 +1624,7 @@ func (p *Query) SelectStmt() (localctx ISelectStmtContext) { } { - p.SetState(87) + p.SetState(98) p.Match(QueryFROM) if p.HasError() { // Recognition error - abort rule @@ -1341,13 +1632,13 @@ func (p *Query) SelectStmt() (localctx ISelectStmtContext) { } } { - p.SetState(88) + p.SetState(99) var _x = p.IdentWC() localctx.(*SelectStmtContext).Filter = _x } - p.SetState(91) + p.SetState(102) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1356,7 +1647,7 @@ func (p *Query) SelectStmt() (localctx ISelectStmtContext) { if _la == QueryAS { { - p.SetState(89) + p.SetState(100) p.Match(QueryAS) if p.HasError() { // Recognition error - abort rule @@ -1364,7 +1655,7 @@ func (p *Query) SelectStmt() (localctx ISelectStmtContext) { } } { - p.SetState(90) + p.SetState(101) var _x = p.Ident() @@ -1461,12 +1752,12 @@ func (s *ClauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *Query) Clause() (localctx IClauseContext) { localctx = NewClauseContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 10, QueryRULE_clause) + p.EnterRule(localctx, 12, QueryRULE_clause) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(93) + p.SetState(104) _la = p.GetTokenStream().LA(1) if !(_la == QueryCLAUSE_SAME || _la == QueryCLAUSE_DISTINCT) { @@ -1693,12 +1984,12 @@ func (p *Query) filterExpr(_p int) (localctx IFilterExprContext) { localctx = NewFilterExprContext(p, p.GetParserRuleContext(), _parentState) var _prevctx IFilterExprContext = localctx var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. - _startState := 12 - p.EnterRecursionRule(localctx, 12, QueryRULE_filterExpr, _p) + _startState := 14 + p.EnterRecursionRule(localctx, 14, QueryRULE_filterExpr, _p) var _alt int p.EnterOuterAlt(localctx, 1) - p.SetState(106) + p.SetState(117) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1707,7 +1998,7 @@ func (p *Query) filterExpr(_p int) (localctx IFilterExprContext) { switch p.GetTokenStream().LA(1) { case QueryNOT_OP: { - p.SetState(96) + p.SetState(107) var _m = p.Match(QueryNOT_OP) @@ -1718,7 +2009,7 @@ func (p *Query) filterExpr(_p int) (localctx IFilterExprContext) { } } { - p.SetState(97) + p.SetState(108) p.Match(QueryL_PAREN) if p.HasError() { // Recognition error - abort rule @@ -1726,14 +2017,14 @@ func (p *Query) filterExpr(_p int) (localctx IFilterExprContext) { } } { - p.SetState(98) + p.SetState(109) var _x = p.filterExpr(0) localctx.(*FilterExprContext).F1 = _x } { - p.SetState(99) + p.SetState(110) p.Match(QueryR_PAREN) if p.HasError() { // Recognition error - abort rule @@ -1743,7 +2034,7 @@ func (p *Query) filterExpr(_p int) (localctx IFilterExprContext) { case QueryL_PAREN: { - p.SetState(101) + p.SetState(112) p.Match(QueryL_PAREN) if p.HasError() { // Recognition error - abort rule @@ -1751,14 +2042,14 @@ func (p *Query) filterExpr(_p int) (localctx IFilterExprContext) { } } { - p.SetState(102) + p.SetState(113) var _x = p.filterExpr(0) localctx.(*FilterExprContext).Inner = _x } { - p.SetState(103) + p.SetState(114) p.Match(QueryR_PAREN) if p.HasError() { // Recognition error - abort rule @@ -1768,7 +2059,7 @@ func (p *Query) filterExpr(_p int) (localctx IFilterExprContext) { case QueryREP, QueryIN, QueryAS, QuerySELECT, QueryFROM, QueryFILTER, QueryAT, QueryIDENT, QuerySTRING: { - p.SetState(105) + p.SetState(116) p.Expr() } @@ -1777,12 +2068,12 @@ func (p *Query) filterExpr(_p int) (localctx IFilterExprContext) { goto errorExit } p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) - p.SetState(116) + p.SetState(127) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 14, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 16, p.GetParserRuleContext()) if p.HasError() { goto errorExit } @@ -1792,25 +2083,25 @@ func (p *Query) filterExpr(_p int) (localctx IFilterExprContext) { p.TriggerExitRuleEvent() } _prevctx = localctx - p.SetState(114) + p.SetState(125) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 13, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 15, p.GetParserRuleContext()) { case 1: localctx = NewFilterExprContext(p, _parentctx, _parentState) localctx.(*FilterExprContext).F1 = _prevctx p.PushNewRecursionContext(localctx, _startState, QueryRULE_filterExpr) - p.SetState(108) + p.SetState(119) if !(p.Precpred(p.GetParserRuleContext(), 4)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) goto errorExit } { - p.SetState(109) + p.SetState(120) var _m = p.Match(QueryAND_OP) @@ -1821,7 +2112,7 @@ func (p *Query) filterExpr(_p int) (localctx IFilterExprContext) { } } { - p.SetState(110) + p.SetState(121) var _x = p.filterExpr(5) @@ -1832,14 +2123,14 @@ func (p *Query) filterExpr(_p int) (localctx IFilterExprContext) { localctx = NewFilterExprContext(p, _parentctx, _parentState) localctx.(*FilterExprContext).F1 = _prevctx p.PushNewRecursionContext(localctx, _startState, QueryRULE_filterExpr) - p.SetState(111) + p.SetState(122) if !(p.Precpred(p.GetParserRuleContext(), 3)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) goto errorExit } { - p.SetState(112) + p.SetState(123) var _m = p.Match(QueryOR_OP) @@ -1850,7 +2141,7 @@ func (p *Query) filterExpr(_p int) (localctx IFilterExprContext) { } } { - p.SetState(113) + p.SetState(124) var _x = p.filterExpr(4) @@ -1862,12 +2153,12 @@ func (p *Query) filterExpr(_p int) (localctx IFilterExprContext) { } } - p.SetState(118) + p.SetState(129) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 14, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 16, p.GetParserRuleContext()) if p.HasError() { goto errorExit } @@ -2017,10 +2308,10 @@ func (s *FilterStmtContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *Query) FilterStmt() (localctx IFilterStmtContext) { localctx = NewFilterStmtContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 14, QueryRULE_filterStmt) + p.EnterRule(localctx, 16, QueryRULE_filterStmt) p.EnterOuterAlt(localctx, 1) { - p.SetState(119) + p.SetState(130) p.Match(QueryFILTER) if p.HasError() { // Recognition error - abort rule @@ -2028,14 +2319,14 @@ func (p *Query) FilterStmt() (localctx IFilterStmtContext) { } } { - p.SetState(120) + p.SetState(131) var _x = p.filterExpr(0) localctx.(*FilterStmtContext).Expr = _x } { - p.SetState(121) + p.SetState(132) p.Match(QueryAS) if p.HasError() { // Recognition error - abort rule @@ -2043,7 +2334,7 @@ func (p *Query) FilterStmt() (localctx IFilterStmtContext) { } } { - p.SetState(122) + p.SetState(133) var _x = p.Ident() @@ -2222,8 +2513,8 @@ func (s *ExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *Query) Expr() (localctx IExprContext) { localctx = NewExprContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 16, QueryRULE_expr) - p.SetState(130) + p.EnterRule(localctx, 18, QueryRULE_expr) + p.SetState(141) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2233,7 +2524,7 @@ func (p *Query) Expr() (localctx IExprContext) { case QueryAT: p.EnterOuterAlt(localctx, 1) { - p.SetState(124) + p.SetState(135) p.Match(QueryAT) if p.HasError() { // Recognition error - abort rule @@ -2241,7 +2532,7 @@ func (p *Query) Expr() (localctx IExprContext) { } } { - p.SetState(125) + p.SetState(136) var _x = p.Ident() @@ -2251,14 +2542,14 @@ func (p *Query) Expr() (localctx IExprContext) { case QueryREP, QueryIN, QueryAS, QuerySELECT, QueryFROM, QueryFILTER, QueryIDENT, QuerySTRING: p.EnterOuterAlt(localctx, 2) { - p.SetState(126) + p.SetState(137) var _x = p.FilterKey() localctx.(*ExprContext).Key = _x } { - p.SetState(127) + p.SetState(138) p.Match(QuerySIMPLE_OP) if p.HasError() { // Recognition error - abort rule @@ -2266,7 +2557,7 @@ func (p *Query) Expr() (localctx IExprContext) { } } { - p.SetState(128) + p.SetState(139) var _x = p.FilterValue() @@ -2378,8 +2669,8 @@ func (s *FilterKeyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *Query) FilterKey() (localctx IFilterKeyContext) { localctx = NewFilterKeyContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 18, QueryRULE_filterKey) - p.SetState(134) + p.EnterRule(localctx, 20, QueryRULE_filterKey) + p.SetState(145) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2389,14 +2680,14 @@ func (p *Query) FilterKey() (localctx IFilterKeyContext) { case QueryREP, QueryIN, QueryAS, QuerySELECT, QueryFROM, QueryFILTER, QueryIDENT: p.EnterOuterAlt(localctx, 1) { - p.SetState(132) + p.SetState(143) p.Ident() } case QuerySTRING: p.EnterOuterAlt(localctx, 2) { - p.SetState(133) + p.SetState(144) p.Match(QuerySTRING) if p.HasError() { // Recognition error - abort rule @@ -2526,8 +2817,8 @@ func (s *FilterValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *Query) FilterValue() (localctx IFilterValueContext) { localctx = NewFilterValueContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 20, QueryRULE_filterValue) - p.SetState(139) + p.EnterRule(localctx, 22, QueryRULE_filterValue) + p.SetState(150) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2537,21 +2828,21 @@ func (p *Query) FilterValue() (localctx IFilterValueContext) { case QueryREP, QueryIN, QueryAS, QuerySELECT, QueryFROM, QueryFILTER, QueryIDENT: p.EnterOuterAlt(localctx, 1) { - p.SetState(136) + p.SetState(147) p.Ident() } case QueryNUMBER1, QueryZERO: p.EnterOuterAlt(localctx, 2) { - p.SetState(137) + p.SetState(148) p.Number() } case QuerySTRING: p.EnterOuterAlt(localctx, 3) { - p.SetState(138) + p.SetState(149) p.Match(QuerySTRING) if p.HasError() { // Recognition error - abort rule @@ -2652,12 +2943,12 @@ func (s *NumberContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *Query) Number() (localctx INumberContext) { localctx = NewNumberContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 22, QueryRULE_number) + p.EnterRule(localctx, 24, QueryRULE_number) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(141) + p.SetState(152) _la = p.GetTokenStream().LA(1) if !(_la == QueryNUMBER1 || _la == QueryZERO) { @@ -2776,15 +3067,15 @@ func (s *KeywordContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *Query) Keyword() (localctx IKeywordContext) { localctx = NewKeywordContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 24, QueryRULE_keyword) + p.EnterRule(localctx, 26, QueryRULE_keyword) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(143) + p.SetState(154) _la = p.GetTokenStream().LA(1) - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&7616) != 0) { + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&15168) != 0) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) @@ -2892,8 +3183,8 @@ func (s *IdentContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *Query) Ident() (localctx IIdentContext) { localctx = NewIdentContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 26, QueryRULE_ident) - p.SetState(147) + p.EnterRule(localctx, 28, QueryRULE_ident) + p.SetState(158) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2903,14 +3194,14 @@ func (p *Query) Ident() (localctx IIdentContext) { case QueryREP, QueryIN, QueryAS, QuerySELECT, QueryFROM, QueryFILTER: p.EnterOuterAlt(localctx, 1) { - p.SetState(145) + p.SetState(156) p.Keyword() } case QueryIDENT: p.EnterOuterAlt(localctx, 2) { - p.SetState(146) + p.SetState(157) p.Match(QueryIDENT) if p.HasError() { // Recognition error - abort rule @@ -3023,8 +3314,8 @@ func (s *IdentWCContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *Query) IdentWC() (localctx IIdentWCContext) { localctx = NewIdentWCContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 28, QueryRULE_identWC) - p.SetState(151) + p.EnterRule(localctx, 30, QueryRULE_identWC) + p.SetState(162) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3034,14 +3325,14 @@ func (p *Query) IdentWC() (localctx IIdentWCContext) { case QueryREP, QueryIN, QueryAS, QuerySELECT, QueryFROM, QueryFILTER, QueryIDENT: p.EnterOuterAlt(localctx, 1) { - p.SetState(149) + p.SetState(160) p.Ident() } case QueryWILDCARD: p.EnterOuterAlt(localctx, 2) { - p.SetState(150) + p.SetState(161) p.Match(QueryWILDCARD) if p.HasError() { // Recognition error - abort rule @@ -3069,7 +3360,7 @@ errorExit: func (p *Query) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool { switch ruleIndex { - case 6: + case 7: var t *FilterExprContext = nil if localctx != nil { t = localctx.(*FilterExprContext) diff --git a/netmap/parser/query_visitor.go b/netmap/parser/query_visitor.go index 7550d99..c251e90 100644 --- a/netmap/parser/query_visitor.go +++ b/netmap/parser/query_visitor.go @@ -1,4 +1,4 @@ -// Code generated from Query.g4 by ANTLR 4.13.0. DO NOT EDIT. +// Code generated from /repo/frostfs/sdk-go/netmap/parser/Query.g4 by ANTLR 4.13.0. DO NOT EDIT. package parser // Query @@ -14,6 +14,9 @@ type QueryVisitor interface { // Visit a parse tree produced by Query#selectFilterExpr. VisitSelectFilterExpr(ctx *SelectFilterExprContext) interface{} + // Visit a parse tree produced by Query#ecStmt. + VisitEcStmt(ctx *EcStmtContext) interface{} + // Visit a parse tree produced by Query#repStmt. VisitRepStmt(ctx *RepStmtContext) interface{} diff --git a/netmap/policy.go b/netmap/policy.go index e28c89e..3ab77c2 100644 --- a/netmap/policy.go +++ b/netmap/policy.go @@ -34,8 +34,17 @@ type PlacementPolicy struct { func (p *PlacementPolicy) readFromV2(m netmap.PlacementPolicy, checkFieldPresence bool) error { p.replicas = m.GetReplicas() - if checkFieldPresence && len(p.replicas) == 0 { - return errors.New("missing replicas") + if checkFieldPresence { + if len(p.replicas) == 0 { + return errors.New("missing replicas") + } + if len(p.replicas) != 1 { + for i := range p.replicas { + if p.replicas[i].GetECDataCount() != 0 || p.replicas[i].GetECParityCount() != 0 { + return errors.New("erasure code group must be used exclusively") + } + } + } } p.backupFactor = m.GetContainerBackupFactor() @@ -393,10 +402,14 @@ func (p PlacementPolicy) WriteStringTo(w io.StringWriter) (err error) { c := p.replicas[i].GetCount() s := p.replicas[i].GetSelector() - if s != "" { - _, err = w.WriteString(fmt.Sprintf("%sREP %d IN %s", delim, c, s)) - } else { + if c != 0 { _, err = w.WriteString(fmt.Sprintf("%sREP %d", delim, c)) + } else { + ecx, ecy := p.replicas[i].GetECDataCount(), p.replicas[i].GetECParityCount() + _, err = w.WriteString(fmt.Sprintf("%sEC %d.%d", delim, ecx, ecy)) + } + if s != "" { + _, err = w.WriteString(fmt.Sprintf(" IN %s", s)) } if err != nil { @@ -630,6 +643,8 @@ var ( "make sure to pair REP and SELECT clauses: \"REP .. IN X\" + \"SELECT ... AS X\"") // errRedundantSelector is returned for errors found by filters policy validator. errRedundantFilter = errors.New("policy: found redundant filter") + // errECFewSelectors is returned when EC keyword is used without UNIQUE keyword. + errECFewSelectors = errors.New("policy: too few nodes to select") ) type policyVisitor struct { @@ -657,11 +672,18 @@ func (p *policyVisitor) VisitPolicy(ctx *parser.PolicyContext) any { pl.unique = ctx.UNIQUE() != nil - repStmts := ctx.AllRepStmt() - pl.replicas = make([]netmap.Replica, 0, len(repStmts)) - - for _, r := range repStmts { - res, ok := r.Accept(p).(*netmap.Replica) + stmts := ctx.GetChildren() + for _, r := range stmts { + var res *netmap.Replica + var ok bool + switch r := r.(type) { + case parser.IRepStmtContext: + res, ok = r.Accept(p).(*netmap.Replica) + case parser.IEcStmtContext: + res, ok = r.Accept(p).(*netmap.Replica) + default: + continue + } if !ok { return nil } @@ -758,6 +780,28 @@ func (p *policyVisitor) VisitRepStmt(ctx *parser.RepStmtContext) any { return rs } +// VisitRepStmt implements parser.QueryVisitor interface. +func (p *policyVisitor) VisitEcStmt(ctx *parser.EcStmtContext) any { + dataCount, err := strconv.ParseUint(ctx.GetData().GetText(), 10, 32) + if err != nil { + return p.reportError(errInvalidNumber) + } + parityCount, err := strconv.ParseUint(ctx.GetParity().GetText(), 10, 32) + if err != nil { + return p.reportError(errInvalidNumber) + } + + rs := new(netmap.Replica) + rs.SetECDataCount(uint32(dataCount)) + rs.SetECParityCount(uint32(parityCount)) + + if sel := ctx.GetSelector(); sel != nil { + rs.SetSelector(sel.GetText()) + } + + return rs +} + // VisitSelectStmt implements parser.QueryVisitor interface. func (p *policyVisitor) VisitSelectStmt(ctx *parser.SelectStmtContext) any { res, err := strconv.ParseUint(ctx.GetCount().GetText(), 10, 32) @@ -910,6 +954,14 @@ func validatePolicy(p PlacementPolicy) error { if seenSelectors[selName] == nil { return fmt.Errorf("%w: '%s'", errUnknownSelector, selName) } + + dataCount := p.replicas[i].GetECDataCount() + parityCount := p.replicas[i].GetECParityCount() + if dataCount != 0 || parityCount != 0 { + if c := seenSelectors[selName].GetCount(); c < dataCount+parityCount { + return fmt.Errorf("%w: %d < %d + %d", errECFewSelectors, c, dataCount, parityCount) + } + } } } diff --git a/netmap/policy_decode_test.go b/netmap/policy_decode_test.go index 0c78fa8..f42d3b5 100644 --- a/netmap/policy_decode_test.go +++ b/netmap/policy_decode_test.go @@ -44,6 +44,8 @@ FILTER Node EQ '10.78.8.11' AS F`, `UNIQUE REP 1 REP 1`, + `EC 1.2 IN X +SELECT 3 IN City FROM * AS X`, } var p PlacementPolicy From e9be3e6d94296c9129f5be0186ec6c5b3255a00a Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 21 Mar 2024 09:57:34 +0300 Subject: [PATCH 023/197] [#205] netmap: Add well-known EC parameters to network config Signed-off-by: Evgenii Stratonikov --- netmap/network_info.go | 32 ++++++++++++++++++++++++++++++++ netmap/network_info_test.go | 26 ++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/netmap/network_info.go b/netmap/network_info.go index 186d433..a149bf4 100644 --- a/netmap/network_info.go +++ b/netmap/network_info.go @@ -62,6 +62,8 @@ func (x *NetworkInfo) readFromV2(m netmap.NetworkInfo, checkFieldPresence bool) configEpochDuration, configIRCandidateFee, configMaxObjSize, + configMaxECDataCount, + configMaxECParityCount, configWithdrawalFee: _, err = decodeConfigValueUint64(prm.GetValue()) case configHomomorphicHashingDisabled, @@ -234,6 +236,8 @@ func (x *NetworkInfo) IterateRawNetworkParameters(f func(name string, value []by configEpochDuration, configIRCandidateFee, configMaxObjSize, + configMaxECDataCount, + configMaxECParityCount, configWithdrawalFee, configHomomorphicHashingDisabled, configMaintenanceModeAllowed: @@ -432,6 +436,34 @@ func (x NetworkInfo) MaxObjectSize() uint64 { return x.configUint64(configMaxObjSize) } +const configMaxECDataCount = "MaxECDataCount" + +// SetMaxECDataCount sets maximum number of data shards for erasure codes. +// +// Zero means no restrictions. +func (x *NetworkInfo) SetMaxECDataCount(dataCount uint64) { + x.setConfigUint64(configMaxECDataCount, dataCount) +} + +// MaxECDataCount returns maximum number of data shards for erasure codes. +func (x NetworkInfo) MaxECDataCount() uint64 { + return x.configUint64(configMaxECDataCount) +} + +const configMaxECParityCount = "MaxECParityCount" + +// SetMaxECParityCount sets maximum number of parity shards for erasure codes. +// +// Zero means no restrictions. +func (x *NetworkInfo) SetMaxECParityCount(parityCount uint64) { + x.setConfigUint64(configMaxECParityCount, parityCount) +} + +// MaxECParityCount returns maximum number of parity shards for erasure codes. +func (x NetworkInfo) MaxECParityCount() uint64 { + return x.configUint64(configMaxECParityCount) +} + const configWithdrawalFee = "WithdrawFee" // SetWithdrawalFee sets fee for withdrawals from the FrostFS accounts that diff --git a/netmap/network_info_test.go b/netmap/network_info_test.go index 54b1b30..161d152 100644 --- a/netmap/network_info_test.go +++ b/netmap/network_info_test.go @@ -173,6 +173,32 @@ func TestNetworkInfo_MaxObjectSize(t *testing.T) { ) } +func TestNetworkInfo_MaxECDataCount(t *testing.T) { + testConfigValue(t, + func(x NetworkInfo) any { return x.MaxECDataCount() }, + func(info *NetworkInfo, val any) { info.SetMaxECDataCount(val.(uint64)) }, + uint64(1), uint64(2), + "MaxECDataCount", func(val any) []byte { + data := make([]byte, 8) + binary.LittleEndian.PutUint64(data, val.(uint64)) + return data + }, + ) +} + +func TestNetworkInfo_MaxECParityCount(t *testing.T) { + testConfigValue(t, + func(x NetworkInfo) any { return x.MaxECParityCount() }, + func(info *NetworkInfo, val any) { info.SetMaxECParityCount(val.(uint64)) }, + uint64(1), uint64(2), + "MaxECParityCount", func(val any) []byte { + data := make([]byte, 8) + binary.LittleEndian.PutUint64(data, val.(uint64)) + return data + }, + ) +} + func TestNetworkInfo_WithdrawalFee(t *testing.T) { testConfigValue(t, func(x NetworkInfo) any { return x.WithdrawalFee() }, From bd2d350b090b4c8b56a9dd9d5a12385465705a98 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 28 Feb 2024 14:51:48 +0300 Subject: [PATCH 024/197] [#205] object: Initial EC implementation Signed-off-by: Evgenii Stratonikov --- go.mod | 2 + go.sum | 5 + object/erasure_code.go | 121 +++++++++++ object/erasurecode/constructor.go | 87 ++++++++ object/erasurecode/constructor_test.go | 31 +++ object/erasurecode/reconstruct.go | 142 +++++++++++++ object/erasurecode/reconstruct_test.go | 284 +++++++++++++++++++++++++ object/erasurecode/split.go | 69 ++++++ object/erasurecode/split_test.go | 36 ++++ object/erasurecode/target.go | 44 ++++ object/erasurecode/verify.go | 104 +++++++++ object/object.go | 8 + 12 files changed, 933 insertions(+) create mode 100644 object/erasure_code.go create mode 100644 object/erasurecode/constructor.go create mode 100644 object/erasurecode/constructor_test.go create mode 100644 object/erasurecode/reconstruct.go create mode 100644 object/erasurecode/reconstruct_test.go create mode 100644 object/erasurecode/split.go create mode 100644 object/erasurecode/split_test.go create mode 100644 object/erasurecode/target.go create mode 100644 object/erasurecode/verify.go diff --git a/go.mod b/go.mod index 84be6b5..97bcd88 100644 --- a/go.mod +++ b/go.mod @@ -11,6 +11,7 @@ require ( github.com/antlr4-go/antlr/v4 v4.13.0 github.com/google/uuid v1.3.0 github.com/hashicorp/golang-lru/v2 v2.0.2 + github.com/klauspost/reedsolomon v1.12.1 github.com/mr-tron/base58 v1.2.0 github.com/nspcc-dev/neo-go v0.101.2-0.20230601131642-a0117042e8fc github.com/stretchr/testify v1.8.3 @@ -28,6 +29,7 @@ require ( github.com/golang/protobuf v1.5.3 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/hashicorp/golang-lru v0.6.0 // indirect + github.com/klauspost/cpuid/v2 v2.2.6 // indirect github.com/nspcc-dev/go-ordered-json v0.0.0-20220111165707-25110be27d22 // indirect github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20230615193820-9185820289ce // indirect github.com/nspcc-dev/rfc6979 v0.2.0 // indirect diff --git a/go.sum b/go.sum index e11d2e8..66eeb94 100644 --- a/go.sum +++ b/go.sum @@ -227,6 +227,10 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= +github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= +github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/reedsolomon v1.12.1 h1:NhWgum1efX1x58daOBGCFWcxtEhOhXKKl1HAPQUp03Q= +github.com/klauspost/reedsolomon v1.12.1/go.mod h1:nEi5Kjb6QqtbofI6s+cbG/j1da11c96IBYBSnVGtuBs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -548,6 +552,7 @@ golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +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= diff --git a/object/erasure_code.go b/object/erasure_code.go new file mode 100644 index 0000000..43abe03 --- /dev/null +++ b/object/erasure_code.go @@ -0,0 +1,121 @@ +package object + +import ( + "errors" + + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" +) + +// ECHeader represents erasure coding header. +type ECHeader struct { + parent oid.ID + index uint32 + total uint32 + header []byte + headerLength uint32 +} + +// NewECHeader constructs new erasure coding header. +func NewECHeader(parent oid.ID, index, total uint32, header []byte, headerLength uint32) *ECHeader { + return &ECHeader{ + parent: parent, + index: index, + total: total, + header: header, + headerLength: headerLength, + } +} + +// WriteToV2 converts SDK structure to v2-api one. +func (e *ECHeader) WriteToV2(h *object.ECHeader) { + var parent refs.ObjectID + e.parent.WriteToV2(&parent) + h.Parent = &parent + h.Index = e.index + h.Total = e.total + h.Header = e.header + h.HeaderLength = e.headerLength +} + +// ReadFromV2 converts v2-api structure to SDK one. +func (e *ECHeader) ReadFromV2(h *object.ECHeader) error { + if h == nil { + return nil + } + if h.Parent == nil { + return errors.New("empty parent") + } + + _ = e.parent.ReadFromV2(*h.Parent) + e.index = h.Index + e.total = h.Total + e.header = h.Header + e.headerLength = h.HeaderLength + return nil +} + +func (o *Object) ECHeader() *ECHeader { + ec := (*object.Object)(o).GetHeader().GetEC() + if ec == nil { + return nil + } + + h := new(ECHeader) + _ = h.ReadFromV2(ec) + return h +} + +func (o *Object) SetECHeader(ec *ECHeader) { + o.setHeaderField(func(h *object.Header) { + if ec == nil { + h.SetEC(nil) + return + } + + v2 := new(object.ECHeader) + ec.WriteToV2(v2) + h.SetEC(v2) + }) +} + +func (e *ECHeader) Parent() oid.ID { + return e.parent +} + +func (e *ECHeader) SetParent(id oid.ID) { + e.parent = id +} + +func (e *ECHeader) Index() uint32 { + return e.index +} + +func (e *ECHeader) SetIndex(i uint32) { + e.index = i +} + +func (e *ECHeader) Total() uint32 { + return e.total +} + +func (e *ECHeader) SetTotal(i uint32) { + e.total = i +} + +func (e *ECHeader) Header() []byte { + return e.header +} + +func (e *ECHeader) SetHeader(header []byte) { + e.header = header +} + +func (e *ECHeader) HeaderLength() uint32 { + return e.headerLength +} + +func (e *ECHeader) SetHeaderLength(l uint32) { + e.headerLength = l +} diff --git a/object/erasurecode/constructor.go b/object/erasurecode/constructor.go new file mode 100644 index 0000000..447372d --- /dev/null +++ b/object/erasurecode/constructor.go @@ -0,0 +1,87 @@ +package erasurecode + +import ( + "errors" + + objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" + "github.com/klauspost/reedsolomon" +) + +var ( + // ErrMalformedSlice is returned when a slice of EC chunks is inconsistent. + ErrMalformedSlice = errors.New("inconsistent EC headers") + // ErrInvShardNum is returned from NewConstructor when the number of shards is invalid. + ErrInvShardNum = reedsolomon.ErrInvShardNum + // ErrMaxShardNum is returned from NewConstructor when the number of shards is too big. + ErrMaxShardNum = reedsolomon.ErrMaxShardNum +) + +// MaxShardCount is the maximum number of shards. +const MaxShardCount = 256 + +// Constructor is a wrapper around encoder allowing to reconstruct objects. +// It's methods are not thread-safe. +type Constructor struct { + enc reedsolomon.Encoder + headerLength uint32 + payloadShards [][]byte + headerShards [][]byte +} + +// NewConstructor returns new constructor instance. +func NewConstructor(dataCount int, parityCount int) (*Constructor, error) { + // The library supports up to 65536 shards with some restrictions. + // This can easily result in OOM or panic, thus SDK declares it's own restriction. + if dataCount+parityCount > MaxShardCount { + return nil, ErrMaxShardNum + } + + enc, err := reedsolomon.New(dataCount, parityCount) + if err != nil { + return nil, err + } + return &Constructor{enc: enc}, nil +} + +// clear clears internal state of the constructor, so it can be reused. +func (c *Constructor) clear() { + c.headerLength = 0 + c.payloadShards = nil + c.headerShards = nil +} + +func (c *Constructor) fillHeader(parts []*objectSDK.Object) error { + shards := make([][]byte, len(parts)) + headerLength := 0 + for i := range parts { + if parts[i] == nil { + continue + } + + var err error + headerLength, err = validatePart(parts, i, headerLength) + if err != nil { + return err + } + + shards[i] = parts[i].GetECHeader().Header() + } + + c.headerLength = uint32(headerLength) + c.headerShards = shards + return nil +} + +// fillPayload fills the payload shards. +// Currently there is no case when it can be called without reconstructing header, +// thus fillHeader() must be called before and this function performs no validation. +func (c *Constructor) fillPayload(parts []*objectSDK.Object) { + shards := make([][]byte, len(parts)) + for i := range parts { + if parts[i] == nil { + continue + } + shards[i] = parts[i].Payload() + } + c.payloadShards = shards +} diff --git a/object/erasurecode/constructor_test.go b/object/erasurecode/constructor_test.go new file mode 100644 index 0000000..3268d35 --- /dev/null +++ b/object/erasurecode/constructor_test.go @@ -0,0 +1,31 @@ +package erasurecode_test + +import ( + "testing" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/erasurecode" + "github.com/stretchr/testify/require" +) + +func TestErasureConstruct(t *testing.T) { + t.Run("negative, no panic", func(t *testing.T) { + _, err := erasurecode.NewConstructor(-1, 2) + require.ErrorIs(t, err, erasurecode.ErrInvShardNum) + }) + t.Run("negative, no panic", func(t *testing.T) { + _, err := erasurecode.NewConstructor(2, -1) + require.ErrorIs(t, err, erasurecode.ErrInvShardNum) + }) + t.Run("zero parity", func(t *testing.T) { + _, err := erasurecode.NewConstructor(1, 0) + require.NoError(t, err) + }) + t.Run("max shard num", func(t *testing.T) { + _, err := erasurecode.NewConstructor(erasurecode.MaxShardCount, 0) + require.NoError(t, err) + }) + t.Run("max+1 shard num", func(t *testing.T) { + _, err := erasurecode.NewConstructor(erasurecode.MaxShardCount+1, 0) + require.ErrorIs(t, err, erasurecode.ErrMaxShardNum) + }) +} diff --git a/object/erasurecode/reconstruct.go b/object/erasurecode/reconstruct.go new file mode 100644 index 0000000..68ade85 --- /dev/null +++ b/object/erasurecode/reconstruct.go @@ -0,0 +1,142 @@ +package erasurecode + +import ( + "bytes" + "crypto/ecdsa" + "fmt" + + objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" + "github.com/klauspost/reedsolomon" +) + +// Reconstruct returns full object reconstructed from parts. +// All non-nil objects in parts must have EC header with the same `total` field equal to len(parts). +// The slice must contain at least one non nil object. +// Index of the objects in parts must be equal to it's index field in the EC header. +// The parts slice isn't changed and can be used concurrently for reading. +func (c *Constructor) Reconstruct(parts []*objectSDK.Object) (*objectSDK.Object, error) { + res, err := c.ReconstructHeader(parts) + if err != nil { + return nil, err + } + + c.fillPayload(parts) + + payload, err := reconstructExact(c.enc, int(res.PayloadSize()), c.payloadShards) + if err != nil { + return nil, fmt.Errorf("%w: %w", ErrMalformedSlice, err) + } + + res.SetPayload(payload) + return res, nil +} + +// ReconstructHeader returns object header reconstructed from parts. +// All non-nil objects in parts must have EC header with the same `total` field equal to len(parts). +// The slice must contain at least one non nil object. +// Index of the objects in parts must be equal to it's index field in the EC header. +// The parts slice isn't changed and can be used concurrently for reading. +func (c *Constructor) ReconstructHeader(parts []*objectSDK.Object) (*objectSDK.Object, error) { + c.clear() + + if err := c.fillHeader(parts); err != nil { + return nil, err + } + + obj, err := c.reconstructHeader() + if err != nil { + return nil, fmt.Errorf("%w: %w", ErrMalformedSlice, err) + } + return obj, nil +} + +// ReconstructParts reconstructs specific EC parts without reconstructing full object. +// All non-nil objects in parts must have EC header with the same `total` field equal to len(parts). +// The slice must contain at least one non nil object. +// Index of the objects in parts must be equal to it's index field in the EC header. +// Those parts for which corresponding element in required is true must be nil and will be overwritten. +// Because partial reconstruction only makes sense for full objects, all parts must have non-empty payload. +// If key is not nil, all reconstructed parts are signed with this key. +func (c *Constructor) ReconstructParts(parts []*objectSDK.Object, required []bool, key *ecdsa.PrivateKey) error { + if len(required) != len(parts) { + return fmt.Errorf("len(parts) != len(required): %d != %d", len(parts), len(required)) + } + + c.clear() + + if err := c.fillHeader(parts); err != nil { + return err + } + c.fillPayload(parts) + + if err := c.enc.ReconstructSome(c.payloadShards, required); err != nil { + return fmt.Errorf("%w: %w", ErrMalformedSlice, err) + } + if err := c.enc.ReconstructSome(c.headerShards, required); err != nil { + return fmt.Errorf("%w: %w", ErrMalformedSlice, err) + } + + nonNilPart := 0 + for i := range parts { + if parts[i] != nil { + nonNilPart = i + break + } + } + + ec := parts[nonNilPart].GetECHeader() + parent := ec.Parent() + total := ec.Total() + + for i := range required { + if parts[i] != nil || !required[i] { + continue + } + + part := objectSDK.New() + copyRequiredFields(part, parts[nonNilPart]) + part.SetPayload(c.payloadShards[i]) + part.SetPayloadSize(uint64(len(c.payloadShards[i]))) + part.SetECHeader(objectSDK.NewECHeader(parent, uint32(i), total, + c.headerShards[i], c.headerLength)) + + if err := setIDWithSignature(part, key); err != nil { + return err + } + parts[i] = part + } + return nil +} + +func (c *Constructor) reconstructHeader() (*objectSDK.Object, error) { + data, err := reconstructExact(c.enc, int(c.headerLength), c.headerShards) + if err != nil { + return nil, err + } + + var obj objectSDK.Object + return &obj, obj.Unmarshal(data) +} + +func reconstructExact(enc reedsolomon.Encoder, size int, shards [][]byte) ([]byte, error) { + if err := enc.ReconstructData(shards); err != nil { + return nil, err + } + + // Technically, this error will be returned from enc.Join(). + // However, allocating based on unvalidated user data is an easy attack vector. + // Preallocating seems to have enough benefits to justify a slight increase in code complexity. + maxSize := 0 + for i := range shards { + maxSize += len(shards[i]) + } + if size > maxSize { + return nil, reedsolomon.ErrShortData + } + + buf := bytes.NewBuffer(make([]byte, 0, size)) + if err := enc.Join(buf, shards, size); err != nil { + return nil, err + } + return buf.Bytes(), nil +} diff --git a/object/erasurecode/reconstruct_test.go b/object/erasurecode/reconstruct_test.go new file mode 100644 index 0000000..b638a4f --- /dev/null +++ b/object/erasurecode/reconstruct_test.go @@ -0,0 +1,284 @@ +package erasurecode_test + +import ( + "context" + "crypto/rand" + "math" + "testing" + + cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test" + objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/erasurecode" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/transformer" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/version" + "github.com/nspcc-dev/neo-go/pkg/crypto/keys" + "github.com/stretchr/testify/require" +) + +func TestErasureCodeReconstruct(t *testing.T) { + const payloadSize = 99 + const dataCount = 3 + const parityCount = 2 + + // We would also like to test padding behaviour, + // so ensure padding is done. + require.NotZero(t, payloadSize%(dataCount+parityCount)) + + pk, err := keys.NewPrivateKey() + require.NoError(t, err) + + original := newObject(t, payloadSize, pk) + + c, err := erasurecode.NewConstructor(dataCount, parityCount) + require.NoError(t, err) + + parts, err := c.Split(original, &pk.PrivateKey) + require.NoError(t, err) + + t.Run("reconstruct header", func(t *testing.T) { + original := original.CutPayload() + parts := cloneSlice(parts) + for i := range parts { + parts[i] = parts[i].CutPayload() + } + t.Run("from data", func(t *testing.T) { + parts := cloneSlice(parts) + for i := dataCount; i < dataCount+parityCount; i++ { + parts[i] = nil + } + reconstructed, err := c.ReconstructHeader(parts) + require.NoError(t, err) + verifyReconstruction(t, original, reconstructed) + }) + t.Run("from parity", func(t *testing.T) { + parts := cloneSlice(parts) + for i := 0; i < parityCount; i++ { + parts[i] = nil + } + reconstructed, err := c.ReconstructHeader(parts) + require.NoError(t, err) + verifyReconstruction(t, original, reconstructed) + + t.Run("not enough shards", func(t *testing.T) { + parts[parityCount] = nil + _, err := c.ReconstructHeader(parts) + require.ErrorIs(t, err, erasurecode.ErrMalformedSlice) + }) + }) + t.Run("only nil parts", func(t *testing.T) { + parts := make([]*objectSDK.Object, len(parts)) + _, err := c.ReconstructHeader(parts) + require.ErrorIs(t, err, erasurecode.ErrMalformedSlice) + }) + t.Run("missing EC header", func(t *testing.T) { + parts := cloneSlice(parts) + parts[0] = deepCopy(t, parts[0]) + parts[0].SetECHeader(nil) + + _, err := c.ReconstructHeader(parts) + require.ErrorIs(t, err, erasurecode.ErrMalformedSlice) + }) + t.Run("invalid index", func(t *testing.T) { + parts := cloneSlice(parts) + parts[0] = deepCopy(t, parts[0]) + + ec := parts[0].GetECHeader() + ec.SetIndex(1) + parts[0].SetECHeader(ec) + + _, err := c.ReconstructHeader(parts) + require.ErrorIs(t, err, erasurecode.ErrMalformedSlice) + }) + t.Run("invalid total", func(t *testing.T) { + parts := cloneSlice(parts) + parts[0] = deepCopy(t, parts[0]) + + ec := parts[0].GetECHeader() + ec.SetTotal(uint32(len(parts) + 1)) + parts[0].SetECHeader(ec) + + _, err := c.ReconstructHeader(parts) + require.ErrorIs(t, err, erasurecode.ErrMalformedSlice) + }) + t.Run("inconsistent header length", func(t *testing.T) { + parts := cloneSlice(parts) + parts[0] = deepCopy(t, parts[0]) + + ec := parts[0].GetECHeader() + ec.SetHeaderLength(ec.HeaderLength() - 1) + parts[0].SetECHeader(ec) + + _, err := c.ReconstructHeader(parts) + require.ErrorIs(t, err, erasurecode.ErrMalformedSlice) + }) + t.Run("invalid header length", func(t *testing.T) { + parts := cloneSlice(parts) + for i := range parts { + parts[i] = deepCopy(t, parts[i]) + + ec := parts[0].GetECHeader() + ec.SetHeaderLength(math.MaxUint32) + parts[0].SetECHeader(ec) + } + + _, err := c.ReconstructHeader(parts) + require.ErrorIs(t, err, erasurecode.ErrMalformedSlice) + }) + }) + t.Run("reconstruct data", func(t *testing.T) { + t.Run("from data", func(t *testing.T) { + parts := cloneSlice(parts) + for i := dataCount; i < dataCount+parityCount; i++ { + parts[i] = nil + } + reconstructed, err := c.Reconstruct(parts) + require.NoError(t, err) + verifyReconstruction(t, original, reconstructed) + }) + t.Run("from parity", func(t *testing.T) { + parts := cloneSlice(parts) + for i := 0; i < parityCount; i++ { + parts[i] = nil + } + reconstructed, err := c.Reconstruct(parts) + require.NoError(t, err) + verifyReconstruction(t, original, reconstructed) + + t.Run("not enough shards", func(t *testing.T) { + parts[parityCount] = nil + _, err := c.Reconstruct(parts) + require.ErrorIs(t, err, erasurecode.ErrMalformedSlice) + }) + }) + }) + t.Run("reconstruct parts", func(t *testing.T) { + // We would like to also test that ReconstructParts doesn't perform + // excessive work, so ensure this test makes sense. + require.GreaterOrEqual(t, parityCount, 2) + + t.Run("from data", func(t *testing.T) { + oldParts := parts + parts := cloneSlice(parts) + for i := dataCount; i < dataCount+parityCount; i++ { + parts[i] = nil + } + + required := make([]bool, len(parts)) + required[dataCount] = true + + require.NoError(t, c.ReconstructParts(parts, required, nil)) + + old := deepCopy(t, oldParts[dataCount]) + old.SetSignature(nil) + require.Equal(t, old, parts[dataCount]) + + for i := dataCount + 1; i < dataCount+parityCount; i++ { + require.Nil(t, parts[i]) + } + }) + t.Run("from parity", func(t *testing.T) { + oldParts := parts + parts := cloneSlice(parts) + for i := 0; i < parityCount; i++ { + parts[i] = nil + } + + required := make([]bool, len(parts)) + required[0] = true + + require.NoError(t, c.ReconstructParts(parts, required, nil)) + + old := deepCopy(t, oldParts[0]) + old.SetSignature(nil) + require.Equal(t, old, parts[0]) + + for i := 1; i < parityCount; i++ { + require.Nil(t, parts[i]) + } + }) + }) +} + +func newObject(t *testing.T, size uint64, pk *keys.PrivateKey) *objectSDK.Object { + // Use transformer to form object to avoid potential bugs with yet another helper object creation in tests. + tt := &testTarget{} + p := transformer.NewPayloadSizeLimiter(transformer.Params{ + Key: &pk.PrivateKey, + NextTargetInit: func() transformer.ObjectWriter { return tt }, + NetworkState: dummyEpochSource(123), + MaxSize: size + 1, + WithoutHomomorphicHash: true, + }) + cnr := cidtest.ID() + ver := version.Current() + hdr := objectSDK.New() + hdr.SetContainerID(cnr) + hdr.SetType(objectSDK.TypeRegular) + hdr.SetVersion(&ver) + + var owner user.ID + user.IDFromKey(&owner, pk.PrivateKey.PublicKey) + hdr.SetOwnerID(owner) + + var attr objectSDK.Attribute + attr.SetKey("somekey") + attr.SetValue("somevalue") + hdr.SetAttributes(attr) + + expectedPayload := make([]byte, size) + _, _ = rand.Read(expectedPayload) + writeObject(t, context.Background(), p, hdr, expectedPayload) + require.Len(t, tt.objects, 1) + return tt.objects[0] +} + +func writeObject(t *testing.T, ctx context.Context, target transformer.ChunkedObjectWriter, header *objectSDK.Object, payload []byte) *transformer.AccessIdentifiers { + require.NoError(t, target.WriteHeader(ctx, header)) + + _, err := target.Write(ctx, payload) + require.NoError(t, err) + + ids, err := target.Close(ctx) + require.NoError(t, err) + + return ids +} + +func verifyReconstruction(t *testing.T, original, reconstructed *objectSDK.Object) { + require.True(t, reconstructed.VerifyIDSignature()) + reconstructed.ToV2().SetMarshalData(nil) + original.ToV2().SetMarshalData(nil) + + require.Equal(t, original, reconstructed) +} + +func deepCopy(t *testing.T, obj *objectSDK.Object) *objectSDK.Object { + data, err := obj.Marshal() + require.NoError(t, err) + + res := objectSDK.New() + require.NoError(t, res.Unmarshal(data)) + return res +} + +func cloneSlice[T any](src []T) []T { + dst := make([]T, len(src)) + copy(dst, src) + return dst +} + +type dummyEpochSource uint64 + +func (s dummyEpochSource) CurrentEpoch() uint64 { + return uint64(s) +} + +type testTarget struct { + objects []*objectSDK.Object +} + +func (tt *testTarget) WriteObject(_ context.Context, o *objectSDK.Object) error { + tt.objects = append(tt.objects, o) + return nil // AccessIdentifiers should not be used. +} diff --git a/object/erasurecode/split.go b/object/erasurecode/split.go new file mode 100644 index 0000000..b449b27 --- /dev/null +++ b/object/erasurecode/split.go @@ -0,0 +1,69 @@ +package erasurecode + +import ( + "crypto/ecdsa" + + objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" +) + +// Split splits fully formed object into multiple chunks. +func (c *Constructor) Split(obj *objectSDK.Object, key *ecdsa.PrivateKey) ([]*objectSDK.Object, error) { + c.clear() + + header, err := obj.CutPayload().Marshal() + if err != nil { + return nil, err + } + + headerShards, err := c.encodeRaw(header) + if err != nil { + return nil, err + } + payloadShards, err := c.encodeRaw(obj.Payload()) + if err != nil { + return nil, err + } + + parts := make([]*objectSDK.Object, len(payloadShards)) + parent, _ := obj.ID() + for i := range parts { + chunk := objectSDK.New() + copyRequiredFields(chunk, obj) + chunk.SetPayload(payloadShards[i]) + chunk.SetPayloadSize(uint64(len(payloadShards[i]))) + + ec := objectSDK.NewECHeader(parent, uint32(i), uint32(len(payloadShards)), headerShards[i], uint32(len(header))) + chunk.SetECHeader(ec) + if err := setIDWithSignature(chunk, key); err != nil { + return nil, err + } + + parts[i] = chunk + } + return parts, nil +} + +func setIDWithSignature(obj *objectSDK.Object, key *ecdsa.PrivateKey) error { + if err := objectSDK.CalculateAndSetID(obj); err != nil { + return err + } + + objectSDK.CalculateAndSetPayloadChecksum(obj) + + if key == nil { + return nil + } + + return objectSDK.CalculateAndSetSignature(*key, obj) +} + +func (c *Constructor) encodeRaw(data []byte) ([][]byte, error) { + shards, err := c.enc.Split(data) + if err != nil { + return nil, err + } + if err := c.enc.Encode(shards); err != nil { + return nil, err + } + return shards, nil +} diff --git a/object/erasurecode/split_test.go b/object/erasurecode/split_test.go new file mode 100644 index 0000000..9fcba76 --- /dev/null +++ b/object/erasurecode/split_test.go @@ -0,0 +1,36 @@ +package erasurecode_test + +import ( + "testing" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/erasurecode" + "github.com/nspcc-dev/neo-go/pkg/crypto/keys" + "github.com/stretchr/testify/require" +) + +// The library can behave differently for big shard counts. +// This test checks we support the maximum number of chunks we promise. +func TestSplitMaxShardCount(t *testing.T) { + pk, err := keys.NewPrivateKey() + require.NoError(t, err) + + original := newObject(t, 1024, pk) + + t.Run("only data", func(t *testing.T) { + c, err := erasurecode.NewConstructor(erasurecode.MaxShardCount, 0) + require.NoError(t, err) + + parts, err := c.Split(original, &pk.PrivateKey) + require.NoError(t, err) + require.Len(t, parts, erasurecode.MaxShardCount) + }) + t.Run("data + parity", func(t *testing.T) { + c, err := erasurecode.NewConstructor(1, erasurecode.MaxShardCount-1) + require.NoError(t, err) + + parts, err := c.Split(original, &pk.PrivateKey) + require.NoError(t, err) + require.Len(t, parts, erasurecode.MaxShardCount) + }) + +} diff --git a/object/erasurecode/target.go b/object/erasurecode/target.go new file mode 100644 index 0000000..5cd672b --- /dev/null +++ b/object/erasurecode/target.go @@ -0,0 +1,44 @@ +package erasurecode + +import ( + "context" + "crypto/ecdsa" + + objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/transformer" +) + +// Target accepts regular objects and splits them into erasure-coded chunks. +type Target struct { + c *Constructor + key *ecdsa.PrivateKey + next transformer.ObjectWriter +} + +// ObjectWriter is an interface of the object writer that writes prepared object. +type ObjectWriter interface { + WriteObject(context.Context, *objectSDK.Object) error +} + +// NewTarget returns new target instance. +func NewTarget(c *Constructor, key *ecdsa.PrivateKey, next ObjectWriter) *Target { + return &Target{ + c: c, + key: key, + next: next, + } +} + +// WriteObject implements the transformer.ObjectWriter interface. +func (t *Target) WriteObject(ctx context.Context, obj *objectSDK.Object) error { + parts, err := t.c.Split(obj, t.key) + if err != nil { + return err + } + for i := range parts { + if err := t.next.WriteObject(ctx, parts[i]); err != nil { + return err + } + } + return nil +} diff --git a/object/erasurecode/verify.go b/object/erasurecode/verify.go new file mode 100644 index 0000000..8f1acd4 --- /dev/null +++ b/object/erasurecode/verify.go @@ -0,0 +1,104 @@ +package erasurecode + +import ( + "fmt" + + objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" +) + +// Verify verifies that parts are well formed. +// All parts are expected to be non-nil. +// The number of parts must be equal to `total` field of the EC header +// and parts must be sorted by index. +func (c *Constructor) Verify(parts []*objectSDK.Object) error { + c.clear() + + var headerLength int + for i := range parts { + if parts[i] == nil { + return ErrMalformedSlice + } + + var err error + headerLength, err = validatePart(parts, i, headerLength) + if err != nil { + return err + } + } + + p0 := parts[0] + for i := 1; i < len(parts); i++ { + // This part must be kept in sync with copyRequiredFields(). + pi := parts[i] + if p0.OwnerID().Equals(pi.OwnerID()) { + return fmt.Errorf("%w: owner id mismatch: %s != %s", ErrMalformedSlice, p0.OwnerID(), pi.OwnerID()) + } + if p0.Version() == nil && pi.Version() != nil || !p0.Version().Equal(*pi.Version()) { + return fmt.Errorf("%w: version mismatch: %s != %s", ErrMalformedSlice, p0.Version(), pi.Version()) + } + + cnr0, _ := p0.ContainerID() + cnri, _ := pi.ContainerID() + if !cnr0.Equals(cnri) { + return fmt.Errorf("%w: container id mismatch: %s != %s", ErrMalformedSlice, cnr0, cnri) + } + } + + if err := c.fillHeader(parts); err != nil { + return err + } + c.fillPayload(parts) + + ok, err := c.enc.Verify(c.headerShards) + if err != nil { + return err + } + if !ok { + return ErrMalformedSlice + } + + ok, err = c.enc.Verify(c.payloadShards) + if err != nil { + return err + } + if !ok { + return ErrMalformedSlice + } + return nil +} + +// copyRequiredFields sets all fields in dst which are copied from src and shared among all chunks. +// src can be either another chunk of full object. +// dst must be a chunk. +func copyRequiredFields(dst *objectSDK.Object, src *objectSDK.Object) { + dst.SetVersion(src.Version()) + dst.SetOwnerID(src.OwnerID()) + dst.SetCreationEpoch(src.CreationEpoch()) + dst.SetSessionToken(src.SessionToken()) + + cnr, _ := src.ContainerID() + dst.SetContainerID(cnr) +} + +// validatePart makes i-th part is consistent with the rest. +// If headerLength is not zero it is asserted to be equal in the ec header. +// Otherwise, new headerLength is returned. +func validatePart(parts []*objectSDK.Object, i int, headerLength int) (int, error) { + ec := parts[i].GetECHeader() + if ec == nil { + return headerLength, fmt.Errorf("%w: missing EC header", ErrMalformedSlice) + } + if ec.Index() != uint32(i) { + return headerLength, fmt.Errorf("%w: index=%d, ec.index=%d", ErrMalformedSlice, i, ec.Index()) + } + if ec.Total() != uint32(len(parts)) { + return headerLength, fmt.Errorf("%w: len(parts)=%d, total=%d", ErrMalformedSlice, len(parts), ec.Total()) + } + if headerLength == 0 { + return int(ec.HeaderLength()), nil + } + if ec.HeaderLength() != uint32(headerLength) { + return headerLength, fmt.Errorf("%w: header length mismatch %d != %d", ErrMalformedSlice, headerLength, ec.HeaderLength()) + } + return headerLength, nil +} diff --git a/object/object.go b/object/object.go index fde26ae..af16128 100644 --- a/object/object.go +++ b/object/object.go @@ -366,6 +366,14 @@ func (o *Object) Children() []oid.ID { return res } +func (o *Object) GetECHeader() *ECHeader { + v2 := (*object.Object)(o).GetHeader().GetEC() + + var ec ECHeader + _ = ec.ReadFromV2(v2) // Errors is checked on unmarshal. + return &ec +} + // SetChildren sets list of the identifiers of the child objects. func (o *Object) SetChildren(v ...oid.ID) { var ( From 1af9b6d18bdfe7c14a9eaa21062be624d0b81b90 Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Mon, 25 Mar 2024 10:35:17 +0300 Subject: [PATCH 025/197] [#155] sdk-go: Add buffer support for payloadSizeLimiter Signed-off-by: Alexander Chuprov --- client/object_put.go | 3 +++ client/object_put_transformer.go | 12 ++++++++++++ object/transformer/transformer.go | 10 +++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/client/object_put.go b/client/object_put.go index 213ec7f..bf27f4c 100644 --- a/client/object_put.go +++ b/client/object_put.go @@ -4,6 +4,7 @@ import ( "context" "crypto/ecdsa" + buffPool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" @@ -36,6 +37,8 @@ type PrmObjectPutInit struct { WithoutHomomorphHash bool Key *ecdsa.PrivateKey + + Pool *buffPool.BufferPool } // SetCopiesNumber sets number of object copies that is enough to consider put successful. diff --git a/client/object_put_transformer.go b/client/object_put_transformer.go index 523603c..2347a4f 100644 --- a/client/object_put_transformer.go +++ b/client/object_put_transformer.go @@ -3,6 +3,7 @@ package client import ( "context" + buffPool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/transformer" @@ -26,6 +27,7 @@ func (c *Client) objectPutInitTransformer(prm PrmObjectPutInit) (*objectWriterTr MaxSize: prm.MaxSize, WithoutHomomorphicHash: prm.WithoutHomomorphHash, NetworkState: prm.EpochSource, + Pool: prm.Pool, }) return &w, nil } @@ -114,6 +116,7 @@ func (it *internalTarget) tryPutSingle(ctx context.Context, o *object.Object) (b } if err == nil { + it.returnBuffPool(o.Payload()) id, _ := o.ID() it.res = &ResObjectPut{ statusRes: res.statusRes, @@ -126,3 +129,12 @@ func (it *internalTarget) tryPutSingle(ctx context.Context, o *object.Object) (b } return true, err } + +func (it *internalTarget) returnBuffPool(playback []byte) { + if it.prm.Pool == nil { + return + } + var buffer buffPool.Buffer + buffer.Data = playback + it.prm.Pool.Put(&buffer) +} diff --git a/object/transformer/transformer.go b/object/transformer/transformer.go index 4b27de8..37d5471 100644 --- a/object/transformer/transformer.go +++ b/object/transformer/transformer.go @@ -6,6 +6,7 @@ import ( "crypto/sha256" "fmt" + buffPool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/checksum" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" @@ -45,6 +46,7 @@ type Params struct { // functionality. Primary usecases are providing file size when putting an object // with the frostfs-cli or using Content-Length header in gateways. SizeHint uint64 + Pool *buffPool.BufferPool } // NewPayloadSizeLimiter returns ObjectTarget instance that restricts payload length @@ -137,7 +139,13 @@ func (s *payloadSizeLimiter) initializeCurrent() { payloadSize = remaining % s.MaxSize } } - s.payload = make([]byte, 0, payloadSize) + + if s.Pool == nil { + s.payload = make([]byte, 0, payloadSize) + } else { + buffer := s.Pool.Get(uint32(payloadSize)) + s.payload = buffer.Data[:0] + } } func (s *payloadSizeLimiter) initPayloadHashers() { From 6d0da3f86102f3a0d2f26d0cc6948382c83e3dc0 Mon Sep 17 00:00:00 2001 From: aarifullin Date: Wed, 27 Mar 2024 14:32:59 +0300 Subject: [PATCH 026/197] [#211] go.mod: Update frostfs-api-go version Signed-off-by: Airat Arifullin --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 97bcd88..0c9cdbf 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.20 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240319122301-1772b921826b + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240327095603-491a47e7fe24 git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 git.frostfs.info/TrueCloudLab/hrw v1.2.1 diff --git a/go.sum b/go.sum index 66eeb94..d3ecf3b 100644 --- a/go.sum +++ b/go.sum @@ -31,8 +31,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl 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-api-go/v2 v2.16.1-0.20240319122301-1772b921826b h1:PoGgzbf+uU+aPJb8etqAqaeoImLYRickZyf/nQ7+vcY= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240319122301-1772b921826b/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240327095603-491a47e7fe24 h1:uIkl0mKWwDICUZTbNWZ38HLYDBI9rMgdAhYQWZ0C9iQ= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240327095603-491a47e7fe24/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb h1:S/TrbOOu9qEXZRZ9/Ddw7crnxbBUQLo68PSzQWYrc9M= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb/go.mod h1:nkR5gaGeez3Zv2SE7aceP0YwxG2FzIB5cGKpQO2vV2o= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= From 425d48f68b11ffdd848edad7eb49230139a0209d Mon Sep 17 00:00:00 2001 From: aarifullin Date: Wed, 27 Mar 2024 14:43:23 +0300 Subject: [PATCH 027/197] [#211] netmap: Introduce ReplicaDescriptor method * Make ReplicaNumberByIndex deprecated. * Introduce ReplicaDescriptor method that access i-th replica directly. * Introduce new getters for ReplicaDescriptor. Signed-off-by: Airat Arifullin --- netmap/policy.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/netmap/policy.go b/netmap/policy.go index 3ab77c2..bbc8aba 100644 --- a/netmap/policy.go +++ b/netmap/policy.go @@ -139,6 +139,14 @@ func (r *ReplicaDescriptor) SetNumberOfObjects(c uint32) { r.m.SetCount(c) } +func (r ReplicaDescriptor) SetECDataCount(v uint32) { + r.m.SetECDataCount(v) +} + +func (r ReplicaDescriptor) SetECParityCount(v uint32) { + r.m.SetECParityCount(v) +} + // NumberOfObjects returns number set using SetNumberOfObjects. // // Zero ReplicaDescriptor has zero number of objects. @@ -146,6 +154,19 @@ func (r ReplicaDescriptor) NumberOfObjects() uint32 { return r.m.GetCount() } +func (r ReplicaDescriptor) GetECDataCount() uint32 { + return r.m.GetECDataCount() +} + +func (r ReplicaDescriptor) GetECParityCount() uint32 { + return r.m.GetECParityCount() +} + +// TotalECPartCount returns total sum of ECDataCount and ECParityCount. +func (r ReplicaDescriptor) TotalECPartCount() uint32 { + return r.m.GetECDataCount() + r.m.GetECParityCount() +} + // SetSelectorName sets name of the related Selector. // // Zero ReplicaDescriptor references to the root bucket's selector: it contains @@ -179,10 +200,19 @@ func (p PlacementPolicy) NumberOfReplicas() int { // descriptor. Index MUST be in range [0; NumberOfReplicas()). // // Zero PlacementPolicy has no replicas. +// +// Deprecated: Use PlacementPolicy.ReplicaDescriptor(int).NumberOfObjects() instead. func (p PlacementPolicy) ReplicaNumberByIndex(i int) uint32 { return p.replicas[i].GetCount() } +// ReplicaDescriptor returns i-th replica descriptor. Index MUST be in range [0; NumberOfReplicas()). +func (p PlacementPolicy) ReplicaDescriptor(i int) ReplicaDescriptor { + return ReplicaDescriptor{ + m: p.replicas[i], + } +} + // SetContainerBackupFactor sets container backup factor: it controls how deep // FrostFS will search for nodes alternatives to include into container's nodes subset. // From ec0cb2169f92fd57f2585980d1f1e08ac18d9fda Mon Sep 17 00:00:00 2001 From: aarifullin Date: Thu, 28 Mar 2024 18:53:34 +0300 Subject: [PATCH 028/197] [#211] object: Fix setIDWithSignature * Calculate and set checksum before ID is calculated. * Add header verification for parts in unit-test. Signed-off-by: Airat Arifullin --- object/erasurecode/split.go | 4 ++-- object/erasurecode/split_test.go | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/object/erasurecode/split.go b/object/erasurecode/split.go index b449b27..196de4a 100644 --- a/object/erasurecode/split.go +++ b/object/erasurecode/split.go @@ -44,12 +44,12 @@ func (c *Constructor) Split(obj *objectSDK.Object, key *ecdsa.PrivateKey) ([]*ob } func setIDWithSignature(obj *objectSDK.Object, key *ecdsa.PrivateKey) error { + objectSDK.CalculateAndSetPayloadChecksum(obj) + if err := objectSDK.CalculateAndSetID(obj); err != nil { return err } - objectSDK.CalculateAndSetPayloadChecksum(obj) - if key == nil { return nil } diff --git a/object/erasurecode/split_test.go b/object/erasurecode/split_test.go index 9fcba76..e82bd51 100644 --- a/object/erasurecode/split_test.go +++ b/object/erasurecode/split_test.go @@ -3,6 +3,7 @@ package erasurecode_test import ( "testing" + objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/erasurecode" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "github.com/stretchr/testify/require" @@ -23,6 +24,10 @@ func TestSplitMaxShardCount(t *testing.T) { parts, err := c.Split(original, &pk.PrivateKey) require.NoError(t, err) require.Len(t, parts, erasurecode.MaxShardCount) + + for _, part := range parts { + require.NoError(t, objectSDK.CheckHeaderVerificationFields(part)) + } }) t.Run("data + parity", func(t *testing.T) { c, err := erasurecode.NewConstructor(1, erasurecode.MaxShardCount-1) @@ -31,6 +36,10 @@ func TestSplitMaxShardCount(t *testing.T) { parts, err := c.Split(original, &pk.PrivateKey) require.NoError(t, err) require.Len(t, parts, erasurecode.MaxShardCount) + + for _, part := range parts { + require.NoError(t, objectSDK.CheckHeaderVerificationFields(part)) + } }) } From 3790142b10c765e69c80c1789c347fde969c103a Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Mon, 1 Apr 2024 13:17:28 +0300 Subject: [PATCH 029/197] [#212] pool: Control sub tree nodes order Signed-off-by: Alex Vanin --- pool/tree/pool.go | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/pool/tree/pool.go b/pool/tree/pool.go index 38ef09e..28cc98b 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -26,6 +26,16 @@ const ( defaultStreamTimeout = 10 * time.Second ) +// SubTreeSort defines an order of nodes returned from GetSubTree RPC. +type SubTreeSort int32 + +const ( + // NoneOrder does not specify order of nodes returned in GetSubTree RPC. + NoneOrder SubTreeSort = iota + // AscendingOrder specifies ascending alphabetical order of nodes based on FilePath attribute. + AscendingOrder +) + var ( // ErrNodeNotFound is returned from Tree service in case of not found error. ErrNodeNotFound = errors.New("not found") @@ -119,6 +129,7 @@ type GetSubTreeParams struct { RootID uint64 Depth uint32 BearerToken []byte + Order SubTreeSort } // AddNodeParams groups parameters of Pool.AddNode operation. @@ -388,12 +399,17 @@ func (p *Pool) GetSubTree(ctx context.Context, prm GetSubTreeParams) (*SubTreeRe RootId: prm.RootID, Depth: prm.Depth, BearerToken: prm.BearerToken, - OrderBy: &grpcService.GetSubTreeRequest_Body_Order{ - Direction: grpcService.GetSubTreeRequest_Body_Order_Asc, - }, + OrderBy: new(grpcService.GetSubTreeRequest_Body_Order), }, } + switch prm.Order { + case AscendingOrder: + request.Body.OrderBy.Direction = grpcService.GetSubTreeRequest_Body_Order_Asc + default: + request.Body.OrderBy.Direction = grpcService.GetSubTreeRequest_Body_Order_None + } + if err := p.signRequest(request.Body, func(key, sign []byte) { request.Signature = &grpcService.Signature{ Key: key, From 20ab57bf7ec3b271d474799a68dd226e5e8da1ca Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Mon, 22 Apr 2024 09:51:20 +0300 Subject: [PATCH 030/197] [#214] object: Implement `Get\Head` requests for EC object Signed-off-by: Anton Nikiforov --- client/object_get.go | 5 ++++ go.mod | 2 +- go.sum | 4 +-- object/ecinfo.go | 69 ++++++++++++++++++++++++++++++++++++++++++++ object/error.go | 18 ++++++++++++ object/error_test.go | 43 +++++++++++++++++++++++++++ pool/pool.go | 4 +++ 7 files changed, 142 insertions(+), 3 deletions(-) create mode 100644 object/ecinfo.go diff --git a/client/object_get.go b/client/object_get.go index 363c1ec..a97fa76 100644 --- a/client/object_get.go +++ b/client/object_get.go @@ -150,6 +150,9 @@ func (x *ObjectReader) ReadHeader(dst *object.Object) bool { case *v2object.SplitInfo: x.err = object.NewSplitInfoError(object.NewSplitInfoFromV2(v)) return false + case *v2object.ECInfo: + x.err = object.NewECInfoError(object.NewECInfoFromV2(v)) + return false case *v2object.GetObjectPartInit: partInit = v } @@ -502,6 +505,8 @@ func (c *Client) ObjectHead(ctx context.Context, prm PrmObjectHead) (*ResObjectH return nil, fmt.Errorf("unexpected header type %T", v) case *v2object.SplitInfo: return nil, object.NewSplitInfoError(object.NewSplitInfoFromV2(v)) + case *v2object.ECInfo: + return nil, object.NewECInfoError(object.NewECInfoFromV2(v)) case *v2object.HeaderWithSignature: res.hdr = v } diff --git a/go.mod b/go.mod index 0c9cdbf..b5bc388 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.20 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240327095603-491a47e7fe24 + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240422151450-df9b65324a4c git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 git.frostfs.info/TrueCloudLab/hrw v1.2.1 diff --git a/go.sum b/go.sum index d3ecf3b..1a30d38 100644 --- a/go.sum +++ b/go.sum @@ -31,8 +31,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl 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-api-go/v2 v2.16.1-0.20240327095603-491a47e7fe24 h1:uIkl0mKWwDICUZTbNWZ38HLYDBI9rMgdAhYQWZ0C9iQ= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240327095603-491a47e7fe24/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240422151450-df9b65324a4c h1:RFDrNsF2e+EJfaB8lZrRRxNjQkLfM09gnEyudvGuc10= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240422151450-df9b65324a4c/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb h1:S/TrbOOu9qEXZRZ9/Ddw7crnxbBUQLo68PSzQWYrc9M= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb/go.mod h1:nkR5gaGeez3Zv2SE7aceP0YwxG2FzIB5cGKpQO2vV2o= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= diff --git a/object/ecinfo.go b/object/ecinfo.go new file mode 100644 index 0000000..85345a7 --- /dev/null +++ b/object/ecinfo.go @@ -0,0 +1,69 @@ +package object + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" +) + +type ECChunk object.ECChunk + +func (c *ECChunk) SetID(id oid.ID) { + objV2 := new(refs.ObjectID) + id.WriteToV2(objV2) + c.ID = *objV2 +} + +// ToV2 converts ECChunk to v2 ECChunk message. +// +// Nil ECChunk converts to nil. +func (c *ECChunk) ToV2() *object.ECChunk { + return (*object.ECChunk)(c) +} + +func NewECChunkFromV2(v2 *object.ECChunk) *ECChunk { + return (*ECChunk)(v2) +} + +type ECInfo object.ECInfo + +// NewECInfoFromV2 wraps v2 ECInfo message to ECInfo. +// +// Nil object.ECInfo converts to nil. +func NewECInfoFromV2(v2 *object.ECInfo) *ECInfo { + return (*ECInfo)(v2) +} + +// NewECInfo creates and initializes blank ECInfo. +func NewECInfo() *ECInfo { + return NewECInfoFromV2(new(object.ECInfo)) +} + +// ToV2 converts ECInfo to v2 ECInfo message. +// +// Nil ECInfo converts to nil. +func (s *ECInfo) ToV2() *object.ECInfo { + return (*object.ECInfo)(s) +} + +func (s *ECInfo) Marshal() ([]byte, error) { + return (*object.ECInfo)(s).StableMarshal(nil), nil +} + +func (s *ECInfo) Unmarshal(data []byte) error { + return (*object.ECInfo)(s).Unmarshal(data) +} + +// MarshalJSON implements json.Marshaler. +func (s *ECInfo) MarshalJSON() ([]byte, error) { + return (*object.ECInfo)(s).MarshalJSON() +} + +// UnmarshalJSON implements json.Unmarshaler. +func (s *ECInfo) UnmarshalJSON(data []byte) error { + return (*object.ECInfo)(s).UnmarshalJSON(data) +} + +func (s *ECInfo) AddChunk(chunk ECChunk) { + s.Chunks = append(s.Chunks, *chunk.ToV2()) +} diff --git a/object/error.go b/object/error.go index 96048c2..8db1d94 100644 --- a/object/error.go +++ b/object/error.go @@ -17,3 +17,21 @@ func (s *SplitInfoError) SplitInfo() *SplitInfo { func NewSplitInfoError(v *SplitInfo) *SplitInfoError { return &SplitInfoError{si: v} } + +type ECInfoError struct { + ei *ECInfo +} + +const ecInfoErrorMsg = "object not found, ec info has been provided" + +func (e *ECInfoError) Error() string { + return ecInfoErrorMsg +} + +func (e *ECInfoError) ECInfo() *ECInfo { + return e.ei +} + +func NewECInfoError(v *ECInfo) *ECInfoError { + return &ECInfoError{ei: v} +} diff --git a/object/error_test.go b/object/error_test.go index a0774b0..0e52b39 100644 --- a/object/error_test.go +++ b/object/error_test.go @@ -1,9 +1,12 @@ package object_test import ( + "crypto/rand" "errors" "testing" + objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" "github.com/stretchr/testify/require" ) @@ -31,3 +34,43 @@ func generateSplitInfo() *object.SplitInfo { return si } + +func TestNewECInfoError(t *testing.T) { + var ( + ei = generateECInfo() + + err error = object.NewECInfoError(ei) + expectedErr *object.ECInfoError + ) + + require.True(t, errors.As(err, &expectedErr)) + + eiErr, ok := err.(*object.ECInfoError) + require.True(t, ok) + require.Equal(t, ei, eiErr.ECInfo()) +} + +func generateECInfo() *object.ECInfo { + ei := object.NewECInfo() + ei.Chunks = append(ei.Chunks, objectV2.ECChunk{ + ID: generateV2ID(), + Index: 0, + Total: 2, + }) + ei.Chunks = append(ei.Chunks, objectV2.ECChunk{ + ID: generateV2ID(), + Index: 1, + Total: 2, + }) + return ei +} + +func generateV2ID() refs.ObjectID { + var buf [32]byte + _, _ = rand.Read(buf[:]) + + var id refs.ObjectID + id.SetValue(buf[:]) + + return id +} diff --git a/pool/pool.go b/pool/pool.go index 7392e48..a4ffff1 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -1182,6 +1182,10 @@ func needCountError(ctx context.Context, err error) bool { if errors.As(err, &siErr) { return false } + var eiErr *object.ECInfoError + if errors.As(err, &eiErr) { + return false + } if errors.Is(ctx.Err(), context.Canceled) { return false From 12ddefe07877933bfdf28942d3b355650dd33ed7 Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Sat, 27 Apr 2024 23:06:15 +0300 Subject: [PATCH 031/197] [#218] object: Implement `Range\RangeHash` requests for EC object Signed-off-by: Anton Nikiforov --- client/object_get.go | 6 ++++++ go.mod | 2 +- go.sum | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/client/object_get.go b/client/object_get.go index a97fa76..8c821de 100644 --- a/client/object_get.go +++ b/client/object_get.go @@ -261,6 +261,7 @@ func (x *ObjectReader) close(ignoreEOF bool) (*ResObjectGet, error) { // Return errors: // // *object.SplitInfoError (returned on virtual objects with PrmObjectGet.MakeRaw). +// *object.ECInfoError (returned on erasure-coded objects with PrmObjectGet.MakeRaw). // // Return statuses: // - global (see Client docs); @@ -457,6 +458,7 @@ func (prm *PrmObjectHead) buildRequest(c *Client) (*v2object.HeadRequest, error) // Return errors: // // *object.SplitInfoError (returned on virtual objects with PrmObjectHead.MakeRaw). +// *object.ECInfoError (returned on erasure-coded objects with PrmObjectHead.MakeRaw). // // Return statuses: // - global (see Client docs); @@ -670,6 +672,9 @@ func (x *ObjectRangeReader) readChunk(buf []byte) (int, bool) { case *v2object.SplitInfo: x.err = object.NewSplitInfoError(object.NewSplitInfoFromV2(v)) return read, false + case *v2object.ECInfo: + x.err = object.NewECInfoError(object.NewECInfoFromV2(v)) + return read, false case *v2object.GetRangePartChunk: partChunk = v } @@ -730,6 +735,7 @@ func (x *ObjectRangeReader) close(ignoreEOF bool) (*ResObjectRange, error) { // Return errors: // // *object.SplitInfoError (returned on virtual objects with PrmObjectRange.MakeRaw). +// *object.ECInfoError (returned on erasure-coded objects with PrmObjectRange.MakeRaw). // // Return statuses: // - global (see Client docs); diff --git a/go.mod b/go.mod index b5bc388..d600ded 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.20 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240422151450-df9b65324a4c + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240427200446-67c6f305b21f git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 git.frostfs.info/TrueCloudLab/hrw v1.2.1 diff --git a/go.sum b/go.sum index 1a30d38..754d2d7 100644 --- a/go.sum +++ b/go.sum @@ -33,6 +33,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240422151450-df9b65324a4c h1:RFDrNsF2e+EJfaB8lZrRRxNjQkLfM09gnEyudvGuc10= git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240422151450-df9b65324a4c/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240427200446-67c6f305b21f h1:YyjsQNtrngQzIKOUtApXoi5r5pewatM+cXfpY19vZWo= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240427200446-67c6f305b21f/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb h1:S/TrbOOu9qEXZRZ9/Ddw7crnxbBUQLo68PSzQWYrc9M= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb/go.mod h1:nkR5gaGeez3Zv2SE7aceP0YwxG2FzIB5cGKpQO2vV2o= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= From 99e02858af12303288bea20f8a759abc53c56d1d Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Tue, 7 May 2024 09:30:31 +0300 Subject: [PATCH 032/197] [#220] netmap: Fix setters for `Replica.DataCount/ParityCount` Signed-off-by: Anton Nikiforov --- netmap/policy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netmap/policy.go b/netmap/policy.go index bbc8aba..545fb5c 100644 --- a/netmap/policy.go +++ b/netmap/policy.go @@ -139,11 +139,11 @@ func (r *ReplicaDescriptor) SetNumberOfObjects(c uint32) { r.m.SetCount(c) } -func (r ReplicaDescriptor) SetECDataCount(v uint32) { +func (r *ReplicaDescriptor) SetECDataCount(v uint32) { r.m.SetECDataCount(v) } -func (r ReplicaDescriptor) SetECParityCount(v uint32) { +func (r *ReplicaDescriptor) SetECParityCount(v uint32) { r.m.SetECParityCount(v) } From 02c936f397c7bb9e1e7ca4e71b548f4deaaa32a1 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Thu, 2 May 2024 17:13:08 +0300 Subject: [PATCH 033/197] [#216] netmap: Add policy decode fuzz test Signed-off-by: Dmitrii Stepanov --- go.mod | 1 + go.sum | 6 +++--- netmap/policy_decode_test.go | 26 +++++++++++++------------- netmap/policy_fuzz.go | 14 ++++++++++++++ netmap/policy_fuzz_test.go | 17 +++++++++++++++++ 5 files changed, 48 insertions(+), 16 deletions(-) create mode 100644 netmap/policy_fuzz.go create mode 100644 netmap/policy_fuzz_test.go diff --git a/go.mod b/go.mod index d600ded..88eaaf0 100644 --- a/go.mod +++ b/go.mod @@ -34,6 +34,7 @@ require ( github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20230615193820-9185820289ce // indirect github.com/nspcc-dev/rfc6979 v0.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/twmb/murmur3 v1.1.8 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/goleak v1.2.1 // indirect diff --git a/go.sum b/go.sum index 754d2d7..f9212b2 100644 --- a/go.sum +++ b/go.sum @@ -31,8 +31,6 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl 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-api-go/v2 v2.16.1-0.20240422151450-df9b65324a4c h1:RFDrNsF2e+EJfaB8lZrRRxNjQkLfM09gnEyudvGuc10= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240422151450-df9b65324a4c/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240427200446-67c6f305b21f h1:YyjsQNtrngQzIKOUtApXoi5r5pewatM+cXfpY19vZWo= git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240427200446-67c6f305b21f/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb h1:S/TrbOOu9qEXZRZ9/Ddw7crnxbBUQLo68PSzQWYrc9M= @@ -302,6 +300,7 @@ github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -334,8 +333,9 @@ github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= 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/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= +github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= diff --git a/netmap/policy_decode_test.go b/netmap/policy_decode_test.go index f42d3b5..536d66b 100644 --- a/netmap/policy_decode_test.go +++ b/netmap/policy_decode_test.go @@ -7,50 +7,50 @@ import ( "github.com/stretchr/testify/require" ) -func TestDecodeString(t *testing.T) { - testCases := []string{ - `REP 2 +var validPlacementPolicy = []string{ + `REP 2 CBF 2 SELECT 2 FROM *`, - `REP 1 IN X + `REP 1 IN X CBF 1 SELECT 2 IN SAME Location FROM * AS X`, - `REP 1 IN X + `REP 1 IN X REP 2 IN Y CBF 1 SELECT 2 FROM * AS X SELECT 3 FROM * AS Y`, - `REP 1 IN X + `REP 1 IN X SELECT 2 IN City FROM Good AS X FILTER Country EQ RU AS FromRU FILTER Country EQ EN AS FromEN FILTER @FromRU AND @FromEN AND Rating GT 7 AS Good`, - `REP 7 IN SPB + `REP 7 IN SPB SELECT 1 IN City FROM SPBSSD AS SPB FILTER City EQ SPB AND SSD EQ true OR City EQ SPB AND Rating GE 5 AS SPBSSD`, - `REP 7 IN SPB + `REP 7 IN SPB SELECT 1 IN City FROM SPBSSD AS SPB FILTER NOT (NOT (City EQ SPB) AND SSD EQ true OR City EQ SPB AND Rating GE 5) AS SPBSSD`, - `REP 1 IN FNODE + `REP 1 IN FNODE CBF 1 SELECT 1 FROM F AS FNODE FILTER Node EQ '10.78.8.11' AS F`, - `UNIQUE + `UNIQUE REP 1 REP 1`, - `EC 1.2 IN X + `EC 1.2 IN X SELECT 3 IN City FROM * AS X`, - } +} +func TestDecodeString(t *testing.T) { var p PlacementPolicy - for _, testCase := range testCases { + for _, testCase := range validPlacementPolicy { require.NoError(t, p.DecodeString(testCase), "unable parse %s", testCase) var b strings.Builder require.NoError(t, p.WriteStringTo(&b)) diff --git a/netmap/policy_fuzz.go b/netmap/policy_fuzz.go new file mode 100644 index 0000000..40088e9 --- /dev/null +++ b/netmap/policy_fuzz.go @@ -0,0 +1,14 @@ +//go:build gofuzz +// +build gofuzz + +package netmap + +func DoFuzzPlacementPolicyDecode(data []byte) int { + p := string(data) + if p == "" { + return 0 + } + var pp PlacementPolicy + _ = pp.DecodeString(p) + return 1 +} diff --git a/netmap/policy_fuzz_test.go b/netmap/policy_fuzz_test.go new file mode 100644 index 0000000..35b69a4 --- /dev/null +++ b/netmap/policy_fuzz_test.go @@ -0,0 +1,17 @@ +//go:build gofuzz +// +build gofuzz + +package netmap + +import ( + "testing" +) + +func FuzzDecodeString(f *testing.F) { + for _, pp := range validPlacementPolicy { + f.Add([]byte(pp)) + } + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzPlacementPolicyDecode(data) + }) +} From eaf36706a2311e0d03e91526fd33efd757207447 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Mon, 6 May 2024 16:22:42 +0300 Subject: [PATCH 034/197] [#215] go.mod: Update frostfs-api-go/v2 package version Signed-off-by: Airat Arifullin --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 88eaaf0..cbe2d94 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.20 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240427200446-67c6f305b21f + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240506114654-b171364079c3 git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 git.frostfs.info/TrueCloudLab/hrw v1.2.1 diff --git a/go.sum b/go.sum index f9212b2..f730e59 100644 --- a/go.sum +++ b/go.sum @@ -31,8 +31,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl 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-api-go/v2 v2.16.1-0.20240427200446-67c6f305b21f h1:YyjsQNtrngQzIKOUtApXoi5r5pewatM+cXfpY19vZWo= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240427200446-67c6f305b21f/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240506114654-b171364079c3 h1:Fhkq+F6AiYhkJlqq0IXnA5eUuTPbhRqAwlcHTPzUF2g= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240506114654-b171364079c3/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb h1:S/TrbOOu9qEXZRZ9/Ddw7crnxbBUQLo68PSzQWYrc9M= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb/go.mod h1:nkR5gaGeez3Zv2SE7aceP0YwxG2FzIB5cGKpQO2vV2o= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= From 32a975a20d96029d6edef148a9ea15a65f1e5b3a Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Mon, 6 May 2024 16:26:51 +0300 Subject: [PATCH 035/197] [#215] apemanager: Introduce apemanager types * Introduce `Chain`, `ChainTarget` and `TargetType`. * Implement api-v2 converters for the introduced types. * Add unit-tests. Signed-off-by: Airat Arifullin --- apemanager/chain.go | 52 ++++++++++++++++++++++++++ apemanager/chain_target.go | 53 +++++++++++++++++++++++++++ apemanager/chain_target_test.go | 65 +++++++++++++++++++++++++++++++++ apemanager/chain_test.go | 43 ++++++++++++++++++++++ 4 files changed, 213 insertions(+) create mode 100644 apemanager/chain.go create mode 100644 apemanager/chain_target.go create mode 100644 apemanager/chain_target_test.go create mode 100644 apemanager/chain_test.go diff --git a/apemanager/chain.go b/apemanager/chain.go new file mode 100644 index 0000000..0a4cec4 --- /dev/null +++ b/apemanager/chain.go @@ -0,0 +1,52 @@ +package apemanager + +import ( + "errors" + "fmt" + + apemanager_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" +) + +var ( + ErrInvalidChainRepresentation = errors.New("invalid chain representation") +) + +// ChainID is Chain's identifier. +type ChainID []byte + +// Chain is an SDK representation for v2's Chain. +// +// Note that Chain (as well as v2's Chain) and all related entities +// are NOT operated by Access-Policy-Engine (APE). The client is responsible +// to convert these types to policy-engine entities. +type Chain struct { + // Raw is the encoded chain kind. + // It assumes that Raw's bytes are the result of encoding provided by + // policy-engine package. + Raw []byte +} + +// ToV2 converts Chain to v2. +func (c *Chain) ToV2() *apemanager_v2.Chain { + v2ct := new(apemanager_v2.Chain) + + if c.Raw != nil { + v2Raw := new(apemanager_v2.ChainRaw) + v2Raw.SetRaw(c.Raw) + v2ct.SetKind(v2Raw) + } + + return v2ct +} + +// ReadFromV2 fills Chain from v2. +func (c *Chain) ReadFromV2(v2ct *apemanager_v2.Chain) error { + switch v := v2ct.GetKind().(type) { + default: + return fmt.Errorf("unsupported chain kind: %T", v) + case *apemanager_v2.ChainRaw: + raw := v.GetRaw() + c.Raw = raw + } + return nil +} diff --git a/apemanager/chain_target.go b/apemanager/chain_target.go new file mode 100644 index 0000000..70cf9dc --- /dev/null +++ b/apemanager/chain_target.go @@ -0,0 +1,53 @@ +package apemanager + +import ( + apemanager_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" +) + +// TargetType is an SDK representation for v2's TargetType. +type TargetType apemanager_v2.TargetType + +const ( + TargetTypeUndefined TargetType = iota + TargetTypeNamespace + TargetTypeContainer + TargetTypeUser + TargetTypeGroup +) + +// ToV2 converts TargetType to v2. +func (targetType TargetType) ToV2() apemanager_v2.TargetType { + return apemanager_v2.TargetType(targetType) +} + +// FromV2 reads TargetType to v2. +func (targetType *TargetType) FromV2(v2targetType apemanager_v2.TargetType) { + *targetType = TargetType(v2targetType) +} + +// ChainTarget is an SDK representation for v2's ChainTarget. +// +// Note that ChainTarget (as well as v2's ChainTarget) and all related entities +// are NOT operated by Access-Policy-Engine (APE). The client is responsible +// to convert these types to policy-engine entities. +type ChainTarget struct { + TargetType TargetType + + Name string +} + +// ToV2 converts ChainTarget to v2. +func (ct *ChainTarget) ToV2() *apemanager_v2.ChainTarget { + v2ct := new(apemanager_v2.ChainTarget) + + v2ct.SetTargetType(ct.TargetType.ToV2()) + v2ct.SetName(ct.Name) + + return v2ct +} + +// FromV2 reads ChainTarget frpm v2. +func (ct *ChainTarget) FromV2(v2ct *apemanager_v2.ChainTarget) { + ct.TargetType.FromV2(v2ct.GetTargetType()) + ct.Name = v2ct.GetName() +} diff --git a/apemanager/chain_target_test.go b/apemanager/chain_target_test.go new file mode 100644 index 0000000..a5e5fb7 --- /dev/null +++ b/apemanager/chain_target_test.go @@ -0,0 +1,65 @@ +package apemanager_test + +import ( + "testing" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/apemanager" + "github.com/stretchr/testify/require" + + apemanager_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" +) + +var ( + m = map[apemanager.TargetType]apemanager_v2.TargetType{ + apemanager.TargetTypeUndefined: apemanager_v2.TargetTypeUndefined, + apemanager.TargetTypeNamespace: apemanager_v2.TargetTypeNamespace, + apemanager.TargetTypeContainer: apemanager_v2.TargetTypeContainer, + apemanager.TargetTypeUser: apemanager_v2.TargetTypeUser, + apemanager.TargetTypeGroup: apemanager_v2.TargetTypeGroup, + } +) + +func TestTargetType(t *testing.T) { + for typesdk, typev2 := range m { + t.Run("from sdk to v2 "+typev2.String(), func(t *testing.T) { + v2 := typesdk.ToV2() + require.Equal(t, v2, typev2) + }) + + t.Run("from v2 to sdk "+typev2.String(), func(t *testing.T) { + var typ apemanager.TargetType + typ.FromV2(typev2) + require.Equal(t, typesdk, typ) + }) + } +} + +func TestChainTarget(t *testing.T) { + var ( + typ = apemanager.TargetTypeNamespace + name = "namespaceXXYYZZ" + ) + + t.Run("from sdk to v2", func(t *testing.T) { + ct := apemanager.ChainTarget{ + TargetType: typ, + Name: name, + } + + v2 := ct.ToV2() + require.Equal(t, m[typ], v2.GetTargetType()) + require.Equal(t, name, v2.GetName()) + }) + + t.Run("from v2 to sdk", func(t *testing.T) { + v2 := &apemanager_v2.ChainTarget{} + v2.SetTargetType(m[typ]) + v2.SetName(name) + + var ct apemanager.ChainTarget + ct.FromV2(v2) + + require.Equal(t, typ, ct.TargetType) + require.Equal(t, name, ct.Name) + }) +} diff --git a/apemanager/chain_test.go b/apemanager/chain_test.go new file mode 100644 index 0000000..fbe1818 --- /dev/null +++ b/apemanager/chain_test.go @@ -0,0 +1,43 @@ +package apemanager_test + +import ( + "testing" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/apemanager" + "github.com/stretchr/testify/require" + + apemanager_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" +) + +const ( + encoded = `{"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"}` +) + +func TestChainData(t *testing.T) { + t.Run("raw chain", func(t *testing.T) { + var c apemanager.Chain + + b := []byte(encoded) + c.Raw = b + + v2, ok := c.ToV2().GetKind().(*apemanager_v2.ChainRaw) + require.True(t, ok) + require.Equal(t, b, v2.Raw) + }) +} + +func TestChainMessageV2(t *testing.T) { + b := []byte(encoded) + + v2Raw := &apemanager_v2.ChainRaw{} + v2Raw.SetRaw(b) + + v2 := &apemanager_v2.Chain{} + v2.SetKind(v2Raw) + + var c apemanager.Chain + c.ReadFromV2(v2) + + require.NotNil(t, c.Raw) + require.Equal(t, b, c.Raw) +} From b2ad1f3b3e4f2d82ea6d36b810f944de2ed283ee Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Mon, 6 May 2024 16:33:20 +0300 Subject: [PATCH 036/197] [#215] client: Introduce apemanager rpc interface * Introduce `APEManagerAddChain`, `APEManagerRemoveChain`, `APEManagerListChains`. * Introduce reqeuest/response types for these handlers (Prm*, Res*). * Inroduce status type for apemanager `APEManagerAccessDenied`; add unit-tests. Signed-off-by: Airat Arifullin --- client/apemanager_add_chain.go | 79 ++++++++++++++++++++++++++++++ client/apemanager_list_chains.go | 80 +++++++++++++++++++++++++++++++ client/apemanager_remove_chain.go | 73 ++++++++++++++++++++++++++++ client/errors.go | 6 +++ client/status/apemanager.go | 53 ++++++++++++++++++++ client/status/v2.go | 7 +++ client/status/v2_test.go | 12 +++++ 7 files changed, 310 insertions(+) create mode 100644 client/apemanager_add_chain.go create mode 100644 client/apemanager_list_chains.go create mode 100644 client/apemanager_remove_chain.go create mode 100644 client/status/apemanager.go diff --git a/client/apemanager_add_chain.go b/client/apemanager_add_chain.go new file mode 100644 index 0000000..00fd66d --- /dev/null +++ b/client/apemanager_add_chain.go @@ -0,0 +1,79 @@ +package client + +import ( + "context" + "fmt" + + apemanager_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" + session_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" + apemanager_sdk "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/apemanager" + apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" +) + +// PrmAPEManagerAddChain groups parameters of APEManagerAddChain operation. +type PrmAPEManagerAddChain struct { + XHeaders []string + + ChainTarget apemanager_sdk.ChainTarget + + Chain apemanager_sdk.Chain +} + +func (prm *PrmAPEManagerAddChain) buildRequest(c *Client) (*apemanager_v2.AddChainRequest, error) { + if len(prm.XHeaders)%2 != 0 { + return nil, errorInvalidXHeaders + } + + req := new(apemanager_v2.AddChainRequest) + reqBody := new(apemanager_v2.AddChainRequestBody) + + reqBody.SetTarget(prm.ChainTarget.ToV2()) + reqBody.SetChain(prm.Chain.ToV2()) + + req.SetBody(reqBody) + + var meta session_v2.RequestMetaHeader + writeXHeadersToMeta(prm.XHeaders, &meta) + + c.prepareRequest(req, &meta) + + return req, nil +} + +type ResAPEManagerAddChain struct { + statusRes + + // ChainID of set Chain. If Chain does not contain chainID before request, then + // ChainID is generated. + ChainID apemanager_sdk.ChainID +} + +// APEManagerAddChain sets Chain for ChainTarget. +func (c *Client) APEManagerAddChain(ctx context.Context, prm PrmAPEManagerAddChain) (*ResAPEManagerAddChain, error) { + req, err := prm.buildRequest(c) + if err != nil { + return nil, err + } + + if err := signature.SignServiceMessage(&c.prm.Key, req); err != nil { + return nil, fmt.Errorf("sign request: %w", err) + } + + resp, err := rpcapi.AddChain(&c.c, req, client.WithContext(ctx)) + if err != nil { + return nil, err + } + + var res ResAPEManagerAddChain + res.st, err = c.processResponse(resp) + if err != nil || !apistatus.IsSuccessful(res.st) { + return &res, err + } + + res.ChainID = resp.GetBody().GetChainID() + + return &res, nil +} diff --git a/client/apemanager_list_chains.go b/client/apemanager_list_chains.go new file mode 100644 index 0000000..dd5c4dd --- /dev/null +++ b/client/apemanager_list_chains.go @@ -0,0 +1,80 @@ +package client + +import ( + "context" + "fmt" + + apemanager_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" + session_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" + apemanager_sdk "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/apemanager" + apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" +) + +// PrmAPEManagerListChains groups parameters of APEManagerListChains operation. +type PrmAPEManagerListChains struct { + XHeaders []string + + ChainTarget apemanager_sdk.ChainTarget +} + +func (prm *PrmAPEManagerListChains) buildRequest(c *Client) (*apemanager_v2.ListChainsRequest, error) { + if len(prm.XHeaders)%2 != 0 { + return nil, errorInvalidXHeaders + } + + req := new(apemanager_v2.ListChainsRequest) + reqBody := new(apemanager_v2.ListChainsRequestBody) + + reqBody.SetTarget(prm.ChainTarget.ToV2()) + + req.SetBody(reqBody) + + var meta session_v2.RequestMetaHeader + writeXHeadersToMeta(prm.XHeaders, &meta) + + c.prepareRequest(req, &meta) + + return req, nil +} + +type ResAPEManagerListChains struct { + statusRes + + Chains []apemanager_sdk.Chain +} + +// APEManagerListChains lists Chains for ChainTarget. +func (c *Client) APEManagerListChains(ctx context.Context, prm PrmAPEManagerListChains) (*ResAPEManagerListChains, error) { + req, err := prm.buildRequest(c) + if err != nil { + return nil, err + } + + if err := signature.SignServiceMessage(&c.prm.Key, req); err != nil { + return nil, fmt.Errorf("sign request: %w", err) + } + + resp, err := rpcapi.ListChains(&c.c, req, client.WithContext(ctx)) + if err != nil { + return nil, err + } + + var res ResAPEManagerListChains + res.st, err = c.processResponse(resp) + if err != nil || !apistatus.IsSuccessful(res.st) { + return nil, err + } + + for _, ch := range resp.GetBody().GetChains() { + var chSDK apemanager_sdk.Chain + if err := chSDK.ReadFromV2(ch); err != nil { + return nil, err + } + res.Chains = append(res.Chains, chSDK) + } + + return &res, nil +} diff --git a/client/apemanager_remove_chain.go b/client/apemanager_remove_chain.go new file mode 100644 index 0000000..dc10113 --- /dev/null +++ b/client/apemanager_remove_chain.go @@ -0,0 +1,73 @@ +package client + +import ( + "context" + "fmt" + + apemanager_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" + session_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" + apemanager_sdk "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/apemanager" + apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" +) + +// PrmAPEManagerRemoveChain groups parameters of APEManagerRemoveChain operation. +type PrmAPEManagerRemoveChain struct { + XHeaders []string + + ChainTarget apemanager_sdk.ChainTarget + + ChainID apemanager_sdk.ChainID +} + +func (prm *PrmAPEManagerRemoveChain) buildRequest(c *Client) (*apemanager_v2.RemoveChainRequest, error) { + if len(prm.XHeaders)%2 != 0 { + return nil, errorInvalidXHeaders + } + + req := new(apemanager_v2.RemoveChainRequest) + reqBody := new(apemanager_v2.RemoveChainRequestBody) + + reqBody.SetTarget(prm.ChainTarget.ToV2()) + reqBody.SetChainID(prm.ChainID) + + req.SetBody(reqBody) + + var meta session_v2.RequestMetaHeader + writeXHeadersToMeta(prm.XHeaders, &meta) + + c.prepareRequest(req, &meta) + + return req, nil +} + +type ResAPEManagerRemoveChain struct { + statusRes +} + +// APEManagerRemoveChain removes Chain with ChainID defined for ChainTarget. +func (c *Client) APEManagerRemoveChain(ctx context.Context, prm PrmAPEManagerRemoveChain) (*ResAPEManagerRemoveChain, error) { + req, err := prm.buildRequest(c) + if err != nil { + return nil, err + } + + if err := signature.SignServiceMessage(&c.prm.Key, req); err != nil { + return nil, fmt.Errorf("sign request: %w", err) + } + + resp, err := rpcapi.RemoveChain(&c.c, req, client.WithContext(ctx)) + if err != nil { + return nil, err + } + + var res ResAPEManagerRemoveChain + res.st, err = c.processResponse(resp) + if err != nil || !apistatus.IsSuccessful(res.st) { + return &res, err + } + + return &res, nil +} diff --git a/client/errors.go b/client/errors.go index 64144b6..be87c62 100644 --- a/client/errors.go +++ b/client/errors.go @@ -61,6 +61,12 @@ func IsErrSessionNotFound(err error) bool { return wrapsErrType[*apistatus.SessionTokenNotFound](err) } +// IsErrAPEManagerAccessDenied checks if err corresponds to FrostFS status return +// corresponding to apemanager access deny. Supports wrapped errors. +func IsErrAPEManagerAccessDenied(err error) bool { + return wrapsErrType[*apistatus.APEManagerAccessDenied](err) +} + // returns error describing missing field with the given name. func newErrMissingResponseField(name string) error { return fmt.Errorf("missing %s field in the response", name) diff --git a/client/status/apemanager.go b/client/status/apemanager.go new file mode 100644 index 0000000..f68fd48 --- /dev/null +++ b/client/status/apemanager.go @@ -0,0 +1,53 @@ +package apistatus + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" +) + +// APEManagerAccessDenied describes status of the failure because of the access control violation. +// Instances provide Status and StatusV2 interfaces. +type APEManagerAccessDenied struct { + v2 status.Status +} + +const defaultAPEManagerAccessDeniedMsg = "apemanager access denied" + +func (x *APEManagerAccessDenied) Error() string { + msg := x.v2.Message() + if msg == "" { + msg = defaultAPEManagerAccessDeniedMsg + } + + return errMessageStatusV2( + globalizeCodeV2(apemanager.StatusAPEManagerAccessDenied, apemanager.GlobalizeFail), + msg, + ) +} + +func (x *APEManagerAccessDenied) fromStatusV2(st *status.Status) { + x.v2 = *st +} + +// ToStatusV2 converts APEManagerAccessDenied to v2's Status. +// If the value was returned by FromStatusV2, returns the source message. +// Otherwise, returns message with +// - code: APE_MANAGER_ACCESS_DENIED; +// - string message: "apemanager access denied"; +// - details: empty. +func (x APEManagerAccessDenied) ToStatusV2() *status.Status { + x.v2.SetCode(globalizeCodeV2(apemanager.StatusAPEManagerAccessDenied, apemanager.GlobalizeFail)) + x.v2.SetMessage(defaultAPEManagerAccessDeniedMsg) + return &x.v2 +} + +// WriteReason writes human-readable access rejection reason. +func (x *APEManagerAccessDenied) WriteReason(reason string) { + apemanager.WriteAccessDeniedDesc(&x.v2, reason) +} + +// Reason returns human-readable access rejection reason returned by the server. +// Returns empty value is reason is not presented. +func (x APEManagerAccessDenied) Reason() string { + return apemanager.ReadAccessDeniedDesc(x.v2) +} diff --git a/client/status/v2.go b/client/status/v2.go index ff6ccec..f5bef6a 100644 --- a/client/status/v2.go +++ b/client/status/v2.go @@ -3,6 +3,7 @@ package apistatus import ( "fmt" + "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/object" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" @@ -92,6 +93,12 @@ func FromStatusV2(st *status.Status) Status { case session.StatusTokenExpired: decoder = new(SessionTokenExpired) } + case apemanager.LocalizeFailStatus(&code): + //nolint:exhaustive + switch code { + case apemanager.StatusAPEManagerAccessDenied: + decoder = new(APEManagerAccessDenied) + } } if decoder == nil { diff --git a/client/status/v2_test.go b/client/status/v2_test.go index 14d4c30..2295c47 100644 --- a/client/status/v2_test.go +++ b/client/status/v2_test.go @@ -125,6 +125,12 @@ func TestToStatusV2(t *testing.T) { }), codeV2: 4097, }, + { + status: (statusConstructor)(func() apistatus.Status { + return new(apistatus.APEManagerAccessDenied) + }), + codeV2: 5120, + }, { status: (statusConstructor)(func() apistatus.Status { return new(apistatus.NodeUnderMaintenance) @@ -278,6 +284,12 @@ func TestFromStatusV2(t *testing.T) { }), codeV2: 4097, }, + { + status: (statusConstructor)(func() apistatus.Status { + return new(apistatus.APEManagerAccessDenied) + }), + codeV2: 5120, + }, { status: (statusConstructor)(func() apistatus.Status { return new(apistatus.NodeUnderMaintenance) From d4e6f4e125f08f2666295fac2803ceb201cef780 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Fri, 17 May 2024 15:02:44 +0300 Subject: [PATCH 037/197] [#223] go.mod: Update frosts-api-go/v2 version Signed-off-by: Airat Arifullin --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index cbe2d94..31024af 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.20 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240506114654-b171364079c3 + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240516133103-0803bc6ded00 git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 git.frostfs.info/TrueCloudLab/hrw v1.2.1 diff --git a/go.sum b/go.sum index f730e59..4d2a480 100644 --- a/go.sum +++ b/go.sum @@ -31,8 +31,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl 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-api-go/v2 v2.16.1-0.20240506114654-b171364079c3 h1:Fhkq+F6AiYhkJlqq0IXnA5eUuTPbhRqAwlcHTPzUF2g= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240506114654-b171364079c3/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240516133103-0803bc6ded00 h1:Q3B9WtFh05AXhUFs/2CLvhh9tuFs/Zd/XemWBbuzvg8= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240516133103-0803bc6ded00/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb h1:S/TrbOOu9qEXZRZ9/Ddw7crnxbBUQLo68PSzQWYrc9M= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb/go.mod h1:nkR5gaGeez3Zv2SE7aceP0YwxG2FzIB5cGKpQO2vV2o= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= From 09b79d13f314c46907eee88902f80b24555cc3d6 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 14 May 2024 13:06:30 +0300 Subject: [PATCH 038/197] [#223] object: Introduce `ec_parent` search filter Signed-off-by: Airat Arifullin --- object/search.go | 7 +++++++ object/search_test.go | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/object/search.go b/object/search.go index f3df671..818099d 100644 --- a/object/search.go +++ b/object/search.go @@ -120,6 +120,7 @@ const ( fKeySplitID fKeyPropRoot fKeyPropPhy + fKeyECParent ) func (k filterKey) String() string { @@ -152,6 +153,8 @@ func (k filterKey) String() string { return v2object.FilterPropertyRoot case fKeyPropPhy: return v2object.FilterPropertyPhy + case fKeyECParent: + return v2object.FilterHeaderECParent } } @@ -277,6 +280,10 @@ func (f *SearchFilters) AddSplitIDFilter(m SearchMatchType, id *SplitID) { f.addReservedFilter(m, fKeySplitID, staticStringer(id.String())) } +func (f *SearchFilters) AddECParentFilter(m SearchMatchType, parentID oid.ID) { + f.addReservedFilter(m, fKeyECParent, staticStringer(parentID.String())) +} + // AddTypeFilter adds filter by object type. func (f *SearchFilters) AddTypeFilter(m SearchMatchType, typ Type) { f.addReservedFilter(m, fKeyType, staticStringer(typ.String())) diff --git a/object/search_test.go b/object/search_test.go index 40df23b..4241f7d 100644 --- a/object/search_test.go +++ b/object/search_test.go @@ -160,6 +160,23 @@ func TestSearchFilters_AddSplitIDFilter(t *testing.T) { }) } +func TestSearchFilters_AddECParentFilter(t *testing.T) { + id := testOID() + + fs := new(object.SearchFilters) + fs.AddECParentFilter(object.MatchStringEqual, id) + + t.Run("v2", func(t *testing.T) { + fsV2 := fs.ToV2() + + require.Len(t, fsV2, 1) + + require.Equal(t, v2object.FilterHeaderECParent, fsV2[0].GetKey()) + require.Equal(t, id.String(), fsV2[0].GetValue()) + require.Equal(t, v2object.MatchStringEqual, fsV2[0].GetMatchType()) + }) +} + func TestSearchFilters_AddTypeFilter(t *testing.T) { typ := object.TypeTombstone From 3de256d05e320b6888dab6e8c102a2298a346178 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Fri, 17 May 2024 15:16:28 +0300 Subject: [PATCH 039/197] [#223] object: Introduce new fields for `ECHeader` * Introduce `parentSplitID`, `parentSplitParentID` fields for `ECHeader`; * Fix ECHeader's constructor; * Fix `Split` and `Reconstruct`; * Add unit-tests. Signed-off-by: Airat Arifullin --- object/erasure_code.go | 57 +++++++++++++++---- object/erasurecode/reconstruct.go | 4 +- object/erasurecode/split.go | 11 +++- object/erasurecode/split_test.go | 93 +++++++++++++++++++++++++++++++ 4 files changed, 152 insertions(+), 13 deletions(-) diff --git a/object/erasure_code.go b/object/erasure_code.go index 43abe03..625f161 100644 --- a/object/erasure_code.go +++ b/object/erasure_code.go @@ -10,21 +10,25 @@ import ( // ECHeader represents erasure coding header. type ECHeader struct { - parent oid.ID - index uint32 - total uint32 - header []byte - headerLength uint32 + parent oid.ID + parentSplitID *SplitID + parentSplitParentID *oid.ID + index uint32 + total uint32 + header []byte + headerLength uint32 } // NewECHeader constructs new erasure coding header. -func NewECHeader(parent oid.ID, index, total uint32, header []byte, headerLength uint32) *ECHeader { +func NewECHeader(parent oid.ID, parentSplitID *SplitID, parentSplitParentID *oid.ID, index, total uint32, header []byte, headerLength uint32) *ECHeader { return &ECHeader{ - parent: parent, - index: index, - total: total, - header: header, - headerLength: headerLength, + parent: parent, + parentSplitID: parentSplitID, + parentSplitParentID: parentSplitParentID, + index: index, + total: total, + header: header, + headerLength: headerLength, } } @@ -32,6 +36,14 @@ func NewECHeader(parent oid.ID, index, total uint32, header []byte, headerLength func (e *ECHeader) WriteToV2(h *object.ECHeader) { var parent refs.ObjectID e.parent.WriteToV2(&parent) + h.ParentSplitID = e.parentSplitID.ToV2() + + if e.parentSplitParentID != nil { + parentSplitParentID := new(refs.ObjectID) + e.parentSplitParentID.WriteToV2(parentSplitParentID) + h.ParentSplitParentID = parentSplitParentID + } + h.Parent = &parent h.Index = e.index h.Total = e.total @@ -49,6 +61,13 @@ func (e *ECHeader) ReadFromV2(h *object.ECHeader) error { } _ = e.parent.ReadFromV2(*h.Parent) + e.parentSplitID = NewSplitIDFromV2(h.ParentSplitID) + if h.ParentSplitParentID != nil { + if e.parentSplitParentID == nil { + e.parentSplitParentID = new(oid.ID) + } + _ = e.parentSplitParentID.ReadFromV2(*h.ParentSplitParentID) + } e.index = h.Index e.total = h.Total e.header = h.Header @@ -88,6 +107,22 @@ func (e *ECHeader) SetParent(id oid.ID) { e.parent = id } +func (e *ECHeader) ParentSplitID() *SplitID { + return e.parentSplitID +} + +func (e *ECHeader) SetParentSplitID(parentSplitID *SplitID) { + e.parentSplitID = parentSplitID +} + +func (e *ECHeader) ParentSplitParentID() *oid.ID { + return e.parentSplitParentID +} + +func (e *ECHeader) SetParentSplitParentID(parentSplitParentID *oid.ID) { + e.parentSplitParentID = parentSplitParentID +} + func (e *ECHeader) Index() uint32 { return e.index } diff --git a/object/erasurecode/reconstruct.go b/object/erasurecode/reconstruct.go index 68ade85..4561a7c 100644 --- a/object/erasurecode/reconstruct.go +++ b/object/erasurecode/reconstruct.go @@ -87,6 +87,8 @@ func (c *Constructor) ReconstructParts(parts []*objectSDK.Object, required []boo ec := parts[nonNilPart].GetECHeader() parent := ec.Parent() total := ec.Total() + splitID := ec.ParentSplitID() + parSplitParID := ec.ParentSplitParentID() for i := range required { if parts[i] != nil || !required[i] { @@ -97,7 +99,7 @@ func (c *Constructor) ReconstructParts(parts []*objectSDK.Object, required []boo copyRequiredFields(part, parts[nonNilPart]) part.SetPayload(c.payloadShards[i]) part.SetPayloadSize(uint64(len(c.payloadShards[i]))) - part.SetECHeader(objectSDK.NewECHeader(parent, uint32(i), total, + part.SetECHeader(objectSDK.NewECHeader(parent, splitID, parSplitParID, uint32(i), total, c.headerShards[i], c.headerLength)) if err := setIDWithSignature(part, key); err != nil { diff --git a/object/erasurecode/split.go b/object/erasurecode/split.go index 196de4a..63895da 100644 --- a/object/erasurecode/split.go +++ b/object/erasurecode/split.go @@ -4,6 +4,7 @@ import ( "crypto/ecdsa" objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" + oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" ) // Split splits fully formed object into multiple chunks. @@ -32,7 +33,15 @@ func (c *Constructor) Split(obj *objectSDK.Object, key *ecdsa.PrivateKey) ([]*ob chunk.SetPayload(payloadShards[i]) chunk.SetPayloadSize(uint64(len(payloadShards[i]))) - ec := objectSDK.NewECHeader(parent, uint32(i), uint32(len(payloadShards)), headerShards[i], uint32(len(header))) + var parentSplitParentID *oid.ID + if obj.HasParent() { + splitParentID, ok := obj.Parent().ID() + if ok { + parentSplitParentID = &splitParentID + } + } + + ec := objectSDK.NewECHeader(parent, obj.SplitID(), parentSplitParentID, uint32(i), uint32(len(payloadShards)), headerShards[i], uint32(len(header))) chunk.SetECHeader(ec) if err := setIDWithSignature(chunk, key); err != nil { return nil, err diff --git a/object/erasurecode/split_test.go b/object/erasurecode/split_test.go index e82bd51..22d9a0a 100644 --- a/object/erasurecode/split_test.go +++ b/object/erasurecode/split_test.go @@ -5,6 +5,7 @@ import ( objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/erasurecode" + oidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id/test" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "github.com/stretchr/testify/require" ) @@ -41,5 +42,97 @@ func TestSplitMaxShardCount(t *testing.T) { require.NoError(t, objectSDK.CheckHeaderVerificationFields(part)) } }) + t.Run("ec parents are children of last Split part", func(t *testing.T) { + c, err := erasurecode.NewConstructor(1, erasurecode.MaxShardCount-1) + require.NoError(t, err) + + splitted1 := newObject(t, 1024, pk) + splitted2 := newObject(t, 1024, pk) + + splittedId1, _ := splitted1.ID() + splittedId2, _ := splitted2.ID() + + splitID := objectSDK.NewSplitID() + parent := objectSDK.New() + parent.SetID(oidtest.ID()) + parent.SetChildren(splittedId1, splittedId2) + parent.SetSplitID(splitID) + + splitted1.SetSplitID(splitID) + splitted1.SetParent(parent) + splitted2.SetSplitID(splitID) + splitted2.SetParent(parent) + + parts1, err := c.Split(splitted1, &pk.PrivateKey) + require.NoError(t, err) + require.Len(t, parts1, erasurecode.MaxShardCount) + + for _, part := range parts1 { + require.NoError(t, objectSDK.CheckHeaderVerificationFields(part)) + + require.NotNil(t, part.ECHeader().ParentSplitID()) + require.Equal(t, *splitID, *part.ECHeader().ParentSplitID()) + require.NotNil(t, part.ECHeader().ParentSplitParentID()) + } + + parts2, err := c.Split(splitted2, &pk.PrivateKey) + require.NoError(t, err) + require.Len(t, parts1, erasurecode.MaxShardCount) + + for _, part := range parts2 { + require.NoError(t, objectSDK.CheckHeaderVerificationFields(part)) + + require.NotNil(t, part.ECHeader().ParentSplitID()) + require.Equal(t, *splitID, *part.ECHeader().ParentSplitID()) + require.NotNil(t, part.ECHeader().ParentSplitParentID()) + } + + }) + t.Run("ec parents are children of non-last Split part", func(t *testing.T) { + c, err := erasurecode.NewConstructor(1, erasurecode.MaxShardCount-1) + require.NoError(t, err) + + splitted1 := newObject(t, 1024, pk) + splitted2 := newObject(t, 1024, pk) + + splittedId1, _ := splitted1.ID() + splittedId2, _ := splitted2.ID() + + splitID := objectSDK.NewSplitID() + parent := objectSDK.New() + // Such parent has got no ID. + parent.SetChildren(splittedId1, splittedId2) + parent.SetSplitID(splitID) + + splitted1.SetSplitID(splitID) + splitted1.SetParent(parent) + splitted2.SetSplitID(splitID) + splitted2.SetParent(parent) + + parts1, err := c.Split(splitted1, &pk.PrivateKey) + require.NoError(t, err) + require.Len(t, parts1, erasurecode.MaxShardCount) + + for _, part := range parts1 { + require.NoError(t, objectSDK.CheckHeaderVerificationFields(part)) + + require.NotNil(t, part.ECHeader().ParentSplitID()) + require.Equal(t, *splitID, *part.ECHeader().ParentSplitID()) + require.Nil(t, part.ECHeader().ParentSplitParentID()) + } + + parts2, err := c.Split(splitted2, &pk.PrivateKey) + require.NoError(t, err) + require.Len(t, parts1, erasurecode.MaxShardCount) + + for _, part := range parts2 { + require.NoError(t, objectSDK.CheckHeaderVerificationFields(part)) + + require.NotNil(t, part.ECHeader().ParentSplitID()) + require.Equal(t, *splitID, *part.ECHeader().ParentSplitID()) + require.Nil(t, part.ECHeader().ParentSplitParentID()) + } + + }) } From c5c6272029fefe895ae899bb0d1d6eeaa01619b1 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Wed, 8 May 2024 14:54:39 +0300 Subject: [PATCH 040/197] [#221] pool: Make sampler safe for concurrent using Signed-off-by: Denis Kirillov --- pool/sampler.go | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/pool/sampler.go b/pool/sampler.go index f5b6635..6f46886 100644 --- a/pool/sampler.go +++ b/pool/sampler.go @@ -1,13 +1,18 @@ package pool -import "math/rand" +import ( + "math/rand" + "sync" +) // sampler implements weighted random number generation using Vose's Alias // Method (https://www.keithschwarz.com/darts-dice-coins/). type sampler struct { + mu sync.Mutex randomGenerator *rand.Rand - probabilities []float64 - alias []int + + probabilities []float64 + alias []int } // newSampler creates new sampler with a given set of probabilities using @@ -58,10 +63,16 @@ func newSampler(probabilities []float64, source rand.Source) *sampler { } // Next returns the next (not so) random number from sampler. +// This method is safe for concurrent use by multiple goroutines. func (g *sampler) Next() int { n := len(g.alias) + + g.mu.Lock() i := g.randomGenerator.Intn(n) - if g.randomGenerator.Float64() < g.probabilities[i] { + f := g.randomGenerator.Float64() + g.mu.Unlock() + + if f < g.probabilities[i] { return i } return g.alias[i] From 6a52487edd8d2d5f485e3e375b512a5e554470c4 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Thu, 30 May 2024 14:58:14 +0300 Subject: [PATCH 041/197] [#226] pool/tree: Fix handling access denied error Signed-off-by: Denis Kirillov --- pool/tree/pool.go | 2 +- pool/tree/pool_test.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pool/tree/pool.go b/pool/tree/pool.go index 28cc98b..2c55351 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -599,7 +599,7 @@ func handleError(msg string, err error) error { } if strings.Contains(err.Error(), "not found") { return fmt.Errorf("%w: %s", ErrNodeNotFound, err.Error()) - } else if strings.Contains(err.Error(), "is denied by") { + } else if strings.Contains(err.Error(), "denied") { return fmt.Errorf("%w: %s", ErrNodeAccessDenied, err.Error()) } return fmt.Errorf("%s: %w", msg, err) diff --git a/pool/tree/pool_test.go b/pool/tree/pool_test.go index f85b656..c2e50eb 100644 --- a/pool/tree/pool_test.go +++ b/pool/tree/pool_test.go @@ -5,6 +5,7 @@ import ( "errors" "testing" + apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool" grpcService "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool/tree/service" "github.com/stretchr/testify/require" @@ -68,6 +69,10 @@ func TestHandleError(t *testing.T) { err: errors.New("something is denied by some acl rule"), expectedError: ErrNodeAccessDenied, }, + { + err: &apistatus.APEManagerAccessDenied{}, + expectedError: ErrNodeAccessDenied, + }, } { t.Run("", func(t *testing.T) { err := handleError("err message", tc.err) From dd23c6fd2b579a33a4a81bc6029daf083ca07aa7 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 28 May 2024 12:05:02 +0300 Subject: [PATCH 042/197] [#225] apemanager: Move `apemanager` to `ape` package * Update go.mod; * Fix packages; * Fix client's `apemanager` methods. Signed-off-by: Airat Arifullin --- {apemanager => ape}/chain.go | 14 ++++++------ {apemanager => ape}/chain_target.go | 18 +++++++-------- {apemanager => ape}/chain_target_test.go | 28 ++++++++++++------------ {apemanager => ape}/chain_test.go | 16 +++++++------- client/apemanager_add_chain.go | 20 ++++++++--------- client/apemanager_list_chains.go | 20 ++++++++--------- client/apemanager_remove_chain.go | 18 +++++++-------- go.mod | 2 +- go.sum | 4 ++-- 9 files changed, 70 insertions(+), 70 deletions(-) rename {apemanager => ape}/chain.go (74%) rename {apemanager => ape}/chain_target.go (64%) rename {apemanager => ape}/chain_target_test.go (54%) rename {apemanager => ape}/chain_test.go (68%) diff --git a/apemanager/chain.go b/ape/chain.go similarity index 74% rename from apemanager/chain.go rename to ape/chain.go index 0a4cec4..eae441d 100644 --- a/apemanager/chain.go +++ b/ape/chain.go @@ -1,10 +1,10 @@ -package apemanager +package ape import ( "errors" "fmt" - apemanager_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" + apeV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape" ) var ( @@ -27,11 +27,11 @@ type Chain struct { } // ToV2 converts Chain to v2. -func (c *Chain) ToV2() *apemanager_v2.Chain { - v2ct := new(apemanager_v2.Chain) +func (c *Chain) ToV2() *apeV2.Chain { + v2ct := new(apeV2.Chain) if c.Raw != nil { - v2Raw := new(apemanager_v2.ChainRaw) + v2Raw := new(apeV2.ChainRaw) v2Raw.SetRaw(c.Raw) v2ct.SetKind(v2Raw) } @@ -40,11 +40,11 @@ func (c *Chain) ToV2() *apemanager_v2.Chain { } // ReadFromV2 fills Chain from v2. -func (c *Chain) ReadFromV2(v2ct *apemanager_v2.Chain) error { +func (c *Chain) ReadFromV2(v2ct *apeV2.Chain) error { switch v := v2ct.GetKind().(type) { default: return fmt.Errorf("unsupported chain kind: %T", v) - case *apemanager_v2.ChainRaw: + case *apeV2.ChainRaw: raw := v.GetRaw() c.Raw = raw } diff --git a/apemanager/chain_target.go b/ape/chain_target.go similarity index 64% rename from apemanager/chain_target.go rename to ape/chain_target.go index 70cf9dc..13b7e87 100644 --- a/apemanager/chain_target.go +++ b/ape/chain_target.go @@ -1,11 +1,11 @@ -package apemanager +package ape import ( - apemanager_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" + apeV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape" ) // TargetType is an SDK representation for v2's TargetType. -type TargetType apemanager_v2.TargetType +type TargetType apeV2.TargetType const ( TargetTypeUndefined TargetType = iota @@ -16,12 +16,12 @@ const ( ) // ToV2 converts TargetType to v2. -func (targetType TargetType) ToV2() apemanager_v2.TargetType { - return apemanager_v2.TargetType(targetType) +func (targetType TargetType) ToV2() apeV2.TargetType { + return apeV2.TargetType(targetType) } // FromV2 reads TargetType to v2. -func (targetType *TargetType) FromV2(v2targetType apemanager_v2.TargetType) { +func (targetType *TargetType) FromV2(v2targetType apeV2.TargetType) { *targetType = TargetType(v2targetType) } @@ -37,8 +37,8 @@ type ChainTarget struct { } // ToV2 converts ChainTarget to v2. -func (ct *ChainTarget) ToV2() *apemanager_v2.ChainTarget { - v2ct := new(apemanager_v2.ChainTarget) +func (ct *ChainTarget) ToV2() *apeV2.ChainTarget { + v2ct := new(apeV2.ChainTarget) v2ct.SetTargetType(ct.TargetType.ToV2()) v2ct.SetName(ct.Name) @@ -47,7 +47,7 @@ func (ct *ChainTarget) ToV2() *apemanager_v2.ChainTarget { } // FromV2 reads ChainTarget frpm v2. -func (ct *ChainTarget) FromV2(v2ct *apemanager_v2.ChainTarget) { +func (ct *ChainTarget) FromV2(v2ct *apeV2.ChainTarget) { ct.TargetType.FromV2(v2ct.GetTargetType()) ct.Name = v2ct.GetName() } diff --git a/apemanager/chain_target_test.go b/ape/chain_target_test.go similarity index 54% rename from apemanager/chain_target_test.go rename to ape/chain_target_test.go index a5e5fb7..21a11b7 100644 --- a/apemanager/chain_target_test.go +++ b/ape/chain_target_test.go @@ -1,21 +1,21 @@ -package apemanager_test +package ape_test import ( "testing" - "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/apemanager" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ape" "github.com/stretchr/testify/require" - apemanager_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" + apeV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape" ) var ( - m = map[apemanager.TargetType]apemanager_v2.TargetType{ - apemanager.TargetTypeUndefined: apemanager_v2.TargetTypeUndefined, - apemanager.TargetTypeNamespace: apemanager_v2.TargetTypeNamespace, - apemanager.TargetTypeContainer: apemanager_v2.TargetTypeContainer, - apemanager.TargetTypeUser: apemanager_v2.TargetTypeUser, - apemanager.TargetTypeGroup: apemanager_v2.TargetTypeGroup, + m = map[ape.TargetType]apeV2.TargetType{ + ape.TargetTypeUndefined: apeV2.TargetTypeUndefined, + ape.TargetTypeNamespace: apeV2.TargetTypeNamespace, + ape.TargetTypeContainer: apeV2.TargetTypeContainer, + ape.TargetTypeUser: apeV2.TargetTypeUser, + ape.TargetTypeGroup: apeV2.TargetTypeGroup, } ) @@ -27,7 +27,7 @@ func TestTargetType(t *testing.T) { }) t.Run("from v2 to sdk "+typev2.String(), func(t *testing.T) { - var typ apemanager.TargetType + var typ ape.TargetType typ.FromV2(typev2) require.Equal(t, typesdk, typ) }) @@ -36,12 +36,12 @@ func TestTargetType(t *testing.T) { func TestChainTarget(t *testing.T) { var ( - typ = apemanager.TargetTypeNamespace + typ = ape.TargetTypeNamespace name = "namespaceXXYYZZ" ) t.Run("from sdk to v2", func(t *testing.T) { - ct := apemanager.ChainTarget{ + ct := ape.ChainTarget{ TargetType: typ, Name: name, } @@ -52,11 +52,11 @@ func TestChainTarget(t *testing.T) { }) t.Run("from v2 to sdk", func(t *testing.T) { - v2 := &apemanager_v2.ChainTarget{} + v2 := &apeV2.ChainTarget{} v2.SetTargetType(m[typ]) v2.SetName(name) - var ct apemanager.ChainTarget + var ct ape.ChainTarget ct.FromV2(v2) require.Equal(t, typ, ct.TargetType) diff --git a/apemanager/chain_test.go b/ape/chain_test.go similarity index 68% rename from apemanager/chain_test.go rename to ape/chain_test.go index fbe1818..83991f6 100644 --- a/apemanager/chain_test.go +++ b/ape/chain_test.go @@ -1,12 +1,12 @@ -package apemanager_test +package ape_test import ( "testing" - "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/apemanager" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ape" "github.com/stretchr/testify/require" - apemanager_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" + apeV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape" ) const ( @@ -15,12 +15,12 @@ const ( func TestChainData(t *testing.T) { t.Run("raw chain", func(t *testing.T) { - var c apemanager.Chain + var c ape.Chain b := []byte(encoded) c.Raw = b - v2, ok := c.ToV2().GetKind().(*apemanager_v2.ChainRaw) + v2, ok := c.ToV2().GetKind().(*apeV2.ChainRaw) require.True(t, ok) require.Equal(t, b, v2.Raw) }) @@ -29,13 +29,13 @@ func TestChainData(t *testing.T) { func TestChainMessageV2(t *testing.T) { b := []byte(encoded) - v2Raw := &apemanager_v2.ChainRaw{} + v2Raw := &apeV2.ChainRaw{} v2Raw.SetRaw(b) - v2 := &apemanager_v2.Chain{} + v2 := &apeV2.Chain{} v2.SetKind(v2Raw) - var c apemanager.Chain + var c ape.Chain c.ReadFromV2(v2) require.NotNil(t, c.Raw) diff --git a/client/apemanager_add_chain.go b/client/apemanager_add_chain.go index 00fd66d..2581e2a 100644 --- a/client/apemanager_add_chain.go +++ b/client/apemanager_add_chain.go @@ -4,12 +4,12 @@ import ( "context" "fmt" - apemanager_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" + apemanagerV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - session_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + sessionV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" - apemanager_sdk "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/apemanager" + apeSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ape" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" ) @@ -17,25 +17,25 @@ import ( type PrmAPEManagerAddChain struct { XHeaders []string - ChainTarget apemanager_sdk.ChainTarget + ChainTarget apeSDK.ChainTarget - Chain apemanager_sdk.Chain + Chain apeSDK.Chain } -func (prm *PrmAPEManagerAddChain) buildRequest(c *Client) (*apemanager_v2.AddChainRequest, error) { +func (prm *PrmAPEManagerAddChain) buildRequest(c *Client) (*apemanagerV2.AddChainRequest, error) { if len(prm.XHeaders)%2 != 0 { return nil, errorInvalidXHeaders } - req := new(apemanager_v2.AddChainRequest) - reqBody := new(apemanager_v2.AddChainRequestBody) + req := new(apemanagerV2.AddChainRequest) + reqBody := new(apemanagerV2.AddChainRequestBody) reqBody.SetTarget(prm.ChainTarget.ToV2()) reqBody.SetChain(prm.Chain.ToV2()) req.SetBody(reqBody) - var meta session_v2.RequestMetaHeader + var meta sessionV2.RequestMetaHeader writeXHeadersToMeta(prm.XHeaders, &meta) c.prepareRequest(req, &meta) @@ -48,7 +48,7 @@ type ResAPEManagerAddChain struct { // ChainID of set Chain. If Chain does not contain chainID before request, then // ChainID is generated. - ChainID apemanager_sdk.ChainID + ChainID apeSDK.ChainID } // APEManagerAddChain sets Chain for ChainTarget. diff --git a/client/apemanager_list_chains.go b/client/apemanager_list_chains.go index dd5c4dd..a608f1e 100644 --- a/client/apemanager_list_chains.go +++ b/client/apemanager_list_chains.go @@ -4,12 +4,12 @@ import ( "context" "fmt" - apemanager_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" + apemanagerV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - session_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + sessionV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" - apemanager_sdk "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/apemanager" + apeSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ape" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" ) @@ -17,22 +17,22 @@ import ( type PrmAPEManagerListChains struct { XHeaders []string - ChainTarget apemanager_sdk.ChainTarget + ChainTarget apeSDK.ChainTarget } -func (prm *PrmAPEManagerListChains) buildRequest(c *Client) (*apemanager_v2.ListChainsRequest, error) { +func (prm *PrmAPEManagerListChains) buildRequest(c *Client) (*apemanagerV2.ListChainsRequest, error) { if len(prm.XHeaders)%2 != 0 { return nil, errorInvalidXHeaders } - req := new(apemanager_v2.ListChainsRequest) - reqBody := new(apemanager_v2.ListChainsRequestBody) + req := new(apemanagerV2.ListChainsRequest) + reqBody := new(apemanagerV2.ListChainsRequestBody) reqBody.SetTarget(prm.ChainTarget.ToV2()) req.SetBody(reqBody) - var meta session_v2.RequestMetaHeader + var meta sessionV2.RequestMetaHeader writeXHeadersToMeta(prm.XHeaders, &meta) c.prepareRequest(req, &meta) @@ -43,7 +43,7 @@ func (prm *PrmAPEManagerListChains) buildRequest(c *Client) (*apemanager_v2.List type ResAPEManagerListChains struct { statusRes - Chains []apemanager_sdk.Chain + Chains []apeSDK.Chain } // APEManagerListChains lists Chains for ChainTarget. @@ -69,7 +69,7 @@ func (c *Client) APEManagerListChains(ctx context.Context, prm PrmAPEManagerList } for _, ch := range resp.GetBody().GetChains() { - var chSDK apemanager_sdk.Chain + var chSDK apeSDK.Chain if err := chSDK.ReadFromV2(ch); err != nil { return nil, err } diff --git a/client/apemanager_remove_chain.go b/client/apemanager_remove_chain.go index dc10113..a297716 100644 --- a/client/apemanager_remove_chain.go +++ b/client/apemanager_remove_chain.go @@ -4,12 +4,12 @@ import ( "context" "fmt" - apemanager_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" + apemanagerV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - session_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + sessionV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" - apemanager_sdk "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/apemanager" + apeSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ape" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" ) @@ -17,25 +17,25 @@ import ( type PrmAPEManagerRemoveChain struct { XHeaders []string - ChainTarget apemanager_sdk.ChainTarget + ChainTarget apeSDK.ChainTarget - ChainID apemanager_sdk.ChainID + ChainID apeSDK.ChainID } -func (prm *PrmAPEManagerRemoveChain) buildRequest(c *Client) (*apemanager_v2.RemoveChainRequest, error) { +func (prm *PrmAPEManagerRemoveChain) buildRequest(c *Client) (*apemanagerV2.RemoveChainRequest, error) { if len(prm.XHeaders)%2 != 0 { return nil, errorInvalidXHeaders } - req := new(apemanager_v2.RemoveChainRequest) - reqBody := new(apemanager_v2.RemoveChainRequestBody) + req := new(apemanagerV2.RemoveChainRequest) + reqBody := new(apemanagerV2.RemoveChainRequestBody) reqBody.SetTarget(prm.ChainTarget.ToV2()) reqBody.SetChainID(prm.ChainID) req.SetBody(reqBody) - var meta session_v2.RequestMetaHeader + var meta sessionV2.RequestMetaHeader writeXHeadersToMeta(prm.XHeaders, &meta) c.prepareRequest(req, &meta) diff --git a/go.mod b/go.mod index 31024af..96ef020 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.20 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240516133103-0803bc6ded00 + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240529164544-9e825239ac5f git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 git.frostfs.info/TrueCloudLab/hrw v1.2.1 diff --git a/go.sum b/go.sum index 4d2a480..6e302d0 100644 --- a/go.sum +++ b/go.sum @@ -31,8 +31,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl 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-api-go/v2 v2.16.1-0.20240516133103-0803bc6ded00 h1:Q3B9WtFh05AXhUFs/2CLvhh9tuFs/Zd/XemWBbuzvg8= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240516133103-0803bc6ded00/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240529164544-9e825239ac5f h1:/BC1Aq7WcfZ/g9Y3t2UfZ44/w1Z8s367MYrBSzno0cQ= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240529164544-9e825239ac5f/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb h1:S/TrbOOu9qEXZRZ9/Ddw7crnxbBUQLo68PSzQWYrc9M= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb/go.mod h1:nkR5gaGeez3Zv2SE7aceP0YwxG2FzIB5cGKpQO2vV2o= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= From 717a7d00ef2106a6cb5f7d15f2ec1eee3bf92449 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Thu, 30 May 2024 11:27:21 +0300 Subject: [PATCH 043/197] [#225] bearer: Introduce `APEOverride` field for the token Signed-off-by: Airat Arifullin --- bearer/bearer.go | 114 +++++++++++++++++++++++++++++++++++++++- bearer/bearer_test.go | 53 +++++++++++++++++++ bearer/test/generate.go | 12 +++++ 3 files changed, 177 insertions(+), 2 deletions(-) diff --git a/bearer/bearer.go b/bearer/bearer.go index aaea6c3..e419d54 100644 --- a/bearer/bearer.go +++ b/bearer/bearer.go @@ -6,7 +6,9 @@ import ( "fmt" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" + apeV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + apeSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ape" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto" frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa" @@ -33,9 +35,85 @@ type Token struct { sigSet bool sig refs.Signature + apeOverrideSet bool + apeOverride APEOverride + impersonate bool } +// 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 APEOverride struct { + // Target for which chains are applied. + Target apeSDK.ChainTarget + + // The list of APE chains. + Chains []apeSDK.Chain +} + +// Marshal marshals APEOverride into a protobuf binary form. +func (c *APEOverride) Marshal() ([]byte, error) { + return c.ToV2().StableMarshal(nil), nil +} + +// Unmarshal unmarshals protobuf binary representation of APEOverride. +func (c *APEOverride) Unmarshal(data []byte) error { + overrideV2 := new(acl.APEOverride) + if err := overrideV2.Unmarshal(data); err != nil { + return err + } + + return c.FromV2(overrideV2) +} + +// MarshalJSON encodes APEOverride to protobuf JSON format. +func (c *APEOverride) MarshalJSON() ([]byte, error) { + return c.ToV2().MarshalJSON() +} + +// UnmarshalJSON decodes APEOverride from protobuf JSON format. +func (c *APEOverride) UnmarshalJSON(data []byte) error { + overrideV2 := new(acl.APEOverride) + if err := overrideV2.UnmarshalJSON(data); err != nil { + return err + } + + return c.FromV2(overrideV2) +} + +func (c *APEOverride) FromV2(tokenAPEChains *acl.APEOverride) error { + c.Target.FromV2(tokenAPEChains.GetTarget()) + if chains := tokenAPEChains.GetChains(); len(chains) > 0 { + c.Chains = make([]apeSDK.Chain, len(chains)) + for i := range chains { + if err := c.Chains[i].ReadFromV2(chains[i]); err != nil { + return fmt.Errorf("invalid APE chain: %w", err) + } + } + } + return nil +} + +func (c *APEOverride) ToV2() *acl.APEOverride { + if c == nil { + return nil + } + + apeOverride := new(acl.APEOverride) + apeOverride.SetTarget(c.Target.ToV2()) + chains := make([]*apeV2.Chain, len(c.Chains)) + for i := range c.Chains { + chains[i] = c.Chains[i].ToV2() + } + apeOverride.SetChains(chains) + + return apeOverride +} + // reads Token from the acl.BearerToken message. If checkFieldPresence is set, // returns an error on absence of any protocol-required field. func (b *Token) readFromV2(m acl.BearerToken, checkFieldPresence bool) error { @@ -48,10 +126,11 @@ func (b *Token) readFromV2(m acl.BearerToken, checkFieldPresence bool) error { b.impersonate = body.GetImpersonate() + apeOverrides := body.GetAPEOverride() eaclTable := body.GetEACL() if b.eaclTableSet = eaclTable != nil; b.eaclTableSet { b.eaclTable = *eacl.NewTableFromV2(eaclTable) - } else if checkFieldPresence && !b.impersonate { + } else if checkFieldPresence && !b.impersonate && apeOverrides == nil { return errors.New("missing eACL table") } @@ -72,6 +151,14 @@ func (b *Token) readFromV2(m acl.BearerToken, checkFieldPresence bool) error { return errors.New("missing token lifetime") } + if b.apeOverrideSet = apeOverrides != nil; b.apeOverrideSet { + if err = b.apeOverride.FromV2(apeOverrides); err != nil { + return err + } + } else if checkFieldPresence && !b.impersonate && !b.eaclTableSet { + return errors.New("missing APE override") + } + sig := m.GetSignature() if b.sigSet = sig != nil; sig != nil { b.sig = *sig @@ -90,7 +177,7 @@ func (b *Token) ReadFromV2(m acl.BearerToken) error { } func (b Token) fillBody() *acl.BearerTokenBody { - if !b.eaclTableSet && !b.targetUserSet && !b.lifetimeSet && !b.impersonate { + if !b.eaclTableSet && !b.targetUserSet && !b.lifetimeSet && !b.impersonate && !b.apeOverrideSet { return nil } @@ -116,6 +203,10 @@ func (b Token) fillBody() *acl.BearerTokenBody { body.SetLifetime(&lifetime) } + if b.apeOverrideSet { + body.SetAPEOverride(b.apeOverride.ToV2()) + } + body.SetImpersonate(b.impersonate) return &body @@ -214,6 +305,25 @@ func (b Token) EACLTable() eacl.Table { return eacl.Table{} } +// SetAPEOverride sets APE override to the bearer token. +// +// See also: APEOverride. +func (b *Token) SetAPEOverride(v APEOverride) { + b.apeOverride = v + b.apeOverrideSet = true +} + +// APEOverride returns APE override set by SetAPEOverride. +// +// Zero Token has zero APEOverride. +func (b *Token) APEOverride() APEOverride { + if b.apeOverrideSet { + return b.apeOverride + } + + return APEOverride{} +} + // SetImpersonate mark token as impersonate to consider token signer as request owner. // If this field is true extended EACLTable in token body isn't processed. func (b *Token) SetImpersonate(v bool) { diff --git a/bearer/bearer_test.go b/bearer/bearer_test.go index 3c0e946..341c4f2 100644 --- a/bearer/bearer_test.go +++ b/bearer/bearer_test.go @@ -3,6 +3,7 @@ package bearer_test import ( "bytes" "math/rand" + "reflect" "testing" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" @@ -81,6 +82,58 @@ func TestToken_SetEACLTable(t *testing.T) { require.True(t, isEqualEACLTables(eaclTable, val.EACLTable())) } +func TestToken_SetAPEOverrides(t *testing.T) { + var val bearer.Token + var m acl.BearerToken + filled := bearertest.Token() + + val.WriteToV2(&m) + require.Zero(t, m.GetBody()) + + val2 := filled + + require.NoError(t, val2.Unmarshal(val.Marshal())) + require.Zero(t, val2.APEOverride()) + + val2 = filled + + jd, err := val.MarshalJSON() + require.NoError(t, err) + + require.NoError(t, val2.UnmarshalJSON(jd)) + require.Zero(t, val2.APEOverride()) + + // set value + + tApe := bearertest.APEOverride() + + val.SetAPEOverride(tApe) + require.Equal(t, tApe, val.APEOverride()) + + val.WriteToV2(&m) + require.NotNil(t, m.GetBody().GetAPEOverride()) + require.True(t, tokenAPEOverridesEqual(tApe.ToV2(), m.GetBody().GetAPEOverride())) + + val2 = filled + + require.NoError(t, val2.Unmarshal(val.Marshal())) + apeOverride := val2.APEOverride() + require.True(t, tokenAPEOverridesEqual(tApe.ToV2(), apeOverride.ToV2())) + + val2 = filled + + jd, err = val.MarshalJSON() + require.NoError(t, err) + + require.NoError(t, val2.UnmarshalJSON(jd)) + apeOverride = val.APEOverride() + require.True(t, tokenAPEOverridesEqual(tApe.ToV2(), apeOverride.ToV2())) +} + +func tokenAPEOverridesEqual(lhs, rhs *acl.APEOverride) bool { + return reflect.DeepEqual(lhs, rhs) +} + func TestToken_ForUser(t *testing.T) { var val bearer.Token var m acl.BearerToken diff --git a/bearer/test/generate.go b/bearer/test/generate.go index 4fce6a4..0ea3936 100644 --- a/bearer/test/generate.go +++ b/bearer/test/generate.go @@ -1,6 +1,7 @@ package bearertest import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ape" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" eacltest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/eacl/test" usertest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user/test" @@ -15,6 +16,17 @@ func Token() (t bearer.Token) { t.SetIat(1) t.ForUser(usertest.ID()) t.SetEACLTable(*eacltest.Table()) + t.SetAPEOverride(APEOverride()) return t } + +func APEOverride() bearer.APEOverride { + return bearer.APEOverride{ + Target: ape.ChainTarget{ + TargetType: ape.TargetTypeContainer, + Name: "F8JsMnChywiPvbDvpxMbjTjx5KhWHHp6gCDt8BhzL9kF", + }, + Chains: []ape.Chain{{Raw: []byte("{}")}}, + } +} From ebd8fcd1685f4906ddfa4835d9b722c6916dfb1f Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Mon, 27 May 2024 13:16:18 +0300 Subject: [PATCH 044/197] [#224] object: Introduce parent attributes in EC-header Signed-off-by: Airat Arifullin --- go.mod | 2 +- go.sum | 4 +-- object/erasure_code.go | 45 ++++++++++++++++++++++++++++--- object/erasurecode/reconstruct.go | 12 +++++---- object/erasurecode/split.go | 9 ++++++- 5 files changed, 59 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 96ef020..4ec6eca 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.20 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240529164544-9e825239ac5f + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240530152826-2f6d3209e1d3 git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 git.frostfs.info/TrueCloudLab/hrw v1.2.1 diff --git a/go.sum b/go.sum index 6e302d0..f2a2799 100644 --- a/go.sum +++ b/go.sum @@ -31,8 +31,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl 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-api-go/v2 v2.16.1-0.20240529164544-9e825239ac5f h1:/BC1Aq7WcfZ/g9Y3t2UfZ44/w1Z8s367MYrBSzno0cQ= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240529164544-9e825239ac5f/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240530152826-2f6d3209e1d3 h1:H5GvrVlowIMWfzqQkhY0p0myooJxQ1sMRVSFfXawwWg= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240530152826-2f6d3209e1d3/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb h1:S/TrbOOu9qEXZRZ9/Ddw7crnxbBUQLo68PSzQWYrc9M= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb/go.mod h1:nkR5gaGeez3Zv2SE7aceP0YwxG2FzIB5cGKpQO2vV2o= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= diff --git a/object/erasure_code.go b/object/erasure_code.go index 625f161..bb55fe4 100644 --- a/object/erasure_code.go +++ b/object/erasure_code.go @@ -13,18 +13,34 @@ type ECHeader struct { parent oid.ID parentSplitID *SplitID parentSplitParentID *oid.ID + parentAttributes []Attribute index uint32 total uint32 header []byte headerLength uint32 } +type ECParentInfo struct { + // EC-parent's ID. + ID oid.ID + + // EC-parent's split ID if the parent is a part of Split itself. + SplitID *SplitID + + // EC-parent's parent split ID if the parent is a part of Split itself. + SplitParentID *oid.ID + + // EC-parent's attributes. + Attributes []Attribute +} + // NewECHeader constructs new erasure coding header. -func NewECHeader(parent oid.ID, parentSplitID *SplitID, parentSplitParentID *oid.ID, index, total uint32, header []byte, headerLength uint32) *ECHeader { +func NewECHeader(ecParentInfo ECParentInfo, index, total uint32, header []byte, headerLength uint32) *ECHeader { return &ECHeader{ - parent: parent, - parentSplitID: parentSplitID, - parentSplitParentID: parentSplitParentID, + parent: ecParentInfo.ID, + parentSplitID: ecParentInfo.SplitID, + parentSplitParentID: ecParentInfo.SplitParentID, + parentAttributes: ecParentInfo.Attributes, index: index, total: total, header: header, @@ -45,6 +61,13 @@ func (e *ECHeader) WriteToV2(h *object.ECHeader) { } h.Parent = &parent + + attrs := make([]object.Attribute, len(e.parentAttributes)) + for i := range e.parentAttributes { + attrs[i] = *e.parentAttributes[i].ToV2() + } + h.ParentAttributes = attrs + h.Index = e.index h.Total = e.total h.Header = e.header @@ -60,6 +83,12 @@ func (e *ECHeader) ReadFromV2(h *object.ECHeader) error { return errors.New("empty parent") } + attrs := make([]Attribute, len(h.ParentAttributes)) + for i := range h.ParentAttributes { + attrs[i] = *NewAttributeFromV2(&h.ParentAttributes[i]) + } + e.parentAttributes = attrs + _ = e.parent.ReadFromV2(*h.Parent) e.parentSplitID = NewSplitIDFromV2(h.ParentSplitID) if h.ParentSplitParentID != nil { @@ -123,6 +152,14 @@ func (e *ECHeader) SetParentSplitParentID(parentSplitParentID *oid.ID) { e.parentSplitParentID = parentSplitParentID } +func (e *ECHeader) ParentAttributes() []Attribute { + return e.parentAttributes +} + +func (e *ECHeader) SetParentAttributes(attrs []Attribute) { + e.parentAttributes = attrs +} + func (e *ECHeader) Index() uint32 { return e.index } diff --git a/object/erasurecode/reconstruct.go b/object/erasurecode/reconstruct.go index 4561a7c..ca9767b 100644 --- a/object/erasurecode/reconstruct.go +++ b/object/erasurecode/reconstruct.go @@ -85,10 +85,13 @@ func (c *Constructor) ReconstructParts(parts []*objectSDK.Object, required []boo } ec := parts[nonNilPart].GetECHeader() - parent := ec.Parent() + ecParentInfo := objectSDK.ECParentInfo{ + ID: ec.Parent(), + SplitID: ec.ParentSplitID(), + SplitParentID: ec.ParentSplitParentID(), + Attributes: ec.ParentAttributes(), + } total := ec.Total() - splitID := ec.ParentSplitID() - parSplitParID := ec.ParentSplitParentID() for i := range required { if parts[i] != nil || !required[i] { @@ -99,8 +102,7 @@ func (c *Constructor) ReconstructParts(parts []*objectSDK.Object, required []boo copyRequiredFields(part, parts[nonNilPart]) part.SetPayload(c.payloadShards[i]) part.SetPayloadSize(uint64(len(c.payloadShards[i]))) - part.SetECHeader(objectSDK.NewECHeader(parent, splitID, parSplitParID, uint32(i), total, - c.headerShards[i], c.headerLength)) + part.SetECHeader(objectSDK.NewECHeader(ecParentInfo, uint32(i), total, c.headerShards[i], c.headerLength)) if err := setIDWithSignature(part, key); err != nil { return err diff --git a/object/erasurecode/split.go b/object/erasurecode/split.go index 63895da..bd173a7 100644 --- a/object/erasurecode/split.go +++ b/object/erasurecode/split.go @@ -41,7 +41,14 @@ func (c *Constructor) Split(obj *objectSDK.Object, key *ecdsa.PrivateKey) ([]*ob } } - ec := objectSDK.NewECHeader(parent, obj.SplitID(), parentSplitParentID, uint32(i), uint32(len(payloadShards)), headerShards[i], uint32(len(header))) + ecParentInfo := objectSDK.ECParentInfo{ + ID: parent, + SplitID: obj.SplitID(), + SplitParentID: parentSplitParentID, + Attributes: obj.Attributes(), + } + + ec := objectSDK.NewECHeader(ecParentInfo, uint32(i), uint32(len(payloadShards)), headerShards[i], uint32(len(header))) chunk.SetECHeader(ec) if err := setIDWithSignature(chunk, key); err != nil { return nil, err From 1a5886e776de79fc6598838242e4dc7ff21e7bea Mon Sep 17 00:00:00 2001 From: Ekaterina Lebedeva Date: Mon, 17 Jun 2024 16:58:10 +0300 Subject: [PATCH 045/197] [#228] client: Move isClientErrMaintenance from node Signed-off-by: Ekaterina Lebedeva --- client/errors.go | 6 ++++++ client/errors_test.go | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/client/errors.go b/client/errors.go index be87c62..b457ff0 100644 --- a/client/errors.go +++ b/client/errors.go @@ -67,6 +67,12 @@ func IsErrAPEManagerAccessDenied(err error) bool { return wrapsErrType[*apistatus.APEManagerAccessDenied](err) } +// IsErrNodeUnderMaintenance checks if err corresponds to FrostFS status return +// corresponding to nodes being under maintenance. Supports wrapped errors. +func IsErrNodeUnderMaintenance(err error) bool { + return wrapsErrType[*apistatus.NodeUnderMaintenance](err) +} + // returns error describing missing field with the given name. func newErrMissingResponseField(name string) error { return fmt.Errorf("missing %s field in the response", name) diff --git a/client/errors_test.go b/client/errors_test.go index 53872fa..acf82b9 100644 --- a/client/errors_test.go +++ b/client/errors_test.go @@ -38,6 +38,10 @@ func TestErrors(t *testing.T) { check: client.IsErrSessionNotFound, err: new(apistatus.SessionTokenNotFound), }, + { + check: client.IsErrNodeUnderMaintenance, + err: new(apistatus.NodeUnderMaintenance), + }, } for i := range errs { From 27e965007dffb49e7012c4e2cddf9223945b5d91 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Wed, 3 Jul 2024 17:20:58 +0300 Subject: [PATCH 046/197] [#233] pool: Introduce ape-manager methods * Remove GetEACL, SetEACL methods as they are deprecated; * Fix mock; * Introduce add/remove/list methods to request ape-manager from the client. Signed-off-by: Airat Arifullin --- pool/mock_test.go | 13 ++++ pool/pool.go | 154 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 167 insertions(+) diff --git a/pool/mock_test.go b/pool/mock_test.go index bf4916d..fef6f41 100644 --- a/pool/mock_test.go +++ b/pool/mock_test.go @@ -9,6 +9,7 @@ import ( sessionv2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/accounting" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ape" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" @@ -103,6 +104,18 @@ func (m *mockClient) containerSetEACL(context.Context, PrmContainerSetEACL) erro return nil } +func (c *mockClient) apeManagerAddChain(ctx context.Context, prm PrmAddAPEChain) error { + return nil +} + +func (c *mockClient) apeManagerRemoveChain(ctx context.Context, prm PrmRemoveAPEChain) error { + return nil +} + +func (c *mockClient) apeManagerListChains(ctx context.Context, prm PrmListAPEChains) ([]ape.Chain, error) { + return []ape.Chain{}, nil +} + func (m *mockClient) endpointInfo(ctx context.Context, _ prmEndpointInfo) (netmap.NodeInfo, error) { var ni netmap.NodeInfo diff --git a/pool/pool.go b/pool/pool.go index a4ffff1..7f100cf 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -15,6 +15,7 @@ import ( "time" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/accounting" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ape" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" sdkClient "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" @@ -53,6 +54,12 @@ type client interface { containerEACL(context.Context, PrmContainerEACL) (eacl.Table, error) // see clientWrapper.containerSetEACL. containerSetEACL(context.Context, PrmContainerSetEACL) error + // see clientWrapper.apeManagerAddChain. + apeManagerAddChain(context.Context, PrmAddAPEChain) error + // see clientWrapper.apeManagerRemoveChain. + apeManagerRemoveChain(context.Context, PrmRemoveAPEChain) error + // see clientWrapper.apeManagerListChains. + apeManagerListChains(context.Context, PrmListAPEChains) ([]ape.Chain, error) // see clientWrapper.endpointInfo. endpointInfo(context.Context, prmEndpointInfo) (netmap.NodeInfo, error) // see clientWrapper.networkInfo. @@ -169,6 +176,9 @@ const ( methodObjectHead methodObjectRange methodSessionCreate + methodAPEManagerAddChain + methodAPEManagerRemoveChain + methodAPEManagerListChains methodLast ) @@ -207,6 +217,12 @@ func (m MethodIndex) String() string { return "objectRange" case methodSessionCreate: return "sessionCreate" + case methodAPEManagerAddChain: + return "apeManagerAddChain" + case methodAPEManagerRemoveChain: + return "apeManagerRemoveChain" + case methodAPEManagerListChains: + return "apeManagerListChains" case methodLast: return "it's a system name rather than a method" default: @@ -641,6 +657,83 @@ func (c *clientWrapper) containerSetEACL(ctx context.Context, prm PrmContainerSe return nil } +// apeManagerAddChain invokes sdkClient.APEManagerAddChain and parse response status to error. +func (c *clientWrapper) apeManagerAddChain(ctx context.Context, prm PrmAddAPEChain) error { + cl, err := c.getClient() + if err != nil { + return err + } + + cliPrm := sdkClient.PrmAPEManagerAddChain{ + ChainTarget: prm.Target, + Chain: prm.Chain, + } + + start := time.Now() + res, err := cl.APEManagerAddChain(ctx, cliPrm) + c.incRequests(time.Since(start), methodAPEManagerAddChain) + var st apistatus.Status + if res != nil { + st = res.Status() + } + if err = c.handleError(ctx, st, err); err != nil { + return fmt.Errorf("add chain error: %w", err) + } + + return nil +} + +// apeManagerRemoveChain invokes sdkClient.APEManagerRemoveChain and parse response status to error. +func (c *clientWrapper) apeManagerRemoveChain(ctx context.Context, prm PrmRemoveAPEChain) error { + cl, err := c.getClient() + if err != nil { + return err + } + + cliPrm := sdkClient.PrmAPEManagerRemoveChain{ + ChainTarget: prm.Target, + ChainID: prm.ChainID, + } + + start := time.Now() + res, err := cl.APEManagerRemoveChain(ctx, cliPrm) + c.incRequests(time.Since(start), methodAPEManagerRemoveChain) + var st apistatus.Status + if res != nil { + st = res.Status() + } + if err = c.handleError(ctx, st, err); err != nil { + return fmt.Errorf("remove chain error: %w", err) + } + + return nil +} + +// apeManagerListChains invokes sdkClient.APEManagerListChains. Returns chains and parsed response status to error. +func (c *clientWrapper) apeManagerListChains(ctx context.Context, prm PrmListAPEChains) ([]ape.Chain, error) { + cl, err := c.getClient() + if err != nil { + return nil, err + } + + cliPrm := sdkClient.PrmAPEManagerListChains{ + ChainTarget: prm.Target, + } + + start := time.Now() + res, err := cl.APEManagerListChains(ctx, cliPrm) + c.incRequests(time.Since(start), methodAPEManagerListChains) + var st apistatus.Status + if res != nil { + st = res.Status() + } + if err = c.handleError(ctx, st, err); err != nil { + return nil, fmt.Errorf("list chains error: %w", err) + } + + return res.Chains, nil +} + // endpointInfo invokes sdkClient.EndpointInfo parse response status to error and return result as is. func (c *clientWrapper) endpointInfo(ctx context.Context, _ prmEndpointInfo) (netmap.NodeInfo, error) { cl, err := c.getClient() @@ -1723,6 +1816,22 @@ type PrmContainerSetEACL struct { WaitParams *WaitParams } +type PrmAddAPEChain struct { + Target ape.ChainTarget + + Chain ape.Chain +} + +type PrmRemoveAPEChain struct { + Target ape.ChainTarget + + ChainID ape.ChainID +} + +type PrmListAPEChains struct { + Target ape.ChainTarget +} + // SetTable sets structure of container's extended ACL to be used as a // parameter of the base client's operation. // @@ -2727,6 +2836,51 @@ func (p *Pool) SetEACL(ctx context.Context, prm PrmContainerSetEACL) error { return nil } +// AddAPEChain sends a request to set APE chain rules for a target (basically, for a container). +func (p *Pool) AddAPEChain(ctx context.Context, prm PrmAddAPEChain) error { + cp, err := p.connection() + if err != nil { + return err + } + + err = cp.apeManagerAddChain(ctx, prm) + if err != nil { + return fmt.Errorf("add ape chain via client '%s': %w", cp.address(), err) + } + + return nil +} + +// RemoveAPEChain sends a request to remove APE chain rules for a target. +func (p *Pool) RemoveAPEChain(ctx context.Context, prm PrmRemoveAPEChain) error { + cp, err := p.connection() + if err != nil { + return err + } + + err = cp.apeManagerRemoveChain(ctx, prm) + if err != nil { + return fmt.Errorf("remove ape chain via client '%s': %w", cp.address(), err) + } + + return nil +} + +// ListAPEChains sends a request to list APE chains rules for a target. +func (p *Pool) ListAPEChains(ctx context.Context, prm PrmListAPEChains) ([]ape.Chain, error) { + cp, err := p.connection() + if err != nil { + return nil, err + } + + chains, err := cp.apeManagerListChains(ctx, prm) + if err != nil { + return nil, fmt.Errorf("list ape chains via client '%s': %w", cp.address(), err) + } + + return chains, nil +} + // Balance requests current balance of the FrostFS account. // // Main return value MUST NOT be processed on an erroneous return. From 560cbbd1f1e4ccdd3e1b77c736c05633f31f6ed5 Mon Sep 17 00:00:00 2001 From: Marina Biryukova Date: Fri, 5 Jul 2024 12:29:55 +0300 Subject: [PATCH 047/197] [#234] pool: Update token expiration check in cache Signed-off-by: Marina Biryukova --- pool/cache.go | 17 +++++++++++------ pool/cache_test.go | 2 +- pool/pool.go | 8 ++++++-- pool/sampler_test.go | 2 +- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/pool/cache.go b/pool/cache.go index 5c39888..05bbcae 100644 --- a/pool/cache.go +++ b/pool/cache.go @@ -9,21 +9,22 @@ import ( ) type sessionCache struct { - cache *lru.Cache[string, *cacheValue] - currentEpoch atomic.Uint64 + cache *lru.Cache[string, *cacheValue] + currentEpoch atomic.Uint64 + tokenDuration uint64 } type cacheValue struct { token session.Object } -func newCache() (*sessionCache, error) { +func newCache(tokenDuration uint64) (*sessionCache, error) { cache, err := lru.New[string, *cacheValue](100) if err != nil { return nil, err } - return &sessionCache{cache: cache}, nil + return &sessionCache{cache: cache, tokenDuration: tokenDuration}, nil } // Get returns a copy of the session token from the cache without signature @@ -66,8 +67,12 @@ func (c *sessionCache) updateEpoch(newEpoch uint64) { func (c *sessionCache) expired(val *cacheValue) bool { epoch := c.currentEpoch.Load() - // use epoch+1 (clear cache beforehand) to prevent 'expired session token' error right after epoch tick - return val.token.ExpiredAt(epoch + 1) + preExpiredDur := c.tokenDuration / 2 + if preExpiredDur == 0 { + preExpiredDur = 1 + } + + return val.token.ExpiredAt(epoch + preExpiredDur) } func (c *sessionCache) Epoch() uint64 { diff --git a/pool/cache_test.go b/pool/cache_test.go index c1f12c8..d49c4d8 100644 --- a/pool/cache_test.go +++ b/pool/cache_test.go @@ -20,7 +20,7 @@ func TestSessionCache_GetUnmodifiedToken(t *testing.T) { require.False(t, tok.VerifySignature(), extra) } - cache, err := newCache() + cache, err := newCache(0) require.NoError(t, err) cache.Put(key, target) diff --git a/pool/pool.go b/pool/pool.go index 7f100cf..0cffc30 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -1947,7 +1947,7 @@ type innerPool struct { } const ( - defaultSessionTokenExpirationDuration = 100 // in blocks + defaultSessionTokenExpirationDuration = 100 // in epochs defaultErrorThreshold = 100 defaultRebalanceInterval = 15 * time.Second @@ -1969,7 +1969,7 @@ func NewPool(options InitParameters) (*Pool, error) { return nil, err } - cache, err := newCache() + cache, err := newCache(options.sessionExpirationDuration) if err != nil { return nil, fmt.Errorf("couldn't create cache: %w", err) } @@ -2087,6 +2087,10 @@ func fillDefaultInitParams(params *InitParameters, cache *sessionCache) { params.nodeStreamTimeout = defaultStreamTimeout } + if cache.tokenDuration == 0 { + cache.tokenDuration = defaultSessionTokenExpirationDuration + } + if params.isMissingClientBuilder() { params.setClientBuilder(func(addr string) client { var prm wrapperPrm diff --git a/pool/sampler_test.go b/pool/sampler_test.go index 5ea2326..5ece768 100644 --- a/pool/sampler_test.go +++ b/pool/sampler_test.go @@ -47,7 +47,7 @@ func TestHealthyReweight(t *testing.T) { buffer = make([]float64, len(weights)) ) - cache, err := newCache() + cache, err := newCache(0) require.NoError(t, err) client1 := newMockClient(names[0], *newPrivateKey(t)) From 51cefd4908c50930503aee56a76a9f047a8b9189 Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Tue, 9 Jul 2024 12:19:25 +0300 Subject: [PATCH 048/197] [#232] netmap: Allow empty values for unknown parameters in network config Signed-off-by: Alexander Chuprov --- netmap/network_info.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/netmap/network_info.go b/netmap/network_info.go index a149bf4..1e553f4 100644 --- a/netmap/network_info.go +++ b/netmap/network_info.go @@ -49,11 +49,6 @@ func (x *NetworkInfo) readFromV2(m netmap.NetworkInfo, checkFieldPresence bool) mNames[name] = struct{}{} switch name { - default: - if len(prm.GetValue()) == 0 { - err = fmt.Errorf("empty attribute value %s", name) - return true - } case configAuditFee, configStoragePrice, From 9d89f08c7b9a57cc08262ff767c8ea5aee8359d7 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 12 Jul 2024 10:10:56 +0300 Subject: [PATCH 049/197] [#236] go.mod: Bump min go version to go1.21 Signed-off-by: Evgenii Stratonikov --- .forgejo/workflows/dco.yml | 2 +- .forgejo/workflows/tests.yml | 4 ++-- go.mod | 2 +- go.sum | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/dco.yml b/.forgejo/workflows/dco.yml index c8aa5e3..dcee5fc 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.22' - 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 946e685..1ad32dc 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.21' + go-version: '1.22' cache: true - name: Install linters @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go_versions: [ '1.20', '1.21' ] + go_versions: [ '1.21', '1.22' ] fail-fast: false steps: - uses: actions/checkout@v3 diff --git a/go.mod b/go.mod index 4ec6eca..f5554f1 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go -go 1.20 +go 1.21 require ( git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240530152826-2f6d3209e1d3 diff --git a/go.sum b/go.sum index f2a2799..21cb148 100644 --- a/go.sum +++ b/go.sum @@ -180,6 +180,7 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 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/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 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= From a69f00903cb109ec569c9a90662627be90c9074b Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 12 Jul 2024 10:22:35 +0300 Subject: [PATCH 050/197] [#236] netmap: Replace sort.Slice() with slices.Sort() 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-sdk-go/netmap cpu: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz │ old │ new │ │ sec/op │ sec/op vs base │ Netmap_ContainerNodes/REP_2-8 10.395µ ± 14% 9.227µ ± 13% -11.24% (p=0.015 n=10) Netmap_ContainerNodes/REP_2_IN_X_CBF_2_SELECT_2_FROM_*_AS_X-8 10.110µ ± 16% 9.189µ ± 7% ~ (p=0.105 n=10) geomean 10.25µ 9.208µ -10.18% │ old │ new │ │ B/op │ B/op vs base │ Netmap_ContainerNodes/REP_2-8 8.695Ki ± 0% 8.320Ki ± 0% -4.31% (p=0.000 n=10) Netmap_ContainerNodes/REP_2_IN_X_CBF_2_SELECT_2_FROM_*_AS_X-8 8.117Ki ± 0% 7.742Ki ± 0% -4.62% (p=0.000 n=10) geomean 8.401Ki 8.026Ki -4.47% │ old │ new │ │ allocs/op │ allocs/op vs base │ Netmap_ContainerNodes/REP_2-8 138.0 ± 0% 122.0 ± 0% -11.59% (p=0.000 n=10) Netmap_ContainerNodes/REP_2_IN_X_CBF_2_SELECT_2_FROM_*_AS_X-8 138.0 ± 0% 122.0 ± 0% -11.59% (p=0.000 n=10) geomean 138.0 122.0 -11.59% ``` Signed-off-by: Evgenii Stratonikov --- netmap/aggregator.go | 6 ++---- netmap/node_info.go | 22 +++++----------------- netmap/selector.go | 11 ++++++----- netmap/selector_test.go | 7 ++++--- 4 files changed, 17 insertions(+), 29 deletions(-) diff --git a/netmap/aggregator.go b/netmap/aggregator.go index 0f577a0..433a3ba 100644 --- a/netmap/aggregator.go +++ b/netmap/aggregator.go @@ -1,8 +1,6 @@ package netmap -import ( - "sort" -) +import "slices" type ( // aggregator can calculate some value across all netmap @@ -128,7 +126,7 @@ func (a *meanIQRAgg) Compute() float64 { return 0 } - sort.Slice(a.arr, func(i, j int) bool { return a.arr[i] < a.arr[j] }) + slices.Sort(a.arr) var min, max float64 diff --git a/netmap/node_info.go b/netmap/node_info.go index 8f323f7..bd37388 100644 --- a/netmap/node_info.go +++ b/netmap/node_info.go @@ -3,7 +3,7 @@ package netmap import ( "errors" "fmt" - "sort" + "slices" "strconv" "strings" @@ -227,14 +227,6 @@ func (x NodeInfo) Hash() uint64 { return hrw.Hash(x.m.GetPublicKey()) } -// less declares "less than" comparison between two NodeInfo instances: -// x1 is less than x2 if it has less Hash(). -// -// Method is needed for internal placement needs. -func less(x1, x2 NodeInfo) bool { - return x1.Hash() < x2.Hash() -} - func (x *NodeInfo) setNumericAttribute(key string, num uint64) { x.SetAttribute(key, strconv.FormatUint(num, 10)) } @@ -455,15 +447,11 @@ func (x *NodeInfo) SortAttributes() { return } - sort.Slice(as, func(i, j int) bool { - switch strings.Compare(as[i].GetKey(), as[j].GetKey()) { - case -1: - return true - case 1: - return false - default: - return as[i].GetValue() < as[j].GetValue() + slices.SortFunc(as, func(ai, aj netmap.Attribute) int { + if r := strings.Compare(ai.GetKey(), aj.GetKey()); r != 0 { + return r } + return strings.Compare(ai.GetValue(), aj.GetValue()) }) x.m.SetAttributes(as) diff --git a/netmap/selector.go b/netmap/selector.go index f9247ff..d57a89d 100644 --- a/netmap/selector.go +++ b/netmap/selector.go @@ -1,8 +1,9 @@ package netmap import ( + "cmp" "fmt" - "sort" + "slices" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" "git.frostfs.info/TrueCloudLab/hrw" @@ -70,12 +71,12 @@ func (c *context) getSelection(s netmap.Selector) ([]nodes, error) { // we also need to have deterministic input to HRW sorting routine. if len(c.hrwSeed) == 0 { if s.GetAttribute() == "" { - sort.Slice(buckets, func(i, j int) bool { - return less(buckets[i].nodes[0], buckets[j].nodes[0]) + slices.SortFunc(buckets, func(b1, b2 nodeAttrPair) int { + return cmp.Compare(b1.nodes[0].Hash(), b2.nodes[0].Hash()) }) } else { - sort.Slice(buckets, func(i, j int) bool { - return buckets[i].attr < buckets[j].attr + slices.SortFunc(buckets, func(b1, b2 nodeAttrPair) int { + return cmp.Compare(b1.attr, b2.attr) }) } } diff --git a/netmap/selector_test.go b/netmap/selector_test.go index 934ff7e..0f0dd24 100644 --- a/netmap/selector_test.go +++ b/netmap/selector_test.go @@ -1,11 +1,12 @@ package netmap import ( + "cmp" "crypto/rand" "encoding/binary" "fmt" mrand "math/rand" - "sort" + "slices" "strconv" "testing" @@ -85,8 +86,8 @@ func BenchmarkHRWSort(b *testing.B) { copy(realNodes, vectors) b.StartTimer() - sort.Slice(vectors, func(i, j int) bool { - return less(vectors[i][0], vectors[j][0]) + slices.SortFunc(vectors, func(vi, vj nodes) int { + return cmp.Compare(vi[0].Hash(), vj[0].Hash()) }) hrw.SortSliceByWeightIndex(realNodes, weights, pivot) } From 159a50fcf0f2a35653eb1ad94fb10a4ce56d7fc9 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 12 Jul 2024 10:33:34 +0300 Subject: [PATCH 051/197] [#236] netmap: Reduce allocations in getSelection() 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-sdk-go/netmap cpu: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz │ new │ alloc │ │ sec/op │ sec/op vs base │ Netmap_ContainerNodes/REP_2-8 9.227µ ± 13% 8.677µ ± 6% ~ (p=0.165 n=10) Netmap_ContainerNodes/REP_2_IN_X_CBF_2_SELECT_2_FROM_*_AS_X-8 9.189µ ± 7% 7.946µ ± 14% -13.53% (p=0.001 n=10) geomean 9.208µ 8.303µ -9.82% │ new │ alloc │ │ B/op │ B/op vs base │ Netmap_ContainerNodes/REP_2-8 8.320Ki ± 0% 7.734Ki ± 0% -7.04% (p=0.000 n=10) Netmap_ContainerNodes/REP_2_IN_X_CBF_2_SELECT_2_FROM_*_AS_X-8 7.742Ki ± 0% 7.156Ki ± 0% -7.57% (p=0.000 n=10) geomean 8.026Ki 7.440Ki -7.31% │ new │ alloc │ │ allocs/op │ allocs/op vs base │ Netmap_ContainerNodes/REP_2-8 122.00 ± 0% 92.00 ± 0% -24.59% (p=0.000 n=10) Netmap_ContainerNodes/REP_2_IN_X_CBF_2_SELECT_2_FROM_*_AS_X-8 122.00 ± 0% 92.00 ± 0% -24.59% (p=0.000 n=10) geomean 122.0 92.00 -24.59% ``` Signed-off-by: Evgenii Stratonikov --- netmap/aggregator.go | 11 +++++------ netmap/selector.go | 4 +++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/netmap/aggregator.go b/netmap/aggregator.go index 433a3ba..6926b84 100644 --- a/netmap/aggregator.go +++ b/netmap/aggregator.go @@ -72,12 +72,6 @@ func newMinAgg() aggregator { return new(minAgg) } -// newMeanIQRAgg returns an aggregator which -// computes mean value of values from IQR interval. -func newMeanIQRAgg() aggregator { - return new(meanIQRAgg) -} - // newReverseMinNorm returns a normalizer which // normalize values in range of 0.0 to 1.0 to a minimum value. func newReverseMinNorm(min float64) normalizer { @@ -116,6 +110,11 @@ func (a *minAgg) Compute() float64 { return a.min } +func (a *meanIQRAgg) clear() { + a.k = 0 + a.arr = a.arr[:0] +} + func (a *meanIQRAgg) Add(n float64) { a.arr = append(a.arr, n) } diff --git a/netmap/selector.go b/netmap/selector.go index d57a89d..b16e774 100644 --- a/netmap/selector.go +++ b/netmap/selector.go @@ -104,8 +104,10 @@ func (c *context) getSelection(s netmap.Selector) ([]nodes, error) { if len(c.hrwSeed) != 0 { weights := make([]float64, len(res)) + a := new(meanIQRAgg) for i := range res { - weights[i] = calcBucketWeight(res[i], newMeanIQRAgg(), c.weightFunc) + a.clear() + weights[i] = calcBucketWeight(res[i], a, c.weightFunc) } hrw.SortHasherSliceByWeightValue(res, weights, c.hrwSeedHash) From 6729f54c4edb8bfe7c174f107937e6501a082f1f Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 12 Jul 2024 10:46:53 +0300 Subject: [PATCH 052/197] [#236] netmap: Reuse slice for weights in ContainerNodes() 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-sdk-go/netmap cpu: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz │ alloc │ weights │ │ sec/op │ sec/op vs base │ Netmap_ContainerNodes/REP_2-8 8.677µ ± 6% 8.384µ ± 10% ~ (p=0.247 n=10) Netmap_ContainerNodes/REP_2_IN_X_CBF_2_SELECT_2_FROM_*_AS_X-8 7.946µ ± 14% 7.998µ ± 6% ~ (p=0.481 n=10) geomean 8.303µ 8.189µ -1.38% │ alloc │ weights │ │ B/op │ B/op vs base │ Netmap_ContainerNodes/REP_2-8 7.734Ki ± 0% 7.617Ki ± 0% -1.52% (p=0.000 n=10) Netmap_ContainerNodes/REP_2_IN_X_CBF_2_SELECT_2_FROM_*_AS_X-8 7.156Ki ± 0% 7.039Ki ± 0% -1.64% (p=0.000 n=10) geomean 7.440Ki 7.322Ki -1.58% │ alloc │ weights │ │ allocs/op │ allocs/op vs base │ Netmap_ContainerNodes/REP_2-8 92.00 ± 0% 77.00 ± 0% -16.30% (p=0.000 n=10) Netmap_ContainerNodes/REP_2_IN_X_CBF_2_SELECT_2_FROM_*_AS_X-8 92.00 ± 0% 77.00 ± 0% -16.30% (p=0.000 n=10) geomean 92.00 77.00 -16.30% ``` Signed-off-by: Evgenii Stratonikov --- netmap/netmap.go | 12 ++++++++---- netmap/selector.go | 4 +++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/netmap/netmap.go b/netmap/netmap.go index f0ece7d..85e2a84 100644 --- a/netmap/netmap.go +++ b/netmap/netmap.go @@ -113,9 +113,10 @@ func (n nodes) Hash() uint64 { return 0 } -// weights returns slice of nodes weights W. -func (n nodes) weights(wf weightFunc) []float64 { - w := make([]float64, 0, len(n)) +func (n nodes) appendWeightsTo(wf weightFunc, w []float64) []float64 { + if cap(w) < len(n) { + w = make([]float64, 0, len(n)) + } for i := range n { w = append(w, wf(n[i])) } @@ -149,10 +150,13 @@ func (m NetMap) PlacementVectors(vectors [][]NodeInfo, pivot []byte) ([][]NodeIn wf := defaultWeightFunc(m.nodes) result := make([][]NodeInfo, len(vectors)) + var ws []float64 + for i := range vectors { result[i] = make([]NodeInfo, len(vectors[i])) copy(result[i], vectors[i]) - hrw.SortHasherSliceByWeightValue(result[i], nodes(result[i]).weights(wf), h) + ws = nodes(result[i]).appendWeightsTo(wf, ws[:0]) + hrw.SortHasherSliceByWeightValue(result[i], ws, h) } return result, nil diff --git a/netmap/selector.go b/netmap/selector.go index b16e774..ab73cec 100644 --- a/netmap/selector.go +++ b/netmap/selector.go @@ -171,8 +171,10 @@ func (c *context) getSelectionBase(s netmap.Selector) []nodeAttrPair { } if len(c.hrwSeed) != 0 { + var ws []float64 for i := range result { - hrw.SortHasherSliceByWeightValue(result[i].nodes, result[i].nodes.weights(c.weightFunc), c.hrwSeedHash) + ws = result[i].nodes.appendWeightsTo(c.weightFunc, ws[:0]) + hrw.SortHasherSliceByWeightValue(result[i].nodes, ws, c.hrwSeedHash) } } From e977b8a94cac63b93e49a1adf82c909ad6b2894b Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 12 Jul 2024 13:10:48 +0300 Subject: [PATCH 053/197] [#236] netmap: Remove unused field from `meanIQRAgg` It was there since the inception [1], but we never got to use it. [1] https://github.com/nspcc-dev/netmap/commit/5931284e07260e251ef758ad60aaa46c9bd7110c Signed-off-by: Evgenii Stratonikov --- netmap/aggregator.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/netmap/aggregator.go b/netmap/aggregator.go index 6926b84..c4a43c1 100644 --- a/netmap/aggregator.go +++ b/netmap/aggregator.go @@ -26,7 +26,6 @@ type ( } meanIQRAgg struct { - k float64 arr []float64 } @@ -111,7 +110,6 @@ func (a *minAgg) Compute() float64 { } func (a *meanIQRAgg) clear() { - a.k = 0 a.arr = a.arr[:0] } @@ -135,8 +133,7 @@ func (a *meanIQRAgg) Compute() float64 { min, max = a.arr[0], a.arr[l-1] } else { start, end := l/minLn, l*3/minLn-1 - iqr := a.k * (a.arr[end] - a.arr[start]) - min, max = a.arr[start]-iqr, a.arr[end]+iqr + min, max = a.arr[start], a.arr[end] } count := 0 From fc7c524fcb3042efb38d2f1ef4e27ceec723a0ed Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 12 Jul 2024 15:42:55 +0300 Subject: [PATCH 054/197] [#236] *: Replace slice.Copy() with bytes.Clone() The former is deprecated. Signed-off-by: Evgenii Stratonikov --- session/container_test.go | 4 ++-- session/object_test.go | 4 ++-- user/id_test.go | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/session/container_test.go b/session/container_test.go index d906482..73fd815 100644 --- a/session/container_test.go +++ b/session/container_test.go @@ -1,6 +1,7 @@ package session_test import ( + "bytes" "crypto/rand" "fmt" "math" @@ -17,7 +18,6 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user" usertest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user/test" "github.com/google/uuid" - "github.com/nspcc-dev/neo-go/pkg/util/slice" "github.com/stretchr/testify/require" ) @@ -179,7 +179,7 @@ func TestContainerProtocolV2(t *testing.T) { breakSign: func(m *v2session.Token) { body := m.GetBody() key := body.GetSessionKey() - cp := slice.Copy(key) + cp := bytes.Clone(key) cp[len(cp)-1]++ body.SetSessionKey(cp) }, diff --git a/session/object_test.go b/session/object_test.go index 1df0f76..6990ff8 100644 --- a/session/object_test.go +++ b/session/object_test.go @@ -1,6 +1,7 @@ package session_test import ( + "bytes" "crypto/ecdsa" "fmt" "math" @@ -19,7 +20,6 @@ import ( usertest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user/test" "github.com/google/uuid" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" - "github.com/nspcc-dev/neo-go/pkg/util/slice" "github.com/stretchr/testify/require" ) @@ -200,7 +200,7 @@ func TestObjectProtocolV2(t *testing.T) { breakSign: func(m *v2session.Token) { body := m.GetBody() key := body.GetSessionKey() - cp := slice.Copy(key) + cp := bytes.Clone(key) cp[len(cp)-1]++ body.SetSessionKey(cp) }, diff --git a/user/id_test.go b/user/id_test.go index 00b0884..9867472 100644 --- a/user/id_test.go +++ b/user/id_test.go @@ -1,6 +1,7 @@ package user_test import ( + "bytes" "crypto/rand" "testing" @@ -10,7 +11,6 @@ import ( "github.com/mr-tron/base58" "github.com/nspcc-dev/neo-go/pkg/encoding/address" "github.com/nspcc-dev/neo-go/pkg/util" - "github.com/nspcc-dev/neo-go/pkg/util/slice" "github.com/stretchr/testify/require" ) @@ -84,7 +84,7 @@ func TestV2_ID(t *testing.T) { }) t.Run("invalid prefix", func(t *testing.T) { - val := slice.Copy(val) + val := bytes.Clone(val) val[0]++ m.SetValue(val) @@ -94,7 +94,7 @@ func TestV2_ID(t *testing.T) { }) t.Run("invalid checksum", func(t *testing.T) { - val := slice.Copy(val) + val := bytes.Clone(val) val[21]++ m.SetValue(val) From c4ff8a6cda51ec871d0b4b2570e28d03f02add9a Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 12 Jul 2024 14:22:03 +0300 Subject: [PATCH 055/197] [#236] go.mod: Update neo-go to v0.106.2 Signed-off-by: Evgenii Stratonikov --- go.mod | 41 +++++++++---------- go.sum | 125 +++++++++++++++++++++++++++++++++++++-------------------- 2 files changed, 101 insertions(+), 65 deletions(-) diff --git a/go.mod b/go.mod index f5554f1..84a04d1 100644 --- a/go.mod +++ b/go.mod @@ -9,41 +9,40 @@ require ( git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 github.com/antlr4-go/antlr/v4 v4.13.0 - github.com/google/uuid v1.3.0 - github.com/hashicorp/golang-lru/v2 v2.0.2 + github.com/google/uuid v1.6.0 + github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/klauspost/reedsolomon v1.12.1 github.com/mr-tron/base58 v1.2.0 - github.com/nspcc-dev/neo-go v0.101.2-0.20230601131642-a0117042e8fc - github.com/stretchr/testify v1.8.3 - go.uber.org/zap v1.24.0 - google.golang.org/grpc v1.55.0 + github.com/nspcc-dev/neo-go v0.106.2 + github.com/stretchr/testify v1.9.0 + go.uber.org/zap v1.27.0 + google.golang.org/grpc v1.62.0 google.golang.org/protobuf v1.33.0 gopkg.in/yaml.v3 v3.0.1 ) require ( git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 // indirect - github.com/benbjohnson/clock v1.1.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/gorilla/websocket v1.5.0 // indirect - github.com/hashicorp/golang-lru v0.6.0 // indirect + github.com/golang/snappy v0.0.1 // indirect + github.com/gorilla/websocket v1.5.1 // indirect github.com/klauspost/cpuid/v2 v2.2.6 // indirect - github.com/nspcc-dev/go-ordered-json v0.0.0-20220111165707-25110be27d22 // indirect - github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20230615193820-9185820289ce // indirect - github.com/nspcc-dev/rfc6979 v0.2.0 // indirect + github.com/nspcc-dev/go-ordered-json v0.0.0-20240301084351-0246b013f8b2 // indirect + github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20240521091047-78685785716d // indirect + github.com/nspcc-dev/rfc6979 v0.2.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.8.1 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954 // indirect github.com/twmb/murmur3 v1.1.8 // indirect - go.uber.org/atomic v1.10.0 // indirect - go.uber.org/goleak v1.2.1 // indirect + go.etcd.io/bbolt v1.3.9 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sync v0.2.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/crypto v0.21.0 // indirect + golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/sync v0.6.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect ) diff --git a/go.sum b/go.sum index 21cb148..d822c00 100644 --- a/go.sum +++ b/go.sum @@ -65,11 +65,13 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210521073959-f0d4d129b7f1/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= @@ -86,6 +88,8 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/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= @@ -93,8 +97,14 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk 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/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= +github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= +github.com/consensys/gnark-crypto v0.12.2-0.20231013160410-1f65e75b6dfb h1:f0BMgIjhZy4lSRHCXFbQst85f5agZAjtDMixQqBWNpc= +github.com/consensys/gnark-crypto v0.12.2-0.20231013160410-1f65e75b6dfb/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -115,6 +125,7 @@ github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGE github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:rZfgFAXFS/z/lEd6LJmf9HVZ1LkgYiHx5pHhV5DR16M= github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= 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= @@ -179,8 +190,8 @@ github.com/google/go-cmp v0.5.4/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/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +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/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 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= @@ -194,22 +205,22 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf 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/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/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/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= +github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= 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/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru v0.6.0 h1:uL2shRDx7RTrOrTCUZEGP/wJUFiUI8QT6E7z5o8jga4= -github.com/hashicorp/golang-lru v0.6.0/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru/v2 v2.0.2 h1:Dwmkdr5Nc/oBiXgJS3CDHNhJtIHkuZ3DZF5twqnfBdU= -github.com/hashicorp/golang-lru/v2 v2.0.2/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= +github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= +github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -250,6 +261,8 @@ github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2y github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= +github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -267,17 +280,18 @@ github.com/nspcc-dev/dbft v0.0.0-20200219114139-199d286ed6c1/go.mod h1:O0qtn62pr github.com/nspcc-dev/dbft v0.0.0-20210721160347-1b03241391ac/go.mod h1:U8MSnEShH+o5hexfWJdze6uMFJteP0ko7J2frO7Yu1Y= github.com/nspcc-dev/dbft v0.0.0-20220902113116-58a5e763e647/go.mod h1:g9xisXmX9NP9MjioaTe862n9SlZTrP+6PVUWLBYOr98= github.com/nspcc-dev/go-ordered-json v0.0.0-20210915112629-e1b6cce73d02/go.mod h1:79bEUDEviBHJMFV6Iq6in57FEOCMcRhfQnfaf0ETA5U= -github.com/nspcc-dev/go-ordered-json v0.0.0-20220111165707-25110be27d22 h1:n4ZaFCKt1pQJd7PXoMJabZWK9ejjbLOVrkl/lOUmshg= github.com/nspcc-dev/go-ordered-json v0.0.0-20220111165707-25110be27d22/go.mod h1:79bEUDEviBHJMFV6Iq6in57FEOCMcRhfQnfaf0ETA5U= +github.com/nspcc-dev/go-ordered-json v0.0.0-20240301084351-0246b013f8b2 h1:mD9hU3v+zJcnHAVmHnZKt3I++tvn30gBj2rP2PocZMk= +github.com/nspcc-dev/go-ordered-json v0.0.0-20240301084351-0246b013f8b2/go.mod h1:U5VfmPNM88P4RORFb6KSUVBdJBDhlqggJZYGXGPxOcc= github.com/nspcc-dev/hrw v1.0.9/go.mod h1:l/W2vx83vMQo6aStyx2AuZrJ+07lGv2JQGlVkPG06MU= github.com/nspcc-dev/neo-go v0.73.1-pre.0.20200303142215-f5a1b928ce09/go.mod h1:pPYwPZ2ks+uMnlRLUyXOpLieaDQSEaf4NM3zHVbRjmg= github.com/nspcc-dev/neo-go v0.98.0/go.mod h1:E3cc1x6RXSXrJb2nDWXTXjnXk3rIqVN8YdFyWv+FrqM= github.com/nspcc-dev/neo-go v0.99.4/go.mod h1:mKTolfRUfKjFso5HPvGSQtUZc70n0VKBMs16eGuC5gA= -github.com/nspcc-dev/neo-go v0.101.2-0.20230601131642-a0117042e8fc h1:fySIWvUQsitK5e5qYIHnTDCXuPpwzz89SEUEIyY11sg= -github.com/nspcc-dev/neo-go v0.101.2-0.20230601131642-a0117042e8fc/go.mod h1:s9QhjMC784MWqTURovMbyYduIJc86mnCruxcMiAebpc= +github.com/nspcc-dev/neo-go v0.106.2 h1:KXSJ2J5Oacc7LrX3r4jvnC8ihKqHs5NB21q4f2S3r9o= +github.com/nspcc-dev/neo-go v0.106.2/go.mod h1:Ojwfx3/lv0VTeEHMpQ17g0wTnXcCSoFQVq5GEeCZmGo= github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220927123257-24c107e3a262/go.mod h1:23bBw0v6pBYcrWs8CBEEDIEDJNbcFoIh8pGGcf2Vv8s= -github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20230615193820-9185820289ce h1:vLGuUNDkmQrWMa4rr4vTd1u8ULqejWxVmNz1L7ocTEI= -github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20230615193820-9185820289ce/go.mod h1:ZUuXOkdtHZgaC13za/zMgXfQFncZ0jLzfQTe+OsDOtg= +github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20240521091047-78685785716d h1:Vcb7YkZuUSSIC+WF/xV3UDfHbAxZgyT2zGleJP3Ig5k= +github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20240521091047-78685785716d/go.mod h1:/vrbWSHc7YS1KSYhVOyyeucXW/e+1DkVBOgnBEXUCeY= github.com/nspcc-dev/neofs-api-go/v2 v2.11.0-pre.0.20211201134523-3604d96f3fe1/go.mod h1:oS8dycEh8PPf2Jjp6+8dlwWyEv2Dy77h/XhhcdxYEFs= github.com/nspcc-dev/neofs-api-go/v2 v2.11.1/go.mod h1:oS8dycEh8PPf2Jjp6+8dlwWyEv2Dy77h/XhhcdxYEFs= github.com/nspcc-dev/neofs-crypto v0.2.0/go.mod h1:F/96fUzPM3wR+UGsPi3faVNmFlA9KAEAUQR7dMxZmNA= @@ -287,24 +301,27 @@ github.com/nspcc-dev/neofs-crypto v0.4.0/go.mod h1:6XJ8kbXgOfevbI2WMruOtI+qUJXNw github.com/nspcc-dev/neofs-sdk-go v0.0.0-20211201182451-a5b61c4f6477/go.mod h1:dfMtQWmBHYpl9Dez23TGtIUKiFvCIxUZq/CkSIhEpz4= github.com/nspcc-dev/neofs-sdk-go v0.0.0-20220113123743-7f3162110659/go.mod h1:/jay1lr3w7NQd/VDBkEhkJmDmyPNsu4W+QV2obsUV40= github.com/nspcc-dev/rfc6979 v0.1.0/go.mod h1:exhIh1PdpDC5vQmyEsGvc4YDM/lyQp/452QxGq/UEso= -github.com/nspcc-dev/rfc6979 v0.2.0 h1:3e1WNxrN60/6N0DW7+UYisLeZJyfqZTNOjeV/toYvOE= github.com/nspcc-dev/rfc6979 v0.2.0/go.mod h1:exhIh1PdpDC5vQmyEsGvc4YDM/lyQp/452QxGq/UEso= +github.com/nspcc-dev/rfc6979 v0.2.1 h1:8wWxkamHWFmO790GsewSoKUSJjVnL1fmdRpokU/RgRM= +github.com/nspcc-dev/rfc6979 v0.2.1/go.mod h1:Tk7h5kyUWkhjyO3zUgFFhy1v2vQv3BvQEntakdtqrWc= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -315,16 +332,22 @@ github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= +github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= @@ -332,12 +355,16 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= 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/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -350,8 +377,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV 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/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/syndtr/goleveldb v0.0.0-20180307113352-169b1b37be73/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954 h1:xQdMZ1WLrgkkvOZ/LDQxjVxMLdby7osSh4ZEVa5sIjs= github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= @@ -359,8 +386,8 @@ github.com/twmb/murmur3 v1.1.5/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq github.com/twmb/murmur3 v1.1.8 h1:8Yt9taO/WN3l08xErzjeschgZU2QSrwm1kclYq+0aRg= github.com/twmb/murmur3 v1.1.8/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU= github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/virtuald/go-ordered-json v0.0.0-20170621173500-b18e6e673d74 h1:JwtAtbp7r/7QSyGz8mKUbYJBg2+6Cd7OjM8o/GNOcVo= github.com/virtuald/go-ordered-json v0.0.0-20170621173500-b18e6e673d74/go.mod h1:RmMWU37GKR2s6pgrIEB4ixgpVCt/cf7dnJv3fuH1J1c= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -370,8 +397,9 @@ github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/gopher-lua v0.0.0-20190514113301-1cd887cd7036/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20191128022950-c6266f4fe8d7/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= +go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE= 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= @@ -381,19 +409,17 @@ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqe go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= -go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -405,8 +431,8 @@ golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= 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= @@ -417,8 +443,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 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/exp v0.0.0-20230515195305-f3d0a9c9a5cc h1:mCRnTeVUjcrhlRmO0VK8a6k6Rrf6TF9htwo2pJVSjIU= -golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= +golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= 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= @@ -440,6 +466,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB 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/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= +golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 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= @@ -478,8 +506,8 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= 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= @@ -499,8 +527,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/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/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.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -556,11 +584,13 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 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/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210429154555-c04ba851c2a4/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= 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= @@ -568,8 +598,8 @@ 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.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -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/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= 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= @@ -617,9 +647,12 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= +golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= 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 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= 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= @@ -673,8 +706,8 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc 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-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= 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= @@ -690,8 +723,8 @@ google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM 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.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= -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/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= +google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= 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= @@ -716,6 +749,7 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogR gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -724,6 +758,7 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= @@ -739,3 +774,5 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 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= +rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= +rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= From e18b91623138a2b5ff774db029dcec148f5ee938 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Tue, 16 Jul 2024 11:22:01 +0300 Subject: [PATCH 056/197] [#238] go.mod: Update frostfs-contract to v0.19.3 Signed-off-by: Denis Kirillov --- go.mod | 3 +- go.sum | 594 +-------------------------------------------------------- 2 files changed, 5 insertions(+), 592 deletions(-) diff --git a/go.mod b/go.mod index 84a04d1..b0be06c 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21 require ( git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240530152826-2f6d3209e1d3 - git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb + git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3 git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 @@ -33,7 +33,6 @@ require ( github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20240521091047-78685785716d // indirect github.com/nspcc-dev/rfc6979 v0.2.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954 // indirect github.com/twmb/murmur3 v1.1.8 // indirect go.etcd.io/bbolt v1.3.9 // indirect diff --git a/go.sum b/go.sum index d822c00..f44c0a1 100644 --- a/go.sum +++ b/go.sum @@ -1,40 +1,7 @@ -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-api-go/v2 v2.16.1-0.20240530152826-2f6d3209e1d3 h1:H5GvrVlowIMWfzqQkhY0p0myooJxQ1sMRVSFfXawwWg= git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240530152826-2f6d3209e1d3/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= -git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb h1:S/TrbOOu9qEXZRZ9/Ddw7crnxbBUQLo68PSzQWYrc9M= -git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb/go.mod h1:nkR5gaGeez3Zv2SE7aceP0YwxG2FzIB5cGKpQO2vV2o= +git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3 h1:zt8OAof+3YKIdRqg8EaLfbqq+4TnWGnsrXEXyGMNz5M= +git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3/go.mod h1:F/fe1OoIDKr5Bz99q4sriuHDuf3aZefZy9ZsCqEtgxc= 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/hrw v1.2.1 h1:ccBRK21rFvY5R1WotI6LNoPlizk7qSvdfD8lNIRudVc= @@ -43,686 +10,159 @@ git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 h1:M2KR3iBj7WpY3hP10IevfIB9MURr4O9m git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0/go.mod h1:okpbKfVYf/BpejtfFTfhZqFP+sZ8rsHrP8Rr/jYPNRc= git.frostfs.info/TrueCloudLab/tzhash v1.8.0 h1:UFMnUIk0Zh17m8rjGHJMqku2hCgaXDqjqZzS4gsb4UA= git.frostfs.info/TrueCloudLab/tzhash v1.8.0/go.mod h1:dhY+oy274hV8wGvGL4MwwMpdL3GYvaX1a8GQZQHvlF8= -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/CityOfZion/neo-go v0.62.1-pre.0.20191114145240-e740fbe708f8/go.mod h1:MJCkWUBhi9pn/CrYO1Q3P687y2KeahrOPS9BD9LDGb0= -github.com/CityOfZion/neo-go v0.70.1-pre.0.20191209120015-fccb0085941e/go.mod h1:0enZl0az8xA6PVkwzEOwPWVJGqlt/GO4hA4kmQ5Xzig= -github.com/CityOfZion/neo-go v0.70.1-pre.0.20191212173117-32ac01130d4c/go.mod h1:JtlHfeqLywZLswKIKFnAp+yzezY4Dji9qlfQKB2OD/I= -github.com/CityOfZion/neo-go v0.71.1-pre.0.20200129171427-f773ec69fb84/go.mod h1:FLI526IrRWHmcsO+mHsCbj64pJZhwQFTLJZu+A4PGOA= -github.com/Workiva/go-datastructures v1.0.50/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= -github.com/abiosoft/ishell v2.0.0+incompatible/go.mod h1:HQR9AqF2R3P4XXpMpI0NAzgHf/aS6+zVXRj14cVk9qg= -github.com/abiosoft/ishell/v2 v2.0.2/go.mod h1:E4oTCXfo6QjoCart0QYa5m9w4S+deXs/P/9jA77A9Bs= -github.com/abiosoft/readline v0.0.0-20180607040430-155bce2042db/go.mod h1:rB3B4rKii8V21ydCbIzH5hZiCQE7f5E9SzUb/ZZx530= -github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis v2.5.0+incompatible/go.mod h1:8HZjEj4yU0dwhYHky+DxYx+6BMjkBbe5ONFIF1MXffk= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210521073959-f0d4d129b7f1/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= -github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= -github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= -github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= -github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= -github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= -github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= -github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/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/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= github.com/consensys/gnark-crypto v0.12.2-0.20231013160410-1f65e75b6dfb h1:f0BMgIjhZy4lSRHCXFbQst85f5agZAjtDMixQqBWNpc= github.com/consensys/gnark-crypto v0.12.2-0.20231013160410-1f65e75b6dfb/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= -github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= -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.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/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= -github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:rZfgFAXFS/z/lEd6LJmf9HVZ1LkgYiHx5pHhV5DR16M= -github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -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-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-redis/redis v6.10.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -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/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= 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/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= -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.4/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/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 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/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -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/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/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/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -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/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -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/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/klauspost/reedsolomon v1.12.1 h1:NhWgum1efX1x58daOBGCFWcxtEhOhXKKl1HAPQUp03Q= github.com/klauspost/reedsolomon v1.12.1/go.mod h1:nEi5Kjb6QqtbofI6s+cbG/j1da11c96IBYBSnVGtuBs= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +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/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= 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/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nspcc-dev/dbft v0.0.0-20191205084618-dacb1a30c254/go.mod h1:w1Ln2aT+dBlPhLnuZhBV+DfPEdS2CHWWLp5JTScY3bw= -github.com/nspcc-dev/dbft v0.0.0-20191209120240-0d6b7568d9ae/go.mod h1:3FjXOoHmA51EGfb5GS/HOv7VdmngNRTssSeQ729dvGY= -github.com/nspcc-dev/dbft v0.0.0-20200117124306-478e5cfbf03a/go.mod h1:/YFK+XOxxg0Bfm6P92lY5eDSLYfp06XOdL8KAVgXjVk= -github.com/nspcc-dev/dbft v0.0.0-20200219114139-199d286ed6c1/go.mod h1:O0qtn62prQSqizzoagHmuuKoz8QMkU3SzBoKdEvm3aQ= -github.com/nspcc-dev/dbft v0.0.0-20210721160347-1b03241391ac/go.mod h1:U8MSnEShH+o5hexfWJdze6uMFJteP0ko7J2frO7Yu1Y= -github.com/nspcc-dev/dbft v0.0.0-20220902113116-58a5e763e647/go.mod h1:g9xisXmX9NP9MjioaTe862n9SlZTrP+6PVUWLBYOr98= -github.com/nspcc-dev/go-ordered-json v0.0.0-20210915112629-e1b6cce73d02/go.mod h1:79bEUDEviBHJMFV6Iq6in57FEOCMcRhfQnfaf0ETA5U= -github.com/nspcc-dev/go-ordered-json v0.0.0-20220111165707-25110be27d22/go.mod h1:79bEUDEviBHJMFV6Iq6in57FEOCMcRhfQnfaf0ETA5U= github.com/nspcc-dev/go-ordered-json v0.0.0-20240301084351-0246b013f8b2 h1:mD9hU3v+zJcnHAVmHnZKt3I++tvn30gBj2rP2PocZMk= github.com/nspcc-dev/go-ordered-json v0.0.0-20240301084351-0246b013f8b2/go.mod h1:U5VfmPNM88P4RORFb6KSUVBdJBDhlqggJZYGXGPxOcc= -github.com/nspcc-dev/hrw v1.0.9/go.mod h1:l/W2vx83vMQo6aStyx2AuZrJ+07lGv2JQGlVkPG06MU= -github.com/nspcc-dev/neo-go v0.73.1-pre.0.20200303142215-f5a1b928ce09/go.mod h1:pPYwPZ2ks+uMnlRLUyXOpLieaDQSEaf4NM3zHVbRjmg= -github.com/nspcc-dev/neo-go v0.98.0/go.mod h1:E3cc1x6RXSXrJb2nDWXTXjnXk3rIqVN8YdFyWv+FrqM= -github.com/nspcc-dev/neo-go v0.99.4/go.mod h1:mKTolfRUfKjFso5HPvGSQtUZc70n0VKBMs16eGuC5gA= github.com/nspcc-dev/neo-go v0.106.2 h1:KXSJ2J5Oacc7LrX3r4jvnC8ihKqHs5NB21q4f2S3r9o= github.com/nspcc-dev/neo-go v0.106.2/go.mod h1:Ojwfx3/lv0VTeEHMpQ17g0wTnXcCSoFQVq5GEeCZmGo= -github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220927123257-24c107e3a262/go.mod h1:23bBw0v6pBYcrWs8CBEEDIEDJNbcFoIh8pGGcf2Vv8s= github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20240521091047-78685785716d h1:Vcb7YkZuUSSIC+WF/xV3UDfHbAxZgyT2zGleJP3Ig5k= github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20240521091047-78685785716d/go.mod h1:/vrbWSHc7YS1KSYhVOyyeucXW/e+1DkVBOgnBEXUCeY= -github.com/nspcc-dev/neofs-api-go/v2 v2.11.0-pre.0.20211201134523-3604d96f3fe1/go.mod h1:oS8dycEh8PPf2Jjp6+8dlwWyEv2Dy77h/XhhcdxYEFs= -github.com/nspcc-dev/neofs-api-go/v2 v2.11.1/go.mod h1:oS8dycEh8PPf2Jjp6+8dlwWyEv2Dy77h/XhhcdxYEFs= -github.com/nspcc-dev/neofs-crypto v0.2.0/go.mod h1:F/96fUzPM3wR+UGsPi3faVNmFlA9KAEAUQR7dMxZmNA= -github.com/nspcc-dev/neofs-crypto v0.2.3/go.mod h1:8w16GEJbH6791ktVqHN9YRNH3s9BEEKYxGhlFnp0cDw= -github.com/nspcc-dev/neofs-crypto v0.3.0/go.mod h1:8w16GEJbH6791ktVqHN9YRNH3s9BEEKYxGhlFnp0cDw= -github.com/nspcc-dev/neofs-crypto v0.4.0/go.mod h1:6XJ8kbXgOfevbI2WMruOtI+qUJXNwSGM/E9eClXxPHs= -github.com/nspcc-dev/neofs-sdk-go v0.0.0-20211201182451-a5b61c4f6477/go.mod h1:dfMtQWmBHYpl9Dez23TGtIUKiFvCIxUZq/CkSIhEpz4= -github.com/nspcc-dev/neofs-sdk-go v0.0.0-20220113123743-7f3162110659/go.mod h1:/jay1lr3w7NQd/VDBkEhkJmDmyPNsu4W+QV2obsUV40= -github.com/nspcc-dev/rfc6979 v0.1.0/go.mod h1:exhIh1PdpDC5vQmyEsGvc4YDM/lyQp/452QxGq/UEso= -github.com/nspcc-dev/rfc6979 v0.2.0/go.mod h1:exhIh1PdpDC5vQmyEsGvc4YDM/lyQp/452QxGq/UEso= github.com/nspcc-dev/rfc6979 v0.2.1 h1:8wWxkamHWFmO790GsewSoKUSJjVnL1fmdRpokU/RgRM= github.com/nspcc-dev/rfc6979 v0.2.1/go.mod h1:Tk7h5kyUWkhjyO3zUgFFhy1v2vQv3BvQEntakdtqrWc= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 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_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.2.1/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= -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/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -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.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/syndtr/goleveldb v0.0.0-20180307113352-169b1b37be73/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954 h1:xQdMZ1WLrgkkvOZ/LDQxjVxMLdby7osSh4ZEVa5sIjs= github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= -github.com/twmb/murmur3 v1.1.5/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= github.com/twmb/murmur3 v1.1.8 h1:8Yt9taO/WN3l08xErzjeschgZU2QSrwm1kclYq+0aRg= github.com/twmb/murmur3 v1.1.8/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU= github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/virtuald/go-ordered-json v0.0.0-20170621173500-b18e6e673d74/go.mod h1:RmMWU37GKR2s6pgrIEB4ixgpVCt/cf7dnJv3fuH1J1c= -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= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/gopher-lua v0.0.0-20190514113301-1cd887cd7036/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= -github.com/yuin/gopher-lua v0.0.0-20191128022950-c6266f4fe8d7/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE= -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/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 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-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -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/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= -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/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/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-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -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-20200520004742-59133d7f0dd7/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-20200813134508-3edf25e44fcc/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/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -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-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= 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.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/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-20190222072716-a9d3bda3a223/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-20190422165155-953cdadca894/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-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/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-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/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-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210429154555-c04ba851c2a4/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= -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.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -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-20180318012157-96caea41033d/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 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-20191108193012-7d206e10da11/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/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= -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 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= 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/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= -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.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -730,49 +170,23 @@ google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ 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.28.1/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/abiosoft/ishell.v2 v2.0.0/go.mod h1:sFp+cGtH6o4s1FtpVPTMcHq2yue+c4DGOVohJCPUzwY= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/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= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -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.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/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= rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= From 7c06cdff2d28c298e7fcbcb6ad15f56954d8106f Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Thu, 11 Jul 2024 17:18:28 +0300 Subject: [PATCH 057/197] [#239] pool/tree: Update tree service client Update tree service to fix split tree problem. Tree intermediate nodes can be duplicated so we must handle this. Signed-off-by: Denis Kirillov --- go.mod | 2 +- pool/tree/pool.go | 44 +- pool/tree/pool_signature.go | 41 +- pool/tree/service/service.pb.go | 330 ++-- pool/tree/service/service_frostfs.pb.go | 1887 +++++++++++++++++++++++ pool/tree/service/service_grpc.pb.go | 46 +- pool/tree/service/types.pb.go | 4 +- pool/tree/service/types_frostfs.pb.go | 106 ++ syncTree.sh | 9 +- 9 files changed, 2226 insertions(+), 243 deletions(-) create mode 100644 pool/tree/service/service_frostfs.pb.go create mode 100644 pool/tree/service/types_frostfs.pb.go diff --git a/go.mod b/go.mod index b0be06c..4e12445 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ go 1.21 require ( git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240530152826-2f6d3209e1d3 git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3 - git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 github.com/antlr4-go/antlr/v4 v4.13.0 @@ -22,6 +21,7 @@ require ( ) require ( + git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 // indirect git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect diff --git a/pool/tree/pool.go b/pool/tree/pool.go index 2c55351..b610909 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -126,7 +126,7 @@ type GetNodesParams struct { type GetSubTreeParams struct { CID cid.ID TreeID string - RootID uint64 + RootID []uint64 Depth uint32 BearerToken []byte Order SubTreeSort @@ -308,12 +308,7 @@ func (p *Pool) GetNodes(ctx context.Context, prm GetNodesParams) ([]*grpcService }, } - if err := p.signRequest(request.Body, func(key, sign []byte) { - request.Signature = &grpcService.Signature{ - Key: key, - Sign: sign, - } - }); err != nil { + if err := p.signRequest(request); err != nil { return nil, err } @@ -410,12 +405,7 @@ func (p *Pool) GetSubTree(ctx context.Context, prm GetSubTreeParams) (*SubTreeRe request.Body.OrderBy.Direction = grpcService.GetSubTreeRequest_Body_Order_None } - if err := p.signRequest(request.Body, func(key, sign []byte) { - request.Signature = &grpcService.Signature{ - Key: key, - Sign: sign, - } - }); err != nil { + if err := p.signRequest(request); err != nil { return nil, err } @@ -445,12 +435,7 @@ func (p *Pool) AddNode(ctx context.Context, prm AddNodeParams) (uint64, error) { BearerToken: prm.BearerToken, }, } - if err := p.signRequest(request.Body, func(key, sign []byte) { - request.Signature = &grpcService.Signature{ - Key: key, - Sign: sign, - } - }); err != nil { + if err := p.signRequest(request); err != nil { return 0, err } @@ -482,12 +467,7 @@ func (p *Pool) AddNodeByPath(ctx context.Context, prm AddNodeByPathParams) (uint }, } - if err := p.signRequest(request.Body, func(key, sign []byte) { - request.Signature = &grpcService.Signature{ - Key: key, - Sign: sign, - } - }); err != nil { + if err := p.signRequest(request); err != nil { return 0, err } @@ -527,12 +507,7 @@ func (p *Pool) MoveNode(ctx context.Context, prm MoveNodeParams) error { }, } - if err := p.signRequest(request.Body, func(key, sign []byte) { - request.Signature = &grpcService.Signature{ - Key: key, - Sign: sign, - } - }); err != nil { + if err := p.signRequest(request); err != nil { return err } @@ -558,12 +533,7 @@ func (p *Pool) RemoveNode(ctx context.Context, prm RemoveNodeParams) error { BearerToken: prm.BearerToken, }, } - if err := p.signRequest(request.Body, func(key, sign []byte) { - request.Signature = &grpcService.Signature{ - Key: key, - Sign: sign, - } - }); err != nil { + if err := p.signRequest(request); err != nil { return err } diff --git a/pool/tree/pool_signature.go b/pool/tree/pool_signature.go index 0b3a2f6..5a8def1 100644 --- a/pool/tree/pool_signature.go +++ b/pool/tree/pool_signature.go @@ -1,25 +1,38 @@ package tree import ( - crypto "git.frostfs.info/TrueCloudLab/frostfs-crypto" - "google.golang.org/protobuf/proto" + frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa" + tree "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool/tree/service" ) -func (p *Pool) signData(buf []byte, f func(key, sign []byte)) error { - sign, err := crypto.Sign(&p.key.PrivateKey, buf) +type message interface { + SignedDataSize() int + ReadSignedData([]byte) ([]byte, error) + GetSignature() *tree.Signature + SetSignature(*tree.Signature) +} + +// signMessage uses the pool key and signs any protobuf +// message that was generated for the TreeService by the +// protoc-gen-go-frostfs generator. Returns any errors directly. +func (p *Pool) signRequest(m message) error { + binBody, err := m.ReadSignedData(nil) if err != nil { return err } - f(p.key.PublicKey().Bytes(), sign) + keySDK := frostfsecdsa.Signer(p.key.PrivateKey) + data, err := keySDK.Sign(binBody) + if err != nil { + return err + } + + rawPub := make([]byte, keySDK.Public().MaxEncodedSize()) + rawPub = rawPub[:keySDK.Public().Encode(rawPub)] + m.SetSignature(&tree.Signature{ + Key: rawPub, + Sign: data, + }) + return nil } - -func (p *Pool) signRequest(requestBody proto.Message, f func(key, sign []byte)) error { - buf, err := proto.Marshal(requestBody) - if err != nil { - return err - } - - return p.signData(buf, f) -} diff --git a/pool/tree/service/service.pb.go b/pool/tree/service/service.pb.go index 63f3e71..f439e3f 100644 --- a/pool/tree/service/service.pb.go +++ b/pool/tree/service/service.pb.go @@ -3,8 +3,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v3.21.9 +// protoc-gen-go v1.33.0 +// protoc v4.25.0 // source: pkg/services/tree/service.proto package tree @@ -1979,8 +1979,8 @@ type GetSubTreeRequest_Body struct { ContainerId []byte `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` // The name of the tree. TreeId string `protobuf:"bytes,2,opt,name=tree_id,json=treeId,proto3" json:"tree_id,omitempty"` - // ID of the root node of a subtree. - RootId uint64 `protobuf:"varint,3,opt,name=root_id,json=rootId,proto3" json:"root_id,omitempty"` + // IDs of the root nodes of a subtree forest. + RootId []uint64 `protobuf:"varint,3,rep,name=root_id,json=rootId,proto3" json:"root_id,omitempty"` // Optional depth of the traversal. Zero means return only root. // Maximum depth is 10. Depth uint32 `protobuf:"varint,4,opt,name=depth,proto3" json:"depth,omitempty"` @@ -2036,11 +2036,11 @@ func (x *GetSubTreeRequest_Body) GetTreeId() string { return "" } -func (x *GetSubTreeRequest_Body) GetRootId() uint64 { +func (x *GetSubTreeRequest_Body) GetRootId() []uint64 { if x != nil { return x.RootId } - return 0 + return nil } func (x *GetSubTreeRequest_Body) GetDepth() uint32 { @@ -2117,11 +2117,11 @@ type GetSubTreeResponse_Body struct { unknownFields protoimpl.UnknownFields // ID of the node. - NodeId uint64 `protobuf:"varint,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` + NodeId []uint64 `protobuf:"varint,1,rep,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` // ID of the parent. - ParentId uint64 `protobuf:"varint,2,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"` + ParentId []uint64 `protobuf:"varint,2,rep,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"` // Time node was first added to a tree. - Timestamp uint64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Timestamp []uint64 `protobuf:"varint,3,rep,name=timestamp,proto3" json:"timestamp,omitempty"` // Node meta-information. Meta []*KeyValue `protobuf:"bytes,4,rep,name=meta,proto3" json:"meta,omitempty"` } @@ -2158,25 +2158,25 @@ func (*GetSubTreeResponse_Body) Descriptor() ([]byte, []int) { return file_pkg_services_tree_service_proto_rawDescGZIP(), []int{11, 0} } -func (x *GetSubTreeResponse_Body) GetNodeId() uint64 { +func (x *GetSubTreeResponse_Body) GetNodeId() []uint64 { if x != nil { return x.NodeId } - return 0 + return nil } -func (x *GetSubTreeResponse_Body) GetParentId() uint64 { +func (x *GetSubTreeResponse_Body) GetParentId() []uint64 { if x != nil { return x.ParentId } - return 0 + return nil } -func (x *GetSubTreeResponse_Body) GetTimestamp() uint64 { +func (x *GetSubTreeResponse_Body) GetTimestamp() []uint64 { if x != nil { return x.Timestamp } - return 0 + return nil } func (x *GetSubTreeResponse_Body) GetMeta() []*KeyValue { @@ -2742,173 +2742,175 @@ var file_pkg_services_tree_service_proto_rawDesc = []byte{ 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x42, 0x79, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, - 0x73, 0x22, 0xbf, 0x03, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x54, 0x72, 0x65, 0x65, + 0x73, 0x22, 0xc3, 0x03, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2d, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0xc8, 0x02, 0x0a, 0x04, 0x42, 0x6f, 0x64, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0xcc, 0x02, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x72, 0x65, 0x65, 0x49, 0x64, 0x12, 0x17, 0x0a, - 0x07, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, - 0x72, 0x6f, 0x6f, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x70, 0x74, 0x68, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x64, 0x65, 0x70, 0x74, 0x68, 0x12, 0x21, 0x0a, 0x0c, - 0x62, 0x65, 0x61, 0x72, 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0b, 0x62, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x3d, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x54, - 0x72, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, - 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x1a, 0x73, - 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x4a, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x74, 0x72, 0x65, - 0x65, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x44, - 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0x1e, 0x0a, 0x09, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x73, - 0x63, 0x10, 0x01, 0x22, 0xf6, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x54, 0x72, - 0x65, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x62, 0x6f, - 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, - 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2d, 0x0a, - 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0f, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x7e, 0x0a, 0x04, - 0x42, 0x6f, 0x64, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, - 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x22, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x4b, 0x65, - 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x9b, 0x01, 0x0a, - 0x0f, 0x54, 0x72, 0x65, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x2e, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, - 0x12, 0x2d, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, - 0x29, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x22, 0x8c, 0x01, 0x0a, 0x10, 0x54, - 0x72, 0x65, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x2f, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, - 0x74, 0x72, 0x65, 0x65, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, - 0x12, 0x2d, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, - 0x18, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0xdb, 0x01, 0x0a, 0x0c, 0x41, 0x70, - 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x62, 0x6f, - 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, - 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, - 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2d, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x72, 0x65, - 0x65, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x6f, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x21, - 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x74, 0x72, 0x65, 0x65, 0x49, 0x64, 0x12, 0x2b, 0x0a, 0x09, 0x6f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, - 0x74, 0x72, 0x65, 0x65, 0x2e, 0x4c, 0x6f, 0x67, 0x4d, 0x6f, 0x76, 0x65, 0x52, 0x09, 0x6f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x74, 0x0a, 0x0d, 0x41, 0x70, 0x70, 0x6c, 0x79, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x41, 0x70, - 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, - 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2d, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x72, 0x65, 0x65, - 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x22, 0xe2, 0x01, - 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x72, 0x65, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, + 0x07, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x04, 0x42, 0x02, + 0x10, 0x00, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, + 0x70, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x64, 0x65, 0x70, 0x74, 0x68, + 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x65, 0x61, 0x72, 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x62, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x12, 0x3d, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x47, 0x65, 0x74, + 0x53, 0x75, 0x62, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, + 0x6f, 0x64, 0x79, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, + 0x42, 0x79, 0x1a, 0x73, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x4a, 0x0a, 0x09, 0x64, + 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, + 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x54, 0x72, 0x65, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x4f, 0x72, 0x64, + 0x65, 0x72, 0x2e, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x64, 0x69, + 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x1e, 0x0a, 0x09, 0x44, 0x69, 0x72, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x07, + 0x0a, 0x03, 0x41, 0x73, 0x63, 0x10, 0x01, 0x22, 0x83, 0x02, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x53, + 0x75, 0x62, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, + 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, + 0x72, 0x65, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x12, 0x2d, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x53, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x1a, 0x8a, 0x01, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x1b, 0x0a, 0x07, 0x6e, 0x6f, 0x64, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x02, 0x10, 0x00, 0x52, 0x06, + 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x42, 0x02, 0x10, 0x00, 0x52, 0x08, 0x70, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x04, 0x42, 0x02, 0x10, 0x00, 0x52, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x22, 0x0a, 0x04, 0x6d, 0x65, 0x74, + 0x61, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x4b, + 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x9b, 0x01, + 0x0a, 0x0f, 0x54, 0x72, 0x65, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x4c, 0x6f, 0x67, 0x52, + 0x1a, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2d, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x1a, 0x70, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, + 0x1a, 0x29, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x74, - 0x72, 0x65, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x72, - 0x65, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x14, 0x0a, 0x05, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x22, 0xa7, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x4c, 0x6f, 0x67, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x47, 0x65, 0x74, - 0x4f, 0x70, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x22, 0x8c, 0x01, 0x0a, 0x10, + 0x54, 0x72, 0x65, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x2f, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x12, 0x2d, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x53, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x1a, 0x18, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0xdb, 0x01, 0x0a, 0x0c, 0x41, + 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x62, + 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x72, 0x65, 0x65, + 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2d, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x33, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, - 0x2b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x4c, 0x6f, 0x67, 0x4d, 0x6f, 0x76, - 0x65, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x80, 0x01, 0x0a, - 0x13, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, - 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, - 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2d, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x72, - 0x65, 0x65, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x22, - 0x7e, 0x0a, 0x12, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, - 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, - 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2d, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x72, - 0x65, 0x65, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x32, - 0xd6, 0x04, 0x0a, 0x0b, 0x54, 0x72, 0x65, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x2a, 0x0a, 0x03, 0x41, 0x64, 0x64, 0x12, 0x10, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x41, 0x64, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, - 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x09, 0x41, - 0x64, 0x64, 0x42, 0x79, 0x50, 0x61, 0x74, 0x68, 0x12, 0x16, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, - 0x41, 0x64, 0x64, 0x42, 0x79, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x17, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x42, 0x79, 0x50, 0x61, 0x74, - 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x52, 0x65, 0x6d, - 0x6f, 0x76, 0x65, 0x12, 0x13, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, - 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, - 0x0a, 0x04, 0x4d, 0x6f, 0x76, 0x65, 0x12, 0x11, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x4d, 0x6f, - 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x74, 0x72, 0x65, 0x65, - 0x2e, 0x4d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, - 0x0d, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x42, 0x79, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1a, - 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x42, 0x79, 0x50, - 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x74, 0x72, 0x65, - 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x42, 0x79, 0x50, 0x61, 0x74, 0x68, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x75, - 0x62, 0x54, 0x72, 0x65, 0x65, 0x12, 0x17, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x47, 0x65, 0x74, - 0x53, 0x75, 0x62, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, - 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x54, 0x72, 0x65, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x39, 0x0a, 0x08, 0x54, 0x72, - 0x65, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x54, 0x72, - 0x65, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, - 0x74, 0x72, 0x65, 0x65, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x12, - 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x4f, 0x70, - 0x4c, 0x6f, 0x67, 0x12, 0x15, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x70, - 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x74, 0x72, 0x65, - 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x30, 0x01, 0x12, 0x42, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, - 0x65, 0x63, 0x6b, 0x12, 0x18, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, - 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, - 0x74, 0x72, 0x65, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2f, 0x74, 0x72, 0x65, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x6f, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, + 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x72, 0x65, 0x65, 0x49, 0x64, 0x12, 0x2b, 0x0a, 0x09, 0x6f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, + 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x4c, 0x6f, 0x67, 0x4d, 0x6f, 0x76, 0x65, 0x52, 0x09, 0x6f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x74, 0x0a, 0x0d, 0x41, 0x70, 0x70, 0x6c, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x41, + 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, + 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2d, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x72, 0x65, + 0x65, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x22, 0xe2, + 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x4c, 0x6f, 0x67, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, + 0x64, 0x79, 0x12, 0x2d, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x1a, 0x70, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, + 0x74, 0x72, 0x65, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, + 0x72, 0x65, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x14, 0x0a, + 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x22, 0xa7, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x4c, 0x6f, 0x67, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x47, 0x65, + 0x74, 0x4f, 0x70, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, + 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2d, 0x0a, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, + 0x72, 0x65, 0x65, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x33, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, + 0x12, 0x2b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x4c, 0x6f, 0x67, 0x4d, 0x6f, + 0x76, 0x65, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x80, 0x01, + 0x0a, 0x13, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, + 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, + 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2d, 0x0a, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, + 0x72, 0x65, 0x65, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, + 0x22, 0x7e, 0x0a, 0x12, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x6c, + 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, + 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2d, 0x0a, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, + 0x72, 0x65, 0x65, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, + 0x32, 0xd6, 0x04, 0x0a, 0x0b, 0x54, 0x72, 0x65, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x2a, 0x0a, 0x03, 0x41, 0x64, 0x64, 0x12, 0x10, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x41, + 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x74, 0x72, 0x65, 0x65, + 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x09, + 0x41, 0x64, 0x64, 0x42, 0x79, 0x50, 0x61, 0x74, 0x68, 0x12, 0x16, 0x2e, 0x74, 0x72, 0x65, 0x65, + 0x2e, 0x41, 0x64, 0x64, 0x42, 0x79, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x17, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x42, 0x79, 0x50, 0x61, + 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x52, 0x65, + 0x6d, 0x6f, 0x76, 0x65, 0x12, 0x13, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x52, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x74, 0x72, 0x65, 0x65, + 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x2d, 0x0a, 0x04, 0x4d, 0x6f, 0x76, 0x65, 0x12, 0x11, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x4d, + 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x74, 0x72, 0x65, + 0x65, 0x2e, 0x4d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, + 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x42, 0x79, 0x50, 0x61, 0x74, 0x68, 0x12, + 0x1a, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x42, 0x79, + 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x74, 0x72, + 0x65, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x42, 0x79, 0x50, 0x61, 0x74, 0x68, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, + 0x75, 0x62, 0x54, 0x72, 0x65, 0x65, 0x12, 0x17, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x47, 0x65, + 0x74, 0x53, 0x75, 0x62, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x18, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x54, 0x72, 0x65, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x39, 0x0a, 0x08, 0x54, + 0x72, 0x65, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x54, + 0x72, 0x65, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x12, + 0x12, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x4f, + 0x70, 0x4c, 0x6f, 0x67, 0x12, 0x15, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4f, + 0x70, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x74, 0x72, + 0x65, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x42, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x12, 0x18, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x6c, + 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, + 0x2e, 0x74, 0x72, 0x65, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, + 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x73, 0x2f, 0x74, 0x72, 0x65, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/pool/tree/service/service_frostfs.pb.go b/pool/tree/service/service_frostfs.pb.go new file mode 100644 index 0000000..1a49c5c --- /dev/null +++ b/pool/tree/service/service_frostfs.pb.go @@ -0,0 +1,1887 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package tree + +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 *AddRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.ContainerId) + size += proto.StringSize(2, x.TreeId) + size += proto.UInt64Size(3, x.ParentId) + for i := range x.Meta { + size += proto.NestedStructureSize(4, x.Meta[i]) + } + size += proto.BytesSize(5, x.BearerToken) + 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 *AddRequest_Body) 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.ContainerId) + offset += proto.StringMarshal(2, buf[offset:], x.TreeId) + offset += proto.UInt64Marshal(3, buf[offset:], x.ParentId) + for i := range x.Meta { + offset += proto.NestedStructureMarshal(4, buf[offset:], x.Meta[i]) + } + offset += proto.BytesMarshal(5, buf[offset:], x.BearerToken) + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *AddRequest) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + 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 *AddRequest) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// 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 *AddRequest) 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 *AddRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *AddRequest) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *AddResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.UInt64Size(1, x.NodeId) + 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 *AddResponse_Body) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.UInt64Marshal(1, buf[offset:], x.NodeId) + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *AddResponse) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + 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 *AddResponse) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// 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 *AddResponse) 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 *AddResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *AddResponse) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *AddByPathRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.ContainerId) + size += proto.StringSize(2, x.TreeId) + size += proto.StringSize(3, x.PathAttribute) + size += proto.RepeatedStringSize(4, x.Path) + for i := range x.Meta { + size += proto.NestedStructureSize(5, x.Meta[i]) + } + size += proto.BytesSize(6, x.BearerToken) + 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 *AddByPathRequest_Body) 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.ContainerId) + offset += proto.StringMarshal(2, buf[offset:], x.TreeId) + offset += proto.StringMarshal(3, buf[offset:], x.PathAttribute) + offset += proto.RepeatedStringMarshal(4, buf[offset:], x.Path) + for i := range x.Meta { + offset += proto.NestedStructureMarshal(5, buf[offset:], x.Meta[i]) + } + offset += proto.BytesMarshal(6, buf[offset:], x.BearerToken) + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *AddByPathRequest) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + 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 *AddByPathRequest) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// 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 *AddByPathRequest) 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 *AddByPathRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *AddByPathRequest) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *AddByPathResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + var n int + n, _ = proto.RepeatedUInt64Size(1, x.Nodes) + size += n + size += proto.UInt64Size(2, x.ParentId) + 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 *AddByPathResponse_Body) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.RepeatedUInt64Marshal(1, buf[offset:], x.Nodes) + offset += proto.UInt64Marshal(2, buf[offset:], x.ParentId) + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *AddByPathResponse) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + 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 *AddByPathResponse) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// 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 *AddByPathResponse) 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 *AddByPathResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *AddByPathResponse) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *RemoveRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.ContainerId) + size += proto.StringSize(2, x.TreeId) + size += proto.UInt64Size(3, x.NodeId) + size += proto.BytesSize(4, x.BearerToken) + 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 *RemoveRequest_Body) 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.ContainerId) + offset += proto.StringMarshal(2, buf[offset:], x.TreeId) + offset += proto.UInt64Marshal(3, buf[offset:], x.NodeId) + offset += proto.BytesMarshal(4, buf[offset:], x.BearerToken) + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *RemoveRequest) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + 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 *RemoveRequest) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// 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 *RemoveRequest) 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 *RemoveRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *RemoveRequest) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *RemoveResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + 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 *RemoveResponse_Body) StableMarshal(buf []byte) []byte { + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *RemoveResponse) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + 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 *RemoveResponse) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// 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 *RemoveResponse) 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 *RemoveResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *RemoveResponse) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *MoveRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.ContainerId) + size += proto.StringSize(2, x.TreeId) + size += proto.UInt64Size(3, x.ParentId) + size += proto.UInt64Size(4, x.NodeId) + for i := range x.Meta { + size += proto.NestedStructureSize(5, x.Meta[i]) + } + size += proto.BytesSize(6, x.BearerToken) + 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 *MoveRequest_Body) 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.ContainerId) + offset += proto.StringMarshal(2, buf[offset:], x.TreeId) + offset += proto.UInt64Marshal(3, buf[offset:], x.ParentId) + offset += proto.UInt64Marshal(4, buf[offset:], x.NodeId) + for i := range x.Meta { + offset += proto.NestedStructureMarshal(5, buf[offset:], x.Meta[i]) + } + offset += proto.BytesMarshal(6, buf[offset:], x.BearerToken) + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *MoveRequest) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + 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 *MoveRequest) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// 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 *MoveRequest) 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 *MoveRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *MoveRequest) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *MoveResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + 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 *MoveResponse_Body) StableMarshal(buf []byte) []byte { + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *MoveResponse) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + 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 *MoveResponse) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// 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 *MoveResponse) 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 *MoveResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *MoveResponse) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetNodeByPathRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.ContainerId) + size += proto.StringSize(2, x.TreeId) + size += proto.StringSize(3, x.PathAttribute) + size += proto.RepeatedStringSize(4, x.Path) + size += proto.RepeatedStringSize(5, x.Attributes) + size += proto.BoolSize(6, x.LatestOnly) + size += proto.BoolSize(7, x.AllAttributes) + size += proto.BytesSize(8, x.BearerToken) + 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 *GetNodeByPathRequest_Body) 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.ContainerId) + offset += proto.StringMarshal(2, buf[offset:], x.TreeId) + offset += proto.StringMarshal(3, buf[offset:], x.PathAttribute) + offset += proto.RepeatedStringMarshal(4, buf[offset:], x.Path) + offset += proto.RepeatedStringMarshal(5, buf[offset:], x.Attributes) + offset += proto.BoolMarshal(6, buf[offset:], x.LatestOnly) + offset += proto.BoolMarshal(7, buf[offset:], x.AllAttributes) + offset += proto.BytesMarshal(8, buf[offset:], x.BearerToken) + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetNodeByPathRequest) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + 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 *GetNodeByPathRequest) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// 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 *GetNodeByPathRequest) 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 *GetNodeByPathRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *GetNodeByPathRequest) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetNodeByPathResponse_Info) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.UInt64Size(1, x.NodeId) + size += proto.UInt64Size(2, x.Timestamp) + for i := range x.Meta { + size += proto.NestedStructureSize(3, x.Meta[i]) + } + size += proto.UInt64Size(4, x.ParentId) + 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 *GetNodeByPathResponse_Info) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.UInt64Marshal(1, buf[offset:], x.NodeId) + offset += proto.UInt64Marshal(2, buf[offset:], x.Timestamp) + for i := range x.Meta { + offset += proto.NestedStructureMarshal(3, buf[offset:], x.Meta[i]) + } + offset += proto.UInt64Marshal(4, buf[offset:], x.ParentId) + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetNodeByPathResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + for i := range x.Nodes { + size += proto.NestedStructureSize(1, x.Nodes[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 *GetNodeByPathResponse_Body) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + for i := range x.Nodes { + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Nodes[i]) + } + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetNodeByPathResponse) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + 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 *GetNodeByPathResponse) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// 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 *GetNodeByPathResponse) 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 *GetNodeByPathResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *GetNodeByPathResponse) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetSubTreeRequest_Body_Order) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.EnumSize(1, int32(x.Direction)) + 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 *GetSubTreeRequest_Body_Order) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.EnumMarshal(1, buf[offset:], int32(x.Direction)) + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetSubTreeRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.ContainerId) + size += proto.StringSize(2, x.TreeId) + for i := range x.RootId { + size += protowire.SizeGroup(protowire.Number(3), protowire.SizeVarint(x.RootId[i])) + } + size += proto.UInt32Size(4, x.Depth) + size += proto.BytesSize(5, x.BearerToken) + size += proto.NestedStructureSize(6, x.OrderBy) + 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 *GetSubTreeRequest_Body) 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.ContainerId) + offset += proto.StringMarshal(2, buf[offset:], x.TreeId) + for i := range x.RootId { + { + prefix := protowire.EncodeTag(protowire.Number(3), protowire.VarintType) + offset += binary.PutUvarint(buf[offset:], uint64(prefix)) + offset += binary.PutUvarint(buf[offset:], x.RootId[i]) + } + } + offset += proto.UInt32Marshal(4, buf[offset:], x.Depth) + offset += proto.BytesMarshal(5, buf[offset:], x.BearerToken) + offset += proto.NestedStructureMarshal(6, buf[offset:], x.OrderBy) + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetSubTreeRequest) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + 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 *GetSubTreeRequest) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// 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 *GetSubTreeRequest) 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 *GetSubTreeRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *GetSubTreeRequest) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetSubTreeResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + for i := range x.NodeId { + size += protowire.SizeGroup(protowire.Number(1), protowire.SizeVarint(x.NodeId[i])) + } + for i := range x.ParentId { + size += protowire.SizeGroup(protowire.Number(2), protowire.SizeVarint(x.ParentId[i])) + } + for i := range x.Timestamp { + size += protowire.SizeGroup(protowire.Number(3), protowire.SizeVarint(x.Timestamp[i])) + } + for i := range x.Meta { + size += proto.NestedStructureSize(4, x.Meta[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 *GetSubTreeResponse_Body) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + for i := range x.NodeId { + { + prefix := protowire.EncodeTag(protowire.Number(1), protowire.VarintType) + offset += binary.PutUvarint(buf[offset:], uint64(prefix)) + offset += binary.PutUvarint(buf[offset:], x.NodeId[i]) + } + } + for i := range x.ParentId { + { + prefix := protowire.EncodeTag(protowire.Number(2), protowire.VarintType) + offset += binary.PutUvarint(buf[offset:], uint64(prefix)) + offset += binary.PutUvarint(buf[offset:], x.ParentId[i]) + } + } + for i := range x.Timestamp { + { + prefix := protowire.EncodeTag(protowire.Number(3), protowire.VarintType) + offset += binary.PutUvarint(buf[offset:], uint64(prefix)) + offset += binary.PutUvarint(buf[offset:], x.Timestamp[i]) + } + } + for i := range x.Meta { + offset += proto.NestedStructureMarshal(4, buf[offset:], x.Meta[i]) + } + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetSubTreeResponse) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + 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 *GetSubTreeResponse) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// 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 *GetSubTreeResponse) 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 *GetSubTreeResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *GetSubTreeResponse) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *TreeListRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.ContainerId) + 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 *TreeListRequest_Body) 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.ContainerId) + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *TreeListRequest) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + 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 *TreeListRequest) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// 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 *TreeListRequest) 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 *TreeListRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *TreeListRequest) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *TreeListResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.RepeatedStringSize(1, x.Ids) + 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 *TreeListResponse_Body) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.RepeatedStringMarshal(1, buf[offset:], x.Ids) + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *TreeListResponse) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + 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 *TreeListResponse) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// 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 *TreeListResponse) 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 *TreeListResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *TreeListResponse) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ApplyRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.ContainerId) + size += proto.StringSize(2, x.TreeId) + size += proto.NestedStructureSize(3, x.Operation) + 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 *ApplyRequest_Body) 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.ContainerId) + offset += proto.StringMarshal(2, buf[offset:], x.TreeId) + offset += proto.NestedStructureMarshal(3, buf[offset:], x.Operation) + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ApplyRequest) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + 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 *ApplyRequest) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// 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 *ApplyRequest) 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 *ApplyRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *ApplyRequest) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ApplyResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + 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 *ApplyResponse_Body) StableMarshal(buf []byte) []byte { + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ApplyResponse) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + 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 *ApplyResponse) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// 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 *ApplyResponse) 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 *ApplyResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *ApplyResponse) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetOpLogRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.ContainerId) + size += proto.StringSize(2, x.TreeId) + size += proto.UInt64Size(3, x.Height) + size += proto.UInt64Size(4, x.Count) + 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 *GetOpLogRequest_Body) 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.ContainerId) + offset += proto.StringMarshal(2, buf[offset:], x.TreeId) + offset += proto.UInt64Marshal(3, buf[offset:], x.Height) + offset += proto.UInt64Marshal(4, buf[offset:], x.Count) + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetOpLogRequest) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + 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 *GetOpLogRequest) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// 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 *GetOpLogRequest) 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 *GetOpLogRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *GetOpLogRequest) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetOpLogResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Operation) + 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 *GetOpLogResponse_Body) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Operation) + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetOpLogResponse) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + 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 *GetOpLogResponse) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// 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 *GetOpLogResponse) 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 *GetOpLogResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *GetOpLogResponse) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *HealthcheckResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + 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 *HealthcheckResponse_Body) StableMarshal(buf []byte) []byte { + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *HealthcheckResponse) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + 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 *HealthcheckResponse) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// 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 *HealthcheckResponse) 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 *HealthcheckResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *HealthcheckResponse) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *HealthcheckRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + 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 *HealthcheckRequest_Body) StableMarshal(buf []byte) []byte { + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *HealthcheckRequest) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + 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 *HealthcheckRequest) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// 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 *HealthcheckRequest) 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 *HealthcheckRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *HealthcheckRequest) SetSignature(sig *Signature) { + x.Signature = sig +} diff --git a/pool/tree/service/service_grpc.pb.go b/pool/tree/service/service_grpc.pb.go index 2c08289..4c293a4 100644 --- a/pool/tree/service/service_grpc.pb.go +++ b/pool/tree/service/service_grpc.pb.go @@ -3,8 +3,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.21.9 +// - protoc-gen-go-grpc v1.4.0 +// - protoc v4.25.0 // source: pkg/services/tree/service.proto package tree @@ -18,8 +18,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 const ( TreeService_Add_FullMethodName = "/tree.TreeService/Add" @@ -70,8 +70,9 @@ func NewTreeServiceClient(cc grpc.ClientConnInterface) TreeServiceClient { } func (c *treeServiceClient) Add(ctx context.Context, in *AddRequest, opts ...grpc.CallOption) (*AddResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AddResponse) - err := c.cc.Invoke(ctx, TreeService_Add_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, TreeService_Add_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -79,8 +80,9 @@ func (c *treeServiceClient) Add(ctx context.Context, in *AddRequest, opts ...grp } func (c *treeServiceClient) AddByPath(ctx context.Context, in *AddByPathRequest, opts ...grpc.CallOption) (*AddByPathResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AddByPathResponse) - err := c.cc.Invoke(ctx, TreeService_AddByPath_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, TreeService_AddByPath_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -88,8 +90,9 @@ func (c *treeServiceClient) AddByPath(ctx context.Context, in *AddByPathRequest, } func (c *treeServiceClient) Remove(ctx context.Context, in *RemoveRequest, opts ...grpc.CallOption) (*RemoveResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(RemoveResponse) - err := c.cc.Invoke(ctx, TreeService_Remove_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, TreeService_Remove_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -97,8 +100,9 @@ func (c *treeServiceClient) Remove(ctx context.Context, in *RemoveRequest, opts } func (c *treeServiceClient) Move(ctx context.Context, in *MoveRequest, opts ...grpc.CallOption) (*MoveResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MoveResponse) - err := c.cc.Invoke(ctx, TreeService_Move_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, TreeService_Move_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -106,8 +110,9 @@ func (c *treeServiceClient) Move(ctx context.Context, in *MoveRequest, opts ...g } func (c *treeServiceClient) GetNodeByPath(ctx context.Context, in *GetNodeByPathRequest, opts ...grpc.CallOption) (*GetNodeByPathResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetNodeByPathResponse) - err := c.cc.Invoke(ctx, TreeService_GetNodeByPath_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, TreeService_GetNodeByPath_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -115,11 +120,12 @@ func (c *treeServiceClient) GetNodeByPath(ctx context.Context, in *GetNodeByPath } func (c *treeServiceClient) GetSubTree(ctx context.Context, in *GetSubTreeRequest, opts ...grpc.CallOption) (TreeService_GetSubTreeClient, error) { - stream, err := c.cc.NewStream(ctx, &TreeService_ServiceDesc.Streams[0], TreeService_GetSubTree_FullMethodName, opts...) + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &TreeService_ServiceDesc.Streams[0], TreeService_GetSubTree_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &treeServiceGetSubTreeClient{stream} + x := &treeServiceGetSubTreeClient{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -147,8 +153,9 @@ func (x *treeServiceGetSubTreeClient) Recv() (*GetSubTreeResponse, error) { } func (c *treeServiceClient) TreeList(ctx context.Context, in *TreeListRequest, opts ...grpc.CallOption) (*TreeListResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(TreeListResponse) - err := c.cc.Invoke(ctx, TreeService_TreeList_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, TreeService_TreeList_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -156,8 +163,9 @@ func (c *treeServiceClient) TreeList(ctx context.Context, in *TreeListRequest, o } func (c *treeServiceClient) Apply(ctx context.Context, in *ApplyRequest, opts ...grpc.CallOption) (*ApplyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ApplyResponse) - err := c.cc.Invoke(ctx, TreeService_Apply_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, TreeService_Apply_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -165,11 +173,12 @@ func (c *treeServiceClient) Apply(ctx context.Context, in *ApplyRequest, opts .. } func (c *treeServiceClient) GetOpLog(ctx context.Context, in *GetOpLogRequest, opts ...grpc.CallOption) (TreeService_GetOpLogClient, error) { - stream, err := c.cc.NewStream(ctx, &TreeService_ServiceDesc.Streams[1], TreeService_GetOpLog_FullMethodName, opts...) + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &TreeService_ServiceDesc.Streams[1], TreeService_GetOpLog_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &treeServiceGetOpLogClient{stream} + x := &treeServiceGetOpLogClient{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -197,8 +206,9 @@ func (x *treeServiceGetOpLogClient) Recv() (*GetOpLogResponse, error) { } func (c *treeServiceClient) Healthcheck(ctx context.Context, in *HealthcheckRequest, opts ...grpc.CallOption) (*HealthcheckResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(HealthcheckResponse) - err := c.cc.Invoke(ctx, TreeService_Healthcheck_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, TreeService_Healthcheck_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -373,7 +383,7 @@ func _TreeService_GetSubTree_Handler(srv interface{}, stream grpc.ServerStream) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(TreeServiceServer).GetSubTree(m, &treeServiceGetSubTreeServer{stream}) + return srv.(TreeServiceServer).GetSubTree(m, &treeServiceGetSubTreeServer{ServerStream: stream}) } type TreeService_GetSubTreeServer interface { @@ -430,7 +440,7 @@ func _TreeService_GetOpLog_Handler(srv interface{}, stream grpc.ServerStream) er if err := stream.RecvMsg(m); err != nil { return err } - return srv.(TreeServiceServer).GetOpLog(m, &treeServiceGetOpLogServer{stream}) + return srv.(TreeServiceServer).GetOpLog(m, &treeServiceGetOpLogServer{ServerStream: stream}) } type TreeService_GetOpLogServer interface { diff --git a/pool/tree/service/types.pb.go b/pool/tree/service/types.pb.go index b4d6981..6464ccb 100644 --- a/pool/tree/service/types.pb.go +++ b/pool/tree/service/types.pb.go @@ -3,8 +3,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v3.21.9 +// protoc-gen-go v1.33.0 +// protoc v4.25.0 // source: pkg/services/tree/types.proto package tree diff --git a/pool/tree/service/types_frostfs.pb.go b/pool/tree/service/types_frostfs.pb.go new file mode 100644 index 0000000..707fcc3 --- /dev/null +++ b/pool/tree/service/types_frostfs.pb.go @@ -0,0 +1,106 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package tree + +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 *KeyValue) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.StringSize(1, x.Key) + size += proto.BytesSize(2, x.Value) + 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 *KeyValue) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.StringMarshal(1, buf[offset:], x.Key) + offset += proto.BytesMarshal(2, buf[offset:], x.Value) + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *LogMove) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.UInt64Size(1, x.ParentId) + size += proto.BytesSize(2, x.Meta) + size += proto.UInt64Size(3, x.ChildId) + 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 *LogMove) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.UInt64Marshal(1, buf[offset:], x.ParentId) + offset += proto.BytesMarshal(2, buf[offset:], x.Meta) + offset += proto.UInt64Marshal(3, buf[offset:], x.ChildId) + return buf +} + +// 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) + 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 *Signature) 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.Key) + offset += proto.BytesMarshal(2, buf[offset:], x.Sign) + return buf +} diff --git a/syncTree.sh b/syncTree.sh index 90eeba7..d3d2ab8 100755 --- a/syncTree.sh +++ b/syncTree.sh @@ -1,6 +1,6 @@ #!/bin/bash -REVISION="b3695411d907c3c65485bab04f9ff8479a72906b" +REVISION="00a88b99368d7141380f65d9cb446f1e4771ba01" echo "tree service revision ${REVISION}" @@ -9,11 +9,6 @@ echo "tree service revision ${REVISION}" FILES=$(curl -s https://git.frostfs.info/TrueCloudLab/frostfs-node/src/commit/${REVISION}/pkg/services/tree | sed -n "s,.*\"/TrueCloudLab/frostfs-node/src/commit/${REVISION}/pkg/services/tree/\([^.]*\.pb\.go\)\".*,\1,p") for file in $FILES; do - if [[ $file == *"frostfs"* ]]; then - echo "skip '$file'" - continue - else - echo "sync '$file' in tree service" - fi + echo "sync '$file' in tree service" curl -s "https://git.frostfs.info/TrueCloudLab/frostfs-node/raw/commit/${REVISION}/pkg/services/tree/${file}" -o "./pool/tree/service/${file}" done From ce8270568d3680006ffc9877d9fe9e41b3e44ee0 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Thu, 18 Jul 2024 17:17:40 +0300 Subject: [PATCH 058/197] [#239] go.mod: Update frostfs-contract Signed-off-by: Denis Kirillov --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4e12445..b4dcb85 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21 require ( git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240530152826-2f6d3209e1d3 - git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3 + git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 github.com/antlr4-go/antlr/v4 v4.13.0 diff --git a/go.sum b/go.sum index f44c0a1..dff6ec8 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240530152826-2f6d3209e1d3 h1:H5GvrVlowIMWfzqQkhY0p0myooJxQ1sMRVSFfXawwWg= git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240530152826-2f6d3209e1d3/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= -git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3 h1:zt8OAof+3YKIdRqg8EaLfbqq+4TnWGnsrXEXyGMNz5M= -git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3/go.mod h1:F/fe1OoIDKr5Bz99q4sriuHDuf3aZefZy9ZsCqEtgxc= +git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e h1:kcBqZBiFIUBATUqEuvVigtkJJWQ2Gug/eYXn967o3M4= +git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e/go.mod h1:F/fe1OoIDKr5Bz99q4sriuHDuf3aZefZy9ZsCqEtgxc= 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/hrw v1.2.1 h1:ccBRK21rFvY5R1WotI6LNoPlizk7qSvdfD8lNIRudVc= From 7e94a6adf2baaade80c788226ba2b6b4fbcd90a9 Mon Sep 17 00:00:00 2001 From: Marina Biryukova Date: Fri, 12 Jul 2024 14:35:01 +0300 Subject: [PATCH 059/197] [#237] pool: Return creation epoch from object put Signed-off-by: Marina Biryukova --- client/object_put.go | 8 ++++- client/object_put_raw.go | 1 + client/object_put_single.go | 8 +++++ client/object_put_transformer.go | 8 +++-- object/transformer/transformer.go | 1 + object/transformer/types.go | 1 + pool/mock_test.go | 5 ++- pool/object_put_pool_transformer.go | 10 ++++-- pool/pool.go | 50 ++++++++++++++++++----------- 9 files changed, 65 insertions(+), 27 deletions(-) diff --git a/client/object_put.go b/client/object_put.go index bf27f4c..07ca840 100644 --- a/client/object_put.go +++ b/client/object_put.go @@ -72,7 +72,8 @@ func (x *PrmObjectPutInit) SetGRPCPayloadChunkLen(v int) { type ResObjectPut struct { statusRes - obj oid.ID + obj oid.ID + epoch uint64 } // StoredObjectID returns identifier of the saved object. @@ -80,6 +81,11 @@ func (x ResObjectPut) StoredObjectID() oid.ID { return x.obj } +// StoredEpoch returns creation epoch of the saved object. +func (x ResObjectPut) StoredEpoch() uint64 { + return x.epoch +} + // ObjectWriter is designed to write one object or // multiple parts of one object to FrostFS system. // diff --git a/client/object_put_raw.go b/client/object_put_raw.go index dd210a8..c22bd05 100644 --- a/client/object_put_raw.go +++ b/client/object_put_raw.go @@ -175,6 +175,7 @@ func (x *objectWriterRaw) Close(_ context.Context) (*ResObjectPut, error) { if x.err != nil { x.err = newErrInvalidResponseField(fieldID, x.err) } + x.res.epoch = x.respV2.GetMetaHeader().GetEpoch() return &x.res, nil } diff --git a/client/object_put_single.go b/client/object_put_single.go index 8eaeca9..bdef026 100644 --- a/client/object_put_single.go +++ b/client/object_put_single.go @@ -93,6 +93,13 @@ func (prm *PrmObjectPutSingle) SetObject(o *v2object.Object) { // ResObjectPutSingle groups resulting values of PutSingle operation. type ResObjectPutSingle struct { statusRes + + epoch uint64 +} + +// Epoch returns creation epoch of the saved object. +func (r *ResObjectPutSingle) Epoch() uint64 { + return r.epoch } func (prm *PrmObjectPutSingle) buildRequest(c *Client) (*v2object.PutSingleRequest, error) { @@ -162,6 +169,7 @@ func (c *Client) ObjectPutSingle(ctx context.Context, prm PrmObjectPutSingle) (* if err != nil { return nil, err } + res.epoch = resp.GetMetaHeader().GetEpoch() return &res, nil } diff --git a/client/object_put_transformer.go b/client/object_put_transformer.go index 2347a4f..5314a12 100644 --- a/client/object_put_transformer.go +++ b/client/object_put_transformer.go @@ -58,8 +58,11 @@ func (x *objectWriterTransformer) Close(ctx context.Context) (*ResObjectPut, err return nil, err } - if ai != nil && ai.ParentID != nil { - x.it.res.obj = *ai.ParentID + if ai != nil { + x.it.res.epoch = ai.Epoch + if ai.ParentID != nil { + x.it.res.obj = *ai.ParentID + } } return x.it.res, nil } @@ -121,6 +124,7 @@ func (it *internalTarget) tryPutSingle(ctx context.Context, o *object.Object) (b it.res = &ResObjectPut{ statusRes: res.statusRes, obj: id, + epoch: res.epoch, } if it.client.prm.DisableFrostFSErrorResolution && !apistatus.IsSuccessful(it.res.st) { return true, apistatus.ErrFromStatus(it.res.st) diff --git a/object/transformer/transformer.go b/object/transformer/transformer.go index 37d5471..4cf8c30 100644 --- a/object/transformer/transformer.go +++ b/object/transformer/transformer.go @@ -247,6 +247,7 @@ func (s *payloadSizeLimiter) fillHeader() (*AccessIdentifiers, error) { ParentID: parID, SelfID: id, ParentHeader: parHdr, + Epoch: curEpoch, }, nil } diff --git a/object/transformer/types.go b/object/transformer/types.go index 212f453..1cda425 100644 --- a/object/transformer/types.go +++ b/object/transformer/types.go @@ -14,6 +14,7 @@ type AccessIdentifiers struct { ParentID *oid.ID SelfID oid.ID ParentHeader *object.Object + Epoch uint64 } // EpochSource is a source for the current epoch. diff --git a/pool/mock_test.go b/pool/mock_test.go index fef6f41..03a981b 100644 --- a/pool/mock_test.go +++ b/pool/mock_test.go @@ -17,7 +17,6 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/eacl" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" - oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session" "github.com/google/uuid" ) @@ -142,8 +141,8 @@ func (m *mockClient) netMapSnapshot(context.Context, prmNetMapSnapshot) (netmap. return nm, nil } -func (m *mockClient) objectPut(context.Context, PrmObjectPut) (oid.ID, error) { - return oid.ID{}, nil +func (m *mockClient) objectPut(context.Context, PrmObjectPut) (ResPutObject, error) { + return ResPutObject{}, nil } func (m *mockClient) objectDelete(context.Context, PrmObjectDelete) error { diff --git a/pool/object_put_pool_transformer.go b/pool/object_put_pool_transformer.go index 099a12d..e596aeb 100644 --- a/pool/object_put_pool_transformer.go +++ b/pool/object_put_pool_transformer.go @@ -72,6 +72,7 @@ func (x *objectWriterTransformer) WritePayloadChunk(ctx context.Context, chunk [ type ResObjectPut struct { Status apistatus.Status OID oid.ID + Epoch uint64 } // Close return non nil result in any case. If error occurred, the result contains only buffer for further reusing. @@ -81,8 +82,11 @@ func (x *objectWriterTransformer) Close(ctx context.Context) (*ResObjectPut, err return nil, err } - if ai != nil && ai.ParentID != nil { - x.it.res.OID = *ai.ParentID + if ai != nil { + x.it.res.Epoch = ai.Epoch + if ai.ParentID != nil { + x.it.res.OID = *ai.ParentID + } } return &x.it.res, nil } @@ -128,6 +132,7 @@ func (it *internalTarget) putAsStream(ctx context.Context, o *object.Object) err if res != nil { it.res.Status = res.Status() it.res.OID = res.StoredObjectID() + it.res.Epoch = res.StoredEpoch() } return err } @@ -154,6 +159,7 @@ func (it *internalTarget) tryPutSingle(ctx context.Context, o *object.Object) (b it.res = ResObjectPut{ Status: res.Status(), OID: id, + Epoch: res.Epoch(), } if !it.resolveFrostFSErrors && !apistatus.IsSuccessful(it.res.Status) { return true, apistatus.ErrFromStatus(it.res.Status) diff --git a/pool/pool.go b/pool/pool.go index 0cffc30..651702b 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -67,7 +67,7 @@ type client interface { // see clientWrapper.netMapSnapshot netMapSnapshot(context.Context, prmNetMapSnapshot) (netmap.NetMap, error) // see clientWrapper.objectPut. - objectPut(context.Context, PrmObjectPut) (oid.ID, error) + objectPut(context.Context, PrmObjectPut) (ResPutObject, error) // see clientWrapper.objectDelete. objectDelete(context.Context, PrmObjectDelete) error // see clientWrapper.objectGet. @@ -798,7 +798,7 @@ func (c *clientWrapper) netMapSnapshot(ctx context.Context, _ prmNetMapSnapshot) } // objectPut writes object to FrostFS. -func (c *clientWrapper) objectPut(ctx context.Context, prm PrmObjectPut) (oid.ID, error) { +func (c *clientWrapper) objectPut(ctx context.Context, prm PrmObjectPut) (ResPutObject, error) { if prm.bufferMaxSize == 0 { prm.bufferMaxSize = defaultBufferMaxSizeForPut } @@ -810,10 +810,10 @@ func (c *clientWrapper) objectPut(ctx context.Context, prm PrmObjectPut) (oid.ID return c.objectPutServerCut(ctx, prm) } -func (c *clientWrapper) objectPutServerCut(ctx context.Context, prm PrmObjectPut) (oid.ID, error) { +func (c *clientWrapper) objectPutServerCut(ctx context.Context, prm PrmObjectPut) (ResPutObject, error) { cl, err := c.getClient() if err != nil { - return oid.ID{}, err + return ResPutObject{}, err } cliPrm := sdkClient.PrmObjectPutInit{ @@ -827,7 +827,7 @@ func (c *clientWrapper) objectPutServerCut(ctx context.Context, prm PrmObjectPut wObj, err := cl.ObjectPutInit(ctx, cliPrm) c.incRequests(time.Since(start), methodObjectPut) if err = c.handleError(ctx, nil, err); err != nil { - return oid.ID{}, fmt.Errorf("init writing on API client: %w", err) + return ResPutObject{}, fmt.Errorf("init writing on API client: %w", err) } if wObj.WriteHeader(ctx, prm.hdr) { @@ -868,7 +868,7 @@ func (c *clientWrapper) objectPutServerCut(ctx context.Context, prm PrmObjectPut break } - return oid.ID{}, fmt.Errorf("read payload: %w", c.handleError(ctx, nil, err)) + return ResPutObject{}, fmt.Errorf("read payload: %w", c.handleError(ctx, nil, err)) } } } @@ -879,13 +879,16 @@ func (c *clientWrapper) objectPutServerCut(ctx context.Context, prm PrmObjectPut st = res.Status() } if err = c.handleError(ctx, st, err); err != nil { // here err already carries both status and client errors - return oid.ID{}, fmt.Errorf("client failure: %w", err) + return ResPutObject{}, fmt.Errorf("client failure: %w", err) } - return res.StoredObjectID(), nil + return ResPutObject{ + ObjectID: res.StoredObjectID(), + Epoch: res.StoredEpoch(), + }, nil } -func (c *clientWrapper) objectPutClientCut(ctx context.Context, prm PrmObjectPut) (oid.ID, error) { +func (c *clientWrapper) objectPutClientCut(ctx context.Context, prm PrmObjectPut) (ResPutObject, error) { putInitPrm := PrmObjectPutClientCutInit{ PrmObjectPut: prm, } @@ -894,7 +897,7 @@ func (c *clientWrapper) objectPutClientCut(ctx context.Context, prm PrmObjectPut wObj, err := c.objectPutInitTransformer(putInitPrm) c.incRequests(time.Since(start), methodObjectPut) if err = c.handleError(ctx, nil, err); err != nil { - return oid.ID{}, fmt.Errorf("init writing on API client: %w", err) + return ResPutObject{}, fmt.Errorf("init writing on API client: %w", err) } if wObj.WriteHeader(ctx, prm.hdr) { @@ -935,7 +938,7 @@ func (c *clientWrapper) objectPutClientCut(ctx context.Context, prm PrmObjectPut break } - return oid.ID{}, fmt.Errorf("read payload: %w", c.handleError(ctx, nil, err)) + return ResPutObject{}, fmt.Errorf("read payload: %w", c.handleError(ctx, nil, err)) } } } @@ -946,10 +949,13 @@ func (c *clientWrapper) objectPutClientCut(ctx context.Context, prm PrmObjectPut st = res.Status } if err = c.handleError(ctx, st, err); err != nil { // here err already carries both status and client errors - return oid.ID{}, fmt.Errorf("client failure: %w", err) + return ResPutObject{}, fmt.Errorf("client failure: %w", err) } - return res.OID, nil + return ResPutObject{ + ObjectID: res.OID, + Epoch: res.Epoch, + }, nil } // objectDelete invokes sdkClient.ObjectDelete parse response status to error. @@ -2445,10 +2451,16 @@ func (p *Pool) fillAppropriateKey(prm *prmCommon) { } } +// ResPutObject is designed to provide identifier and creation epoch of the saved object. +type ResPutObject struct { + ObjectID oid.ID + Epoch uint64 +} + // PutObject writes an object through a remote server using FrostFS API protocol. // // Main return value MUST NOT be processed on an erroneous return. -func (p *Pool) PutObject(ctx context.Context, prm PrmObjectPut) (oid.ID, error) { +func (p *Pool) PutObject(ctx context.Context, prm PrmObjectPut) (ResPutObject, error) { cnr, _ := prm.hdr.ContainerID() var prmCtx prmContext @@ -2461,13 +2473,13 @@ func (p *Pool) PutObject(ctx context.Context, prm PrmObjectPut) (oid.ID, error) var ctxCall callContext ctxCall.sessionClientCut = prm.clientCut if err := p.initCallContext(&ctxCall, prm.prmCommon, prmCtx); err != nil { - return oid.ID{}, fmt.Errorf("init call context: %w", err) + return ResPutObject{}, fmt.Errorf("init call context: %w", err) } if ctxCall.sessionDefault { ctxCall.sessionTarget = prm.UseSession if err := p.openDefaultSession(ctx, &ctxCall); err != nil { - return oid.ID{}, fmt.Errorf("open default session: %w", err) + return ResPutObject{}, fmt.Errorf("open default session: %w", err) } } @@ -2478,14 +2490,14 @@ func (p *Pool) PutObject(ctx context.Context, prm PrmObjectPut) (oid.ID, error) prm.setNetworkInfo(ni) } - id, err := ctxCall.client.objectPut(ctx, prm) + res, err := ctxCall.client.objectPut(ctx, prm) if err != nil { // removes session token from cache in case of token error p.checkSessionTokenErr(err, ctxCall.endpoint) - return id, fmt.Errorf("init writing on API client %s: %w", ctxCall.endpoint, err) + return ResPutObject{}, fmt.Errorf("init writing on API client %s: %w", ctxCall.endpoint, err) } - return id, nil + return res, nil } // DeleteObject marks an object for deletion from the container using FrostFS API protocol. From fa89999d919c1a1d2e8c348f8acf4ca69623aeac Mon Sep 17 00:00:00 2001 From: Marina Biryukova Date: Mon, 22 Jul 2024 11:17:26 +0300 Subject: [PATCH 060/197] [#242] pool: Log error that caused healthy status change Signed-off-by: Marina Biryukova --- pool/mock_test.go | 6 +++--- pool/pool.go | 31 ++++++++++++++++++------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/pool/mock_test.go b/pool/mock_test.go index 03a981b..d555afd 100644 --- a/pool/mock_test.go +++ b/pool/mock_test.go @@ -195,9 +195,9 @@ func (m *mockClient) dial(context.Context) error { return nil } -func (m *mockClient) restartIfUnhealthy(ctx context.Context) (healthy bool, changed bool) { - _, err := m.endpointInfo(ctx, prmEndpointInfo{}) - healthy = err == nil +func (m *mockClient) restartIfUnhealthy(ctx context.Context) (changed bool, err error) { + _, err = m.endpointInfo(ctx, prmEndpointInfo{}) + healthy := err == nil changed = healthy != m.isHealthy() if healthy { m.setHealthy() diff --git a/pool/pool.go b/pool/pool.go index 651702b..2f9a651 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -86,7 +86,7 @@ type client interface { // see clientWrapper.dial. dial(ctx context.Context) error // see clientWrapper.restartIfUnhealthy. - restartIfUnhealthy(ctx context.Context) (bool, bool) + restartIfUnhealthy(ctx context.Context) (bool, error) // see clientWrapper.close. close() error } @@ -373,11 +373,11 @@ func (c *clientWrapper) dial(ctx context.Context) error { } // restartIfUnhealthy checks healthy status of client and recreate it if status is unhealthy. -// Return current healthy status and indicating if status was changed by this function call. -func (c *clientWrapper) restartIfUnhealthy(ctx context.Context) (healthy, changed bool) { +// Indicating if status was changed by this function call and returns error that caused unhealthy status. +func (c *clientWrapper) restartIfUnhealthy(ctx context.Context) (changed bool, err error) { var wasHealthy bool - if _, err := c.endpointInfo(ctx, prmEndpointInfo{}); err == nil { - return true, false + if _, err = c.endpointInfo(ctx, prmEndpointInfo{}); err == nil { + return false, nil } else if !errors.Is(err, errPoolClientUnhealthy) { wasHealthy = true } @@ -403,22 +403,22 @@ func (c *clientWrapper) restartIfUnhealthy(ctx context.Context) (healthy, change GRPCDialOptions: c.prm.dialOptions, } - if err := cl.Dial(ctx, prmDial); err != nil { + if err = cl.Dial(ctx, prmDial); err != nil { c.setUnhealthyOnDial() - return false, wasHealthy + return wasHealthy, err } c.clientMutex.Lock() c.client = &cl c.clientMutex.Unlock() - if _, err := cl.EndpointInfo(ctx, sdkClient.PrmEndpointInfo{}); err != nil { + if _, err = cl.EndpointInfo(ctx, sdkClient.PrmEndpointInfo{}); err != nil { c.setUnhealthy() - return false, wasHealthy + return wasHealthy, err } c.setHealthy() - return true, !wasHealthy + return !wasHealthy, nil } func (c *clientWrapper) getClient() (*sdkClient.Client, error) { @@ -2198,7 +2198,8 @@ func (p *Pool) updateInnerNodesHealth(ctx context.Context, i int, bufferWeights tctx, c := context.WithTimeout(ctx, options.nodeRequestTimeout) defer c() - healthy, changed := cli.restartIfUnhealthy(tctx) + changed, err := cli.restartIfUnhealthy(tctx) + healthy := err == nil if healthy { bufferWeights[j] = options.nodesParams[i].weights[j] } else { @@ -2207,8 +2208,12 @@ func (p *Pool) updateInnerNodesHealth(ctx context.Context, i int, bufferWeights } if changed { - p.log(zap.DebugLevel, "health has changed", - zap.String("address", cli.address()), zap.Bool("healthy", healthy)) + fields := []zap.Field{zap.String("address", cli.address()), zap.Bool("healthy", healthy)} + if err != nil { + fields = append(fields, zap.String("reason", err.Error())) + } + + p.log(zap.DebugLevel, "health has changed", fields...) healthyChanged.Store(true) } }(j, cli) From 9da46f566fec219c0f52450c887c47fc0205340a Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 26 Jul 2024 14:12:48 +0300 Subject: [PATCH 061/197] [#243] go.mod: Update api-go Signed-off-by: Evgenii Stratonikov --- client/common.go | 16 ++--- client/container_set_eacl.go | 136 ----------------------------------- client/container_space.go | 92 ------------------------ container/size.go | 104 --------------------------- container/size_test.go | 94 ------------------------ container/test/generate.go | 10 --- go.mod | 2 +- go.sum | 4 +- pool/pool.go | 80 --------------------- 9 files changed, 10 insertions(+), 528 deletions(-) delete mode 100644 client/container_set_eacl.go delete mode 100644 client/container_space.go delete mode 100644 container/size.go delete mode 100644 container/size_test.go diff --git a/client/common.go b/client/common.go index 11cec28..65abae5 100644 --- a/client/common.go +++ b/client/common.go @@ -46,15 +46,13 @@ func writeXHeadersToMeta(xHeaders []string, h *v2session.RequestMetaHeader) { // error messages. var ( - errorMissingContainer = errors.New("missing container") - errorMissingObject = errors.New("missing object") - errorAccountNotSet = errors.New("account not set") - errorServerAddrUnset = errors.New("server address is unset or empty") - errorEACLTableNotSet = errors.New("eACL table not set") - errorMissingAnnouncements = errors.New("missing announcements") - errorZeroRangeLength = errors.New("zero range length") - errorMissingRanges = errors.New("missing ranges") - errorInvalidXHeaders = errors.New("xheaders must be presented only as key-value pairs") + errorMissingContainer = errors.New("missing container") + errorMissingObject = errors.New("missing object") + errorAccountNotSet = errors.New("account not set") + errorServerAddrUnset = errors.New("server address is unset or empty") + errorZeroRangeLength = errors.New("zero range length") + errorMissingRanges = errors.New("missing ranges") + errorInvalidXHeaders = errors.New("xheaders must be presented only as key-value pairs") ) type request interface { diff --git a/client/container_set_eacl.go b/client/container_set_eacl.go deleted file mode 100644 index b149334..0000000 --- a/client/container_set_eacl.go +++ /dev/null @@ -1,136 +0,0 @@ -package client - -import ( - "context" - "fmt" - - v2container "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" - frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto" - frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa" - "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/eacl" - "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session" -) - -// PrmContainerSetEACL groups parameters of ContainerSetEACL operation. -type PrmContainerSetEACL struct { - // FrostFS request X-Headers. - XHeaders []string - - Table *eacl.Table - - Session *session.Container -} - -// SetTable sets eACL table structure to be set for the container. -// Required parameter. -// -// Deprecated: Use PrmContainerSetEACL.Table instead. -func (x *PrmContainerSetEACL) SetTable(table eacl.Table) { - x.Table = &table -} - -// WithinSession specifies session within which extended ACL of the container -// should be saved. -// -// Creator of the session acquires the authorship of the request. This affects -// the execution of an operation (e.g. access control). -// -// Session is optional, if set the following requirements apply: -// - if particular container is specified (ApplyOnlyTo), it MUST equal the container -// for which extended ACL is going to be set -// - session operation MUST be session.VerbContainerSetEACL (ForVerb) -// - token MUST be signed using private key of the owner of the container to be saved -// -// Deprecated: Use PrmContainerSetEACL.Session instead. -func (x *PrmContainerSetEACL) WithinSession(s session.Container) { - x.Session = &s -} - -func (x *PrmContainerSetEACL) buildRequest(c *Client) (*v2container.SetExtendedACLRequest, error) { - if x.Table == nil { - return nil, errorEACLTableNotSet - } - - if len(x.XHeaders)%2 != 0 { - return nil, errorInvalidXHeaders - } - - eaclV2 := x.Table.ToV2() - - var sig frostfscrypto.Signature - - err := sig.Calculate(frostfsecdsa.SignerRFC6979(c.prm.Key), eaclV2.StableMarshal(nil)) - if err != nil { - return nil, fmt.Errorf("calculate signature: %w", err) - } - - var sigv2 refs.Signature - sig.WriteToV2(&sigv2) - - reqBody := new(v2container.SetExtendedACLRequestBody) - reqBody.SetEACL(eaclV2) - reqBody.SetSignature(&sigv2) - - var meta v2session.RequestMetaHeader - writeXHeadersToMeta(x.XHeaders, &meta) - - if x.Session != nil { - var tokv2 v2session.Token - x.Session.WriteToV2(&tokv2) - - meta.SetSessionToken(&tokv2) - } - - var req v2container.SetExtendedACLRequest - req.SetBody(reqBody) - c.prepareRequest(&req, &meta) - return &req, nil -} - -// ResContainerSetEACL groups resulting values of ContainerSetEACL operation. -type ResContainerSetEACL struct { - statusRes -} - -// ContainerSetEACL sends request to update eACL table of the FrostFS container. -// -// Exactly one return value is non-nil. By default, server status is returned in res structure. -// Any client's internal or transport errors are returned as `error`. -// If PrmInit.DisableFrostFSFailuresResolution has been called, unsuccessful -// FrostFS status codes are included in the returned result structure, -// otherwise, are also returned as `error`. -// -// Operation is asynchronous and no guaranteed even in the absence of errors. -// The required time is also not predictable. -// -// Success can be verified by reading by identifier (see EACL). -// -// Returns an error if parameters are set incorrectly (see PrmContainerSetEACL docs). -// Context is required and must not be nil. It is used for network communication. -// -// Return statuses: -// - global (see Client docs). -func (c *Client) ContainerSetEACL(ctx context.Context, prm PrmContainerSetEACL) (*ResContainerSetEACL, error) { - req, err := prm.buildRequest(c) - if err != nil { - return nil, err - } - - if err := signature.SignServiceMessage(&c.prm.Key, req); err != nil { - return nil, fmt.Errorf("sign request: %w", err) - } - - resp, err := rpcapi.SetEACL(&c.c, req, client.WithContext(ctx)) - if err != nil { - return nil, err - } - - var res ResContainerSetEACL - res.st, err = c.processResponse(resp) - return &res, err -} diff --git a/client/container_space.go b/client/container_space.go deleted file mode 100644 index dda5acc..0000000 --- a/client/container_space.go +++ /dev/null @@ -1,92 +0,0 @@ -package client - -import ( - "context" - "fmt" - - v2container "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" - rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" - "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container" -) - -// PrmAnnounceSpace groups parameters of ContainerAnnounceUsedSpace operation. -type PrmAnnounceSpace struct { - XHeaders []string - - Announcements []container.SizeEstimation -} - -// SetValues sets values describing volume of space that is used for the container objects. -// Required parameter. Must not be empty. -// -// Must not be mutated before the end of the operation. -// -// Deprecated: Use PrmAnnounceSpace.Announcements instead. -func (x *PrmAnnounceSpace) SetValues(vs []container.SizeEstimation) { - x.Announcements = vs -} - -func (x *PrmAnnounceSpace) buildRequest(c *Client) (*v2container.AnnounceUsedSpaceRequest, error) { - if len(x.Announcements) == 0 { - return nil, errorMissingAnnouncements - } - - v2announce := make([]v2container.UsedSpaceAnnouncement, len(x.Announcements)) - for i := range x.Announcements { - x.Announcements[i].WriteToV2(&v2announce[i]) - } - - reqBody := new(v2container.AnnounceUsedSpaceRequestBody) - reqBody.SetAnnouncements(v2announce) - - var req v2container.AnnounceUsedSpaceRequest - req.SetBody(reqBody) - c.prepareRequest(&req, new(v2session.RequestMetaHeader)) - return &req, nil -} - -// ResAnnounceSpace groups resulting values of ContainerAnnounceUsedSpace operation. -type ResAnnounceSpace struct { - statusRes -} - -// ContainerAnnounceUsedSpace sends request to announce volume of the space used for the container objects. -// -// Exactly one return value is non-nil. By default, server status is returned in res structure. -// Any client's internal or transport errors are returned as `error`. -// If PrmInit.DisableFrostFSFailuresResolution has been called, unsuccessful -// FrostFS status codes are included in the returned result structure, -// otherwise, are also returned as `error`. -// -// Operation is asynchronous and no guaranteed even in the absence of errors. -// The required time is also not predictable. -// -// At this moment success can not be checked. -// -// Returns an error if parameters are set incorrectly (see PrmAnnounceSpace docs). -// Context is required and must not be nil. It is used for network communication. -// -// Return statuses: -// - global (see Client docs). -func (c *Client) ContainerAnnounceUsedSpace(ctx context.Context, prm PrmAnnounceSpace) (*ResAnnounceSpace, error) { - req, err := prm.buildRequest(c) - if err != nil { - return nil, err - } - - if err := signature.SignServiceMessage(&c.prm.Key, req); err != nil { - return nil, fmt.Errorf("sign request: %w", err) - } - - resp, err := rpcapi.AnnounceUsedSpace(&c.c, req, client.WithContext(ctx)) - if err != nil { - return nil, err - } - - var res ResAnnounceSpace - res.st, err = c.processResponse(resp) - return &res, err -} diff --git a/container/size.go b/container/size.go deleted file mode 100644 index 64220ed..0000000 --- a/container/size.go +++ /dev/null @@ -1,104 +0,0 @@ -package container - -import ( - "errors" - "fmt" - - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" -) - -// SizeEstimation groups information about estimation of the size of the data -// stored in the FrostFS container. -// -// SizeEstimation is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container.UsedSpaceAnnouncement -// message. See ReadFromV2 / WriteToV2 methods. -type SizeEstimation struct { - m container.UsedSpaceAnnouncement -} - -// ReadFromV2 reads SizeEstimation from the container.UsedSpaceAnnouncement message. -// Checks if the message conforms to FrostFS API V2 protocol. -// -// See also WriteToV2. -func (x *SizeEstimation) ReadFromV2(m container.UsedSpaceAnnouncement) error { - cnrV2 := m.GetContainerID() - if cnrV2 == nil { - return errors.New("missing container") - } - - var cnr cid.ID - - err := cnr.ReadFromV2(*cnrV2) - if err != nil { - return fmt.Errorf("invalid container: %w", err) - } - - x.m = m - - return nil -} - -// WriteToV2 writes SizeEstimation into the container.UsedSpaceAnnouncement message. -// The message MUST NOT be nil. -// -// See also ReadFromV2. -func (x SizeEstimation) WriteToV2(m *container.UsedSpaceAnnouncement) { - *m = x.m -} - -// SetEpoch sets epoch when estimation of the container data size was calculated. -// -// See also Epoch. -func (x *SizeEstimation) SetEpoch(epoch uint64) { - x.m.SetEpoch(epoch) -} - -// Epoch return epoch set using SetEpoch. -// -// Zero SizeEstimation represents estimation in zero epoch. -func (x SizeEstimation) Epoch() uint64 { - return x.m.GetEpoch() -} - -// SetContainer specifies the container for which the amount of data is estimated. -// Required by the FrostFS API protocol. -// -// See also Container. -func (x *SizeEstimation) SetContainer(cnr cid.ID) { - var cidV2 refs.ContainerID - cnr.WriteToV2(&cidV2) - - x.m.SetContainerID(&cidV2) -} - -// Container returns container set using SetContainer. -// -// Zero SizeEstimation is not bound to any container (returns zero) which is -// incorrect according to FrostFS API protocol. -func (x SizeEstimation) Container() (res cid.ID) { - m := x.m.GetContainerID() - if m != nil { - err := res.ReadFromV2(*m) - if err != nil { - panic(fmt.Errorf("unexpected error from cid.ID.ReadFromV2: %w", err)) - } - } - - return -} - -// SetValue sets estimated amount of data (in bytes) in the specified container. -// -// See also Value. -func (x *SizeEstimation) SetValue(value uint64) { - x.m.SetUsedSpace(value) -} - -// Value returns data size estimation set using SetValue. -// -// Zero SizeEstimation has zero value. -func (x SizeEstimation) Value() uint64 { - return x.m.GetUsedSpace() -} diff --git a/container/size_test.go b/container/size_test.go deleted file mode 100644 index 77fed4d..0000000 --- a/container/size_test.go +++ /dev/null @@ -1,94 +0,0 @@ -package container_test - -import ( - "crypto/sha256" - "testing" - - v2container "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container" - cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" - cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test" - "github.com/stretchr/testify/require" -) - -func TestSizeEstimation_Epoch(t *testing.T) { - var val container.SizeEstimation - - require.Zero(t, val.Epoch()) - - const epoch = 123 - - val.SetEpoch(epoch) - require.EqualValues(t, epoch, val.Epoch()) - - var msg v2container.UsedSpaceAnnouncement - val.WriteToV2(&msg) - - require.EqualValues(t, epoch, msg.GetEpoch()) -} - -func TestSizeEstimation_Container(t *testing.T) { - var val container.SizeEstimation - - require.Zero(t, val.Container()) - - cnr := cidtest.ID() - - val.SetContainer(cnr) - require.True(t, val.Container().Equals(cnr)) - - var msg v2container.UsedSpaceAnnouncement - val.WriteToV2(&msg) - - var msgCnr refs.ContainerID - cnr.WriteToV2(&msgCnr) - - require.Equal(t, &msgCnr, msg.GetContainerID()) -} - -func TestSizeEstimation_Value(t *testing.T) { - var val container.SizeEstimation - - require.Zero(t, val.Value()) - - const value = 876 - - val.SetValue(value) - require.EqualValues(t, value, val.Value()) - - var msg v2container.UsedSpaceAnnouncement - val.WriteToV2(&msg) - - require.EqualValues(t, value, msg.GetUsedSpace()) -} - -func TestSizeEstimation_ReadFromV2(t *testing.T) { - const epoch = 654 - const value = 903 - var cnrMsg refs.ContainerID - - var msg v2container.UsedSpaceAnnouncement - - var val container.SizeEstimation - - require.Error(t, val.ReadFromV2(msg)) - - msg.SetContainerID(&cnrMsg) - - require.Error(t, val.ReadFromV2(msg)) - - cnrMsg.SetValue(make([]byte, sha256.Size)) - - var cnr cid.ID - require.NoError(t, cnr.ReadFromV2(cnrMsg)) - - msg.SetEpoch(epoch) - msg.SetUsedSpace(value) - - require.NoError(t, val.ReadFromV2(msg)) - - require.EqualValues(t, epoch, val.Epoch()) - require.EqualValues(t, value, val.Value()) - require.EqualValues(t, cnr, val.Container()) -} diff --git a/container/test/generate.go b/container/test/generate.go index 7ac0c2a..c242369 100644 --- a/container/test/generate.go +++ b/container/test/generate.go @@ -5,7 +5,6 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/acl" - cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test" netmaptest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap/test" usertest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user/test" ) @@ -23,15 +22,6 @@ func Container() (x container.Container) { return x } -// SizeEstimation returns random container.SizeEstimation. -func SizeEstimation() (x container.SizeEstimation) { - x.SetContainer(cidtest.ID()) - x.SetEpoch(rand.Uint64()) - x.SetValue(rand.Uint64()) - - return x -} - // BasicACL returns random acl.Basic. func BasicACL() (x acl.Basic) { x.FromBits(rand.Uint32()) diff --git a/go.mod b/go.mod index b4dcb85..a481fb2 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.21 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240530152826-2f6d3209e1d3 + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240726072425-3dfa2f4fd65e git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 diff --git a/go.sum b/go.sum index dff6ec8..a23b405 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240530152826-2f6d3209e1d3 h1:H5GvrVlowIMWfzqQkhY0p0myooJxQ1sMRVSFfXawwWg= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240530152826-2f6d3209e1d3/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240726072425-3dfa2f4fd65e h1:gEWT+70E/RvGkxtSv+PlyUN2vtJVymhQa1mypvrXukM= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240726072425-3dfa2f4fd65e/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e h1:kcBqZBiFIUBATUqEuvVigtkJJWQ2Gug/eYXn967o3M4= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e/go.mod h1:F/fe1OoIDKr5Bz99q4sriuHDuf3aZefZy9ZsCqEtgxc= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= diff --git a/pool/pool.go b/pool/pool.go index 2f9a651..502833d 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -52,8 +52,6 @@ type client interface { containerDelete(context.Context, PrmContainerDelete) error // see clientWrapper.containerEACL. containerEACL(context.Context, PrmContainerEACL) (eacl.Table, error) - // see clientWrapper.containerSetEACL. - containerSetEACL(context.Context, PrmContainerSetEACL) error // see clientWrapper.apeManagerAddChain. apeManagerAddChain(context.Context, PrmAddAPEChain) error // see clientWrapper.apeManagerRemoveChain. @@ -612,51 +610,6 @@ func (c *clientWrapper) containerEACL(ctx context.Context, prm PrmContainerEACL) return res.Table(), nil } -// containerSetEACL invokes sdkClient.ContainerSetEACL parse response status to error. -// It also waits for the EACL to appear on the network. -func (c *clientWrapper) containerSetEACL(ctx context.Context, prm PrmContainerSetEACL) error { - cl, err := c.getClient() - if err != nil { - return err - } - - cliPrm := sdkClient.PrmContainerSetEACL{ - Table: &prm.Table, - Session: prm.Session, - } - - start := time.Now() - res, err := cl.ContainerSetEACL(ctx, cliPrm) - c.incRequests(time.Since(start), methodContainerSetEACL) - var st apistatus.Status - if res != nil { - st = res.Status() - } - if err = c.handleError(ctx, st, err); err != nil { - return fmt.Errorf("set eacl on client: %w", err) - } - - if prm.WaitParams == nil { - prm.WaitParams = defaultWaitParams() - } - if err := prm.WaitParams.CheckValidity(); err != nil { - return fmt.Errorf("invalid wait parameters: %w", err) - } - - cnrID, _ := prm.Table.CID() - eaclPrm := PrmContainerEACL{ - ContainerID: cnrID, - Session: prm.Session, - } - - err = waitForEACLPresence(ctx, c, eaclPrm, &prm.Table, prm.WaitParams) - if err = c.handleError(ctx, nil, err); err != nil { - return fmt.Errorf("wait eacl presence on client: %w", err) - } - - return nil -} - // apeManagerAddChain invokes sdkClient.APEManagerAddChain and parse response status to error. func (c *clientWrapper) apeManagerAddChain(ctx context.Context, prm PrmAddAPEChain) error { cl, err := c.getClient() @@ -2835,28 +2788,6 @@ func (p *Pool) GetEACL(ctx context.Context, prm PrmContainerEACL) (eacl.Table, e return eaclResult, nil } -// SetEACL sends request to update eACL table of the FrostFS container and waits for the operation to complete. -// -// Waiting parameters can be specified using SetWaitParams. If not called, defaults are used: -// -// polling interval: 5s -// waiting timeout: 120s -// -// Success can be verified by reading by identifier (see GetEACL). -func (p *Pool) SetEACL(ctx context.Context, prm PrmContainerSetEACL) error { - cp, err := p.connection() - if err != nil { - return err - } - - err = cp.containerSetEACL(ctx, prm) - if err != nil { - return fmt.Errorf("set EACL via client '%s': %w", cp.address(), err) - } - - return nil -} - // AddAPEChain sends a request to set APE chain rules for a target (basically, for a container). func (p *Pool) AddAPEChain(ctx context.Context, prm PrmAddAPEChain) error { cp, err := p.connection() @@ -2955,17 +2886,6 @@ func waitForContainerPresence(ctx context.Context, cli client, prm PrmContainerG }) } -// waitForEACLPresence waits until the container eacl is applied on the FrostFS network. -func waitForEACLPresence(ctx context.Context, cli client, prm PrmContainerEACL, table *eacl.Table, waitParams *WaitParams) error { - return waitFor(ctx, waitParams, func(ctx context.Context) bool { - eaclTable, err := cli.containerEACL(ctx, prm) - if err == nil { - return eacl.EqualTables(*table, eaclTable) - } - return false - }) -} - // waitForContainerRemoved waits until the container is removed from the FrostFS network. func waitForContainerRemoved(ctx context.Context, cli client, prm PrmContainerGet, waitParams *WaitParams) error { return waitFor(ctx, waitParams, func(ctx context.Context) bool { From e83d6b7c6a1a424bada9e790c3b6bcbf6f4f6bb7 Mon Sep 17 00:00:00 2001 From: Marina Biryukova Date: Wed, 31 Jul 2024 10:59:00 +0300 Subject: [PATCH 062/197] [#244] pool/tree: Collect request duration statistic After each request for tree pool statistic accumulated values are reset to zero. Signed-off-by: Marina Biryukova --- pool/pool.go | 42 ++++--------------- pool/statistic.go | 48 ++++++++++++++++++++- pool/tree/pool.go | 94 +++++++++++++++++++++++++++++++++++++----- pool/tree/statistic.go | 51 +++++++++++++++++++++++ 4 files changed, 190 insertions(+), 45 deletions(-) create mode 100644 pool/tree/statistic.go diff --git a/pool/pool.go b/pool/pool.go index 502833d..8cfda26 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -106,7 +106,7 @@ type clientStatus interface { // overallErrorRate returns the number of all happened errors. overallErrorRate() uint64 // methodsStatus returns statistic for all used methods. - methodsStatus() []statusSnapshot + methodsStatus() []StatusSnapshot } // errPoolClientUnhealthy is an error to indicate that client in pool is unhealthy. @@ -122,7 +122,7 @@ type clientStatusMonitor struct { mu sync.RWMutex // protect counters currentErrorCount uint32 overallErrorCount uint64 - methods []*methodStatus + methods []*MethodStatus } // values for healthy status of clientStatusMonitor. @@ -141,19 +141,6 @@ const ( statusHealthy ) -// methodStatus provide statistic for specific method. -type methodStatus struct { - name string - mu sync.RWMutex // protect counters - statusSnapshot -} - -// statusSnapshot is statistic for specific method. -type statusSnapshot struct { - allTime uint64 - allRequests uint64 -} - // MethodIndex index of method in list of statuses in clientStatusMonitor. type MethodIndex int @@ -229,9 +216,9 @@ func (m MethodIndex) String() string { } func newClientStatusMonitor(logger *zap.Logger, addr string, errorThreshold uint32) clientStatusMonitor { - methods := make([]*methodStatus, methodLast) + methods := make([]*MethodStatus, methodLast) for i := methodBalanceGet; i < methodLast; i++ { - methods[i] = &methodStatus{name: i.String()} + methods[i] = &MethodStatus{name: i.String()} } healthy := new(atomic.Uint32) @@ -246,19 +233,6 @@ func newClientStatusMonitor(logger *zap.Logger, addr string, errorThreshold uint } } -func (m *methodStatus) snapshot() statusSnapshot { - m.mu.RLock() - defer m.mu.RUnlock() - return m.statusSnapshot -} - -func (m *methodStatus) incRequests(elapsed time.Duration) { - m.mu.Lock() - defer m.mu.Unlock() - m.allTime += uint64(elapsed) - m.allRequests++ -} - // clientWrapper is used by default, alternative implementations are intended for testing purposes only. type clientWrapper struct { clientMutex sync.RWMutex @@ -1177,10 +1151,10 @@ func (c *clientStatusMonitor) overallErrorRate() uint64 { return c.overallErrorCount } -func (c *clientStatusMonitor) methodsStatus() []statusSnapshot { - result := make([]statusSnapshot, len(c.methods)) +func (c *clientStatusMonitor) methodsStatus() []StatusSnapshot { + result := make([]StatusSnapshot, len(c.methods)) for i, val := range c.methods { - result[i] = val.snapshot() + result[i] = val.Snapshot() } return result @@ -1188,7 +1162,7 @@ func (c *clientStatusMonitor) methodsStatus() []statusSnapshot { func (c *clientWrapper) incRequests(elapsed time.Duration, method MethodIndex) { methodStat := c.methods[method] - methodStat.incRequests(elapsed) + methodStat.IncRequests(elapsed) if c.prm.poolRequestInfoCallback != nil { c.prm.poolRequestInfoCallback(RequestInfo{ Address: c.prm.address, diff --git a/pool/statistic.go b/pool/statistic.go index 5f1cfad..5ae0f7b 100644 --- a/pool/statistic.go +++ b/pool/statistic.go @@ -2,6 +2,7 @@ package pool import ( "errors" + "sync" "time" ) @@ -46,7 +47,7 @@ func (s Statistic) Node(address string) (*NodeStatistic, error) { // NodeStatistic is metrics of certain connections. type NodeStatistic struct { address string - methods []statusSnapshot + methods []StatusSnapshot overallErrors uint64 currentErrors uint32 } @@ -158,3 +159,48 @@ func (n NodeStatistic) averageTime(method MethodIndex) time.Duration { } return time.Duration(stat.allTime / stat.allRequests) } + +// MethodStatus provide statistic for specific method. +type MethodStatus struct { + name string + mu sync.RWMutex // protect counters + snapshot StatusSnapshot +} + +func NewMethodStatus(name string) *MethodStatus { + return &MethodStatus{name: name} +} + +func (m *MethodStatus) Snapshot() StatusSnapshot { + m.mu.RLock() + defer m.mu.RUnlock() + return m.snapshot +} + +func (m *MethodStatus) IncRequests(elapsed time.Duration) { + m.mu.Lock() + defer m.mu.Unlock() + m.snapshot.allTime += uint64(elapsed) + m.snapshot.allRequests++ +} + +func (m *MethodStatus) Reset() { + m.mu.Lock() + defer m.mu.Unlock() + m.snapshot.allTime = 0 + m.snapshot.allRequests = 0 +} + +// StatusSnapshot is statistic for specific method. +type StatusSnapshot struct { + allTime uint64 + allRequests uint64 +} + +func (s StatusSnapshot) AllRequests() uint64 { + return s.allRequests +} + +func (s StatusSnapshot) AllTime() uint64 { + return s.allTime +} diff --git a/pool/tree/pool.go b/pool/tree/pool.go index b610909..195102b 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -88,6 +88,7 @@ type Pool struct { rebalanceParams rebalanceParameters dialOptions []grpc.DialOption logger *zap.Logger + methods []*pool.MethodStatus maxRequestAttempts int @@ -169,6 +170,39 @@ type RemoveNodeParams struct { BearerToken []byte } +// MethodIndex index of method in list of statuses in Pool. +type MethodIndex int + +const ( + methodGetNodes MethodIndex = iota + methodGetSubTree + methodAddNode + methodAddNodeByPath + methodMoveNode + methodRemoveNode + methodLast +) + +// String implements fmt.Stringer. +func (m MethodIndex) String() string { + switch m { + case methodGetNodes: + return "getNodes" + case methodAddNode: + return "addNode" + case methodGetSubTree: + return "getSubTree" + case methodAddNodeByPath: + return "addNodeByPath" + case methodMoveNode: + return "moveNode" + case methodRemoveNode: + return "removeNode" + default: + return "unknown" + } +} + // NewPool creates connection pool using parameters. func NewPool(options InitParameters) (*Pool, error) { if options.key == nil { @@ -182,6 +216,11 @@ func NewPool(options InitParameters) (*Pool, error) { fillDefaultInitParams(&options) + methods := make([]*pool.MethodStatus, methodLast) + for i := methodGetNodes; i < methodLast; i++ { + methods[i] = pool.NewMethodStatus(i.String()) + } + p := &Pool{ key: options.key, logger: options.logger, @@ -192,6 +231,7 @@ func NewPool(options InitParameters) (*Pool, error) { clientRebalanceInterval: options.clientRebalanceInterval, }, maxRequestAttempts: options.maxRequestAttempts, + methods: methods, } return p, nil @@ -308,12 +348,13 @@ func (p *Pool) GetNodes(ctx context.Context, prm GetNodesParams) ([]*grpcService }, } + start := time.Now() if err := p.signRequest(request); err != nil { return nil, err } var resp *grpcService.GetNodeByPathResponse - if err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) (inErr error) { + err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) (inErr error) { resp, inErr = client.GetNodeByPath(ctx, request) // Pool wants to do retry 'GetNodeByPath' request if result is empty. // Empty result is expected due to delayed tree service sync. @@ -323,7 +364,9 @@ func (p *Pool) GetNodes(ctx context.Context, prm GetNodesParams) ([]*grpcService return errNodeEmptyResult } return handleError("failed to get node by path", inErr) - }); err != nil && !errors.Is(err, errNodeEmptyResult) { + }) + p.methods[methodGetNodes].IncRequests(time.Since(start)) + if err != nil && !errors.Is(err, errNodeEmptyResult) { return nil, err } @@ -405,15 +448,18 @@ func (p *Pool) GetSubTree(ctx context.Context, prm GetSubTreeParams) (*SubTreeRe request.Body.OrderBy.Direction = grpcService.GetSubTreeRequest_Body_Order_None } + start := time.Now() if err := p.signRequest(request); err != nil { return nil, err } var cli grpcService.TreeService_GetSubTreeClient - if err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) (inErr error) { + err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) (inErr error) { cli, inErr = client.GetSubTree(ctx, request) return handleError("failed to get sub tree client", inErr) - }); err != nil { + }) + p.methods[methodGetSubTree].IncRequests(time.Since(start)) + if err != nil { return nil, err } @@ -435,15 +481,19 @@ func (p *Pool) AddNode(ctx context.Context, prm AddNodeParams) (uint64, error) { BearerToken: prm.BearerToken, }, } + + start := time.Now() if err := p.signRequest(request); err != nil { return 0, err } var resp *grpcService.AddResponse - if err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) (inErr error) { + err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) (inErr error) { resp, inErr = client.Add(ctx, request) return handleError("failed to add node", inErr) - }); err != nil { + }) + p.methods[methodAddNode].IncRequests(time.Since(start)) + if err != nil { return 0, err } @@ -467,15 +517,18 @@ func (p *Pool) AddNodeByPath(ctx context.Context, prm AddNodeByPathParams) (uint }, } + start := time.Now() if err := p.signRequest(request); err != nil { return 0, err } var resp *grpcService.AddByPathResponse - if err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) (inErr error) { + err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) (inErr error) { resp, inErr = client.AddByPath(ctx, request) return handleError("failed to add node by path", inErr) - }); err != nil { + }) + p.methods[methodAddNodeByPath].IncRequests(time.Since(start)) + if err != nil { return 0, err } @@ -507,16 +560,20 @@ func (p *Pool) MoveNode(ctx context.Context, prm MoveNodeParams) error { }, } + start := time.Now() if err := p.signRequest(request); err != nil { return err } - return p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) error { + err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) error { if _, err := client.Move(ctx, request); err != nil { return handleError("failed to move node", err) } return nil }) + p.methods[methodMoveNode].IncRequests(time.Since(start)) + + return err } // RemoveNode invokes eponymous method from TreeServiceClient. @@ -533,16 +590,21 @@ func (p *Pool) RemoveNode(ctx context.Context, prm RemoveNodeParams) error { BearerToken: prm.BearerToken, }, } + + start := time.Now() if err := p.signRequest(request); err != nil { return err } - return p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) error { + err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) error { if _, err := client.Remove(ctx, request); err != nil { return handleError("failed to remove node", err) } return nil }) + p.methods[methodRemoveNode].IncRequests(time.Since(start)) + + return err } // Close closes the Pool and releases all the associated resources. @@ -563,6 +625,18 @@ func (p *Pool) Close() error { return err } +// Statistic returns tree pool statistics. +func (p *Pool) Statistic() Statistic { + stat := Statistic{make([]pool.StatusSnapshot, len(p.methods))} + + for i, method := range p.methods { + stat.methods[i] = method.Snapshot() + method.Reset() + } + + return stat +} + func handleError(msg string, err error) error { if err == nil { return nil diff --git a/pool/tree/statistic.go b/pool/tree/statistic.go new file mode 100644 index 0000000..9f565fa --- /dev/null +++ b/pool/tree/statistic.go @@ -0,0 +1,51 @@ +package tree + +import ( + "time" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool" +) + +// Statistic is metrics of the tree pool. +type Statistic struct { + methods []pool.StatusSnapshot +} + +func (s *Statistic) Requests() (requests uint64) { + for _, val := range s.methods { + requests += val.AllRequests() + } + return requests +} + +func (s *Statistic) AverageGetNodes() time.Duration { + return s.averageTime(methodGetNodes) +} + +func (s *Statistic) AverageGetSubTree() time.Duration { + return s.averageTime(methodGetSubTree) +} + +func (s *Statistic) AverageAddNode() time.Duration { + return s.averageTime(methodAddNode) +} + +func (s *Statistic) AverageAddNodeByPath() time.Duration { + return s.averageTime(methodAddNodeByPath) +} + +func (s *Statistic) AverageMoveNode() time.Duration { + return s.averageTime(methodMoveNode) +} + +func (s *Statistic) AverageRemoveNode() time.Duration { + return s.averageTime(methodRemoveNode) +} + +func (s *Statistic) averageTime(method MethodIndex) time.Duration { + stat := s.methods[method] + if stat.AllRequests() == 0 { + return 0 + } + return time.Duration(stat.AllTime() / stat.AllRequests()) +} From 6dd500def973a345710fed3d479b0040f37f7cf6 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Wed, 31 Jul 2024 17:55:34 +0300 Subject: [PATCH 063/197] [#247] object: Introduce Patch type * Make ToV2, FromV2 converters for Patch and PayloadPatch; * Add unit-tests. Signed-off-by: Airat Arifullin --- go.mod | 2 +- go.sum | 4 +- object/patch.go | 103 +++++++++++++++++++++++++++ object/patch_test.go | 161 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 267 insertions(+), 3 deletions(-) create mode 100644 object/patch.go create mode 100644 object/patch_test.go diff --git a/go.mod b/go.mod index a481fb2..faa6b6b 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.21 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240726072425-3dfa2f4fd65e + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240730145254-c27b978770a3 git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 diff --git a/go.sum b/go.sum index a23b405..b84f659 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240726072425-3dfa2f4fd65e h1:gEWT+70E/RvGkxtSv+PlyUN2vtJVymhQa1mypvrXukM= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240726072425-3dfa2f4fd65e/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240730145254-c27b978770a3 h1:BbtF/98HU0nBl4szdDYAV3XadNE5sJ92uSFmNePQmfA= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240730145254-c27b978770a3/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e h1:kcBqZBiFIUBATUqEuvVigtkJJWQ2Gug/eYXn967o3M4= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e/go.mod h1:F/fe1OoIDKr5Bz99q4sriuHDuf3aZefZy9ZsCqEtgxc= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= diff --git a/object/patch.go b/object/patch.go new file mode 100644 index 0000000..1cc30fc --- /dev/null +++ b/object/patch.go @@ -0,0 +1,103 @@ +package object + +import ( + v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" +) + +// Patch is a patch that's applied for an object. +type Patch struct { + // The address of the object for which the patch is being applied. + Address oid.Address + + // The list of new attributes to set in the object's header. + NewAttributes []Attribute + + // If ReplaceAttributes flag is true, then the header's attributes are reset and + // filled with NewAttributes. Otherwise, the attributes are just merged. + ReplaceAttributes bool + + // Payload patch. If this field is not set, then it assumed such Patch patches only + // header (see NewAttributes, ReplaceAttributes). + PayloadPatch *PayloadPatch +} + +func (p *Patch) ToV2() *v2object.PatchRequestBody { + if p == nil { + return nil + } + + v2 := new(v2object.PatchRequestBody) + + addrV2 := new(refs.Address) + p.Address.WriteToV2(addrV2) + v2.SetAddress(addrV2) + + attrs := make([]v2object.Attribute, len(p.NewAttributes)) + for i := range p.NewAttributes { + attrs[i] = *p.NewAttributes[i].ToV2() + } + v2.SetNewAttributes(attrs) + v2.SetReplaceAttributes(p.ReplaceAttributes) + + v2.SetPatch(p.PayloadPatch.ToV2()) + + return v2 +} + +func (p *Patch) FromV2(patch *v2object.PatchRequestBody) { + if patch == nil { + return + } + + if addr := patch.GetAddress(); addr != nil { + _ = p.Address.ReadFromV2(*addr) + } + + newAttrs := patch.GetNewAttributes() + p.NewAttributes = make([]Attribute, len(newAttrs)) + for i := range newAttrs { + p.NewAttributes[i] = *NewAttributeFromV2(&newAttrs[i]) + } + + p.ReplaceAttributes = patch.GetReplaceAttributes() + + if v2patch := patch.GetPatch(); v2patch != nil { + p.PayloadPatch = new(PayloadPatch) + p.PayloadPatch.FromV2(v2patch) + } +} + +// Patch is a patch that's applied for an object's payload. +type PayloadPatch struct { + // Range of the patch application. + Range *Range + + // Chunk is the payload that replaces (or is appended to) the original object payload. + Chunk []byte +} + +func (p *PayloadPatch) ToV2() *v2object.PatchRequestBodyPatch { + if p == nil { + return nil + } + + v2 := new(v2object.PatchRequestBodyPatch) + + v2.Chunk = p.Chunk + v2.Range = p.Range.ToV2() + + return v2 +} + +func (p *PayloadPatch) FromV2(patch *v2object.PatchRequestBodyPatch) { + if patch == nil { + return + } + + p.Chunk = patch.Chunk + if patch.Range != nil { + p.Range = NewRangeFromV2(patch.Range) + } +} diff --git a/object/patch_test.go b/object/patch_test.go new file mode 100644 index 0000000..f66fd29 --- /dev/null +++ b/object/patch_test.go @@ -0,0 +1,161 @@ +package object + +import ( + "testing" + + v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" + oidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id/test" + "github.com/stretchr/testify/require" +) + +func TestPatch(t *testing.T) { + t.Run("to v2", func(t *testing.T) { + t.Run("only attributes", func(t *testing.T) { + var p Patch + + var attr1, attr2 Attribute + attr1.SetKey("key1") + attr1.SetValue("val1") + attr2.SetKey("key2") + attr2.SetValue("val2") + + p.Address = oidtest.Address() + p.NewAttributes = []Attribute{attr1, attr2} + p.ReplaceAttributes = true + + v2patch := p.ToV2() + + addr := new(oid.Address) + require.NotNil(t, v2patch.GetAddress()) + addr.ReadFromV2(*v2patch.GetAddress()) + require.True(t, p.Address.Equals(*addr)) + + require.Equal(t, p.ReplaceAttributes, v2patch.GetReplaceAttributes()) + + require.Nil(t, v2patch.GetPatch()) + + require.Len(t, v2patch.GetNewAttributes(), 2) + require.Equal(t, attr1.Key(), v2patch.GetNewAttributes()[0].GetKey()) + require.Equal(t, attr2.Key(), v2patch.GetNewAttributes()[1].GetKey()) + require.Equal(t, attr1.Value(), v2patch.GetNewAttributes()[0].GetValue()) + require.Equal(t, attr2.Value(), v2patch.GetNewAttributes()[1].GetValue()) + }) + + t.Run("with payload patch", func(t *testing.T) { + var p Patch + + var attr1, attr2 Attribute + attr1.SetKey("key1") + attr1.SetValue("val1") + attr2.SetKey("key2") + attr2.SetValue("val2") + + p.Address = oidtest.Address() + p.NewAttributes = []Attribute{attr1, attr2} + p.ReplaceAttributes = true + + rng := &Range{} + rng.SetOffset(100) + rng.SetLength(10) + p.PayloadPatch = &PayloadPatch{ + Range: rng, + Chunk: []byte("payload_patch_chunk"), + } + + v2patch := p.ToV2() + + addr := new(oid.Address) + require.NotNil(t, v2patch.GetAddress()) + addr.ReadFromV2(*v2patch.GetAddress()) + require.True(t, p.Address.Equals(*addr)) + + require.Equal(t, p.ReplaceAttributes, v2patch.GetReplaceAttributes()) + + require.Len(t, v2patch.GetNewAttributes(), 2) + require.Equal(t, attr1.Key(), v2patch.GetNewAttributes()[0].GetKey()) + require.Equal(t, attr2.Key(), v2patch.GetNewAttributes()[1].GetKey()) + require.Equal(t, attr1.Value(), v2patch.GetNewAttributes()[0].GetValue()) + require.Equal(t, attr2.Value(), v2patch.GetNewAttributes()[1].GetValue()) + + require.NotNil(t, v2patch.GetPatch()) + require.NotNil(t, v2patch.GetPatch().Range) + require.Equal(t, uint64(100), v2patch.GetPatch().Range.GetOffset()) + require.Equal(t, uint64(10), v2patch.GetPatch().Range.GetLength()) + require.Equal(t, []byte("payload_patch_chunk"), v2patch.GetPatch().Chunk) + }) + + }) + + t.Run("from v2", func(t *testing.T) { + t.Run("only attributes", func(t *testing.T) { + v2patch := new(v2object.PatchRequestBody) + + address := oidtest.Address() + v2addr := new(refs.Address) + address.WriteToV2(v2addr) + v2patch.SetAddress(v2addr) + + var attr1, attr2 Attribute + attr1.SetKey("key1") + attr1.SetValue("val1") + attr2.SetKey("key2") + attr2.SetValue("val2") + + v2patch.SetNewAttributes([]v2object.Attribute{ + *attr1.ToV2(), *attr2.ToV2(), + }) + v2patch.SetReplaceAttributes(true) + + var p Patch + p.FromV2(v2patch) + + require.Equal(t, address, p.Address) + require.Equal(t, []Attribute{attr1, attr2}, p.NewAttributes) + require.Equal(t, true, p.ReplaceAttributes) + require.Nil(t, p.PayloadPatch) + }) + + t.Run("with payload patch", func(t *testing.T) { + v2patchReqBody := new(v2object.PatchRequestBody) + + address := oidtest.Address() + v2addr := new(refs.Address) + address.WriteToV2(v2addr) + v2patchReqBody.SetAddress(v2addr) + + var attr1, attr2 Attribute + attr1.SetKey("key1") + attr1.SetValue("val1") + attr2.SetKey("key2") + attr2.SetValue("val2") + + v2patchReqBody.SetNewAttributes([]v2object.Attribute{ + *attr1.ToV2(), *attr2.ToV2(), + }) + v2patchReqBody.SetReplaceAttributes(true) + + v2Rng := &v2object.Range{} + v2Rng.SetOffset(13) + v2Rng.SetLength(10) + v2Patch := &v2object.PatchRequestBodyPatch{ + Range: v2Rng, + Chunk: []byte("payload_patch_chunk"), + } + v2patchReqBody.SetPatch(v2Patch) + + var p Patch + p.FromV2(v2patchReqBody) + + require.Equal(t, address, p.Address) + require.Equal(t, []Attribute{attr1, attr2}, p.NewAttributes) + require.Equal(t, true, p.ReplaceAttributes) + require.NotNil(t, p.PayloadPatch) + require.NotNil(t, p.PayloadPatch.Range) + require.Equal(t, uint64(13), p.PayloadPatch.Range.GetOffset()) + require.Equal(t, uint64(10), p.PayloadPatch.Range.GetLength()) + require.Equal(t, []byte("payload_patch_chunk"), p.PayloadPatch.Chunk) + }) + }) +} From 361739e860348f3122ce0c61713b8d1ef8038173 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Wed, 31 Jul 2024 17:56:45 +0300 Subject: [PATCH 064/197] [#247] object: Introduce `patcher` package * Introduce `patcher` package that contains such interfaces to be implemented: - `PatchApplier` - the main patching engine that merges the stream of patches and the stream of original object payload divided by ranges. The merged streams result is output to `ChunkedObjectWriter`; - `RangeProvider` - provides the original object payload by ranges; - `HeaderProvider` - provides the original object header. * Introduce `patcher` that implements `PatchApplier`; * Cover all possible cases with unit-tests. Signed-off-by: Airat Arifullin --- object/patcher/patcher.go | 242 +++++++++++++ object/patcher/patcher_test.go | 601 +++++++++++++++++++++++++++++++++ 2 files changed, 843 insertions(+) create mode 100644 object/patcher/patcher.go create mode 100644 object/patcher/patcher_test.go diff --git a/object/patcher/patcher.go b/object/patcher/patcher.go new file mode 100644 index 0000000..ec448c9 --- /dev/null +++ b/object/patcher/patcher.go @@ -0,0 +1,242 @@ +package patcher + +import ( + "context" + "errors" + "fmt" + "io" + + objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/transformer" +) + +var ( + ErrOffsetExceedsSize = errors.New("patch offset exceeds object size") + ErrInvalidPatchOffsetOrder = errors.New("invalid patch offset order") + ErrPayloadPatchIsNil = errors.New("nil payload patch") + ErrAttrPatchAlreadyApplied = errors.New("attribute patch already applied") +) + +// PatchRes is the result of patch application. +type PatchRes struct { + AccessIdentifiers *transformer.AccessIdentifiers +} + +// PatchApplier is the interface that provides method to apply header and payload patches. +type PatchApplier interface { + // ApplyAttributesPatch applies the patch only for the object's attributes. + // + // ApplyAttributesPatch can't be invoked few times, otherwise it returns `ErrAttrPatchAlreadyApplied` error. + // + // The call is idempotent for the original header if it's invoked with empty `newAttrs` and + // `replaceAttrs = false`. + ApplyAttributesPatch(ctx context.Context, newAttrs []objectSDK.Attribute, replaceAttrs bool) error + + // ApplyPayloadPatch applies the patch for the object's payload. + // + // ApplyPayloadPatch returns `ErrPayloadPatchIsNil` error if patch is nil. + ApplyPayloadPatch(ctx context.Context, payloadPatch *objectSDK.PayloadPatch) error + + // Close closes PatchApplier when the patch stream is over. + Close(context.Context) (PatchRes, error) +} + +// RangeProvider is the interface that provides a method to get original object payload +// by a given range. +type RangeProvider interface { + // GetRange reads an original object payload by the given range. + // The method returns io.Reader over the data range only. This means if the data is read out, + // then GetRange has to be invoked to provide reader over the next range. + GetRange(ctx context.Context, rng *objectSDK.Range) io.Reader +} + +type patcher struct { + rangeProvider RangeProvider + + objectWriter transformer.ChunkedObjectWriter + + currOffset uint64 + + originalPayloadSize uint64 + + hdr *objectSDK.Object + + attrPatchAlreadyApplied bool + + readerBuffSize int +} + +const ( + DefaultReaderBufferSize = 64 * 1024 +) + +// Params is parameters to initialize patcher. +type Params struct { + // Original object header. + Header *objectSDK.Object + + // Range provider. + RangeProvider RangeProvider + + // ObjectWriter is the writer that writes the patched object. + ObjectWriter transformer.ChunkedObjectWriter + + // The size of the buffer used by the original payload range reader. + // If it's set to <=0, then `DefaultReaderBufferSize` is used. + ReaderBufferSize int +} + +func New(prm Params) PatchApplier { + readerBufferSize := prm.ReaderBufferSize + if readerBufferSize <= 0 { + readerBufferSize = DefaultReaderBufferSize + } + + return &patcher{ + rangeProvider: prm.RangeProvider, + + objectWriter: prm.ObjectWriter, + + hdr: prm.Header, + + originalPayloadSize: prm.Header.PayloadSize(), + + readerBuffSize: readerBufferSize, + } +} + +func (p *patcher) ApplyAttributesPatch(ctx context.Context, newAttrs []objectSDK.Attribute, replaceAttrs bool) error { + defer func() { + p.attrPatchAlreadyApplied = true + }() + + if p.attrPatchAlreadyApplied { + return ErrAttrPatchAlreadyApplied + } + + if replaceAttrs { + p.hdr.SetAttributes(newAttrs...) + } else if len(newAttrs) > 0 { + mergedAttrs := mergeAttributes(newAttrs, p.hdr.Attributes()) + p.hdr.SetAttributes(mergedAttrs...) + } + + if err := p.objectWriter.WriteHeader(ctx, p.hdr); err != nil { + return fmt.Errorf("writer header: %w", err) + } + return nil +} + +func (p *patcher) ApplyPayloadPatch(ctx context.Context, payloadPatch *objectSDK.PayloadPatch) error { + if payloadPatch == nil { + return ErrPayloadPatchIsNil + } + + if payloadPatch.Range.GetOffset() < p.currOffset { + return fmt.Errorf("%w: current = %d, previous = %d", ErrInvalidPatchOffsetOrder, payloadPatch.Range.GetOffset(), p.currOffset) + } + + if payloadPatch.Range.GetOffset() > p.originalPayloadSize { + return fmt.Errorf("%w: offset = %d, object size = %d", ErrOffsetExceedsSize, payloadPatch.Range.GetOffset(), p.originalPayloadSize) + } + + var err error + if p.currOffset, err = p.applyPatch(ctx, payloadPatch, p.currOffset); err != nil { + return fmt.Errorf("apply patch: %w", err) + } + + return nil +} + +func (p *patcher) Close(ctx context.Context) (PatchRes, error) { + rng := new(objectSDK.Range) + rng.SetOffset(p.currOffset) + rng.SetLength(p.originalPayloadSize - p.currOffset) + + // copy remaining originial payload + if err := p.copyRange(ctx, rng); err != nil { + return PatchRes{}, fmt.Errorf("copy payload: %w", err) + } + + aid, err := p.objectWriter.Close(ctx) + if err != nil { + return PatchRes{}, fmt.Errorf("close object writer: %w", err) + } + + return PatchRes{ + AccessIdentifiers: aid, + }, nil +} + +func (p *patcher) copyRange(ctx context.Context, rng *objectSDK.Range) error { + rdr := p.rangeProvider.GetRange(ctx, rng) + for { + buffOrigPayload := make([]byte, p.readerBuffSize) + n, readErr := rdr.Read(buffOrigPayload) + if readErr != nil { + if readErr != io.EOF { + return fmt.Errorf("read: %w", readErr) + } + } + _, wrErr := p.objectWriter.Write(ctx, buffOrigPayload[:n]) + if wrErr != nil { + return fmt.Errorf("write: %w", wrErr) + } + if readErr == io.EOF { + break + } + } + return nil +} + +func (p *patcher) applyPatch(ctx context.Context, payloadPatch *objectSDK.PayloadPatch, offset uint64) (newOffset uint64, err error) { + // write the original payload chunk before the start of the patch + if payloadPatch.Range.GetOffset() > offset { + rng := new(objectSDK.Range) + rng.SetOffset(offset) + rng.SetLength(payloadPatch.Range.GetOffset() - offset) + + if err = p.copyRange(ctx, rng); err != nil { + err = fmt.Errorf("copy payload: %w", err) + return + } + + newOffset = payloadPatch.Range.GetOffset() + } + + // apply patch + if _, err = p.objectWriter.Write(ctx, payloadPatch.Chunk); err != nil { + return + } + + if payloadPatch.Range.GetLength() > 0 { + newOffset += payloadPatch.Range.GetLength() + } + + return +} + +func mergeAttributes(newAttrs, oldAttrs []objectSDK.Attribute) []objectSDK.Attribute { + attrMap := make(map[string]string, len(newAttrs)) + + for _, attr := range newAttrs { + attrMap[attr.Key()] = attr.Value() + } + + for i := range oldAttrs { + newVal, ok := attrMap[oldAttrs[i].Key()] + if !ok { + continue + } + oldAttrs[i].SetValue(newVal) + delete(attrMap, oldAttrs[i].Key()) + } + + for _, newAttr := range newAttrs { + if _, ok := attrMap[newAttr.Key()]; ok { + oldAttrs = append(oldAttrs, newAttr) + } + } + + return oldAttrs +} diff --git a/object/patcher/patcher_test.go b/object/patcher/patcher_test.go new file mode 100644 index 0000000..bf2402b --- /dev/null +++ b/object/patcher/patcher_test.go @@ -0,0 +1,601 @@ +package patcher + +import ( + "bytes" + "context" + "io" + "testing" + + objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" + oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" + oidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id/test" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/transformer" + "github.com/stretchr/testify/require" +) + +type mockPatchedObjectWriter struct { + obj *objectSDK.Object +} + +func (m *mockPatchedObjectWriter) Write(_ context.Context, chunk []byte) (int, error) { + res := append(m.obj.Payload(), chunk...) + + m.obj.SetPayload(res) + m.obj.SetPayloadSize(uint64(len(res))) + + return len(chunk), nil +} + +func (m *mockPatchedObjectWriter) WriteHeader(_ context.Context, hdr *objectSDK.Object) error { + m.obj.ToV2().SetHeader(hdr.ToV2().GetHeader()) + return nil +} + +func (m *mockPatchedObjectWriter) Close(context.Context) (*transformer.AccessIdentifiers, error) { + return &transformer.AccessIdentifiers{}, nil +} + +type mockRangeProvider struct { + originalObjectPayload []byte +} + +var _ RangeProvider = (*mockRangeProvider)(nil) + +func (m *mockRangeProvider) GetRange(_ context.Context, rng *objectSDK.Range) io.Reader { + offset := rng.GetOffset() + length := rng.GetLength() + + if length == 0 { + return bytes.NewReader(m.originalObjectPayload[offset:]) + } + return bytes.NewReader(m.originalObjectPayload[offset : offset+length]) +} + +func newTestObject() (*objectSDK.Object, oid.Address) { + obj := objectSDK.New() + + addr := oidtest.Address() + obj.SetContainerID(addr.Container()) + obj.SetID(addr.Object()) + + return obj, addr +} + +func rangeWithOffestWithLength(offset, length uint64) *objectSDK.Range { + rng := new(objectSDK.Range) + rng.SetOffset(offset) + rng.SetLength(length) + return rng +} + +func TestPatchRevert(t *testing.T) { + obj, _ := newTestObject() + + modifPatch := &objectSDK.Patch{ + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(0, 0), + + Chunk: []byte("inserted"), + }, + } + + originalObjectPayload := []byte("*******************") + + obj.SetPayload(originalObjectPayload) + obj.SetPayloadSize(uint64(len(originalObjectPayload))) + + exp := []byte("inserted*******************") + + rangeProvider := &mockRangeProvider{ + originalObjectPayload: originalObjectPayload, + } + + patchedObj, _ := newTestObject() + + wr := &mockPatchedObjectWriter{ + obj: patchedObj, + } + + prm := Params{ + Header: obj.CutPayload(), + + RangeProvider: rangeProvider, + + ObjectWriter: wr, + } + + patcher := New(prm) + + err := patcher.ApplyAttributesPatch(context.Background(), modifPatch.NewAttributes, modifPatch.ReplaceAttributes) + require.NoError(t, err) + + err = patcher.ApplyPayloadPatch(context.Background(), modifPatch.PayloadPatch) + require.NoError(t, err) + + _, err = patcher.Close(context.Background()) + require.NoError(t, err) + + require.Equal(t, exp, patchedObj.Payload()) + + revertPatch := &objectSDK.Patch{ + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(0, uint64(len("inserted"))), + + Chunk: []byte{}, + }, + } + + rangeProvider = &mockRangeProvider{ + originalObjectPayload: exp, + } + + patchedPatchedObj, _ := newTestObject() + + wr = &mockPatchedObjectWriter{ + obj: patchedPatchedObj, + } + + prm = Params{ + Header: patchedObj.CutPayload(), + + RangeProvider: rangeProvider, + + ObjectWriter: wr, + } + + patcher = New(prm) + + err = patcher.ApplyAttributesPatch(context.Background(), revertPatch.NewAttributes, revertPatch.ReplaceAttributes) + require.NoError(t, err) + + err = patcher.ApplyPayloadPatch(context.Background(), revertPatch.PayloadPatch) + require.NoError(t, err) + + _, err = patcher.Close(context.Background()) + require.NoError(t, err) + + require.Equal(t, originalObjectPayload, patchedPatchedObj.Payload()) +} + +func TestPatchRepeatAttributePatch(t *testing.T) { + obj, _ := newTestObject() + + modifPatch := &objectSDK.Patch{} + + originalObjectPayload := []byte("*******************") + + obj.SetPayload(originalObjectPayload) + obj.SetPayloadSize(uint64(len(originalObjectPayload))) + + rangeProvider := &mockRangeProvider{ + originalObjectPayload: originalObjectPayload, + } + + patchedObj, _ := newTestObject() + + wr := &mockPatchedObjectWriter{ + obj: patchedObj, + } + + prm := Params{ + Header: obj.CutPayload(), + + RangeProvider: rangeProvider, + + ObjectWriter: wr, + } + + patcher := New(prm) + + err := patcher.ApplyAttributesPatch(context.Background(), modifPatch.NewAttributes, modifPatch.ReplaceAttributes) + require.NoError(t, err) + + err = patcher.ApplyAttributesPatch(context.Background(), modifPatch.NewAttributes, modifPatch.ReplaceAttributes) + require.ErrorIs(t, err, ErrAttrPatchAlreadyApplied) +} + +func TestPatchEmptyPayloadPatch(t *testing.T) { + obj, _ := newTestObject() + + modifPatch := &objectSDK.Patch{} + + originalObjectPayload := []byte("*******************") + + obj.SetPayload(originalObjectPayload) + obj.SetPayloadSize(uint64(len(originalObjectPayload))) + + rangeProvider := &mockRangeProvider{ + originalObjectPayload: originalObjectPayload, + } + + patchedObj, _ := newTestObject() + + wr := &mockPatchedObjectWriter{ + obj: patchedObj, + } + + prm := Params{ + Header: obj.CutPayload(), + + RangeProvider: rangeProvider, + + ObjectWriter: wr, + } + + patcher := New(prm) + + err := patcher.ApplyAttributesPatch(context.Background(), modifPatch.NewAttributes, modifPatch.ReplaceAttributes) + require.NoError(t, err) + + err = patcher.ApplyPayloadPatch(context.Background(), nil) + require.ErrorIs(t, err, ErrPayloadPatchIsNil) +} + +func newTestAttribute(key, val string) objectSDK.Attribute { + var attr objectSDK.Attribute + attr.SetKey(key) + attr.SetValue(val) + return attr +} + +func TestPatch(t *testing.T) { + for _, test := range []struct { + name string + patches []objectSDK.Patch + originalObjectPayload []byte + patchedPayload []byte + originalHeaderAttributes []objectSDK.Attribute + patchedHeaderAttributes []objectSDK.Attribute + expectedPayloadPatchErr error + }{ + { + name: "invalid offset", + patches: []objectSDK.Patch{ + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(100, 0), + Chunk: []byte(""), + }, + }, + }, + originalObjectPayload: []byte("0123456789qwertyuiopasdfghjklzxcvbnm"), + expectedPayloadPatchErr: ErrOffsetExceedsSize, + }, + { + name: "invalid following patch offset", + patches: []objectSDK.Patch{ + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(10, 0), + Chunk: []byte(""), + }, + }, + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(7, 0), + Chunk: []byte(""), + }, + }, + }, + originalObjectPayload: []byte("0123456789qwertyuiopasdfghjklzxcvbnm"), + expectedPayloadPatchErr: ErrInvalidPatchOffsetOrder, + }, + { + name: "only header patch", + patches: []objectSDK.Patch{ + { + NewAttributes: []objectSDK.Attribute{ + newTestAttribute("key1", "val2"), + newTestAttribute("key2", "val2"), + }, + }, + }, + originalObjectPayload: []byte("0123456789qwertyuiopasdfghjklzxcvbnm"), + patchedPayload: []byte("0123456789qwertyuiopasdfghjklzxcvbnm"), + patchedHeaderAttributes: []objectSDK.Attribute{ + newTestAttribute("key1", "val2"), + newTestAttribute("key2", "val2"), + }, + }, + { + name: "header and payload", + patches: []objectSDK.Patch{ + { + NewAttributes: []objectSDK.Attribute{ + newTestAttribute("key1", "val2"), + newTestAttribute("key2", "val2"), + }, + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(0, 0), + Chunk: []byte("inserted at the beginning"), + }, + }, + }, + originalObjectPayload: []byte("0123456789qwertyuiopasdfghjklzxcvbnm"), + patchedPayload: []byte("inserted at the beginning0123456789qwertyuiopasdfghjklzxcvbnm"), + patchedHeaderAttributes: []objectSDK.Attribute{ + newTestAttribute("key1", "val2"), + newTestAttribute("key2", "val2"), + }, + }, + { + name: "header only merge attributes", + patches: []objectSDK.Patch{ + { + NewAttributes: []objectSDK.Attribute{ + newTestAttribute("key1", "val2"), + newTestAttribute("key2", "val2-incoming"), + }, + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(0, 0), + Chunk: []byte("inserted at the beginning"), + }, + }, + }, + originalHeaderAttributes: []objectSDK.Attribute{ + newTestAttribute("key2", "to be popped out"), + newTestAttribute("key3", "val3"), + }, + originalObjectPayload: []byte("0123456789qwertyuiopasdfghjklzxcvbnm"), + patchedPayload: []byte("inserted at the beginning0123456789qwertyuiopasdfghjklzxcvbnm"), + patchedHeaderAttributes: []objectSDK.Attribute{ + newTestAttribute("key2", "val2-incoming"), + newTestAttribute("key3", "val3"), + newTestAttribute("key1", "val2"), + }, + }, + { + name: "header only then payload", + patches: []objectSDK.Patch{ + { + NewAttributes: []objectSDK.Attribute{ + newTestAttribute("key1", "val2"), + newTestAttribute("key2", "val2"), + }, + }, + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(0, 0), + Chunk: []byte("inserted at the beginning"), + }, + }, + }, + originalObjectPayload: []byte("0123456789qwertyuiopasdfghjklzxcvbnm"), + patchedPayload: []byte("inserted at the beginning0123456789qwertyuiopasdfghjklzxcvbnm"), + patchedHeaderAttributes: []objectSDK.Attribute{ + newTestAttribute("key1", "val2"), + newTestAttribute("key2", "val2"), + }, + }, + { + name: "no effect", + patches: []objectSDK.Patch{ + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(0, 0), + Chunk: []byte(""), + }, + }, + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(12, 0), + Chunk: []byte(""), + }, + }, + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(20, 0), + Chunk: []byte(""), + }, + }, + }, + originalObjectPayload: []byte("0123456789qwertyuiopasdfghjklzxcvbnm"), + patchedPayload: []byte("0123456789qwertyuiopasdfghjklzxcvbnm"), + }, + { + name: "insert prefix", + patches: []objectSDK.Patch{ + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(0, 0), + Chunk: []byte("inserted at the beginning"), + }, + }, + }, + originalObjectPayload: []byte("0123456789qwertyuiopasdfghjklzxcvbnm"), + patchedPayload: []byte("inserted at the beginning0123456789qwertyuiopasdfghjklzxcvbnm"), + }, + { + name: "insert in the middle", + patches: []objectSDK.Patch{ + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(5, 0), + Chunk: []byte("inserted somewhere in the middle"), + }, + }, + }, + originalObjectPayload: []byte("0123456789qwertyuiopasdfghjklzxcvbnm"), + patchedPayload: []byte("01234inserted somewhere in the middle56789qwertyuiopasdfghjklzxcvbnm"), + }, + { + name: "insert at the end", + patches: []objectSDK.Patch{ + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(36, 0), + Chunk: []byte("inserted somewhere at the end"), + }, + }, + }, + originalObjectPayload: []byte("0123456789qwertyuiopasdfghjklzxcvbnm"), + patchedPayload: []byte("0123456789qwertyuiopasdfghjklzxcvbnminserted somewhere at the end"), + }, + { + name: "replace by range", + patches: []objectSDK.Patch{ + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(0, 12), + Chunk: []byte("just replace"), + }, + }, + }, + originalObjectPayload: []byte("0123456789qwertyuiopasdfghjklzxcvbnm"), + patchedPayload: []byte("just replaceertyuiopasdfghjklzxcvbnm"), + }, + { + name: "replace and insert some bytes", + patches: []objectSDK.Patch{ + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(0, 11), + Chunk: []byte("replace and append in the middle"), + }, + }, + }, + originalObjectPayload: []byte("0123456789qwertyuiopasdfghjklzxcvbnm"), + patchedPayload: []byte("replace and append in the middlewertyuiopasdfghjklzxcvbnm"), + }, + { + name: "replace and insert some bytes in the middle", + patches: []objectSDK.Patch{ + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(5, 3), + Chunk: []byte("@@@@@"), + }, + }, + }, + originalObjectPayload: []byte("0123456789qwertyuiopasdfghjklzxcvbnm"), + patchedPayload: []byte("01234@@@@@89qwertyuiopasdfghjklzxcvbnm"), + }, + { + name: "a few patches: prefix, suffix", + patches: []objectSDK.Patch{ + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(0, 0), + Chunk: []byte("this_will_be_prefix"), + }, + }, + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(36, 0), + Chunk: []byte("this_will_be_suffix"), + }, + }, + }, + originalObjectPayload: []byte("0123456789qwertyuiopasdfghjklzxcvbnm"), + patchedPayload: []byte("this_will_be_prefix0123456789qwertyuiopasdfghjklzxcvbnmthis_will_be_suffix"), + }, + { + name: "a few patches: replace and insert some bytes", + patches: []objectSDK.Patch{ + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(10, 3), + Chunk: []byte("aaaaa"), + }, + }, + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(16, 0), + Chunk: []byte("bbbbb"), + }, + }, + }, + originalObjectPayload: []byte("0123456789ABCDEF"), + patchedPayload: []byte("0123456789aaaaaDEFbbbbb"), + }, + { + name: "a few patches: various modifiactions", + patches: []objectSDK.Patch{ + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(4, 8), + Chunk: []byte("earliest"), + }, + }, + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(13, 0), + Chunk: []byte("known "), + }, + }, + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(35, 8), + Chunk: []byte("a small town"), + }, + }, + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(62, 6), + Chunk: []byte("tablet"), + }, + }, + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(87, 0), + Chunk: []byte("Shar-Kali-Sharri"), + }, + }, + }, + originalObjectPayload: []byte("The ******** mention of Babylon as [insert] appears on a clay ****** from the reign of "), + patchedPayload: []byte("The earliest known mention of Babylon as a small town appears on a clay tablet from the reign of Shar-Kali-Sharri"), + }, + } { + t.Run(test.name, func(t *testing.T) { + rangeProvider := &mockRangeProvider{ + originalObjectPayload: test.originalObjectPayload, + } + + originalObject, _ := newTestObject() + originalObject.SetPayload(test.originalObjectPayload) + originalObject.SetPayloadSize(uint64(len(test.originalObjectPayload))) + originalObject.SetAttributes(test.originalHeaderAttributes...) + + patchedObject, _ := newTestObject() + + wr := &mockPatchedObjectWriter{ + obj: patchedObject, + } + + prm := Params{ + Header: originalObject.CutPayload(), + + RangeProvider: rangeProvider, + + ObjectWriter: wr, + } + + patcher := New(prm) + + for i, patch := range test.patches { + if i == 0 { + _ = patcher.ApplyAttributesPatch(context.Background(), patch.NewAttributes, patch.ReplaceAttributes) + } + + if patch.PayloadPatch == nil { + continue + } + + err := patcher.ApplyPayloadPatch(context.Background(), patch.PayloadPatch) + if err != nil && test.expectedPayloadPatchErr != nil { + require.ErrorIs(t, err, test.expectedPayloadPatchErr) + return + } + require.NoError(t, err) + } + + _, err := patcher.Close(context.Background()) + require.NoError(t, err) + require.Equal(t, test.patchedPayload, patchedObject.Payload()) + + patchedAttrs := append([]objectSDK.Attribute{}, test.patchedHeaderAttributes...) + require.Equal(t, patchedAttrs, patchedObject.Attributes()) + }) + } + +} From 335aa18dc6ed6e71ad7e5ef6ae0bba00e96512ef Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Mon, 5 Aug 2024 23:01:23 +0300 Subject: [PATCH 065/197] [#249] go.mod: Bump frostfs-api-go/v2 version Signed-off-by: Airat Arifullin --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index faa6b6b..da05e86 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.21 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240730145254-c27b978770a3 + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240806093111-ebaf78c8faab git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 diff --git a/go.sum b/go.sum index b84f659..0aa5474 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240730145254-c27b978770a3 h1:BbtF/98HU0nBl4szdDYAV3XadNE5sJ92uSFmNePQmfA= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240730145254-c27b978770a3/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240806093111-ebaf78c8faab h1:CXN7QBLcaiGoy/XnJEvsSxy58OBAikVO7jQBMB9Ze6k= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240806093111-ebaf78c8faab/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e h1:kcBqZBiFIUBATUqEuvVigtkJJWQ2Gug/eYXn967o3M4= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e/go.mod h1:F/fe1OoIDKr5Bz99q4sriuHDuf3aZefZy9ZsCqEtgxc= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= From 3ba7446157d4007d8e34ea0e3fdb9429b823f2cc Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Mon, 5 Aug 2024 23:05:22 +0300 Subject: [PATCH 066/197] [#249] client: Introduce `ObjectPatch` Signed-off-by: Airat Arifullin --- client/object_patch.go | 259 ++++++++++++++++++++++++++++++++++++ client/object_patch_test.go | 209 +++++++++++++++++++++++++++++ 2 files changed, 468 insertions(+) create mode 100644 client/object_patch.go create mode 100644 client/object_patch_test.go diff --git a/client/object_patch.go b/client/object_patch.go new file mode 100644 index 0000000..b30bebe --- /dev/null +++ b/client/object_patch.go @@ -0,0 +1,259 @@ +package client + +import ( + "context" + "crypto/ecdsa" + "errors" + "fmt" + "io" + + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" + v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" + v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" + apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" + oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session" +) + +// ObjectPatcher is designed to patch an object. +// +// Must be initialized using Client.ObjectPatchInit, any other +// usage is unsafe. +type ObjectPatcher interface { + // PatchAttributes patches attributes. Attributes can be patched no more than once, + // otherwise, the server returns an error. + // + // Result means success. Failure reason can be received via Close. + PatchAttributes(ctx context.Context, newAttrs []object.Attribute, replace bool) bool + + // PatchPayload patches the object's payload. + // + // PatchPayload receives `payloadReader` and thus the payload of the patch is read and sent by chunks of + // `MaxChunkLength` length. + // + // Result means success. Failure reason can be received via Close. + PatchPayload(ctx context.Context, rng *object.Range, payloadReader io.Reader) bool + + // Close ends patching the object and returns the result of the operation + // along with the final results. Must be called after using the ObjectPatcher. + // + // Exactly one return value is non-nil. By default, server status is returned in res structure. + // Any client's internal or transport errors are returned as Go built-in error. + // If Client is tuned to resolve FrostFS API statuses, then FrostFS failures + // codes are returned as error. + // + // Return statuses: + // - global (see Client docs); + // - *apistatus.ContainerNotFound; + // - *apistatus.ContainerAccessDenied; + // - *apistatus.ObjectAccessDenied; + // - *apistatus.ObjectAlreadyRemoved; + // - *apistatus.ObjectLocked; + // - *apistatus.ObjectOutOfRange; + // - *apistatus.SessionTokenNotFound; + // - *apistatus.SessionTokenExpired. + Close(_ context.Context) (*ResObjectPatch, error) +} + +// ResObjectPatch groups resulting values of ObjectPatch operation. +type ResObjectPatch struct { + statusRes + + obj oid.ID +} + +// ObjectID returns an object ID of the patched object. +func (r ResObjectPatch) ObjectID() oid.ID { + return r.obj +} + +// PrmObjectPatch groups parameters of ObjectPatch operation. +type PrmObjectPatch struct { + XHeaders []string + + Address oid.Address + + BearerToken *bearer.Token + + Session *session.Object + + Key *ecdsa.PrivateKey + + MaxChunkLength int +} + +// ObjectPatchInit initializes object patcher. +func (c *Client) ObjectPatchInit(ctx context.Context, prm PrmObjectPatch) (ObjectPatcher, error) { + if len(prm.XHeaders)%2 != 0 { + return nil, errorInvalidXHeaders + } + + var objectPatcher objectPatcher + stream, err := rpcapi.Patch(&c.c, &objectPatcher.respV2, client.WithContext(ctx)) + if err != nil { + return nil, fmt.Errorf("open stream: %w", err) + } + + objectPatcher.addr = prm.Address + objectPatcher.key = &c.prm.Key + if prm.Key != nil { + objectPatcher.key = prm.Key + } + objectPatcher.client = c + objectPatcher.stream = stream + objectPatcher.firstPatchPayload = true + + if prm.MaxChunkLength > 0 { + objectPatcher.maxChunkLen = prm.MaxChunkLength + } else { + objectPatcher.maxChunkLen = defaultGRPCPayloadChunkLen + } + + objectPatcher.req.SetBody(&v2object.PatchRequestBody{}) + + meta := new(v2session.RequestMetaHeader) + writeXHeadersToMeta(prm.XHeaders, meta) + + if prm.BearerToken != nil { + v2BearerToken := new(acl.BearerToken) + prm.BearerToken.WriteToV2(v2BearerToken) + meta.SetBearerToken(v2BearerToken) + } + + if prm.Session != nil { + v2SessionToken := new(v2session.Token) + prm.Session.WriteToV2(v2SessionToken) + meta.SetSessionToken(v2SessionToken) + } + + c.prepareRequest(&objectPatcher.req, meta) + + return &objectPatcher, nil +} + +type objectPatcher struct { + client *Client + + stream interface { + Write(*v2object.PatchRequest) error + Close() error + } + + key *ecdsa.PrivateKey + res ResObjectPatch + err error + + addr oid.Address + + req v2object.PatchRequest + respV2 v2object.PatchResponse + + maxChunkLen int + + firstPatchPayload bool +} + +func (x *objectPatcher) PatchAttributes(_ context.Context, newAttrs []object.Attribute, replace bool) bool { + return x.patch(&object.Patch{ + Address: x.addr, + NewAttributes: newAttrs, + ReplaceAttributes: replace, + }) +} + +func (x *objectPatcher) PatchPayload(_ context.Context, rng *object.Range, payloadReader io.Reader) bool { + offset := rng.GetOffset() + + buf := make([]byte, x.maxChunkLen) + + for { + n, err := payloadReader.Read(buf) + if err != nil && err != io.EOF { + x.err = fmt.Errorf("read payload: %w", err) + return false + } + if n == 0 { + break + } + + rngPart := object.NewRange() + if x.firstPatchPayload { + x.firstPatchPayload = false + rngPart.SetOffset(offset) + rngPart.SetLength(rng.GetLength()) + } else { + rngPart.SetOffset(offset + rng.GetLength()) + } + + if !x.patch(&object.Patch{ + Address: x.addr, + PayloadPatch: &object.PayloadPatch{ + Range: rngPart, + Chunk: buf[:n], + }, + }) { + return false + } + + if err == io.EOF { + break + } + } + + return true +} + +func (x *objectPatcher) patch(patch *object.Patch) bool { + x.req.SetBody(patch.ToV2()) + x.req.SetVerificationHeader(nil) + + x.err = signature.SignServiceMessage(x.key, &x.req) + if x.err != nil { + x.err = fmt.Errorf("sign message: %w", x.err) + return false + } + + x.err = x.stream.Write(&x.req) + return x.err == nil +} + +func (x *objectPatcher) Close(_ context.Context) (*ResObjectPatch, error) { + // Ignore io.EOF error, because it is expected error for client-side + // stream termination by the server. E.g. when stream contains invalid + // message. Server returns an error in response message (in status). + if x.err != nil && !errors.Is(x.err, io.EOF) { + return nil, x.err + } + + if x.err = x.stream.Close(); x.err != nil { + return nil, x.err + } + + x.res.st, x.err = x.client.processResponse(&x.respV2) + if x.err != nil { + return nil, x.err + } + + if !apistatus.IsSuccessful(x.res.st) { + return &x.res, nil + } + + const fieldID = "ID" + + idV2 := x.respV2.Body.ObjectID + if idV2 == nil { + return nil, newErrMissingResponseField(fieldID) + } + + x.err = x.res.obj.ReadFromV2(*idV2) + if x.err != nil { + x.err = newErrInvalidResponseField(fieldID, x.err) + } + + return &x.res, nil +} diff --git a/client/object_patch_test.go b/client/object_patch_test.go new file mode 100644 index 0000000..9c87820 --- /dev/null +++ b/client/object_patch_test.go @@ -0,0 +1,209 @@ +package client + +import ( + "bytes" + "context" + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rand" + "testing" + + v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" + oidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id/test" + "github.com/stretchr/testify/require" +) + +type mockPatchStream struct { + streamedPayloadPatches []*object.PayloadPatch +} + +func (m *mockPatchStream) Write(r *v2object.PatchRequest) error { + pp := new(object.PayloadPatch) + pp.FromV2(r.GetBody().GetPatch()) + + if r.GetBody().GetPatch() != nil { + bodyChunk := r.GetBody().GetPatch().Chunk + pp.Chunk = make([]byte, len(bodyChunk)) + copy(pp.Chunk, bodyChunk) + } + + m.streamedPayloadPatches = append(m.streamedPayloadPatches, pp) + + return nil +} + +func (m *mockPatchStream) Close() error { + return nil +} + +func TestObjectPatcher(t *testing.T) { + type part struct { + offset int + length int + chunk string + } + + for _, test := range []struct { + name string + patchPayload string + rng *object.Range + maxChunkLen int + expectParts []part + }{ + { + name: "no split payload patch", + patchPayload: "011111", + rng: newRange(0, 6), + maxChunkLen: defaultGRPCPayloadChunkLen, + expectParts: []part{ + { + offset: 0, + length: 6, + chunk: "011111", + }, + }, + }, + { + name: "splitted payload patch", + patchPayload: "012345", + rng: newRange(0, 6), + maxChunkLen: 2, + expectParts: []part{ + { + offset: 0, + length: 6, + chunk: "01", + }, + { + offset: 6, + length: 0, + chunk: "23", + }, + { + offset: 6, + length: 0, + chunk: "45", + }, + }, + }, + { + name: "splitted payload patch with zero-length subpatches", + patchPayload: "0123456789!@", + rng: newRange(0, 4), + maxChunkLen: 2, + expectParts: []part{ + { + offset: 0, + length: 4, + chunk: "01", + }, + { + offset: 4, + length: 0, + chunk: "23", + }, + { + offset: 4, + length: 0, + chunk: "45", + }, + { + offset: 4, + length: 0, + chunk: "67", + }, + { + offset: 4, + length: 0, + chunk: "89", + }, + { + offset: 4, + length: 0, + chunk: "!@", + }, + }, + }, + { + name: "splitted payload patch with zero-length subpatches only", + patchPayload: "0123456789!@", + rng: newRange(0, 0), + maxChunkLen: 2, + expectParts: []part{ + { + offset: 0, + length: 0, + chunk: "01", + }, + { + offset: 0, + length: 0, + chunk: "23", + }, + { + offset: 0, + length: 0, + chunk: "45", + }, + { + offset: 0, + length: 0, + chunk: "67", + }, + { + offset: 0, + length: 0, + chunk: "89", + }, + { + offset: 0, + length: 0, + chunk: "!@", + }, + }, + }, + } { + t.Run(test.name, func(t *testing.T) { + m := &mockPatchStream{} + + pk, _ := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + + patcher := objectPatcher{ + client: &Client{}, + stream: m, + addr: oidtest.Address(), + key: pk, + maxChunkLen: test.maxChunkLen, + firstPatchPayload: true, + } + + success := patcher.PatchAttributes(context.Background(), nil, false) + require.True(t, success) + + success = patcher.PatchPayload(context.Background(), test.rng, bytes.NewReader([]byte(test.patchPayload))) + require.True(t, success) + + require.Len(t, m.streamedPayloadPatches, len(test.expectParts)+1) + + // m.streamedPayloadPatches[0] is attribute patch, so skip it + for i, part := range test.expectParts { + requireRangeChunk(t, m.streamedPayloadPatches[i+1], part.offset, part.length, part.chunk) + } + }) + } +} + +func requireRangeChunk(t *testing.T, pp *object.PayloadPatch, offset, length int, chunk string) { + require.NotNil(t, pp) + require.Equal(t, uint64(offset), pp.Range.GetOffset()) + require.Equal(t, uint64(length), pp.Range.GetLength()) + require.Equal(t, []byte(chunk), pp.Chunk) +} + +func newRange(offest, length uint64) *object.Range { + rng := &object.Range{} + rng.SetOffset(offest) + rng.SetLength(length) + return rng +} From 93171b331989ba55eca8d6300698256ea860547b Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Mon, 5 Aug 2024 23:09:20 +0300 Subject: [PATCH 067/197] [#249] session: Support patch verb Signed-off-by: Airat Arifullin --- session/object.go | 1 + session/object_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/session/object.go b/session/object.go index 86ea7cb..3641bd1 100644 --- a/session/object.go +++ b/session/object.go @@ -237,6 +237,7 @@ const ( VerbObjectDelete // Delete rpc VerbObjectRange // GetRange rpc VerbObjectRangeHash // GetRangeHash rpc + VerbObjectPatch // Patch rpc ) // ForVerb specifies the object operation of the session scope. Each diff --git a/session/object_test.go b/session/object_test.go index 6990ff8..59ff8d6 100644 --- a/session/object_test.go +++ b/session/object_test.go @@ -599,6 +599,7 @@ func TestObject_ForVerb(t *testing.T) { session.VerbObjectRangeHash: v2session.ObjectVerbRangeHash, session.VerbObjectRange: v2session.ObjectVerbRange, session.VerbObjectDelete: v2session.ObjectVerbDelete, + session.VerbObjectPatch: v2session.ObjectVerbPatch, } { val.ForVerb(from) From 5d58519253513557c5db462a231ce56fcd52f5ed Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Mon, 5 Aug 2024 23:18:00 +0300 Subject: [PATCH 068/197] [#249] pool: Introduce `objectPatch` method Signed-off-by: Airat Arifullin --- pool/mock_test.go | 4 ++ pool/pool.go | 128 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+) diff --git a/pool/mock_test.go b/pool/mock_test.go index d555afd..994fecd 100644 --- a/pool/mock_test.go +++ b/pool/mock_test.go @@ -145,6 +145,10 @@ func (m *mockClient) objectPut(context.Context, PrmObjectPut) (ResPutObject, err return ResPutObject{}, nil } +func (m *mockClient) objectPatch(context.Context, PrmObjectPatch) (ResPatchObject, error) { + return ResPatchObject{}, nil +} + func (m *mockClient) objectDelete(context.Context, PrmObjectDelete) error { return nil } diff --git a/pool/pool.go b/pool/pool.go index 8cfda26..9dd4eb5 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -66,6 +66,8 @@ type client interface { netMapSnapshot(context.Context, prmNetMapSnapshot) (netmap.NetMap, error) // see clientWrapper.objectPut. objectPut(context.Context, PrmObjectPut) (ResPutObject, error) + // see clientWrapper.objectPatch. + objectPatch(context.Context, PrmObjectPatch) (ResPatchObject, error) // see clientWrapper.objectDelete. objectDelete(context.Context, PrmObjectDelete) error // see clientWrapper.objectGet. @@ -160,6 +162,7 @@ const ( methodObjectGet methodObjectHead methodObjectRange + methodObjectPatch methodSessionCreate methodAPEManagerAddChain methodAPEManagerRemoveChain @@ -192,6 +195,8 @@ func (m MethodIndex) String() string { return "netMapSnapshot" case methodObjectPut: return "objectPut" + case methodObjectPatch: + return "objectPatch" case methodObjectDelete: return "objectDelete" case methodObjectGet: @@ -724,6 +729,44 @@ func (c *clientWrapper) netMapSnapshot(ctx context.Context, _ prmNetMapSnapshot) return res.NetMap(), nil } +// objectPatch patches object in FrostFS. +func (c *clientWrapper) objectPatch(ctx context.Context, prm PrmObjectPatch) (ResPatchObject, error) { + cl, err := c.getClient() + if err != nil { + return ResPatchObject{}, err + } + + start := time.Now() + pObj, err := cl.ObjectPatchInit(ctx, sdkClient.PrmObjectPatch{ + Address: prm.addr, + Session: prm.stoken, + Key: prm.key, + BearerToken: prm.btoken, + MaxChunkLength: prm.maxPayloadPatchChunkLength, + }) + if err = c.handleError(ctx, nil, err); err != nil { + return ResPatchObject{}, fmt.Errorf("init patching on API client: %w", err) + } + c.incRequests(time.Since(start), methodObjectPatch) + + start = time.Now() + attrPatchSuccess := pObj.PatchAttributes(ctx, prm.newAttrs, prm.replaceAttrs) + c.incRequests(time.Since(start), methodObjectPatch) + + if attrPatchSuccess { + start = time.Now() + _ = pObj.PatchPayload(ctx, prm.rng, prm.payload) + c.incRequests(time.Since(start), methodObjectPatch) + } + + res, err := pObj.Close(ctx) + if err = c.handleError(ctx, res.Status(), err); err != nil { + return ResPatchObject{}, fmt.Errorf("client failure: %w", err) + } + + return ResPatchObject{ObjectID: res.ObjectID()}, nil +} + // objectPut writes object to FrostFS. func (c *clientWrapper) objectPut(ctx context.Context, prm PrmObjectPut) (ResPutObject, error) { if prm.bufferMaxSize == 0 { @@ -1545,6 +1588,53 @@ func (x *PrmObjectPut) setNetworkInfo(ni netmap.NetworkInfo) { x.networkInfo = ni } +// PrmObjectPatch groups parameters of PatchObject operation. +type PrmObjectPatch struct { + prmCommon + + addr oid.Address + + rng *object.Range + + payload io.Reader + + newAttrs []object.Attribute + + replaceAttrs bool + + maxPayloadPatchChunkLength int +} + +// SetAddress sets the address of the object that is patched. +func (x *PrmObjectPatch) SetAddress(addr oid.Address) { + x.addr = addr +} + +// SetRange sets the patch's range. +func (x *PrmObjectPatch) SetRange(rng *object.Range) { + x.rng = rng +} + +// SetPayloadReader sets a payload reader. +func (x *PrmObjectPatch) SetPayloadReader(payload io.Reader) { + x.payload = payload +} + +// SetRange sets the new attributes to the patch. +func (x *PrmObjectPatch) SetNewAttributes(newAttrs []object.Attribute) { + x.newAttrs = newAttrs +} + +// SetRange sets the replace attributes flag to the patch. +func (x *PrmObjectPatch) SetReplaceAttributes(replaceAttrs bool) { + x.replaceAttrs = replaceAttrs +} + +// SetMaxPayloadPatchChunkSize sets a max buf size to read the patch's payload. +func (x *PrmObjectPatch) SetMaxPayloadPatchChunkSize(maxPayloadPatchChunkSize int) { + x.maxPayloadPatchChunkLength = maxPayloadPatchChunkSize +} + // PrmObjectDelete groups parameters of DeleteObject operation. type PrmObjectDelete struct { prmCommon @@ -2389,6 +2479,44 @@ type ResPutObject struct { Epoch uint64 } +// ResPatchObject is designed to provide identifier for the saved patched object. +type ResPatchObject struct { + ObjectID oid.ID +} + +// PatchObject patches an object through a remote server using FrostFS API protocol. +// +// Main return value MUST NOT be processed on an erroneous return. +func (p *Pool) PatchObject(ctx context.Context, prm PrmObjectPatch) (ResPatchObject, error) { + var prmCtx prmContext + prmCtx.useDefaultSession() + prmCtx.useVerb(session.VerbObjectPatch) + prmCtx.useContainer(prm.addr.Container()) + + p.fillAppropriateKey(&prm.prmCommon) + + var ctxCall callContext + if err := p.initCallContext(&ctxCall, prm.prmCommon, prmCtx); err != nil { + return ResPatchObject{}, fmt.Errorf("init call context: %w", err) + } + + if ctxCall.sessionDefault { + ctxCall.sessionTarget = prm.UseSession + if err := p.openDefaultSession(ctx, &ctxCall); err != nil { + return ResPatchObject{}, fmt.Errorf("open default session: %w", err) + } + } + + res, err := ctxCall.client.objectPatch(ctx, prm) + if err != nil { + // removes session token from cache in case of token error + p.checkSessionTokenErr(err, ctxCall.endpoint) + return ResPatchObject{}, fmt.Errorf("init patching on API client %s: %w", ctxCall.endpoint, err) + } + + return res, nil +} + // PutObject writes an object through a remote server using FrostFS API protocol. // // Main return value MUST NOT be processed on an erroneous return. From a15b1264f50692e6a2ef20ee21aabf82f50b7990 Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Thu, 20 Jun 2024 14:37:38 +0300 Subject: [PATCH 069/197] [#231] policy: Bump jre version to `17` Signed-off-by: Anton Nikiforov --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a4cfb15..9caf0c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ FROM golang:1.21 -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install make openjdk-11-jre -y +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install make openjdk-17-jre -y WORKDIR /work From 92c75961573a74ffadb37531975b523ff4822342 Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Wed, 7 Aug 2024 16:53:43 +0300 Subject: [PATCH 070/197] [#231] go.mod: Update version for `frostfs-api-go/v2` Signed-off-by: Anton Nikiforov --- go.mod | 7 +++---- go.sum | 18 ++++++------------ 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index da05e86..54b7b89 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.21 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240806093111-ebaf78c8faab + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240809081817-47a48969b067 git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 @@ -15,7 +15,7 @@ require ( github.com/nspcc-dev/neo-go v0.106.2 github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.27.0 - google.golang.org/grpc v1.62.0 + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -25,7 +25,6 @@ require ( git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.1 // indirect github.com/gorilla/websocket v1.5.1 // indirect github.com/klauspost/cpuid/v2 v2.2.6 // indirect @@ -43,5 +42,5 @@ require ( golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect ) diff --git a/go.sum b/go.sum index 0aa5474..b1ab86d 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240806093111-ebaf78c8faab h1:CXN7QBLcaiGoy/XnJEvsSxy58OBAikVO7jQBMB9Ze6k= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240806093111-ebaf78c8faab/go.mod h1:OBDSr+DqV1z4VDouoX3YMleNc4DPBVBWTG3WDT2PK1o= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240809081817-47a48969b067 h1:/da6lloTPujJgEYF/dgqbxY9h6TMaRHclOV9yvCcE8s= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240809081817-47a48969b067/go.mod h1:mc7j6Cc1GU1tJZNmDwEYiJJ339biNnU1Bz3wZGogMe0= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e h1:kcBqZBiFIUBATUqEuvVigtkJJWQ2Gug/eYXn967o3M4= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e/go.mod h1:F/fe1OoIDKr5Bz99q4sriuHDuf3aZefZy9ZsCqEtgxc= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= @@ -39,15 +39,11 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU 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.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -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/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 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.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 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/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= @@ -161,18 +157,16 @@ golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc 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/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= -google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= -google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +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 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.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -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.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 2077b357363a0225f448663e4937ae1f242d7113 Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Mon, 24 Jun 2024 14:45:59 +0300 Subject: [PATCH 071/197] [#231] netmap: Add `LIKE` operation for `filter` Signed-off-by: Anton Nikiforov --- doc/policy.md | 7 ++ netmap/filter.go | 18 +++- netmap/parser/QueryLexer.g4 | 2 +- netmap/parser/QueryLexer.interp | 2 +- netmap/parser/query_lexer.go | 184 ++++++++++++++++---------------- netmap/policy.go | 7 ++ netmap/policy_test.go | 5 + netmap/selector_test.go | 87 +++++++++++++++ netmap/yml_unmarshal.go | 19 ++-- 9 files changed, 228 insertions(+), 103 deletions(-) diff --git a/doc/policy.md b/doc/policy.md index 28744ef..0b87079 100644 --- a/doc/policy.md +++ b/doc/policy.md @@ -428,6 +428,13 @@ Comparison operators (all binary): - `LE`: less or equal - `LT`: less than +Pattern operator: +- `LIKE`: specifies pattern for an attribute. Uses as a wildcard symbol `*`. + - `... ATTR LIKE "VAL"` - the behaviour is equal to `EQ` + - `... ATTR LIKE "VAL*"` - matches all which starts with `VAL` + - `... ATTR LIKE "*VAL"` - matches all which ends with `VAL` + - `... ATTR LIKE "*VAL*"` - matches all which contains `VAL` + Logical operators: - `NOT`: negation (unary) - `AND`: conjunction (binary) diff --git a/netmap/filter.go b/netmap/filter.go index 71e101d..76d8545 100644 --- a/netmap/filter.go +++ b/netmap/filter.go @@ -3,6 +3,7 @@ package netmap import ( "fmt" "strconv" + "strings" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" ) @@ -11,6 +12,8 @@ import ( // which points to the whole netmap. const mainFilterName = "*" +const likeWildcard = "*" + // processFilters processes filters and returns error is any of them is invalid. func (c *context) processFilters(p PlacementPolicy) error { for i := range p.filters { @@ -53,7 +56,7 @@ func (c *context) processFilter(f netmap.Filter, top bool) error { } switch op { - case netmap.EQ, netmap.NE: + case netmap.EQ, netmap.NE, netmap.LIKE: case netmap.GT, netmap.GE, netmap.LT, netmap.LE: val := f.GetValue() n, err := strconv.ParseUint(val, 10, 64) @@ -110,6 +113,19 @@ func (c *context) matchKeyValue(f *netmap.Filter, b NodeInfo) bool { switch op := f.GetOp(); op { case netmap.EQ: return b.Attribute(f.GetKey()) == f.GetValue() + case netmap.LIKE: + str, prefix := strings.CutPrefix(f.GetValue(), likeWildcard) + str, suffix := strings.CutSuffix(str, likeWildcard) + if prefix && suffix { + return strings.Contains(b.Attribute(f.GetKey()), str) + } + if prefix && !suffix { + return strings.HasSuffix(b.Attribute(f.GetKey()), str) + } + if !prefix && suffix { + return strings.HasPrefix(b.Attribute(f.GetKey()), str) + } + return b.Attribute(f.GetKey()) == f.GetValue() case netmap.NE: return b.Attribute(f.GetKey()) != f.GetValue() default: diff --git a/netmap/parser/QueryLexer.g4 b/netmap/parser/QueryLexer.g4 index 3e4e924..200fbb6 100644 --- a/netmap/parser/QueryLexer.g4 +++ b/netmap/parser/QueryLexer.g4 @@ -3,7 +3,7 @@ lexer grammar QueryLexer; NOT_OP : 'NOT'; AND_OP : 'AND'; OR_OP : 'OR'; -SIMPLE_OP : 'EQ' | 'NE' | 'GE' | 'GT' | 'LT' | 'LE'; +SIMPLE_OP : 'EQ' | 'NE' | 'GE' | 'GT' | 'LT' | 'LE' | 'LIKE' ; UNIQUE : 'UNIQUE'; REP : 'REP'; diff --git a/netmap/parser/QueryLexer.interp b/netmap/parser/QueryLexer.interp index c4d6296..c339bdd 100644 --- a/netmap/parser/QueryLexer.interp +++ b/netmap/parser/QueryLexer.interp @@ -96,4 +96,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 25, 222, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 89, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 5, 20, 161, 8, 20, 10, 20, 12, 20, 164, 9, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 172, 8, 23, 10, 23, 12, 23, 175, 9, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 5, 25, 182, 8, 25, 10, 25, 12, 25, 185, 9, 25, 1, 25, 1, 25, 1, 25, 1, 25, 5, 25, 191, 8, 25, 10, 25, 12, 25, 194, 9, 25, 1, 25, 3, 25, 197, 8, 25, 1, 26, 1, 26, 1, 26, 3, 26, 202, 8, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 4, 31, 217, 8, 31, 11, 31, 12, 31, 218, 1, 31, 1, 31, 0, 0, 32, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 0, 45, 0, 47, 22, 49, 23, 51, 24, 53, 0, 55, 0, 57, 0, 59, 0, 61, 0, 63, 25, 1, 0, 8, 1, 0, 48, 57, 3, 0, 65, 90, 95, 95, 97, 122, 1, 0, 49, 57, 9, 0, 34, 34, 39, 39, 47, 47, 92, 92, 98, 98, 102, 102, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 3, 0, 0, 31, 39, 39, 92, 92, 3, 0, 0, 31, 34, 34, 92, 92, 3, 0, 9, 10, 13, 13, 32, 32, 229, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 1, 65, 1, 0, 0, 0, 3, 69, 1, 0, 0, 0, 5, 73, 1, 0, 0, 0, 7, 88, 1, 0, 0, 0, 9, 90, 1, 0, 0, 0, 11, 97, 1, 0, 0, 0, 13, 101, 1, 0, 0, 0, 15, 104, 1, 0, 0, 0, 17, 107, 1, 0, 0, 0, 19, 110, 1, 0, 0, 0, 21, 114, 1, 0, 0, 0, 23, 121, 1, 0, 0, 0, 25, 126, 1, 0, 0, 0, 27, 133, 1, 0, 0, 0, 29, 135, 1, 0, 0, 0, 31, 137, 1, 0, 0, 0, 33, 142, 1, 0, 0, 0, 35, 151, 1, 0, 0, 0, 37, 153, 1, 0, 0, 0, 39, 155, 1, 0, 0, 0, 41, 157, 1, 0, 0, 0, 43, 165, 1, 0, 0, 0, 45, 167, 1, 0, 0, 0, 47, 169, 1, 0, 0, 0, 49, 176, 1, 0, 0, 0, 51, 196, 1, 0, 0, 0, 53, 198, 1, 0, 0, 0, 55, 203, 1, 0, 0, 0, 57, 209, 1, 0, 0, 0, 59, 211, 1, 0, 0, 0, 61, 213, 1, 0, 0, 0, 63, 216, 1, 0, 0, 0, 65, 66, 5, 78, 0, 0, 66, 67, 5, 79, 0, 0, 67, 68, 5, 84, 0, 0, 68, 2, 1, 0, 0, 0, 69, 70, 5, 65, 0, 0, 70, 71, 5, 78, 0, 0, 71, 72, 5, 68, 0, 0, 72, 4, 1, 0, 0, 0, 73, 74, 5, 79, 0, 0, 74, 75, 5, 82, 0, 0, 75, 6, 1, 0, 0, 0, 76, 77, 5, 69, 0, 0, 77, 89, 5, 81, 0, 0, 78, 79, 5, 78, 0, 0, 79, 89, 5, 69, 0, 0, 80, 81, 5, 71, 0, 0, 81, 89, 5, 69, 0, 0, 82, 83, 5, 71, 0, 0, 83, 89, 5, 84, 0, 0, 84, 85, 5, 76, 0, 0, 85, 89, 5, 84, 0, 0, 86, 87, 5, 76, 0, 0, 87, 89, 5, 69, 0, 0, 88, 76, 1, 0, 0, 0, 88, 78, 1, 0, 0, 0, 88, 80, 1, 0, 0, 0, 88, 82, 1, 0, 0, 0, 88, 84, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 89, 8, 1, 0, 0, 0, 90, 91, 5, 85, 0, 0, 91, 92, 5, 78, 0, 0, 92, 93, 5, 73, 0, 0, 93, 94, 5, 81, 0, 0, 94, 95, 5, 85, 0, 0, 95, 96, 5, 69, 0, 0, 96, 10, 1, 0, 0, 0, 97, 98, 5, 82, 0, 0, 98, 99, 5, 69, 0, 0, 99, 100, 5, 80, 0, 0, 100, 12, 1, 0, 0, 0, 101, 102, 5, 69, 0, 0, 102, 103, 5, 67, 0, 0, 103, 14, 1, 0, 0, 0, 104, 105, 5, 73, 0, 0, 105, 106, 5, 78, 0, 0, 106, 16, 1, 0, 0, 0, 107, 108, 5, 65, 0, 0, 108, 109, 5, 83, 0, 0, 109, 18, 1, 0, 0, 0, 110, 111, 5, 67, 0, 0, 111, 112, 5, 66, 0, 0, 112, 113, 5, 70, 0, 0, 113, 20, 1, 0, 0, 0, 114, 115, 5, 83, 0, 0, 115, 116, 5, 69, 0, 0, 116, 117, 5, 76, 0, 0, 117, 118, 5, 69, 0, 0, 118, 119, 5, 67, 0, 0, 119, 120, 5, 84, 0, 0, 120, 22, 1, 0, 0, 0, 121, 122, 5, 70, 0, 0, 122, 123, 5, 82, 0, 0, 123, 124, 5, 79, 0, 0, 124, 125, 5, 77, 0, 0, 125, 24, 1, 0, 0, 0, 126, 127, 5, 70, 0, 0, 127, 128, 5, 73, 0, 0, 128, 129, 5, 76, 0, 0, 129, 130, 5, 84, 0, 0, 130, 131, 5, 69, 0, 0, 131, 132, 5, 82, 0, 0, 132, 26, 1, 0, 0, 0, 133, 134, 5, 42, 0, 0, 134, 28, 1, 0, 0, 0, 135, 136, 5, 46, 0, 0, 136, 30, 1, 0, 0, 0, 137, 138, 5, 83, 0, 0, 138, 139, 5, 65, 0, 0, 139, 140, 5, 77, 0, 0, 140, 141, 5, 69, 0, 0, 141, 32, 1, 0, 0, 0, 142, 143, 5, 68, 0, 0, 143, 144, 5, 73, 0, 0, 144, 145, 5, 83, 0, 0, 145, 146, 5, 84, 0, 0, 146, 147, 5, 73, 0, 0, 147, 148, 5, 78, 0, 0, 148, 149, 5, 67, 0, 0, 149, 150, 5, 84, 0, 0, 150, 34, 1, 0, 0, 0, 151, 152, 5, 40, 0, 0, 152, 36, 1, 0, 0, 0, 153, 154, 5, 41, 0, 0, 154, 38, 1, 0, 0, 0, 155, 156, 5, 64, 0, 0, 156, 40, 1, 0, 0, 0, 157, 162, 3, 45, 22, 0, 158, 161, 3, 43, 21, 0, 159, 161, 3, 45, 22, 0, 160, 158, 1, 0, 0, 0, 160, 159, 1, 0, 0, 0, 161, 164, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 42, 1, 0, 0, 0, 164, 162, 1, 0, 0, 0, 165, 166, 7, 0, 0, 0, 166, 44, 1, 0, 0, 0, 167, 168, 7, 1, 0, 0, 168, 46, 1, 0, 0, 0, 169, 173, 7, 2, 0, 0, 170, 172, 3, 43, 21, 0, 171, 170, 1, 0, 0, 0, 172, 175, 1, 0, 0, 0, 173, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 48, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 176, 177, 5, 48, 0, 0, 177, 50, 1, 0, 0, 0, 178, 183, 5, 34, 0, 0, 179, 182, 3, 53, 26, 0, 180, 182, 3, 61, 30, 0, 181, 179, 1, 0, 0, 0, 181, 180, 1, 0, 0, 0, 182, 185, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 186, 1, 0, 0, 0, 185, 183, 1, 0, 0, 0, 186, 197, 5, 34, 0, 0, 187, 192, 5, 39, 0, 0, 188, 191, 3, 53, 26, 0, 189, 191, 3, 59, 29, 0, 190, 188, 1, 0, 0, 0, 190, 189, 1, 0, 0, 0, 191, 194, 1, 0, 0, 0, 192, 190, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 195, 1, 0, 0, 0, 194, 192, 1, 0, 0, 0, 195, 197, 5, 39, 0, 0, 196, 178, 1, 0, 0, 0, 196, 187, 1, 0, 0, 0, 197, 52, 1, 0, 0, 0, 198, 201, 5, 92, 0, 0, 199, 202, 7, 3, 0, 0, 200, 202, 3, 55, 27, 0, 201, 199, 1, 0, 0, 0, 201, 200, 1, 0, 0, 0, 202, 54, 1, 0, 0, 0, 203, 204, 5, 117, 0, 0, 204, 205, 3, 57, 28, 0, 205, 206, 3, 57, 28, 0, 206, 207, 3, 57, 28, 0, 207, 208, 3, 57, 28, 0, 208, 56, 1, 0, 0, 0, 209, 210, 7, 4, 0, 0, 210, 58, 1, 0, 0, 0, 211, 212, 8, 5, 0, 0, 212, 60, 1, 0, 0, 0, 213, 214, 8, 6, 0, 0, 214, 62, 1, 0, 0, 0, 215, 217, 7, 7, 0, 0, 216, 215, 1, 0, 0, 0, 217, 218, 1, 0, 0, 0, 218, 216, 1, 0, 0, 0, 218, 219, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 221, 6, 31, 0, 0, 221, 64, 1, 0, 0, 0, 12, 0, 88, 160, 162, 173, 181, 183, 190, 192, 196, 201, 218, 1, 6, 0, 0] \ No newline at end of file +[4, 0, 25, 226, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 93, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 5, 20, 165, 8, 20, 10, 20, 12, 20, 168, 9, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 176, 8, 23, 10, 23, 12, 23, 179, 9, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 5, 25, 186, 8, 25, 10, 25, 12, 25, 189, 9, 25, 1, 25, 1, 25, 1, 25, 1, 25, 5, 25, 195, 8, 25, 10, 25, 12, 25, 198, 9, 25, 1, 25, 3, 25, 201, 8, 25, 1, 26, 1, 26, 1, 26, 3, 26, 206, 8, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 4, 31, 221, 8, 31, 11, 31, 12, 31, 222, 1, 31, 1, 31, 0, 0, 32, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 0, 45, 0, 47, 22, 49, 23, 51, 24, 53, 0, 55, 0, 57, 0, 59, 0, 61, 0, 63, 25, 1, 0, 8, 1, 0, 48, 57, 3, 0, 65, 90, 95, 95, 97, 122, 1, 0, 49, 57, 9, 0, 34, 34, 39, 39, 47, 47, 92, 92, 98, 98, 102, 102, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 3, 0, 0, 31, 39, 39, 92, 92, 3, 0, 0, 31, 34, 34, 92, 92, 3, 0, 9, 10, 13, 13, 32, 32, 234, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 1, 65, 1, 0, 0, 0, 3, 69, 1, 0, 0, 0, 5, 73, 1, 0, 0, 0, 7, 92, 1, 0, 0, 0, 9, 94, 1, 0, 0, 0, 11, 101, 1, 0, 0, 0, 13, 105, 1, 0, 0, 0, 15, 108, 1, 0, 0, 0, 17, 111, 1, 0, 0, 0, 19, 114, 1, 0, 0, 0, 21, 118, 1, 0, 0, 0, 23, 125, 1, 0, 0, 0, 25, 130, 1, 0, 0, 0, 27, 137, 1, 0, 0, 0, 29, 139, 1, 0, 0, 0, 31, 141, 1, 0, 0, 0, 33, 146, 1, 0, 0, 0, 35, 155, 1, 0, 0, 0, 37, 157, 1, 0, 0, 0, 39, 159, 1, 0, 0, 0, 41, 161, 1, 0, 0, 0, 43, 169, 1, 0, 0, 0, 45, 171, 1, 0, 0, 0, 47, 173, 1, 0, 0, 0, 49, 180, 1, 0, 0, 0, 51, 200, 1, 0, 0, 0, 53, 202, 1, 0, 0, 0, 55, 207, 1, 0, 0, 0, 57, 213, 1, 0, 0, 0, 59, 215, 1, 0, 0, 0, 61, 217, 1, 0, 0, 0, 63, 220, 1, 0, 0, 0, 65, 66, 5, 78, 0, 0, 66, 67, 5, 79, 0, 0, 67, 68, 5, 84, 0, 0, 68, 2, 1, 0, 0, 0, 69, 70, 5, 65, 0, 0, 70, 71, 5, 78, 0, 0, 71, 72, 5, 68, 0, 0, 72, 4, 1, 0, 0, 0, 73, 74, 5, 79, 0, 0, 74, 75, 5, 82, 0, 0, 75, 6, 1, 0, 0, 0, 76, 77, 5, 69, 0, 0, 77, 93, 5, 81, 0, 0, 78, 79, 5, 78, 0, 0, 79, 93, 5, 69, 0, 0, 80, 81, 5, 71, 0, 0, 81, 93, 5, 69, 0, 0, 82, 83, 5, 71, 0, 0, 83, 93, 5, 84, 0, 0, 84, 85, 5, 76, 0, 0, 85, 93, 5, 84, 0, 0, 86, 87, 5, 76, 0, 0, 87, 93, 5, 69, 0, 0, 88, 89, 5, 76, 0, 0, 89, 90, 5, 73, 0, 0, 90, 91, 5, 75, 0, 0, 91, 93, 5, 69, 0, 0, 92, 76, 1, 0, 0, 0, 92, 78, 1, 0, 0, 0, 92, 80, 1, 0, 0, 0, 92, 82, 1, 0, 0, 0, 92, 84, 1, 0, 0, 0, 92, 86, 1, 0, 0, 0, 92, 88, 1, 0, 0, 0, 93, 8, 1, 0, 0, 0, 94, 95, 5, 85, 0, 0, 95, 96, 5, 78, 0, 0, 96, 97, 5, 73, 0, 0, 97, 98, 5, 81, 0, 0, 98, 99, 5, 85, 0, 0, 99, 100, 5, 69, 0, 0, 100, 10, 1, 0, 0, 0, 101, 102, 5, 82, 0, 0, 102, 103, 5, 69, 0, 0, 103, 104, 5, 80, 0, 0, 104, 12, 1, 0, 0, 0, 105, 106, 5, 69, 0, 0, 106, 107, 5, 67, 0, 0, 107, 14, 1, 0, 0, 0, 108, 109, 5, 73, 0, 0, 109, 110, 5, 78, 0, 0, 110, 16, 1, 0, 0, 0, 111, 112, 5, 65, 0, 0, 112, 113, 5, 83, 0, 0, 113, 18, 1, 0, 0, 0, 114, 115, 5, 67, 0, 0, 115, 116, 5, 66, 0, 0, 116, 117, 5, 70, 0, 0, 117, 20, 1, 0, 0, 0, 118, 119, 5, 83, 0, 0, 119, 120, 5, 69, 0, 0, 120, 121, 5, 76, 0, 0, 121, 122, 5, 69, 0, 0, 122, 123, 5, 67, 0, 0, 123, 124, 5, 84, 0, 0, 124, 22, 1, 0, 0, 0, 125, 126, 5, 70, 0, 0, 126, 127, 5, 82, 0, 0, 127, 128, 5, 79, 0, 0, 128, 129, 5, 77, 0, 0, 129, 24, 1, 0, 0, 0, 130, 131, 5, 70, 0, 0, 131, 132, 5, 73, 0, 0, 132, 133, 5, 76, 0, 0, 133, 134, 5, 84, 0, 0, 134, 135, 5, 69, 0, 0, 135, 136, 5, 82, 0, 0, 136, 26, 1, 0, 0, 0, 137, 138, 5, 42, 0, 0, 138, 28, 1, 0, 0, 0, 139, 140, 5, 46, 0, 0, 140, 30, 1, 0, 0, 0, 141, 142, 5, 83, 0, 0, 142, 143, 5, 65, 0, 0, 143, 144, 5, 77, 0, 0, 144, 145, 5, 69, 0, 0, 145, 32, 1, 0, 0, 0, 146, 147, 5, 68, 0, 0, 147, 148, 5, 73, 0, 0, 148, 149, 5, 83, 0, 0, 149, 150, 5, 84, 0, 0, 150, 151, 5, 73, 0, 0, 151, 152, 5, 78, 0, 0, 152, 153, 5, 67, 0, 0, 153, 154, 5, 84, 0, 0, 154, 34, 1, 0, 0, 0, 155, 156, 5, 40, 0, 0, 156, 36, 1, 0, 0, 0, 157, 158, 5, 41, 0, 0, 158, 38, 1, 0, 0, 0, 159, 160, 5, 64, 0, 0, 160, 40, 1, 0, 0, 0, 161, 166, 3, 45, 22, 0, 162, 165, 3, 43, 21, 0, 163, 165, 3, 45, 22, 0, 164, 162, 1, 0, 0, 0, 164, 163, 1, 0, 0, 0, 165, 168, 1, 0, 0, 0, 166, 164, 1, 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 42, 1, 0, 0, 0, 168, 166, 1, 0, 0, 0, 169, 170, 7, 0, 0, 0, 170, 44, 1, 0, 0, 0, 171, 172, 7, 1, 0, 0, 172, 46, 1, 0, 0, 0, 173, 177, 7, 2, 0, 0, 174, 176, 3, 43, 21, 0, 175, 174, 1, 0, 0, 0, 176, 179, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 48, 1, 0, 0, 0, 179, 177, 1, 0, 0, 0, 180, 181, 5, 48, 0, 0, 181, 50, 1, 0, 0, 0, 182, 187, 5, 34, 0, 0, 183, 186, 3, 53, 26, 0, 184, 186, 3, 61, 30, 0, 185, 183, 1, 0, 0, 0, 185, 184, 1, 0, 0, 0, 186, 189, 1, 0, 0, 0, 187, 185, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 190, 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 190, 201, 5, 34, 0, 0, 191, 196, 5, 39, 0, 0, 192, 195, 3, 53, 26, 0, 193, 195, 3, 59, 29, 0, 194, 192, 1, 0, 0, 0, 194, 193, 1, 0, 0, 0, 195, 198, 1, 0, 0, 0, 196, 194, 1, 0, 0, 0, 196, 197, 1, 0, 0, 0, 197, 199, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 199, 201, 5, 39, 0, 0, 200, 182, 1, 0, 0, 0, 200, 191, 1, 0, 0, 0, 201, 52, 1, 0, 0, 0, 202, 205, 5, 92, 0, 0, 203, 206, 7, 3, 0, 0, 204, 206, 3, 55, 27, 0, 205, 203, 1, 0, 0, 0, 205, 204, 1, 0, 0, 0, 206, 54, 1, 0, 0, 0, 207, 208, 5, 117, 0, 0, 208, 209, 3, 57, 28, 0, 209, 210, 3, 57, 28, 0, 210, 211, 3, 57, 28, 0, 211, 212, 3, 57, 28, 0, 212, 56, 1, 0, 0, 0, 213, 214, 7, 4, 0, 0, 214, 58, 1, 0, 0, 0, 215, 216, 8, 5, 0, 0, 216, 60, 1, 0, 0, 0, 217, 218, 8, 6, 0, 0, 218, 62, 1, 0, 0, 0, 219, 221, 7, 7, 0, 0, 220, 219, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 220, 1, 0, 0, 0, 222, 223, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 225, 6, 31, 0, 0, 225, 64, 1, 0, 0, 0, 12, 0, 92, 164, 166, 177, 185, 187, 194, 196, 200, 205, 222, 1, 6, 0, 0] \ No newline at end of file diff --git a/netmap/parser/query_lexer.go b/netmap/parser/query_lexer.go index 85a0336..43fc173 100644 --- a/netmap/parser/query_lexer.go +++ b/netmap/parser/query_lexer.go @@ -62,7 +62,7 @@ func querylexerLexerInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 25, 222, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 0, 25, 226, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, @@ -70,96 +70,98 @@ func querylexerLexerInit() { 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, - 1, 3, 3, 3, 89, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, - 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, - 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, - 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, - 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, - 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, - 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 5, 20, 161, 8, 20, 10, - 20, 12, 20, 164, 9, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, - 172, 8, 23, 10, 23, 12, 23, 175, 9, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, - 25, 5, 25, 182, 8, 25, 10, 25, 12, 25, 185, 9, 25, 1, 25, 1, 25, 1, 25, - 1, 25, 5, 25, 191, 8, 25, 10, 25, 12, 25, 194, 9, 25, 1, 25, 3, 25, 197, - 8, 25, 1, 26, 1, 26, 1, 26, 3, 26, 202, 8, 26, 1, 27, 1, 27, 1, 27, 1, - 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 4, 31, - 217, 8, 31, 11, 31, 12, 31, 218, 1, 31, 1, 31, 0, 0, 32, 1, 1, 3, 2, 5, - 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, - 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, - 0, 45, 0, 47, 22, 49, 23, 51, 24, 53, 0, 55, 0, 57, 0, 59, 0, 61, 0, 63, - 25, 1, 0, 8, 1, 0, 48, 57, 3, 0, 65, 90, 95, 95, 97, 122, 1, 0, 49, 57, - 9, 0, 34, 34, 39, 39, 47, 47, 92, 92, 98, 98, 102, 102, 110, 110, 114, - 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 3, 0, 0, 31, 39, 39, 92, - 92, 3, 0, 0, 31, 34, 34, 92, 92, 3, 0, 9, 10, 13, 13, 32, 32, 229, 0, 1, - 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, - 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, - 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, - 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, - 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, - 0, 0, 0, 41, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, - 0, 0, 0, 0, 63, 1, 0, 0, 0, 1, 65, 1, 0, 0, 0, 3, 69, 1, 0, 0, 0, 5, 73, - 1, 0, 0, 0, 7, 88, 1, 0, 0, 0, 9, 90, 1, 0, 0, 0, 11, 97, 1, 0, 0, 0, 13, - 101, 1, 0, 0, 0, 15, 104, 1, 0, 0, 0, 17, 107, 1, 0, 0, 0, 19, 110, 1, - 0, 0, 0, 21, 114, 1, 0, 0, 0, 23, 121, 1, 0, 0, 0, 25, 126, 1, 0, 0, 0, - 27, 133, 1, 0, 0, 0, 29, 135, 1, 0, 0, 0, 31, 137, 1, 0, 0, 0, 33, 142, - 1, 0, 0, 0, 35, 151, 1, 0, 0, 0, 37, 153, 1, 0, 0, 0, 39, 155, 1, 0, 0, - 0, 41, 157, 1, 0, 0, 0, 43, 165, 1, 0, 0, 0, 45, 167, 1, 0, 0, 0, 47, 169, - 1, 0, 0, 0, 49, 176, 1, 0, 0, 0, 51, 196, 1, 0, 0, 0, 53, 198, 1, 0, 0, - 0, 55, 203, 1, 0, 0, 0, 57, 209, 1, 0, 0, 0, 59, 211, 1, 0, 0, 0, 61, 213, - 1, 0, 0, 0, 63, 216, 1, 0, 0, 0, 65, 66, 5, 78, 0, 0, 66, 67, 5, 79, 0, - 0, 67, 68, 5, 84, 0, 0, 68, 2, 1, 0, 0, 0, 69, 70, 5, 65, 0, 0, 70, 71, - 5, 78, 0, 0, 71, 72, 5, 68, 0, 0, 72, 4, 1, 0, 0, 0, 73, 74, 5, 79, 0, - 0, 74, 75, 5, 82, 0, 0, 75, 6, 1, 0, 0, 0, 76, 77, 5, 69, 0, 0, 77, 89, - 5, 81, 0, 0, 78, 79, 5, 78, 0, 0, 79, 89, 5, 69, 0, 0, 80, 81, 5, 71, 0, - 0, 81, 89, 5, 69, 0, 0, 82, 83, 5, 71, 0, 0, 83, 89, 5, 84, 0, 0, 84, 85, - 5, 76, 0, 0, 85, 89, 5, 84, 0, 0, 86, 87, 5, 76, 0, 0, 87, 89, 5, 69, 0, - 0, 88, 76, 1, 0, 0, 0, 88, 78, 1, 0, 0, 0, 88, 80, 1, 0, 0, 0, 88, 82, - 1, 0, 0, 0, 88, 84, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 89, 8, 1, 0, 0, 0, - 90, 91, 5, 85, 0, 0, 91, 92, 5, 78, 0, 0, 92, 93, 5, 73, 0, 0, 93, 94, - 5, 81, 0, 0, 94, 95, 5, 85, 0, 0, 95, 96, 5, 69, 0, 0, 96, 10, 1, 0, 0, - 0, 97, 98, 5, 82, 0, 0, 98, 99, 5, 69, 0, 0, 99, 100, 5, 80, 0, 0, 100, - 12, 1, 0, 0, 0, 101, 102, 5, 69, 0, 0, 102, 103, 5, 67, 0, 0, 103, 14, - 1, 0, 0, 0, 104, 105, 5, 73, 0, 0, 105, 106, 5, 78, 0, 0, 106, 16, 1, 0, - 0, 0, 107, 108, 5, 65, 0, 0, 108, 109, 5, 83, 0, 0, 109, 18, 1, 0, 0, 0, - 110, 111, 5, 67, 0, 0, 111, 112, 5, 66, 0, 0, 112, 113, 5, 70, 0, 0, 113, - 20, 1, 0, 0, 0, 114, 115, 5, 83, 0, 0, 115, 116, 5, 69, 0, 0, 116, 117, - 5, 76, 0, 0, 117, 118, 5, 69, 0, 0, 118, 119, 5, 67, 0, 0, 119, 120, 5, - 84, 0, 0, 120, 22, 1, 0, 0, 0, 121, 122, 5, 70, 0, 0, 122, 123, 5, 82, - 0, 0, 123, 124, 5, 79, 0, 0, 124, 125, 5, 77, 0, 0, 125, 24, 1, 0, 0, 0, - 126, 127, 5, 70, 0, 0, 127, 128, 5, 73, 0, 0, 128, 129, 5, 76, 0, 0, 129, - 130, 5, 84, 0, 0, 130, 131, 5, 69, 0, 0, 131, 132, 5, 82, 0, 0, 132, 26, - 1, 0, 0, 0, 133, 134, 5, 42, 0, 0, 134, 28, 1, 0, 0, 0, 135, 136, 5, 46, - 0, 0, 136, 30, 1, 0, 0, 0, 137, 138, 5, 83, 0, 0, 138, 139, 5, 65, 0, 0, - 139, 140, 5, 77, 0, 0, 140, 141, 5, 69, 0, 0, 141, 32, 1, 0, 0, 0, 142, - 143, 5, 68, 0, 0, 143, 144, 5, 73, 0, 0, 144, 145, 5, 83, 0, 0, 145, 146, - 5, 84, 0, 0, 146, 147, 5, 73, 0, 0, 147, 148, 5, 78, 0, 0, 148, 149, 5, - 67, 0, 0, 149, 150, 5, 84, 0, 0, 150, 34, 1, 0, 0, 0, 151, 152, 5, 40, - 0, 0, 152, 36, 1, 0, 0, 0, 153, 154, 5, 41, 0, 0, 154, 38, 1, 0, 0, 0, - 155, 156, 5, 64, 0, 0, 156, 40, 1, 0, 0, 0, 157, 162, 3, 45, 22, 0, 158, - 161, 3, 43, 21, 0, 159, 161, 3, 45, 22, 0, 160, 158, 1, 0, 0, 0, 160, 159, - 1, 0, 0, 0, 161, 164, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 162, 163, 1, 0, - 0, 0, 163, 42, 1, 0, 0, 0, 164, 162, 1, 0, 0, 0, 165, 166, 7, 0, 0, 0, - 166, 44, 1, 0, 0, 0, 167, 168, 7, 1, 0, 0, 168, 46, 1, 0, 0, 0, 169, 173, - 7, 2, 0, 0, 170, 172, 3, 43, 21, 0, 171, 170, 1, 0, 0, 0, 172, 175, 1, - 0, 0, 0, 173, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 48, 1, 0, 0, - 0, 175, 173, 1, 0, 0, 0, 176, 177, 5, 48, 0, 0, 177, 50, 1, 0, 0, 0, 178, - 183, 5, 34, 0, 0, 179, 182, 3, 53, 26, 0, 180, 182, 3, 61, 30, 0, 181, - 179, 1, 0, 0, 0, 181, 180, 1, 0, 0, 0, 182, 185, 1, 0, 0, 0, 183, 181, - 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 186, 1, 0, 0, 0, 185, 183, 1, 0, - 0, 0, 186, 197, 5, 34, 0, 0, 187, 192, 5, 39, 0, 0, 188, 191, 3, 53, 26, - 0, 189, 191, 3, 59, 29, 0, 190, 188, 1, 0, 0, 0, 190, 189, 1, 0, 0, 0, - 191, 194, 1, 0, 0, 0, 192, 190, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, - 195, 1, 0, 0, 0, 194, 192, 1, 0, 0, 0, 195, 197, 5, 39, 0, 0, 196, 178, - 1, 0, 0, 0, 196, 187, 1, 0, 0, 0, 197, 52, 1, 0, 0, 0, 198, 201, 5, 92, - 0, 0, 199, 202, 7, 3, 0, 0, 200, 202, 3, 55, 27, 0, 201, 199, 1, 0, 0, - 0, 201, 200, 1, 0, 0, 0, 202, 54, 1, 0, 0, 0, 203, 204, 5, 117, 0, 0, 204, - 205, 3, 57, 28, 0, 205, 206, 3, 57, 28, 0, 206, 207, 3, 57, 28, 0, 207, - 208, 3, 57, 28, 0, 208, 56, 1, 0, 0, 0, 209, 210, 7, 4, 0, 0, 210, 58, - 1, 0, 0, 0, 211, 212, 8, 5, 0, 0, 212, 60, 1, 0, 0, 0, 213, 214, 8, 6, - 0, 0, 214, 62, 1, 0, 0, 0, 215, 217, 7, 7, 0, 0, 216, 215, 1, 0, 0, 0, - 217, 218, 1, 0, 0, 0, 218, 216, 1, 0, 0, 0, 218, 219, 1, 0, 0, 0, 219, - 220, 1, 0, 0, 0, 220, 221, 6, 31, 0, 0, 221, 64, 1, 0, 0, 0, 12, 0, 88, - 160, 162, 173, 181, 183, 190, 192, 196, 201, 218, 1, 6, 0, 0, + 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 93, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, + 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, + 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, + 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, + 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, + 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, + 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, + 5, 20, 165, 8, 20, 10, 20, 12, 20, 168, 9, 20, 1, 21, 1, 21, 1, 22, 1, + 22, 1, 23, 1, 23, 5, 23, 176, 8, 23, 10, 23, 12, 23, 179, 9, 23, 1, 24, + 1, 24, 1, 25, 1, 25, 1, 25, 5, 25, 186, 8, 25, 10, 25, 12, 25, 189, 9, + 25, 1, 25, 1, 25, 1, 25, 1, 25, 5, 25, 195, 8, 25, 10, 25, 12, 25, 198, + 9, 25, 1, 25, 3, 25, 201, 8, 25, 1, 26, 1, 26, 1, 26, 3, 26, 206, 8, 26, + 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, + 30, 1, 30, 1, 31, 4, 31, 221, 8, 31, 11, 31, 12, 31, 222, 1, 31, 1, 31, + 0, 0, 32, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, + 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, + 19, 39, 20, 41, 21, 43, 0, 45, 0, 47, 22, 49, 23, 51, 24, 53, 0, 55, 0, + 57, 0, 59, 0, 61, 0, 63, 25, 1, 0, 8, 1, 0, 48, 57, 3, 0, 65, 90, 95, 95, + 97, 122, 1, 0, 49, 57, 9, 0, 34, 34, 39, 39, 47, 47, 92, 92, 98, 98, 102, + 102, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 3, 0, + 0, 31, 39, 39, 92, 92, 3, 0, 0, 31, 34, 34, 92, 92, 3, 0, 9, 10, 13, 13, + 32, 32, 234, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, + 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, + 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, + 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, + 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, + 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, + 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 1, 65, 1, 0, 0, 0, 3, 69, + 1, 0, 0, 0, 5, 73, 1, 0, 0, 0, 7, 92, 1, 0, 0, 0, 9, 94, 1, 0, 0, 0, 11, + 101, 1, 0, 0, 0, 13, 105, 1, 0, 0, 0, 15, 108, 1, 0, 0, 0, 17, 111, 1, + 0, 0, 0, 19, 114, 1, 0, 0, 0, 21, 118, 1, 0, 0, 0, 23, 125, 1, 0, 0, 0, + 25, 130, 1, 0, 0, 0, 27, 137, 1, 0, 0, 0, 29, 139, 1, 0, 0, 0, 31, 141, + 1, 0, 0, 0, 33, 146, 1, 0, 0, 0, 35, 155, 1, 0, 0, 0, 37, 157, 1, 0, 0, + 0, 39, 159, 1, 0, 0, 0, 41, 161, 1, 0, 0, 0, 43, 169, 1, 0, 0, 0, 45, 171, + 1, 0, 0, 0, 47, 173, 1, 0, 0, 0, 49, 180, 1, 0, 0, 0, 51, 200, 1, 0, 0, + 0, 53, 202, 1, 0, 0, 0, 55, 207, 1, 0, 0, 0, 57, 213, 1, 0, 0, 0, 59, 215, + 1, 0, 0, 0, 61, 217, 1, 0, 0, 0, 63, 220, 1, 0, 0, 0, 65, 66, 5, 78, 0, + 0, 66, 67, 5, 79, 0, 0, 67, 68, 5, 84, 0, 0, 68, 2, 1, 0, 0, 0, 69, 70, + 5, 65, 0, 0, 70, 71, 5, 78, 0, 0, 71, 72, 5, 68, 0, 0, 72, 4, 1, 0, 0, + 0, 73, 74, 5, 79, 0, 0, 74, 75, 5, 82, 0, 0, 75, 6, 1, 0, 0, 0, 76, 77, + 5, 69, 0, 0, 77, 93, 5, 81, 0, 0, 78, 79, 5, 78, 0, 0, 79, 93, 5, 69, 0, + 0, 80, 81, 5, 71, 0, 0, 81, 93, 5, 69, 0, 0, 82, 83, 5, 71, 0, 0, 83, 93, + 5, 84, 0, 0, 84, 85, 5, 76, 0, 0, 85, 93, 5, 84, 0, 0, 86, 87, 5, 76, 0, + 0, 87, 93, 5, 69, 0, 0, 88, 89, 5, 76, 0, 0, 89, 90, 5, 73, 0, 0, 90, 91, + 5, 75, 0, 0, 91, 93, 5, 69, 0, 0, 92, 76, 1, 0, 0, 0, 92, 78, 1, 0, 0, + 0, 92, 80, 1, 0, 0, 0, 92, 82, 1, 0, 0, 0, 92, 84, 1, 0, 0, 0, 92, 86, + 1, 0, 0, 0, 92, 88, 1, 0, 0, 0, 93, 8, 1, 0, 0, 0, 94, 95, 5, 85, 0, 0, + 95, 96, 5, 78, 0, 0, 96, 97, 5, 73, 0, 0, 97, 98, 5, 81, 0, 0, 98, 99, + 5, 85, 0, 0, 99, 100, 5, 69, 0, 0, 100, 10, 1, 0, 0, 0, 101, 102, 5, 82, + 0, 0, 102, 103, 5, 69, 0, 0, 103, 104, 5, 80, 0, 0, 104, 12, 1, 0, 0, 0, + 105, 106, 5, 69, 0, 0, 106, 107, 5, 67, 0, 0, 107, 14, 1, 0, 0, 0, 108, + 109, 5, 73, 0, 0, 109, 110, 5, 78, 0, 0, 110, 16, 1, 0, 0, 0, 111, 112, + 5, 65, 0, 0, 112, 113, 5, 83, 0, 0, 113, 18, 1, 0, 0, 0, 114, 115, 5, 67, + 0, 0, 115, 116, 5, 66, 0, 0, 116, 117, 5, 70, 0, 0, 117, 20, 1, 0, 0, 0, + 118, 119, 5, 83, 0, 0, 119, 120, 5, 69, 0, 0, 120, 121, 5, 76, 0, 0, 121, + 122, 5, 69, 0, 0, 122, 123, 5, 67, 0, 0, 123, 124, 5, 84, 0, 0, 124, 22, + 1, 0, 0, 0, 125, 126, 5, 70, 0, 0, 126, 127, 5, 82, 0, 0, 127, 128, 5, + 79, 0, 0, 128, 129, 5, 77, 0, 0, 129, 24, 1, 0, 0, 0, 130, 131, 5, 70, + 0, 0, 131, 132, 5, 73, 0, 0, 132, 133, 5, 76, 0, 0, 133, 134, 5, 84, 0, + 0, 134, 135, 5, 69, 0, 0, 135, 136, 5, 82, 0, 0, 136, 26, 1, 0, 0, 0, 137, + 138, 5, 42, 0, 0, 138, 28, 1, 0, 0, 0, 139, 140, 5, 46, 0, 0, 140, 30, + 1, 0, 0, 0, 141, 142, 5, 83, 0, 0, 142, 143, 5, 65, 0, 0, 143, 144, 5, + 77, 0, 0, 144, 145, 5, 69, 0, 0, 145, 32, 1, 0, 0, 0, 146, 147, 5, 68, + 0, 0, 147, 148, 5, 73, 0, 0, 148, 149, 5, 83, 0, 0, 149, 150, 5, 84, 0, + 0, 150, 151, 5, 73, 0, 0, 151, 152, 5, 78, 0, 0, 152, 153, 5, 67, 0, 0, + 153, 154, 5, 84, 0, 0, 154, 34, 1, 0, 0, 0, 155, 156, 5, 40, 0, 0, 156, + 36, 1, 0, 0, 0, 157, 158, 5, 41, 0, 0, 158, 38, 1, 0, 0, 0, 159, 160, 5, + 64, 0, 0, 160, 40, 1, 0, 0, 0, 161, 166, 3, 45, 22, 0, 162, 165, 3, 43, + 21, 0, 163, 165, 3, 45, 22, 0, 164, 162, 1, 0, 0, 0, 164, 163, 1, 0, 0, + 0, 165, 168, 1, 0, 0, 0, 166, 164, 1, 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, + 42, 1, 0, 0, 0, 168, 166, 1, 0, 0, 0, 169, 170, 7, 0, 0, 0, 170, 44, 1, + 0, 0, 0, 171, 172, 7, 1, 0, 0, 172, 46, 1, 0, 0, 0, 173, 177, 7, 2, 0, + 0, 174, 176, 3, 43, 21, 0, 175, 174, 1, 0, 0, 0, 176, 179, 1, 0, 0, 0, + 177, 175, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 48, 1, 0, 0, 0, 179, 177, + 1, 0, 0, 0, 180, 181, 5, 48, 0, 0, 181, 50, 1, 0, 0, 0, 182, 187, 5, 34, + 0, 0, 183, 186, 3, 53, 26, 0, 184, 186, 3, 61, 30, 0, 185, 183, 1, 0, 0, + 0, 185, 184, 1, 0, 0, 0, 186, 189, 1, 0, 0, 0, 187, 185, 1, 0, 0, 0, 187, + 188, 1, 0, 0, 0, 188, 190, 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 190, 201, + 5, 34, 0, 0, 191, 196, 5, 39, 0, 0, 192, 195, 3, 53, 26, 0, 193, 195, 3, + 59, 29, 0, 194, 192, 1, 0, 0, 0, 194, 193, 1, 0, 0, 0, 195, 198, 1, 0, + 0, 0, 196, 194, 1, 0, 0, 0, 196, 197, 1, 0, 0, 0, 197, 199, 1, 0, 0, 0, + 198, 196, 1, 0, 0, 0, 199, 201, 5, 39, 0, 0, 200, 182, 1, 0, 0, 0, 200, + 191, 1, 0, 0, 0, 201, 52, 1, 0, 0, 0, 202, 205, 5, 92, 0, 0, 203, 206, + 7, 3, 0, 0, 204, 206, 3, 55, 27, 0, 205, 203, 1, 0, 0, 0, 205, 204, 1, + 0, 0, 0, 206, 54, 1, 0, 0, 0, 207, 208, 5, 117, 0, 0, 208, 209, 3, 57, + 28, 0, 209, 210, 3, 57, 28, 0, 210, 211, 3, 57, 28, 0, 211, 212, 3, 57, + 28, 0, 212, 56, 1, 0, 0, 0, 213, 214, 7, 4, 0, 0, 214, 58, 1, 0, 0, 0, + 215, 216, 8, 5, 0, 0, 216, 60, 1, 0, 0, 0, 217, 218, 8, 6, 0, 0, 218, 62, + 1, 0, 0, 0, 219, 221, 7, 7, 0, 0, 220, 219, 1, 0, 0, 0, 221, 222, 1, 0, + 0, 0, 222, 220, 1, 0, 0, 0, 222, 223, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, + 224, 225, 6, 31, 0, 0, 225, 64, 1, 0, 0, 0, 12, 0, 92, 164, 166, 177, 185, + 187, 194, 196, 200, 205, 222, 1, 6, 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) diff --git a/netmap/policy.go b/netmap/policy.go index 545fb5c..48ca364 100644 --- a/netmap/policy.go +++ b/netmap/policy.go @@ -324,6 +324,13 @@ func (x *Filter) setAttribute(key string, op netmap.Operation, val string) { x.m.SetValue(val) } +// Like applies the rule to accept only nodes with attribute like value. +// +// Method SHOULD NOT be called along with other similar methods. +func (x *Filter) Like(key, value string) { + x.setAttribute(key, netmap.LIKE, value) +} + // Equal applies the rule to accept only nodes with the same attribute value. // // Method SHOULD NOT be called along with other similar methods. diff --git a/netmap/policy_test.go b/netmap/policy_test.go index 1d5487b..7c639c6 100644 --- a/netmap/policy_test.go +++ b/netmap/policy_test.go @@ -122,6 +122,11 @@ func TestDecodeSelectFilterExpr(t *testing.T) { FILTER Color EQ 'Red' AS RedNode FILTER @RedNode AND Shape EQ 'Cirle' AS RedCircleNode `, + ` + CBF 1 + SELECT 1 FROM R + FILTER Color LIKE 'R' AS R + `, } { _, err := DecodeSelectFilterString(s) require.NoError(t, err) diff --git a/netmap/selector_test.go b/netmap/selector_test.go index 0f0dd24..797ccfc 100644 --- a/netmap/selector_test.go +++ b/netmap/selector_test.go @@ -8,6 +8,7 @@ import ( mrand "math/rand" "slices" "strconv" + "strings" "testing" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" @@ -251,6 +252,92 @@ func TestPlacementPolicy_ProcessSelectors(t *testing.T) { } } +func TestPlacementPolicy_Like(t *testing.T) { + nodes := []NodeInfo{ + nodeInfoFromAttributes("Country", "Russia"), + nodeInfoFromAttributes("Country", "Germany"), + nodeInfoFromAttributes("Country", "Belarus"), + } + + var nm NetMap + nm.SetNodes(nodes) + + t.Run("LIKE all", func(t *testing.T) { + ssNamed := []Selector{newSelector("X", "Country", 4, "FromRU", (*Selector).SelectDistinct)} + fsNamed := []Filter{newFilter("FromRU", "Country", "*", netmap.LIKE)} + rsNamed := []ReplicaDescriptor{newReplica(4, "X")} + pNamed := newPlacementPolicy(0, rsNamed, ssNamed, fsNamed) + + n, err := nm.ContainerNodes(pNamed, []byte{1}) + require.NoError(t, err) + + require.Equal(t, 3, len(n[0])) + for _, n := range n[0] { + require.True(t, strings.Contains("GermanyRussiaBelarus", n.Attribute("Country"))) + } + }) + + t.Run("LIKE no wildcard", func(t *testing.T) { + ssNamed := []Selector{newSelector("X", "Country", 1, "FromRU", (*Selector).SelectDistinct)} + fsNamed := []Filter{newFilter("FromRU", "Country", "Russia", netmap.LIKE)} + rsNamed := []ReplicaDescriptor{newReplica(1, "X")} + pNamed := newPlacementPolicy(0, rsNamed, ssNamed, fsNamed) + + n, err := nm.ContainerNodes(pNamed, []byte{1}) + require.NoError(t, err) + + require.Equal(t, 1, len(n[0])) + for _, n := range n[0] { + require.True(t, n.Attribute("Country") == "Russia") + } + }) + + t.Run("LIKE prefix", func(t *testing.T) { + ssNamed := []Selector{newSelector("X", "Country", 1, "FromRU", (*Selector).SelectDistinct)} + fsNamed := []Filter{newFilter("FromRU", "Country", "Ge*", netmap.LIKE)} + rsNamed := []ReplicaDescriptor{newReplica(1, "X")} + pNamed := newPlacementPolicy(0, rsNamed, ssNamed, fsNamed) + + n, err := nm.ContainerNodes(pNamed, []byte{1}) + require.NoError(t, err) + + require.Equal(t, 1, len(n[0])) + for _, n := range n[0] { + require.True(t, n.Attribute("Country") == "Germany") + } + }) + + t.Run("LIKE suffix", func(t *testing.T) { + ssNamed := []Selector{newSelector("X", "Country", 1, "FromRU", (*Selector).SelectDistinct)} + fsNamed := []Filter{newFilter("FromRU", "Country", "*sia", netmap.LIKE)} + rsNamed := []ReplicaDescriptor{newReplica(1, "X")} + pNamed := newPlacementPolicy(0, rsNamed, ssNamed, fsNamed) + + n, err := nm.ContainerNodes(pNamed, []byte{1}) + require.NoError(t, err) + + require.Equal(t, 1, len(n[0])) + for _, n := range n[0] { + require.True(t, n.Attribute("Country") == "Russia") + } + }) + + t.Run("LIKE middle", func(t *testing.T) { + ssNamed := []Selector{newSelector("X", "Country", 2, "FromRU", (*Selector).SelectDistinct)} + fsNamed := []Filter{newFilter("FromRU", "Country", "*us*", netmap.LIKE)} + rsNamed := []ReplicaDescriptor{newReplica(2, "X")} + pNamed := newPlacementPolicy(0, rsNamed, ssNamed, fsNamed) + + n, err := nm.ContainerNodes(pNamed, []byte{1}) + require.NoError(t, err) + + require.Equal(t, 2, len(n[0])) + for _, n := range n[0] { + require.True(t, strings.Contains("RussiaBelarus", n.Attribute("Country"))) + } + }) +} + func TestPlacementPolicy_Unique(t *testing.T) { p := newPlacementPolicy(2, []ReplicaDescriptor{ diff --git a/netmap/yml_unmarshal.go b/netmap/yml_unmarshal.go index fa94586..7c38b2c 100644 --- a/netmap/yml_unmarshal.go +++ b/netmap/yml_unmarshal.go @@ -44,15 +44,16 @@ func convertNFilters(temp []tempFilter) []netmap.Filter { } var stringToOperationMap = map[string]netmap.Operation{ - "EQ": netmap.EQ, - "NE": netmap.NE, - "GT": netmap.GT, - "GE": netmap.GE, - "LT": netmap.LT, - "LE": netmap.LE, - "OR": netmap.OR, - "AND": netmap.AND, - "NOT": netmap.NOT, + "EQ": netmap.EQ, + "NE": netmap.NE, + "GT": netmap.GT, + "GE": netmap.GE, + "LT": netmap.LT, + "LE": netmap.LE, + "OR": netmap.OR, + "AND": netmap.AND, + "NOT": netmap.NOT, + "LIKE": netmap.LIKE, } func convertStringToOperation(opStr string) netmap.Operation { From 908c96a94dfb6e12ffd1c7678882bdb3be442ca4 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 13 Aug 2024 15:27:42 +0300 Subject: [PATCH 072/197] [#251] pool: Fix `handlerError` panic for `objectPatch` Signed-off-by: Airat Arifullin --- pool/pool.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pool/pool.go b/pool/pool.go index 9dd4eb5..fa1fa72 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -760,7 +760,11 @@ func (c *clientWrapper) objectPatch(ctx context.Context, prm PrmObjectPatch) (Re } res, err := pObj.Close(ctx) - if err = c.handleError(ctx, res.Status(), err); err != nil { + var st apistatus.Status + if res != nil { + st = res.Status() + } + if err = c.handleError(ctx, st, err); err != nil { return ResPatchObject{}, fmt.Errorf("client failure: %w", err) } From 98aabc45a720b869bda7d59bf5c3863d3e8fe5ee Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 13 Aug 2024 18:56:11 +0300 Subject: [PATCH 073/197] [#252] patcher: Fix applying patch from the same offset Signed-off-by: Airat Arifullin --- object/patcher/patcher.go | 2 ++ object/patcher/patcher_test.go | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/object/patcher/patcher.go b/object/patcher/patcher.go index ec448c9..aad1f2a 100644 --- a/object/patcher/patcher.go +++ b/object/patcher/patcher.go @@ -190,6 +190,8 @@ func (p *patcher) copyRange(ctx context.Context, rng *objectSDK.Range) error { } func (p *patcher) applyPatch(ctx context.Context, payloadPatch *objectSDK.PayloadPatch, offset uint64) (newOffset uint64, err error) { + newOffset = offset + // write the original payload chunk before the start of the patch if payloadPatch.Range.GetOffset() > offset { rng := new(objectSDK.Range) diff --git a/object/patcher/patcher_test.go b/object/patcher/patcher_test.go index bf2402b..3abb939 100644 --- a/object/patcher/patcher_test.go +++ b/object/patcher/patcher_test.go @@ -508,6 +508,31 @@ func TestPatch(t *testing.T) { originalObjectPayload: []byte("0123456789ABCDEF"), patchedPayload: []byte("0123456789aaaaaDEFbbbbb"), }, + { + name: "starting from the same offset", + patches: []objectSDK.Patch{ + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(8, 3), + Chunk: []byte("1"), + }, + }, + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(11, 0), + Chunk: []byte("2"), + }, + }, + { + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(11, 0), + Chunk: []byte("3"), + }, + }, + }, + originalObjectPayload: []byte("abcdefghijklmnop"), + patchedPayload: []byte("abcdefgh123lmnop"), + }, { name: "a few patches: various modifiactions", patches: []objectSDK.Patch{ From 203bba65a0b33cf1ba3751b6b676b20cd1046119 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Wed, 14 Aug 2024 16:48:06 +0300 Subject: [PATCH 074/197] [#253] pool: Don't count regular FrostFS errors Previously we count all frostfs errors like: ObjectNotFound, EACLNotFound because frostfs status is unconditionally resolved into built-in go errors but handleError method handled built-in errors like internal network ones. Since after resolving frostfs errors status is also returned we start check this first Signed-off-by: Denis Kirillov --- pool/pool.go | 27 +++++++++++++++++---------- pool/pool_test.go | 17 +++++++++++++++++ 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/pool/pool.go b/pool/pool.go index fa1fa72..f9e3dae 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -1227,6 +1227,22 @@ func (c *clientWrapper) close() error { } func (c *clientStatusMonitor) handleError(ctx context.Context, st apistatus.Status, err error) error { + if stErr := apistatus.ErrFromStatus(st); stErr != nil { + switch stErr.(type) { + case *apistatus.ServerInternal, + *apistatus.WrongMagicNumber, + *apistatus.SignatureVerification, + *apistatus.NodeUnderMaintenance: + c.incErrorRate() + } + + if err == nil { + err = stErr + } + + return err + } + if err != nil { if needCountError(ctx, err) { c.incErrorRate() @@ -1235,16 +1251,7 @@ func (c *clientStatusMonitor) handleError(ctx context.Context, st apistatus.Stat return err } - err = apistatus.ErrFromStatus(st) - switch err.(type) { - case *apistatus.ServerInternal, - *apistatus.WrongMagicNumber, - *apistatus.SignatureVerification, - *apistatus.NodeUnderMaintenance: - c.incErrorRate() - } - - return err + return nil } func needCountError(ctx context.Context, err error) bool { diff --git a/pool/pool_test.go b/pool/pool_test.go index c8721b9..9189c3e 100644 --- a/pool/pool_test.go +++ b/pool/pool_test.go @@ -609,6 +609,23 @@ func TestHandleError(t *testing.T) { expectedError: true, countError: false, }, + { + ctx: ctx, + status: new(apistatus.ObjectNotFound), + err: &apistatus.ObjectNotFound{}, + expectedError: true, + countError: false, + }, + { + ctx: ctx, + status: nil, + err: &apistatus.EACLNotFound{}, + expectedError: true, + // we expect error be counted because status is nil + // currently we assume that DisableFrostFSErrorResolution be always false for pool + // and status be checked first in handleError + countError: true, + }, { ctx: ctx, status: new(apistatus.ServerInternal), From 6dd7be11d13b62441fe4b51c6d809e7fafc384f7 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 20 Aug 2024 10:18:45 +0300 Subject: [PATCH 075/197] [#256] go.mod: Update api-go Signed-off-by: Evgenii Stratonikov --- go.mod | 5 ++++- go.sum | 10 ++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 54b7b89..f3e0a7f 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.21 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240809081817-47a48969b067 + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240819074700-a43110e36326 git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 @@ -23,11 +23,14 @@ require ( require ( git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 // indirect git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 // indirect + github.com/VictoriaMetrics/easyproto v0.1.4 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/golang/snappy v0.0.1 // indirect github.com/gorilla/websocket v1.5.1 // indirect + github.com/josharian/intern v1.0.0 // indirect github.com/klauspost/cpuid/v2 v2.2.6 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/nspcc-dev/go-ordered-json v0.0.0-20240301084351-0246b013f8b2 // indirect github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20240521091047-78685785716d // indirect github.com/nspcc-dev/rfc6979 v0.2.1 // indirect diff --git a/go.sum b/go.sum index b1ab86d..e184e11 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240809081817-47a48969b067 h1:/da6lloTPujJgEYF/dgqbxY9h6TMaRHclOV9yvCcE8s= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240809081817-47a48969b067/go.mod h1:mc7j6Cc1GU1tJZNmDwEYiJJ339biNnU1Bz3wZGogMe0= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240819074700-a43110e36326 h1:TkH+NSsY4C/Z8MocIJyMcqLm5vEhZcSowOldJyilKKA= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240819074700-a43110e36326/go.mod h1:zZnHiRv9m5+ESYLhBXY9Jds9A/YIDEUGiuyPUS09HwM= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e h1:kcBqZBiFIUBATUqEuvVigtkJJWQ2Gug/eYXn967o3M4= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e/go.mod h1:F/fe1OoIDKr5Bz99q4sriuHDuf3aZefZy9ZsCqEtgxc= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= @@ -10,6 +10,8 @@ git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 h1:M2KR3iBj7WpY3hP10IevfIB9MURr4O9m git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0/go.mod h1:okpbKfVYf/BpejtfFTfhZqFP+sZ8rsHrP8Rr/jYPNRc= git.frostfs.info/TrueCloudLab/tzhash v1.8.0 h1:UFMnUIk0Zh17m8rjGHJMqku2hCgaXDqjqZzS4gsb4UA= git.frostfs.info/TrueCloudLab/tzhash v1.8.0/go.mod h1:dhY+oy274hV8wGvGL4MwwMpdL3GYvaX1a8GQZQHvlF8= +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/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -55,6 +57,8 @@ github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyf github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +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/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/klauspost/reedsolomon v1.12.1 h1:NhWgum1efX1x58daOBGCFWcxtEhOhXKKl1HAPQUp03Q= @@ -63,6 +67,8 @@ 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/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= From 338d1ef254e8758c38dc3731d64a0f22c54c6263 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Mon, 19 Aug 2024 16:17:26 +0300 Subject: [PATCH 076/197] [#258] pool/tree: Add node address to error Signed-off-by: Denis Kirillov --- pool/tree/pool.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pool/tree/pool.go b/pool/tree/pool.go index 195102b..21f7c54 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -836,6 +836,11 @@ LOOP: if startI != indexI || startJ != indexJ { p.setStartIndices(indexI, indexJ) } + + if err != nil { + err = fmt.Errorf("address %s: %w", p.innerPools[indexI].clients[indexJ].endpoint(), err) + } + return err } From cf225be0df1d75c216ee580d6335809539df9676 Mon Sep 17 00:00:00 2001 From: Ekaterina Lebedeva Date: Wed, 21 Aug 2024 16:42:58 +0300 Subject: [PATCH 077/197] [#1316] go.mod: Bump go version to 1.22 Signed-off-by: Ekaterina Lebedeva --- .forgejo/workflows/dco.yml | 2 +- .forgejo/workflows/tests.yml | 4 ++-- Dockerfile | 2 +- Makefile | 4 ++-- go.mod | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.forgejo/workflows/dco.yml b/.forgejo/workflows/dco.yml index dcee5fc..89a6fac 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.22' + 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 1ad32dc..c4cb72a 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.22' + go-version: '1.23' cache: true - name: Install linters @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go_versions: [ '1.21', '1.22' ] + go_versions: [ '1.22', '1.23' ] fail-fast: false steps: - uses: actions/checkout@v3 diff --git a/Dockerfile b/Dockerfile index 9caf0c4..8c1ae08 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21 +FROM golang:1.22 RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install make openjdk-17-jre -y WORKDIR /work diff --git a/Makefile b/Makefile index 0b4011f..33ab7d5 100755 --- a/Makefile +++ b/Makefile @@ -2,8 +2,8 @@ ANTLR_VERSION="4.13.0" TMP_DIR := .cache -LINT_VERSION ?= 1.56.2 -TRUECLOUDLAB_LINT_VERSION ?= 0.0.2 +LINT_VERSION ?= 1.60.1 +TRUECLOUDLAB_LINT_VERSION ?= 0.0.6 OUTPUT_LINT_DIR ?= $(shell pwd)/bin LINT_DIR = $(OUTPUT_LINT_DIR)/golangci-lint-$(LINT_VERSION)-v$(TRUECLOUDLAB_LINT_VERSION) diff --git a/go.mod b/go.mod index f3e0a7f..75a8bff 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go -go 1.21 +go 1.22 require ( git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240819074700-a43110e36326 From 9115d3f281c6934e5fb49bb9adc5d3cddfe44ad8 Mon Sep 17 00:00:00 2001 From: Ekaterina Lebedeva Date: Wed, 21 Aug 2024 16:43:53 +0300 Subject: [PATCH 078/197] [#1316] lint: Fix warnings Signed-off-by: Ekaterina Lebedeva --- .golangci.yml | 3 ++- netmap/aggregator.go | 12 ++++++------ netmap/context.go | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index aca0746..ff8989a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -12,7 +12,8 @@ run: # 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: diff --git a/netmap/aggregator.go b/netmap/aggregator.go index c4a43c1..1faba9e 100644 --- a/netmap/aggregator.go +++ b/netmap/aggregator.go @@ -73,8 +73,8 @@ func newMinAgg() aggregator { // newReverseMinNorm returns a normalizer which // normalize values in range of 0.0 to 1.0 to a minimum value. -func newReverseMinNorm(min float64) normalizer { - return &reverseMinNorm{min: min} +func newReverseMinNorm(minV float64) normalizer { + return &reverseMinNorm{min: minV} } // newSigmoidNorm returns a normalizer which @@ -125,22 +125,22 @@ func (a *meanIQRAgg) Compute() float64 { slices.Sort(a.arr) - var min, max float64 + var minV, maxV float64 const minLn = 4 if l < minLn { - min, max = a.arr[0], a.arr[l-1] + minV, maxV = a.arr[0], a.arr[l-1] } else { start, end := l/minLn, l*3/minLn-1 - min, max = a.arr[start], a.arr[end] + minV, maxV = a.arr[start], a.arr[end] } count := 0 sum := float64(0) for _, e := range a.arr { - if e >= min && e <= max { + if e >= minV && e <= maxV { sum += e count++ } diff --git a/netmap/context.go b/netmap/context.go index df3c85b..ca791e8 100644 --- a/netmap/context.go +++ b/netmap/context.go @@ -94,14 +94,14 @@ func (c *context) addUsedNodes(ns ...NodeInfo) { func defaultWeightFunc(ns nodes) weightFunc { mean := newMeanAgg() - min := newMinAgg() + minV := newMinAgg() for i := range ns { mean.Add(float64(ns[i].capacity())) - min.Add(float64(ns[i].Price())) + minV.Add(float64(ns[i].Price())) } return newWeightFunc( newSigmoidNorm(mean.Compute()), - newReverseMinNorm(min.Compute())) + newReverseMinNorm(minV.Compute())) } From 28f140bf06c1d563f2d8c1def60f3acacd327d23 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Mon, 19 Aug 2024 17:54:42 +0300 Subject: [PATCH 079/197] [#254] pool: Add parameter gracefulCloseOnSwitchTimeout Add new param for waiting a little until current in-flight requests will be finished Signed-off-by: Denis Kirillov --- pool/pool.go | 60 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 53 insertions(+), 7 deletions(-) diff --git a/pool/pool.go b/pool/pool.go index f9e3dae..9798836 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -258,6 +258,8 @@ type wrapperPrm struct { responseInfoCallback func(sdkClient.ResponseMetaInfo) error poolRequestInfoCallback func(RequestInfo) dialOptions []grpc.DialOption + + gracefulCloseOnSwitchTimeout time.Duration } // setAddress sets endpoint to connect in FrostFS network. @@ -291,6 +293,14 @@ func (x *wrapperPrm) setErrorThreshold(threshold uint32) { x.errorThreshold = threshold } +// SetGracefulCloseOnSwitchTimeout specifies the timeout after which unhealthy client be closed during rebalancing +// if it will become healthy back. +// +// See also setErrorThreshold. +func (x *wrapperPrm) setGracefulCloseOnSwitchTimeout(timeout time.Duration) { + x.gracefulCloseOnSwitchTimeout = timeout +} + // setPoolRequestCallback sets callback that will be invoked after every pool response. func (x *wrapperPrm) setPoolRequestCallback(f func(RequestInfo)) { x.poolRequestInfoCallback = f @@ -362,7 +372,7 @@ func (c *clientWrapper) restartIfUnhealthy(ctx context.Context) (changed bool, e // if connection is dialed before, to avoid routine / connection leak, // pool has to close it and then initialize once again. if c.isDialed() { - _ = c.close() + c.scheduleGracefulClose() } var cl sdkClient.Client @@ -407,6 +417,12 @@ func (c *clientWrapper) getClient() (*sdkClient.Client, error) { return nil, errPoolClientUnhealthy } +func (c *clientWrapper) getClientRaw() *sdkClient.Client { + c.clientMutex.RLock() + defer c.clientMutex.RUnlock() + return c.client +} + // balanceGet invokes sdkClient.BalanceGet parse response status to error and return result as is. func (c *clientWrapper) balanceGet(ctx context.Context, prm PrmBalanceGet) (accounting.Decimal, error) { cl, err := c.getClient() @@ -1220,12 +1236,25 @@ func (c *clientWrapper) incRequests(elapsed time.Duration, method MethodIndex) { } func (c *clientWrapper) close() error { - if c.client != nil { - return c.client.Close() + if cl := c.getClientRaw(); cl != nil { + return cl.Close() } return nil } +func (c *clientWrapper) scheduleGracefulClose() { + cl := c.getClientRaw() + if cl == nil { + return + } + + time.AfterFunc(c.prm.gracefulCloseOnSwitchTimeout, func() { + if err := cl.Close(); err != nil { + c.log(zap.DebugLevel, "close unhealthy client during rebalance", zap.String("address", c.address()), zap.Error(err)) + } + }) +} + func (c *clientStatusMonitor) handleError(ctx context.Context, st apistatus.Status, err error) error { if stErr := apistatus.ErrFromStatus(st); stErr != nil { switch stErr.(type) { @@ -1300,6 +1329,8 @@ type InitParameters struct { dialOptions []grpc.DialOption clientBuilder clientBuilder + + gracefulCloseOnSwitchTimeout time.Duration } // SetKey specifies default key to be used for the protocol communication by default. @@ -1336,6 +1367,15 @@ func (x *InitParameters) SetClientRebalanceInterval(interval time.Duration) { x.clientRebalanceInterval = interval } +// SetGracefulCloseOnSwitchTimeout specifies the timeout after which unhealthy client be closed during rebalancing +// if it will become healthy back. +// Generally this param should be less than client rebalance interval (see SetClientRebalanceInterval). +// +// See also SetErrorThreshold. +func (x *InitParameters) SetGracefulCloseOnSwitchTimeout(timeout time.Duration) { + x.gracefulCloseOnSwitchTimeout = timeout +} + // SetSessionExpirationDuration specifies the session token lifetime in epochs. func (x *InitParameters) SetSessionExpirationDuration(expirationDuration uint64) { x.sessionExpirationDuration = expirationDuration @@ -1984,10 +2024,11 @@ const ( defaultSessionTokenExpirationDuration = 100 // in epochs defaultErrorThreshold = 100 - defaultRebalanceInterval = 15 * time.Second - defaultHealthcheckTimeout = 4 * time.Second - defaultDialTimeout = 5 * time.Second - defaultStreamTimeout = 10 * time.Second + defaultGracefulCloseOnSwitchTimeout = 10 * time.Second + defaultRebalanceInterval = 15 * time.Second + defaultHealthcheckTimeout = 4 * time.Second + defaultDialTimeout = 5 * time.Second + defaultStreamTimeout = 10 * time.Second defaultBufferMaxSizeForPut = 3 * 1024 * 1024 // 3 MB ) @@ -2109,6 +2150,10 @@ func fillDefaultInitParams(params *InitParameters, cache *sessionCache) { params.clientRebalanceInterval = defaultRebalanceInterval } + if params.gracefulCloseOnSwitchTimeout <= 0 { + params.gracefulCloseOnSwitchTimeout = defaultGracefulCloseOnSwitchTimeout + } + if params.healthcheckTimeout <= 0 { params.healthcheckTimeout = defaultHealthcheckTimeout } @@ -2134,6 +2179,7 @@ func fillDefaultInitParams(params *InitParameters, cache *sessionCache) { prm.setDialTimeout(params.nodeDialTimeout) prm.setStreamTimeout(params.nodeStreamTimeout) prm.setErrorThreshold(params.errorThreshold) + prm.setGracefulCloseOnSwitchTimeout(params.gracefulCloseOnSwitchTimeout) prm.setPoolRequestCallback(params.requestCallback) prm.setGRPCDialOptions(params.dialOptions) prm.setResponseInfoCallback(func(info sdkClient.ResponseMetaInfo) error { From f0b9493ce3f7142de2f93dc485d4821b97b0961d Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 27 Aug 2024 11:31:52 +0300 Subject: [PATCH 080/197] [#261] go.mod: Update api-go Signed-off-by: Evgenii Stratonikov --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 75a8bff..e6f64c0 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.22 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240819074700-a43110e36326 + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240827080218-5fece80b4203 git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 diff --git a/go.sum b/go.sum index e184e11..c4e4d29 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240819074700-a43110e36326 h1:TkH+NSsY4C/Z8MocIJyMcqLm5vEhZcSowOldJyilKKA= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240819074700-a43110e36326/go.mod h1:zZnHiRv9m5+ESYLhBXY9Jds9A/YIDEUGiuyPUS09HwM= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240827080218-5fece80b4203 h1:GtBJrT2x03XAiOqyQBUa1XXjDBGxsW5ahCv1W8qyj60= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240827080218-5fece80b4203/go.mod h1:BDnEpkKMykCS8u1nLzR6SgNzCv6885RWlo5TnravQuI= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e h1:kcBqZBiFIUBATUqEuvVigtkJJWQ2Gug/eYXn967o3M4= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e/go.mod h1:F/fe1OoIDKr5Bz99q4sriuHDuf3aZefZy9ZsCqEtgxc= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= From 3c00f4eeac4b7cbc2375ef863869bd617db4ca55 Mon Sep 17 00:00:00 2001 From: Nikita Zinkevich Date: Thu, 29 Aug 2024 15:52:21 +0300 Subject: [PATCH 081/197] [#203] Add pool docs Signed-off-by: Nikita Zinkevich --- doc/image/pool.png | Bin 0 -> 198815 bytes doc/pool.md | 27 +++++++++++++++++++++++++++ pool/doc.go | 3 +-- pool/pool.go | 8 ++++++-- 4 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 doc/image/pool.png create mode 100644 doc/pool.md diff --git a/doc/image/pool.png b/doc/image/pool.png new file mode 100644 index 0000000000000000000000000000000000000000..de9788e0de333f3d931f9cce149293a9c81fb3c2 GIT binary patch literal 198815 zcmeEv1zc6x`Zgl1bV*nsNcSO>k`x5#2K4}k?naO<2^9sTQxF71q(h`bKtftVKuVAj z0m*M4IR}q1S7+|bT>XE}kGXfw+Iz3P_FC`zy!EWTughPQ#Kt1WLPA2qmO3w{h=g;^1Q8Vd2?3V58ydmy3@qZ_^O=L;C&Ly?KPsrj4Z~&>zC0As&XG zWbPyiF@sJvd>&!<0mSCdU%NjWHv2;T-*jhTF0N?i;G}1!DWYPcByDHOd)|zhoo{bu z9KdGwusPpru(flBOR$Zly@fsmx+d-79zpaBF0b*yY2ZkMhiPA?!gq|pBX=Vx434MqG*xn47UJ)~}F2qa(tY>QY z@vdK=06>Bnyw$?e0vH6K(oh8hbkPn16Y+1%+{dQ>ynLS)Q4(Tl4zaUw2D*jy$jk?u zdYH;^!hSj;$RG52=tztZWRDXrdSIB$8}4@vJ@rTA0yqaIR{weUP?-Ee`o6j3T%g}e z4op14A9UuvzvSF-eE9{}oD&eXk4o}e&0#D5V{6XI1=HzYaLr*L_!+Wue*{^5V+R@z zZbK;EUId&2U`Bv*_YMJIgK!kyiqORT)j#l)bZy|B!dt%EnY@j$rH!#26leEG@E5vK z+XLJ`)d^G^5NsS^wE^!1YE8al-@vw3doGQEu@lrLiXa*!8V*iN@xt1E9&7b2;QAve=KNv7`$~wJ zfA~@ancctNeT~OIgZ?$4 z<@{V|*}vr#{t`k9O9K3m(C!P-cTM_FB((d3{=Ve@9~WBCmq^PF6XIXa9f0N6en@Ed z&GWw`wEOq_zPx>f_4_XD|Ih9K3^rlzz%L7|?67PqVtAnsBrstaHA@>iBTGX|3$U5^ zr&bXl6KMs_sKIik(6pGy=ZUvZ*U4B~0$I0@={6IHot-l*tp>KYvjna}NX7wqLmOvx z;8bYh?&A*)=nuf-g#8qQrnmMFia}={`s-H(}Us9;-J8e78cpun$vo*x-QEV6%cKP~Vn{kK*$e z!~&kmW@BOFv$D&9XVIX`myPqHZwopzvm_z0l)g5C~>^vpm(;Nx$&j9MBP z*uqPCfbsrL=>&cs;7o)(?tdO3r|8GCKjzE7cjk|!)nQ7FAk^|eO>FPE5JdVDrb9vH zJISWKtN+=`1_wOn16vGsj<0<~c=iY}Rm2V#Soos-?<*VZFtPgPbVJquFPPA;Od&6a zE+;qC@cq=L@RMgD_UWM!{f%!L%g+qnmzEO*;nnB*_}mDV^OK=PG@ek=)(6`f{S(G> z4=et&&cYD^0S^8xY~$eh+>2%Bg{c!5dzYcAF>*+7$nEWz&x*tdW zdwTlSEq_@(g(r0oTpW1e3xNXhr#TY{C1W7a{n0|&ALoewL?=)O6Tv(9-zLDO6TmPTjBY*{sKP0vL z7W!Y3+Wq@|U*P`OkNwScfLFjcL0=bLehn$*;{H1Q``zNhep+~MgV;y1!)LXJzdt*& zPZIo@%QhctDBmF^d^3;vMXhGvgV^fiMKH`I^7KCJ*|$C=XqSud}gG4f#zp`C@PA9<=}GHQN*GZ->3iY%J{DJTTuI zCfCfcx&L>FCNQ=r{N8ZZD_nzrMVbj0e24j`{kc%#Rr=H9!r%55O5s4DGW-Dv@PB4+ zKc-s#g7*D8s`aJ4<${;Y;mY-s+uJYPh5h0GIeYjC{=T&5U-l1Aru@17e>Hpi_1grX z^YGi=LX$4vC3fyX`(My_IIWV6g^QB|wghmS2TR!gJD>ntX!yO^VK;|E!mns=IlkU; z@@w)sx#09Ag!C;Oln@hPKOwJ^1Lnpf6f*z*1i^1!C!#a--|;%Xy8{A_Qiz!NkMDN) z5oG;CgZ?Esi3_efaB%x|Ne^Ee?f(nBPA<6Hfq-|v3a=9m)xQDn`?2je{K&l3TNeAZzAvFEwb^hnA&_AL8 zUl>7HDr29u0ZS$Dz~8!p;LO1@Y>2@tybZ1-i0TMcweQu^{{9jaeBi%X92^{f8~gYt zeSsA(+_Cxfq!h;D_#r6;!1PBcl3#Iu5FqnUaMr%+X8(05zv-IrP4(Pxq=7>we2f3D zCyZaGT;URjV0>Y_F#a1U`n!ekPmBdx5I~3;{x)RXXa0P(Z+)Kt1!HjkqpwTmg40W2 z!pIAM4f3xij9*ho{#Y3IS&`p$9e?l3_$gjM3Alt%O@v7)_pb|?upBNTr2GV|kiYHy zQ~U2F{h8UD-^@gQk$gn(T)$5}`2+UmcdIM#_o(j0>;K^eQ*hGZzgmX*-^5{X*Brsa zh3;qhO-+E}AL9Cd^PN+iAMxd{$Me7|r(h8V3~K*f9w0MR<`94${<_f7@2L$w5@zZ`#&9ApZ;M2g{WMwv`VqW-#jt ze-Yk4qM%>ZcRy$N!|(ko+g3PqA~=h`Ch3m{{v-%_7dUYVv2OAclK!~hcJ9+ghu@^X zpZT3h-w#V+9xEaueq7|gfPMcCvVF;1*>@M<;P%T_#JON=fq-!T7f65KsuTYzq(3eg zTOJ{x`we(MGvNI?IQAu(hzFkNhU3^jPx|}nmcK4^!u;LeditC6_Yaf)c;Pkue@{=p zy5+B{r{AjFevvVSzlg-v-dueD3y@Y28)M+}zaPKW4J*vce`@;PJFIp0KVB?nZ)au< z{X+4d`!Mof`2_M;)qV*HcIaE@zI;nPv}G^F_|JY+;L8tA{krdE;Ddm1pewggmCM(6#ZLR1kc36lB3^>5#hXH#GDws4Q_k?_grESEG70^ zicBGDuuqWvTNdsA4!x55>(q}T#M&NW3w#*s%Zjoc#0mP9@PFvrThI^I0pI8PQyvoZ zv&G-{kSs0i5Wc+4%OSG&$sPlsT?v*?hU?Nl%7bL*ge7(0*aLq{3PL`9KR8DOANUT? zp9g%nzurUhTWtR0mjM5|^nlgpxD3);0QMBx7hqkV#5xC73P0IvH9Z-DNqpq zjQ7NCZEp#+QqTj;d-miUZ~_OH6%a=N;V%3*&}IOJeV7y8rV6pq2U~y~Oiy*uu;e`O;73+g^FUJ0K%n1Eg*^!Do36k|xAqp-0(FL*g0jVOLK9k>dG1v4ZE2>fgU~{bV=%cNBeXi4i%I-l+_Om6*xFLI;I@K zV9>pAo<6aY=KN-y?Y6M8ZZw(G%{G2ITe1~DjHlEQ!n)e; zH`#Cg%O(`%Xr$}p;evvi{GZ?d1oA19>0|qs!bb47bt*>&Rc79^XGOKNC`d?19_8nY4VBs}WNU)B%m>0Q2JcS~d|-=&2Ydsg^9{8h} zL_$kT>tw`z3KGpP#&!aEndStcLJc#QR*{7Y*10=@nc_htk-XMa8fLFucH5^v zAKHlq%=649PKR6TLnw0HcXud9T5=Ap&*nU3b6(aD%vC78lZ1-@xg_`F-_quHM=0@ zbxbKXHhQo2HhlSBdGFFR@<5VaLp4|Lid>eJV7o-iFk?Z2R53WVRV$)fSI%yJd8yl?r z{6pt16rI4DH947}DVUxywYz%(Tk5*hTsTwt?K`*e3CV(3=ZGn`i9ak))fgsRiPR*k z%F<>ZRk@eWtw4Imqc+)(w1?kqi}zwYKmBA_;M4L8cUjgq7oK*M*c#T!UF0M{oThXx z&-ENkr`c&t+`DUZ%Eca6tUC-zj)*D=&}w(x8>T3l_Ho0K?7NR~>d{m8Z32Ir0_kKC z0Y)Pt`MX!Q%GrRsrPhq2pXPgsgy$GBcCX@H8gxD|XmTsl$W9Tr`+c6U1DqA-<09=Hb0$=Mma zz44x*#-SyWJzYJQO5*0RY!1^j-_M?dE?&5?!HU0PLowhEy-uB1NhBG)8~$#>Qi>d2 z`K5A0Yo5~dmuXmaBleGj$w_O|67Byk)|OgynN-Eq)yVVJmxQAh5x zfseL=iJ5}OEwYYYWc)Rv}P{72Y2M7Q|aqOYDqwbZSi$g z-sskoEo7;E9=t)*eYw=Y&HQkVo(Xsn@{k5m=o%+b2IHN^pD#(KcRu28c}Ai%Fyv;n z8_;{>n9*<^%d^MD6ec5>0n8@KeAAc0Z&S2mOCt^}@dz@hW8WeAyNq4**^!v3u@hR) zc#6-sU}|&^;F>Z_7?q@y^(CjB52XqS2)NZhFL{IV`rDU9hP=bim^+(S-Fio~4;2u2KKcXE%!Bc;m=0bbA0(I0| zPc$mTnUH5jo_{Xr^uF>SC|ZT!O;ftb_)MaX#Z!rbv>rO88WEMElkZFG2tczv*`hmJ zAJ{Dhc{5J$*n3b*-blRs)UCQ`XlO{G&`cw$tqNVc%z?S9tLyb+^b)2>w9h8|7QN?` zqxMn0p@{pk8d@LKc z<)DpHvKS_`cYfD(wuhIV1d96OG(lX+!w{{Hurp?P`NECLwIn*Vl(1zM#p>{qT;7>X< zK9hY_r^DmAjC0Pnv}7%57rQxFwLA;+0oU!Dy>}kRKT=OlQ_t0PTAd@4k&)4_I4*vj z+}+*1E9dg%M`#Mvh;!UXffCPtH}A?*wy+#X_$<%dMlB(2grD;>Vp%4Il&@d!mcZ=&|G3Wi!#HVZoBcC;l_c3Rs$nE5|Rj}RI!u0X= zPcrNkT+i%90+Y^&hisnZX;Eh*UMT0k0x|Zjv%Q;g+a5AnI)v_UWoqZGyq<>l=6gzy zqnm|k8YZhpheLGcuI=FM7-p_U3R*`juC18AuMelwQz1FJJICbe@_dYpt(~XVr(-uz z{LX!s3foS6(Yq^nnF$P+m?F~IL7=)9_vNbeO!bF|AQ?%KR%kTy@r|C)V%E1p>)QWC=kje!-sR{`E)robpdxeXeuH8x*5j zz4J_zSIEW7T1jGbI{pqDvnnO^>BDuiMXaa_wry3%@KZ2flJC)sG zeJzsG?d|jJmsT^i?+-iHGYf914CbR0J{&?7Jt)eKu~ppl{yM3&3QK5akZmB1$;Qfz z_rWxib4Y#fYakN-R@~)kIfU4<)n3 zUFOkXiRI~2Sm}+o(dPz>uqD^xr73n7@UL~0X$ff;U&Seu)l7Doim!I@JeSasmYIFR zGH(24qJr>21IVdEQRi7r z)?fEp=u~y81hqeMqbA~{$FayDJL^m|f9YCeVWDbV47k5MT&63QlnIov#Okoh!|uF_ za;_^lj-P-zx$;Z^!EQNY=Hr8=H@xC|UPijs$5>Axrx1JRD31yoI7Tw6-kPCSR1>LO4LVaPi zFskFK_fXGVtDq)}{++yVo`Xh5f^tVL2o-+DwhDEi%0o8H3klUMV)kBtDET?<4YoRlU&@Z{AO zs$x1)Appc^z7B5(noQ1<`+o)uQW$+lt;N7P%tVaF_f9b?RzOgk(5YBxaayl-t5noU zAa z9ZSnQn=$J@ulK5)MZQi8o!`DIS(1H4`Iktut>_#EMO>x1dt;JJi_x- zi*G#9k@*iQBwdUeEMVuGn+$nzHu5gdIq{gm8fhwpn*KuL7ibMPj*5m-iNE&HEEHY# zk~)ZXxDx6cpJfaAEV@r5Lb;e#fi*jjnq(STrYrvX01rPM)9#Qt}%Fk$6j1;evzoX~Mp$mh+GRZ<3#WT9kky#`zokkx29Z}hYre~>*BT9al$WQ}m@FQ3Pb1GDQt;Xt&7$W52jr9IVjiCS zWcGzGQ9&{1=EHJ*3uVZ=&O*rJUNxNgM>Fc!SL;hT$XHLKhh7JCADWq19Ideia5#4G zCY$4nG+7`hbyHVYf4#10bl@{%u}uBy!<@jd;Bwlj0|Y1B40h4N$s>GKh&eH@GOCeA z0WJ=+Mee9^e39h{OYHz%>CzE$mMkz~}&iO_iB88c)y7@6YmRM1J#{^x^vvXmkTqHz@pidZL4)QJ{o!J;*V}``$9a5<3 zKUgj}enFo}a|e>*mAUKO1mqSnYHl7qOLE}Afxag$JS*?tPoM>o_Phoe6=(JXnEsj@ z7h49wMWIS`MR~a3?lC6QK7B;KL)KdEG!-vaf{;(5iaP;Fb#! zX5-)>xND!*i;jk-3wZrbyE_6BHz=iiK@f=u#Q4GE4IXd#3e^Li%z*0BK-_EcN2SSf zxXw_avCfwyFRZLSs32}^RlF150+<@Bt##|^H*a*IDV~7>#^s6T)7<5+U+c#TUL!}x zp+vfw03<$co-j&Bm#`;wDW9qPd;`%qn?iRlM; z3U^AogGgDiyj}z728~lo?PjRdEwi$-eRIy7Ia3`(+WeZ;BE;I>Ufjxx?RhNUL0nwi zlX+yM63~}jQN#iFR4eJv44|z_5B;8zDG$MxhVyB2lj6u zY>bKGQ~Qdu8Ech~3C$CHx&O?r$7OkT@-V^BT8mDG86FTbvi9E4OCv`qc zg56^FOk7kiuE6!rwB+UAu2C2mL~3dpNzBy2yL!gAFY`p#@|3ql1#{JBKkB58;7ntpP`R5a)PLy^>~v@`6`b1huac# zhQ=t=s+r=$%xqlb$12XXkQ4bZsQMYHywtW*X>OtonlntH#i=RKQu7g09f>>?e+ge; ztN($(r0iuBP{Bx@RzEq-(pD8kZeZ&>uS76DI1=Q{qMD@>c=2s%qN|2!Xvb0h!USUc zp@8W~)^wc|991UukYqn`@%e-f->_{N2G_2r&jv_(qyw&bs*HoK)QQS7H@YZ~i z>TS@yRp&LqBXYy8SJ-(qjSTgo^p<$a*VBxpX5MsJDJVTLkv)8zR}l}?cB%BrdhxkP zHUo~GH=q;PN{WiNPq@a$^CnwlUu{efdU_sXoNx@Ek|4OY79}j7&esiyum%G#)78o< z&Tk9w4|O5&Jq)xGv{*U5DZQaK=~ zyfo%B;<9g!C>hB4l$M@}c&>H*+52YB1G#9nK;Y8N>0s1ZC>Xm?LBs@7v(T<~pS?>> z#X)Hw*{)Ilu(y}9GT!?vJ`p8~qa05d8^~J&)0WoED=|AYB)g2Ks1r7thXv6(a;$v0Z1cG{hcn{|3U=hLq=iP@`N;f9ZX^KA_~t<62-1Mvy? zghzu&w$sqjXp9%XBx5ogPUMf94kdYJ9j5^ig1q+CSpC)RGW zsF8d4RD`H`MK!Gy;&9hsV<#thvO9+K2>+yI@Ub%_-aF(B0nrgM`b@C}M7{-BDI#w> zz0yaiQbltLd5g#CvYOQ@%W3lP2q}WF8F>yR8w^E&`f|ZHuXOj9xR+T8I0{{`%!n$o zD|{uv?Xd3Tca!kjPC+pvuw#3O`k0>f8CM9_~WS_m#G)U}K;1?9F=OUM? zp`<9@nnZ~HYG#|I6+1YHAcmv>CHK)Lk{|gva!T$_t!=)A{4tuK*`Qtx%!jM1xOK9paf25Wuni=9CrXpsRQfOaA(WXbY}&{88${4)wg5a@6?}I)6C`Yo-a2XUJCaflm1W}pH>s)JmoP3Qma)udnNid#?u%BUcbCjt}BQC8Q^+Ib!P1)#X z)!mXT<|f6iMIOoEC>1vr4`U($6(6bNZ?~QMUk$VLGHj=^!W12?ijU5h=DKLL*v{r^#U;JaOso!rh`+b z3^tlhV}Q@$8=Xzht<|Gbk_0Bxjy#`ae=<+B5j=7y@xZORtnk#NNxPwPG>SA!rl2ET zn!RN1ZTCT3l=4F&zNM)&Hp_T1r*EewJoK!yjmXO~xqYaPr$wN> z+?8E9pPm|@6EZ87EYW|_r{_~5{WTx5qc-xZZ9cRRQ_YEiC+}K}AQy~Mq(Dkh3+z<9 zI;g?h$KtkhZ*DS&#VWAzOYAcqVqiQbCY&x?(oAF zrVJS;()}DEFZ;R&#?&lvo2)C5%`eh1ImIU_TL&XGyIB1t&9HChs{|S9F3+XvIzDOA zH8TkZ2_H3W3W6AL&6uL&t~;Y7Q)N!2NSiOYAF_(Uj4sH+GwgoWP4w8V>V3-q5%KJW z$%prEi3jpwUMFYw?3h3>HMdX?#20>uj5}T07kJ6kCn!2&94%RQf}Gc3=@`^IWD*Ze zo@BHQKjUU}+QDK27l(D5M#Oq!^3YcI119N4wjo;)Z7Lk5GybaE*^0Jag}6*rZ>snmvZ?O5Gi|A_SoiJfml#EfMr=sSYpovFDXsw z$>(qvyROk34kEv=Vd57O7g!j=0G^I)l36)ijjEdDR^$H8dOV3jJD$JxUg-9t-PhPe zjNlvAqE}zFW*T~>J6~}pe3uqdHJVqXpe{*Dz2WF(K8tgN-$vJu|B1j*$J5MgpooS0 z?2z5Y20B>mzBI?#ynsYH?O}V;kTbmz{gEZ+iDibzlExb++d*B=RkWxT?quG$!~IE3 z=+1gJSPG55^*7>5XW7dqZohH{@`)(ux~)B;#>r_4c|DPA$*fN1kzGB7)(|G0yo01| zl!Rjz^|JAd#yQ{T!npvrX!Tdwa+x+>cFM({y&>B|Zhx1!Q^x$LOMx#Lp>sLf zVaukbru16fSO@a~f3)`;MW@2E6$sjnmmiRujn#PRuFvXZ{k#h~b|yzF*Ma^_!K~LZ zB-?#Jzk^KXBRXGU8AurlZNInD=<`}Af}F^4~JCFJyOpb z3vr3O(C_)8sFQ>@-}3Cr^jVa)k@ibR zcyy89bU)lxa%Xu!Uicu$nUf@$p7A-~jS_-o6l6XBo4e-mR|`Sbx+7$TcNdUZF7LR~ zC2E{_@g59eT{R$7%Y>GLG%x0ch4FZiq4-hKog&n`ZE?c*0^3{{TH|8wvR|vlJJ)43i{r>M z+g@<9ot2*{Ov6(!MW!Ush8X0!s1~1at5VnQ>dR*=ru{=oawxgrOY>{dyx5vO^;=Ov zsD~N>%Vjm+NpB##RQ-l#7In#Ldi_9bi4&F~jt<^x#loV++?hwB0jwK&DlRe!ycgD8 zdmiu12`}>#3wd^wj5%_D4&}vx*yFO*hf#E{9JPyM6T1v1 z>%!FNc789s&mLK7<64Z2=Ei1x-1VHZy`XnQrjgQ6<&EJh+Mo>Qoi5Bf65GDshI3am z2Ptlfp_1q^aci$P*qTIk-AYm&{A=4`<8)--Uf3Q^!Md>Y#B5kPGS7W?;PxFQtMT@0!Rj3s#$4q3&)!Z~SS3t;|0(xS z;#Il&E(feojiE|&_|&kRMDk?HF8Wr}m_c#+sJ+SHa7Ar-hTg032^`zz&d8^()C?-w z^es)}`au0Ge%q|Ck6uJ`^5xu}9iTAFu8?=Q0cW0wBc{M;2<ZdinYJiHL4aDZUuzPYcKTaUR$2r4H@O}@G{ zlSTm^OIsZ3f%m4i*T#GmRW2mT6pWzWJY^Q1i+i0M!cVM8xF3Vu%EWNR38`B>l+&@+ zwlL;3uz-Sd*`a=#Mdix9H5cLXd*y(88I)XyeZ|Zok{gBe1oIhg@Vt)0H0TzMbn#m+ zbyb)9w1j>pYFqC<8>*E4OH@`_@NPlW>c=x~`bMbKMy&B6>Mf zg7WAdGB>lycwJ2qU2^8#)t;%fDvU$H!ZDt=>#U`oUFz5doQG)M)=yPF!2LsiSdx2X zo{COy$3@~HKRWdtY?pO3YAObTZB6O<_`4nLWd`wLdGYU);vcr3x|wM_kj|GUT?c;O z`Cg<*(7QB6S&FgTZ4+zi<~6xnY!1uk^No72;$GSl?;Jgb@AvA~l`u%unBq{|>ak(p z%EZe2!-j)^o85A+G$FOkjW#gd+N!iIizUcvq6-`R{C>+uwayq2qHN_0+$ELMNGm+m z^>FFQunb3ES}WQe=Fv(zTk%9BPzy~GGqYPY^q z`4rMCku{W$<-LJh*RtC{0QlkuVjRsXci#FZWh7nCRgy?jeLrwS$V4$Z9dn(?qatgv z%{an9>n4rvdJqIO-rpsL52``GK{Pnn$rHcb;&=UF0h1?E+e7a7ZrrgYUf1WWOyhAt zm9tCVwAgx++<+xAaGYuQepo88YL*s5d6D~OX#OZ=4!^hg$Oao1GZhPWcv<{ckVu2< zn1EXOPU$dtZ@ywGWU5hf;fzbNHl{h(gAJD+4r7wn^K;&gO!aBfHOtj({0|M5voM`p zr=o5Vc@*_Bk!0xH?CC3;I1$ZbeA4x11G%|w@?_(6?|`6PhEtg8{Dx#)kw#Jp+jHwt zDbS$Nc9Vfh|NM9^^Pu?K-ZP+?-6z-DNJtX$j%xMJpU*42H@^hr5hA%Qv8W;;>EP{p zb$-VZwyC_kEYpMc<8E(z)czleQXu zZLY)Cg$Lyt#wN41NB*YOJ1fZb0~fJ+j_zC$aPOx)S?_14*qkxB(ML#|8klUN*I&9k z(d8xXR?Pjp_dw13r`kBZoa%K@wa!8bfork<*%ubr{-O%p7+c3;X8_(DrWO)vNg*lA)9c#oG7%-k?(9d zl6o&)mO8I4y-~Q_AVerrgHy&2Wa>7w5#(awRYwb|mk@8)FKHoN(*bKF@iOq-jw6;1 zF9zc9)ECJGpW<*1>RTq+Qo7weN-hoU_>kndGMjbgHyYuz8ytmP(cYJ-@E{=}{Uz zE1eCpOWwPi%5IE8PFf&)J$-dM<#=>&YfM7y1zT;0i}TZ6?F4m)v7|U<3a^O@`i&1x zYNZdflh>07Vc8kHRFGnMtT-7=tf$PH5~-W2<}e~! z;rc)P$`H-;>rjEdDwC*1ZsU4g*AE2ZyB8Z$%o~oYEW}-^ zkW`4~8*11q^*6tveb|k;$2okn#rmdbpZZ2j?obNNC01EA)u4_n;}PK49oA z{(yFpiwpVSuCgnG+2);_OTMXNESlQK>!iu)u^-OX6n09S!d-PPus+w|s{@cp0rC_BhM=vj z?bf?CA)}5l7m&4yv%d#jPxJ~`ak25UTG@9@wXO3PEWtXZyn$~fhIS2a51;c)>TsIc z#Pqfi?pg%-yWjA6(M<~QHLJW9n6GF)Q}4_^Kg3$eh!@Z53f4F97|3Q69T8J|!)`l{ z1gPzJMrZs-wcS0fJ2{oZKJ}U{-WBcD0$tb&eXpj*al(757hu+AqF?cD& zPj|b!6BC7$D>YLi@v5!qG`Wf4OIFs)!pXF(34(9qFz`IJF941^TB>w-HL%*-EXkr#bvJ5^uxw6=cyb?cP+nL!Eq!n=+0 z$Jg!)TDi<&hai*78|tb)RmVR<@&e$$mUfxGHjWb2pe=mVhJXJ2c@e73B6}UiuuNl2 z5O#-d@x4nvfw;oS5_Pz@B0dW3dN>j(7eEheSQ>8t>)+$wdG)|SaS)UZ@XfqT$uTJ= z_@49?pIS#1&+8>cc_h~%WW!!_>9NV+#To)>slnocG(JKeS<|q}tfRQ>#kM+0k4}S@ zFixGK1-F$ns0*lm;BXQ5b@NQvJnd?=>2q`V92+-}n4%&Fz@tsJ3KePZWcJxI`4F|J zpyzc;sH?B{RAItBAN^C0bDHJ`j?h*-WiwTlSy4;RH9e?NrJ%$}ee#^AM!#-5dpiN{ z5uH|!s_m0oBir@lqkFNlr?zlqU*D0OOHZiIQG4fYtuIlV^gayn@IWF9mJmHJQn{u? zH2gu*!+k=RmjBG9+hC$$NjWXT0bi`dJab~-wm2=?a;GU`+V>CBR$gM_28*a)IYs5w zr$!P~6aN685|2e)tJqg^jA0}OiV;wAI`$Knp&o#&$nFoFVW7#HN7TrvFpFY}J| z-G3Qq)~RXIrJ+M{Oz%Z<1mEPG&8Z6^KK}PxBFHg|#D-qWc!-6>BE7TAn4g~)@vwNq zc=F_d(b3WK7cWXkO9#GMc)n|HViLW|pp5lC$|g;(F3 zXg_rm=$&W3&uw688U)nalbqj8@)h`K3$QxUySzDuVOS*W^x9jU< z#vjymcy;H}YcIM4qt;yr{}AA>b4ZQh!YXI(NqK)tYCxH!R{-7|NvE65lCFUP+K%xtcPR?xXS1gP zp0_&Pt*M!r>i`-g0YvZV!IHd1m4T(yL2i41;V#^Su~;4LjfPzf?1u<5gOnKZ0R)tK zplFP03OI%si^Y*aIKx&B*gi~DSKqONlWI_WZ}haW>M*x1jId@M*l}bz)3t197KmST z5t~#Dn;|Ay<>d}MB3YsFW{9fLIc}S}$>Jbdyo&s8WD?U-_dN0Jn=Bq)j z7J>_ro;ubW8`NP8%-1&76CW8lt-sceBM;?~BW1uoKma13M0Gr>_2|lh2-eFtcD6V5 zfSnQP8hL3b)Ypf7cPn{aRw7?y#<6g2ZVr<9HJ zwl>$|Nxd-wb{Bu@+qab->!>}59F2%l=E-Y0vosb%E3rXms=)QqnzQW0lXR&k2K7Ek z@`l654yjq3%eL`TFEuzlDR(^RP?1ji<4b(J_;RN>rALgv|i1+(V zJ2Nk^-u*=9%vB*~$2Y~EPMdG|$_0k3ns$6;#6n`^@T#k+7ag@sulFl7l#2rj9y#^I z{3UlV87JCVhdDeHY{!$$*Bv%ijI%C3J*J?baD>N#((f?YZNlb6KET13CqU-sLt-V@ z$hjmyqoFXb<>&2vaDBnU8y$DDqP59cl0GYO;tA;iuf)-6iP-v~vX6CEUtA0c+df86CiS3=iTzeg~OD*c)<1sl?MzjSTB`V z0`AS|+7ig|@qB^ZVEA-L1zpwY zDpnVs?j{4A5~>yXEgJs3fqdf^KKUv9^2NZ;iNMP!t&tM1Omz=a4(mY9rAHen79I?3 zN=2E!s;xiIfSGRDP43He&(=MZB($)Q+bOrP+Sk_MXy?3W)Fwb1OL1Bn^YV?2HbNQR z@B=SQ@KD`{aI@3-oav!W*Qyc=xTzp^)^X&J!*jQ%vUNi(#gH^eshPppLw{1#C+mv` zqkF^ooh2pa4QG0*#9Oh^)h0Psw?~Cky3Di-@H91j*;hySjPJfXg}kOcJYGFhv-tk1 zzjHH>0lkS+x$HF(9{siHqiNfm7)Q(2M9VG;5L21V#SV6qB%#WrW26=r>BK*Y7n9|d zY`b=U(s2Qo3ompDH1jWsvaxdB4U&P;i2N|h@zkX`~4mlUML>p@WbMHP~mM1OM)`4+dsW3d9%Zgt*wk6RBur)~~%7C7=UdeX>HiQ`4E zesU}A2bHOLcE;8h3#!pwXE^x{(&P^`p`4ds?04G%F$I$PhDRld9ST?OLbNn5-J2CZ4~=8>BjP10S5$= z@NQm|4O!4vSG^&SfIa1+^Btt?(K65D8rrOm+p7?9%@oxhS~4HV$K=ly4j~6EPwKEV z=(v+|_C`jQ+@&>GxBKueBQ#v%#$dSdw6dwJ&9j@Yreg7URvu+XmU;0SwnZ6opEX~I zn(&plipsv&7Kl~Ua__S8gK)ozlfo$`Ob3vHqC!(6rQ&AiZQY&Rg2l(9Rr_n2Utvj! zW4F0EOjJu{U1rA(#UD-AC^|s0G-uc%%gm^dXZnr-sQBT`Ivx|vF2(k>Ys1cr2KSfh zOb^U1Fs+?nRL}!>BonPzhvwY@I7U|E2_Ms?wU0lcdS&I_lbgy- z$d8|LPB@C2nH|n-P@*hKa7ryHZn7*~puTL#F7m|uLXAAnIFsped_ujNEFh|Gd_@8- z>JGROg?C81Tg=UyBbY@TPVGEnOjIhuL)k8u=`B_M}B^ZSB|- zMl!OpOQSXDi@Hgu>VcAmhK8dH{DuCc4@`&4`52VbJq%i-F})cMd>Cbi&4qM)pAf~aYz*$ z=LbDgQ)vbY%^B~-Pl`x}Ys$D1ZJvs!L0T+mTd4xs3t>waoqM;eqipPwuS$mZ$X0-Q zkXi%uev6!GGL0{&$Rq^$jnK|+)0L|yg>Ms}HhSsz=;2KTf4KLkI)@QgNL-l2I0ijG zSHj#>@5Axi1kbG&oRNl6YZI-Ro3z_)OfEEQ*dV#k8mU?g`ZIK!GU}79K97II{lZ`- zR+gCKxa@5gj9ckajuAaQJ=LPuJ}lp!x})Z+SV)lzhas+zymhw zf1IjaSY^7s2oPIOlb!{(zN5A z*Ns5DM!G`Uyj0V4VqqOxi#OpW^qkhBxGw`s6asAPV?T&)Hl1DI5bzOXZmvpGWUr$H z9%C6Kh-s_N9E(3>9%g0#tl*yc>EpWn7!+IC)Fw4li7x*2yBb-7z17~;&b%9-{d8>?*T*POa zlV+LTK8|O3rYX4DxS}m+5C{_7 z-GaLX8iKoPqru(XCAhmg1a}DT?ydqgT6~KgN9UK95@LE-H)DHIko&Wl;2e&$qJyk65E78OzM z&E)DkIKMP)n5t*0WPG(8&-`Pkb6-)=H?^+;6FOu>D0{wsKa<(!U7BcrK1*dDeX0&4 z9u?mbw1;(Vr-%Xi`?oD6&+=CZLW}y|#@gBa_iKcWb>bMrA3#}0$5#&Fhlj1q-jJRV zU7r!*q`n@)QmFs1a=R}LaN**Zr{#NxLwz`qL&8fh6tvD%d5rR(oCP<{FZ3Q znb|nkPU<@hRDZ#+GBWxkMohUMd}5@g?f6qalo}lLKQ4feV8?a)shfIh8l|Pqx|1Pe z#Ozch>RO^hYDrwZvtGLkU4?3SAix?%T-yU^wdzm2X{(*rHKsRTWa@167v+{Y{oNdNo1<>{a0s)EemX{``_2-X$==$t~JZ*~d zU(?If9XdJgCEa}7bv%%rRpzW0v$?xTwU?L%mT+xOkL^Lp-)1zZz;A;mIt5HMu)FIuQGV&D;3AZfF7GGiChq{ia`jVPOz} zJs3V-?O)vA<65QZc6y)#IKs&7$3BatPMxG;Tavx`c3bFma1iPH z1qb9ODA|`-P9-Xt>)|Na3sC5Hdpr2N5^bz4hBbVnMJSPlxH*AVK)EZ^tw}Hd$}UqX zE7&`mm^n`;a&30$m-^L@~@Yrh^6o6l+Ts-7X+TiRYc^Hbr%BEzqZIpl#$gB(x z<*7G+p;+Ki!u<9J2eePtYYhYZjDecm2A7onI)9Bg`toN3g{tYN!wyivb)TzFDG#_i zUk*X?-8;uW2_`ED`ye%DKu(cv?FT@?Am%Gu&SB7SRN98DL@o6-yTYxv zdgB}_l7_~W!ll-1GMP~Fw)^o;=ki1w+pO-vQC{ICY8f-Jz9l}Bl$fvcYU{2a8Nv9te#0mz>>=^TucvQwO^5Nh?<+0 zf3NHRF7aUhOJKh0*H)>mJTVuVy*__fODQ4qN)MX$eCN$W_}<``8yh`|1z$?q4X@q8 zO^UZD!EZ31$cFX5>gyD-C@1d5Ct`&K@*F%6+(JHnl`|JOc+yd7Nj7L(ptXUW>M!{_ z)NPf;u+c51sg#2YIyg8GA;xi3!HI%Ot4@f8Q2a6FHwJi3sI>>wA5Co(W_Q}N$xbm* zN?nfeXj=J(WovBAm>8CWCrX)H^COa;G&M<^_wRDK!eG_irge%O(EFJ{FTx?X5(h&` zDugYo4yZ6WdVT=%C$j4Md$q|r40tSvOMt>a<$=TR`R){uzK8-HsDZV07TF~-P44dZ z_j6JtHF{Hj^zWbDRmSsoRWdE#HQjNIy+8)3segYw{~AUOO#rjK@LI$FLo9yo({FXP z(A*#+u|;Ys1mDNVU!G46dHnxqTo{A1TM3xI#N;ic(7amggGK)m_yiR^bVxFoZO_SI zf@BZn`u|uf)Y5AQ+@6mHs}Rd&ccW=)S}FH&mMKHQ%`8U%Y);7eQ^wtu_RAh^|Kx+- zWDhcUw%iMc%znv$GhR-&twm_u;_G`Cpwa5~83OBPGRKw+F_on!ucLIwIEvryy z_M?}Hdi~aV?*YHRb)CGyd`&CcklC<2HM8)!xo`8FzoFL#t(x1{0(bg5Uoy27^LOr4 zv)gU9&)srDQ@ZVXb_EB0>@2Fxn$S(-bdumj8&olPW+_9vY4o=iw8u+dq5a`PkrSs?+(3 zL=&;cqZFePZu|0*T>iqPey}W{_PJyCjLd9(5F;|7%hrf}JA;yD za)!E`>;8E6g?Vrc3seI~EP9E_HX3QKT1zPM@;w+YyTH_oLG2|*CW_$gL&kgWJ{^r` zyfGk2geDVZa>v*z&v|44LhKT~P0&k{J55d27RW%XZoRA_uOosSVoza< zK^C$5Zjpnsl+u(JfQc=?mM}T9CryPhkH6J^XTrj66I$U0m~pMHp;72LQ_hK78O0o}3G>XitEjc53%gT)l&cc$J= z(f7Xjwuz8)-Tx1-u3QrWQ}RwcW|b4~`8=Bgd_DFageK_>fP+VW2tT*fbBb^_&5J<- z%ucexH|+KG&(=GG^V!{xP_No);+F*>&Ua|ZUU&8nH%^${R1$Sx@fq%vbHot9WF!w5 zXF-DVu1Zx`coJ;S53HVr>eAo=QY%yvzVPFPO5^2P!!nJUoKEh!2N@CnQks2GNUOh^ ziLCtVy_2A^iH!*c1>JotL1^|Kdoy zTzUJGw_hQ}>09ZJzuzr`(56Z9Ei_rK6*oO~rfx1p9o`?q8VOkK_1g1fD|wb3kDxM} zA5_v~qZVvW(zciTz6Yw6il4+zrr0EX()ndB$m{CDviKu?Wc}lH$J@NL1Na$K z?EK_+zSCLN@?9*%)Deu&Cla0{+trpM1Q+Kq`kD6nPd5bg4xVUlSBA}S;kyq zg6V;Vz&{X*H}uQF7Y~r>&GFr#v>^CPi#${vi=>4 z7Zpp~8GGAd`v(f4;y7bkNiAnH+SR2Y9~CV}r$h z(5z}N+|ZpOpP_AjRA`F4>O;|9%T22kOQ#

Cl9$kf9I5qdaA4LQk+KdG9U)G+iS4Xa!978Y>(|N_B_G9TWTR?p&PCduA83m1#67XMCE_zp zA+W(>~>hw=IN(I5Dwu}Cace1%qMkTXjr9UtMSTd)p*12x!A~?b?okh zE}1);?NEn2rYqRg1y+Hsy0D#GZd4iMy9KZ6c-S{FA!xNGi=Y6scxWAA@Dc9tk2WzH zX4(Vc!-~<|~$S#W+_KJHxc)A%?$O484d7#fi(zc*_$h!;WQE&AMMuYSWZb zAtUzEB1trm#-r63B)!Ccv@NSBNv#;hOT^$e5R&yCK>O=||Qgzl&* zz}Mef^k;Fa`2J>-c~^ibvcCNkd_Y|M?m=xLK2a@HYGamsN}E$vd+>eaoVD8=gvCXv z@i+P?^ifa5sE8q27L>;1O+|3Z&JdMfu7T}^W4qr?UyKO?;Jtx=(&gRZbKw@JQen(8 zEXcDQ3v=_Z*XMhN({@i=LS!8Mf9VMrKTYhGCg;xq7?DE27r#UASM&+*yNmlt^Hge{ zhnAT*FRn=Lly&|IfK{AdQr)*>BSWU&om~TyNPJqfhxLW;dYDVS!TM`hCp)N!_Gd0v)6<`O>XRmhqLsQF52rZL7m!S<=#rMmF7A(@VO!PZ=Y0KC{G}y zOwiiry~@TZZqa4ETiM2F?T>9RHtaCo!1{RCGN2+-zDQJXFppa zZR}iOI?7O4{exTv!cYsH_Q#C^3Zkx=Apt`^z-vrcQIX|bB=0*Wq=Y~4_Bs=ynQ#5R zhRE)`W)|IYhFuIv&=Vdak|4?6KlbRE->p2_bdZ9@e$dbnc;MJi|C6-Wj;JW&s*Mc$wgrgE&L)B z)AKtH>1K)RD;mecnr+7FsG%iJmYA>7Zi!Xvi5d8Z-fMFGXEO6|q(7QK0dBF|;1k_j z34?3BxiScSRx@8|iFTFAGYui3&8K-Mw~GwUnbg7e*cEKNdQH$zP^lc$`Ii}t$4{~; zdMFLX0!AJP-e2F1pVWVgpc=QUt4#{;ZEFgI3?o$gK?2yW8x>-5(h4ELM6ww}auA z6Bmmcg!?kufEeyi*|Zp%{Yf)X-*HS>en~1R1)Tdp1v1<(Mi5~O@rc%)!1F@n*>{^d z@4heF_cju?Kchh&doQp&JX#nL1UY9bzdU)zo01im{guNBa;^pa-d?1nrN_?n^6n#g z6`^@tj{MOnB=*V)B!D_a^-HD|3|q+~d7E0zOvIW))GJ@G?<1oLp0!@LtOBEO`QhXV za7THvJ14nAUaR$d=3xNAC;K3Og)DYzvxYucGU4zL9^pMQYnpUxha?!GI2y*$*r<%c zojF&epm!*`!#+NKuF90y8H-6|ksI9m%*_&{H}|uuw#0*!#|i9w^q|I=4T56gjp@r8 zp)s&AiKn(Ik$)jvZ1OTV4u-^A@1a1+Z4GUcZQkB!XmD`w3J?e~??2m7PfueNZh2GL zzFL<@19AP$X0`hHdA+M2VeJG<;yDL%u3Q&Wj$rM)<#gSM*_>gCv^UR}*l}ywG(rrS zl!Ip;GaD+c2>=vM@iPlhYF&}cOk~e&+y{Pd&<|}z zc0n+Bi}#A;L&!XNhXw{5mk+1rU%KGM`T_|UVH#m&@ctA8M=&E;l*vv-l$zcF#C9PA z%ANFQ^mq4H8R{})TO?%H`phVVFF)UzclvYc2O)Oe^#H*vu3{B-u$+MdZR}sYL~5(m z##-STVfL-Z7oAln`uVefjjY41(J^b*S(d;@_E5xg?l1h3hXP43V0MECon#j4h>RpS z#B*YPPvS~0VhkhqpDnYsA2}>}p_Zm?(8PWUn1K=pUm0EH0K+kZIi9L7r8d95GK7?| zadCwKw1&yaNwF@jBOdZkXh$0zT!4u~pk9~Qy}X*M%OCNnqY^{|r3cCVv!Xp{#tt5Z zWh0+TbqmAS4KZS3+<>eqsUp8t+#QUbez7H_nDLj0#Lz{-ZIA8ycx<$;po?X+^pi9R ze$L^5u*zU-*j2dz{O8}@Vefq`lb8!rgatk+ZwuWl+|+&4UaN*Q{q%g7al(=smk!jXxk&ta#o^B7E@MvguuZ3E zo58Ekva4@o362i8$UzJYk;i{XV-tsN6Vj6d$yZ_WOSL~f{bg_$-Z9#HmPLmDuPY@+ zQW84JBlb49EtrCCFN<^aR#f-cN%-XbTYGug)FX7U5-|RbD}bV>Dhl$pwoV&GA=dG z1S#}C@D1_BU#rJcWT*Zj!$VI2Zn7Df8$5qZ#W?4IJt5ef2X=@3RDk;5Epth>(n z${j8$jnyv$G`q?kCR!h&Y6kUSW`F!vN^WM3%aDZgW@W*U49c8(F__M^ey+3lwT~+8 z%WqTpP4SxIP&Y@>@lwyAxopEKWsoaoy!;!(pvPylk7jRN!swSDBMkIc?p5`=V#Sr6 z=tuii`iGGq4eMAeHbFOu_eHF^~NmQG!!3>bSj`X^v9|!hHGi5nb6eL z!J?w4g5I!&G%OO=)UHbPVr=on2Vr`cTR!G~2XYnjCy@(LGzNz~B$LXP~!qXf*_$h2Yym5Tr~Wz-UTtrkw-7k^STQO=f}+LDmPkogX#DJ|gNCf0n1HazwZa1>K-=e{zLV4@98Zcq-D>rih-fc)Civo*M{&# zi$s#AQV{6yT}Ucgu!3h^G|Y-$sLiKYS2x<9R$sNYGJskC=I~a~{Z($U`EmO_{KaE= zI?88CF`JIIH`Ew)8#CTF{ZWU`&^nS$aLK60nM2S|M$cPsFg;L6c@i<0e=PuGnu%)Q z;p@DTByoFe@1N@>HeWHtct!aT79L~r4vEF_J0QQTFX8aMQA3E?r#HFM@%E@uC??lokvLE2k`UlH&RBUYN zRMEe)zMKj`MbKSZ=>OoYNVDnn!y&*8Rx>ZXJePJ58|)d*A^c-zjlq2&=daY(R~=03 zR~zKVQd5@ymIJ*hk%HlRDIat5+^%}?EqYI#qJBPph*~s#Hr>UvnlH4QPgO1wct-gU`z zR!04uXqfmP!!iq#>+gXB93A@xcvm|(IVq0^iqSlV^#UP;)npXy@8f~=8Q4i@^q;stgI3=OM9Qe-CMDZ0ki- zt4SFE_FF)oK&@V*_oE-Ycall8QX?QZq;J1jVrX&AEhG5X>`(|#|ruD=RTT%4P?CD~5rjo~dtft?T#>&K&VUu}Wk2gUx8z+Zg zqWU+MiFzsZ8>wfgf&E9+zW!`@mCqV@+ORG$H77^&Euf#AHcl%%pxAEAG1 z4|^*zf(JSI^`mKXF~U)NqJx9KV%5ClpI2e21CN*hWCaZvJK^C+SP&?4vI@40jVg+^ zSzWcy{(7>W;rINqk2K;H2_ccto2=`EfF+dBJE|W#zGdduUr>vDkb@VwH_!FZY^LA3 z>X*PxjA5WkYj~Kn#k>5?8TtKQsbxj(rRXrT_4W!X_V?O&&-=qu24V;GV$+?_+wV1Z z%XA+b*7r>GSDU5VeYv7_W1K>XhxYO3^!vd`^4$0fat0(_@j@djlWD)Vz>LBffYn9b z#Bc7*KA66U*cLZCvNS_mpIK#_(gmmaOo52|$Yxqw#Nc}SU90b_ewPNh>uv3i@vfww zE!B>`gXE^)yB`tsSbhb0?5WfCna$KN^bJZ~D)qI+Q2oY*Zp`RioA==3gxGQcVtVudR#@ppXMos-U06vQe)%&?eLXcmoY6LpnXLB@Q?%%B0AW z-;I4~To$5pR?V?^f>CV+va|(&W5WQULcI;Vt(`o??=h&%S3$p-8tpsI%HtHQ;0rDh z_rIz#3-AW8E20S1}pnLnb^(!QR;$2#i~8&+0Q_q_$-DTkt4VoMx?<^Q+dIA0=!i#J zK0*Zwok5eo#*%R#qerILW`5iE)}vS+!35uv=&nFqK(LC@mz6)7a@>R7@; zI8Xo~Xb`{%>WqdEG%FaoP>2oeAHEMzo$rR5Zzl*cYl`A9e7ndNo7&COmK!Y6A30et zU?gIkxcUTv^)rK!(q)-?0x86$L_~mTZ%t%Bdx*Mpd_*F{D+oh={@{UE)Y+FBU@P zAU5{6+ONibu9t5ZqAv0=PxKR4CohB0|Gj*q_lJ)jq`1wbxUP|ex?gN6y>gT1dN`dF zyKmTZs>?DdYF3qi;+Ht`kxQY)iNwW4{JJ&?Pm>5 zw9O7K3k7$!2LHT099_8@I0oKQz()=sfyo#QhNB}eiE&KpL({TM0ryS`@EUAl&PF+H z`RcJ3^?L*@?Z#75tNy1FG#dtV1ub_3!IdGIJ`O!T4)T-0XR>6PO{DOfeNTf?^!EuT zrmgWCn`<8TG56fX?oc`>TU_}-c9P4$nTTZz3pTx zCfX;)^Gu<<2*@?Y?~g=kT34i5^}Z^GV`8@xND4^BLD_%GyjrfcV05vKJzg->Xp

    Y*ogHzRkCi4$k|p}7vTB3V8zls59yr;no&pST6kYDjB>L?3HR ztv^}yy^n#hoKN9i`-dohjRG#n7hA$ayl!%Z*u#gu-41jF}%fMvE?evKiTtp8? zQ#o*&mL@b;U609*zw6gm5ZhFKl|)}!*xW6R#Kg-V5qGaQUuNs^gMgOTI;MRvhLfnd z$x5^#ql((8gz>7IQ43$3v9MpXEF*F8;q{m^SahO@h$25fpH`>U;j9t|bj2UQtlMsI zFquKC-`zQ`8Gk;)pDLC(D5om&wR$%}%@8ljqXa=eQwL5%7>3NsBur-M94Cipg3(aA zjk6%Q$TefXL~jLW-Chb`920eI{A*gtZGuL&F<_QAT^%FN3WWIzm-K z3!}o8%HJ*D^|MS(fIq*6Hqigmr!19IF^{flWg^8Jkc7BVh&Qh5)3TtRnQ|))(S0^m!X9L%Q61R{_r>~(5m%& zm_04$59bO=pQNPDZi%ajB_i&J+tyg?|T{Rh59< zC-(#}e)+T^E^0Sv`o7x%{6$Z_mYHSTUMpOZe01gZ35l7*0&w;T<2~jqcRs^2WA!2; z5}G(Tbl*(vjRSeGPn9~1*s$2p;aKR9#0iDBoS_qqUeV6FKHN<+L4V?ghvst)vwb{c zWp#~jF!gc;ZUsjIKvUZuPht4S9-w3rBP0O+X@s7)Cx*_hF5y6m!dW%?@n7s#^JQ}2 z>%S}PH|LvzzmywX{wOo*w8qMyVOIwL(wEV%eSLBKF6HPS{Y+C5X%G*O?lBi%-WTdD|K zevdNPae(Jds(#q4)c>2Q_&#jIy#N>W-@=b0GMIh3!o4=YDV$OBR9o&l4>loZkzg_4 zu1fg!a;=C(uS$D;4;bBB!7_a*JQ@L?p32AEf~$kM$5*oo0}HVM!3O!qk5J<@XqYbW zb&xrizh6eSIAb z7k30EmRZxPL@{?d(5Pzw5JM!lt6=e@7i55QQlcFOlwtE&2PrM~(m2jVS!D6KtO-qt zS3}CiJZYRTL0IT^m*tmE+Sc{4GO2|1tMR>L`4qBqVqnqKoeyv*dDctSt*$3H03M~( z;bz;~(NPG@?(z6MSl@k`0PT*=YGZ_8YyQ2|DDY=P^)(B75Hron=U~C21tHMUg}Ug> zW}}b#Kox+d#2=t^zCjyL1eK+H`)F{&NjjJfL-=^#P=X>RXVdxMjzgl$1DaV+R_ckO zHBiOiRM?bRrH#P=H9|cF-2+R7@_N{RL3ebBA0EMiGkr8F)#$`=4V|Szulj0cbs=W|GjMh*mC_#OKF1p zleEceVP`**%JMso-Q3(>n67?#UTg&@L=b4<{^$XCh%W{lHp{HVwrr0=I@h;@O@}#r zBa!pur#qTY7WG7lrWtAVD5w3(N$jWVce41Y1YLno>oO`mIt&>#`Id=gV;AL*>3c_W zg^%ZTK<#YO4Xpe_0=7N8eTou8)s-%EI$Z_%>ZbYj0Nkd)(RBR!G;~_`XyPbk_4USvc>50Pz7GRC;wX z;MIL`%jffS^MMqXr$|y<+z`l9x!52V)bC=y6$OhA1;`{Hx3&xb)`t^VlpI(^abqIh zPH**D;KLrf*a^SqRgtnFj?Q{5bi77JZ+>v>F=HEXqUrZ2G!S=^GEVOL-N|Iq2S)Bc zj+!l}L0*(*v}~3>rHiyS2J{-FtDmf-8kHcD0k(zN8*@WT%V8=(yRvN0$!LLm2ozF$ z53+90f+<*KSqc^CPuDd!*9Tdzzadf^9UbDIkKG!grNBT6f13IDkWGjb7D;SC8x+Dn zLtUQ#frcu0VDp4_95nu0o}#qex~eQ+`q!(~m0-T0Ka%25`L;%aZLL%s!4TqH{_yR2Q*iz&Lx^( zJ*%aik7WW+8LAA(K5pH#8+gdyS9=F*rR*#OpSwB33F>8*Dm74Za&q{>$KuIEA4Cac ziew?7Xg?wF*XC7Po3#B|X`s2Mndbl}Y2P#iGKNQybi5U7ltJ{smgtB3Sq7;E@p*Zr7aFpsj zTA45n1VkD1+Qv4eJc#yCiG(rQC)E9NGMb0D>v2ZO;eC-x^e&T-~mk4uS#1%){Cl7k|GtYmc2Q(T$QuZf3DGqt>7R%DRKc! zG)yZt1`C57-=tA^epcrX8S?&dfet4!A?IGt($PJhxL{#!(m4@!z1**JK$gTGg9*Cf z)%^EHqd^Nu_D&S?W}hGl33HP=AY=+@S$)pY)sMJh;*#ypzbv3OR=c^en=26KBf6T+ z7xheLamvA^^25ygD1$|xg(6--d$adiF(dtQ_)Uv?B1Rxe3)DHJlR=?gZZusm(@7>I zpoyp$n?iStughNf=OIOTFuEinvopV@8w?WXtFRw3q6EH2e3<{{LWF}$3Qm`7j-yLc z_2$5f7(EmTuRIiltiVYYh#=)-mV2!cQ% zU+Pbcpr7u7n_sO2B*YRNz3$IqYPz2yNiD?3Hlc}#h&&o8BN0l+6Vr*p7$y&?X&glt zGxMj+2fpf4wy5muStxI|J^qYOf9$Vg!(~_YF>}(c`C@Y@A;o=;I6b~i>xB;OlHz|+ zp3vREbFOmD%~2>3)4x!u(WXMjUyLh`_6cgw9UBLSnp;1b4{KA~Zrb~MiiA8w2J$;3{of*EFe>m3Vie(Qi!_z`MVMhJgyrrm`!$|r2PHjfVG>yD#a zcim^nL;Lkw4?xy#{@}>Qyb591U20%N{w;B%4UvnCkq_b83}xuSa^gZIZLw_Un3DZ& zmn4nV_sQwu2_{d5il$17gCu1|Lp)MJQt%lMi91m_xR%uK1s#ZMs=-+nl|j(VdYz*| ztU#k6Y+EV&X#%+;)$J7~BI|zXXKT~2El#xf4QA7+xE`|DV#iPprT|*YF%~=i3C_PS z5B2|k`A_jwn~jX>ki#W^$~lX$FhI9f8hxXE8|h`9Vb)wETUn%%hN};ovpqBJ8M=vt zu;NjC?w2?Opt1mw5QH%f9l)+2P_#cGI}z&8sd%)FW0za1pdxe$8I2s) zlJ>t^R#N3Kr9MiA5o>RCG~YR}DQV3gjIhHFX~<)IX>5x<-1TXlyvvc%3&$t3nt%R- zULeucIb;#&-;DmTwF{!;K-|zy8+$Ha=^YlBk*ivU6PbS=_FKy3s$N2l)h4d<37h{0)eU^h^U1my994CDJBdYJLmBXS z|NM4-bo51_^kdJj+S>Rt7J}C&vYp+6uUAuKiOZJac@WCwz&1RZ$?kPUa{Iw@xUx-sy9XGmtfdy-46{A4o7l!7$aYVhr|wmGm@IMTZbt+z%gU zt}4Q+r1`=ytk{SH?ebly?4ATm3MEj!95ylSsjjTe^ODn_B1yGApPbx;5@fX?HZZ))!TLo z=n76)mE-rXE@L+g2ZOsVc{re^K|Ex88E_Lx7U^v{4-aDTO(T)IQH4%-{qi^X93KSS zQDyYlK}fe9{!qik1}X}x9}It>fs#F#XlcV~a>?CtZuEqbF4-;60Qw7su%De~L>=T0fGdX$pT1OvHQFN$msB^^Qu!=4RdM_6a(M#xos|Iv z8-uEtzDacFMD}aF70q;ZPrwJ>gX{YPmW?M(@b0!}iY|?IR20cct=+Y-M|O9lE}^-3 zN2=(^bpGb7rnepO8fR*!nbpzz9_yrRb7+Pxzx1m`XPG6i9|TZdhruEjG3ZH~h*A8Y z7J9U9wpj@T;^n~~p2S~?2E8xVVsr9PnThTU%w#MSOTJqkEjA&y`z~E2HO;0pybYLdPj{8diOGuuc`Z=Ya1|OtG;pr8 zx&YQ=jai%oOjhbuUjqOMg%O}XK?uSi-eZAEZt@1?!plw88gE*yUv0aoKB24~uXy!o z@@EeL)fp$|#nlmH>FTSJl;WzWyr$Sx1Mjn@Dn}Hm7_z2S4xdjzlPt|;ZkQzNJ60O! zI?(FfGV^_VLy$d;83WJHW^KOl5$Lzr_=A&hwigNuUm~>^6B837YqVY?wLtVnbJ+>& zUPTttveLmbKW-f?yY-wj2pFtJ*VWscOqs1L5&@j?3d3Tf9fZo5f4mO5nwFi%g;o_7 zB5GC>zWpTt^S^K{*ZY2;ldjF%Ke?*;^K(&TX785Ly!9etPMAjR#rQs}$>gTove@;B z@t#UjQW-wz0k_fWjVky2i3!fLHeeN`>u9kQsJJN9_wj&nJzVy0q}HOy(q2(&IxEYd z7;JC;fknBlLzhrwz~fGX&@zE44zo_UMvb0fU!bC))hx%5Do47|``fE0Ng=@7x4d8+ znumtmM?(v<-FKM$f!oK;C9>lKWa97(-hkw?XIk~<3`#s@ab$79wXSnY>KUDo(K0-a zmwKK!Ux}r808hTgu|Ej-aA%V zq^(izxM4&q2`2TAepTAlyOq@ygyz(dZk1_XZ7;>>Zw3b|F6@f70I(y!6Dn5#20TzvxR~D@##O8i28q*s2TI3iv!lp zlwe?aQlToF%9( z0%p>d;ke&PwLbJ{2{j=eEpA5*mUg{IB9b7|0|yPQH@7zGKZgr!VZ~!LfLLu#$yw1z zxCGI07m}Z#*$OIt3Zc?i(6|^&tY3~CXs(w!SdaVP)5QG3O%`Qqo`8=Ia@!jvu$L4m&`J5cP>iWrgrzLL5O9@^Vfx}U zH6>cc;HMb%=X~O%$D^`}POj8-O93g*1BO4udm0UZe^xQ0vP+^L{QM7XT*}0WWV%9} zkMLu4tuK?rORv*)dy4jKosT+rhnI#LOo%h3L6p=ZhTG+Jv|sZ+S*6(l=3f(hm|P^(YB0h=*27Q68 z&NGOVF0?FifDg$^0gv+=?EkH?q%lBDJa4hmh0l4816rhwsBz&UW0AIPqff^Z1V_9k z)RS`Z9(shHGX5>RHahLVdNAP}vz5gKDX?e*lXB6=oJ!82h2ZZO@}4 zW#HFM)jN_K6IZU?9`-B~EmF0}kDW2ejZn1e<#Cg?PL)8!10XMfe;!Hz;VyoSVDLGx z*BoByN}Yv;g;BR%)in6$&?G#y*|d2iK0%d|Fu!3j7~gg3_{)G+(j6zr*~pX3ZqQJh zKNs<9mD zVX*@!pK$#H*YvQ_=`qeDi@lxUbgMpsL_i5K94;(q9+|n6k6yM}z%@;*|3TYYw$&96 zBB_5kqrhyr^|960jh(*E5%@fkYq~=w_oKUsd3l5})M&XE&E&f?Uc=73iF5YEYU;L; zOzKtYYnQi|DLj4SZ)#cBj1!BhGHw8l?g?}QHVI|mQqUtnX~Mre?8ZHuwrqObu$$sy zu;XUTOv+=h+p7rt=@z)IbEtgyQ6Gl=YDo*J2sk0W0Nx0TbQLP=K&9y=K=i+;s!M@} z=>ZvG$fZ;zSE!RF;R_;cCOIG<%!ml1_=eLz!Uf@sYqulFpnuJ4H)gr;BJ1*Qi$LF+ z{I7EK>@i8m=&@n2%U(;Qv!cy7h)NUwdUubfXMQ^Ty4<;IQBt-ty=wB+C$(yI40>Mn z%sAHy)$+uu6ZBhXNQEuHARmw4ivyUh6seNq8--S9nEHHv-xgkk5Y3taKi^Um zGpo8#;|4$p#8Y_4XVa&I;2?MGF{8( z*drGk<#9o^;up+4^SM}3^Xu089^TF_CU~-(ibQV>`HXv$BjIQ9DGC;Sw|yH%KNjmP|G#2WKtD3u zbm)=I(+IUc{>1>O#+SR^DeZJeH?A-U4`Pm_{JzYq`mW-{;D7+6ZwT1tR|l*{^?nx& zg!n`n006Ou04)5^a>^UIp`17uYanN^0Rn<$+U%Rdl*MXqIk3hS&C@X%N-v7%(z`Rx zPr`}*DFi8fMxOn^egQ$^>HHmn&Nu@o2#_M%?#aF!PD{ zF5;rC359uzt89;=U=Bb&*DKT*qKUXMn6#T!;UVVA&(I$L7!;TcAOjoOB)5kW(%T*w zUo$n`6t^2tM3!PgThb9lyZ#Q)(DTvF1xR2#WZTQTVS<3R<3C;sw)q^66hQEM{Q7bF zc$-loAy-JbiZpTOWrYD^?DDNMh-;4Jg7XylcS(1EV}i0&v}Z)%-+M*jyO#0gPR6L8 zk0`JuRGK$*-|md`r)0(iYc0rd1Gw0_KYG?;#HzI)EXTf>xxJjkx=zp(YA@AzZg3-V z8XZ?H;PGrpzTA$Wy)|q+D;VK4v=eQ1K>uSq<=;d9m+f>rg#}`H4ccDxge1v*B!3?)G{9SNhdgOV3Y?Km(OY2r$ap*&9o8WMYl}9~S@t9Ir8H zf<#@#fnd1wG+h7Hx}N#7?s_ZW3#4QC-{X4t?{STN7jp7O+vz|16wtLZK-$1Zi=8ed z9THFngB0^4&)#NgFpA_Ger9hbC8GVq~0WV%(nHmvZ={>A4({CPrjfc2!$|mG!eKO3vfow zHmixgv161pyy?X)5Z*afqQJm^tur9PWzsCn{juqUmSkQXm|}`fLUuZS`}`8QI^tC`zMT@~Br&w+LFD$m07uV4inhuODS75Ptl5Q~_1#Yrz|CF2ViE7CLu~b+4#!>GQf&S1OREBhRXAPGQVfzC>tMkX@v{ z#>QOG9XOX=`z>6A|C zF6j>GRJzaO=Nt0AzcX|GI&)^u%pPU7^28n2eZ^YqD&q`G`c(E?a?R%^0v3k&5a|&K zpJ&JB#7H!DdRkE=Gs~~t4Xlx9T{^Y#O=KFyPqkES15ky~XmhWV@(UTOi|+&o0Kb4T zA5cRBPeJZ64~ep|Wu=UR+2RY7-L*uXMF+L1i-b_gq}|fIlzbNUB|~K3R2#Dd^kjYc z@1cr6rtAt3*eIc49K%4R$^=IiXLLQ%3$o#&{;I@0p=x;Kc{CP$rkA84x0b|_Ms41# zVhCz{u!1(bO$o&cL(jG_*${w5xxRxL30D)3&BZh*3tS6t8l`99z+uUWMkTy^WeT?F zZeHdbaaSg7Fx~XRg%@k*^UFVLsd6x9G7R*{%;E-E@!(=qILl{YITWl`T$! zQP~OpiW{CRO-qJgILT8b_V#0BQ4Y95quQUFtk>{p{sImW2uuMn8$jKV4XC^cb&0Qv zBq2(ryB;@vHD(btYTtrlQ|x|6k$DEy8m@>Ss|f{dDaC1BX;<&B#jNO=eJzi7J+u(53%p$^zBg&y;*X zS6&Tm?Q`3<+@E@o(L{oMfVjl^;o-2?M?ChJ=O|MZLoN>8yEoM~xfn1sGg6{ZZxrL% zysc`dC(M!7Rw8&SF_5Wr16RUNHGSAe7Uq`2{zndWFtU>udPV!Q3k}PN`e$%;jq_N! z-{NXCyhm8$dp!&Q6%T|pQ;JGfMu!JNs7z7ovOPNUyk8}le*~eOUEm z!YD@vL7NQ5Q7n)5{rI6w7}0}+C*nKu6-Ze00rtz)u@)YkG8<5dLKuyzkkIk+4%0N3 zBhmDuI_y$9-{<%_cW5?LHNA&9y*oGY6aJANX$j$xHm0e1ot}+WQIXV-`k4)`xdWkh z0b(v!Lp8Lms9jU#j1c-h-QR2Gi9R&>vzH{H>_)a?1JJhPbnDBj z8m)Xs6sWpjqnLjatoY;SzJ!!cIR@z41ONfp8W()-0m>f})kYFD7T8wbeE+~GZ7=o! z1H8PlGTH9s0W@!aL&)Q(aBw8K98=YFa2RTgb*Gd8)-bm(EVoL+1ACgkADL!cfxgtN zAae^K`{Ri{Rbr;kbaQt^ZTf7<@8RRrl)jg(gZ$p&V)JY9nm|b@enY{+Uu{G)o+_oM zi@&3hBU00H@neFMoSJF%hCBe4^_z0~`n@V-v%RS%Dos(|0*uH&%*YreSp2nA5CCEY zwzVCIAX8FMe4kLbL{j~2on1fswT}*5ysSZ#~{gb)GX4CU2 zcSkpE-rga%i@-vwH(S`wODXwa8<-KhZ ze#%E;C_m0gfit7v1t5=CYk9tH{4qyUb(1vHuL7UDrn^irmNgZ`&5$1XJjy*WN7qA| z2Qu&`eGT${4PY|u?b5F5Ur9}m@Lr>oV}Wp6JohF@{V1?~@`xX6NB9IVASq4?oC-gNQyx*%)SR0G(#twOETv4oXb&Qqx`cvQEYkdTr++mMYK$Zd{GC>_8fu&( zuRN$r_}oIGV5#=-<36{FSgaf|gX+t?AAn270pw@>x(dzfkB$B%fZ{`-=Iqxc7BAWPg8G?l_; zrcka00#FosNO*M>w~#U}^neDoq@(tLOSupCeuOiqtmqnO zrMFCPu9;XxVr@`$0%u@=G;?$sZ6Ure>3s%dtpS~I1Tk%evH3u( z5=i^}>V(RwJyRgMSdFKWS7~G7nG+0^vAVR=4*g3yB2@ z7=~&PbuCvwlnprr3LEss8`7m^jfJOY8>1^D`WC6li*h zpIn790Yh!6i$;kRb>u-71e;qm@@tYQ7UdD4m`3s_5zZmlw2FEX?)7|twk*S~(lm85 zF8Rl;2$0mF)Hrb9@LIF_I28ZJs+JJsmVm&Je&%Y&u9gNGX7+ktziN<&X7wwKJ3ctD zurmhRvH zo3wk1A$Xw*K!4y6fJ%p85D(P>$T9y`7-74cwq2K85!_FmGJt%r#6LYU-Ih`SePPV%a+n>b-_0N})qZ#S3_!$NIkCYh6 zkTfocnnC@DV`i@o_6rRVza1P96$-&~`{q>6Nj@CxjY4NWBNaSH8`?GBCP-<{Vb`pE)P!{Z}d_iWfe=Kw*4Xg>iImXe$RCLdJ7oF zDgZ6_j)t)Vi_tnW!xzE>VQK&zST{X0{#~VHZ zW!{H$>KCTx_&wQRW%B+D(tQ0rbm2o2!fM0y*3?YPP4zXj>pR_0B_!vYlP@fdPP_2f zpm&+-Ec!i`>AdwYJ7Af~llzUm`Fa-dw|BPz{2}^=LlYCPC@J^3w+csfp@35HL#<`a zvIi#q)7!}nrga5r0lMgAs8E>OBwrMe)chUbS!^sfIRJRdK)Jiffq)_a;%4jU*z<6E zzWu4N)`_Me(hr7rW}n^_#6TZ(%ycXNNyN_1ZUYr&(49Wa94-Vdxn!f{uuc3vt2-?u zjhsnp8UVOk3N0hBxIEzVa^9v0ikoLTAQTW0lg`sMcs>%AEckr89ih z+=_y!HSFRgd*GU@^F#_bJ#p79vS}OuLYePRo#baGsDW2XNy^O!iGa%&KnZ+05$hd+ zh9IP526(*r1qB8GAeN_fs8wgNClq}FM1U@n%uHfKMJhgr2Pu55-Zej;yo(X5R1=10 z-tl~f8e}Ga2K#0r#in%r`03%3o}=QcLGf*|JhYxjZaE*Twr&UIc$q-*fa@ zTPI#rEEZ2N|73uGv>5D;$B%4lkPPm1&IAto0TWJDky-86HhBYKSP3X7uR)94&wi`# zs_brqz{^wVmKO*N@7ZVJAc5k+SqBwt>;m#tPIhlWZ5w6VH-jWW;u+3@hZvY?9AmG(wi z5-k=3-H_0?fuf^|2$y7dZ-4|goMPVQcsCGSH8sM&ecO}e^90Yy$%z?VlzIY0>Qx@s z*4ADJi*Ir7Z{15 zLzRpCT4-u@xX@I4kjLH;9;Qz6csU~VZLe4oc0psVPUw~YD=J{^rwYK$Rp@jB;+C$C zxqvd>FKjT~)Wzn>$ykQr^W(K1;geS#{fPT@K*{eK84spLkJ5=LZhLh-*(3VfkOav6!jEbO!n>e7d;^? z3sKS00SR&|irhpVc(FS|QTu5!3_7~9f+joUt6zaRsvwOd^F(dcNFTvFCwg50#I9i~ zVL10Eyx!sYnvet=14A_&%AG!D5T~$koBzZQri*dKsuOMS5Ox=__y90dR8<5=Z?|);a<3->T3CIj)h5soM2aYFodmb zO@P;eA#;Ob8zu!UJ&fN70>&9VjtMPqwrQtsmcQvgEbm~Y!Z#u>a%1nl_eqcgFL%fEId7Ug486AyGeZ;0Cn-`4h2$IcE z*TK~Amr9*Fm8;QLhI`uTkKS7U9`Nve5YsNSr>0SyFq)m4CE39z8e z;P_n6e2JEc1id2w>7Fwve!`=33ld?8t|Ad>NINA8Z$*1R9HHB?$;GH$lY;oD4d6HFT%SVIUpLI!c;N|fKU zVj{V?*o(AFDbM+*q0m22(?9n|nE*rTQh9Xlhd)v0Q>{F!VmJN#R`_k2^Q`F?@&_%; ziGc#arY8b3XC2X*&zK5RUgTYT%8CTy)Ab0r=`a*F=F% zkRqm;Mc!ED)jwSpDSq4u9)rwm?ymQA!Aa)%IBkzy$vrH}s9v&_uXsLW&3d}p-o1q{ zz*nNx(k}bWaBL_&9|bg&PjiR%pX)*Uc}fyf?x7h%@hRqdE_pV2gRzeP1F|A)5h#Gz zzAUvR_^=U*C;Q>niOq_RgsI#1x(nU$VI^|Aqk6i2UpliA1r#?K`e&OF1GwRT{>n#( zyIhTg93-itQO$bx0IE&Nwfbbw-m}wwA)%4j&tqMA(qDH{h%){X3wCb%2M<3po#=Un zrOMKsd$KNSQ4?I0|3Fq~lLT|kIZn@-41jD%%zt)K0B-x=o1M|T0PAD8{v=0vyhGjG zBGuQkDoSTa)P5XG>4&>;iyXQfrfb;ZJ33zNrJ}d{N>~D_hzYJ$7@q)+?SBw%{~ct< zWTDRE+bTv~cyUTM>>YLOUzB~XYncaEWv1T_*HSFEtOucV*d|nJa*Xd}m-uBd3#OsT z^{#8_@p=a2+XLYQE%&6{-#LT!dqzLw=EOn5BxnHPRSL{e9tV9q3m6`&`FMYkIAu zVrSV8P^M{d7~$C0_1#Sicy;4D94+=(ceIe0?bKhds%QAuw+_ek)fdIhDs$l#^G@Uw zaOD3!oMV*l7YP@xIb2`=Ah9SsH%?9l5bk(IrPys!+O}1R!Xwo)fAIK(|KeK8u9b5x zn;-3?oIq0=o@%o#EPdsi=%B8G@jMwQzeN!F4<(l9pU#S=7>elRnhuZ2ayeQGK55p&PqIwz zU0JBVCE`NMSaeBpLsa=SRJ~+-U;WO~k$$-r1!V8_R?Ot@P6e>x6o0_cf|zaw#hSbZ z$ji;MU;c!psco<>WTdQ+Yd-g6%}&Q-*cqzRu5NSu>pIzP?7?k5HnOk&Wn{!D5Z;jL}P|Zhw}C=MjY>J99b}w{Mu4h7pUN`p8qYiHzV*Ao2rdOFyx;hsnwLR`qmW=J0 z>CSm=TvMZ9nhz7<5Q|Qi>9wc4NvW!0rcY@gRi0-5G!G3Wan*l|uFm>Jl61FH5NmyX z@^R#}FHQ#=zjv+0?ojZ8a4I}Jbz=)Q?*lH?+dGC8s^EhPpmVH*bBm9&-r%NaCE68| zM$;M5yvEW%>$4`EK>JBRjVgg7CHGgr_6fk`#{M;ZaFD0)&^15Pl6q-7=f5Qz)03M6 z{mA`e16o)V&ynV=`8qiTqq@HR>d5iQI%U0=m6hFoBG_eI70H7EDTL^l#TAfKP>^wv z6AX?30r>}-Z+kbql#wR^eTWu=Qv^>CB=k}mW=Bgr$d`v|Cc(G=H<<6spT(No=CF%b z*0i76fxy*Mgs)*}#K?bpdwU1$Qmtnn9i0roVCyI9=*Ge*B&E8`;j}#?cPu- zb?lx7wIYch+N?Ad0Wbm=*X`%H&>z>a=SN|S2Ir}S++z-#5!LUdJ;J$v>`H2lFE!X~ zwBPdGJzfUnU!~5z55bdNLS-TPyS*lOAR!vCJEvQz0gRngriYqh{G{aRni&9}BoSb&P)&ME3>pqy-(E}tL&_lC~RL|zmO zg1!o#|7W!L4>CWHe);%y}_hb8aZ>&Ic&jK5%U=J?hV0Q84Sgxwow zgA}_QOpiEz)C>bf1_ktbWt6^@KL9j@E_Ond`K}`;dH*ihv~O?Geo0l^*x+cKcHmA#KFYu^cakCMB*m+ ztamOK#|zP#vn9XWJ&;enS9mQ|d;IX0Jj@YiYJ*H+Uhl88{|^>GN_1!`shh*YRJ;O2*^DxI&ADyy{ zTz5g6UPU$*k;E#sd~#_#)eZx)tI4N*d_BEX`b&arO+_gJW(-$0Y5l!p{w7PVUd`S~ zGfHfMb=7pHk??u$TTUOL(=8lD2G{@v3tZC*Dggmhxy_$SFCFLP(Bb2SPZuIe#&14PLVMSS-mfz;*7wXT?3y;*OXK7ybQTIGQQ7}#0=n*D4@86e{gG2DF zR=8PgUaV4_m+c!WC~d+YdH;WuIbEOo9of`u*jp_ zj!`@{jcPF=nx0-)oGP!~&I2OBJWEywr_cWEco-h?c+nF&Q%Y3qgHR`N!w;qW) z%o`&@Q;%C3)@7AQkTN{+2=ZleY|BJe0Ag|m8sBbmSK=b+iaxePLB#LLd&qXO5 z9*83{Z;XZ-+f!y}LVTa&^X8imxiSSjLIHH)4z>9Jq%r{5%492*j(+-~(YVR6cc(Kf zKP#d>c88qRTlQ8yB_uTv=F)ilJdQB=m8n&Y-9D12GVI`yy*UmpTBMQ8wC9ZCeWgY* zG|J({!_)J`Nkd^(RibyKf~rG&ogUy=P*5DaIEaX2pdf(Ut8K{&a?r)9-a;H~GJWpO zLdGLKZE7!U?q_09l&-{PKgqH|0>+~M3#|NIAs^twFNXK=U0dsz6LWwx`dI>BPy zdOS#h*`NCj=O$W9Zc^O@h`X4Aa^ww5EQDW5#p9bYC^#hrdVlJ@RU&k~i3;sqI z52}SV(!kR6t18Zbp6Pb8kEZL!n=`Je4-5|S5%6LmYbFU5SzZYsFeMr$Uii6(O}0DP zep3Jjt{(oP?IhSm>&6Y3_Z7s2qKa0w2Q2TUBNBP?yGK5;~@D?Chx zlSj$8>2Ermid&>Jtjh2syVOj47G$8PzUxF=XW1nYz}Na4 zgMtoA!i1sKpHfU#*V7P?1p9A9mK_hhT1eS>Kk_P}l2eRo?&}EHO-J)Bc0(Pt!h5Z6 zjmtas7g-Kf48l#HEFDT|SDyv_vau_LNvgE3r`pp&BGVz!)h}HfDRLA~AKVC8dVOoU z3VxGd(A}jdIeAZ>Ya)ac`Llugv&?*esZK{=CYp$Rsbw7Ateun+!q`dMX8|@|i}?}z ztSA&v6B`=n-(l@Pf5oH#sf$++HeE^T@oThq|Ha9hdq)2`NRH?Eog;@RI&xH9 z+pd}1a=e2Ns_0ECZ1oO~fFhOC6qeE7O)u0=yzb-h4gkM*+RqL+7p*oPGe4y_yj!Jj zG8HfW@eOu}Yw_HZO$9(6>7PtM!@7(FYsd2}*t7qOODL3+SxYxOchrY|ik%|KT|1jM zF)HZvDU!BAE{k38#14MzD^qZ#-m4N7`>qo3mZo*O{NeVuK^6mf6nxAGG>~}7QSI4L zJ<&TI4@Q6J_r#v}N1`g$d;a#S(o!EYTx0>{0q>Qe@qhOh%7o%yyZS%S?0&iRY9SF3 z!ZdTv%oB4GMW>P&^cpBGCvJX$NZUa)ALgmG?ajv4g#P%CMG7R6xrN~VHI`3~MC{fY zhXGfB$5;g9!vF0t_C_>4uNU2e`5tT3siO#H@gJ=j8j;DMVyTs=Ni8qn&i{#mKGcjjbt#OsKs?Lrv*rGbc}B7KM~u3W1D zTif|vcR~E2tBz7%a0z!d(~*v6|pUYfw?~W zr53K_hG@;u8Qwmy%r_px?JzF(1kEIYeoSWTUXC=KKFkr~ zCxZvQe44pJqN0o>+0sb6PTA?{jfbJoQC;zAKD|~bQzA-9eqa8x`j#|IBjtO$B}=i+ z&n0IFf$t&Vazf$Omvv!&C?Ksm9mARzdrKDjUDgdM=0UW+VV-`)kCO!-ys)JO{i|=n zH(osijcU|yY_im=>Z&`%Ou2KekHeP?fi%e3S!);snd#PYHHewXFwA)kS)#u_lErXh zJSBGraJ3E^_5k$yT<7c}nl&LzXMUAkVG%BewLnGIN`#bUI`IER2`SS}<(>!^G|j2G z%>bTgS=p2q!+YY(e~|%qnmJ0&uB>P?bv6AF${Pk%^kSt>(in50(b>UeCg|E>5d{`j zc_KzA53Fw)d;pU-ccoS)@i#L74Iv2);ID{Tj$pzPKP6ar01TC?OJ;16u^HZtfy|(@ zUx=N{L1{PRLvs&N+V)zYXS5d;yHzGl;~k(lhQC{H9EK-Vc)MwWlJv;`c}}y%PLSi2 zE0xB)zLo=5EsLVmnHAzP?tb2w%DjegeWKc7kJAzByf~$^H-VnwhP#EsOdA<|gg>C9 zlf$!QN+=##SiuZpDpL@=t+umN;XBFniOA}!`%$v}Mmkc>>PvFjUpw^?AE>?Vc1;zs z%aq$Y7g2SjN;x&JuWo02oT?`RSX5A&5@FnRJ>3>98z1t}I}S|DwQyt??%T`Saqk84 z5~`TO(C?FgNLtdT45%d0|EVVHZsR!o&f@nGEi7{TxjkHw9=UyLf=CbpC_B)ZJqC{( zKJm-{8n2Ng`XE32Nzbsm6_s!w84&rKuJOYEdMx_rT&J(10phlut_k78`zh;*#z@o> zl&Q?SJ^3~tkxnd<-8wh%?+d^|vi@cLG3|})#s5V@Y(XZJwCa&jIsZk(JwX!!h4S&0`WktJHgJ24LmCStlwBi>FA4xq z?RQgnMQfZ>JX3^!Uac8eUyk=XtIgvY=`Ys#wysQrIVwDzrk$PC2C#iQV14MCf+4sj**j(0fsu6uVYR9*$Q%Pcru zU8G=pAFRCQ6P^Al1b&Z1`-|R4fAcZ9asA}dgPMl;BV-at)x_=cM{AtzX-&@61hm| zJhhr$bkY`OYc*JvqI%tj3+P<)U&JJXm1O2yKc|G^s#R#iSXkiGr?z2q_aXNk^d4$J z&JKC*oi;o5_zFNxw(fiEKE|6Z+a33*%HZ)Q&T$`j-}oG5yw;drxbD-Vuq;TZdQ)w5 ze4^2!zQXKmrM@zwV{v?Pasr934bf{&U&Sn>Bm@=~dcO94>_&!8z%|u}S-a;uf6IKG z>2b0f)p9=8bWLEn*#2%QXh2f#+1S@Mx84jmXMT@X7FRkirQKoa;q>xe6PhN*Y*Gn zJUybvgH4BBp_MLgoif$)PUx;JwAVAn*!x?&R1kQo!B zzwFcz9yGj@`zIYbyN_KrM-SVq=K;x9dUTUxFlf9Wx&J+4I-lKcOahWz=-;1exWI77 z@l5Rg@DN!xV>YG|7t2*>_s;w8EEq+s?{I6repuY8^mBK8q&d;`1O&+9y#=?WJ(Q*i zc%8%usMvbGMiYTexs77IDkusgGIGQ$@{1PQtzBf;DYT|7SDR3gi3CHqVJN|pm!B~) zs{!7;d3uK#@m#nWi^&c& zbSpyVA_cxeiP&!?O+A<9040!>VxtUDv}RJ8-kWir)I=kO_~+yIO=`V&W}lgr9VKP* zAnYDu-^n|LNKm}%G?Xn@piuM#q1$O_t@F$GM%O(oDb)tmrOLpltX>XEaO4jX_2je^ zI-e*k(0S6B8YySM{UhcN9ZJ+j*8|!sf~x-buhA@@M!r>s;km698XmLe7EZi=0GTr{ z)_;snB1Jf_b6!6a7|~=$my4<}uhc|xba0ZmOxo5rPbAZHR&r+s%Sxf|dj5CR$z$OB z=2jU20?ymnApEYL10Rr~BcjH{@Zp)4Cjy7bedv~Ho#QBfZ`MqnbB^v;b7t14tYUf^ zBr5Q9BY^-_O>RmrDu`9-d~Z-RHq^5I_cd|sN}2u2Z>fCK$0X31=MGI&ne1&zQ7qFH z?lStNIjA#X0p0HDrz)7b*P3-G9wd$Bczko)m@+qvT{M$V%U9t>nVi8uWATLY4gxz^ zdXKx_A?0{Nz_|;gYL?${UfzAr6;DynU10s(cPoBx5U| zDb|$N9777WlB)5mDHt+{WFuLl(ZS;7qr%r8FKlXCF?Ln@5 z@SiM`u&T4lpA`yAohBW3lk|mt|F6$F9dy^4KyXLDb6|&CSh`y&iHBT^$`BTH?NOOxP4m;rac+^~q1Bl1i-o`nEfCl)wjST+dhGR%GN}O5E}kYW za+b>Hc@h8nlgqEgXC!-#8DGtfS>`dzf=f3LNVw`5KfSuczh>|~RyK{^boIHMu}rDP z*S8;{^}@I}3!?~C`<89n!`(AVL*NXsR6p;F=>gL?55pt;cN+Dm&RA&QlIV`Xx!Gwg zqYsiQ3E`7DM70hW#_2r}2+mZN@R?}sOvISEV*e%pI(TpXddK~HI#}{#@x57$u&M*k zq|fd$Syib993|F*Q&(0#4=O6E-zYD~dj2`QrEVR6ad+Gd(*P4RvbAe&cMRoVO}thB zjk!`d-!8?!w(FliLGWU&=ef>*elC?KB;lV>W1YDmaamJ3x#F8#lS$hAVqI~< zC1Aj>z+msr{vz97DC4=O!7hGqKFJF@Synt;hglb&etNzW5V@^ z7xN+mxnZNX9^e|-aoH6-f!(!8)r#!qA02BT(i0fEW$yOtY1DzlmX)+E141dY+qCZnnP|eyl=&kO*F0KaMJWSFYUvGkq9qNNeY8pT02EA z2Uu2#x*GXE#|&`T`0Ao@)g42!nvFxJ`6s#W`$%yeUk<<;oOUJNv)?UJn_oEX?s2~O zg-%X*==-+5oSCtrnZhZ~d+$oZbV9~l)wR0;gIHM`RE6oiiDubci^5E<~p6%SJg7Sv$;WRIK<(%gKh=Kj*4HVQg5-D zj$l;keO+7J+)RAK;$x%GfI7>#kX$5K!y#+iX~BM5ZmOhkVEM<+tl;s8|6QQu+3=8l zOaXSkCKwV*tntT}9V&N=78+SAnj61&Eklx!d@q`hHS4Rws=^GPVi38;``eI`eU=yQtV`A{DA}v-|PPSSn2CvP}I)Bv$bKlAI%(jJyu`Gn@06d z@_$Vb)M;{t?|#02^A$NGGJuJm?=7ZzQrF5ba(v+BK0lME)HQtFlB$f7kIsphV%~6z z=-R)n=s&iUU0nb6?D*rAHX#Z7RB!d|bnb?-uebv_^VtAn=d(@hpxj7Gj`%cI(RgId=s`(7Jd*%Flo0=^25 zKFxlhz(1ijk|t>5&FA%mVIq~(`^}CmR{r71Bs}ac#3*e%dpu$cZ!0bJGqt%=yudEy zUyFnGo(1yVTxQpK{THPeHs|XLYo1_GM@`JCAW-G^DW`*Ei8!8Kri zt~z+#U$~s)*#?lM62~HKax?lEr4#wB>dFmjUV%YD24mB&haz;`9fflIgY51r@UN^~ zRGv6&HT2la=5VZ18(1u=)E*NGWvzD>GB|KW z!UxG3AJP7#UF_KXO?PPl?~jwi+HM zy7^L}8|W5pme7+zKrJ&ynx^rN36vNkSO60Lo&iE|&gI(wsTo8J~yN zfL0lSy&}_=D@_32;WUvPBK|oI#)w4A&`fY?qYBXhYZRluT_)k}r{C7$e7RR98L9If zl^QK7%j24UCg*B>V%oWrO)E{IKK+OiRUvO@%GB`V`{mSkTD=eP0Ee)G95IGedUaB> z!=xOA*9HUsce1uz`1pQCCGQ$Iv?NIJo9AMq1p2)dSTQf)d0-Fi#j)pm1;1?DjND;X zxk-Wa{$%8u|0J~MRZGHN)I$}&_oB}bA%2P^L)~JVG_rvzHPz58W0Dr*MzUtQa>W@e3B+D5 zV=Q=RSHPKwL#NiR<)S}-t`z#(UZ#pQ`zKyWdqOnG?3?27u|fvijBP?G!M`rGFSJqw zU~aJU<+I*7CnC^{H?QXA3T(DF3Idt&oKMkO%?X(I82`ZnoK*BZ<`qqHDdCa7w7hSi z`6}Eur=#9btIlBE9$7j%OUj?RZB)Ep_|V~iiBYZ~WcD~+Xauavi|!}BFI)3s!Bvj-_e3BcF~@a(?4muUF#hy1URz&2;=d8 zJO(Z#>PD<>#~t)F6aQyBaU%el&^fXQjWt`yJfxpsDG0dQLb0L8iSo<>o*`m^H*Kzo zUDQ{i5IA`FluO=PY(k3hv(5>JBriu(5wa3$ZL{fKny=*Obo(8xQz?#Zxm{F z(PTAZ4)4oF3H)3Fe6JXZ?eWs^0FUwi`sMu`yNIyXrmJQDk0+9($_~Msj1%zZ|6jBA zUPuBiU-}CY28gEy*D>IKEdeJ;3{VN%7To_@0feMNig}`G!s;(ACGfKf74SU|ThzZ( zKL6Pd6C}W8c)sB}2L1o+^2LX&3olL&SgzcY!1xV*}^^pc}qBXPES7?}~`I0=<~T zx|WBa{RDuD1V^AEj40qyQo4KkraDbY4kf+;IL<(mbg|ho&BR~~PMg(MKR_)V=t2t%NPBZ}adnQ4B03#Rf3NI# z3Y#t0_7QC9N&K5y1r{x|A4&(O>&`E<@sp08;ePKb#$=ZBygHSa?kbV`2C1 z3uboKo9AE>QZmwBGATDPus8|(Pr}u({ua*D*i~YF&&-?dLR-e445sCLGWMoFLhBCV z(P>D{{|GN;@Vd}KiX+5vSS=Qfz7NBviO8SWpDK6*gG5kN&w%vOR1^EzpaQ7{2$yle z!2Y_g1L>eVG&>e_RGc^X$|N7&c7PtzDu+Yl)`y8(-Ekw3H+QdXx)sU{g%gUjaQbi~ z+qp9dUzLZY0=~D=Oo^%#x#@DF9Wxu-51eyf-&X*`4Fc#HE(8c@PFCpfMlKYR{Eu}X z(?3*^(fnqdS9d_U2Z1AqKDJxrUNK?ackT>Jk+?EgfLenVnRc290^Lp}lEDsA3mx=$ zcNu{3&SJJq`08kJDG-n{|05ltrlzJ*V+?)S^^fNx17 z`Fj3;Y)c^u$ShyF$@zC%7~Bpa@O2?C4_?V}(BT zAX;-k69(49!=p^M4X>}Sk4A0_Xz}xhGcpONin0R)yWZX1z?TN^PICQeyPvCVixlu$ zMRm0;GIV;_Tx^yFPW|pON;=h+TMX`Hgp6``HoAj{3LXJ*6)wcT_JDeAmu}jxf7R=zwFJgK0q)7xQBCA_Is+cZ)&f0fr>gE!>p63UIfn9k-8iNsNu8!zsRW$=Fe zn8c=vMRlLaWe533F$`dtsuB)8y_|+m5uN31Cud%GA%>V!t1E~1o0+mFq)F78I)W!K zpMIAY)EC7Dfn1K}{Q&;zrzxWHdGn=u2Jic0PN2hsINjB!gues#Ug#Qr*|9zPOEi>1 zuGHe=gpY)=_^_2l5Nn;KlaDC-Ue01}Awaj9U%JOy&?kEC5fYqPd5)3!D>>Y@u0)?Ba6+JXqp|~a25}mw#&F&! zqdUAkVB;E;c6;0b9k7>vJ~TTecas77xAe&pM&?l=(-~=TSOio*%LxGt*LX|O)#}(# zs4y?8I?HJ^5TG321JEZ8Oih!FtBO}9$H$QYdSzg3t%G?>*X_%rQz^tZD`br8xH+&y zc9_CVoW}eK@0Lm`ks1*wl^FGiNrk4$E^+F2Y`rVfZG|AI6g@jX&0ultT>H3GBN{hH z%$w=b8U>?M(zVI^{<^HD2xyjz3>ZLYSXkJ^>;sWqwQ{YEXu&6;;Uos9?}T^%DG2?U z@N5&vQt@MvfUy}>sU>=F=9KkZzFf?(P(j?(UZEZV>M0IcK}~J@<@p$2foW2j6(t8*@JMiF9w3ws1PL6~dMN z0l3$VpCm}=^zzt1TPIe$nIG?E&Q{S=@_|OzMAyeE-K!Unv*;6pjvC8;nq9O!Bfl7I zVPZ2m)Lq&ivl&lHqtjW0sq%ZZBfYF|$1t+jc1FK=mx84V-1&YS@pxrUDdgKeE@*sJ z$Q@5Sy`gIMW}vX!Q7Eq}KnJ-aE^Sr%c8kPqQ{b)d`KMuW z8h~XwwBJr-eYFIb%sME%?nqp^r<=((c055e^9%+P=Uxj9PFMi^l6w}tZu@jf2MkyM z^y)efWubWu;(x=h;Pl;p{f4|-Jp<kacSf$wTdVtGVy9v}Hn?-vI4oj(*Vxtx!Cn9-Fh)>e?B2z(!Ww z9!X=xdO|!wxwDe)wXN10GFPk6>LT>Ml?RXhPxJ}};rRE1Y~*q4|H7{XvzRwY2%9Z0 zbr;)as~8*Q;h%pDN68mCWUy+bDUm7IKVF+kr?A2m%BCyA7vZ5}U<3e0N>pNa|ehR@OWJ0i+$1Pz<;#fgkJX$fq{W$<8&}{640(0Ty1Lb8TXRT`hYq6E6UA}Nx3y%%Rg`7*x2Ya^f5 zh0>GNg0~C9#~D+9L`yEJ%7@2?EYnu#(4vQ8F?SyC3j~cC!w4MX_~G}sYF1ArnYk1% zG&~n z^%>O3;?k0ksP&)Z5&tdsP2xHa@UisLCb3<^$UPqS zG-G=)K{aPFXpu==?x<#}rSHs3SE6H5e7hfiKAbmWD@82NbOT^zK+$3$*evI)Bh7&; zQqLfeGRJ76s@+7rl4*(6x-cC6ADAm7HU4D$*Y69lJ3dOSnzE^JuXXxkn}yJH+*^;~ z8?cV|?rAv`)}cdDUc(11f}-z54+n*rL}xPtu#$GmfW=f?+(ZC8Rv!?UgvP2?@r84x z%@ys3+f5fB3y$T^XZ8XPKZnOXBcK#6Lvd#n`p;dM#SI1Y%(g!-$R*X}K0ogI^Smm~ z4DkJceh#$98qawp^cGqxE?&>Ugbtka` zNN;~4Tlyp|ZFEch-=hTZ6@%tmI#-quR3Bzry@?a!ql+%w9w0wx&MAN+%9QNozHAVZ zMF#MCUBbS*#OU09E$9WS8t$^VVu>2@A1#{`0SIn*Z9n}lKwGX(3m%c_#w>CeW&BnX^DdkGlkH1rVk$MNW42e=-ORAIy1~nkE$V`f0Mnd!p4XFEKNa zt3O|<6BHk>QsXo9vlw`Kb9~KaOMX3E?G0+b{qWz7wU6iv5S2LID=3vZF7fE+!%fk< z(`SpExiJnV%b@K#^aV=hkZU$rxIA3uf6u0ErmF{!9?e(Auv=^U`}>nR!{N#O_s0~5 zlC|QED&wr_Y|*91zm#nJa^ZFyRyDymbM!@|5l^asojN21FpCm25|{={(J7F4&Tn(E z{`~fz(!>YqyBN{4Cls69VvwkoIr;d6Gvnj_F3Ub&1zk8ZDMM)$eYT>+45MPMl%|-@ ze_!YvxTf?QpLt=OxS}s{^6i2fV*xM&#>N5PXQvTq;=vIS5g!1vq!bfdX_Ym>VvOQn z=^s^`LOlPyEd=;skJIe2ducEP5yR>n)xfyde$U!lKW`}Z8S6sWMhZh^;=wXEhqKid zi_Aa9yvRk8N4$17H@{PNa#H>KUPSvC0kg6W->}~pfba8{+Q8|mdR%&Eg+_y~hU{`L zTCQ51dEbj-L>Pga?t?}pIk2e2pc=l>$y~8&z#43u-goQYZvx;5AD?9$XWQ!$B(jpc z^eyG3KDWI#m`lt?(PCCRD4Bom7?0&YcMRJe@c3Wtj{0S1XN%57TfnmZ_rZ;}fDBUQ zCNZ|sNF_I}vGins)^>XoEa~E3lloi2crTkz|V8O2kR#xzU zS7*?v!uf1Xz1}STyF=&lGPj_6LqmfL;O4Yl-S|IlzA<11xILDR%g4tz*dX%uzr|p& z9MJ?fHWt2hh=FoL@mY9=D*&TL9+nUNoM8^ia3xsRiWiZ2x;>dJ*JQ6VpO-D~mD00) zy0xq`nFQ#9$rixgRXF}SlBDp!%fo{g85#M z?go13D(5rpdR2X6V;E=WJE;DlB59z(MU%my%cY$Z5>Fq@j|ObZ2vgXtE5>Xh|AR=a z5^Xr)bGX5BI3YK=%GmS8SHiMdL9n7^#!Dv5rfJcAZt&1#Dq z{hdAU!0?{bM(cZbT7uEky70vhQRZ?0eFUGMmA1GSUlM1UI_%?tYQ#qnQEx;*fc&%D zl!vEh`~Z>?=h0x`q|84n4{E*) z1{=rJk;^fHaM=ZOakS=VL3A)zbuqZ}CDk`Q5uv!!qS^KPA{L%bl=uLEVyN z3ERb?TVosZ8+j{dm{rLT`@$>8Bja7x1;cuAQB3C_yA8n4p}VICtl~wr#t&3DKs;cn zom^1FzukgEhEJ1HI6khgMyw(^b*wTGv)k3Ude$@pP-08q=g)d+77zet`(!a7F{ARa zSj>nHIK*C=ME89zAw15Rs{++L(Tc^NKLwjN7#P-$++yDeyWboJ0LSQ{rSv-LpTD!= zPGMt$#JI!15hM0p0-T~r+y-_9@79Rs1z_aZ?TE$&APWy?>ioRdZ$_1PJSUll-9^h=Lfr5jNk7!siYI67=?G6*$X(X6gO2(h#d; z8y-Tz$xIS0_pcJ@!bmhq@6OCXA|~bJunel?i$_BnUho=Ycp^rL-2)Cs#OD`Vjg|@2 zFw&_=%CbMUq)Gvw66i98tCJs+Sz?A@QrT0EDE7lE8s;ypQ z;9tzy1%Ra_UU#-X#fUv)i_=M{Lat~w5aPhKhl@}AZwDXj(0$+h!RAFehcQPQ{Od{( z4S6b?BAQ-nNEj`LCg}I)BnCVfzi73PaUIRH6^%ytfs`7oTbyErSGu3#qgcm=dL#eK z%lJ@f_I%)vMIw-*3#2H91kz38{rg;)_;g+s3IrAS?Bzm543ZdqN`Dd9=)CwGF+}P} z#_VR$ZbK{WR4)5$^4Yhm^OQtj?O6hpdhFGvl*6B2Jnjv}mZ==4C<~xk#V@2$%Aa3(byW=UF{JD=_6f9`_NvA*MqPukf zWc!AB71><8Xa_mjw(%H-T15tB92E1rY<+^?X4^kkd_RF8lh5;8aR`+cx`=pxL=u#+ zaJS1*Rk=Je``DU7g&t}B;J2*GZ#sI{RnM`h7#{1`w{gMC?h}Oq52OA?MtKm9+e)gcABQXe|Y-&`m{7tR*;28joxBPFC*4FnLRm8QnM7quF!Yp@>8c*_~*C$jiP@#;HtIPHJE-m z!ropQEJmZI4XUN=To~}S5pM&0Ol;cj%>+!g^;))GMPVDn3;d{nsm-sHogZOsftJwky9>)6w^v%~Sb#>tw)Pe^_kwoQnuuWEe|+x$pm)FRRXBA3|)l z%a9%x4?hnKpj2>GDSz)=)GoxN*edl?_76bc5`_D7zM1)5%~jE~BGiX~vsF$3##3uM z^1^~o92E&ODxZ|W6qFIQ?*Oj2*BxifKX%JVMe*HwH!$mAITCF73 zW6Lb;fx5UB9uYCwCLtw_!z~;#C$3QIxq6ypB3W0o*k(^cz~_Z*k02fT{qO^gP-uW- zs@m3bzP)T>yTZb} z+~$~9S|eAyS%ZEaWkK=0zTSl9s&d%ERSo7|%)VCePxc#~ z5F*iOKvMA^pm4dtGJanMaM6w516rg?aHh*(l3^k&*z z?J*JtEB@{S(&+b4Jqo0(m>Qh~E3doTp;ag-spqJVBo@po7~e#}Ca9RKIbz!HhmIxCBwP2%L*MmjsB-#t&N*W+POjoZfgLR-M-VD)SR3B~6LM@6 zf0Us1KhQPbJr+4zLz$IaRJv;M2#@mdjf^6-Qiy_)jNmJZN@^i0r&xnpqrq<#`22+I zS3vt)pQ0Sl4;qK6ttI<9O4voRv1tRxOHnT;>70HRo0CJ%7QtdXCV+X`=5j%t!RsCf zWO-8x6#y=NO-?5%#8%tYAXl{l;3)iY`!ky>E4~sqAo}Nmd;=#!L@x9X7l0DVP_=4| zA9C#C=-zWA8t$Nbz5i{#T-UDow_O9#>h`MpBjHui&Pd^p-hLbvwt)c=IAxcmiJR(L z3R_2Ker#Hwb&rz%d1eBTeVT91Et!$B_u?%_Y~mC-#-E^hV$~GqO*;&r_UYaLFk~d624#Pa*yG)fNlu5m=3yd zHk+`~9ogFtC`kF2Nj$?`Tu~IWIF3lLSc&%z-W9)WCMucBD#1?r#5~8ScPU?T(+6P4 zgfgjYP@uvpS7;*El8+1bv!$bb>AnO>RXNTZG06ps^K1Q~+|bvQ6nm$gjlDzKuB{av zJQSJLFEIC`G;^>N+yBcQ^?5;y?geS~yh8I(r^02NwD}CIJm?{B`0?&>bJyx_F>UeAl+%2&k&rtbetBB)7=R ziV+%NoM2zm?#E=EWH4&krafJG4t5~URZmmZm=WRJ$eX+y9%~lURjWpprmZobsc480 z0fTj~B0q2(ctEDAh19K6O?-P6I^PJS;6gC{4q2N&f{qTN>Q1ix`w1QlP>3fGZhibh z+uXMAv>QWo3PpANBTBxJyS3IXSNiSvzg#$b`%&U8*5&uDVKi#-p09Lck(KVx+m;O0 zl5fNzvtEHejn(82n}+w#BT$Krhc0Isf^H&@@`GckWrY-Si5ZimVXr%J4bEb{nqKOZYJKkqRr~ZpUZz`NOtuK7SG2t-K#5 zE9D7X-5sS&V(iUX{r*mj$}E~`^j$eclf7Ema)0lXM+x0-$&F0k3lDEIZydtVgvY}a z2bBdvXl$Pm<>~E#3s7#8PQcXvr=Sc|tf55Aq zPUq!|D#Ru@#hU-^UB!7JYsh8DY_F+0`6H36QyhH8%VZ=jX{fr4x?18HF&66|Kj6fZ zrq)d3#xRxY)$2F8^ivEP7>dcjrtHI&zaD-oqi7cwOk=^axj~8k`~}NvORCX)mRujuEU=Yc#)xuimB)ktXtKbbqeIo@IM9R<0O=L{nKAT~ejG7tkFk z6HRkb%&}Q$!Dythw7fAs_F~zU5jonm)T0Rd?lox@Op2CE5$V%N zS+iKAjrP?;RN-lFcCmuaxElPlJmj_Q}85uWbA z{4AhbGFV6|9vYvNL1E<$$by>*&kAWU=WJl8Is2W{lo!nPOZ(Ze1mWZr2I}v7+XVRX zyPw|RfpFFORIu39lQfA)NwH@?s`|&oFjZv!h`1K=Uqg}B49h9D!a5~UD(HDP+zgmE zDppe?ARwSR-k9eUECZ9MqH$#9a%H+P7pf97wu*1IBosLnlw+LY$Cc7Vj8%6VE?3Hy z=WhW73fcUDc4G=RPYfu`&~ExiXYpq>6a0!*5FIZLk2(G~Vt5ui6n!R^qv>If?Om=d zvcjt}OQtSF#j(>=2J%o9fG0CyoWQ=j+GcpgS76&)x=R3nvmRSa)E+8%Ok4 z+uzxqTyj3oHsZ1!b3vP<1YpmUlAH!xzXBy=t!zKj={m$h%^rG<(YP;PN1do2Io)LK znfzBw83N9yDQn?OEXs2OxV*6N;HN1)wXAQuk>Q+Y?Pb9c9=#Tu)uod~sC`i>WnckB zLg$_}zg7{}9h6;ZjjZ4xKpWBZtJ8|Z;w5cC4-o07|FF#`e)O_ffg}lxRP~})D2A=z zSXU$lJ%RgLHQ)>x@wubJ=5bS2y#TobzHFz~(8D%-M=u1Ch%svv{J&I)30KHivA1DHy|z~}(~;-N$@dCb*5wBi z?dcq~mUIn2+>>>E$Exs*?wNSrs(x|9GbqtGnM&evCPU<~P&-{k_{gT}dU8mnc6~Of zjRJZ_IE)k$3C%v+7#C|tJYB2+JK#lX&y-|^I88mCRSdX&$@>wxx_!aoiXh`>`Im9N zX{7e#KBK!mWE$cf6xo#|K_agVZsN)0^-V6`m^EhHK1ygVJ0FjZv9WdRGMN+;6$a=q zkr}_e1#=%|F8ZxK^}#ZorEltv=1{rWIXb^A>`#@VF^9p*)fFXk7|`CHanSBoV{Cb= z_)nknivbp_qfVb>^Q$y?+?$1jMPsRF>0qLcGHmyG&~a{;LS3)+MxzSHGjpT|Ym(Tk z$S*_IJ1hX6imk;J&UG>h|7;UeBemRrO|;_|%~x?QIlX+r z>Ywk&E&r$t%<~vdK5q2d%NY({c7$yv%&{$SIBMqvfC!0r5oCFV;sQAI6GswGIx*EF zUU)0wQHej?9suEdc+O1#o#njkBp-b{e0BRrik8s8$x0Or&~ElG<>O)~RDA)`q*<+LQxZ#IXE7CXf~c=yX^*=O*ZG)E{$;Bt-7h{<2tzJ|H6#1}iXG z{S-?k+PGLuyiZd3eRw+wR8$3?jMr}OuPQ(>yp%))RpPd7C%sF#p;e}z+9xwP%&8DV zwq(c)jF@6lru&ifdZM*Mi*Tk2OYK(5zP8ebmS?H?x_ECvnn{0r(=D*>a=X4u??bKq zX~BJ1lO#1Bz_Z@ZRtdEovNl4ANts8Cpjh_UMzGlJvITwR3&U+c_AxQY(1qbsKKVE?wx&-+NHgh05@iIxR66_y!QCV2X9(@X{HmM8PR6N z-!;O-KJU*Q!YlkDtA9`;!URxR43Iv#6i`+6wj0DI6~*N2rv;bMrI1Z&g^`nhF#N5N zta-xh&km&IwTX)bZUWaqAD!2am7J(NvW($rM5|Z&}&I>azb4IEJd2D6W+jYnJl; zNo+7KS>T^+x!(5?dI!ICtHpl2d|LEu`JWN#GXeVZ`xoM`jpZEeSe}JOs|mB`H&+pZ zHsn!JgWN2W{o?>hT`IK5_J@rqSd09p?cLtpxC)AAjM!!xUhj`w^^>L1Qeq`dQfig^ zFV=nI>sZXTohR@FOgM{t{$c_JHm9IszrN?ay__K=>X)EK(jdTS@Q64#jy&tBs?@Of$o zrBvyA0x>kB1xdZIIob%R6Ds|G{(cEX0ckV*m{1|rufjqBDWTv$X&8cH7iYc`o4Glk zmEzflts36e9tt^(qQOBKI@SLqF7|7SBH8o6eZ&L^5SuW+x&d&4(X5Mq;nV38I<-7D z%dVV?_HvcJd3f_xB0anGZU{p zYG7rlxr2y=&DAZ$VR&tP(>Bx-{X`SFBVmX3^Mr}{2hpgrT%RHhw89V)_j6>byxss0 z8TLCGxpRS)YAU5^Sth!(Sp-~Os6<&EweOGvP5_UC^=tv^D8WkTHp{)wNNCK;elw-~M=AtxSvhbg!(l z#+Ak(hi>x7sns6sHFRI+|4PTu=Cl@+vX;BO1YBtJf{}k4hI=o#Ca$+9AA2=kgM^%1 zTJBm@lS$PU@(KXXnNn6Vez?Ct*z|2Cbji%b`&L}pyI*(5Ds4RwgXzcZ;>daok=KKO z-a+^OsCRft6WDY&K?kjO)7wY#VPEeA9EL#_j5=vlwhGL?+wJ zWr45XEX17qck0}5Cu)AoEi^Z~Z9I4q#+6`pFc!AN4sGez_Tc9O^MC5(p`m!HsA>{& zuX@;m7JIUKjj)g`RfYT&ZuOT})am z@R;y?STGT$!lG|TD9qAV{}EjPT3cyfIII7PE)+X0BV+^>a+%^-|Eed>S5dHM;E@vt z4A?WN%+CwHs>Le|)D8E8ZTqh`yV}~atcXjd*#Vp>mtq_k^6K%p=ffNJ_O`YYds<_X zt=j7kzRjz;NNz!#^LCc0LX6;&fM5%i)|2tKPEci|u4Hi&xb?)a#O2ELV{;1926ShY@=oJ(c6aN;_8CHj5kInFYI!}a2YI_%3%}2l z+S8IRHlxGF#-?Ne*3AReb1I~jP^Y0Wr#<2oOKhfnw;@e)j62Jndx7vruuzV6SPR|N zqQSswhvUkx52+BEx5eg)JGKyOf(xzNP(yRHh{MmXG!w-&*~%Y@;LTf_TXJPy0~uct z0e#5_77-chA8?#>|9rH-MD7u~o3-BqR zv&hmYL2!8eN^Li9@dG3;B9u!i)OkEdZhy3ePn$2{;thcXyk-Y2tyG(YA~K=6yQF`Q zm+5zbVjiE4qH@$yUOTtQDB}Fek`pNfdrjr=vnO-hYl3Seuiu{0#Ab)=rXkfzSj6UY z7L+;*U=$F97oW*`9rc`rJwP<9QGZcm2yfnp9X@vsX(5VAlMtM?x(6#)Xv4&UM-$ST zX(ye}#i4)@Pz4Zon)8)tU^ot1okFfOfrTAMGOdCE0Q(5t!1vWNMAfcdD`TXKKDvLo z=_$s?k}oNtyId^xE|Vo0^XMIzcGqsAQDmDx`|?hN27Thz!Ob8uN7T9@H1ZE9CU6N0 zu$SKg^KieQAQ*a`_HZEDY7-dN4ziT==K`Mn@6FB4l`FpB0IUI%)fUiD0$pi8P0mrV zQ0ElKS{;&=C%5GH=t{+zG>$eT=*^cAF@=$7b#yfg@{(0KWQC6;BqSm;7B&1RXfh#~ zpk)z=eles|gQ1o9Pz@?cQPrU+C2}}I&M;J+Gxthv-^>Czf!9yD=nD3#c-flF&dd!b z&V3c-=D(=DG8sa}$mdu;ndP12d}Z#nOass_4|KNgXvH>oQ|=9xp(;9cqR?uN-CS>d%&N6 z=k1SY-Pa#%RQq{V@Ibr-z%$192`mQR^TS@I$-=ok$d(QDp4=CT7!)PvPAs{iqEJuf z@J!qAfyykhdChO}RV_RU6BK472Tq{XV3J4oj+0p{mssyXeCV(XJscJv4LY|`rm^&k z#Uk8T=XcLi39>R-Yf;LPn(!}Tg1r{Wc6+xu7NZm#yv(31Qh4$5zpI+^9=*(ls4B(U zT_|(ZnlDpw6=SCuYlpI_rcH+sMPyQzWa$I{)PS3)`_qL;JiNR>8n6&LO~FgR+F8I6 z;24Cipp++$LaW(u?5@E!pNt224ry|_AM1hJ@D^heI{ zcnjiwHavf5V01B!gTU&q1P>-;_73}G;L8^ZvWz61Bc)ZkQj4vinx`Ox z`cBznIt*r;l;V(AWOWph(;J`xLe9?{CFg)5m%uiWa`1K^YC&_2xp@nAtDx7XoP+>R35qMkLTij->&?YyTX{o%^DJgk!0jP3ik%Bo>6* zR}Rk_=qy^P-*Af_mH+<)X1zZs-+uBy2q0qe$##hh4+d`sQG$c_C@0xj@A3a|N%m9k za-d@%JTl*P0@@5RK|z4KZ^%BL(_*mx02`We_WYr92bhBA@j@mfB-q&7=VncI&bhg} z=PKq)o?l*0`G8WyW1;$9-_oWM8k<6R%LvQgeWGeuvBp^QsNPLN4T<@E`SOKg5;6@b z;aFs+Z`MXK?|mfSX2GaPQbj6!m}~BqEYpUy?lG&SY^m+?|4Y7xA`-Z9hLH!>H1zKu z83KoN0>6@S4i~3=D&)cR&k<%A=^h0(*R+T`!|xq*=%7Jkari&?d=?AT9|jCw>Shef zsO8|nbYZ-K2f#&~O;h+R$qkh-0zn=bUYn7%9!R`#R!mjXm-jx!#5g>oi9~Lk9PWK; zmPNrmNg`driLE5cI-Sug{B#8T))>f(e1c&IN-vZ)E;bJq(1OwFB^)TOuCB(zw@gMM z5%LjHQo<_av1EM$! zX2}YcT0XLx_yGL1Trbbr(w@SU=`@b7u*WM<2!|NP74vkhKb?on%Ev29vLr&Q;OeWs zt&>xb)#RQSfofoC@RtajKiV?Dp0t{{n=Q%tK>-@{x?(_k)E9zAVRN}Hu`^k$L?P0K zPAN~c`zgwQz(`j&OSu$;iSfjYEVytzpNI~dv+S=pydUNBNHe%h*!||` zp=9#JDSms@Ua18P&J(jSui9V7fGkg)UgmamX^F*bmnujEEWKQ_WKKw=Qb zv-ZGgG=jYYPli*iN8-x?fMJqy|yPBiHB zflzO@%O^J3MyZ)GxxKwruhNA87(@|*e$d%!l}&rDO5GG=09`TK4a(5&jRtFt*(}5R z#rzB@Q!67iHMN0P7>gy+Q~9bG0Sm~h!nf0XeR{-4GXriQ2}_0y_Z+W$Vh-9($$=oA4t9|OsWDrfM>$e8Y!2GufrTijP2{X1 ziA~&1K)SXMM$NRF#FjR=waobPxvH{@--C{Bdv+iK+#9NA-)i4bus}0=dI@Xb~a1_gSy}QoZUFny+cOV-_#kr{CWMGz6JpC^KaA`03@kg5%DJSxSFDopneqDYz=!7iM}%x>9f$ zAo$*)WZQV!V2cLg$oJodnGJ5o8NqV6;|Unfz$nwKKqW`i796$!&@HqEEwlOD%ngak zCll98fPO{<+z68XX%SGHD3l~M0T1orS9^)}4V#v^4HAJjXB!zg?Qx(N0^WB(R{)OD zCp*8s5Jtzu*b!?wm8!DYg;9d%`O<>4+K-^rBR}3Q42VH=0eOO%0(|OS+P7p^+2^@x zCT6&7G&-|_mpiQEs4oI~%c%QTQZ%g8%GkLKc#@2(_7-|1Sjzviv@T948gw(nDtmnZ z(I>WjTaSm4FzSsYJtu<*O|fpH*j_v+l*`lySiWu-r!ns~13%yf!XOdo4t^(-Gz_8J zfo*#_hu$L~=-nwC+w|%dL$Ks{o2>ZIZ8cQ>@|1e;JE$?qc~eJ0n2whkqlltMW=k23 z{gQw8Quaft6I^ty)5Br?4T?A9Q9{2)*O6*Rr}O0yDTCBnY4v(Lgr+~Nsq!cy4ckd~ zsX3Os@uThnIIzF=ic1NzZRxax^j$Pca{ch$PeDAmu*ew;%?><<4F29G(@gW9#|v#A z-2uoM1q6fNVDJQiwF7b$>r;ZIbnPeCY?Wk;3Jqr0vCxafQ!oIPP}JZ*d&p51{ANN< z;$a^w1GWRDnX(HK0wEtB5Eg|EGK+hk>yUc{$hDa4ccsZlMkYhH|KS3phObnaCIW2H z3ZaoNDEgva_6(Yi7Z8nt7q?64Npni+ogwbG9IyLHn?XFGs?8h5wy}eh7w|1hHYtP+ z^@5;w89P~=F*nX((~EWA%+EcxzjHa#oFZJZU>wc> zK{sJhQ`V8sYNH}z<~e+#eN9OpHvoj#;CeA7>q-ZV>CRI?{7w7eWY&aeM`tfRG3Z6e>6zE&QFSSq%W7d)5t^lBnw0Z&C`b+4!S7>Q-8G;fEyu;ay@?Zg`XW=d|!c^<%Q0NeN z0Z;StBM-tE`i}9$n~}Q4M(_|4c^}n?-|Z+YLU_M5C?s1%TKI27=asklI$>8hI^1+pCZRhMOr>lSAQoT+8VV=P|;3N_}V|G>l+s`gM)Y z@0E9EakKd9ylFM+VcWQCeikzH?#TQ`{Ug6c;Rttdno?lx+88l&NVWxp0AIgZwqt6y z`>#_{x}*J+027Wq!Uddyu=!UlHne+7C&kl=0d9w3Ea~oBnbMxu*!5h!Sk+C+Mg9C4 z@bR(npC;%TXG>RKpZsvBt~;U>D~`mhnuNtJ2k?B+X2v~I9qIq3vaCR-HU-Lhv*H(@02ZfNTizDyScXLEuAZ{-C~pz}%&+?ndZW10L>fbdH2eQMnjpzWOO z@b+H$;jWhF_N)W=8GCylul>-ZI>z}Vv@a?uDycUP1T5x=#}G?ii^P+QM5m^vqOQge z9|Dnkl=4|`fd4GW%SaFs%lvF|Z+;=uCjMsQAZ{OKe*b2Mati(CT!LU?a_>f>g+3YsCSq+7~-p3Pp+NuIo<7onXjUpK3@UUAbg-=`Oes6AXc zlCqWgBXJz4drC;+Y7%4S@)~qj3Cq*FmAIZaug~mS5;r`qBk~GwDJUL4D4bNB&mS&$ zBxBGqtuwDR`LuP+g}q*aZO{d`nvz0{>ii&?z@#mtLzMc<%wgzs%pRJ)iP8_PV z8AR+8<(&4_AA=!ik9&-wg;fUrBWDZ`0iX4fH;4Ca9c2oRZw&^u!F5mb0FkU}(b9Js zi%X}9!05^ky~{^wC8{|?Vj1lsq=k3z{Tv^{8qxn1W>%m}aj zYbu>;8b5voIkHrYIG^K8SNfIq(<$>L7TFKaq5@dO^q6ukyvr%@H zd%S?)!CTbHtR0>avG9rZbhkX`y-@CZgdH-r$c|U2L>(jaw5b$+U!=z({Sv#Iy)E5n6m*s{<${DPvJ>>4mS*22PVlQUxw4qx5d0ddv$4#Y_Vm zYIwDg$wW+#5M}A+T}%0Vt%qGBOIj7pA);g?MB*R1Df##aGBPrP!@_8An0QMB;kXCy zRAb4=$)SPJPZDPZ61!>OP|3)`NE}?;-~Hlmdby_6-ZdO%#mZIeGx~9@DOO$b-zfTwE>gRRkx5jsYeUs<)l;bLcX|p?C6G zo=`7IDDHf?l;B?9%D_>xyRoTXq-IP|pKA?Qkxtto-hKW4Ub7yHijI5d zx0V`ggkcxhg8JGTeoKElqgG41f8ujGH{u-%uRM`Zk&|cV8Gpn&HN)ba(U)L`&F-7Ix^>(9vF^wSQFU{)9xpW)#>#BOZn(lWn_Rkh5YIjvX1@8WWfKX{=vDh%xd)ccP8jY^vJ)HmWsdE|dasc`Bz=o!7Tk{~qVd z5tV_DW9fTZ?%3kMfQmJwI|V{&8FYcwg#@rgSAwNjbER7s>$Sws;uyv^a8M>$c@)qj zhrieeD3q3RagM*_VQI_XI-uncY={hq5cnyzNa~UdfJ= zknZ+II|6v!>57B9og`qX_B?%S?QB?+v?&Rt&LZDvSguhs(3R=NsZONO4GNQl4J8+x z(?%||88+L8PffpKXuTff1!&C~ym_udASaztt8t1bt;>T=k%1cKo;+NFE z^n3vGTn4zW{;IOKE}v=tkj>&p1VXPAWbTV2{k}3n$!Tb2Mr{T3v-|rdfRK9v`Svr# z{QbK3s~&(PWj%A1(1NXk7rr1|3PZ=5DjTCDq-;*kfutgcnLuEpkM8w?_6bMgs!m1hGJ1de!isG&zA3gj$l^obhv9*mX}K3X;TRO7U7qpH zuehW6!4uPfrS2R%we3dn`{?w%Z_Qx@Azbq%iS+0Qkk}oK$9Wi3(t~1er@iSqVQOgf zHOqr!@e(e6p*cfsf?H9TUJ6jDZzi7{FawGTpcQRy!O{4-vbvg#*8)dNNB00S9>e2Z z*I(7isH|iVjUtF>bzWDFQRp4Aqhs%P4UZ^Gz|Ho$-HpV~c}#9o{n+BXc3~Egu%@MJ zX+<$#PKUT`_mkY7#Mk~;w8Bd@0AyU?8D48iB{&WJ7DYk@8oUugVnwgI2we8A-rjcr zR@VdAUFcd`ez1G%Y;V8CsX|#`cXztV15vjYKTIno!?5cn;%c!*%_&XJv3=JqZa$-E zoM>r#Lp$U>`7XZ(z9MQbd(j!yrLcHuE)nw;R*rrY+-$b0x23FMxkYWBm6s&o&&LBb zUcjQKr>3B>dg#dSCTO-_B_)B6gvZgjWdMk~gPhk~Db8x@>t~N-Sp9nyv{M1&30=T_ z#7v{2ZCiA^SYi0q0$gHCb=x?F+~8 z)A9a|!R>t7bFtOWbu(+rP{Bsh&H{YN5Y5m^!b!M~g!>}0oYK_NTw1zZp0SLga zz4GaLGNX-5vZK_=3PRLN+oTZ(gZfi=2#lfI{u;!}^#KX}vc>JO?XT$awVt?*M{4}B z9IkLA-iW3`G5Ks!qzoxhHTXe6{?-m8S?$$i?vzthZO31g(|LgzP`_`Nt)JoKfFfw} zhr6?^A$U>_O8hW+1vZgZBd6irRP0??RHUC>r?^2g)7J;lJ|}gedj0q%Ok!w7PRL?u zOplN=uwe)7Hr0-1uGE0^Ftrw7|7}Om65QP|)R=@sWJ8a)2hiRx&o&s^@4r!~l821| zRf9sczDOFsHv!-Zv!j~&x!&voJP!ymH?=XgA^9v87>`$5u{@t{cPcN%w@Qug;#r5r zM}!T39jm49h#E?+Olp5#B=T59%wx68&HJgm9x>Y+OUb=!fSoUX>GPwRTsm#g&bVki zf||>OaBA!H=V~e(>%IgWJO?Cvp>_BJ*f+dF_MPmyvlD$tHZr#*9t!D(1h#zVq&N+&Z1^p8h>?FXDnWKvjt zqmb;!nf+^ytjRqe-bE*C=+<+NSiU@r%!=>lKh{Bq3Y}EBVn{MPW4b)l=&EfCH61$_ zyxfN5bc?U@-41>-Bj7y7ML7ST18HdOjKs_*heurtVgxCDZe02ZzO4rn^d_X>@9PyLD zpl0HOEH(2yN=&jdk7n+>+7We{LFOwqp3SQA3|!HTFC1g(T#lRcUx8-y7ZU#6*?N@s z>+i(=k-WUN1UmBX!g>88$MsUk8s>kRTtESRId<@rzB172bW)NbGdn}cUIFR3_|X7< zJT`Hvj4nrPT<~*wU`mQ!%vQ>Jhws!?|IbUVFf{72rZ{M}Gnhkm#pM-)Z%D)}FMMBU z>Xnw04hbl~xke^&&-vvVV>u#~qir2P6-xlQ7Gi{+J?L-BtAGX)kUJkiHR*pZ5!9V7 zkl`6njwME_q+_Rmm#LvF1C=bgTb|6`z0ha$+??olc{Fn-U!3MS42KheQkrprS1_16 z2J`((R8-U+#0$fsl6%cUw8z6=3L5hb;SDjsYB%9DyJ=x~IYf?*+S;Kdo!ODKNRL_ye;l zohqRvL1lTamoc$+q^Do{S6Td0-^`3aOqATunRe=^T9h3bsJe`qFHJTOTYVATGsQ}R zzQH-LP_Ph}<(mHYqD zb(V2eee1Uu1VOsHyQM=wkZxhq-QC?S4bt7srdztZK{`Z`?(VpY-#Pzt&%O6^-}**f zd#<_W9OL_pA;(Itp2uxfreC*&^0r_rwVGLfR?Ek{c6dLY&8h0zE4%|$QgE=7F;Soh z+L&+IP|;#gOCp!hd`aSC0kTS%^}61j#J=)Vi-CR2zPIMO-F18>O$uSwyUwdOn%a$*Y@yW_71b>CUkx^bi zj(+_mS<3SB_;aw2aOYs+FW)?!%u;vj0XYo>Y*SB}XO~c=XZgarI|{dj)1VR(UGU0Q zmD}wLIe~!tN5hT>rJ@^sWaQrE3e2O?eSxreXq*Zvjw_KYj4GNTc?^F+AE-S5V}+ba z&f!eZa&SzDO;>c^3Pz)Tn7zy9l=(LHH3;_Z_sXy~8W<(j{ApxdX6+;dSmHgh6AKMp z&2|}8+O5H;qwj)7wQ@1TZ+>j161%u$sgop_ZlPM6V z0gHq*07LB6h4~Ai2nDFN&Fs%%pm7=IVfa9Mop~FxT1g$Z>@1vQ>7MviL}Xy+?u%OX zBFw1eZi(-_-Xa2fxhmoAkE*|5fs&H+ z*@9xz9LW`byHA>UA+FD4Y&P9L8+$5FB-9o?hF4W|@y!^)xzwMxOfBV!Egn3Q!Ft+h zKPqS~Bt>ihRRmMaMyD1^!*Jyj$~+$CQD>tQZOsf$BCCPBi39YzSy>YbHDCw#IDzx8 z^RVMwRH)ScQ1k<0PdPkJB_ATr+k>Rp+O>oVkLvt??-x=+gEdP3#Tfm6sj z-w$}4NtGRFmiNT?esr>8Lli4A1tx!!0^Ly2qr0Cy^zLGQLraWjdivvVdJvu53y5*p zek<2u{fLP3F|XEX4vRsfBen21%fMN8`}yT3-yL-z{dp;v^5_}F@be&q-<#QYo=dd! zJ}SKpC%JOfIBs{|Ar>#r6RGWjzSMcKL`1~7mA-<41BgrMy4W7Av03}PCZ;;3QwSTQ zX#iNkQ?0HiFmariayF3BU1NQa6{T=LC9Rk7jVHDfUVW%GGQxK7DA)pKX&l9+PoyNarb&ru|spG+3Y zEXMDu3b1jhDL7&H_c9E<44Mmey$55T&CKAb8`G22mBV;4Ml-m6dP&kQ851*0I~8Vd<~Ku) z31w;vHRy7ou{VX^8RzpAL0Idnb%-VIE}!&xU(I`kznRfzYbg*otDP{MwgLhB0+nC8 zuKBrL&#AuP@LM}$GS+wQFcY1VV@Nlt?ve)%h z(evpT+de8bPG{b$BU-G#CT^BMbWXz|487aaOR!~EphCE6sGX0+n<>$4u)zF5NRQ)G zR+UaNPe}~9H6X~ElYsnH6Mnmq1sw+7dW|S(H*xqTd9%1aSHg2~KDhbdf}o(EhfWVh z2kK-ttq>1avyDu!YIxF8NThFXZvDP&-_qdfz_nCb5+O>4LEp*%kzBFNt4ig_)e;FnmDixw_Lmc6mwcMp#I~rv!gAz{J9OwD%orW9 z(Lj!Rk7#m6WchhD#%s~;1x1dJJ9}(qtdO=x|}|H5Wu5->YnBtNw~ zV%z2{P@{8$anH7$l&TJbXwg4h-oE^{$B0mQ>Nj+~NZw1~u0LT#5O;a)k(~Kp!Vx$4 zEHgv>5k@V^rYFwvAUm?5JiSc0AlQJS=D@YC4p(J7Xd|wCxVUP#917V~~OI1&G zeLb*XY}@ZiY1MORd7YY;6U9T)h;!TWt-e*&6H-Wmq#vdLwJJ*~;^G733{fMrRX8aL z!$;)jweON?`02F~VI?@}%jc@-j^g_;%zbGx5LmwD z20q^|)r~wdc2Ml}9@#z6&iW;oWo^dC1EaiN?TBa1?lZLUI2}F_eeg*;^hd=a3i22i*eEEnUeJg2 zK>MJHU)JWby*kQ#QTr6-?!&G}=5cEl(n0J3IWDRIitp80d!GFC^?E{ct4BB+&m0pB zejD+({T=z)`Ct!yz<`lXq-%KiV>A(eKz{y)7cG{!1%-TiT``z^*$fFdEBz;x$l$z1maP1>k zHhR?*_14jq3ZI7jCo9u$kR2h8i8EPHU?1ExZ0z5yj5%8&QXI+I4r;Xp!FGgy9&-Fd9fU z?h#0Y3%#}P1d~u&UnfM*C>pMC&CZwXmDGjm= zYceg~`aQXLmM$?l7OYv3>u{TkjMxx7%b?wYkq~V%Lve#4h~e*-0E>Xf4hwkjyL7z4 zpo{plm+^s~=`>0nLrQvH^o116-A#JR%G*P)a50%MY29!Vj{egE;L&(D6SFrUncHI( zh&A)}ef;69?$X@7+Cng9Jz6*Vt6KXva8DN zWXP6U(>A^7YC^8Q>+Q_nbB!qP)3{dI#^W87h-ce#pPw4b5Z&_76cs)25*yGtl0QDx zon#EjWSqlCgPYy%IU~TS;ff(X+bkT!h$(#m&!>NQ9)GWOJaX?aX-sMlGmMQ-CHMcX zH`74=MU5%To}dqoeTRx=hrp!#*gGcX9PZ{2SXmUT@zug1B_Wq3p0?n-HgF;``kDh| zF5&>e17Ek9N4{BfSg^rQa8@~98`Ws>Tq61Ql6w7g5U;O_rO%5=!3y~+O- z8z#CCr^@ccnA&PNrX3EKOYT{Y)STPUd>L)ik=Hf*e2NYF+m}1*d617Q!I$vo3{)tH zd>VP0+B=HRrB6;q2s3q{>6-aLGmYtx*F>!Wx%*S$u1nrfL+{VE#Z^&l8g<_j3MwWc zi**z6CnxNAj`j*9umX*OSzWfLW?JFfv`WcCo_Re?>1~3vHlJIUJaf`4+xZ}ZHS|;_gB2#_VuL~`tSht+YRixqj_68F^{nxOwvuR1f|;cDa7QZb zT!N<8b)Ja`p_>vQR@G04sYv`Bj`CC=)-rXLwg<`$j`)fyD7Oy2RlDB!Rn$F&Nx+kH ze9IQiF^P``mM9;`&l4!UyA<~`WH-oDsqGqza|(8gm`Cqsw|)}__2!_mY*_*}6!;_? zk*VWn2Jdf3J1ch2L^&YAV*pVpd7n9(Z4hzTjN1-jB;I-gMc?Dlut5 zex#icn>*_-ZfsE!lJ}56%BaZUe8u_sAo1vw)Xy^D?WTd)dr~b3cG!}y%=lif_H=Vf z5JQIFT!>rex1JCwB1S8<;Tsj4XR;(l5c3)!_h)a-+SbpoJHY=JtK*!V5hZXi=gcyM z3Pq*G`;|uc#f(V_kXJ-^m%ZTuiS@QwQiir!llIDz6HjMij(Im5)pjgmXnNszr;TN| zXSqXm*~xP^BD?+V9T^ZLw2a3x1qn#|*oP20?dcP?F8YVOjxi0d|9*O|xOETcRduGc z-s7nH+2}rSdLy#k?#Iu*LrI85pcj`z*TCiGuz^r`Z29R!;D+GOQI?T~0yHLz=d%TiN zZJy6C|Ia%Parz@9p2PEEKng1!tK()%H;H-|2f2WF+JwqCS_Ha8mM0{9@AZT`iDU)? z#>NIx-PmgEm}SJ2$@Vc~9Yao!F0nE!>sr7RiUMinQ`M#lk-NnB@s#wU=QA>sC4c#~ z6SvyuOP1U9G3Bzy+PPb;S-s;<0TNbHDCbcw;b@QdU&HOwKQRfLX`z(1a&(EGBJ5tn zI|{@%R*3tY35hOg6U6ZeDg7#^=}GX@uGP&_OfM0)kttOzeX8!K zx?eHlL`iL9dFxA$8e(w_grz;xb>v4ubP05?(j^tA)tdBbM`7egQoB15sD&hu=L)y6 zadDxw4eMSgW;AN%8M9h#Zm2-4RX-5VhXCzZBS%R#1teu<^|t^?c2Y;mt*vyDG=8B{ zKU<#V`x}^ahbF}bNfQYLTNd#B9xye|Iz=gi49CH#Po`u9EW?vEf2AsC;A06q#RN;_ z(WZM{Uv>mWEx@@iL?T+^nGUkkWnU}%C=*2o2OP^#)h&h$$VsW#shY=>4KF!O`sgY7 zW6_ywN91XL%qGmLw7M$s)cxA+ZFE2Z$$f&{-LxN@2sMSG4vWvUl5<(S4!<*EfoGu> zy?QtpG3eZ_hQTdmFyY*mZ`{#S<5^JIX3n$4Bopl8Ih&PGvQ9hHVU(JNz0*|-ren5F zDgPf9;EQD{RBKRocY!_VvKLvPda+Rk0Kr!NbYa7*5cmUuw1y|E&1Q?$xtp2$63CRX zc<5O1Gc`LQz-!9z2|oGZ8$1uqs0qf7&s}5|9z2Drgdp84WP8g&s2g1t>#DrAB z@!BN&UG|j9keRCAN$X;r#&^a*7yA!-x`p(w$D|V^_DDq4TRR(BVx|>wThT*h&qhH{ zfP^WXMQhKDD8$Lwu6bBNiWZg zeq>K>-@AnD-b8_g!yY`%ZD&XxkpJwCFuKJw+8ksuU9+0gO=o=2HBp;$r$Y?{UH2!VKPE$>e35Ob z*uBEORhlo_Cvf70G}mnA%XHp`y3RClwxw|D$H%HMc;iR1Cd=?fH7RZNcY_jP-hK%w zkCA6v1AD`u)k7cXM~8=eINH(WMD1h-tHRj?FYdjgpLS)dACm6B+b6UWdGCMXU_prO z-u*L|vCY9+oo5dc{`wo(7z2O){OSMoQ&JfXvhLY4-HB6zTzQ?GTypg>f41I9!Imb8YX+M4qiy zwi6=@Rt>Q7Ropr!Ox^#YP3ONeC(|(sB2{Il(0bPiGI);7 zx+~~2DU6g+sCfR|KsX?s5rd>k5+qPt%cFYK9apkkYDI}VtncRIOE{wHscUSwr#VQ9 z{Nis}q0g`$U)I4`v3PBkF$?H1AAnRo(fyfbpG)9uP#~&zyxh>_aZTs*e64DpUeZPc z4$nm93m^R^clrKd@djQGywz)CU$7&$=ey|WO{h!VKax-d9 zEn{Szi(b!pmg%!J=S(1jqLMjX7A#NkVtG8jIfxxx3s%`ys0<7AnQIzq2iq<0pk|5(^&P zw3RQ#cse=Wv@tK}xUnwoKUxC;_Y_h`>BA9&;2~B@YfWWqFFJA~X)kKl8RNdcfizSS zid$j?jmiz9wm0;4D##NTkwQHm!X~RoNRJ5O@+z^Hf=uI2MZKc<-gV9eZ{|bFRr@*J z-0yBJrN*Y8(2;Vnbce*E`oh>GF4OAI2TzOkk?W=aO>{!I!Ak6M7JyJ21njikJw0cT zX$bpbiv1dt_vSRJQAO~vsg99jTKY!8p%95XM}CKwbl)ObcU1|%&BQ)Yu_;<{TqXS? z39jXRqVFVTQW+>jM21*}FAIfO7%^6aw(DPgp775m@f8~y>}Ya)Tq2soj$3P9qC8Y0 zn_{*@%Bg{8sgl0_@{Br(E{yw)C4ezvAy(q^ZfP3gUnAqoLSr`q=jdDUOLAJXkHHCL zMb_6kPyA%UTNYy8$_Dq&UyPxE^*7S@dfefq&VUyCdH5+^X^fI9Nk&5@Qxs6@0~@>4 z`MK#o!||^nceW>~+nr$Vjf^y7tsX}DfeYPIN@*r0iJyY@a^AP$JBa?>DnhGUO`)4~ zcs@Gt;^y|GO-L7;c0SPX98r(Q!4G#p?3`-=)3fVF#ixa1(r<1J#{&p9$c!|vMxQh$ zD+>uoY%eG*G@yeI(kO(ZN4(Z10O#Uhg&XIR)tF69*3c^O-J6(M zp-jFP_P;w-Iq@rH2s3^W`p9g{d~aGCAb&BA6{%D%@Y7E8jC$QrKv3*P5U0=TEawN!dAjEo5ZYA7<`_TO}D)StWIUNxjWI zf_&woK>dasY@b@{^TWNFfUIJqxO%UDtG2fy4&sqERDR6qZ;PnPzSPmoke{vkvgHw< zewq@*-3s0;$b0`1?3su(^G#xQ3l^}8!e{0_bd43Yb&~)aG#lXJB+#oO0jew;&Q!k; zrnuk541-n^3Sbf`wXxxP#Khn_u#LVNeeuQK`pwbu?A6dpJY06 z%3B_&2If)4b*srA^wkb;ULboa$abUyd4pkCecKYWJ zIeZM!`3~=``7_G)g03Z%n=r976=&5OKo+U0@hk`=reMq>Kd}F?SK|w`Qj$zoTl-ziyzSc};tiy+ zrdz0dhF>iU`=n71yRorx2h39`w_vCbM;fs{7!@kec6lr}v(KkJNl#L8eTiJHS4~+p z8`V$Wx;Hd5Ozje;?U)6mQp1a_;k%2`Pustphj+=s0?k^?;3v`szG4IMG`ow%;;5Hf zG}2qR`IyokuPG;r)U<2}!_m)0XwIg+(Dq!i>nk+b0df6#AqzdskM?h_Tsh{IC7 zm0a_&tg6T;CCHyTs)5RvSI(yGw<%~!JA#5McLBS**-BPT4gOX@-F9)d0JiT7vR;8n zWVx(!V+U|u92=9V^ufZzE3Ffh;ynk<#GbJ+1b8e4K_FA!erpI70hbkuS}sEnfc!2c z5UmkV)2U?BBvzdLJphcB#Ok`RudgphDv>Vq#}AdIxVV|W=cm2CO+7f0XrmyB@iKEt zVy09EY4bnRal0N0_41qJcS`-8C5NhJ5Ran94Xpx^|gJ>yKrvaSZQ6Jge@DCJNVaqqqOcMw4 zBPuq^;}$o_;N*Z%P%Ls)LINq4VuV~Ve3t5-UNJtQZL?w>(31rD|F+!(`QNb86S8!} zENSwv>Pz*F4b!VK9$Wvc7ccJodXLAiSNZ*vB9*ETCh?bI9_r>RGTl#&BABvRn~#7Z zVpa;A8he5J&>7$#OLI9AmTw;(MgRsZBm@KmNe?OQmXxTw2bD}pjJO5l`}ZtfcV~cH z{HBx}4WqqWz1<@EfGV8(NhiM)R%19|h!4Thap!^Eh2hQ311cc?bosw8(Qf7ZCNC)> zwJ-|&Et3`QfXk=y0NP_7DNI!#lhL;@nL$YDEeNIjR$K`F1STJ*CYMg{Ik4frMbGO0 z0;F*k<`$ZzNt5cqfb1v{uv zEUQ(jo)!tB_IJ#clEwlpFexd3+v4-Fl? z#!7vV0XRREm3RX{El*#!(Yx!WY!thM+vd?~;YFDQ~t=ez?RoBhj^``z6g2`z0H zI)QiX>{uE{MB%65?y*$1#Fp^{(;zfz9gibwuGHL*+h39m3dDXOU&bK~&oHUQq;1B6 zu)(>W7OAI3Nys$X%N6wU(Xg^?N#dcKHU*Si%Muntpf(_S8DKhL7Amy^D=HZAxNIVU zfu=m5^ZRZm-S%#G4giB{?Ei|r{0aU|PWG!%8vCSHY#qJ_M1EUAfj1KRZd+6Gn^!nH z6=g;&M(|YuNy1&$9IZPmrh5lGWoT?+SSVt15p)JlFyQvssq!iq36t>B zzxPj8&DR)|t>u{ASk@4=fE9n}dE5vgo&pGG!r+E8u0SP2?z&_%dGdV zRJCe?kyRit*1!@l=49!cm1%564|#xOLl`ks%5BYSoikN}y4=OEtde24`!Cuo;EssofNDh5Vh zwu2Ph_6=#LGa1KL*~!k%zF-deS9j;BbH}4mWY?D(>Z@_1l-`aXTZ?odk60^-%j< zVGk`W0wA?lo(4=R;6&!0?ejnz5&*ePPDUnQrot#^5!%<((sIB7j$M6^!6tIZ52VI| zY~jhcM68%T+>?^i%Ywa=XH%G_|#r_vdVkG^6)?tY|viM+Esc#O8H4km5{nsGF`T>X20Qd(=FuokpnzX^-vB z;c9X)b7rCkVfADjP+GIsiZvOHtWmB90POC%{lM9 z&wrXt2M8Q9gw0B9TF$o1DgO|!5v5R-1^o8qys(lTj9C@T-XAh>)67{?0)y1}qna5*e6d?kd#oFqy7pcMA}p_?mXw|6cl z1$NKB2h0vRiidIr`@K{5)X`O!u@k=VoG z!W|C(_@!?kMwTaGU%q!ZpIjR49)g_BcBGMB`1vRw0=>rbRr0186kY*g=TbWu((YAl z)$Nv&l7i7B%P?Bs6+xn#B&_h@p%=o!Psk zPLFy;f#Gc7VK_cBTr#eMNh|a$gL+p4}d-!iZYCo&dY*ecm5;1q6HukUSaK>N5s7Z|Wb0 z>u+ZcI!N6{M!h4ph7e1lLai{IC*li7pdej5wC*M^>e8n=sSLmGWA)`TLCvY{KN9I{ z^jR?LgJx-JKWLlL+sy}Qqd6*ZK`y0+$$+iCD+PS48b(kz3I8b*qN9s||HxYXNn7}Y za+{hXPVR#*M>_uzhdx#;ZKPU5e+%aN-!gl6yGsCNT6lej3L)NHXtJv#Ad}e+$5L}1 zxyRlIcx7GvOAw zEL04H*euz@QvDzdJ<)bBgaKQvxnmr15qC}V)8Cz*pG$hlv3!&3>i+t28gjSm8k>PJ z7-#z<4xd-svLsOmqTgSlAb7TOk4#0@XR&mGsme0l!tBy|DhC4SCI|#R&!txTX#1vQ zT&YXA{XfXdIp|hCRGg^c(MPe2BFOy@|0Vbj$4>NiM_>?}W`ruJnMp9n_WePWsiSUE z;8+(0x9AVT-LN}1BjqBojZZ6EIL-IWu1R4(ag4>RY%*FN=yc!gUdi$D`%eAIouG^(2A!JJ1?tf1E1{%kxO zjq!f>*-N(2^B%}Blbi$1P7>Gj>`%AbY5VP+zY0dLSdQ2Ig%)F&(uR`y-v333Nv39q zvcN*oxF52vON#D%CS$$)VQN{gmxOCcsc!Q7gUTEFSoZPlnvEmsib9ge1)`;w8b9Vp zC57;i zw7e*%MFZ9CL~A#l5`SM$#SDRqMT<^bi+Ok=@KLYBq<(D=X!rfJdCI8qqMG{;!LTED zgFiu}8RDFNv#}T!vDm1u6YIFe`t*2xw4lb4*9BZd2B6>9P4+y6!U%XFGHzl>!nWz}_38>kA zXC~OBq85m;-TDFSShsd$X**!*pJC?(B4MQH(UP-qd$2;ht2Cj?G~PLuqd~QB>cVPL zjn!o+Wd?r5zbIgLH)}4bR_+S{X^HVMcT0Us!=U~6;2mXZRR0*5*FRO(A?M6zv?@$# zY7Agf_{cI>aXu53WdB~%Jl$-jyohurBjY#K`;&{?RW2sVQL%!pSDUph8-{!)I=8ls3^`v22XwwDujp7w~(dL zZV?-u)vk zD0$g1qbr~NOOIdW>*+Hss@MvGl{$ZW-)d*+wJ!mGsICQzdq3RQ~70^l0zR=!ED|J3`Xzd0xG?+s8uGD*(($`tb`e+g4CeutzauFmoW9^OhNHw*g5rA+{DYH0~~DQ_1Xb z8Mh6Ev*P1lJzwI9KFgieCuOKK61tr_jQLKUD>aru6?hlx&i}nX`9M*q;8jlwjIiZf zv66o!*%?MP8dwXqEOc@3C;J2@y{xP_hx^rH))N^Pl&{m)Z?+sEsMO`cg!D&-g-xn{tgU@Ba*J7HO?R*l(uwUGDLB1Z zdH?$#-p5O=Ri*YaQe>o_hI!Z&jYNfOd5yWw`S>)TN!4(sK+N0Iz%rN5z)Iwrs*CHGuf6k1n; zpWkbcamm4D`f|D1ay_Yrv;`2i6JR=-rGLH|AceXNm6H;2L&ofNXO}eyc#HbWypk+z z{(f<9L^LIYx)9gDo);=?Ta;kmF=lnWi=X#C9%Kd?N~o_-a+n2WzEvjbhp^cBI6RM$ z4uE`j^Yp~u8VD7o|Ir2f9)ZBr^WQ(+f#I%H9w@M8JdkhPF=8CnZbFKuM3m>y_uMhP zzJiWRoux^!Biq98yY$$a7r0F$W8?0{MKw3wl3kU#Rt45LVN?g_FLWGtTBq|x<_e3TtEtsAK<=2*!;E%u+h{t>gL>?|EhzhmbXdMwx{f%xW$c!Fk>LXMEztv%% zLA_ht%q9V5_4`kdt|JX-WSj#gjm^nmMj16umxrakRfwXb!h7QZrKrg9qwNFTd9kZZ zKC>y3yT?biFm+G)wnNX;_K=hm90Vdh9AFe*1US3D-MO2Zn*IRSg17#uZ~e?bS!+{s zGbt}G{#&aYutwA!zACC0lN`W9aYK@-V%KJHY^zVCm4ZlX^)Dfwn$D1+s<+bOW(tl4 zm9Ct2?@dak+Rb%45O1E_VZT_XVJuY{r((IGZjGK;j*=agYqb(0Lk3*NIqXzP%#3II z%;Gv*V0x)_o@W2LJ9*Sa!NrW4XT-bso^33}E7>3>S@<0rIR*#Y-vJSUi>F;B?jQMh zZ#w@eP!S-G$YABkCV*V~uHIhZSQ`;df4_Nhl4E_%L+re5^aLzZQNRvHNnmC57PVW| z)7M4CY9wO*d1>^$xV&ClLb*z@SZ;5=0>9&a2OsDGfO+FT)YNbWqKT1td3oRDo6Frv zm{{VAYO}dgOjp8UnE1D$2|%hi2PBg^nS(|kdMR4TFkA}KzXwGE&?ol%811Uav{Agy z;+d7of4z^5{$U@7f}j2_T4PObAk?T;wmY~XIehvagjEH_Uy~#Tu&NzbqVF3U{q!Vro?zoDzz&7~e>Vg-h8Vj)K`#?RWN0NkESKBZL%Gg?~EB zT&GKX5X-f$2sy33ghESmIT&2;E~}eOm;3x)1^ZNe8z9fPmNj1ZBB0`m{=(a=PG{ywIkR}X_Gel!H#LWU8O3b<-I+e_n_*j41Y-ktYdJ8g{5qq8aOjpK0sg5M=vk0t3wl%vS}R1+i0(VgYm(dx;%w2$2+e(nFMFY z?zU82;0kl8Q074i#pe+`!-SMF!a#l1;kh)E!fQzJ<6gTj)cz6(hz5oZmU31G4X5iY zEh8Tv>i9sHd~_eic@YNodo2}~mr%d(i*+rJutv{Drq;tIf3p^n<&^swJ(%;6T+XrM z6;4#$A`S=QqVg32>zO-P-5#%&he^+x-hq`;*8QFp9{JN#z(FRLw4!#^p&2EZw2p%x zI*oPJ3td?qn(DA}kB_$b)_=lnZjvN`rm7zO7N1j2gHukkb zqxbh}+%NERE6#r*vp&OQb!Pp#O%4x}d?4Xr_Q335!~V(j^Us~ui-EGfukqp*jn$lJ zWs{#Q8(AT*69yMCL@i39l{=5ShR)&j^z|pSCd=(!N07LAc@mm9OHs~Kn#U7uKJdE6 z7UKU8lclg8ON-p;{icy1M0;MAyrN*==I-8;hZZJ5gsngqQ>8Wo`C46?OuClgH z)d3+%Tt$qJ=2J*Zc!ee#x4V;Gr9}fg;RVq8e76<+2@&O3J-I+$^98lQpoSj7h zA*@unEO=;Wi0gqQIs)h_%LQhG+L)S)V)guh!8!th0^WKsJPgYZ8`86*14!-`x9$P3 zTcTEY8F*=neD!lDrgaOF@KB)eSWgO^>gkUrPjlW<_Pck$g_k+cCaCe~nM5T!G^ilK z@lzmqYw~Vvnz=x^iH*^Z6h0r6Du=yAo-xh(FVVBBm&gW8rs(&c_l8#CWE`fSRt2*s zse4^t>69wfh$2+225$HV?T=-Klal+eAwr`OzupJ;)P{|LUUu9y!pU(#Ft?kFb3P0a%khDV9d85je;6B9B@upDubF6SrX z!-&oCJiNTv)ukx*UT$JutW~ZzuBAeqMN99bSGRc6r%EOkufIjU+n%=<}eD@w#%e zHpr5!u8nm10FAX{vd8NNr@>wk@^-O}O)DlvJ=^~RX`0IH7g6`#ksg0oi%GVSj03%6 ze{ya0B00YUdn&uRop7ZUQn{V~Z3e{P@`n7Zv$0IgEx`5}@n_3A^PKQEQT^HU8{ljj zjDQ;e7=wA@(L^5a8`VNRP;;n55>)l?FShCMxs%5T^o@4b`B;Smaq&}O>7z#E7b<^H z&Zk-J2vN|ck#H?LEzVaGf=;ZQAa;+&C}OUxJvP}224KioHU)Ohlc?BGFf0`tPwdoq z7h;<$%t%n=u_4cMU&(kjb(>U=L0d6KlDO;!SVGUpjtcMSjB?FqONk?D)Wa(?H7+_8 z#uitzU%RRfT^-Ai!l24E_`>3oo(@cXpPG@^C)M9mi}O~-xNKZlpXA*%7C64FV>7Mv zX^*;CX#jVy4i$lXd+_hg#B|hNiegEYs7+^@#^MsR17DQJ?UmjM*}mzmK?zIA@mO;4 zCU`t>Nhldg3=G5t#4BLpHb11+0$|R+DT(A%K=Yh1VDPed`nJ>?{!)(tAz)I$^E#pt z?;CzV!PR27I6re7Z?4f2?&xr3O(CYEzhG=sC^}ldgQwj%tfZ@i1zUpepF)DQo`U1Y zim6%VwYTE>zM1)*y6fJh-j%DsB@R9aq$nQd<%L#s!|`XU5Ep{Nxm@8lOFeM44;YGe z1&ka%#Tpt&2z8X4)sJsx1mNINOV^Oc^F|Z78rA||_DhB;z*XFk>vr<%=t@-jN1Me{U?(9+mw$slFtBzc@rn(F^dLUlk z%H)%*vw}EDjti7QHqlp)E7>OZpQ`)7yzLUuCXFdqZIl6g-^?E57#T7Jvgnh+Eh2oM zk>HcX#yFH(w(?7}q8qQP<_b&z+l<@uhCu>b7dZ4Xz{d0-K^MPy7)d6g^RjZ^^uBGT zz7sqHlOb2e4KTLx=4(60VvEyu9m-St+`3+R7Bm@HSPdB1EZ4Y|$yGCZS5)Rl8XxrP zYvOX3v>>^9xu%aupXHK2&FQK47kDILAji)h5^AhdM{7+GfJNt z-yoSc2tt%UXmTCm-xLI#(W#2tOy2t_5_vT%Sp{?!wi-c2F`G2ygB*5;eAN)^sG}UG zzytb;t)v?=JD{bbr3o}Lgt3hu86=x3HUmLr0Y-!%E26-N&B7S@PA+uUWPaYwmvvyQ zg2!;o7n62|A$D{*80xL6Ui-ZqL)c(I>GWS|BG-P^15m^w8e_6es>906ze3O+&QQuz zf(EA9RJQ~ZdQhi4KY z|Fn0$`SWCuk;(o$M``L5jn8Zs20ct{ICT*^x~$FZ@yV0ZK*hq>?#iR|QuBjUf19Yh z>w@4v1tJ**=AFPi@ejnnuL6i2n1%L#*=Y93I0t$CljQ^yG zbW9X6$~u0YqU)`_)Sdb$Kl4pgS~&Vv&ob8y#P{z!k)aHl*9cZLO&z2!AH%&B>H$1q z_7%`&gTlozxGHgz116%HV;2}@*O7rhk@VVSe5i?|x=%+pcrm3)3jLw#`ScBH?-c1( zjla@A#6tQfAF+L5>cc+QH`TMSK~_|RS6fomOQz;+8@*XmT(nzK-c?G ztiFqyul{t}%fL6{oSJCR45utm(Cor-0chp*NKsXxZ+JU6f9P4*wkN-&L+&hk}C>3S9mbE1`esCrGo^rKI-Ejuq@D zjNM%kOU(=ALAqf5sO6-W_XQBIP}wk0Q#R?TtUvE#fKojJ-)AiI)NoT#0D#BRvRcK+ zL{iCmA_9PJ%#;5&Q3P?bni07~%EnNFTf9y!efLE(TqLINJzb;x>bUB#W8)_(LD@YbGfN)G~1VQ!APik;&jzNN2`y zoF;)pMFrZ1dyzN({(VozS&LO`CBNAx9sRsT#l~)eM4S?fck^u?G()Ps`~plS6VW=y z;EoEkA#y!Y?DSVgNAWF8YV#y4+ zRPeOXgx2Ydlhpun$7$KtG~xk^H~Jp zak)94K9dn=`+2sbj;$T>Tc@STjfoaZAd-GIpP|UAN!jucWzm8di=3cGbYV39x4xr$$@8@^fB?NU0TI-mWhu_ zJrN-i;fO-Cio6LGY;hG@HzDp)A<`pArTNA=j%&ZQ*^0e3e}Va!wmA9@$_*jFvQ zX}2vz8h)Zq@qmQk@3xb5-7=!Gv$Gc!-V6EFZvX)herv6+j?Q(oibXlPoj!1+f+q^t z#E-1fQJ+{b+-jK^IG}%a%dbrWlSwT4aEe>OR1sHoq(qIF50jrv4Tbx8E?z!hxoNwx zT2WWsZfF?hWQ2yB*pmN~EW%I(W>7qJ0Fp%--t~*F3Id#M(*hw9uj^W@yxcdBfpT5V z=1BK_xYM3WC+8@Ag4ZV^9llmr_#%S#%k_(rHa7X=D94h8$Z+=s-cz5yR^Gg0hjC>~dPxk_!Jt0*U8`ZNn*@TFmlx1SiMhyF)bbU_L_h7#OV;>n=0&vdk=(FJz+mZDBe#8s;Jr_8MOv$O?lbU^{dOF@>FuS%5;qO0rN zTIBxzJ~Nl9ccU8SaoxPLw5RyFf|H~VRiq@sCJ>3+ASgl3af19!b*p^mfityt;Gig{VGWo{~Rs4EE#YF6onI5 zo+$fn>Q|^K7ONtgWhI$-xWhbB0gY+y8Au|DCzXDL-!R-^|47Q%!r}Ojd?n_Pw<5+i zY0j?#G00v35PORbe@lJ;Rs2o7P%1GY7=^Hs)~6Uin}B}QjF|_Htsj6QIl4AzWo>X)-I#znEF^i$sCp8x~k zcMS5%K^p`D;Vw0{DGBAxSBN2NZTx&-9P3~et{pc5Y1aN*bae(DzZ(;-HX{YhxMQiC zv+0Q$qq74p!1*xTPRdd!zGSC7R=Zq@O^nJU-46P1zuKE5qpy%Fc6>|dN`RH;tOK@H;R`~3GLGc#80_dZMJslRu1VHLaFpw6K3*0g_ zcn6<=-ndh2VnUd0zt{l>!;vpr{|+XR^CO|6#r&UO5~|)*WdrYzspi8M)M}|qNou-j zaKS!{Ngv3KXIY#wD9?#(4b81AB1(^aRX_B7m=kxJ`cg2s7TD@4-mdPd)`hCZJ!iO8 zls-`vR#4BjD0<+CJ4|ZD&m$3q+#|hHB!@*Ly#gm8>ooxT1A6qYA%t`-sAd+a0L63y zEjdj+8QY%Kq7D8kd{)9Pzx+b8(Q0G<9SjW2n>uJjcy@O7hsgrS^|ciwz``2P&fLrE zi%K{w0EWJRERsF^8hlK8m94FT(NXCr%>n`8C?fte&0jP~QVZe#6-u(;qRMlbI3Q&> zW`IOv5`2Pc9E&@Ag!o)tk)h4dj4eFK!%L2e{MO(?MAzTCbxb;(Khth><=XYC71G+b zq3nPAfFq>IlXsJf1+}bmW;uFy8^IXiVfS=hgxrL#jK(d>lqX1WF$r+aNZ8oWv9PdM zVP4}8F`5gk*IJZsT{MN+IvjVAfQsrMAW#!=T=2fPqj5EZfqgiydY*>Z(fVZiKcOH` zmH!N&wYepIj{7NyT*ni>|J+M`ZCE-NHUF8<{U zwBlna--H-&b0|e+mH_3`l!%z=w7K~MrN0`}l~*17lB|jbV?ZCQ9j%f#{nhs@q`Kt5 zuvMci#%N7TubrNmF|qX|hWSe@$e{k2lK3%+B66gagJurs3B54x1-1n+IrKZ%GM-TW z#MAPusHtgyQU2eN8kklq&Ir%JKGF2WuOjWAl`oegGwX4fCT>z5j#0o5xl#ZjaaOqw zukf`4^fNac;I6xD@o!0(m_8CNbM&WC#;00#Ue);hJ6uC?@Ru(dHF|Yk?F=ePftZ|x zIKYA8aah0_C?fa(zw{Pp43G;F(T&&4lca5ausS%>MX$l^$O&tmHJ8jQg zrHqA(O&zFO9h*J&p#j36th2|WpeEi-y*AiY<#)W;r@v{mw+&NSI1)ZktPl*dE_=@Z zFY?|hD6Vyj8chfU0>RzgA!tKz2oT)eHArItLU4Br5L|*g1P$&^aB1A#-ThxVd++R= zQ+4a!hkKuHRX=ofik0=P^~s!LjxpvA`Nh{@$ZH&q7l?Z*J#}k)2}yCNHbrj~h1cX# ztI#~|)Y>2rXy4`}|H8#o^*Xamh(&tHA66I;Ss-ui^#LmL73mkM3pUL+FI5VaM}M|D z!o)GEj02?z1EAud?bH?tABEpHZ08@99M3>I1BikAs@_M~JPVHP&W}OuXN#tPmTt{T z?)|HxYM=Eg#XDiy6UEt6>3QqVi!kjG5n6)h0Hh?J^Aj%7I5}9^a^4Pw$#9jWRu3@r z9cy@2P-oAC((!({gYT&)zZ5aKGfrh5l5k)ux$RZU!AHim6w`vlx1UMCjc2IM_-xO7@2*-m55$-s zdO&cs&9GZ<7CWhZ^IDHu!A>!b!bguwE3@ISDG-9Qh9K0n&6V?vse{{QiuFapKb{m6$+2Ra-Xbr2MFk`AC@mj= z2K2VK=jMRpt_aiGdt>iyfadI%mq(4os7WEk*7RMf&T2rUTfb>x>F>gC4tSza+aR*I zCo})$^9--VPz%F#Pq;eOW46WK&aZsIOX+yW4z*L)k>lc_b$x!%HTxUkUlnkbxxb=j zjZzq$t~l)BRUEH#w?D^a$MxpC+`Q1KJQ4eam|4!)LJ!FzC2-wHJucRTa*pgpze<6; zzP95oRJ&-8dF6ZK>Us1wM3nwLZu(C;&$S*~&R*zC^mf0;@^Q=ZFp zYZCE_;BSzTh=+eY<^_7L3|rZ6kB~ls&HTT{er=xty!HXVlM-ibU?UO~bcZ|Nn~LbU zR`AhMQ1)$|sWd&AvuW{0+U?^-1cydAP+5mL}j_fuO0Ih ze_26P)Rq3^Ni{Q7hXbnr>ko%xIS9W%bD(GLyOnmJ-s?(DXF`QC zVgzk6oEpBrZwaudr6SY{W^!b{^_`ZfYZ>*$&?bEg>J}SrdmtZ>p`~tUm2ONL49GD8 zg%8VXQK5Laf&hEFm1Rw_5?X-425C!uL49&?)j!fKgRV@o1z!OcSgIO$WgKkmhSjmHuijRzjjlA?FJwLKJ`2E0H-{sM|^2H0rcVleW! zdlTm(njTv5ZD@APg&TI*knyqMTUQ0prZP^}tEIOQ1^M1K-SySYZ1c zW^=O>jj?|6UYmZa_)sE;Ep#%pwMC&sQmih}BN-wu#&;Xm5$wribXq$s!~*(7G*n8& zpV>-t*b*^W4byXy9_;F`(U2ZgPT@YMk0`h?Yo*Yxw}Tx{)Li=o>pG6Q5G-CGFsKhm z>tVT$XPWa#r=3%cUc0o*F&h<{o|!bu8VJFPv9T%DO^G0OKz(V;0edFQ#Hi&HkE)YI z5P^gdOk=# zQfVqTkj#k;2&*9X#^;tVf3?p5sO{yZ!+X@LF4ZE5ac5*7siQwHDwN648Y!DsLQ!GK zvR>px#0r-@Lc5wGPjmMZZ>i!GINvfrfs)-iB@j0X>Kv$_b@UAQdbXlFsnJEKgi>cH z_~H?abkWKa`Tq7y^dh^S6*ZIbwkE z4-1$V_u&hkQ=p*0(S-e~1OdR8*IJML*=A5C?|;Y%xNIir08ZbxryS_oCmk%Zywkps ze4v3+>&n+5EBh@K1Bwh3i;o0Z(NR5s5bJ0~z#mEbCpu_MAW^t*;z0Z5yqD2(2YPlC z>omj_p(En42kB+2W*=+-m3>~C&wxK@N=j6bMk4De>?`n{OV>R#RQ;FMAXM^WAi?xS zTFIn=eNGl?oS^}9rm*9NMC0#_DbiMQDQr z-5~BjLYHZIfC@$A?WKqUgb%dLl1mcC#uSsKdc#cE*w}728}THz&#lPdYpfUAfvT)O zFvJX?EH*Fq6fMUeCqTr+U%VqXKGZVW7@_e7>V3+A!8| z`AcBq()3Y*fNjt27|hX65<8-6LP`D~_55x4;z3;n_PVD5ZsB$DhgT98!{L0~3`pfs zCqeG1t-7=|DoB~{jG_`#{RhGr-ZpTNaFZeBnou!=IE8lXWQ*S;rDz|lsCOgDT3>#o z+e^3Xy{H!u0<+gP0sXDEgz^BFM?h$tGg_j<;}I2#M>(dXMyh8k8ADrV=JwT}5Rf)# z>*!2?5Lv$b8VUupqLR{0$Jbw`$#7q2PDus*ay_3ONkXgY>OQZNf3=}3w7~r2!8*1| zjLrQFH96$y@fo?2#e|F?g6o%mwDJ<_Qc|<2L1G@vj)kyd5wesj6LOS;)cf38RgImM_X zg~&UR?bzP%@NmSI-lXU!yHB4)oSfbQ+McMGm`=T&)ARH7$7LiWBxmU0TT+cNKymhw z^X-4Ost1wfqS9ucmKFhzn+=L_$mqmJ-zf*z-ticwVKK_K1ta$B z85tWEu#|}xFm8Q#nL>XlUm&IZ-VP^qNiXnpVsUC()4^&PAc3}4O)@8F?tC$YtBcj) zu|;lk6joTALp+StHaN<3p_iNwh4y2imp9Xgrki{d5pV!*_pU1p{u&A#D%_u`BlS2@ z zNUWLJ(ejy?9H2SNN65l9D8D{BW+b9s)0v8{OE8yxOUtm$MYQ17zG}Tc`omra)stL2 zy#5hC$oALS;O(`ES_@=!0<}vmp2TV;+AFXw+|&4A(syE=Ul=93aRE(<`m8HJKw~nnzVo~sdO^3FWw90^serl@GL3(^Sne2(CuJDMQrbPO1rb5l zG6Y!B0Zkd|WnBSH-a4&5h}miis3SI;N3d;Bhi}UESJ}4qXFfRgeOoHt+F$$TY9lm= zCE1q$EFv84a`EcX^HY}!yXZUyYASvQ0d2xXM}}OftZ$u42F66L1jy*zm`tORiWLIu zOpiRJ6T0;L$(k!-iYYUSz6H|~VRk$0`!F#KSuZuThCNQ!Nd%}XUdvQ^yq@$NVn)b? z{db#j?=Uez6$5flhr}%lFKx>D?BE&-+KQ9KBu5(~wE9MDPDcM))YN2U6wXw!h79$I z=3c{e=X;CpI}?hQtlH@*r;i^n_mfK|etvh=_6S0sdz0z*?Q5@1X#*~0n$zv-q%#xy zZN|%e(fPrtX`nwtx6)SX-+j4B5aIIQSgy-33$OR8z?gh?i0sJydd;)pJ)t+N=(R-! zEiiv4Q3FBY9F2-Vb+bX(58-_HihF-g4#lqhI&WXH zFTv4fY2`2$R#LTUvI%e7f3U!u0_amZwyynmgUI7pbSL~f_-0PP-sb6R9|bFZLXcB( zQb_AhYYoXTsbn5@#ZL=7qiPh0K@Y`Nw5Xh@!^31_TR5k2W;v(LGbeoBrbKu8aV;>? zR$Ui>XZv$G-<8I796At9mNw^j&E^vY+?1Say46#6=3}^jb7E&Aow6t5BkARTf+BphjL}D(mNGfEMK1k&K9Nj#J{TZ)=ZfB&~&q zI`&>9c&m6vBvq}^_ACsWj+3DX5xYKiGL8NGQs*3QqA*nevhAL8s0&Kb)XOAX)*xql=8w zT38^>ym=`6g;Z|*D@`q+d$UD;9m?PBNZr0c8`p0MmRdQXZl}^ct4PB1HsHX=F{$$N zE~oiKlZqH?dcs_NZzw~c(g+GhROyt-uo0o#R+R|BC%&2~>r=whkQrkdv?*+r36#)n zIz~7Ddh|+xje=0svt>PeJoVUp5ys9iPsPd;4183jcZ86KpTmqoQ8fA~| z?|!0S)W}t;?dE9B6Am!r@zb}B3l`CJoMie}uZ+>4C{ev@yD#}k+jvCy1p*z9AZJ7$ zhQ6u9I&=p(R znny~bQI$VAHF@dd$g~t_MY{Le6*D~Z{oE2wiP+!&8%3lb$)y7`+5MYkQ7@iM9~*G^ zK*LkS$a*4$bI*LQ$Nv zwo4G~R9dFC)r6thCE=&;NYoeQHglvgZ#1adCSQ#|dHdI4zPwQ2qoN@L=vrEnK6i<8 zbVpo3-vpz)uv-E!zTPieI`gBo_A=_GWuJyIKwx*o>BN7!ybEeUXZJc|KBAO%5C?6+zFX(* zNT$(KFr}jEqRI})d*8h$&J^wtRh{`LBj5sN=Z!r-h7=Q2y$I*w%8#wq2uacznnOjy z^C9N`)II#Io{mSB0nB^ktiOIOV0+|^9fCy{BJm_GJfpY~<55JYroVB!!QA^5M#p12 z1QX~2;RK$v(hOHwwZG}OPd53^Vz_O#;jqf#y7C%>2^?Y5VxHIdaFrcZR`H`d^3gM2 zR5#a^zkH3?MfNa%@~zI1v_jS%wa6XNt@N)CKM9GFXiM;EM{@iy>KPqed8sh!9TkDC z4H>XkQ0a;->u7(ffEa)EituDF4ADSkgV74|du|og)vJu#oq(sZ<31}l#{z;?{U&k< z#nBrp*VLY*2-#n3L1;lHc+*HBu$q4+F|9sF5tQV?_cGl!*=76A!c!EeN*(zDt-+VG z`?<7jTf&4ofR1NLgk}BF*zSSno!@ylF%;HZE-Bv25qKZ$rRal`&|5B_h?6+L-nt97 zZdki)OQy%ijlKo;RECe|UG4VDx>nZ}f~M&|pyQ=q75LSZu@4wDJrHzjO% zgvo27?ySm{CS$|zd}>c#x%(X6g*+vouTN50?LJ+xQ5a5g^ImwubWp~3WZ7Ums7vB7m;CCnP^ipWZcO`N@HY}K=_Ik4hxlU=`7kUbA z<7AE!#{E%RMhuD&NUt*hLkFa#;!PRt}#{kxg+O=v#rQyHD0r{ zz{4V?wH-*!so`%|1e$g*|hzB;r8B-xMk0$3HB=8_96FOc5_6-De|#!C{j44!kN+4(ee2VI;rea ze~M{xKh_ueY6^?3?N^?pZw?uA!_x{zJrAj+b4d)sbQ=4EtDjbV4SLv2-sJy+RkkRenGgR)I(A zdBRH+5(U>IlQ>1k#Xv+_%L{N$i#ZpTBd{ti9`ahk}CvcV|d!^5M?P$@Ba+C*rtRMgI1{ zZqeIHHo4sW!8-hs9G36o9J8GU>7u1H_k^IHH8K+**86-08V>*U$>w^l(#T#Rm?!GJ z`E-;hp*zrtPvB$&%i83Ov3O(tz2z5i) z!8+J4M8R8M4!DD*Ke#em4H>8KI$<47EyN@wS?ztMWdS{S9)(+Q&M$wy#kwS(4eg@G z(tkLWVdh}%791@F=YVnMkFJmhaCkn1)pFwmm6KDEP;tBze#E2Ubwz5gyfO`mT;Sb% z707{UU~sn*+lL{Ogyc&L9(&Fm|94{W9BqW(yOy(Eio7C*GM4W^fQ20WS^m`vrqwzc zs$Kin&Qd?doQ!}?e8y8TI4w%e7ck4{j9BXqiSHhfhyNb%w%k+0hm%ql!k|@&;KBFX!pM7= zf{2%uqUZZ{=2S00i zC6QVG%CFc-UNd?WBxgF0xiX8&xTHOsqW_PA-VjDAsht;y~1R%7*NcK(T-JsNHeLrl$@=wNLDy?zoo&m-I zGY)GWxY9ehGN((upCNcV-amDUaf#qdrD~ejMCw=Lw$F7cDwvoLYz39f~EC0B8M=vSi3|==StbdISQUr&p zM>spVYpW=r0+|Najh}-Iot;i8e;R zI>i`@HL=*f1KfTdPPlhLc%KV1YP2%)N9O>G=id=?A)5GpPLyGHg}%M|PfL@4rw=KL z4kg*Qd=1=$CaN$7U={7G0(MMLvxj&7Og_(-11+*Kdh9M6&mpvSD(yOcDkJb$bWq33 z2jszIh~mCZWt)Zshx~Ut-2DZPt!TbpW9aeCk`4`9QAXS7sdaWMRH4)$xC^1?z7Ehg zvKiaaQo}Oa3bv$2WonttVex39MJK$LFe_x?wV2R}^W}F6(L|6ss^5=y60XzLJd(Cj z(UhvHOZxu(J0jwD($g~QZ^p#4n#}3I#+Q``vSOnCHy_CCRsDLqRTO>##FPR`YJf!J zsEh`?|1qT`?Bontk(bvZ?%r3g{>P0maz)AD53W6aXMz14iG)ORDx?RZdjz9?NiyB- z@gi$Hp?kBDK{nmvx}%7(2@pD<@AhpTu)S;N!=Nz_WktIE8It*4ui5-Z^zWFK9LoEu zn*QhWV&eg6Iu{duj!l^uCa9wlte;TLqrF4tL==_DGgvlX#A+_7v~8s9X+);80F?|!O9=k)b0rY#A7!SqU^>Fdp!_3}_F|lw@9+FKbEBpSRV>I0Y zda+BCTnTG%RU5JpdNm_ppjFFXkvLn(!>)7J@06HRbQqfRcU7teRQAel?=qQLJ`SbSn?Pby)A^WyEA=h{Iv&NjQRA9S{=AWYaXSMdq zL%-|7{9$GbGpO1@Z?*$tG`;N{l0H*r2vw*;n}x}?K2ce$8f%cMcNS**6W8VJM_#Q9 zme&~Q{ERzR6=@|))H?0z-J_zjyee{Ox&kD-hcm$9>pzE;u{e~Ckse*uM@h&%qwpaU zh;zf)gMS~tRGN)x)>|b{KU!@vw_HM|lI>g@*j5B{TdhZRp1_mx5aaDqD$d`TS-KUJ z2PZaZaxm9`rPBc|?d8hznv>HH7^g9N@g_Z$UQf=Czc!7xa9uu-PbN4qJ} z^Mv!JFB+F0>;VjBAc*gGU@tEC0m>%R4G@d4V-%c+_8B!-e?cxO5qjM9?4WU-?IeP^ z3s}kQN3;#^d$bTvUVT{nb!ynqx0BUqglvs%LSuktvj?kwU#}S+YPe(w17vX;oCGR- z$k(kgC#D+K_I1syHE}CiEW?M#{-Lxx*o%dY4O{7kxZL=G1CKL5m7>S84ou#Ar`M}I zEK$`(U)`~`nB|w55`6a)GAQ6+>23ER#GUniIjRze%j3@oIY0c&yk#AUi>&uWlz~UD z)=mWb-J5ww&oCZrVpa*SmwpR!i|=Q+FKIOSTV7_3+rWv++?H?k{oW;TV+22~qeCyv zy>3`7glQ9S*$-{sX!d{dCGY)U6g)Blhe0!r_dXy1?wmgaD7382BFc$pkngn{52u18 z?5MR%({&Fdd%seKzR%1xpL@h%YlPjMDmZPsHsyb$(YSDZYnAdU5O0IU;FgZyt=r2Q zCM&f)4EIC8#K>I@XR9}F@~s269={tpYMTO$Zh0iDDOG;xF$ha4QxD3N4!PP`-zj?Q?u410x49atwc7I_rCslW zuR<5szB=P+xRCphz;Dw;R{SdfodwZTO*cDi85Cm@<#aSGh57=qW~P~mupci!lD+-J zZmZvQJvr4Ibi4S&3^a5Z9zt7Q-;}uAGWxGtT?7vDW`LaM*-u3dTSpoz!;@f<Ho0V|gXR-6^o0M%q;p44ij9J(F0QPsrPi@i_hNqxalV(bt-gCh zdh^Nq$Cp+NjYCX=Ke3XPchkPg22Q03>5`h+X%=21mZw| z)0N;yj&1=+GblX;+3ZFsj*H$C(u+An%wW!)LqQ5&#;!{eo%sKbioXF=m46_9}q z4Gk4)oaK}Yl;O{EAD#t=rMmZ=9*5`QV~(>a4nXkF z_3~;j3>V!~X>soG6NZxC)W&iNOfT5dkJyvYe-=cyoQB#2%NKF@H({1>$KAVNFrLX0IQjvrOnRPx& z@`Rp9ikq5s!L`bue_9j_TuR!RsQ%wY+l&Ta%Azr8^!xi-RCO>r5<81Fyl%Y6bP~^v zqluE}EvK$F=wLT>;OZL>DBsL9dYhW z5=oxbY|khKhgT}z;8W~~QWh7_m)|)LiFc`wV9*tR=lezBlJ-KFsXXYu!MUs0&Szr{ z3lSDTYSPZHq_oydm8EDWvB3_7m!#mK$ zm5v%UWHtgTN=B~z`*;OkK#@jVt~vBNOk;YcwK0&h6Ek5OV-w+p`W!_QWUKKoh=eER z(C&*omzB{nR6rN#Ic56u1e%vI(|rA_eQVB zK#BmO!AeH{8^0mt(WS9=cngkV5kdWDyhpAiX*wS3!)k(X$>m5Iiq6gZZ^udJT@~iIHFCPPq3hR-y{Cg!N z&gzZ=^LyjX#{9cDmD;0>{vFz{nX}^h5*QwtXTfJZ>8s*?dE?p5JjZVa8rd)GHWdcP zBjfJs+^(s}d@@C>(%#`Qot5X;Ip1-65RM=|xFU&MrMc2&<`$sfqQ93DLW(A!(fOW0 z2F?~YA1?p^qG=yRN-3lL_0b@g8$}FRo#LP*XQ@s7E+0^cT60E&(LY=OQvg_&^mKk; zD9#M2OY#LiLMHN&83(k`E8>y`_yOp~nKKe<d#%QHJ9C(~^^i7tFjh^0I z>^6uiWU2Lt{`AX$V^4dm7LVLp|1v_DlCvU8p-SI=89VrF5CcpYsqosBAO$%IE z^~R^!(=RR8No(+kb7G|h%M!gspqHZGIB-&6bNtEBWzSZ-bo6TB1DbbePpRQmv(B-{ zJqmh{w2UgG*D1O1qAxV*9bnL!-)6RS%ku+OH(`CY*>@Elb;`jiQ$VY}tQ%G8f$ zN`QHW32l$1FoW6owrEhj_p3AE8T2&NMOT`RsV=z~EONyVsBP ziNj~6`E!j_jq^nA96ZT%t{&)wFVym+t{qk#3qMU2@MD0u9SGP1{s}F-pr5tO^`l;K z!{x^LM~&C}4Uq)HoeLUolNT}bUu6L9=yXiLbksQNOY2=rn=qLr08mK8$QezkeCHJA|v z3nzHIp(Ons{8yOlIL4%bGeu+RBFz@wA)=<3k6kj+&JbMt0|+7ezOt|roD2jv7u}r} z{Am@(4Eo;~mqKpYYTg2^n&em~buxP_;S**wWFygMU0uy>bG2qCD8rdY$?Le}Yg!C|U}XhgICgAhB}<;>KVXDiha0wUtGHwxAi5 zFtu8*>CqVCMh7jcYK*1(&5{d2cs)Eo;mbWUN4am51b!q`fZZ{ z4u`AgxCdmLkD^y6g!<_Q)wMr<$i&vsf|WBm`G04^z!w*Z+`og7_jR7F(grSkvv7$#kGd;k?N4s{Sf1a)dUgcffN7_ z%*r^1r7}Y`XZD(m2MorZXjGcqWiKHw%&x7*BD^}{v>w5*z~Z4Yk0_Qw$HMU5T-eR` zQ8c}ihivbUjxhgwERlFaNKo#1Ut=TB3u?gL$>qB4o?$p7sr0B!C6`rKymxZK0fP$Q zg@ws$)9NU{(inGJDL^W$@@zhy`M_3ukkTwmX>h^<6;6r()>rIkARU*_?dkl&@|Bw3 zk-Mc7RPrGva()vo&z)!Ghi$3hVZBUId7rI+Z&l>0C3cH&RADjtQYkh10Qx*@ znpC{47Y!`-kIKeqnc^;bZ?w51zTsaAx`0a-J_#!;$2ff!s~g*3u^qtJpRXj8Qe*Oo zMNvHynXD|#G&6PMv0ubQHx27pS?GzaDXG=ULt?OS%iXbR6iBxBOW)r z5!DyLlT6Cv?O;v@#$vxMW9Id(I{TSb05n$tgt_QjI4KMFWrb+v`XPM)iQ2Cc8oFx@h*$z*9?`&R>mZMbw21lp~qtbrdVm26& zuD$6mCX)B$0WDX2$|ILj>&K7sr5OZcD`0f0AXV{5!-exA5UJ8_-6C4vFk zkw~+M{(bHO*?qWI{G1VQ{YDnXy7auU_TZNVEq}O~@LNX0GLzseGWfVx!@+K)21VRB zoOWcpp+$PaVo2{s+q=+8JR~9p`Y!s*JnvS3)E>dK&%$c#1^HYYA%3~V(Gax4+I|I3 z+g|18H99AOOI1VTuV|otRi=O%6pitoVa3hR@Nm&l_#4~1F}`)?pHXF)J2#0n#vI)d zDbNkP&MeN8(6u@ZnQ-|La|`{*^4ahBF-orsmPcp3vsd3?fC}KEmHv$%p1s=Ucpg6i zV3t$xbqMOzICL=L(KdUbdpbQMJMl*!PipaXo85xxF8Wrs7nRIN{Dv;hGJDNGqu)}_UnDUZd%Hs9*MRG;A?Ua#vg`EMA=Rb`|!KD`TnFgc7 z0vJU$4Y%VC1J;msVOUgZQeS)Z-Bc>g)Z$k#KUsm7a5T8q;}B_JkO8g!h7U<3$P-8N z{;Tco6|k}|TX-~ogQozMCbAD&HGI}PKmg)nkohhe$nb?0-a9?qf=uKRON*!L?yhJQ zYiX<(>RxSqf79psBJe^qI$&_5LKA5dlW9bv^!6&@+MP~GW@(28JQgpY_PdA#(8fksz0*xI-j+X*fq&#DlvQB7 za@D!i@9vy2TiSd;exxkIGCa)G*nVtD#kuHN>T|tAKImG-L@4vPp~At(HCjIQ$k!~u zdwF%oCj?Z+uG-}IxDBUXnyRa-ubM_pNSi1DC7koeoYG&Ze)P;Rf!}r#JsMo^KG^pO zFTHcE7o;cBg`{A=jP~{ zrNke}_dx$E|NpZd=Oy7O=O2Z_2;eAI_Om`S2&O?6dYh5~?6`AerTOmKc~mD$K#YWX z!qs2?=`aM^MvAvSxu$fjw7dhAidWbHJkgQunM-R?zw}YKVd#5I_H#w!pE%zfk|*KH z(F+DhOY3ITTjY-RJ$3=5Btyt*EbDs$nblHE(Qu?k@+^rzHzsqr*h6t;qr zYM00L^k^^kEGyBoTLhFp4%0<85zp2C)W%tQ^0oC3mLrGw>LEtA~#TiY!9e? z3HV(<2fk!ud+(JHh4fJIcT+X(iw`=KrZtDY%Q?%`UVxmv%gJ>w;KKed`s9DeXf9HM zR7ka-Pv6jS(%lKwo4U_MO3&?ozQ>~Dr1dq#gx^lS!JCm%$U@~n`pv5Wrg3i&w2zx` zx#>wuzI+~r9rk^xU|#dS3f5$!^CbGgEvL82OR2e(d0b%C_H)L3{#`l&?i1KI`@w3) zLn*kFMVJby4ozKMP5yyFX{bLZM>1V?bT~OD4zltk9I{g)|9l+eD981;a6L6Tf-^~% zH1cDzrZwl+CCGS^s&cHc@}H>!ECfbAOfG7}u-x zHhyToXNu>U5I-q%6}!;GQPEDA&W-_4O>mLlO8RqdxQLQKm|EeA5iT!YTi|CZs?m^#93Ew_qAhy>g~{e`2KOvf?KcrVBWVsToaPgrIL8s zYOU1$L=4sD8lOKL@%pGB)kCZ}f>ET75{nn>lUQY*R9eJ@@aus|jLQCb|KCVa&GAd zxjdUAX#e|9@(}>9&ZTiW`Hz_mz@dUYaKK!h_8uYlpFg+&e$Vd-ZTd4+0P@sNVZdd+ z5W)?T{!^s=i$wkZ`Q-(vM!$7&P8fAB{?AO|77;`RW$r{uu>1e_(16s2Jd#$43K&Os zNYlSL_J0_ZpCW;AAQ8dK{J9+hLy`Xm{JvW}{ky{c7vEA4_7(7$mNP~u{^v1G0KexC zh4B6FWBPyX^4ZDxT(+ywC3-Di5U}4Y1I=fgu8&E7Y0m)(6~E58n`70CR@8y?k~{&v%4^3f z9h!*y0v`8oHEXQH0m}wj37F~snk^*XUqRmmkU|6qGM=NZa=l}?Lh|O%2nzlpI*_cc zK9fW~&Gb6p{Yz$c4lfy9snIn;2K(eTGBsKC*`zks2xraY#FZ^M6(Akh57TM*Y%o!% z!pzD##@(n^s+$40FkkQFrHvG-(0?x-hWT?Ev2u7Hdx`U&xO|}|8a}xTx8A-P{MT1RFCt1G$CPiT%5p#9u(2Y9`K|@Hl;% zgS`ovX)h7CPSD6}!lq=Pfog6?Shrt7_V3>m-guv5@TR1&oKl9QEAxH#$gc){fcexE z*AU<~#TI~w-;IO+jRzO+H!)Tas$PnumlGo%X;FUFI3$*drX*oQlGDh&>BaH#tr0-T z4ZvgUV|%0ujutP^XW`&bh5wK%_IfbBS%*ol*$+^SWoBkJLt@kZJc`^7pcnsF-19nW zD*_629o?sxD{S<-CrOa%8;cC}Yl*1*DDz|{fMlJD23?1GE=P_A-yLy*J3~tr!TqtXzP6r5|{-7GGxd1|* z&)dBHmj`oMfMC&Vs^r_yoaBo?XV4ER{iTp-$-a%TiBNM#14K2~t4qQ|UFURT6^n%; z?|@32X_ZklyJ06ns_3YOP{m*Bc%iAlj?W3;U>sY)P zg_7hQtus$Fzr8%Zk!nvPg{SU!O9OH$t{^lJ(9NyY7Z#b>^YLC8M8!yr56C3}&9*P# zk(0Nex!yf#KS~+O^0f1)&ay#82De=?4vKBCh zcWQ*97Qk|E!pG;Z^oov-UbK1uH1ndRx=kawGWboE-(LRtnzK_{e@j!?bfZ2aqnbw7 zs9VR_jzmnS$E0m~vgI>^&$+gB)4t+oZ<5--`FB2(JYT-0MdtOy@f!oN9!5OQk+Es& zx@yIgT0E%`*3D*i&(9M8tpMqSX6qg3xg8JhXPR~DKecs-0u!k~CS zFG%MOY}P@5$!=TUt~(aI%56Sa9&j>ec0M(ReAiN&Al?5ne^2j$=6%E0>ANSVP*M$M zVZTG-HtG%Xo~}7Sk&I`EE<5|JE5R*h4G-#tgV<;w9GY4e@lyTY=}MZvYH|Q0a6a24 zm5O5kT(2Vg1V4!B>FKQxCad9+H?aby0guM_zyv03;;e9XacN(CREkfeb8j}D1}q{B z^!3v(iJIA&1pX^`=Yx9Q&SMWG6A()Ug%4}l`8V$CHZ)rG1fQ+ulS!z4P=Yxubt0PH zGyq_yi=UX^+E(f}=1;A}KyL3Edqo0N)ojJqhCl`nnAxtXQjq)WwTMU-&^K-eMTGqG zNp&v>+0yTA|kfen>$CWGZ4*&RdF#-qvSNImm(7*`|)LpHWklj5G zN`q4Q?!Gabj=oO$#1%+?7|&wnBw(pg`Qo$lY35O6YOTXo02x?&IJI*-n7qvW8@jZN z{p!@?lkoU^#*reewBdI5&AZn`sgBGJLm~rd&FW5H`ik7){*;hhn0skvQpu(AespvU z{QmvBrYnR};cS0~4RBqTI(b?CCv0Xc4fX$A$I%*1X4>7!^^w0!t8+m;XwR@CW*ERz z-<2-a(`TA&_X^Qy*5bUp^dOEVzbnyhd3{$y{J2jl9ueWTUezC%W3SdW+oze;QSW;5 zJS3(+J|on=kP-~2cu#;%b-!XS#`Jm$Fc}$Hq=2V~UtnNS73}BVT*zP1Ju#G2pp{UO z9zNLkBTzfPV3j=S8^G|{=-e@q%=BUg&S3URvp$AjzYnA=EUkeKM71nt7FvLuN^~JG)nA&;b zN!I(d3xi0_%v`|6Arf~4Vg=k}_CeC2@Pd1#z`qAXq}S!El zhX&XZZ7~|?3VEtJ>*a$8I|YF3fLNB0H=fzE@-rff!~Sbha0;fJjN5&Gd9)ad>P=Q<-}CvKNNxpR0*5K9EDM)rtot4bE{c zJDk%~N_Y{N8k?OzU!NK+WpTOJ`^e`Af7Cfq9yh3IaDH6g3r+!v2A;?F^>^fYs(e@c%vZ<*}VYt)2P52`f6Rd&ryAA9R4N9uFV%x+lf}|hR z-=S$srzgR6xcAQc!yjad2kf!J8BH{lr!vwoYKU$vs zAKKnBsE(~`7X<sH-U zr_QB+kso1oui0~sF&_K&R{3UiH!+PBDSo5)mvJ6D%v^lt^gqW%xLrQrh#^i_>MSwy z7BLD94Q+8IP>xu`{9pf{uPUr?M_5>Tje@Nkm@4Q%EYuHLZS;%H_ zhhA(ClxBjupG($X-D;VfYBj<9j_A=mSVpiYIwqSp1|M9 z=M>Nla~R>P0$(!h;P5b9S67#w!A;kGdwcs}I(y~i8erly379#__1mts;sP~*!rI;S zbwFENo2XYDvvg5ayvzN=1IU<<>%S|L5;@{q8Cryh+HJ%I-X~&76&h&fqXTA#NWN&6zw*aSwTUf1RaT*h#E2w^C#pRb#z<$Ojw5SfFb*jYwm~3r!OV z$D*=l0Gjui^qyqGG~h_3)Fop3?@I9mCFE|dx367BUA})Yp_Hsw=DQ+@)aDHp5zVyd z>XhfY;94R{t}pEs9@yBa2>;D^@C1afNYz*ZJFzvLX030lu8ECJ#U~|JJ#tD)7@*4x z3=a?Ai?{pu->Y2|k{-Vi`VRf9jWskKgMBx!5tIU9j}GjK;q>eYN7hz{sExqf7inEJ zK*Wam2Kw-;ZKTMX9SEECQUT=Jk$XIpkjM3JKiiH!s`E01UjMB8k1?At;{usY=2e?LJmW>om6PCw<26Nszk}vC z5dwlxVr@>SV_5+&x-Q_mzdrntG1gt6|Ln1x$q6*q}gfvh2x$HS%2MyB3s z(aBWp)fRBADNsx%CnXi!x5^jz_b;8ZqPksu5xtljTw>L;sGjnAX#OOh+aA(1WRhZa zM;2uoGd+djBI4jeC?fD! z;Q+JCS=MQ@|Kb#TIz!SoY6m}Ea8aLWVcI*o{lVSA^d~RI47d4#aQn&?1SQ&eCV`Un zCpu45z+s~k{LNAbXnB;9jni&y7k-kwrGxB^GRqduuzc?e{kQ1@_;*#dTM1ifQ%|JX zyJYm_NKDg<%MDv324-7;c=p!-pb6*bSmzm9NGp(z*(%cZ92phMN|#Z(4aJx=j_ILo zf#$kz4i*j)*=#=2d1lG0Tl+3vRZO1M31q(l+m!7y5ZiNrR4DKrTD`-Y2M&ui<+OeR z?BCTq;S9kP^Ew+o?}kf7hex#Pjmtw&Y4J6q+pdAaVGVY2K_5oA1NRidCOw5zH4 z;Qk4{qOknKK4kEmN(^gDl}WsJU;YkmwxfLygW>WKParU@hzq!07-Sj$mCT@KU|qXv zgb<0L+VOk|&%?45G=B5XPT-W}i}9&?!T`{jbblx9JAx4oRfofsL;VyGu9}X*8dfnW zzaXwvxL=eP(m&l891W_Ib=atayafJgn6I%QdFRs%7ea-GT6i#|u@1i8RS!WF0G` z>+3|o^rvTgAo{KG#F~3%V!Hi%ru$ZMDnU#wZ(R|Cy+nVoR9i8JY5e-Xq zs0+_m%%2*xxa18AVq{J8!2}4m&rU=69+f6dv5$xvhF2R%=pXaxJ!xPO6p>sV_bFook_3*q45cJgx@wTAoY zV;POb;c5Wuc%UQ6qtW#Qb}e+o?2v`C9RT1;rWz5dQ%(MSHM20{J7TZJM*4G<_spB9 zwoN-icP>*i2b5x@2nYzgjI-?y`r2HMTIDzn8YnCuX(982|9n4iEY7hmy`?nQlQc&7 zP+x&9B8*MSbO`lBr6THJ+q9>DNp$xj`)Kgk6mJViY|bVXk0RoWVlp1i0W5yQ?uwK_ zio=dT@M2;xZ4wpH)Cb4AQyoZX=x!kUNmo}lCUvynGhjiO7^G^4^Y5Pg8_N$nm*L_# zD;tGTaB$^HOgX^i`&|uuE-?=g)Ay9B(Adiix?s0Vnbs&Dz1ApfI>knDRI-{_&@_G6 z7gigK8BnZ0$fy4*tGuiJY4$n*(4h6L#emUVGMg*l%{bVdiOrzf3*@(KoSc-yqynSrp3zYmRQAiI zw1`BIZrc}Xl^+3LoDV&Lja2sE0j;|Lzq?**g?sowK1-V{xzBNGis|=MO4-zD>h}(s zVZolNy6GRawrFu(RIMN{L>!ux#g z9JQ{G7{O%lUa(tzu6y;hTOGg+gQ8U)@i|(NfhEdQ}QPWl(433fZ` z|8AZ4KVSy=U!LX(dw!judiKp$&)CelVEr61gf8XY8y14YX11K3(G|^qP`;QNv^3eZ zSf*iQo>D51Z26mWEZ?d~qSEYBKMshj_fC%Po%z|X&p1(5eNI6kX+?rY(l|U&oYD?C zPIU%hC9$N1GQ~*?KMmj|6KNxX-iz#TSBf^JN*$H;DruxE49XItatvU%B)(ieY8c3k zE>IaJSQ@?aKo*s^L&5Xh_NA#{kD0yiv2>XN?2kXMT(o|NlG@L4{#F0`vgefrkOcoe z*h2)+^j&3O$LrmL;rij6VTwPpyPgXxs|qiVwEK3p;W{sc+GI40+XL( zmf!%ys!vbYyp*Tc?zjDM|6?1A;z)usWz;aWn+fmQw%6T2qvHh$^_&t9@9s8dK?$eB zb4;VGNlxz*AeG2fxnfIs9(U@~A`=;%tK&j%r2=S0+b&`&K5h(~cqtg4kYs*P8|a_( zt8n-n;H%PWm(n&EtX7YQ;my}jF!~&5AHUf(wXkhpHz}!edpwv%Umo`{r*Io``wRO2 zG`Vn3pwrplCJThRhdyiQ0;tB50s zZPm)Kko(tbkPb=}%V~CKVeI_KFb4*@f#^pt`AI;G+-^+X82;V{M!~3(F>YLkPl`Jg zh^#`+2uv(YymV-27X-XWoeMdUOVMy)cl?z{Gn z=TOhQ7N3_IUXZKi-%sxyT{%!f|m?S^u2;3v`8S^7&Eknesu!l^3Oj(@TgM z@qe~fUtSad3VHMMk#u2@3Hv&HtQ+`iM+mUah;4AQi8ZE)=e2qYXVc}dLp-H8rT(L+ zHPXv)`hP-G?*8APDIeRdT#39$IJ=z^_{R8tu07V317;NF#3GUOnb6k%AgL345P3-j z#e)Ve7aPvPfu+e|i^@hsG>U8;C`=DuwZxx^$8o-pZz2>X_uJ<^Z)Qq_rYcZ?`+m_2 z0Qyd0>SM5k3I*v*eONEn|C^j;P2R{`n)j>i8-Wm?u0oD{`dG7slA#r6eovWCVEywh zw~=l;~IR+D%M^2VOdiOU}_y*jmK;*ul zax{!1%5i6vwpNtEDm9xh?&@c(iUVtXMM1YG{z72MYLd$@dwKM>$;thC(1tRtIOB;M3k!H7h%Q92_2=Vts6g!ub|2TM)P*1|kY z^~^4VRdboXVUj522xlR`Bb_!UQughgD|a znEs*@_i3dl;EBkHa!Q>3!zUq@fgQ9|7Guv+S>z&n_hMOBQQ~@#JdI(1Crdvr)_=xw zq{xn_HiV-@w6+m;y3N(e-(zLpEbf;liY*t&_HW6F;YYkKkFUKQhOMtBJDE}Hi+Si= z0+;T2HvL*{9^H9ChfQqxxPUoU-X?Nm_35oi`NO0cT0A8F_DD0y?*#vI;Km$660YC$ z9xV(g(mPKE-;2Z@xJTGRlB4U@EW>UD1Bmr_FQ zBe>EPtTQDepPBztwy_}Aegs2jYU4VvJ5SWBcqG&^+zg#tvad3_cf;I=k*3RhU{mWi z9Zfrl_vUl5j1E_$|Jb_TD4lQY$jF&#yjfbK42c^i{p~78LW!DHLlsYdg2W0tP+6 z#5Pwo{>Nt)7Qi)2OEAIY|2hXbLmE44mcugccI7`tA(lln1Bn(cfJz@vQuZInGe!YM z8&EK-MXgD?aDDoLCAxaM^}Z@e5z7>#eraIwhzbe{TZ;s{lF0+Tj7mQp$6aW3+F(=# z)ko1a#(#w6WnP?&d{dLoU_=UbB~n{!1}u?!US9|(kTM>=G5{_g`3{-YjgAlPlHx?` zH(f2#X9;eV5rAhQ(-sgl^3M^Ahu-KtEHsm2FX!$_4v1q|<*PMOBj-0dYbkzO-K*9f ztLniZ+J6mQBFcv*OO~;DW_7~om&W(o5|P@NM7LGfREHfO`Z_r7xL@6uEhO4~b1V^o zVvA)vPKQSfWF`6hw$IWd^WHjL5_3K&v zcLM?s#`aRujG$LG2*6XL{&Wd}$_i^#vq+t;O=1>LIUxBdANkh)b(5zS`v_}94<$OA zSM-4i^D{67$3XG%S=kciUWkn>o-}nYu6>^^O9OnZ=x+4?Oo4MeAU%m7JHIVfeKa(y z#xW8N*E`JRmr!sFk|~CDYvSq8*W#5F80(ekpFLh^QwfP#Em@xew@l)o&ik5ro-ufb zSO4R?JsCw_d*dUk(+)8Poi^>}Ve<7LfFHeK6|yL-)pkX#bL2dqtF0HSP+M+KrBPVN z=v&ZRc>$%C|DB=jCsA@Lg&M0H12_0sR3VsAxS_o!-Y3*g-c7*fg&m{ppp=%E? z7*HtG<-}k0fI|$JX!3rcm#$9V7&u+uJgA}gEb)=tDiC|XzAp(5fM_kV+W7Q88U|t4$D2|GK z#I!S0M4TUA^=nEM5oGTe@PoNPMmOL#oIeBHPV#+HSQ7u)2d!ax+e73w{E|FBg&;7qKp4b0>Vmu3DwF{5_Z&04onC1e90EN&dhS|IS z)KmP;XbT;ekXi1JUUSgfRzdgr3+#jXNlxTtPOMqs6jH>$H7I4RIzsU1sL8M6N%bp# z5sswX`yA^)sVgsIy?hc;7XFC>)$;c9^jPuj`^vx`v%E zE)~A^xwyV;uqs<>L7x(W(4KWjtoiYcCd8`WGa?ivce^4ioO#A_H;F}&A8bIIf=|}3~x_`Tp`ozIKYzI>@ncA>!M#-D$Um0I1Baixh|1(|?IHDxMpVP#QBhI;xhA0e7>LNA7)FtQZ04F}@J-toy~`E!@Mn&L=#PEZIr*nEvNT9b z7nS-@JXftm1vw{;D#@bZ521fy3ji>hfRtuDbZJ+QQ<-)0$XF0k#4WDdt$X4B`{9=1 z`Wb#0-<+&7rB0SFRr+Q`7c-QWeCGkgu)Q-a`SJ&qlyN|Omgc_jVm>kUXQ={q$tu`} zu$za+b~LC5hF$hO4B-d!s7Rz_O{?h-rl(z8wxSp%UpW{O`sh{rdW97YWm-OssR;A` zb9EBKcs`tCT2dUVE@Fp6upB7$5O1f{p_4P0mdwEhif&prJ`{E5TK*9O%Y22z#~)!w z4vf{{*l0fE!6;ADlRaHDATQY!Re^H!%ewbn>OWYfVXPY+Pz*~ko5 zrYAdiP%_Ee&TX*q5L(ztx?8LlEEj^HCp+|D`J~+U;jGr7y+C)PL9P zbN~S$zqviYC~N~r$#i?VrE7LM2?H`ChygTEy~TwNu*tvJ=z14H$b&aFHkR_mnR=?Y zxQFu_Egri~L?)N3qU69?MpR7a=VMJf>0RL?*UAX#CMFyc)S~0v1mxJ%NzG3$uOH*E zHGX2WE0;u$V_Ix#Rrp_Ifwupo+wnR=4#^VvPmjWPA{$>o6$)G`F^+&7{o;(bdD=<7 zxY>OI*l71;J_i|t8OuE=I(UWArg#2!$sf~8>!}0r3nnPiAi-m2LR|g-x-))Kfeiqm z0|32fyZaWW12o+>_dp;_=u_M*4FmJH%bmd(l6R6xw4oWCj(H0CqLj*m4w&g^%c3$F z9H;=pV#vJ3C(22$(TccRsjfySNZlQymX9l5|5x67%+D`Yoki?1G^bJlyISr@BD( z^J)12s5X(XnX!_Y)_}l~VTU4;IJ{qr@b=_?uRT$Ljo*{`-MP`o9-elUIxY2f>O1dv zh>p=q8FLK{uz@I4piZK&CZsanaEt#^-+)zygmd9{Quzs#LN5U zC6?)+^ieJ@SsYJ`<#-uxJg0IL3uqS|yksxMrE zRg$HKq;u0GDk{qD@fw7pSPz8eCD7|=5^rVmy^aOySIP(r2k=V+C?M6&IIT`I#y~U? zcB>u0n2pyG+S#{N=W!{%Z2sN4{!JR4qfp$Up7n_396m13M)w1Z@-2rwAHKnDyRmD) z9j>WzWkkKB$ywxbhhdDxa#*9#bSuba{$ImgoS^5{3yJ_lQyfyz7>r9@oi(v1~*{*cg_)~FR))j%C<`XwRd*Lp>7E20l}wL z*2`=pv|=o)C>s#18AC+lhM|O9L zPnG+vm=gkp+jC{iUY0n^^S39XcW9(aE zJK5;7O9esC>nEi6et5E4yecg*G0)Sx{La^9{6z@BZ zq3kw#D?Xo>fbej5LLT=3fO-wjsSm_x^Z?`rNaP)Wq`OPb0q_a{(z$NqYZF~?QPo%9 z=xAh!X9)X~9iBp{U54~`m}yw-e*~Qg><7qm7y{#}tZMQU+%y(^heCdH^Uv$btnuFb z(6CDvqqeSXknDfr^}(DdiyYc79Q7sY=G*N1qvl3<4%a0o7)xKnm6vb0k<2O}}ScbnG$AZI8^J(Slomj3%AN0t@sl0|Bt;06+q0 zD!B4YM$^>W+*#?*5OaPK?)KjND3>BryP#c?o#Z|-k%4}}eYLcr!j0J(dbX1cidjrQ zPwfRO>&qC&7k%tH`Ff>t_$^)!JtztaI~Pj$HuNzafx^ z8#G;v#{Ky=%Ee!eLPk^#O+?&(=0H2ZT^xUmd~c}NCtXAl-3OtM@b8M27TOQ^GGX+U z3vwjB;stTm^F+cC=0OYb0HHv;(U;fjaRb=F&aba~<333R$g|vzeU{jiXF*0r zF4Jm|MQM*&0+Mn_#JQMLzr8#+@%wXBmPy2u`x`7(Z)ycn?1s&`i|aH_kxUy{Qv^=k z9G5t_D-fol*1A=S1f`pIPrn>^867X8+;)wtu^Ln z6N~ydfthBjkzvIPLs`i&3Y@U7;JCFk6!lTFdqhB9P2b?Ep|A*BH6~YbJ(QpQfRnlt7vf?`(b_sP(tIJ z)UeeMm=Ktc%8+<$Rw1d(rf{rk!pyV~z>T1aBl_@#o2Nk~Ry4_|uxX?yu#V1^n@=$rx-1LqY8ys1VMk|v; zM~Rd;F3l~k&0$wk;5I%~sz^E&@<80Xj~$e7M4{d4rXX&&(>n+RHNjLk$~x`b-QN<8 z8;2){10PNu2SQstzO+)W#bvbHB+0Hw31AUfE!9e#7loT-!US-`_f$L#B#>wGO5w2_ zSo_t5s_&MQgM4`qCSV%*tp*LR=qhheJ`A)7n+*!(r%h1Oa+(ru3~~~urtnu@n1~l3 z3M=Lh^gI4u0CXUMlKp@Lgda!=f-=T5)MRPO;8cjqM!WO?v@QYa+W@Hs$5Fk?_N|Ga z5%BGZUzp~yS>d2bt-6tkzhb%fL-Vi_u91bzdJnnX8Kxu|e>c4C*St!tF_))~S% zT9!a9Z5~;SV!>01p3p+3SCk<4AvR$S8`R3HTmf#y`BmfT<5<4|3W`KzlvY=0SeaLc z)gqJM#Ngr9(Sk~A+Sx+YyRyyK&7SwyC(GEt_7JY-v(@*uW6VW@g}<{CWWlDu80CNg zs9dl^hrnLQJ_cq`DJr(HS!a5_C@%MeNo%TL3v`zKzqgNAI`8#6^Ef4wJ;yT;yWm}W z@@<(pAbI5-TbFNe;-?NNZBu};!yrs#(*Bg_vD)MRGg zq*hwLp#v2nR>3Da(C~HS2X=sy?+FPBnFH{tf3J6RB+;Oyr$YFhF|KcXJu(Z+?PVPC z<;OUwYzsVQ*q_AbumhuIBTchM`FfEo8i@zH-jJt30pU8v(|eGaoJgMCfj?VfZXm#F z(b#C>wcGoef&n`BEal5%cJE@Nh0M~i1bt+iv^h9;m_-f$$X4c(1QNnbBr%mXb6aCP zJ#&hSD-R|XNX94YiR;0%d-&tJLQZrz8ou#^CSC_ zRpam%?C_n#!#v#ge$hmHq=x+w{=wQTN5UIn;{@8=o=WDIBBi?`pf7>IH!v#&-mr7E z?H$)S@vDvkMI(gw$#_oGDrMp`Y7KlcL(=fC*iS4|H=H`$BAo2bu>svLyJbciU$ZNB zkCQpj!}<9?vf|bI85TFi%mY#sT7w=I8Gra*dx2^oG|XVLJJ8=$f@PZIeD_H#!@~(O zIV&^oIfw{H-s?-oi01<9>LL2NxL$`(H-5Ihvd}2>r`A%GCXhLsLyz8Gh7wttJt~Sl z8-08K>8kCx$_lrmo_R_&Vt9_c2s~Ax-B;|1y2L4bJvsF-CLURXipm7$C}u(P2m2a!EKQJ77}u}tX% z8DYJQBTWcLI<%=_Rd09}CCswl zI7!y(`t6}sH;|{kN<8eEk{!5rXcgF5gZct%*IlX#^?|oe2A{*>1!15>i!3)*2Mv2m z>*rT+b@d!G1;&?|&mC+X9a8Ii2RFS`^MTizjxcQ-F30V7R35v*mme=2mK5l-@FUKXRI?z4p25*iE9 z((lpmpnEo7WZdfHQNJ-+GEV4XNKU;#OD)ieDCQgZh(+Ll1F>faM7-Pr$KF7?KpGHk z3^XMAzbA6t%MY&h$N#EyYlu)${eT2c&!<~Np!yYzRfyVlb#)bcygqaL`(fzK` zB_eGyrZ_f&NzTldmtdlu1~MwXVQ+=OHqy$c=p*}<{xS*|s0omx zjN)iGgj+izk&LsG#UK;G^ThL|+*@aXlqXwtfBMU%$A=}yeOqfA@bZ`)gfXf6ExKBz( z1|_(?x#nm(4@Ru`bnh!Atn*(fsg=$ll_?d>90 zBmGwM0$R7|G6F5jtXJ&e@>HoN*2B}#IE^28th6%RR_S|4X!dM~W1_f$iepL9OF_TS zI@*3r*)K&}g(QGvJ}~{L?N3Gb!@Z7U#Ci|2;`4qoYfV!qFLdEqr;)n-n=$(rkiKAi zm6Xgv2ck+^3$+564E)YZD;~B0THi|7=C&U=8H*0RcNWasZa+ev&F4c16l(9$(*rEt zBNGY(S|K}t-18Aoq`0I4U3wRwzzXcn0x=6v3TOP0 z=WR+Y-pmMuJRfHJ>VgwV25XYZLukansYp!%ZHa z2^5z(0G(A7XUI;6DV6g{9L)r4Ude57l4He;Kk~q?){$xDV{cX&1h`5QtG&!h7d@3E zY76_QYMBtEVq4+O*DoBn znh?=K4W=nud3O;*r83s<2q%fi=5_q4>#g_&#zSRVU#gm9{q?a?!8MunF2jKF3his5 zO8QYqMdn&tQ=`!=c%DZI!S>s;C0aKp7s95m%7SE>MnMABvClX|y1(#(v+Z%x%tG;i zgMQ++!{?O{Ajr7^Z&Y40ZsXVD@87>`%s=0rXh~;rYrrTNI!pr;!kV%D>4rOwKO0~b zJbd9qe1=YG;WB7i3B#I^MqbW63COiU=f~Qf?hxA7%T}$9vGA{pKm0uWl4%56)+tOyhE`7!rZH|4c2;tTYxu&B|?(;ygdjeEJ_v3^LxpDe0X~^ zi~Gd~20QEdgDoG;fa}p0BAF*=(yz&O3^}HcR-jN|SrzslUn0~I` z?aXG)3qc>NB>Yd6H2tqEMobt=Y-H^fdEyzdVB8#TF}**^f$nMx3QP_jd49sXLpRj# z#xjvggF4LMY(1L72nA8AKzdD|$w!D4a#yuthgqG=iuZP^-r=lur1M)mzAmc5uv<>l zMoy^pF57vwoklyLd-Tvh*D1bcGr8w0Pk0=+gN{E?cT@O>qv%?NJ;a(pw zZE9Zyop*S>bHjve&Fye~!x8MhdeoNo8zK8e%n1B zH!Hp%iYpe6he?K&Ag)fQM%-eC%$QoS=Wd2O8+E7fvFK!us?N|s>5CR3$(g7YLzdgZ z+y|RXdJOwHSo(1DR?|s)NInJclGwFh1Tv3!6w%5@eGIAZBM3<6pDi!ogjo_q5Nl84 z@rL8@+M_}vmGZmAUwITkAIRB0EM4~u7QSxb?9OO+Y(@L=EF1nA+ddym!S!*r4g8?S z(EU0_gTK;(D77ck6ZU!=4`-n`axjGx{{58LxWJ)+KS9hSBeM~%yt&SQeKfgQTF+W* zTy}QD=_JE5eaLZec4qmjp}LG%!chQOfrW`NS;Wd=nL zoLQOoT-!Jbt={K%6!bi30f9*)>0zTs$z)196!`XGqSTnep|GRB62&eyEDKPoO~e(q zo88$~_T>rV%2Ym91zSIU8`_4d1u+zbU}bO$2nUIeRDI|FxjAT%AvGip*T{MZQTG9C zw=@PXpbex}KI;~mHS{uf%r3MZrZ*+Y!W z33oj~aNKH?eOHdi4LsT7`#*y$HR)dC3eN(+_5m)SZI>PFHd$? zTGA|{4*H1#{JbcQ)j^cR!;OEf5#urV*j%$lgU^(y#)6Swmq~swdoe<2{xSZu&_16) z=%Pt_&<{U!DA1-SViMyXX)L};e;-MQ_n*Ij3vO=wr#tjz%u!O*Mz;%6ppkoDQE4b` z=+M*K|9W8W8LjFv`oYm^QYoKM$MR~Xm!ddmNE-HRm{O`P$_Y~p1$nvuneNYOLr9Ie z9or0LHlJr-bEtBl?&Xfe7@XR0BoiVAQhyMh`m*=4EV#^W&w9J*XryTiRl#5gmY#v3 ztRPunUyH2G0=htaO&f)u;%-Dp25xf{$z&c~f&W0DhRkN-q)X^=8?NM`8=b^PC~P5= zx<45!e)Z1L5sh;FeljBXTdcCcYD60oAtB+2X?n+-mfO#TMif4Cnq}y1Hgqd zWWLwrigJo?fsKoQl2x#%f(--G{x+YXstQuD zCtQ-R;GH7=B7H|YX1Xu*Xhc-z5Htt>)NK4KG=OAzi@U<9jmh0$O~;9SqQfMY86X9F zmL(L}T)%!v3w$@Y+;e7opUJKLd?t^E+9*Qpxrw?IEq1wv!wFtu`jWQ|>pyd@pB(<> zbh$xpFq%ra1SJfcf$&K(cB|ny=eFfzeeFlc#)?s3xcAd!6fa&{O3#684#YTgtA0$} zJO|Prmu9RC+jtVyV`UElaVeK3(26ST69TM3GlvLbu zovjYKZxUfK1n`=YL}p^MO7KA97m zFqM+CW;j-PJ~#-xG<@yyH=D@u<2MqPN`d(~!yJq{mMR2CLC)lTdHQ;f(+C~Gmi58o z2RlsIv2q}WN(ytD0UllP&J8{%KAb>F$ngtxAA8VmRVRq_@88s!9yQOp!a}skBn=YP~BKB4WZo3$Qh)DrVNU-(v z3OwmpQ5R=>{_*o2r7oXZrnFA84G9J)jlEq6XYa9n)wld;_Yp3&6^-aa?QD}z5}>r* zl*D%#hcgCguL2)}IUfDqhSjpoEcSP0z5Ba z@VWAoXib&|rvn}*-QsKi1dlnA)pcPoqjGC(->^u{!YVW2r~b|dW_!8y*}yQGTQE)b zEp_#2hIonjB%aQ)Pn|8u_R-^#PNfatLx@)svde**n4m?#Q-NGM#TRJC;m}5aVe_m@ zCQv&0gJJLQ*mc{kUsr;o5mDZoKYtr;QV_FQ(3-A%ROVRZ8Zf22(4-Oc4R08`!X-2< zCnIO>YopG^|7MbbxRa_7AojMpgHYdA_XTdB>$1p7%elHSwhbX@!hqkp4erx`sjR*3 za+rnhJz@M4huHzRCzVjJAVH*r%w}HUMBP5W-^@y*J9yg{c62zi`h)AIb0Pu)I+X12 zeYt$$1Gt}ci6tE%GB!St44SOE+D|#<^}R?zKsalDwZLt2HYQWGJqTsA>xsZax44); zxDbwXSFPHH^fMM|b0poT z_^3pp2$qPg%vLjx*XapLSR-{>X8HGk5u-|DyYYxEbzmI9a+mS8U(dNFFt^Ze*Awl& zEBX16O=7}AUZ=5WS}sCpofFhn0T(#3-bOXQ^VfidtYfTaC=TzSkL>Xk+#_x^^L(5X zV|+IXXf6y_&UqI+wx}%<#-KX11pJHl&f5u6m``jA+_1@KG9_OBl=fd_PYONF$sSDF zZbBm*Oyk0c1v8Ub0;X(`X!@*oy!lVEl6?wU+iAv<{VBpQy=5Rt+iykPC z)2P+tP57ZCpIs5@D&sAum`%D%h3j$r1i_~m?~oW(ByM4|-sn$A@L}7>D>!eP$O}qQ zsZRA>MCv6&oRYeHtQ81S5giN9-=t2;aJT6DpiJU+GQx4tBsLQ1Y6FA)n6J=S$^;7m zliy`Gjs8~2i+DU6f&29bzw@8+GnDZk_HChh7^6bc9H4lry!S8MV)2%Lq8OE@iFilh zkGYV^i|vdoc)kbK-JHOcocqIW8Vh;6TU}1I_t!*fix8wVjoA<44v_56>U=2mHLyx5ssWd)#o>X*cES^A z{aWr%^vC0r>C4Xn{UBo273U~_>W@u&uil+z3LfPgsT%QqKK-wcpag{HX1+|yHiJ!N zw0EB)gL{ZM9;P(f&L}rZYv;1N)85d!Nnq9*{^`v)2L;YBia?4ugq$?T*SE>ha%%~N zoLxJ6mnk-#h|lLM|II;O13CD5n<7J`4BCeu%w(uwpIK95yJ_C$u6@cK2>;;%Ri$&JRx`-S9cW9rDL+^1R*Nn1oc zt_oSW{!kJm|HOJ_D(hS0=x~iId?P=|(a>L{YU2j-lbTez%DmM6g>l|_0gudhTuE=X z&`NN~YJt0th9F>J)uTsdiD~=5I3+KWw9McfICg#FY6I==qRe9>8pf|7a;Tq#V^ahR z8t~&+Q#^%-Q&@G_#2Y4<(t#A3{#otwJ{3z*HWdqRX6Y7h+-1H}Z{Ydis>)$^*zNYC zZdMHH#?M~hms}0zUo^F!V$#KeH@_xhU^<5B$HU(6Ubl55f6U02pNlXOz5TTk*FJ!L zm=#{o@8EKKG$4+z?F^U8u-4B>g?)!%w$_1#AGf46)@y94SP1k=gZpIM%iiGYj)#Qg z#fTtImls}bB_(iCCJo>ziQO@p&nfy%xH*B422e(OHxk>(=p(d(JP|+c6uQpul_-}Z z6-5(;DXF~+L}_RoK`H3pd_e>z#^**mpH^gb>qpv>#ttu`auhIqh0zltgzDzT-bqe- z>6h>MK;>vkQ41Za2cCg}S}@th9%;vvYCP_20DmYLz=?-qRrBa2?1~Ku0zb>``QE-v zr&M5km7~XUmS(=*KIa*45{(=}p|&G~&lnbHlw@lDI=D5aDM`k=-&%2D?dPD(^;pi>h=P1mXA1eM~OXiB9;o~nm!z@?iDO9+J~k@ zO2r}z{nLVeV<+jVhGR1w3ORQ6v>FXsC(noi7IB$Z0{w(=y9CrK6rso8zZjZU!|OtU zCx$(vL47s#53>`;CjEX?LTTB)LY|(~1>KAe=JXssCw4hA>>6v-W|P3M=ZJcq;|Zwv zL}KyAV(-^qUxEz>c6JdFTTQBf!zDxTK9zjl4N2Nex- zdYCK-^(+J1b1B(SKncssd1*lX4n8x$oZ*o58& z24GvnnTB2_v!wA`?V(pq>RoDX;{@5*?en6hwcDfM1$H^?fk(+BA+34@v4oSd0u-lS zpjCQvVi2lOIHmz7i}~Vg!R`HwQ&CX?>y~&ar6guiKu2(rG0}1;oIfkf_F>V8Bh ztnoxGxrI(p$nTYPBYsQj)(3}Og)a1-6Q;UK3{&v2V0hPjqfsUf`_LEiS2%m-JyLD8 z@t`OCz}~C1@4k!)Uv16%sR+vtslV+8n3I39^(lah&Sypa;2c0+aidZp5Xg;;<5Wx= z^q2dFcC^X;`6jeZ&Voj_XpU4eJ;0QDFPTW4_!FDD=8J~nbnZ1+;}@wo-h9J6yTn$G zmyU$SLoBm!gM!{fdFhX=hpvimm6t5`Tjf=qZx^x{D8z1;3~yl}{yLgK!(-uG2Ie6a zw%P!##Q~r4S zxzQmdsVwp-80}m}45m)^x7!cqnvl3x%+YYcpQ5yis#Yiv^-#NA~ zQ@fMNWxJ0vcTcuA`LmI1CP5)6+Iimuj_yk`fxq;14eP$iM&Gg+Wn2^YA@(tf#|>Zb z)3(;N+RVs2T4A;LRu`wy$lVJeH$q#a>rAm_H4EjQPAHtBYJr^30Ggi9CdHtBu#dY8 zr#O;$IuqHjY2`cHyA`LPhfuNx_U*l2@Pe-gI!t70&4N`B2!|E3ySml4^>4)<7v&p_ z_6)UP8K2}#fjBa}lC>(=MLCA#N<+GKJTl_a=FJW!-u#Dk z=w>v$1GmGFQPaC?7@ad3HjN`q6Uua!3Fu`s23E&j3-0gE`!g$S$E3ImNd@oh6cY)MQE zHd|1cWfsf?wZH^G*dTIo83kX=1HtDgTw*&>f3LQ%ze$gi=(dxhq|H!D$XK<(oR%0A zdsrPBRmXw{VQBeyV9N&k_08+qT&~xN4$i#MSm@>mzA=j{i_`P+_>sBR4|XNa@Z!c2 z4<*M`6a)XKTZAFI7xz!N4ic( z$BxhERiPLf)tIddE1=6=g|9w(D*_jFP))bD@o(tTTA8Blu135(!$MlX3Y^G~6G4;h z_^p@nnmzu~H+v zzr-I}tnX1?F8sk5Jll45h#}!1l^Ya?cwlU+A&BP0bb$3g;5NKcE-$5&SwTn@HC{Lj z<(JQrNl>>Bhf$?rG{CBUb9wgm_8v^2iWk88Lb6xYy!~0(Aw`_D9eT`Ysk;`9WfP$YM&Jv;WAB$-jR*iI?AkPx zuUa}t=jGxm7Tj+*jhq1&<6IVUkDx(Mi`311$(f9;(VzbNL%o`R`CWG608wImI^)3x z9%_BdhuW()GMmN^50IX(Td03l;dGTEMU~;2_=o!!j|cSTSuCOO9ln73(w@n>c6O#U z{C{({m3GIPH$%YpF)aP}#ct&XNd+$pFWQ9{j#9NI45xNYPb&A&#thms?`?rzch)1X zxUAN0469tg!G0-8$VeWS(0WE+&|*ws6s$|tV8Cx&DvRCqc86Q9?^yFTN)G&~;?08N zY6+fIn1=Z@xv@R9E)0yyViU6~1cEkDWITNAqh|#J0BZr_Gkg~y2fRz^aFa5W$nkl5 zK3cA&IGK<4ok@&wm?lN<5-s%Uz8{K}S3dlH5bO7ddxwJn>ms@>yC0C<{&Wi~<24BL zF&?n{_fXNg707QIO4(~d{$#KV$_uuYDHT4IwruMB8Dm8mQ;m*`b&T6eRvU$g+9rNh zVh|mfkaC%V&zu~7U?bCaI@%Zw{>kVMd^)#s{_#qHmw@Ere{K+?poyTt)YGvw(4R4g zQk%RAGKEB0B9?E*nMyjw>(^ZvaZQQU93-Z@x_ItL_1xA!Y&B&(AXKE*&l+pK)vlNT znYkPX^zmN7gMEEDQu69LBYRwjT-c$}DzHLZmPvF=4xkqgaeEU|xmlXDv5w18EL@{hDg(3r ziyBh*vS!gW$K;4@pNU(ko?p@Kg%VOqRgZI!G2&yP&xCB-I{ ztznU&>EBdsYF*@HtY^7b4>w|=GZ+CnhfT85mIJb>&~k)$h$i8=I(QA{)ST{DuNJrG zYv?>tI)V#lX?((^2U|}PHk`V=WFOO;q?J=ivouInA!eHfPAzFFGX$2AS1z?hBxI66p;>aLH_4(i8njjY%;GD4e#> ztTif}M1-s&cG7|P%eEKXDDTBZ5aVkH5JQz&D9B-Q5i zf=vPbgDN&H=3%n>H9|C1R9(3?g;&U64`rwCJ))#7k!XBthb#o43MvR{Ye2@A*Ug)R zJvi7`Z>lx|8Fmme`8kz+5!X@x;{_$$4i`>y^shQ8+w%p&;RtWX75+o$5TwAjdvx;? zuJ&Y}(mHw@0_E{EOp=!;T@PWo4HV563$y4!AL7U31liN9(uAR)>G*>@t%}c_(gq5i zKdk#^C6E|xHl)$z(lIM5MnLn>`>(-@OW%bm?#(|YQ9Ts1AjN75^MVh6nuX~{<#-C8 z32PiOmE}|&0(}Ngpq!^ycfrBIeE8$-F^R2SYXCQwli~8|i+zY<((3zprphH4Q#H;? zBg^?lOB6*kc-7`ZkY2&S!7Q{fUG^s_bSIXHHL#}lP%`Yr0;(Ybk5{bV=*8SN?5b^C(_jzSSm-Y=r zMH%>`hv(fXm&m$p0XpvYeNw&n*Ql*AeL?qmg&jC7vQ8c%z zq2>DZC89o(Hi2g+H!Pg?@mbWdRB>q;=;RBfkYq4%Z;v>?N}yk0FO=_U>5?%~rJAJ( z^TUd@b9B#|WN&@mUx|?!?tAPhakZ}t=zAt1de3*~et8$n-3J^TgyhyAe&G@hD+o%Q zuWMh>XoQ}O$2c5`ArfH@-W$LbFY^Iv2HzO_TVq3NZION4UU2*x^>;J{s|1aG`i?3c z(*TKenEE92pEev9ytOnfEYiZ_#Xozdua*nGkE$XsX*#{nE@CTnIE?0V#u0cM(92Hy z{k0U)G2`8cy>Iu$v>8w9^90eDe}xXGe?c+N)ervEP(~xf3|qLP`QBTJCiyq%bEei@ z02&GbRY~gggWwtGS+q6R&CVnuf)a@pd&IRsj`F!?($XbpSH+9vY1?LqQFU9&m%Qhq zMmQyz>%o^CB^d{HFR=eplpO@~F|y-tza?2ZEpUMvV`lymCeqw(@9lTXMu3M56?y+p zyz(3#1T4#f!r#z#0${l{YdOD1kNSZa7kNYGtq_B#OL z`RB>(w((YPCAYE@&k^W{t~OP9ypzdH(NM@=(QoJNEyAedTvL^E`odWw%M!s3%-=cA ztk0%_s;QsO7$3hdXHKoeZ-Z@lf5on(a5y83(E{L7G^u+M4I^8KyO?+Hh9(vNZXvd%>mcqaF11pbzM28L@;YnspNcNx|zF3W zmaEt-XlG^fyQ)u=}BZsu&(BQrVM|N{z6|mL34hMhK^D|xceUy0U+=Rd zr4T%AlCrZRrlN&zp)7u(C;TBvbWSQxdz11e?H+);x!fDq%@xS{DkCJrw5P?U<~aKm zoS9q%-*Uj)r0|*BCN#&wvx4|a{cJSYF*apR>QJ9KJYbD;Ih~ypcrxNSCHp?m?UYB{ zEJnwEX~QFpNx?!AMt6Y%Gv9k0y4b@VS3u#-@4>jV!G{Zjv%04qvl=dTBV4tv(#t{nXQJ54WHzd5D&2a{ zg$v$Fr^i$qH_A4v{eW>-s5nz8<%wj;$I=erZL1NR9*Z#Q?KBpTr7SicMe6}@H=l6T zmS+IV7k91^#Y+cmWd0F#B&}B)sf}bbwnygXW`p(mYL_Fo7|YpV$HeSeBvFef;&A8j zQ_wPs@IhkIPsQP6i@B*lHtLxUI!CEp8hhzb-8r!O3&NkBd8-^tCnD+Xmz|ief`pXb zV`l~AfX>V70j0>(Any85Xr@SQWbN525U=B(Sdif?{ z$r&8zq`6c;i12<9!eAG$lP-j!5XjA#5u#77jj&e$N~#%vV*C^T%Hk>1^k~Wj!YF$y zf|D!A!mT9k&B`j9ocO}ULzuvzLg9;7&dnoN@<@(Wg7)xZhbb2G{PoGsA9V{(0R-3%o-OgX}?($YM-u^&E#;u9-EW)ac22kBAjFmcQn&s=Po zg>a=*Afd_%Bf4&tkXWlRf?ogNz-&gN9sn6DG=#%EEo>OmGfC53Y2_3xM z`X`rz=qMKS3dt?Ju?=@+Gv#<&9fpE6st-lE7<(VdW*Ynr6Bzc;y|ly0m~1KUk;2q6 z6Z*(7HtS^v^cRk^?&nET&5ArhGu6_B;)iuY3A^`uuRXeHa2l-l$d8cA=0f>E2a;k* z^3?1P7gk#q4M2(X!ST7-$-`*xd#Lbnk&OhSRrhBdelanFdE_*#D5==tWJsT;DpRj= zBr!{TeyUA~{|LAUO@AoQmZ(q=GvsM7J&|(pEr9gmLXb7u+?W83b|65#Of>jm{DCrl`+^!5(E?)W#?nOokLv*izs)=iU0jMbuqo zrWtdp7+{&{RheWD(_hBmMPsE{U_I~n{sBz2?D=FSvBEZu+ zfHce=?zn&n#Cfbn10IA#WeY0lWlCiIi zL}KF6b)3Av7$ftm4uV_U z*j{2dn){$KX)xPSv;WbTM?un8YX2qzOQsD54Wg?#Fg_9M2)~QaL5jrn(Xt;4bP8rWGm(h2iB5oH@DS$)sP!7W!-7&u96^7Vda}XDX zZX?MwstjwZjEEXWgRFQ@q?;S8M|F!N6-CCTUD7c=s{XiEK$Ag28d$v_(Ywk{j~*iD zH&apNydi15;gi72Mvwh6s#5!LiQ|0CrANe8(HbGz%Z)Le^o2(Ian;q$b05?3RgQVr zU_{y-N%AoNv&9Rf*c;KECPka)cA3TMobP)qH;uAL^SE3OQ>LSmmfSDkVs^G%3k}GK z>xzx-Ocpw&zlfN%%1N_0uY}2dV-%7N|DP!fnOj& zl`$+yYNo>Z73-a@GRU8?rJ;2?E+`@i1=;Lpa?E@~o5CB4Dx)IvsI_#w$pHnPEI}Ei zFRuZ4$xh6We<8N#%F-^mRbd$NbcnucD1OOyN9a;pu-07OP*y{|gNxXGT1q~D6VtDC<;bt^gGF`KuvmCXwuc=f0fG5O40(&e z$IvNwz|w*TviWo#6re*7&}pvwa9nV80k$XpxPVj(5DV|;U_69kCW5FR^3RACN{bEz zNfdUZwzp%pT&MvL!x~^^BNd@mw9u^ulwx~D&I`DoNjMffme?13u*>vi`ckDv78PP| zpM#=NvW-IF;<4X3I%_!w5)Km9P*R;diDY~f+zuoef|4xY_%VKqGEqCApwhaE8E5sl zRR^L@?J|m>;S&CfLvSj3kGwHcP@W#6M5oq5%_koV$|vlRzanE#)k+ka@m$@BU0s6zJV$^Hyvg}EZbRjO9|=E3y>_OR1+Lj1aL~HlonV+w z6#QlpXVo2!aHfVCmN61_L$h97akDbUVj$+24_Q-<=4h@?=w%=Duq*A5NDYu@n{X%0l16`@{7x|roL}98wANjPN<*5zz`F${k!V>Dd-d+(lkNO2Z zgaxAi%%l)s?d_zb-neyz>z(5y!oA@-mP4*DHbe?$(@V?1pK^RcSx0XJn;XFn7{Go! zk+IfMe}#DP9i&#UfZ2~`wJ?b&Ia#C#MmWg1CJhr4@^*za?xGYY#H%|MgO}j)l~&Yx z!3ZmIuy&y~V-65E5_o3asZxJ*ff}_Hn-H@m7EN4po8l>1$3P&*rmtF* z-+cXMPwGhbzWSA%?w>>(-?x6QG=a_7a3`ySCwO%#!dyfdXdybeIH!C& zjWj02)#o#Tc-(hAqbsa$RC|ikhy>hUdI+Bnx-@Z1mg|RtXELbF{65S?J_g-yUd1Pn z-#I=cA0s*jeWyMhN{lHGbC88eN;{*YrRZOD4u$h`roZ4GCdhB)rMyZ%oSI085sI-O zgC|lNQ*A}*n0ci`F|0%~>|6D}uW5aWbncP0W_BqC*Jg8^WIFFWMJ2o8`5c{v@U$qk zag9|ZoP>n{+2Gf5#RJ8vHiWcY@J0g5<^s>EW6c4qodZ(V88KCI12Vnf^1ozib;>Jn zQkR98LY8hIpzzTL)MKj+`(Z`w8vAb#cXxjYygx!9edUKlLo9Ki#8^DW;dQeIt_rtD zC?3EEcv%Vf@*j+)l2~ip9E>yBq>&CJA|V5I(!R6hJ=7wQEKuVWyx3@;t}+lgTWv%F zz8(u!l{vQNN11kG<<@was+7>jIvCt;Z!yuhEEh}Z+*los|9X=nR9Rhf$cp6Yu=z6Y zgsIi*dw2L3>6D1yF4R04lyf-x+D^8g_1e7AH*F!-3tI>91laf`A;;7Gj=H4O-;k`%w7u%$G_|pG~ zEvjFpBS}+c3m|4@MkBMPe&>2HzuJxP2n9t5egcudZa$}!LNMRm{DL**-*k+cn{w2O z3>J5IigNu!y!&xt@gFN;YR`mqM`;YafLl_}?XB-o*<_M=n<>`*)BO?AW;rp+)bcK? z9`42GXH+~HBG$G?A72P)uRQ||A>%3`mdu=LY~|kC^Nsda`|p3$P9IdhWPUT+js!Bp zA_0e>;Rdh!u=uitOtvH-ucnt@sWnr`;C7KN9#`)4@va&S#@J1nQ?1m&NoTj|0bmV^ z68oSg+(GY z1BgCsfV;?}KvvB1F)Qtm#sB0JmHOqv4~EpKgd%R?4A*?R=4w&p-mD!!$(OHI_6@Mg zQ2(P{ppr>%4aJgB0y53#`@b|^`ZjA#C{~M=7=&w=X0pcr3`POvSDR2WH*-hgmaKod zV+o(ZQ8IXLb4Kh9htmes-g%p?muBPe?^=rD0n5Jjpa+S(VAcBxxLP>ea{2KJv7|< zoE9Q?*;X;MREBc)OA<uc*!<|(0Cf^+fALt?9N8Jr@fPt3}e9oV8ZHA(dNIsMAH|+ z!Ada(UB-q94=mo^&0IEtN|d5I>fJ5f*j{YQA%YD^FpP!I?pc&OT4mTl>pUiWsMT9-Qx5qgnx!KBYoZjzyH zBBBwPXl^`is7%nyOCBfTQ>jn{hkL>{6-a$j2Qk_bl18SdM8xM#W)OiyNDr`wA)z~2 z-%nUfL40d1f`2~?x+`DD0Yk*aS-Wm}+nCwT4tq~x!Mr5uqx9TdhZspuZ8o6abb>O6 zlKxedXYe3BY-c60^pm!E=h3I1{mY`<`E-gz+PyC^Vd^}ya%u$CvEz}|q{6*Nw3^Uk zs>PnO*%Koq=}?0`_#;4RaPuNgFBgCY@eSd3z<>_I2qTc6mTpJ9Y15 zscMP;KarLKSK&atH>Yi;6vANXZv}=>p?%&=U>~8NRPH_9xdX!NbUCr_E)*30z#GRZ z=?7TeV;$Y`5h^T*DMVfekuF@ah`3n-MZ-WwR^5VZy3jdECrk8;Fk+FQFPlbyDL3?O z2w-IcXbf~hW2WQn7}f?LGU3a1%j;Xxl4K;vwuP5lm4=&$P3N_ECo0j2)JQ25+O)l84eEn4wjuXkWUI`-an^Fi56VnXF%*IE7_(`f zki8k0XS91JQf5?{&~=j5Ml?`$9av6HP-jC)*W8s1@&A$%#?9()eZ!E*A{Wo^JcmRw zz)-N0DMT5=!ILyb;P-l4nfx~=7_OImRDUI@kNJRhzJw>7l&uY%f9u8|3!@7)?C)l$ zzQ!bwp0?+x^BD7fzRm+g35b)GY;!u3y90C)jGQgeCm^D2Z!}qfh)vdTrZAsVuO>j+ zvfu&i5dO*|nt;c2YSn)j0S)it_uv(uR{t#VuPE}()T0t5q)K4A@5HP08W#n)nj{oz zNetu1ojNaSLX;TH^ngC(6Ah*z@a2xj8JU$3@gQV!_N(@7^@HIN&JtEio(~S;;aDePAB63-M zKM0A5oe8l(WM-R(6ZGLkS3Jti7Vg;YNYA>zLgr@G1wj;pSMwRZJ-%R8bBan1s=o`h z#EmAfq_cRNiKNCv0}3;rEC4751ymu6+O`>fP`6Y=Fd_jeB-A64FOaMm@H;b2GLp4( zfccwUil)6S%BY%?25xWz_6%uOx{+{HWMvkf(wnRg1#13tYKIVay<61p5y7P|7zO`C8`6VB`xwpYX$!>1(e9yX0hh3= z3ngXl7okINW%d`LZo}JWp8NG9uVUzea{i$wPZ zk?QoJN4F0sCIz*wiwg=nS&lUze{ND;=|6I`cbaa4UEg26;Q3H6eR_AL4E?f}_pJBN zK#-hyQW;sGnC{_#ZrdRm%$ZD*FF{uuVdiMyF zZ~kJ}ag)QjfHA`wBr#I-m#nnEt?dQ zPsVuvD>^-836w^MDF-~>6b! z*{163&2}W#Guq9z?@F);WRn?)rqcyMi`~%b^62}$G^74C;7M$Fa8UNxxHR$A&q#|U z+oW#&+-x<%pM)JqL2R#c%Fm)s(|Kb4jS>VUfR{Bi#`OjuS3u_akhfj{CgPyvD+KH3IJ|24NI#CAk(Swdc?3_>Fn2Y`O^)X{94gTTK})yF*O(wH7YDj@;CzGI zw0h+OfQ7G46PZRvldQfM4#k0mvAFN@3j-bAPl%N?Xixii{3?F3^Z`%Xf6cu1)cYv5 zGs&`ctpLo+kS>S@Her%#Z#d*0&QGPFh}FIBN9YHBl6nD{Vl!>~2w3y(AFxm`SezR& zX2-be)5>+wF*DscUJ`YdG|UWOqX=urRDJNE!GHCsf6Ahw@t5KyqIP00TlIN4jD}h^ z4aRaPR-q?H(w<#N>ZGS;r77MUUg;MRv|PWLN0%B;w0fAznFoXax`g9t)xW6M*OE&DNkAgf0^rRAnaaW)5b2-R@>JZ#mGL+Na2YU3Yp0Be2-k^ zC&NdpA@~A?!=Tt-t)N?k#2LyN$Uk2R3WHCgs&&2IUlU1RI!V|9`>UU_n*D9P$+xZ$ z)_G~F2|9A2KbcT2$}Y@!PF>jM$iLWL6^OUs`gm}-p6du9HUmx`{}C*T$?&8ml+dz+m^MA8IUVc%w75v>9(+`$BIDkb-$Z!#lSP%^wwoXfBk+eLu6bI{S+d#76PJ z5PDZ6DK#Fa#$$i+u2N3KfQT0#xA1hj?MAJA?N22j7)sm?wJH~`WVE9kK{z8v#3m8_ zqQbfCn8DYAO0)R4dm8P1sm9bYqio6Z68-&*Lo7u*-{Xq1IX2S=3F9x@e%JB$Zz7fj zR))&GC;G2D8p2V%>_1%G2`WI?y}%&sy(T|`v^_27Q1 zJqdv2<%wdZe>Yb+*QY7$&-rXKEPg%{!l4kv)Y~ePreZr@8z#41DF0QoTcwvU z#d+Ck2gY5O`wlz!zTzYYqwJCjJ2>MGn-OZ!j-LpX4R>EUK3Pd0F28DghSZzhO6MW8 z1Hy%=jD&5bznWPd@Es`S3PWuR(rE37cg@bKD9RYBaT?(YL<%Tyahwbxcv?NHWy4Z< zniBBM|i>K-#2}*_@ecFln-c-6!+i&E=%-P$$we`AsI)Cvm zbS2U(Ahw<95E(vW(XKaPQR>ikh@{>>Q?qWiqMK4$y-+#JM=OfkNRH>9wn}2ip{|gh zmcY0nhwR@_oyC2TlT9bA@-BSxBudz$Zn0wfp|?z{gf9DQ7=~mr%I^W%f;8Fe{WLmXuQT>6&wHvZJNB$6`=ASMad(&J(iQ z4^`~O;38>R+Pez7yN=6hO9Cj%4;VOlET_V$)+yxbNEDvLc?v<-0#;{-z;fgTAX66} zh~W!136n#E00+XZF+{N^GL+DM0Hl;h7{0Hj3{cF?PXtNiZdRpoe(_N?ZJ)EUmNH?G z6%%EQq?t){^SF>!$$u^z230|3aEa1w&7kQBxFBVN65tq1!AD87wN&l2F?GCHx^aSy z?*5i47k#6g;jH7BS`UCizJmfXs7%I*CL^hdVfjNQ^b7H$#2k-~7GOE$H!_+cgl9H5 ztfL#-#YwpNq$Jaq&V+w$vD@J*pKlg>*vvfHE6tGMftBi-Bo2TOX%C33u8LKF=JdBf zF`WWHCVu~CDXeGqBk)jRA3x2$^lG;uOmZa0;U{blNump4?xjF3|`wic@nlO^dJTiNn70oEk)u3DCf!3e_Nu)U72huvvA>4*kZMT8mkEA(VVIH|Mkfz7XLDb!Tprox*8ZG%1+Kg<`bBj%KbWpint2n zk?%`45oiA{6gT5KA<(mL)QBQQZIu>ry3Bf_8F{jLR5?&kVpr?U9}au}#`3;+2`hCV zFXb1Qu%)Ba-D}V=Y{^u0!38qU|M^F`o;r{Xfj|aY`B`Tn1yZh1i{qxKj9`lbCI3%9 z&6d-=_@in)f8K1YR&s1asO+_o=a!ctQby%-iL7!mo(C8Ph=6`wf<$g)X*~)LmX>^< zTN7^s>rq76Xo|F`j7I{%=B-8vL_BE|-3X`Ge?4aaVYzHZOQ8vq=w7Y3p`pFJdR>I1E|SA$Ppl zJw$>p=GVPlNbx|E<;V}z8oW_TC$#RaAKKai3)J5jOYlP>!oE{lSMm_`*?lS^-I=Czk?) zPM53eDPvo2k695olv@5KMA)-UP7V4)mm50~eNp>kuU}Qjn!iBSZ{wK7=uHUKiZM_w z7gShw^q{#g@Fvo^2}^8&dtiuB5M+hk=5Z%Y$xD?M@{=60N%FWz)01bN@qg5@yC0bnQ~8UQ zemiV)M~aBcuxb40!{2$_QVlQh)RZ(M;zmj#td3(;SHkkSU!}g}s0hpxyXZt*g9U01 zCQAB-T-!DAPxgXUY`<^sMI6DWA}12Fw0nY9dbQo6uP;H-^5Wa;{Es+ideGhcl*m7b zg{sgt^n2dtotCCY56TdcvYZZLc?16#tk*;DgKbD}|MG4fHrhzJw&sK!Un-)>o%Uby z$~UZyT1|rEVi#}p+x^)tu@|f<8h6HBx~a)qVlkETDG2Fn6yOuWAy9Gn8So2i@sH+z zvg%0h;8|84Qta&iuW!b5IM_y}Yf#at>T`x&ruWaAmp>%rTHXc<8Wrp%B~Z<9bVP;B0r}00WhBU{9CkX_-JW=yt$zuLHOoL42jeBHwn=8Q4dBoUlFQ zMq;N2;E0japG2)CpT@P$CcHtc3BkE>0FckWoj`&Tnj$sr`jd{7&pasR+;(lmzNm{F zV_xN$BjZ|za&1^hA&^#OjD_E*tx$``UDb{4b;v1cLbB5+?aR10w}2IzzlFSEuT^n5 z=;M)TyF?>js`p)kw#1;Y7O-}~6%3%GwqG?z_gm4S`K{Dj!S$dHRO%X~mSLGCE+JPX z^)}RBgtKkG{<6%**YySZRsFhM6C2Zr<1h2VK>wM}*NT(410#@zYUJR0EIw|KRXI?@ z|Nq)h%r{!?0>+o)_tv>cm83oIRd3j?Y_`Sp!cJ5_CDBXJ}}>jM{hE0>#);?2r?L`p?S>f_Y7iNlkj8_HuzC;n-h1&gGc;)bE*w?FJI zXuI-OS{Ps7q>GD*azG7+291W{>w2qJI;SfYi)}vu)>k7XdGQhfr9bF%4))Tgqt1Jw zre4M_R+e6^NtQ|E!?W6lRwR!O&B7e@*vqMy94XCrg|>SEA@^ek^#tuULukTB{_Y+^ zy4|sArM>E9-zBt<*H$nFk&PVbKvZSB4EW>YmeLh1Kn^0iomca10E+V{_e3&I57|e1 zq(8c}D)$m&&E#veFrk)*kCoK zu?L&W^QajyGjgw_E5Nmb`D5GGvE@k z(J+ffmcybk2ve>TCHoW!L#=GOhC_Ib)Bf-~LT;m=B_0`97~%-tmMP6-K|+Gew#D6~ z{(=G|0bmeB4Td!s9Ca=JjxYXjv1sE13`0TQ3$cVFRBm!7ROIDU2EP+VA`SX)R+bT# z@ZLPJaoN(1q?keRfEuOB@$|;rA+4Ma(i-YShA7)NawP$6ni9ymk%cT+DxDmBX3ZB@ z*eSD+5fPm7VwCI}2EdOeFE3Bc5T@`Q+`ntPH@MpQSQ($&ImD0gQ#{4@2mo8rL^Uw- z6!t<;a_gjX5W~Wkc3))b8f2N*Z2D`Y+Dt+%&Hg89nAilEw;`>XlQOBbG2tz|ZRn0r z&HiSX$V5O63bE)dQK*^UoC}~9;HQ!t5)k(aOH#D6xGm`fSRi_NxrcBbP}4MuuV)Vr zcEVsU@Cm)~I62_pL$VB4^c`64d^`JFUrHoJl-cbpbF}0t1p~P-el*EHvFG(Q#UxDocE?oe%L**ZJtY3$bac!6u z_%tL-i@Miy*6YVnv1pj_l+RyR8j2yJYZvVoyfFfbo1O3I`DeUco>ur+N3tQp{j-R; zV3IZNUwqookpswWK9htDU^aMuNXce5eo9uD-OQuDzhY6W!6b6*GX6`eHi@>KNS!7W z2FRJRW%w)teg{Rum<#7<)mw6Ur|Fzq%Xam_V4wCjRNI6zId#}y2C3e2(U&b1kix2u zS*2(z=hNCBijOr@_gF)w`lQgEpu95U9eC}YSsCM2L|W8F zWZuNGnO*j2JFu1SnGR3?(10kAPadgi*kjzsbhgFtl%FkzF>!(-yNMKADyBBi`*N1k zcM}VnhFZBPhcr>$+KIPdO76D|Pchw`)YkyqLe!>B6;o}<uz9<$LO_b*U zCQAU=xkex(-V9bX?gy5*!kH&qvG9A-1)*}u>R>)&1(EZjVho|(Xq?Bdj;MZ;V_l3G zh1XpwrZLZ3SdHaJd1%3Px@#UDJrLVgK>yK~6ap##6+&w?)CR@lKqzlkzFE{GR()5e z2+B5lGpO{gb@ypG@^QHwE)HtoTH+swM2}BZ^b)9OXVf+fQJj05o9f>YpM(#aW~YA&pG>D_}6Ur;A7+ z$O;RU=UxLNaB|tMC17%xSjqa`{C3r^GI`GBd|AR){Ybk@*!qa}k2(wH`1IsB=(~zt zS~aaY6{5CD5xZC=a&|YV2U{0!1!h6(t5d|RpyW)9bcgc%%ytmA!upw9S<~v@teC4f z1`nS?O8M|Fo$rsOVW(_GlV&RmZvYsx_^FaRNIp-Wq2Ts_|Gno06&v3_Fb^AS`2^vG zxJ^ijiwzL?Z+6CGu(9Di^z8k(Q!-^2lW+f~X!6%JWN#3i>U(@Wt{xwMQCp+98(!d| z(t;?Anf}NoYHp!riclD?($!giIMxisnYFAS8aR;e{*MQ&)Y+jULM!)KZCl5-qXe9m zgf}7G4tKlAg409=nGL-AZ!Q1jimxtlq%+QJ-rZE+69>ycfT%*+jQf#67@?za1wRIB zihxpcrmFA~yiPOp{f`A~HdS|~%l9`5P7EvI`C@rWj_6H^ibq%aG~3m{+s-}I{Qe7! z{i!|$)~<1AV%v3MsPTgVnj@Fp8xzbn0mQ0A6Zs>$i|8kte*Iht1Na4Qw&byx5fpo;&y$ zpQ{>cg~kWkOLSwJmGev`H}8ux<6#{_K=`l$o}T@$!l4l$Dr~T>qy9NM$<4{)Ns4H>oLgv@v-f6OC_v&>@M*0+b_C>-C%>Xf*nozShl<5P zHqm<6x;xJTmEC~~{p)gJ47AOxBHtDQ-5by2SFUOyqbVZ@I2M#}1)NOhn~NQ^TW|`G z(JpSM{BuyOun4ocZHxr45r6Xr`jNUVp+8Mqe^!sqecAR-^g-?U&uForv1&;M> zq1eqpWt07W6nY+JegVt4%>7I14Tof|2@i*?L_a*c18n+l%%sN-Q^M;6nxejuqnJ*q z+sr&+$Qo0*U406nO2b~cWny^cIh|%lD9|6%S#n2)TBc73UlQoFF@;GF$5K^(DJ2Np zjYdavUK~cze9F2-8drcXXCk0NdooaeTE2-bMSXnUMLWpC4l-61uXT>HB(=39OKV~( z47O2w5Xv4*M?FNc<2P89d;!)LkEUCZu88VjeAX!~-g6+5-x8SUUEG@N-po+BfR97tDVp7(HYY8xy?4>=u+D4S;mTUgrg_M0V(f* zxx#pl$tqK_55tURA4GmJI7Yq$Crr$Pv$xeWq{@cs-PBN)Kt`$M-#9Dn?=t(@7o%#M z$}pH;%Q3)Z{wW0g?Q01}fy&QLX8&{7ch1qcLjw36e#{lL35ONXo|st-@oVV<)S>qR?3Co zFrc!iOO1snoCh{fK~!4#nYMJWMrRK}%CBuk!p)J&rMNrFBn;zF*(#@LAG??q-Bwko z+f(a}&2j4UdZBU1Z>me?nzq8C8y4ymM}%Rc@xP8hoye$=9XRAQ@8XmOkoVZmRlS}5 z$ln_i8@hheF0U24D@Jcs&l4Oael!z=cDCL8lJ1J%pE5kUH?VLu1Tc%~yjI$&D!* zx;vk)awFRet0vKQ)UDZx0(&C6SulyB)+??2r~ms21F6-7>Xgv!x3JMVTJt^=P%+kY zF^r6TSeir7bh~ncs?Z4QH=$)HLeR}+t-0MYs_cY1JuNHj{Gcs+?4LHG@u`t z|8 z;0ehw4+A4vaPUinRB3kmf@vt516myMnD$M+p}^M5|6ux~Sc!~nVNAEE*fioL0y1jk z&IoPW3S(JA2QhnGL4#Y zwQ^?<;oBVGTTz7-;&I#y36t6BO%){d19B<0fE1FX(rk;>fD|qXE|$fBlqZ~4(>Az$ zjV8=Tk=5k=EBJ&isq2M|kG~bMnR)#E{~48|Z!)=fprG}Hv$YPZCMWsx_}NW3>km7l zf(H434z|Q2p^w}QXbVKX0*<`%UCT6Nwmg=X?*9B;x@fCYaU_jS5ziC$)8I-1TqC^9 z)f{;;XKOsoQVvE+NHN_N$-E-m#I?KMsBL-b5(!ddE@sLzPWZ#~le8*b)~n3M)ENrn z^FtX8lL*)#iu;Tb_x#6To$WnA@!nJU|=y~+4Z(>F30o7m9iW9#W%*Kg!_&ZL* zhU;ZCOTHC-9ym}8xwe|Oe|3O4{Evy-W(EF{AOfy_Rk$yUdzT%Bk@wL{-h?zHeNpg z^fQIhgszVIShb4?xhYYU_CpBgoGd9A7(AuF#rM@pkUhsSoo{Cwe~4Z#0Jf zGB4-sZ?!zH!z#h5C-f!O*W6k>n4To&`t>8T8RDa|Gg#FN4ScPRfAEd1;#%vV^Pt-R z0r<`WX(b!(X#e0YqPK;0@(+MP|P%RfCf0u3#eY1;-80*E;jUvduxOna_iL z)4}2al%>k(f*0X(l1sE?4x1)1w-1=3q6T0}M1nG=Q+eX$)j$5OVDq{G0rtw9`{iWc zcq3wwm+GysD)rjKEM||8q(smR4>I(PQ#5t5dq(wy1Mm>axd@U>Z(-oI<3Kr-jpX!T zn5I;UNqut7I&Agiwz5EDWXcw#vj2Ltpn|_zyj1&k7!o9D1=ywb<)~Z_UQ<)F1>y*O zxErUBeuR)&n%7~e+md8J3jKg;f8QXLiOS(ZQ!Ey8Ic~|T`>TV>mG`_{^@)JVd&A># zlM6Y&z}6I%Swcm;ORGbMJM(M88vee%kI+xqXXR?pll^W6tnSh-s46aC#@XXBv3`Wr zZaOm)7@UxpdDB~bnl|=p@kp90x*u1tB}75FaB0Q$eH7NBlcZv5AEiy;t5nX)3Gj1q zIBmr+u&~07w(IssF*?J-bf2~iWW&2c(I^1yo;TVyeK<6;r`{mxk z=`U|mC<^j+7#f9q9}wv>uebdB;=jw# zKFI8_=7TDvC_7Cn)H*SS9Ez=bW=fRu+tS7LLK-~TbEkQJ^?oA7Z(>J%*80bLnFt`q z%0954WT&+Vt50WGG1xwtpg{E~ap zv{J3LAkqIHWpBY%SF>%427*J-g#>pexVyV7+$98e3$DR6Sa5fD4IYBKTX2Wqu5aes zJLl~EUVE+G`vYKA)vOvds*gT;&z>6ZGrcXQcY?hrr5&mX)2=eFJ#c?Jkf3!`#)<$Y zQ*Q^XJXV?=-VP_JOp|g@5=$CB-JPFZUjFEdQf-iUhk=r(Y+*W-0#+TBOCb>#&&L^^ zOW+QRMiYmgDwHbPo^&8;+@CRTdqmGY=hCB%3e01t_+V+y`U`ebX94@2B!q`L0m|dd z6-`laiPwU11D+ z#yPS^CSeL&*Q%oqjMvr&lLEW=xU+=|RSvC7Q?Gq$8Vfi;7G1Xg%4mNlCZ|v)g~YM# zW6|2_uG$>1-#rs3QYA)&=Ps*Y(!m**O(Tlg9Xb198g}^iW9TkdjRx_<#4%NlUTL|4 zx)~dA&V7LRcXxMA7W_^nFRfbP>^wV6o|uaZ2iOWBWo2}M)!^AcGf_5$wyV4RrH>N2 zthJ`7VYuR1t>jE4frN31dKeL@chU#4GohZAFJXYrvGN4B?%*hBvrzXWRe3e4R-aGB zXF(l3O&^)nWGrjdySs1j5!2C{vleY?q13=#?qF1_;|&fg`R;}ub-87rX+~dShmS~) z>3nH2$){ja^Ik|Q<(~To0_G$h6G93L6?1|#BeaDE=>6xUO>Pr1ls@gHreiH6tFfUG zNw6krp&|7YX*jQ)c)}(%E;#l8h9UTrUlDCNH z)D7-QUBzGlCZ=Hi`{Aj*#0e{kOFYcXy=-z0+Fi!{q+8y;ic*U@}d5&1#{cI&SxieB{ZqiC_uh z0NoUz*Qhs>-!uQv6kw=}0c2XX)IzwJ*1J0>cT0u!5SXm;x+2OO4)WPERvS0Vk+>9D zBlFS(ACBt~o2ZwG2DjQ0CjkX_b{~Wb%Ww@>i58C;RF(O;Cd6vd50P$jI0*CL_HyS4 zPzn)DK`>-yG_0y!R)@UCCgLaw@bGDiSAKILgcJIm zQSxFzxo;$+-Hm$he$KRALL>0<8ZEY=QHz~gF51!-vspWis4OdUKDOXDR$(c6r`Mzo~ zs3h~bvjDz?A%MOXU7fl>9~?ZN=M56T@%`2t`TaZZAB!c044xc7%u!n}3YAl2LH9~9 zjA#QvhR*WZk{Q-mQU1w3YE&gpS|JLRwZKU=2=SUnxq&O7M9})^Oi`&IM?T~7*JTIS z_YeVx#JUynx*T=SS^iDhZcNywQWUoVwJKdnZ!6l;)pSKbQn3Kh*naJ^@}kM4Mxk^X z36A7DHc#h!#&Pm=N4&VnxA}W5N5#51TyYU?Fh=L_cn*;P>Hc=AKn2zd;4q?QcDjW< z6{H%E7pBwXe{cDpc^)()Cc@aWjDZPd&Um6qD=a~Fr=HrsMjor6GHF2epr8hMabe6s0 zg5D40-pY(GHQKGtH24H1VX@K2yt509poYf9dJ&=HjDZ;Rs^ThWV=z+B@-p7-$*=g; zGL5QefV3*}u@EqS)Nc9g^+n9XHd>aOqtwH;`9VvrR=VaPrBxr-;WS|g42_v_*fXTu zeoNwnIoMz@x`Mmp;!)+nq}Pe)}1E`OK%FncVYTxObAsVCzn zarv2g-rH26(GQ~oWGv_hwQ7Kx%xms^_Cd3Y4`O;ayLffg_idmp<&<1PUK6s+_0*ni zR`HY4jG1V3(7xdGheU$Hiqyax-x!J-mbbYmQPtrMt%eI-(dL>>j#paCpIeN7n?7{e zGExM`xBI?Ir%o^XsZ`hGAZV7Ra`GE;JkafGi5Ej$JJ4nfn=U{>(qI?Ji>`OKH}7ec z(T1gE3XNHZbz)6YJ5wf73x1eal=*CWj~F+f_%QKl22ArA8WgELBUZ83<^MLB+lkU~ zZ!C)0xQ`ex;L%>TKeuPNaJ8H%_80!LEdVjOq!u?P1o)-I_w-NYOOv%L7b!5bW78-H z%6uydsHiAQKr_Q7sY6-UT81Oqc~SBG%incyA-4^0J%`AZ>q09qx;=~=$+2H-ZNp} z9D|s-I6reSQsc>T-~Cr&x_pOn`mogXBs-;6ZP?~htEjW+#0X*TE4{ylr(>?LcubZ9DdA)rT-bYWv{V>8)k zqw~js&}gNc#ns>ZhUVfkU}8rMUoc&ymPO*syLiQo@BKP{zAEJ=Tx%Cdh)s`|DW0KsUI+V4}TBw3aHj4sSG90JF(OEGs zX9}2D*#%~f*0 z-XVPXdwy9nBhyn;kPOsC5^feFqod?tr-zAJb32)YVy#9~&JzGd#&mZGga=QxDgkj( zI{K9cjyobddVjF#gZOCJFtdj_w)6}>uX}9Ip!()Y&8%j-kzjO2Yv}Kz!oHU9x3-!4 ztG?lEO?}s8#WhQ7MO=w7-Y3IEhcW$The>{@2r4uo)-P9gRcYxLHbWrTz}rGf_g8$D zecMctfo4yoIyuF4+C;19uU3(CzB~R2uxz^5mi0@Te$rv7)Wo@EPv01H$nE^1qTcE1 z>JqoT1(ZkPMP|w?$OJLNYJrA8ni=Ufu`P+oqkJIl?$1@|M6N^up0F~Tlz{c;l3~_% z-yeUnZFvlLr9M+|K~_++ba4*3r&XklYXhr+NgLZ>e2O$T>n7pkx8$%?Z)LzeVNAh- zLq>VM&Ef*W%M1H^tX+h^i(!`5Wv2G|i65!rsJM(@QdV{318x?D_{$kM6gi0^Z8tgnq-g%W9KEtu^VxFs z@@eq_tr&k5`^y_qbZ{OxCmrTlTE7!wXpkbYs3_#uchFL=sV-Ed0fYqD;?sF$Bxb%> znl=FYP0$(Gnv8|M;t(02Gnkuw-CMscms41iy zzCceJZHAdSY=q(#qtckX*QSJ<)x&&pc*3s7{(+&nU);Wz*yY?kRdD~}kyL1k@?u#w zq`PT({dP*MWCjQzgKXT$Af(?ia))*G*Wk@^?5ksHT^?`=bl_5eJlDcnW|pPj+0f52yePYvbZ|H?8>7eCv4gXp-0!rPLk}o4T;71H1HYIgPOL_U6w`u?dv6+eWlPQpDSBu#D z6&(%ug)dXUQsYBh!0(M5vQe0I>GS-36KMhTeQ z67q|vQl$q~x*k6SG$nu$^onM-{RBTBm+A53ue57hPP72{b;*Lz0XnpUAukY`S;3Kp zODisCxv1<~7)Fkki;J?cQ79%AGEoDcY&f5P=baU ztWipy>LE1aKMzlDS(w&hS^J%?|1OK!gq3r&07 z{6=9Hbp*<x-Mt<_Q%aD{Q)I?q&&WTkwt?d`P+s?PJc8zHyCKK2od>L2n#7QQ z*?!rt{m@!5oC@P@nJdFXm+GvWE1@dLTW<*)E^pvR-%0v0;~^MfX`zB7mL-{x1rsi_ zxOS|2ChG^YonE;X3ykkGO;VR)UNlY<-1KgF1iQ~ZD+)rq#@1_eJGp+aLL|37;^9uC zd6eyKq~tsb1e#ubFm3c`nnb|`n;mZDO}-7aZk-^z%WoNzLWUX8x}^c%3x?KAF?^%z z=_<8S_8Y`Bx4S=6^|^GiH>vZ~Qub%7Iq@`I=42%In7suROL{1({Ti>NyVZpc2rctGHRC8wUlR z$~C#x(F2v5%9P5dz}f&xOP`p`H@;I;b3olGq~2m;nFNoc70l`4y#TUQZk71J=Cgv7 zU8F0ODzMu#KS2Z`_@Kl8m*%mecz}tUcGi_pB}N+DBdk{3`ZdcvM*zx{^Zk`0Q6 z)&ui{E{@*!sUmi3bbo%&8$-Y?QMsTw-!iWGoEHJH4pf}3QHd+B9P}~Z=;n-DXqMr} zdR*v7N`$igYY+%Te(n8n`W?h1J=Y(9?X!(9wjT_M^YnQf5$6>>`cvf>TgAaWvsz7c zpq97Z-+S96Fg&W!Nz7Y0)S%^Oyf)D|)~1)c9ruQ$#-l53Cb-u9JV(mtwNTis@{Z^( z?}9~y67aFzIX5YAJvy>AP}?DYj{Eq&QU;d7D{s8%A5rDoMsD0o`{g##7DIL)Qwj|j8&43f{6FDZjq)2XH@WZlBz424FDh zyspSVvvi>OmG#iBE7_ZV&a9Y*-WBoMT=kIfR=o$E!v&&Ksg`DDxahK(h!{#qU4T_Gs&EeMRzH;jm6^+)joe-oE<1v{x;hTG zV?MLI&JJK7#h$AX)n+nc8zcBIr|Qm^s8}r7bFj3NTom;l%Go^UO6iD$sCPTXYF*ab zJhxn~A$lO?7uxc?IOSMGXHt(=*}As6Rle6H$IU{IsAvGC$-UtD(ks+&{_EG!A6Qij z{;(a2)zy;2Tu#;?ck5{U%bw8lhz+7M$e@gjYU@=vP_ApD4a3fqTwyw{7Tp#k{*{tD zwSYf74jlv*JI@05e5myTDc~a@^`;`_aSfDAid$s-5`=aVrdjB8* z@D}g6@C9)upK!~fNbjw>`dLyKSI(^<{UJEfB)+~G8x0+&Xxu6!zvg}-;kZ1 zzw2r(Fa`r%u>u?~h!(5;A0ALeW|8LS%ObijC8XVJ|IY|cJ`VxI^Cvmr7ko|771ZDw z?LJi;-S=&XrCoPStHHeO4%gWFx!Y4g;j1xsJbMHV4%)y-?B3k>H6l}9p zM2YXXaOATqzTf>yu@g41lshOyuoJ)fdf0_|v;CI~z>J)Nf6VNnOLT?H_73`TFW@xK z%)VAGT0nJ061+9?hxnw!4tpIuD!%og##B6>HJQ7sHlWiybBr`jMmI1Shg=!u(L<{? zWDaIEytCFlUwC8Is_^C8TcvRtM3@QKG=#^6uhsXpjvO5Y((iP1tSk~mh+Y19-u>2y zIwg7VBqH8h9Flped?@8WCK`o`Ob50Ozs-7qY*IBK$56rpE>g(IPbyabw7+|D@`2*# z$x?$Xx*6#Vy(kPV^gtg}vY#;eAN5?oT^s%!b*zv8QiL7>WpwkWW7N9_);8g2NBf@^ ze7-pNR<=R97ui!p1iQAXc36{Sn9BCdep|FCUZ>>4)xqF*x({e!J+RLhg>{sjE*+U z!F54n=R6(S55EFTmZgOF6CJHr=j>3H&(0PuUw+r1<(R{+@J+VAf`&@o(}d9^S~KlT z{w|_5tDTGLnWP*ATi^&J!{hJ*VZvjz8!$@!_((D(J3Q_KNE6dj?-Zmq9S zKCRm52MmZ#T`qjuZdw9`1lD5}u>&82NevQkmTmt08<)joO4JTXCFssm58%g$1|eXc z0a*`*fyKy8IqQ@u{0vIAY468?>3+XCNB$16{gi&&u4weTM5g~Au2V;( z%gyq(sd+3PyZ)dU@u$xtetDi)5)rAB7)i=L3OtcGE7Ck`QE^X2WBPaumTlfoHEuUd z2d;qbUB;1fU+veuYPVPBITtd=PX#a;S{wJoZ_2QuB!V1&CTOONkmPm=Qy|#Ao|Emm z>ketLNAqw!$Qx3xwtL06RtZdehjV%g`igyudc%)zB-mrLXZVG)JBO)>=}Sw&`zf== z0y3X&jy(1$6DdR;SgQro+R5$_Iaetx_ORwAfLfRor_f}x91Pg?<#}8mPRRxqhe>!m zu%OX>z%`L*@4Xh+S^(5ch=GvvkP2fE0?!1&fOhwAU3O(O2)t#9p^(!&paQck);jnD z`$qdn$Ty*A6|A~=ORfUa=H#(E5fbsUFeg=HLmzTyArpKNLJH0$y~Yz&|z(< zt?YV+Xb%vV26z1@Tci@Xxo^JI^5&@4wVE%p)KdJw8w!H|zvE5apaC6Wk4ozwrsuKq_PW zRjqVYrA6ez$UjnfD0Z4&~cDk>^Kxs(7;HPfxBx?1UxhqOv^ z`|j@HL8fXvOHkIGWpi2=trY#bwlO;L)WjH4uFDM`&S-0Uo7`QG8zg`24I(ki^(eS& zVkv=7rPj_ZucJPtw{w@>^|MO5C>2$^j;s;&|6g8}8ApKxhC6%F=kHqzw!E61g_#T& zH{XXAqjfrxMf8)%zGD*y6+mmd5{4m|M0^}Mvjrm9!KGm{$8ngGDo)qx7!1HeD}0R~ zO+;rGeQ1>YolXw*dR(Ej@RWZYSdpiWdh^-2lji=lP0$@h{Ku$4=f}#@TSG&+Pm7iu zztHbqu3_64?>08B-{i|=h+H%;#KHEhG84dK)7s|bz{iZGWxKlJfn>&-?Y#g=u6voC zK&O_KYAK`2jr~Gbo(SBxzf{n8NM-5~(9kKwdcUJ`mK>-MoTIPeFKVY#T^bw= zm@2)Un=8T4Ut1%8PymxaYSk5E8@57;~e|}Ej%v|yGr&mC>A4x=;yJ@}6 z4eWR!_MSNFVZ`A^G!YIv9IMVzVsDg!q_>PbRzP+5CDJ?){*C(lqr&yA_@yj~^C$6` zv$pNA47?KM0+!m@3+I$K7!xoM8xUBzyOVj6s3uwB=Bal~qJf16tTSqOR+GCpn`;Ui z-B=WNG5Fj8fai!T5&re*n&6-+cSOuyQp{SlPunK?oQG9!OJLluemXeL^8OVo;bKrolxs@rtQ7gqYoiXO&Q)5_oB+IkUf= zxhD)v#SjukdL3XeOnrF-hU##AsCMA5&$mFOh7q6u$GcGj5Is7{@8sHR3QIk`KMuR! zDVs-;maUYtA$)UHc9EKm#s&yUQ|tk6jWhS;W<^oTV?5~@5OE!HLPOyqQ>&qhir<^z z?1&^VsG(jKzAMzXvE0`AA3~C@FBZb!_p3Kd(|pI$4e~OOk}82~VHMbCzo%V44Oqg4 z93Q+hofK9SIeYl2lP_fhKR>rKpl8ISGW{sFppxgh?IjGPG|7Kv(I+hAX4NRiORZ)d z$H`i{G-E3!nlG2M8>`#*1jJpt<&!oDFP?gYGe~U{_W6(I! z*0oxc$hIg8tQ_jpi0%497vtdZNC7HICepe*Y!(U*cZ%nKDp4dp(RT|yWEdu8-1$W= zZVZkGxn|6d{A&bqLeh|&{6yu73=nuHvSRnUV|L zM{1s{P8ujb+zA1_lbJ&e`aL3^ec82uj{v6Gk56KMGg3rLYHuGDqUyNV5*f`Or`_{< zw8yy8`5;wVI+v}Z#t>!6_oKR)IkSB;g$3eYD=@(e5i8bdQ-~)*6C)IxSf&B`Nn@l{ zw7UcU1ZKUVP%ePFsR$x}^M}$>v73o9kz?1>BcaM`^@M#UUOCc$(;tNZlR%$0%^)T7 zrPJdECilVMycD{?p4GT6Nzq_yZV}deWjOI+EuXdVpp4%Di`_DB3*(>tBj*QC{tmKR zQQ!D9cgx{}I%ALN_8UuN(RTf92DdbnTT2itTiw&mu@ae~O$H7Usr%)6xfl|GUPrR0jE}{|G_(Ep{@e|~~ zel45ZpJ=V8+HAuil#swdE2xh`DL)RG2u^%FHC1)vpvJBTk%bay5J)*i~|!Ez~4HZCySYdWe(Wc%kgdPQQxfPBvLj~9#72g&N;T|0#S*~(YZ_{rt>TEM6 zE@$r+L=3KUZo-D(-%#R(16T&O>${l2e;*p)DcV~Nb{0(AV`;7NY63X)0B!RlFFxf-SS0|(6RcB&txqaCg>y<`A z*p-`)v$@x9uN(YJE;d2_?XYhK;`xdpKfi>i+uW*W`)c?J{ERl)#5krQ^V@w_?;)Lm)aV1t zl+q?UBgFhICGG8{2Kc&(gQvw=8Q*zlAj95fCs%pVl*ID$>6(Aj>1yr{kS(@O3={-xNIRqG~9`e8?OewiZ}G7 zip(7I*W-P8K%!ujw!&XK^}nhY1m_l-C9T@qXujv?xs4MW?-2E5GMhwlYtHDO#nYH@ zHCMFOtHX#^UC-(Ft86~<)rJ|xQSw|kro(y>IZN4g;8v9AyGC5!NqEcz4D60KyDi{yXc<_-j}na^mvk6 zNkVnU<1I#!?~~(6lTgN6*b5hgYyTyqoXM8P|n|pI1 z@hE9y0@*canT$_hGjWj_@!Oalv?s4;L*w~NqU3-YSHvLO-Y0P0oJ|*?2=q4yUO=tF zbcQVBDtbj0Z983YgMz;O;ARb1A4BP1(Y{#mDhRjM(}tjm>1*d6-0$)Isv#LzZZcH- zDv#s?J))0%ocGCYQi<(DnJA>qA|)}!4orkKjbo8?ee>F|D5-;UBukzORqoKX+4>ff53SRaf zb$g0NCW$-`d?8543)KN4bXzrGj9{>TTUIiMPoehF{rx4?3TL|T?fXKoTYz|!b`wNa z@4r8sA3QZF>I)giLTs$e9(I!vTv{c&MpFe6tXy{i1|06?B9y&_VujOadY05hXDNLaCK+ zXMO}y2Iuu{p(Enl8rTj})M4^B7Q%OGjSj8Jk!|rPu0q+nc43OE zoT)K})cRZ*lSd|-u}^OJ=RHw6^9AXtzmGo4aie&=$&dV^J^>32QM z`D3aF-Fv@T`KN52@3=5?A@k=U^EMxhfSMmv#PobfZ-cLeTc$qXtR&IyS{S;vd96=X z<4kdDS~1CNW)0<1p5OYJ{W~L->-q%WcIF8mLy&YPobt7P4I~zW2d1eoPkgFwoUiuZ zLzAh^;=|1@Rh3DDyC0Ivv4}>#%DttJ29-)=rjJ~~`_4Q@5EF;;F^wPSxqZxxbwl)k zhk|*_xPN_}HkBm03fYxhvdvst^u+CzF9Q`_&i(egT%-L!rT$A;b22ITl60TjlC7LH z40p0+eU-NL)cAvoX(2?4an`3N@m<;AnA#VGwQ2S3$0QX}HyP z1o4bcS_?LXk69zRlr^q?RpWmHRxf-gQ~k1;xBbq7UZ4uMmKwb=2XCl8XA2D*LxT$~ zKukN;^mqfs&-8JL3!Tt`twGi9)9BbxI_6!7$c}a+EIa?CHN60@0_3TFxNa3|@k}zm zp@T3_-7O35lioXy1NJ9W60}oM0HJ})VjTVVuM*Rs{drfPc-(J}aT5XWX1$$)qH#+^ zDs(Od@j5aW9(JfP&Wp_QoN(jILWomQwT_NCh3plCDbv(vzjwFM`P!0fAe4*X8*?|Lg}ASVs8~)AzDpLtH2^68|*9TeQ2- z3+0)5RSRWer_9KKxPAz&3!Y-a!d=OCOp0Hdxur?>ASrG`f=akCQlERHKLr@qPhhEXh!7L;Tm*)AoW(nABgYnLs`F9 z%>R97bU~?-5H9)r>92bjS#+HQ$ zfVuy?lz}zFf$?``6qMTBUHoC#hU8XJCtVC3#pC9StfBJcCEf+WLlZ^L@-)H{sL#T_G7)~5xrH;GV?AT>;OY= zsS4E>!umgVdax+*u_qTKQD=|Snjs%mY#t(G^pmCdU222(p?P<_LMS0R-vNvE57MBP zjV|W16y1ONu_QgLKFNosk&@enTM*l>LIrQeE!)tvMai>6{u6hLlbr?e;%kbT3x934 z{Cx%+LY||e%JUn*`HPx(1x?&b8CgBBkyt7(=f~-*&&8fj(H$N+t8a6!mzsZ63~Vxe z4)nfzf1cGuS=cPCut}K(2wrV}bT{xA5r>>D`!wsqXg8ze5jS+hs? zzZ2u3JUe*C4&?KW&=_A`-Q?}&nxV-LHzd81_p&*}N@|i& zad7(ij4aT0AIbOAQA*TixgA**@CGid|d`T2+WHcHhaS%#=~LOFP% z*j5mWU7|scPwQ`vBqyW-Nh&6lROoM92^e4w zcP5dYZGxG4Lm=3fTW~P({y#sB4MpyMNk5fG1{EXV=;T}zUCbO*)K3}&9Y)|JeGE5A z)*Dlhn>Bd~0K$3tIfJpfZ4uZ(1LEFQM|?REwoUncWkabfn|$Tc^&v~2udZrWdIVFkQOpn(Rda)VC7o0}WAyE77r7{YgS zbaZkVJeUCODl{}yD4tTj+H9OKIqj%(DOt)s32Mv=ofn88sJy2KkIiwb@l%9l4eB{& zGc!d!@#H;I;i_Xq1m7BMR|uQgsKY=d^s}i7$^z0WYkR*cw}49_3gK-8Zr;*|O!~jU zaEp@3VN+~jaWMyga+$GM+|CU10gJgmirj#v@!8Y8(;q+RL^_Q=fF^f#yvTaI)PM+R z^!5QtKVK>3aqBH-hpG)Hz5uo<2In+ahyv}8kujUkxAR&1)2A_~9a5N`3m{bD&vBJt zm4#5WpuIwzon=r-y5i8Z!ww<4XUJB0i=4UpFc81?(La*-brSKWHh}0TPTBCW_+lzd7%wA$w&0-&Y54qR1ghS4O6$&|h9&l%*Coe@1{Sb-4jH zA#Rr7>%5ADn++fX9Rd*E4Yvnkm0v~xeu2ZqwsZoG3JhSUOsS~4eKLTM@ftYp3n|63 zJM8*&hZ}r))xe_Gi-ewz#m7!MFX?9S=gI+YhPon&(I`{JsMPg4w*NWH#0RL!fC_vm zz;+f1LNEdvs!@&1NbBVS;q*E4fE*Z;V?E>YC(>oGK$m5W3IQBO|Q^W&1Rtqz}>kgS22$M`4zv z&nu!4d1WPjXPILxG+3*`(48v5nE|IvFovTv>l%OIoupzjn4;;^l-KlPzUUte;qzVZ zz6f^hcYsEwu)^nxQld;_;2_Ti<&F1%l@}b@ebu5e(d?tLJ+32kAivsd!_SVU7aEf# znByGAk}TlEF|}Nz@!%y6>v+u?b#^}Z_sA#vm0$qUtFW~u!@&SPo@c#SyYStWG58%G zr5YDN1cEbNIm$`kWI0zP5t_OwF1vZ!=^>T7+xPqE z?zA}7(8kZ&!U1v^}kmjb>>ebg0J46jVB9ND_DJbk6}vZ;-d>2R_fCYQB|xc4;|Gv zc{`Y{l4rN+#s7C}N+)*#1@ws`MWVpKKw`kWOS92B1r$!%#wwB@s>CKKDQUe>EnFIh zrRUE>{N@e1v9y@5s)^qB&xta;h|HHjrC1t@-~9p#h?$ABg*ES~AkYr$jWz`am*c;R zN4(!i$=S_4PvH&2wOVGg&xc7rOf4@C!!_RD_g8*@PGfAAZGZnnPQ1Im7WTv8)3~&1 zi4LI#znyF*Zj*5clhX@ZV25uA3%PUQ)Oq8WQ33ae(n+>+mCPQW52A2qUu0JWeU=E4D)oE!b7F5_ zjc&gzG}{m~#tuyO>fb@DV0JPVpHp$J%>Bu^I5S)ZpaPNLlLRGx3)P>r_uYf4JbSfN3>z7spKq_k*NVQ>LnYxOVa4< zBKd6AYS?%h*5dw8V>rC-AOV$*g@E@F6kt}nLHu&fYKe=(a@|f{9{s?qK@ZD5h4&0W zvDf$C1@$}Kqe`!J?XO2{@~h?0toTpYLVA|_@c^7f_)BZlx!LfIWtCR?zSA$FM!<-s zRzmonk9=G*$?4ER`1ii}^RfL@7v)s}nE|eFxzH35)i**2tg-};MgjtXKAe#2-UrO# zYU%=l;y!#NmeCnJG8>;vm7~8>YXg~zs2m}y-o+doxX$Kxg8TVFrODVp9yV)^?+v^!CDwZHJ^ts6{>f^a?e{5d zJ$lCqm|2U`-(#1Ws>{2NNAisUFm1E*9S1_owpv5ad=2bU$D$S?o0;m8rm;0RO$Dmu z;MNC|`7E~knyHp;hY!|KuJ;UD#VN(HZ|q3Rw`VRjh9Yr#qFv!9S| zi8(dms@r4XQM4``*?@6DiopG{gq(@=A0J;Xt1IXWr~UM$f4vfkDMGASAr$7DYPo9z z15$aK=8BuZ_B;ms+A@tzO+D}>3ptMb5?j|dcHXb!G=hEd1oAz*86W{lN6SqN_S`A$ z#PHet0=u<3HChg(dL`!a!fFYkCkJh9^PA7l59{x_4CBZfy0y_kApTzt(xV~SVx*BTdHO$c|w7Q;?)b5Ov2fe;e1Kt*m1Y7t2 zF`}+ecwGSx9omg@I$$i6Y};gGCmrFrxFAF+xe3Abb1CdM_a(Q;87<0`mY++zn)^mA0RgX3QD1AW<;r~>j-!FQ-Nc5pFl-v5#`~z zk&)3ty*IytM`l-H;_?+sl55rKkK0`gHXMK5~zg-V)st_U_@o&JqvF z*_IB@bvJlca`V<9eNbjK846KcJdYa93=DnPCz$0ls7JiB_G{+Gl!g0iw(qDb^v} zhSG>~ty*b*!$5H{v23NqHq8ce0@{QK-UJ4_u=Hm46GAbqy=Lp@Zw<;$W5qD(wf*v0 zywFicoZ>HS&>u5=F2~+QrZVCC&wQ#gZCIMRr%}$2bkQA-mUlQf{JEd?UA-cVJ%Y2B zn`knP^6DCP=0p?xJ^{w_&zbs#n~C!uXDZo`1Fj7o;b*~*rh*Qxi<{%0tg7W|F!N(8 z{_Pq3tDPv~_qYXywzmFwdncq?wV#?LxnxTj9W%U7D0sJ^B#maBR z_jOiuSHA_`?8qd=ICP+@VOk~rTtLH6N=$XSAy|^7C7#$jeW|Hb8EYW_T)r%76$Y{& zjH40-usMgZz33zqU0f_t9#|`zY=wGe0CWI&$4vh<)($wglUCBODC>KCW4&6D(J35G z$GB|>ZpW2(kI27C?S{xkGWiV9QPLXix-!3fuQr>8I9LI~lJRUXCMwF*wIzGknSWk> zRfa6@M(Li-;2)nm{gHG*%vUlnc^e}(qd`|?)FUw;JLjoxKR}>5c!ojX#qRE%RH?RF zL#Eejhx<%kz6+kM1Mn->p)ozKFJY{G-QK4(2a+0927MF0up3t!PRw%`00x;*tO>WO z@s!YmYyS%E^L&a;`wEsR*?M;mr1imVynLMhxx*kT&@?%m@eV(ii->IbGWX&0)e5rY zkB1t)mHc?syD<>YOO(k6G^g_LUZh`z+RS-@IRLmHIIawD9|DoG1k76XL=2E z7S(tHQcBM^>@Rn9B%jOI-tyw+$tQi25+}?AE)k;#9Q*~Jz{>cfu~TCBqMYYovJZ-* zjlXn=14nbUhV$JK?UWBnf1aK7#p4{Ec^*d;I{!M>sv}$1dJ_(!4=*t`BgXS)v_nG^ zbg-V*a?VNFrwV=oA*?i*op8pUYD6?CszG6nEGVFF+9tZdZ*Y+HI%+H@jy$ z=P&s5PYE9>&2QOKF@M}TBy#aMkBSybDoR3)y6uQu`*{{ANkOk4;4LcEIvU{%u7{P9 zJKO3tqm-$toBt|#pULlwK=+<`Lr6dU9bF^98Pq~7>K>aTZ2x{8U+Hi-B2BN=!lXTO z$L}K*U{-p?yVwKa5Qa+ZQ?u zdz#Tr!u{0vva@BhF1OQGddR?!;9X&PGB3duzryjK>qx_ ztLAopXyP2iiUwSvrnx=i027La%(Cr6CPme-So3clO1(>5cLOo0^pG?SB$jzQy*wG4 z4Qf5o+O?6guSuvuZ%_2SaP(q-_un#wqL1lOa?G>L_7X$`FxACg+5f^+z^M0Ax{mfv z?LGP_00I#G!;lC$zWs8@dkiz6j64AQLQ#hG@g!Gkf2M;@0{KPbVKFBUw%Y9{WVu1d z`)^p^_F3zxWH1?{Uie{wje;%AIMFDJc)Z$7bTGA;OQ6P%F*}oh#_sz%D~jM0&klYb z2@;#vr6ndVExRU~(;4bVn}52x#~{3O%OfA%SSZQE;eH{qF7nFK<#sfFXrq}ronu@> z=U@4!maRj06V2gKSh+l0Q#{FFK$!8L_hr``_&eR}5XPMafSO~FnlVuJp2hObhpY|~ zOlZ{4^N$>dO~p|SvK+Y{iMUhaKF<$9;^dZ%#|xo$Yn?LUkd)87m{|W1&TQ7|FoA+| zb~PhjiAd^z4H}8%g}3FWPJ<3p_?jSsAS2@t(gZ$H%wdhbeCFwV ztJP+20{Nwxq;MFxSPDnyIU9Y^k9&D+!EjEpc0^jM_rXP+>BBn`nVW^Nl4PDbKo-#@ z$dZZvUqSZ-e&x!|PeXC7j}|}sAd!f#O)&`Kv&<^Nc{RW7VW)C*RB`?{&Cjp3MEH&c zl9NOC=vD|k?H?j=Gd6d+|Dw|WI!P&A1XUq!H^ewWL;bcRB`0m-%?l&<)Alb@+$G9d zHKae8P45ET(hN&I8BE5$djbeFFK;gJpf*9~95M!Q?w!W-{Qvro_2TQ5NsN$0?W8gC zwl?o9n6^TvMztKP5&^B*#9t%jJD$cD|pDob{%!OE;QXig{#y1MJ~QtO<2%dVMei^y4`0>SK(H( z*3^!k|AvUbHEt1g&-|}M#e;0U@c}80LN*w9fJmPP+X6xN-0#Aycmem&x%AWi^z6eE zkXI4VpbY%y6b%ue2=zS!RF)ZYm0H>czO79fCV_xEsIBCa)3v%uY>^o9myDthQ~kD#a$2#ti0*mSXlRU7OE2mW6eNQh~e0mlTbUa)Chp ztF&kJAK4}V)MNU)cAq+&4=}XBBNc2v9s{ff=E>dH%}H6H_7Z@k^;@a+v(W;NCe@NI z(oPS(C6Wo18{vOV7)Fs8NKG%)x9#M zyX78UJ7QOizP!Ay1gK0#Gd*+&Ev^h`u)vPckFXK0&A38e+?*)-x|22%_ z_ISZBVlc_Ov$;Oc7}(}U<*pML(m&TNanY5mlPayBag{O+G57+z961LNL^;sL{+}JI zG+LEw*e!Ln;^RdW^MD))3E*OTwrz?wvM3P`jbY0~D?#=5J2X13PN%S)s8U=wtm>_-VGD;8vM=~8ufvZv6oYU;FK~y%;PlGHMQ&R!|HwcI6A-82p}-IOaLvxsdhClt8Gyjk)z4*} HQ$iB}w9V9e literal 0 HcmV?d00001 diff --git a/doc/pool.md b/doc/pool.md new file mode 100644 index 0000000..41e7e69 --- /dev/null +++ b/doc/pool.md @@ -0,0 +1,27 @@ +# Node connection pool + +* Distributes requests between fixed number of nodes +* Wraps + +The distribution between nodes in connection pool is based on priority and weight parameters from +NodeParam struct. The distribution model is presented below. On this scheme nodes with the same +priority have the same color. + +![](./image/pool.png "Pool connections distribution model") + +## Priority + +Pool component forwards request to the nodes with the highest priority (the lower the value - +the higher the priority). The `node 1` from the image's scenario (I) is healthy +and has the highest priority (1), that's why the pool forwards requests from it. There are no other +nodes with priority 1, so `node 1` receives all requests. In the second scenario (II) `node 1` +becomes unhealthy. In that case pool tries to connect nodes with next in priority nodes e.g. +`Node 4` and `node 2`. If all of them become unhealthy too, the pool sends requests to nodes with +priority 3 in scenario (III) and so on. + +## Weights + +If there are several nodes with the same priority, then requests are distributed randomly between +these nodes based on their weights. To do that the proportion of weights is calculated. +For example, for `node 2` and `node 4` with weights 2 and 8 the distribution would be 20 and 80 percent +respectively. \ No newline at end of file diff --git a/pool/doc.go b/pool/doc.go index ce7acb2..349b20b 100644 --- a/pool/doc.go +++ b/pool/doc.go @@ -7,8 +7,7 @@ a weighted random selection of the underlying client to make requests. Create pool instance with 3 nodes connection. This InitParameters will make pool use 192.168.130.71 node while it is healthy. Otherwise, it will make the pool use -192.168.130.72 for 90% of requests and 192.168.130.73 for remaining 10%. -: +192.168.130.72 for 90% of requests and 192.168.130.73 for remaining 10%: var prm pool.InitParameters prm.SetKey(key) diff --git a/pool/pool.go b/pool/pool.go index 9798836..b536bab 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -293,7 +293,7 @@ func (x *wrapperPrm) setErrorThreshold(threshold uint32) { x.errorThreshold = threshold } -// SetGracefulCloseOnSwitchTimeout specifies the timeout after which unhealthy client be closed during rebalancing +// setGracefulCloseOnSwitchTimeout specifies the timeout after which unhealthy client be closed during rebalancing // if it will become healthy back. // // See also setErrorThreshold. @@ -1450,6 +1450,9 @@ func (x *NodeParam) SetPriority(priority int) { } // Priority returns priority of the node. +// Requests will be served by nodes subset with the highest priority (the smaller value - the higher priority). +// If there are no healthy nodes in subsets with current or higher priority, requests will be served +// by nodes subset with lower priority. func (x *NodeParam) Priority() int { return x.priority } @@ -1465,6 +1468,7 @@ func (x *NodeParam) Address() string { } // SetWeight specifies weight of the node. +// Weights used to adjust requests' distribution between nodes with the same priority. func (x *NodeParam) SetWeight(weight float64) { x.weight = weight } @@ -1508,7 +1512,7 @@ func (x *WaitParams) checkForPositive() { } } -// CheckForValid checks if all wait params are non-negative. +// CheckValidity checks if all wait params are non-negative. func (x *WaitParams) CheckValidity() error { if x.Timeout <= 0 { return errors.New("timeout cannot be negative") From 8f751d9dd0ad02ce57cab1c491bcb57e4c7ea7ef Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Mon, 2 Sep 2024 17:56:09 +0300 Subject: [PATCH 082/197] [#263] go.mod: Update api-go Remove `client.ContainerEACL` and related references. This change was initiated by the removal of `ContainerService.GetExtendedACL` from the API. Signed-off-by: Aleksey Savchuk --- client/container_eacl.go | 123 --------------------------------------- go.mod | 2 +- go.sum | 4 +- pool/mock_test.go | 9 --- pool/pool.go | 105 --------------------------------- pool/statistic.go | 10 ---- 6 files changed, 3 insertions(+), 250 deletions(-) delete mode 100644 client/container_eacl.go diff --git a/client/container_eacl.go b/client/container_eacl.go deleted file mode 100644 index 8e9fd40..0000000 --- a/client/container_eacl.go +++ /dev/null @@ -1,123 +0,0 @@ -package client - -import ( - "context" - "fmt" - - v2container "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" - apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" - cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" - "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/eacl" - "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session" -) - -// PrmContainerEACL groups parameters of ContainerEACL operation. -type PrmContainerEACL struct { - // FrostFS request X-Headers. - XHeaders []string - - ContainerID *cid.ID - - Session *session.Container -} - -// SetContainer sets identifier of the FrostFS container to read the eACL table. -// Required parameter. -// -// Deprecated: Use PrmContainerEACL.ContainerID instead. -func (x *PrmContainerEACL) SetContainer(id cid.ID) { - x.ContainerID = &id -} - -func (x *PrmContainerEACL) buildRequest(c *Client) (*v2container.GetExtendedACLRequest, error) { - if x.ContainerID == nil { - return nil, errorMissingContainer - } - - if len(x.XHeaders)%2 != 0 { - return nil, errorInvalidXHeaders - } - - var cidV2 refs.ContainerID - x.ContainerID.WriteToV2(&cidV2) - - reqBody := new(v2container.GetExtendedACLRequestBody) - reqBody.SetContainerID(&cidV2) - - var meta v2session.RequestMetaHeader - writeXHeadersToMeta(x.XHeaders, &meta) - - if x.Session != nil { - var tokv2 v2session.Token - x.Session.WriteToV2(&tokv2) - - meta.SetSessionToken(&tokv2) - } - - var req v2container.GetExtendedACLRequest - req.SetBody(reqBody) - c.prepareRequest(&req, &meta) - return &req, nil -} - -// ResContainerEACL groups resulting values of ContainerEACL operation. -type ResContainerEACL struct { - statusRes - - table eacl.Table -} - -// Table returns eACL table of the requested container. -func (x ResContainerEACL) Table() eacl.Table { - return x.table -} - -// ContainerEACL reads eACL table of the FrostFS container. -// -// Exactly one return value is non-nil. By default, server status is returned in res structure. -// Any client's internal or transport errors are returned as `error`. -// If PrmInit.DisableFrostFSFailuresResolution has been called, unsuccessful -// FrostFS status codes are included in the returned result structure, -// otherwise, are also returned as `error`. -// -// Returns an error if parameters are set incorrectly (see PrmContainerEACL docs). -// Context is required and must not be nil. It is used for network communication. -// -// Return statuses: -// - global (see Client docs); -// - *apistatus.ContainerNotFound; -// - *apistatus.EACLNotFound. -func (c *Client) ContainerEACL(ctx context.Context, prm PrmContainerEACL) (*ResContainerEACL, error) { - req, err := prm.buildRequest(c) - if err != nil { - return nil, err - } - - if err := signature.SignServiceMessage(&c.prm.Key, req); err != nil { - return nil, fmt.Errorf("sign request: %w", err) - } - - resp, err := rpcapi.GetEACL(&c.c, req, client.WithContext(ctx)) - if err != nil { - return nil, err - } - - var res ResContainerEACL - res.st, err = c.processResponse(resp) - if err != nil || !apistatus.IsSuccessful(res.st) { - return &res, err - } - - eACL := resp.GetBody().GetEACL() - if eACL == nil { - return &res, newErrMissingResponseField("eACL") - } - - res.table = *eacl.NewTableFromV2(eACL) - return &res, nil -} diff --git a/go.mod b/go.mod index e6f64c0..013f347 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.22 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240827080218-5fece80b4203 + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240902111049-c11f50efeccb git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 diff --git a/go.sum b/go.sum index c4e4d29..cc07ee4 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240827080218-5fece80b4203 h1:GtBJrT2x03XAiOqyQBUa1XXjDBGxsW5ahCv1W8qyj60= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240827080218-5fece80b4203/go.mod h1:BDnEpkKMykCS8u1nLzR6SgNzCv6885RWlo5TnravQuI= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240902111049-c11f50efeccb h1:p9ByDsw+H6p6LyYSx8LKFtAG/oPKQpDVMNfjPqdevTw= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240902111049-c11f50efeccb/go.mod h1:BDnEpkKMykCS8u1nLzR6SgNzCv6885RWlo5TnravQuI= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e h1:kcBqZBiFIUBATUqEuvVigtkJJWQ2Gug/eYXn967o3M4= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e/go.mod h1:F/fe1OoIDKr5Bz99q4sriuHDuf3aZefZy9ZsCqEtgxc= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= diff --git a/pool/mock_test.go b/pool/mock_test.go index 994fecd..d5a635a 100644 --- a/pool/mock_test.go +++ b/pool/mock_test.go @@ -14,7 +14,6 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa" - "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/eacl" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session" @@ -95,14 +94,6 @@ func (m *mockClient) containerDelete(context.Context, PrmContainerDelete) error return nil } -func (m *mockClient) containerEACL(context.Context, PrmContainerEACL) (eacl.Table, error) { - return eacl.Table{}, nil -} - -func (m *mockClient) containerSetEACL(context.Context, PrmContainerSetEACL) error { - return nil -} - func (c *mockClient) apeManagerAddChain(ctx context.Context, prm PrmAddAPEChain) error { return nil } diff --git a/pool/pool.go b/pool/pool.go index b536bab..264c69a 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -22,7 +22,6 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa" - "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/eacl" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" @@ -50,8 +49,6 @@ type client interface { containerList(context.Context, PrmContainerList) ([]cid.ID, error) // see clientWrapper.containerDelete. containerDelete(context.Context, PrmContainerDelete) error - // see clientWrapper.containerEACL. - containerEACL(context.Context, PrmContainerEACL) (eacl.Table, error) // see clientWrapper.apeManagerAddChain. apeManagerAddChain(context.Context, PrmAddAPEChain) error // see clientWrapper.apeManagerRemoveChain. @@ -152,8 +149,6 @@ const ( methodContainerGet methodContainerList methodContainerDelete - methodContainerEACL - methodContainerSetEACL methodEndpointInfo methodNetworkInfo methodNetMapSnapshot @@ -183,10 +178,6 @@ func (m MethodIndex) String() string { return "containerList" case methodContainerDelete: return "containerDelete" - case methodContainerEACL: - return "containerEACL" - case methodContainerSetEACL: - return "containerSetEACL" case methodEndpointInfo: return "endpointInfo" case methodNetworkInfo: @@ -579,32 +570,6 @@ func (c *clientWrapper) containerDelete(ctx context.Context, prm PrmContainerDel return waitForContainerRemoved(ctx, c, getPrm, prm.WaitParams) } -// containerEACL invokes sdkClient.ContainerEACL parse response status to error and return result as is. -func (c *clientWrapper) containerEACL(ctx context.Context, prm PrmContainerEACL) (eacl.Table, error) { - cl, err := c.getClient() - if err != nil { - return eacl.Table{}, err - } - - cliPrm := sdkClient.PrmContainerEACL{ - ContainerID: &prm.ContainerID, - Session: prm.Session, - } - - start := time.Now() - res, err := cl.ContainerEACL(ctx, cliPrm) - c.incRequests(time.Since(start), methodContainerEACL) - var st apistatus.Status - if res != nil { - st = res.Status() - } - if err = c.handleError(ctx, st, err); err != nil { - return eacl.Table{}, fmt.Errorf("get eacl on client: %w", err) - } - - return res.Table(), nil -} - // apeManagerAddChain invokes sdkClient.APEManagerAddChain and parse response status to error. func (c *clientWrapper) apeManagerAddChain(ctx context.Context, prm PrmAddAPEChain) error { cl, err := c.getClient() @@ -1871,29 +1836,6 @@ func (x *PrmContainerDelete) SetWaitParams(waitParams WaitParams) { x.WaitParams = &waitParams } -// PrmContainerEACL groups parameters of GetEACL operation. -type PrmContainerEACL struct { - ContainerID cid.ID - - Session *session.Container -} - -// SetContainerID specifies identifier of the FrostFS container to read the eACL table. -// -// Deprecated: Use PrmContainerEACL.ContainerID instead. -func (x *PrmContainerEACL) SetContainerID(cnrID cid.ID) { - x.ContainerID = cnrID -} - -// PrmContainerSetEACL groups parameters of SetEACL operation. -type PrmContainerSetEACL struct { - Table eacl.Table - - Session *session.Container - - WaitParams *WaitParams -} - type PrmAddAPEChain struct { Target ape.ChainTarget @@ -1910,36 +1852,6 @@ type PrmListAPEChains struct { Target ape.ChainTarget } -// SetTable sets structure of container's extended ACL to be used as a -// parameter of the base client's operation. -// -// See git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client.PrmContainerSetEACL.SetTable. -// -// Deprecated: Use PrmContainerSetEACL.Table instead. -func (x *PrmContainerSetEACL) SetTable(table eacl.Table) { - x.Table = table -} - -// WithinSession specifies session to be used as a parameter of the base -// client's operation. -// -// See git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client.PrmContainerSetEACL.WithinSession. -// -// Deprecated: Use PrmContainerSetEACL.Session instead. -func (x *PrmContainerSetEACL) WithinSession(s session.Container) { - x.Session = &s -} - -// SetWaitParams specifies timeout params to complete operation. -// If not provided the default one will be used. -// Panics if any of the wait params isn't positive. -// -// Deprecated: Use PrmContainerSetEACL.WaitParams instead. -func (x *PrmContainerSetEACL) SetWaitParams(waitParams WaitParams) { - waitParams.checkForPositive() - x.WaitParams = &waitParams -} - // PrmBalanceGet groups parameters of Balance operation. type PrmBalanceGet struct { account user.ID @@ -2934,23 +2846,6 @@ func (p *Pool) DeleteContainer(ctx context.Context, prm PrmContainerDelete) erro return nil } -// GetEACL reads eACL table of the FrostFS container. -// -// Main return value MUST NOT be processed on an erroneous return. -func (p *Pool) GetEACL(ctx context.Context, prm PrmContainerEACL) (eacl.Table, error) { - cp, err := p.connection() - if err != nil { - return eacl.Table{}, err - } - - eaclResult, err := cp.containerEACL(ctx, prm) - if err != nil { - return eacl.Table{}, fmt.Errorf("get EACL via client '%s': %w", cp.address(), err) - } - - return eaclResult, nil -} - // AddAPEChain sends a request to set APE chain rules for a target (basically, for a container). func (p *Pool) AddAPEChain(ctx context.Context, prm PrmAddAPEChain) error { cp, err := p.connection() diff --git a/pool/statistic.go b/pool/statistic.go index 5ae0f7b..40da88f 100644 --- a/pool/statistic.go +++ b/pool/statistic.go @@ -102,16 +102,6 @@ func (n NodeStatistic) AverageDeleteContainer() time.Duration { return n.averageTime(methodContainerDelete) } -// AverageGetContainerEACL returns average time to perform ContainerEACL request. -func (n NodeStatistic) AverageGetContainerEACL() time.Duration { - return n.averageTime(methodContainerEACL) -} - -// AverageSetContainerEACL returns average time to perform ContainerSetEACL request. -func (n NodeStatistic) AverageSetContainerEACL() time.Duration { - return n.averageTime(methodContainerSetEACL) -} - // AverageEndpointInfo returns average time to perform EndpointInfo request. func (n NodeStatistic) AverageEndpointInfo() time.Duration { return n.averageTime(methodEndpointInfo) From 46ee5438993e879df8182327ebfcf7df31eac530 Mon Sep 17 00:00:00 2001 From: Ekaterina Lebedeva Date: Tue, 3 Sep 2024 13:20:30 +0300 Subject: [PATCH 083/197] [#265] 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 --- container/container.go | 2 +- eacl/record.go | 4 ++-- eacl/table.go | 2 +- eacl/target.go | 6 +++--- eacl/test/benchmark_test.go | 10 +++++----- netmap/bench_test.go | 2 +- netmap/selector_test.go | 20 ++++++++++---------- netmap/yml_test.go | 4 ++-- object/erasurecode/reconstruct_test.go | 6 +++--- object/id/id_test.go | 6 +++--- object/tombstone_test.go | 2 +- object/transformer/transformer_test.go | 4 ++-- pool/pool.go | 2 +- pool/pool_test.go | 6 +++--- pool/sampler.go | 2 +- pool/sampler_test.go | 2 +- pool/tree/pool.go | 2 +- 17 files changed, 41 insertions(+), 41 deletions(-) diff --git a/container/container.go b/container/container.go index 8c9c447..e2e796b 100644 --- a/container/container.go +++ b/container/container.go @@ -308,7 +308,7 @@ func (x *Container) SetAttribute(key, value string) { attrs := x.v2.GetAttributes() ln := len(attrs) - for i := 0; i < ln; i++ { + for i := range ln { if attrs[i].GetKey() == key { attrs[i].SetValue(value) return diff --git a/eacl/record.go b/eacl/record.go index eeb9646..3c0d44a 100644 --- a/eacl/record.go +++ b/eacl/record.go @@ -286,13 +286,13 @@ func equalRecords(r1, r2 Record) bool { return false } - for i := 0; i < len(fs1); i++ { + for i := range len(fs1) { if !equalFilters(fs1[i], fs2[i]) { return false } } - for i := 0; i < len(ts1); i++ { + for i := range len(ts1) { if !equalTargets(ts1[i], ts2[i]) { return false } diff --git a/eacl/table.go b/eacl/table.go index b16467b..6982b85 100644 --- a/eacl/table.go +++ b/eacl/table.go @@ -212,7 +212,7 @@ func EqualTables(t1, t2 Table) bool { return false } - for i := 0; i < len(rs1); i++ { + for i := range len(rs1) { if !equalRecords(rs1[i], rs2[i]) { return false } diff --git a/eacl/target.go b/eacl/target.go index 5e34950..2b8b709 100644 --- a/eacl/target.go +++ b/eacl/target.go @@ -51,7 +51,7 @@ func SetTargetECDSAKeys(t *Target, pubs ...*ecdsa.PublicKey) { binKeys = make([][]byte, 0, ln) } - for i := 0; i < ln; i++ { + for i := range ln { binKeys = append(binKeys, (*keys.PublicKey)(pubs[i]).Bytes()) } @@ -67,7 +67,7 @@ func TargetECDSAKeys(t *Target) []*ecdsa.PublicKey { pubs := make([]*ecdsa.PublicKey, ln) - for i := 0; i < ln; i++ { + for i := range ln { p := new(keys.PublicKey) if p.DecodeBytes(binKeys[i]) == nil { pubs[i] = (*ecdsa.PublicKey)(p) @@ -169,7 +169,7 @@ func equalTargets(t1, t2 Target) bool { return false } - for i := 0; i < len(keys1); i++ { + for i := range len(keys1) { if !bytes.Equal(keys1[i], keys2[i]) { return false } diff --git a/eacl/test/benchmark_test.go b/eacl/test/benchmark_test.go index 865789b..e4f91c0 100644 --- a/eacl/test/benchmark_test.go +++ b/eacl/test/benchmark_test.go @@ -19,7 +19,7 @@ func baseBenchmarkTableBinaryComparison(b *testing.B, factor int) { b.StopTimer() b.ResetTimer() b.StartTimer() - for i := 0; i < b.N; i++ { + for range b.N { got, _ := t.Marshal() if !bytes.Equal(exp, got) { b.Fail() @@ -38,7 +38,7 @@ func baseBenchmarkTableEqualsComparison(b *testing.B, factor int) { b.StopTimer() b.ResetTimer() b.StartTimer() - for i := 0; i < b.N; i++ { + for range b.N { if !eacl.EqualTables(*t, *t2) { b.Fail() } @@ -76,7 +76,7 @@ func TargetN(n int) *eacl.Target { x.SetRole(eacl.RoleSystem) keys := make([][]byte, n) - for i := 0; i < n; i++ { + for i := range n { keys[i] = make([]byte, 32) rand.Read(keys[i]) } @@ -94,7 +94,7 @@ func RecordN(n int) *eacl.Record { x.SetOperation(eacl.OperationRangeHash) x.SetTargets(*TargetN(n)) - for i := 0; i < n; i++ { + for range n { x.AddFilter(eacl.HeaderFromObject, eacl.MatchStringEqual, "", cidtest.ID().EncodeToString()) } @@ -106,7 +106,7 @@ func TableN(n int) *eacl.Table { x.SetCID(cidtest.ID()) - for i := 0; i < n; i++ { + for range n { x.AddRecord(RecordN(n)) } diff --git a/netmap/bench_test.go b/netmap/bench_test.go index e0dc7c5..cd3dfac 100644 --- a/netmap/bench_test.go +++ b/netmap/bench_test.go @@ -47,7 +47,7 @@ func BenchmarkNetmap_ContainerNodes(b *testing.B) { b.ResetTimer() b.ReportAllocs() - for i := 0; i < b.N; i++ { + for range b.N { _, err := nm.ContainerNodes(p, pivot) if err != nil { b.Fatal(err) diff --git a/netmap/selector_test.go b/netmap/selector_test.go index 797ccfc..2d54987 100644 --- a/netmap/selector_test.go +++ b/netmap/selector_test.go @@ -38,7 +38,7 @@ func BenchmarkHRWSort(b *testing.B) { b.Run("sort by index, no weight", func(b *testing.B) { realNodes := make([]nodes, netmapSize) b.ResetTimer() - for i := 0; i < b.N; i++ { + for range b.N { b.StopTimer() copy(realNodes, vectors) b.StartTimer() @@ -49,7 +49,7 @@ func BenchmarkHRWSort(b *testing.B) { b.Run("sort by value, no weight", func(b *testing.B) { realNodes := make([]nodes, netmapSize) b.ResetTimer() - for i := 0; i < b.N; i++ { + for range b.N { b.StopTimer() copy(realNodes, vectors) b.StartTimer() @@ -60,7 +60,7 @@ func BenchmarkHRWSort(b *testing.B) { b.Run("only sort by index", func(b *testing.B) { realNodes := make([]nodes, netmapSize) b.ResetTimer() - for i := 0; i < b.N; i++ { + for range b.N { b.StopTimer() copy(realNodes, vectors) b.StartTimer() @@ -71,7 +71,7 @@ func BenchmarkHRWSort(b *testing.B) { b.Run("sort by value", func(b *testing.B) { realNodes := make([]nodes, netmapSize) b.ResetTimer() - for i := 0; i < b.N; i++ { + for range b.N { b.StopTimer() copy(realNodes, vectors) b.StartTimer() @@ -82,7 +82,7 @@ func BenchmarkHRWSort(b *testing.B) { b.Run("sort by ID, then by index (deterministic)", func(b *testing.B) { realNodes := make([]nodes, netmapSize) b.ResetTimer() - for i := 0; i < b.N; i++ { + for range b.N { b.StopTimer() copy(realNodes, vectors) b.StartTimer() @@ -134,7 +134,7 @@ func BenchmarkPolicyHRWType(b *testing.B) { nm.SetNodes(nodes) b.ResetTimer() - for i := 0; i < b.N; i++ { + for range b.N { _, err := nm.ContainerNodes(p, []byte{1}) if err != nil { b.Fatal() @@ -195,7 +195,7 @@ func TestPlacementPolicy_DeterministicOrder(t *testing.T) { } a, b := getIndices(t) - for i := 0; i < 10; i++ { + for range 10 { x, y := getIndices(t) require.Equal(t, a, x) require.Equal(t, b, y) @@ -352,7 +352,7 @@ func TestPlacementPolicy_Unique(t *testing.T) { var nodes []NodeInfo for i, city := range []string{"Moscow", "Berlin", "Shenzhen"} { - for j := 0; j < 3; j++ { + for j := range 3 { node := nodeInfoFromAttributes("City", city) node.SetPublicKey(binary.BigEndian.AppendUint16(nil, uint16(i*4+j))) nodes = append(nodes, node) @@ -366,7 +366,7 @@ func TestPlacementPolicy_Unique(t *testing.T) { require.NoError(t, err) for i, vi := range v { for _, ni := range vi { - for j := 0; j < i; j++ { + for j := range i { for _, nj := range v[j] { require.NotEqual(t, ni.hash, nj.hash) } @@ -455,7 +455,7 @@ func TestPlacementPolicy_MultiREP(t *testing.T) { for _, additional := range []int{0, 1, 2} { t.Run(fmt.Sprintf("unique=%t, additional=%d", unique, additional), func(t *testing.T) { rs := []ReplicaDescriptor{newReplica(1, "SameRU")} - for i := 0; i < additional; i++ { + for range additional { rs = append(rs, newReplica(1, "")) } diff --git a/netmap/yml_test.go b/netmap/yml_test.go index a744a01..4df6e0a 100644 --- a/netmap/yml_test.go +++ b/netmap/yml_test.go @@ -130,7 +130,7 @@ func BenchmarkPlacementPolicyInteropability(b *testing.B) { b.Run(name, func(b *testing.B) { b.ReportAllocs() b.ResetTimer() - for i := 0; i < b.N; i++ { + for range b.N { b.StartTimer() v, err := nm.ContainerNodes(tt.Policy, tt.Pivot) b.StopTimer() @@ -173,7 +173,7 @@ func BenchmarkManySelects(b *testing.B) { b.ResetTimer() b.ReportAllocs() - for i := 0; i < b.N; i++ { + for range b.N { _, err = nm.ContainerNodes(tt.Policy, tt.Pivot) if err != nil { b.FailNow() diff --git a/object/erasurecode/reconstruct_test.go b/object/erasurecode/reconstruct_test.go index b638a4f..8397f44 100644 --- a/object/erasurecode/reconstruct_test.go +++ b/object/erasurecode/reconstruct_test.go @@ -53,7 +53,7 @@ func TestErasureCodeReconstruct(t *testing.T) { }) t.Run("from parity", func(t *testing.T) { parts := cloneSlice(parts) - for i := 0; i < parityCount; i++ { + for i := range parityCount { parts[i] = nil } reconstructed, err := c.ReconstructHeader(parts) @@ -138,7 +138,7 @@ func TestErasureCodeReconstruct(t *testing.T) { }) t.Run("from parity", func(t *testing.T) { parts := cloneSlice(parts) - for i := 0; i < parityCount; i++ { + for i := range parityCount { parts[i] = nil } reconstructed, err := c.Reconstruct(parts) @@ -180,7 +180,7 @@ func TestErasureCodeReconstruct(t *testing.T) { t.Run("from parity", func(t *testing.T) { oldParts := parts parts := cloneSlice(parts) - for i := 0; i < parityCount; i++ { + for i := range parityCount { parts[i] = nil } diff --git a/object/id/id_test.go b/object/id/id_test.go index bdc0b4d..3f35a3b 100644 --- a/object/id/id_test.go +++ b/object/id/id_test.go @@ -61,7 +61,7 @@ func TestID_Equal(t *testing.T) { func TestID_Parse(t *testing.T) { t.Run("should parse successful", func(t *testing.T) { - for i := 0; i < 10; i++ { + for i := range 10 { t.Run(strconv.Itoa(i), func(t *testing.T) { cs := randSHA256Checksum(t) str := base58.Encode(cs[:]) @@ -78,7 +78,7 @@ func TestID_Parse(t *testing.T) { }) t.Run("should failure on parse", func(t *testing.T) { - for i := 0; i < 10; i++ { + for i := range 10 { j := i t.Run(strconv.Itoa(j), func(t *testing.T) { cs := []byte{1, 2, 3, 4, 5, byte(j)} @@ -98,7 +98,7 @@ func TestID_String(t *testing.T) { }) t.Run("should be equal", func(t *testing.T) { - for i := 0; i < 10; i++ { + for i := range 10 { t.Run(strconv.Itoa(i), func(t *testing.T) { cs := randSHA256Checksum(t) str := base58.Encode(cs[:]) diff --git a/object/tombstone_test.go b/object/tombstone_test.go index 9825133..e819b22 100644 --- a/object/tombstone_test.go +++ b/object/tombstone_test.go @@ -14,7 +14,7 @@ func generateIDList(sz int) []oid.ID { res := make([]oid.ID, sz) cs := [sha256.Size]byte{} - for i := 0; i < sz; i++ { + for i := range sz { var oID oid.ID res[i] = oID diff --git a/object/transformer/transformer_test.go b/object/transformer/transformer_test.go index 97b2b01..a170835 100644 --- a/object/transformer/transformer_test.go +++ b/object/transformer/transformer_test.go @@ -72,7 +72,7 @@ func TestTransformer(t *testing.T) { require.Equal(t, ids.ParentID, &parID) children := tt.objects[i].Children() - for j := 0; j < i; j++ { + for j := range i { id, ok := tt.objects[j].ID() require.True(t, ok) require.Equal(t, id, children[j]) @@ -152,7 +152,7 @@ func benchmarkTransformer(b *testing.B, header *objectSDK.Object, payloadSize, s b.ReportAllocs() b.ResetTimer() - for i := 0; i < b.N; i++ { + for range b.N { f, _ := newPayloadSizeLimiter(maxSize, uint64(sizeHint), func() ObjectWriter { return benchTarget{} }) if err := f.WriteHeader(ctx, header); err != nil { b.Fatalf("write header: %v", err) diff --git a/pool/pool.go b/pool/pool.go index 264c69a..36d6340 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -2256,7 +2256,7 @@ func (p *innerPool) connection() (client, error) { return nil, errors.New("no healthy client") } attempts := 3 * len(p.clients) - for k := 0; k < attempts; k++ { + for range attempts { i := p.sampler.Next() if cp := p.clients[i]; cp.isHealthy() { return cp, nil diff --git a/pool/pool_test.go b/pool/pool_test.go index 9189c3e..656524a 100644 --- a/pool/pool_test.go +++ b/pool/pool_test.go @@ -222,7 +222,7 @@ func TestOneOfTwoFailed(t *testing.T) { time.Sleep(2 * time.Second) - for i := 0; i < 5; i++ { + for range 5 { cp, err := pool.connection() require.NoError(t, err) st, _ := pool.cache.Get(formCacheKey(cp.address(), pool.key, false)) @@ -514,7 +514,7 @@ func TestStatusMonitor(t *testing.T) { monitor.errorThreshold = 3 count := 10 - for i := 0; i < count; i++ { + for range count { monitor.incErrorRate() } @@ -724,7 +724,7 @@ func TestSwitchAfterErrorThreshold(t *testing.T) { require.NoError(t, err) t.Cleanup(pool.Close) - for i := 0; i < errorThreshold; i++ { + for range errorThreshold { conn, err := pool.connection() require.NoError(t, err) require.Equal(t, nodes[0].address, conn.address()) diff --git a/pool/sampler.go b/pool/sampler.go index 6f46886..95d875b 100644 --- a/pool/sampler.go +++ b/pool/sampler.go @@ -30,7 +30,7 @@ func newSampler(probabilities []float64, source rand.Source) *sampler { sampler.alias = make([]int, n) // Compute scaled probabilities. p := make([]float64, n) - for i := 0; i < n; i++ { + for i := range n { p[i] = probabilities[i] * float64(n) } for i, pi := range p { diff --git a/pool/sampler_test.go b/pool/sampler_test.go index 5ece768..ab06e0f 100644 --- a/pool/sampler_test.go +++ b/pool/sampler_test.go @@ -32,7 +32,7 @@ func TestSamplerStability(t *testing.T) { for _, tc := range cases { sampler := newSampler(tc.probabilities, rand.NewSource(0)) res := make([]int, len(tc.probabilities)) - for i := 0; i < COUNT; i++ { + for range COUNT { res[sampler.Next()]++ } diff --git a/pool/tree/pool.go b/pool/tree/pool.go index 21f7c54..3b0ff1a 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -382,7 +382,7 @@ type SubTreeReader struct { // Read reads another list of the subtree nodes. func (x *SubTreeReader) Read(buf []*grpcService.GetSubTreeResponse_Body) (int, error) { - for i := 0; i < len(buf); i++ { + for i := range len(buf) { resp, err := x.cli.Recv() if err == io.EOF { return i, io.EOF From 76a0cfdadb670e27e8e2a2b2c4c204ac39592868 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Tue, 3 Sep 2024 17:17:25 +0300 Subject: [PATCH 084/197] [#217] netmap: Return node netmap state directly Signed-off-by: Aleksey Savchuk --- netmap/node_info.go | 69 ++++++++++++++++++++++++++++++++++ netmap/node_info_test.go | 81 ++++++++++++++++++++++++++++++++-------- 2 files changed, 134 insertions(+), 16 deletions(-) diff --git a/netmap/node_info.go b/netmap/node_info.go index bd37388..4be4b70 100644 --- a/netmap/node_info.go +++ b/netmap/node_info.go @@ -460,6 +460,10 @@ func (x *NodeInfo) SortAttributes() { // SetOffline sets the state of the node to "offline". When a node updates // information about itself in the network map, this action is interpreted as // an intention to leave the network. +// +// See also IsOffline. +// +// Deprecated: use SetStatus instead. func (x *NodeInfo) SetOffline() { x.m.SetState(netmap.Offline) } @@ -470,6 +474,8 @@ func (x *NodeInfo) SetOffline() { // mean online). // // See also SetOffline. +// +// Deprecated: use Status instead. func (x NodeInfo) IsOffline() bool { return x.m.GetState() == netmap.Offline } @@ -479,6 +485,8 @@ func (x NodeInfo) IsOffline() bool { // action is interpreted as an intention to enter the network. // // See also IsOnline. +// +// Deprecated: use SetStatus instead. func (x *NodeInfo) SetOnline() { x.m.SetState(netmap.Online) } @@ -489,6 +497,8 @@ func (x *NodeInfo) SetOnline() { // mean offline). // // See also SetOnline. +// +// Deprecated: use Status instead. func (x NodeInfo) IsOnline() bool { return x.m.GetState() == netmap.Online } @@ -498,6 +508,8 @@ func (x NodeInfo) IsOnline() bool { // state declares temporal unavailability for a node. // // See also IsMaintenance. +// +// Deprecated: use SetStatus instead. func (x *NodeInfo) SetMaintenance() { x.m.SetState(netmap.Maintenance) } @@ -507,6 +519,63 @@ func (x *NodeInfo) SetMaintenance() { // Zero NodeInfo has undefined state. // // See also SetMaintenance. +// +// Deprecated: use Status instead. func (x NodeInfo) IsMaintenance() bool { return x.m.GetState() == netmap.Maintenance } + +type NodeState netmap.NodeState + +const ( + UnspecifiedState = NodeState(netmap.UnspecifiedState) + Online = NodeState(netmap.Online) + Offline = NodeState(netmap.Offline) + Maintenance = NodeState(netmap.Maintenance) +) + +// ToV2 converts NodeState to v2. +func (ns NodeState) ToV2() netmap.NodeState { + return netmap.NodeState(ns) +} + +// FromV2 reads NodeState to v2. +func (ns *NodeState) FromV2(state netmap.NodeState) { + *ns = NodeState(state) +} + +// Status returns the current state of the node in the network map. +// +// Zero NodeInfo has an undefined state, neither online nor offline. +func (x NodeInfo) Status() NodeState { + return NodeState(x.m.GetState()) +} + +// SetState updates the state of the node in the network map. +// +// The state determines the node's current status within the network: +// - "online": Indicates the node intends to enter the network. +// - "offline": Indicates the node intends to leave the network. +// - "maintenance": Indicates the node is temporarily unavailable. +// +// See also Status. +func (x *NodeInfo) SetStatus(state NodeState) { + x.m.SetState(netmap.NodeState(state)) +} + +// String implements fmt.Stringer. +// +// String is designed to be human-readable, and its format MAY differ between +// SDK versions. +func (ns NodeState) String() string { + return netmap.NodeState(ns).String() +} + +// IsOnline checks if the current state is "online". +func (ns NodeState) IsOnline() bool { return ns == Online } + +// IsOffline checks if the current state is "offline". +func (ns NodeState) IsOffline() bool { return ns == Offline } + +// IsMaintenance checks if the current state is "maintenance". +func (ns NodeState) IsMaintenance() bool { return ns == Maintenance } diff --git a/netmap/node_info_test.go b/netmap/node_info_test.go index 1d1c018..de61a21 100644 --- a/netmap/node_info_test.go +++ b/netmap/node_info_test.go @@ -3,6 +3,7 @@ package netmap import ( "testing" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" "github.com/stretchr/testify/require" ) @@ -23,27 +24,75 @@ func TestNodeInfo_SetAttribute(t *testing.T) { require.Equal(t, val, n.Attribute(key)) } +func TestNodeState(t *testing.T) { + m := map[NodeState]netmap.NodeState{ + UnspecifiedState: netmap.UnspecifiedState, + Online: netmap.Online, + Offline: netmap.Offline, + Maintenance: netmap.Maintenance, + } + + t.Run("from sdk to v2", func(t *testing.T) { + for stateSDK, stateV2 := range m { + require.Equal(t, stateV2, stateSDK.ToV2()) + } + }) + + t.Run("from v2 to sdk", func(t *testing.T) { + for stateSDK, stateV2 := range m { + var state NodeState + state.FromV2(stateV2) + require.Equal(t, stateSDK, state) + } + }) +} + func TestNodeInfo_Status(t *testing.T) { - var n NodeInfo + t.Run("deprecated getters/setters", func(t *testing.T) { + var n NodeInfo - require.False(t, n.IsOnline()) - require.False(t, n.IsOffline()) - require.False(t, n.IsMaintenance()) + require.False(t, n.IsOnline()) + require.False(t, n.IsOffline()) + require.False(t, n.IsMaintenance()) - n.SetOnline() - require.True(t, n.IsOnline()) - require.False(t, n.IsOffline()) - require.False(t, n.IsMaintenance()) + n.SetOnline() + require.True(t, n.IsOnline()) + require.False(t, n.IsOffline()) + require.False(t, n.IsMaintenance()) - n.SetOffline() - require.True(t, n.IsOffline()) - require.False(t, n.IsOnline()) - require.False(t, n.IsMaintenance()) + n.SetOffline() + require.True(t, n.IsOffline()) + require.False(t, n.IsOnline()) + require.False(t, n.IsMaintenance()) - n.SetMaintenance() - require.True(t, n.IsMaintenance()) - require.False(t, n.IsOnline()) - require.False(t, n.IsOffline()) + n.SetMaintenance() + require.True(t, n.IsMaintenance()) + require.False(t, n.IsOnline()) + require.False(t, n.IsOffline()) + }) + + t.Run("brand new getters/setters", func(t *testing.T) { + var n NodeInfo + + require.False(t, n.Status().IsOnline()) + require.False(t, n.Status().IsOffline()) + require.False(t, n.Status().IsMaintenance()) + + n.SetStatus(Online) + require.True(t, n.Status().IsOnline()) + require.False(t, n.Status().IsOffline()) + require.False(t, n.Status().IsMaintenance()) + + n.SetStatus(Offline) + require.False(t, n.Status().IsOnline()) + require.True(t, n.Status().IsOffline()) + require.False(t, n.Status().IsMaintenance()) + + n.SetStatus(Maintenance) + require.False(t, n.Status().IsOnline()) + require.False(t, n.Status().IsOffline()) + require.True(t, n.Status().IsMaintenance()) + }) } func TestNodeInfo_ExternalAddr(t *testing.T) { From d86223ed5673b7ce21c095dde2d4b593ab21e634 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Mon, 9 Sep 2024 11:37:15 +0300 Subject: [PATCH 085/197] [#260] Makefile: Add pre-commit targets Signed-off-by: Aleksey Savchuk --- Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Makefile b/Makefile index 33ab7d5..a7c027c 100755 --- a/Makefile +++ b/Makefile @@ -77,3 +77,15 @@ help: @echo ' Targets:' @echo '' @awk '/^#/{ comment = substr($$0,3) } comment && /^[a-zA-Z][a-zA-Z0-9_-]+ ?:/{ print " ", $$1, comment }' $(MAKEFILE_LIST) | column -t -s ':' | grep -v 'IGNORE' | sort -u + +# Activate pre-commit hooks +pre-commit: + pre-commit install --hook-type pre-commit + +# Deactivate pre-commit hooks +unpre-commit: + pre-commit uninstall --hook-type pre-commit + +# Run pre-commit hooks +pre-commit-run: + @pre-commit run --all-files --hook-stage manual From 812126a8ff4c7cffad177264799e72f6da026466 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Mon, 9 Sep 2024 11:39:49 +0300 Subject: [PATCH 086/197] [#260] .golangci.yml: Add protogetter linter Signed-off-by: Aleksey Savchuk --- .golangci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.golangci.yml b/.golangci.yml index ff8989a..b6c6d67 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -63,5 +63,6 @@ linters: - funlen - gocognit - contextcheck + - protogetter disable-all: true fast: false From 7d84d104fb6088fcffc4d49c2a46b3d9f69cb130 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Mon, 9 Sep 2024 11:43:00 +0300 Subject: [PATCH 087/197] [#260] *: Fix linter warnings Signed-off-by: Aleksey Savchuk --- pool/tree/pool.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pool/tree/pool.go b/pool/tree/pool.go index 3b0ff1a..0d7c117 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -360,7 +360,7 @@ func (p *Pool) GetNodes(ctx context.Context, prm GetNodesParams) ([]*grpcService // Empty result is expected due to delayed tree service sync. // Return an error there to trigger retry and ignore it after, // to keep compatibility with 'GetNodeByPath' implementation. - if inErr == nil && len(resp.Body.Nodes) == 0 { + if inErr == nil && len(resp.GetBody().GetNodes()) == 0 { return errNodeEmptyResult } return handleError("failed to get node by path", inErr) @@ -389,7 +389,7 @@ func (x *SubTreeReader) Read(buf []*grpcService.GetSubTreeResponse_Body) (int, e } else if err != nil { return i, handleError("failed to get sub tree", err) } - buf[i] = resp.Body + buf[i] = resp.GetBody() } return len(buf), nil @@ -405,7 +405,7 @@ func (x *SubTreeReader) ReadAll() ([]*grpcService.GetSubTreeResponse_Body, error } else if err != nil { return nil, handleError("failed to get sub tree", err) } - res = append(res, resp.Body) + res = append(res, resp.GetBody()) } return res, nil @@ -421,7 +421,7 @@ func (x *SubTreeReader) Next() (*grpcService.GetSubTreeResponse_Body, error) { return nil, handleError("failed to get sub tree", err) } - return resp.Body, nil + return resp.GetBody(), nil } // GetSubTree invokes eponymous method from TreeServiceClient. @@ -535,12 +535,12 @@ func (p *Pool) AddNodeByPath(ctx context.Context, prm AddNodeByPathParams) (uint body := resp.GetBody() if body == nil { return 0, errors.New("nil body in tree service response") - } else if len(body.Nodes) == 0 { + } else if len(body.GetNodes()) == 0 { return 0, errors.New("empty list of added nodes in tree service response") } // The first node is the leaf that we add, according to tree service docs. - return body.Nodes[0], nil + return body.GetNodes()[0], nil } // MoveNode invokes eponymous method from TreeServiceClient. From f0c599d06d84002b0271e86865ac472f10203676 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Thu, 12 Sep 2024 15:09:01 +0300 Subject: [PATCH 088/197] [#268] client: Fix sequential `PayloadPatch` calls * The flag 'firstPayloadPatch' keeps its state after first `PatchPayload` that make other calls incorrectly set patch ranges. Signed-off-by: Airat Arifullin --- client/object_patch.go | 8 ++------ client/object_patch_test.go | 11 +++++------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/client/object_patch.go b/client/object_patch.go index b30bebe..7af0835 100644 --- a/client/object_patch.go +++ b/client/object_patch.go @@ -106,7 +106,6 @@ func (c *Client) ObjectPatchInit(ctx context.Context, prm PrmObjectPatch) (Objec } objectPatcher.client = c objectPatcher.stream = stream - objectPatcher.firstPatchPayload = true if prm.MaxChunkLength > 0 { objectPatcher.maxChunkLen = prm.MaxChunkLength @@ -154,8 +153,6 @@ type objectPatcher struct { respV2 v2object.PatchResponse maxChunkLen int - - firstPatchPayload bool } func (x *objectPatcher) PatchAttributes(_ context.Context, newAttrs []object.Attribute, replace bool) bool { @@ -171,7 +168,7 @@ func (x *objectPatcher) PatchPayload(_ context.Context, rng *object.Range, paylo buf := make([]byte, x.maxChunkLen) - for { + for patchIter := 0; ; patchIter++ { n, err := payloadReader.Read(buf) if err != nil && err != io.EOF { x.err = fmt.Errorf("read payload: %w", err) @@ -182,8 +179,7 @@ func (x *objectPatcher) PatchPayload(_ context.Context, rng *object.Range, paylo } rngPart := object.NewRange() - if x.firstPatchPayload { - x.firstPatchPayload = false + if patchIter == 0 { rngPart.SetOffset(offset) rngPart.SetLength(rng.GetLength()) } else { diff --git a/client/object_patch_test.go b/client/object_patch_test.go index 9c87820..2349602 100644 --- a/client/object_patch_test.go +++ b/client/object_patch_test.go @@ -170,12 +170,11 @@ func TestObjectPatcher(t *testing.T) { pk, _ := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) patcher := objectPatcher{ - client: &Client{}, - stream: m, - addr: oidtest.Address(), - key: pk, - maxChunkLen: test.maxChunkLen, - firstPatchPayload: true, + client: &Client{}, + stream: m, + addr: oidtest.Address(), + key: pk, + maxChunkLen: test.maxChunkLen, } success := patcher.PatchAttributes(context.Background(), nil, false) From d342c0bc16750d61563894c98898c9a93aca748c Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Thu, 12 Sep 2024 15:12:52 +0300 Subject: [PATCH 089/197] [#268] client: Make `PayloadPatch` correctly receive empty patch payload * Make the method `PatchPayload` send a patch with empty payload patch if range's length is non-zero and if it's the first call. * Empty payload patches just cut original object payload. So, these patches are also valid. Signed-off-by: Airat Arifullin --- client/object_patch.go | 15 +++++++ client/object_patch_test.go | 87 +++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) diff --git a/client/object_patch.go b/client/object_patch.go index 7af0835..ca7e8ed 100644 --- a/client/object_patch.go +++ b/client/object_patch.go @@ -175,6 +175,21 @@ func (x *objectPatcher) PatchPayload(_ context.Context, rng *object.Range, paylo return false } if n == 0 { + if patchIter == 0 { + if rng.GetLength() == 0 { + x.err = errors.New("zero-length empty payload patch can't be applied") + return false + } + if !x.patch(&object.Patch{ + Address: x.addr, + PayloadPatch: &object.PayloadPatch{ + Range: rng, + Chunk: []byte{}, + }, + }) { + return false + } + } break } diff --git a/client/object_patch_test.go b/client/object_patch_test.go index 2349602..839c453 100644 --- a/client/object_patch_test.go +++ b/client/object_patch_test.go @@ -193,6 +193,93 @@ func TestObjectPatcher(t *testing.T) { } } +func TestRepeatPayloadPatch(t *testing.T) { + t.Run("no payload patch partioning", func(t *testing.T) { + m := &mockPatchStream{} + + pk, _ := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + + const maxChunkLen = 20 + + patcher := objectPatcher{ + client: &Client{}, + stream: m, + addr: oidtest.Address(), + key: pk, + maxChunkLen: maxChunkLen, + } + + for _, pp := range []struct { + patchPayload string + rng *object.Range + }{ + { + patchPayload: "xxxxxxxxxx", + rng: newRange(1, 6), + }, + { + patchPayload: "yyyyyyyyyy", + rng: newRange(5, 9), + }, + { + patchPayload: "zzzzzzzzzz", + rng: newRange(10, 0), + }, + } { + success := patcher.PatchPayload(context.Background(), pp.rng, bytes.NewReader([]byte(pp.patchPayload))) + require.True(t, success) + } + + requireRangeChunk(t, m.streamedPayloadPatches[0], 1, 6, "xxxxxxxxxx") + requireRangeChunk(t, m.streamedPayloadPatches[1], 5, 9, "yyyyyyyyyy") + requireRangeChunk(t, m.streamedPayloadPatches[2], 10, 0, "zzzzzzzzzz") + }) + + t.Run("payload patch partioning", func(t *testing.T) { + m := &mockPatchStream{} + + pk, _ := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + + const maxChunkLen = 5 + + patcher := objectPatcher{ + client: &Client{}, + stream: m, + addr: oidtest.Address(), + key: pk, + maxChunkLen: maxChunkLen, + } + + for _, pp := range []struct { + patchPayload string + rng *object.Range + }{ + { + patchPayload: "xxxxxxxxxx", + rng: newRange(1, 6), + }, + { + patchPayload: "yyyyyyyyyy", + rng: newRange(5, 9), + }, + { + patchPayload: "zzzzzzzzzz", + rng: newRange(10, 0), + }, + } { + success := patcher.PatchPayload(context.Background(), pp.rng, bytes.NewReader([]byte(pp.patchPayload))) + require.True(t, success) + } + + requireRangeChunk(t, m.streamedPayloadPatches[0], 1, 6, "xxxxx") + requireRangeChunk(t, m.streamedPayloadPatches[1], 7, 0, "xxxxx") + requireRangeChunk(t, m.streamedPayloadPatches[2], 5, 9, "yyyyy") + requireRangeChunk(t, m.streamedPayloadPatches[3], 14, 0, "yyyyy") + requireRangeChunk(t, m.streamedPayloadPatches[4], 10, 0, "zzzzz") + requireRangeChunk(t, m.streamedPayloadPatches[5], 10, 0, "zzzzz") + }) +} + func requireRangeChunk(t *testing.T, pp *object.PayloadPatch, offset, length int, chunk string) { require.NotNil(t, pp) require.Equal(t, uint64(offset), pp.Range.GetOffset()) From 88c6556c379ea1f9e6c1349e66863febd9924532 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Mon, 16 Sep 2024 14:31:56 +0300 Subject: [PATCH 090/197] [#270] go.mod: Upgrade google.golang.org/grpc Signed-off-by: Dmitrii Stepanov --- go.mod | 16 ++++++++-------- go.sum | 48 ++++++++++++++++++++++++------------------------ 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/go.mod b/go.mod index 013f347..b94c266 100644 --- a/go.mod +++ b/go.mod @@ -15,8 +15,8 @@ require ( github.com/nspcc-dev/neo-go v0.106.2 github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.27.0 - google.golang.org/grpc v1.63.2 - google.golang.org/protobuf v1.33.0 + google.golang.org/grpc v1.66.2 + google.golang.org/protobuf v1.34.1 gopkg.in/yaml.v3 v3.0.1 ) @@ -39,11 +39,11 @@ require ( github.com/twmb/murmur3 v1.1.8 // indirect go.etcd.io/bbolt v1.3.9 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.24.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/net v0.23.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.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/sync v0.7.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 ) diff --git a/go.sum b/go.sum index cc07ee4..62910e1 100644 --- a/go.sum +++ b/go.sum @@ -18,8 +18,8 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= github.com/consensys/gnark-crypto v0.12.2-0.20231013160410-1f65e75b6dfb h1:f0BMgIjhZy4lSRHCXFbQst85f5agZAjtDMixQqBWNpc= @@ -122,21 +122,21 @@ go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= 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/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= -golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= -golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +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.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -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/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/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= @@ -148,33 +148,33 @@ golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +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/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= +golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/text v0.3.0/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.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= -golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= 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/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/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 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.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +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 1dc3b77ac792f876639438b827ebe99b1c9208e3 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Mon, 16 Sep 2024 14:35:24 +0300 Subject: [PATCH 091/197] [#270] pool: Replace deprecated DialContext `Healthcheck` request performed after client creation, so no extra RPC required. Signed-off-by: Dmitrii Stepanov --- pool/tree/client.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pool/tree/client.go b/pool/tree/client.go index 476026f..c6562c7 100644 --- a/pool/tree/client.go +++ b/pool/tree/client.go @@ -43,7 +43,7 @@ func (c *treeClient) dial(ctx context.Context) error { } var err error - if c.conn, c.service, err = dialClient(ctx, c.address, c.opts...); err != nil { + if c.conn, c.service, err = createClient(c.address, c.opts...); err != nil { return err } @@ -61,7 +61,7 @@ func (c *treeClient) redialIfNecessary(ctx context.Context) (healthHasChanged bo defer c.mu.Unlock() if c.conn == nil { - if c.conn, c.service, err = dialClient(ctx, c.address, c.opts...); err != nil { + if c.conn, c.service, err = createClient(c.address, c.opts...); err != nil { return false, err } } @@ -77,7 +77,7 @@ func (c *treeClient) redialIfNecessary(ctx context.Context) (healthHasChanged bo return !wasHealthy, nil } -func dialClient(ctx context.Context, addr string, clientOptions ...grpc.DialOption) (*grpc.ClientConn, grpcService.TreeServiceClient, error) { +func createClient(addr string, clientOptions ...grpc.DialOption) (*grpc.ClientConn, grpcService.TreeServiceClient, error) { host, tlsEnable, err := apiClient.ParseURI(addr) if err != nil { return nil, nil, fmt.Errorf("parse address: %w", err) @@ -93,9 +93,9 @@ func dialClient(ctx context.Context, addr string, clientOptions ...grpc.DialOpti // the order is matter, we want client to be able to overwrite options. opts := append(options, clientOptions...) - conn, err := grpc.DialContext(ctx, host, opts...) + conn, err := grpc.NewClient(host, opts...) if err != nil { - return nil, nil, fmt.Errorf("grpc dial node tree service: %w", err) + return nil, nil, fmt.Errorf("grpc create node tree service: %w", err) } return conn, grpcService.NewTreeServiceClient(conn), nil From 3e455777fd82766554b4b4a2a30c2fcff3b7834e Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Mon, 16 Sep 2024 14:45:38 +0300 Subject: [PATCH 092/197] [#270] go.mod: Upgrade api-go version 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 b94c266..f4a7b48 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.22 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240902111049-c11f50efeccb + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240916093537-13fa0da3741e git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 diff --git a/go.sum b/go.sum index 62910e1..1a7b681 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240902111049-c11f50efeccb h1:p9ByDsw+H6p6LyYSx8LKFtAG/oPKQpDVMNfjPqdevTw= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240902111049-c11f50efeccb/go.mod h1:BDnEpkKMykCS8u1nLzR6SgNzCv6885RWlo5TnravQuI= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240916093537-13fa0da3741e h1:740ABnOBYx4o6jxULHdSSnVW2fYIO35ohg+Uz59sxd0= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240916093537-13fa0da3741e/go.mod h1:F5GS7hRb62PUy5sTYDC4ajVdeffoAfjHSSHTKUJEaYU= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e h1:kcBqZBiFIUBATUqEuvVigtkJJWQ2Gug/eYXn967o3M4= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e/go.mod h1:F/fe1OoIDKr5Bz99q4sriuHDuf3aZefZy9ZsCqEtgxc= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= From 6009d089fc69c11156ff76360671c3fc2a43b5ef Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Mon, 16 Sep 2024 14:46:07 +0300 Subject: [PATCH 093/197] [#270] client: Use RPC call instead of Dial After api-go upgrade created client doesn't establish connection after created, so RPC call is required to establish and check connection. RPC call returns status error, so conversion from status error to context error is required to satisfy Dial contract and unit tests. Signed-off-by: Dmitrii Stepanov --- client/client.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/client/client.go b/client/client.go index 014b3d7..f6530de 100644 --- a/client/client.go +++ b/client/client.go @@ -11,6 +11,8 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) // Client represents virtual connection to the FrostFS network to communicate @@ -98,13 +100,21 @@ func (c *Client) Dial(ctx context.Context, prm PrmDial) error { c.setFrostFSAPIServer((*coreServer)(&c.c)) - // TODO: (neofs-api-go#382) perform generic dial stage of the client.Client _, err := rpc.Balance(&c.c, new(v2accounting.BalanceRequest), client.WithContext(ctx), ) - // return context errors since they signal about dial problem - if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) { - return err + if err != nil { + // return context errors since they signal about dial problem + if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) { + return err + } + st, ok := status.FromError(err) + if ok && st.Code() == codes.Canceled { + return context.Canceled + } + if ok && st.Code() == codes.DeadlineExceeded { + return context.DeadlineExceeded + } } return nil From 6821fe6fb23964a8c3b99dd3433fa4805994e16c Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Mon, 16 Sep 2024 14:59:30 +0300 Subject: [PATCH 094/197] [#271] object: Add `UserAttributes` method Signed-off-by: Aleksey Savchuk --- object/object.go | 23 +++++++++++++++++++++++ object/object_test.go | 25 +++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/object/object.go b/object/object.go index af16128..472e6fd 100644 --- a/object/object.go +++ b/object/object.go @@ -3,7 +3,10 @@ package object import ( "errors" "fmt" + "slices" + "strings" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" @@ -312,6 +315,26 @@ func (o *Object) Attributes() []Attribute { return res } +// UserAttributes returns object user attributes. +func (o *Object) UserAttributes() []Attribute { + attrs := (*object.Object)(o). + GetHeader(). + GetAttributes() + + res := make([]Attribute, 0, len(attrs)) + + for _, attr := range attrs { + key := attr.GetKey() + + if !strings.HasPrefix(key, container.SysAttributePrefix) && + !strings.HasPrefix(key, container.SysAttributePrefixNeoFS) { + res = append(res, *NewAttributeFromV2(&attr)) + } + } + + return slices.Clip(res) +} + // SetAttributes sets object attributes. func (o *Object) SetAttributes(v ...Attribute) { attrs := make([]object.Attribute, len(v)) diff --git a/object/object_test.go b/object/object_test.go index 5e42352..c082173 100644 --- a/object/object_test.go +++ b/object/object_test.go @@ -3,8 +3,10 @@ package object_test import ( "testing" + v2container "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" + objecttest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/test" usertest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user/test" "github.com/stretchr/testify/require" ) @@ -24,3 +26,26 @@ func TestInitCreation(t *testing.T) { require.Equal(t, cnr, cID) require.Equal(t, own, o.OwnerID()) } + +func Test_Attributes(t *testing.T) { + obj := objecttest.Object() + + t.Run("get user attributes", func(t *testing.T) { + // See how we create a test object. It's created with two attributes. + require.Len(t, obj.UserAttributes(), 2) + }) + + userAttrs := obj.UserAttributes() + + sysAttr := *object.NewAttribute() + sysAttr.SetKey(v2container.SysAttributePrefix + "key") + sysAttr.SetValue("value") + + attr := append(userAttrs, sysAttr) + obj.SetAttributes(attr...) + + t.Run("get attributes", func(t *testing.T) { + require.ElementsMatch(t, obj.UserAttributes(), userAttrs) + require.ElementsMatch(t, obj.Attributes(), attr) + }) +} From e580ee991d9887322f84cdbb9afb1440068a3f9c Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Wed, 18 Sep 2024 10:52:44 +0300 Subject: [PATCH 095/197] [#271] Drop handling of system attributes with NeoFS prefix Signed-off-by: Aleksey Savchuk --- container/container.go | 9 ++------- container/container_test.go | 2 +- object/object.go | 5 +---- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/container/container.go b/container/container.go index e2e796b..39c6259 100644 --- a/container/container.go +++ b/container/container.go @@ -356,8 +356,7 @@ func (x Container) IterateUserAttributes(f func(key, val string)) { attrs := x.v2.GetAttributes() for _, attr := range attrs { key := attr.GetKey() - if !strings.HasPrefix(key, container.SysAttributePrefix) && - !strings.HasPrefix(key, container.SysAttributePrefixNeoFS) { + if !strings.HasPrefix(key, container.SysAttributePrefix) { f(key, attr.GetValue()) } } @@ -417,8 +416,7 @@ func DisableHomomorphicHashing(cnr *Container) { // // Zero Container has enabled hashing. func IsHomomorphicHashingDisabled(cnr Container) bool { - return cnr.Attribute(container.SysAttributeHomomorphicHashing) == attributeHomoHashEnabled || - cnr.Attribute(container.SysAttributeHomomorphicHashingNeoFS) == attributeHomoHashEnabled + return cnr.Attribute(container.SysAttributeHomomorphicHashing) == attributeHomoHashEnabled } // Domain represents information about container domain registered in the NNS @@ -467,9 +465,6 @@ func ReadDomain(cnr Container) (res Domain) { if name := cnr.Attribute(container.SysAttributeName); name != "" { res.SetName(name) res.SetZone(cnr.Attribute(container.SysAttributeZone)) - } else if name = cnr.Attribute(container.SysAttributeNameNeoFS); name != "" { - res.SetName(name) - res.SetZone(cnr.Attribute(container.SysAttributeZoneNeoFS)) } return diff --git a/container/container_test.go b/container/container_test.go index d2ecf1d..c5f1b7e 100644 --- a/container/container_test.go +++ b/container/container_test.go @@ -150,7 +150,7 @@ func assertContainsAttribute(t *testing.T, m v2container.Container, key, val str } func TestContainer_Attribute(t *testing.T) { - const attrKey1, attrKey2 = v2container.SysAttributePrefix + "key1", v2container.SysAttributePrefixNeoFS + "key2" + const attrKey1, attrKey2 = v2container.SysAttributePrefix + "key1", v2container.SysAttributePrefix + "key2" const attrVal1, attrVal2 = "val1", "val2" val := containertest.Container() diff --git a/object/object.go b/object/object.go index 472e6fd..718a382 100644 --- a/object/object.go +++ b/object/object.go @@ -324,10 +324,7 @@ func (o *Object) UserAttributes() []Attribute { res := make([]Attribute, 0, len(attrs)) for _, attr := range attrs { - key := attr.GetKey() - - if !strings.HasPrefix(key, container.SysAttributePrefix) && - !strings.HasPrefix(key, container.SysAttributePrefixNeoFS) { + if !strings.HasPrefix(attr.GetKey(), container.SysAttributePrefix) { res = append(res, *NewAttributeFromV2(&attr)) } } From 114b4c14b579cd36fd0e7b94c2f88f1098f38898 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Tue, 17 Sep 2024 10:11:12 +0300 Subject: [PATCH 096/197] [#269] Makefile: Update policy target The previous policy target generated device-specific comments (e.g., `/home/john_doe/repos/<...>`), which could result in unnecessary file changes This behavior would confuse git and require manual changes to resolve. The update ensures comments are now device-agnostic, preventing unwanted changes. Signed-off-by: Aleksey Savchuk --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a7c027c..6a9bb9a 100755 --- a/Makefile +++ b/Makefile @@ -53,7 +53,8 @@ format: policy: @wget -q https://www.antlr.org/download/antlr-${ANTLR_VERSION}-complete.jar -O antlr4-tool.jar - @java -Xmx500M -cp "`pwd`/antlr4-tool.jar" "org.antlr.v4.Tool" -o `pwd`/netmap/parser/ -Dlanguage=Go -no-listener -visitor `pwd`/netmap/parser/Query.g4 `pwd`/netmap/parser/QueryLexer.g4 + @java -Xmx500M -cp antlr4-tool.jar org.antlr.v4.Tool -Dlanguage=Go \ + -no-listener -visitor netmap/parser/Query.g4 netmap/parser/QueryLexer.g4 # Run `make %` in truecloudlab/frostfs-sdk-go container(Golang+Java) docker/%: From da2f0e75328eccbf215e9b1f24c46dba936a3596 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Tue, 17 Sep 2024 10:24:47 +0300 Subject: [PATCH 097/197] [#269] .gitignore: Ignore ANTLR jar file The previous wildcard failed to properly match the ANTLR jar file. Signed-off-by: Aleksey Savchuk --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5659307..bf9e06c 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,7 @@ coverage.txt coverage.html # antlr tool jar -antlr-*.jar +antlr*.jar # tempfiles .cache From 07625e3bd1dfcb9c555ad6e9e44c1fb77226eb5e Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Tue, 17 Sep 2024 10:29:16 +0300 Subject: [PATCH 098/197] [#269] Update ANTLR version 4.13.0 -> 4.13.1 Signed-off-by: Aleksey Savchuk --- Makefile | 2 +- go.mod | 4 ++-- go.sum | 8 ++++---- netmap/parser/generate.go | 5 +++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 6a9bb9a..32b588e 100755 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ #!/usr/bin/make -f -ANTLR_VERSION="4.13.0" +ANTLR_VERSION=4.13.1 TMP_DIR := .cache LINT_VERSION ?= 1.60.1 TRUECLOUDLAB_LINT_VERSION ?= 0.0.6 diff --git a/go.mod b/go.mod index f4a7b48..eb6de13 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 - github.com/antlr4-go/antlr/v4 v4.13.0 + github.com/antlr4-go/antlr/v4 v4.13.1 github.com/google/uuid v1.6.0 github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/klauspost/reedsolomon v1.12.1 @@ -40,7 +40,7 @@ require ( go.etcd.io/bbolt v1.3.9 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.24.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect + golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect golang.org/x/net v0.26.0 // indirect golang.org/x/sync v0.7.0 // indirect golang.org/x/sys v0.21.0 // indirect diff --git a/go.sum b/go.sum index 1a7b681..54be09c 100644 --- a/go.sum +++ b/go.sum @@ -12,8 +12,8 @@ git.frostfs.info/TrueCloudLab/tzhash v1.8.0 h1:UFMnUIk0Zh17m8rjGHJMqku2hCgaXDqjq git.frostfs.info/TrueCloudLab/tzhash v1.8.0/go.mod h1:dhY+oy274hV8wGvGL4MwwMpdL3GYvaX1a8GQZQHvlF8= 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/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= -github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= @@ -124,8 +124,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= +golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= diff --git a/netmap/parser/generate.go b/netmap/parser/generate.go index 66a855b..a11c3fc 100644 --- a/netmap/parser/generate.go +++ b/netmap/parser/generate.go @@ -1,4 +1,5 @@ package parser -// ANTLR can be downloaded from https://www.antlr.org/download/antlr-4.13.0-complete.jar -//go:generate java -Xmx500M -cp "./antlr-4.13.0-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Go -no-listener -visitor QueryLexer.g4 Query.g4 +// You can download ANTLR from https://www.antlr.org/download/antlr-4.13.1-complete.jar, +// then run generate or simply run the dedicated Makefile target like this `make policy`. +//go:generate java -Xmx500M -cp "./antlr-4.13.1-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Go -no-listener -visitor QueryLexer.g4 Query.g4 From 97cf56ba415354d24ed5ddafc92ea80ba399cd93 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Tue, 17 Sep 2024 12:15:06 +0300 Subject: [PATCH 099/197] [#269] netmap: Support non-ascii attributes in `SELECT IN` Signed-off-by: Aleksey Savchuk --- netmap/parser/Query.g4 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/netmap/parser/Query.g4 b/netmap/parser/Query.g4 index 0a5b314..cbdc2bc 100644 --- a/netmap/parser/Query.g4 +++ b/netmap/parser/Query.g4 @@ -19,10 +19,10 @@ repStmt: cbfStmt: CBF BackupFactor = NUMBER1; // container backup factor selectStmt: - SELECT Count = NUMBER1 // number of nodes to select without container backup factor *) - (IN clause? Bucket = ident)? // bucket name - FROM Filter = identWC // filter reference or whole netmap - (AS Name = ident)? // optional selector name + SELECT Count = NUMBER1 // number of nodes to select without container backup factor *) + (IN clause? Bucket = filterKey)? // bucket name + FROM Filter = identWC // filter reference or whole netmap + (AS Name = ident)? // optional selector name ; clause: CLAUSE_SAME | CLAUSE_DISTINCT; // nodes from distinct buckets From e50838a33d8ba2eb96b174109867a99253b381d3 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Tue, 17 Sep 2024 12:19:33 +0300 Subject: [PATCH 100/197] [#269] netmap: Regenerate policy parser Signed-off-by: Aleksey Savchuk --- netmap/parser/Query.interp | 2 +- netmap/parser/query_base_visitor.go | 2 +- netmap/parser/query_lexer.go | 2 +- netmap/parser/query_parser.go | 53 ++++++++++++----------------- netmap/parser/query_visitor.go | 2 +- 5 files changed, 26 insertions(+), 35 deletions(-) diff --git a/netmap/parser/Query.interp b/netmap/parser/Query.interp index 3f7a9ad..6c87254 100644 --- a/netmap/parser/Query.interp +++ b/netmap/parser/Query.interp @@ -74,4 +74,4 @@ identWC atn: -[4, 1, 25, 165, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 1, 0, 3, 0, 34, 8, 0, 1, 0, 1, 0, 4, 0, 38, 8, 0, 11, 0, 12, 0, 39, 1, 0, 3, 0, 43, 8, 0, 1, 0, 5, 0, 46, 8, 0, 10, 0, 12, 0, 49, 9, 0, 1, 0, 5, 0, 52, 8, 0, 10, 0, 12, 0, 55, 9, 0, 1, 0, 1, 0, 1, 1, 3, 1, 60, 8, 1, 1, 1, 3, 1, 63, 8, 1, 1, 1, 5, 1, 66, 8, 1, 10, 1, 12, 1, 69, 9, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 79, 8, 2, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 85, 8, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 94, 8, 5, 1, 5, 3, 5, 97, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 103, 8, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 118, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 126, 8, 7, 10, 7, 12, 7, 129, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 142, 8, 9, 1, 10, 1, 10, 3, 10, 146, 8, 10, 1, 11, 1, 11, 1, 11, 3, 11, 151, 8, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 3, 14, 159, 8, 14, 1, 15, 1, 15, 3, 15, 163, 8, 15, 1, 15, 0, 1, 14, 16, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 0, 3, 1, 0, 16, 17, 1, 0, 22, 23, 3, 0, 6, 6, 8, 9, 11, 13, 172, 0, 33, 1, 0, 0, 0, 2, 59, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 80, 1, 0, 0, 0, 8, 86, 1, 0, 0, 0, 10, 89, 1, 0, 0, 0, 12, 104, 1, 0, 0, 0, 14, 117, 1, 0, 0, 0, 16, 130, 1, 0, 0, 0, 18, 141, 1, 0, 0, 0, 20, 145, 1, 0, 0, 0, 22, 150, 1, 0, 0, 0, 24, 152, 1, 0, 0, 0, 26, 154, 1, 0, 0, 0, 28, 158, 1, 0, 0, 0, 30, 162, 1, 0, 0, 0, 32, 34, 5, 5, 0, 0, 33, 32, 1, 0, 0, 0, 33, 34, 1, 0, 0, 0, 34, 37, 1, 0, 0, 0, 35, 38, 3, 6, 3, 0, 36, 38, 3, 4, 2, 0, 37, 35, 1, 0, 0, 0, 37, 36, 1, 0, 0, 0, 38, 39, 1, 0, 0, 0, 39, 37, 1, 0, 0, 0, 39, 40, 1, 0, 0, 0, 40, 42, 1, 0, 0, 0, 41, 43, 3, 8, 4, 0, 42, 41, 1, 0, 0, 0, 42, 43, 1, 0, 0, 0, 43, 47, 1, 0, 0, 0, 44, 46, 3, 10, 5, 0, 45, 44, 1, 0, 0, 0, 46, 49, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, 47, 48, 1, 0, 0, 0, 48, 53, 1, 0, 0, 0, 49, 47, 1, 0, 0, 0, 50, 52, 3, 16, 8, 0, 51, 50, 1, 0, 0, 0, 52, 55, 1, 0, 0, 0, 53, 51, 1, 0, 0, 0, 53, 54, 1, 0, 0, 0, 54, 56, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 56, 57, 5, 0, 0, 1, 57, 1, 1, 0, 0, 0, 58, 60, 3, 8, 4, 0, 59, 58, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 62, 1, 0, 0, 0, 61, 63, 3, 10, 5, 0, 62, 61, 1, 0, 0, 0, 62, 63, 1, 0, 0, 0, 63, 67, 1, 0, 0, 0, 64, 66, 3, 16, 8, 0, 65, 64, 1, 0, 0, 0, 66, 69, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 70, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 70, 71, 5, 0, 0, 1, 71, 3, 1, 0, 0, 0, 72, 73, 5, 7, 0, 0, 73, 74, 5, 22, 0, 0, 74, 75, 5, 15, 0, 0, 75, 78, 5, 22, 0, 0, 76, 77, 5, 8, 0, 0, 77, 79, 3, 28, 14, 0, 78, 76, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 79, 5, 1, 0, 0, 0, 80, 81, 5, 6, 0, 0, 81, 84, 5, 22, 0, 0, 82, 83, 5, 8, 0, 0, 83, 85, 3, 28, 14, 0, 84, 82, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 7, 1, 0, 0, 0, 86, 87, 5, 10, 0, 0, 87, 88, 5, 22, 0, 0, 88, 9, 1, 0, 0, 0, 89, 90, 5, 11, 0, 0, 90, 96, 5, 22, 0, 0, 91, 93, 5, 8, 0, 0, 92, 94, 3, 12, 6, 0, 93, 92, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 97, 3, 28, 14, 0, 96, 91, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 99, 5, 12, 0, 0, 99, 102, 3, 30, 15, 0, 100, 101, 5, 9, 0, 0, 101, 103, 3, 28, 14, 0, 102, 100, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 11, 1, 0, 0, 0, 104, 105, 7, 0, 0, 0, 105, 13, 1, 0, 0, 0, 106, 107, 6, 7, -1, 0, 107, 108, 5, 1, 0, 0, 108, 109, 5, 18, 0, 0, 109, 110, 3, 14, 7, 0, 110, 111, 5, 19, 0, 0, 111, 118, 1, 0, 0, 0, 112, 113, 5, 18, 0, 0, 113, 114, 3, 14, 7, 0, 114, 115, 5, 19, 0, 0, 115, 118, 1, 0, 0, 0, 116, 118, 3, 18, 9, 0, 117, 106, 1, 0, 0, 0, 117, 112, 1, 0, 0, 0, 117, 116, 1, 0, 0, 0, 118, 127, 1, 0, 0, 0, 119, 120, 10, 4, 0, 0, 120, 121, 5, 2, 0, 0, 121, 126, 3, 14, 7, 5, 122, 123, 10, 3, 0, 0, 123, 124, 5, 3, 0, 0, 124, 126, 3, 14, 7, 4, 125, 119, 1, 0, 0, 0, 125, 122, 1, 0, 0, 0, 126, 129, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 127, 128, 1, 0, 0, 0, 128, 15, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 130, 131, 5, 13, 0, 0, 131, 132, 3, 14, 7, 0, 132, 133, 5, 9, 0, 0, 133, 134, 3, 28, 14, 0, 134, 17, 1, 0, 0, 0, 135, 136, 5, 20, 0, 0, 136, 142, 3, 28, 14, 0, 137, 138, 3, 20, 10, 0, 138, 139, 5, 4, 0, 0, 139, 140, 3, 22, 11, 0, 140, 142, 1, 0, 0, 0, 141, 135, 1, 0, 0, 0, 141, 137, 1, 0, 0, 0, 142, 19, 1, 0, 0, 0, 143, 146, 3, 28, 14, 0, 144, 146, 5, 24, 0, 0, 145, 143, 1, 0, 0, 0, 145, 144, 1, 0, 0, 0, 146, 21, 1, 0, 0, 0, 147, 151, 3, 28, 14, 0, 148, 151, 3, 24, 12, 0, 149, 151, 5, 24, 0, 0, 150, 147, 1, 0, 0, 0, 150, 148, 1, 0, 0, 0, 150, 149, 1, 0, 0, 0, 151, 23, 1, 0, 0, 0, 152, 153, 7, 1, 0, 0, 153, 25, 1, 0, 0, 0, 154, 155, 7, 2, 0, 0, 155, 27, 1, 0, 0, 0, 156, 159, 3, 26, 13, 0, 157, 159, 5, 21, 0, 0, 158, 156, 1, 0, 0, 0, 158, 157, 1, 0, 0, 0, 159, 29, 1, 0, 0, 0, 160, 163, 3, 28, 14, 0, 161, 163, 5, 14, 0, 0, 162, 160, 1, 0, 0, 0, 162, 161, 1, 0, 0, 0, 163, 31, 1, 0, 0, 0, 22, 33, 37, 39, 42, 47, 53, 59, 62, 67, 78, 84, 93, 96, 102, 117, 125, 127, 141, 145, 150, 158, 162] \ No newline at end of file +[4, 1, 25, 165, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 1, 0, 3, 0, 34, 8, 0, 1, 0, 1, 0, 4, 0, 38, 8, 0, 11, 0, 12, 0, 39, 1, 0, 3, 0, 43, 8, 0, 1, 0, 5, 0, 46, 8, 0, 10, 0, 12, 0, 49, 9, 0, 1, 0, 5, 0, 52, 8, 0, 10, 0, 12, 0, 55, 9, 0, 1, 0, 1, 0, 1, 1, 3, 1, 60, 8, 1, 1, 1, 3, 1, 63, 8, 1, 1, 1, 5, 1, 66, 8, 1, 10, 1, 12, 1, 69, 9, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 79, 8, 2, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 85, 8, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 94, 8, 5, 1, 5, 3, 5, 97, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 103, 8, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 118, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 126, 8, 7, 10, 7, 12, 7, 129, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 142, 8, 9, 1, 10, 1, 10, 3, 10, 146, 8, 10, 1, 11, 1, 11, 1, 11, 3, 11, 151, 8, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 3, 14, 159, 8, 14, 1, 15, 1, 15, 3, 15, 163, 8, 15, 1, 15, 0, 1, 14, 16, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 0, 3, 1, 0, 16, 17, 1, 0, 22, 23, 3, 0, 6, 6, 8, 9, 11, 13, 172, 0, 33, 1, 0, 0, 0, 2, 59, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 80, 1, 0, 0, 0, 8, 86, 1, 0, 0, 0, 10, 89, 1, 0, 0, 0, 12, 104, 1, 0, 0, 0, 14, 117, 1, 0, 0, 0, 16, 130, 1, 0, 0, 0, 18, 141, 1, 0, 0, 0, 20, 145, 1, 0, 0, 0, 22, 150, 1, 0, 0, 0, 24, 152, 1, 0, 0, 0, 26, 154, 1, 0, 0, 0, 28, 158, 1, 0, 0, 0, 30, 162, 1, 0, 0, 0, 32, 34, 5, 5, 0, 0, 33, 32, 1, 0, 0, 0, 33, 34, 1, 0, 0, 0, 34, 37, 1, 0, 0, 0, 35, 38, 3, 6, 3, 0, 36, 38, 3, 4, 2, 0, 37, 35, 1, 0, 0, 0, 37, 36, 1, 0, 0, 0, 38, 39, 1, 0, 0, 0, 39, 37, 1, 0, 0, 0, 39, 40, 1, 0, 0, 0, 40, 42, 1, 0, 0, 0, 41, 43, 3, 8, 4, 0, 42, 41, 1, 0, 0, 0, 42, 43, 1, 0, 0, 0, 43, 47, 1, 0, 0, 0, 44, 46, 3, 10, 5, 0, 45, 44, 1, 0, 0, 0, 46, 49, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, 47, 48, 1, 0, 0, 0, 48, 53, 1, 0, 0, 0, 49, 47, 1, 0, 0, 0, 50, 52, 3, 16, 8, 0, 51, 50, 1, 0, 0, 0, 52, 55, 1, 0, 0, 0, 53, 51, 1, 0, 0, 0, 53, 54, 1, 0, 0, 0, 54, 56, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 56, 57, 5, 0, 0, 1, 57, 1, 1, 0, 0, 0, 58, 60, 3, 8, 4, 0, 59, 58, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 62, 1, 0, 0, 0, 61, 63, 3, 10, 5, 0, 62, 61, 1, 0, 0, 0, 62, 63, 1, 0, 0, 0, 63, 67, 1, 0, 0, 0, 64, 66, 3, 16, 8, 0, 65, 64, 1, 0, 0, 0, 66, 69, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 70, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 70, 71, 5, 0, 0, 1, 71, 3, 1, 0, 0, 0, 72, 73, 5, 7, 0, 0, 73, 74, 5, 22, 0, 0, 74, 75, 5, 15, 0, 0, 75, 78, 5, 22, 0, 0, 76, 77, 5, 8, 0, 0, 77, 79, 3, 28, 14, 0, 78, 76, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 79, 5, 1, 0, 0, 0, 80, 81, 5, 6, 0, 0, 81, 84, 5, 22, 0, 0, 82, 83, 5, 8, 0, 0, 83, 85, 3, 28, 14, 0, 84, 82, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 7, 1, 0, 0, 0, 86, 87, 5, 10, 0, 0, 87, 88, 5, 22, 0, 0, 88, 9, 1, 0, 0, 0, 89, 90, 5, 11, 0, 0, 90, 96, 5, 22, 0, 0, 91, 93, 5, 8, 0, 0, 92, 94, 3, 12, 6, 0, 93, 92, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 97, 3, 20, 10, 0, 96, 91, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 99, 5, 12, 0, 0, 99, 102, 3, 30, 15, 0, 100, 101, 5, 9, 0, 0, 101, 103, 3, 28, 14, 0, 102, 100, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 11, 1, 0, 0, 0, 104, 105, 7, 0, 0, 0, 105, 13, 1, 0, 0, 0, 106, 107, 6, 7, -1, 0, 107, 108, 5, 1, 0, 0, 108, 109, 5, 18, 0, 0, 109, 110, 3, 14, 7, 0, 110, 111, 5, 19, 0, 0, 111, 118, 1, 0, 0, 0, 112, 113, 5, 18, 0, 0, 113, 114, 3, 14, 7, 0, 114, 115, 5, 19, 0, 0, 115, 118, 1, 0, 0, 0, 116, 118, 3, 18, 9, 0, 117, 106, 1, 0, 0, 0, 117, 112, 1, 0, 0, 0, 117, 116, 1, 0, 0, 0, 118, 127, 1, 0, 0, 0, 119, 120, 10, 4, 0, 0, 120, 121, 5, 2, 0, 0, 121, 126, 3, 14, 7, 5, 122, 123, 10, 3, 0, 0, 123, 124, 5, 3, 0, 0, 124, 126, 3, 14, 7, 4, 125, 119, 1, 0, 0, 0, 125, 122, 1, 0, 0, 0, 126, 129, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 127, 128, 1, 0, 0, 0, 128, 15, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 130, 131, 5, 13, 0, 0, 131, 132, 3, 14, 7, 0, 132, 133, 5, 9, 0, 0, 133, 134, 3, 28, 14, 0, 134, 17, 1, 0, 0, 0, 135, 136, 5, 20, 0, 0, 136, 142, 3, 28, 14, 0, 137, 138, 3, 20, 10, 0, 138, 139, 5, 4, 0, 0, 139, 140, 3, 22, 11, 0, 140, 142, 1, 0, 0, 0, 141, 135, 1, 0, 0, 0, 141, 137, 1, 0, 0, 0, 142, 19, 1, 0, 0, 0, 143, 146, 3, 28, 14, 0, 144, 146, 5, 24, 0, 0, 145, 143, 1, 0, 0, 0, 145, 144, 1, 0, 0, 0, 146, 21, 1, 0, 0, 0, 147, 151, 3, 28, 14, 0, 148, 151, 3, 24, 12, 0, 149, 151, 5, 24, 0, 0, 150, 147, 1, 0, 0, 0, 150, 148, 1, 0, 0, 0, 150, 149, 1, 0, 0, 0, 151, 23, 1, 0, 0, 0, 152, 153, 7, 1, 0, 0, 153, 25, 1, 0, 0, 0, 154, 155, 7, 2, 0, 0, 155, 27, 1, 0, 0, 0, 156, 159, 3, 26, 13, 0, 157, 159, 5, 21, 0, 0, 158, 156, 1, 0, 0, 0, 158, 157, 1, 0, 0, 0, 159, 29, 1, 0, 0, 0, 160, 163, 3, 28, 14, 0, 161, 163, 5, 14, 0, 0, 162, 160, 1, 0, 0, 0, 162, 161, 1, 0, 0, 0, 163, 31, 1, 0, 0, 0, 22, 33, 37, 39, 42, 47, 53, 59, 62, 67, 78, 84, 93, 96, 102, 117, 125, 127, 141, 145, 150, 158, 162] \ No newline at end of file diff --git a/netmap/parser/query_base_visitor.go b/netmap/parser/query_base_visitor.go index 5816dfe..7fd0bd9 100644 --- a/netmap/parser/query_base_visitor.go +++ b/netmap/parser/query_base_visitor.go @@ -1,4 +1,4 @@ -// Code generated from /repo/frostfs/sdk-go/netmap/parser/Query.g4 by ANTLR 4.13.0. DO NOT EDIT. +// Code generated from netmap/parser/Query.g4 by ANTLR 4.13.1. DO NOT EDIT. package parser // Query diff --git a/netmap/parser/query_lexer.go b/netmap/parser/query_lexer.go index 43fc173..a392d4c 100644 --- a/netmap/parser/query_lexer.go +++ b/netmap/parser/query_lexer.go @@ -1,4 +1,4 @@ -// Code generated from /repo/frostfs/sdk-go/netmap/parser/QueryLexer.g4 by ANTLR 4.13.0. DO NOT EDIT. +// Code generated from netmap/parser/QueryLexer.g4 by ANTLR 4.13.1. DO NOT EDIT. package parser diff --git a/netmap/parser/query_parser.go b/netmap/parser/query_parser.go index 33f1cf0..9ea64ff 100644 --- a/netmap/parser/query_parser.go +++ b/netmap/parser/query_parser.go @@ -1,4 +1,4 @@ -// Code generated from /repo/frostfs/sdk-go/netmap/parser/Query.g4 by ANTLR 4.13.0. DO NOT EDIT. +// Code generated from netmap/parser/Query.g4 by ANTLR 4.13.1. DO NOT EDIT. package parser // Query @@ -93,7 +93,7 @@ func queryParserInit() { 85, 1, 0, 0, 0, 85, 7, 1, 0, 0, 0, 86, 87, 5, 10, 0, 0, 87, 88, 5, 22, 0, 0, 88, 9, 1, 0, 0, 0, 89, 90, 5, 11, 0, 0, 90, 96, 5, 22, 0, 0, 91, 93, 5, 8, 0, 0, 92, 94, 3, 12, 6, 0, 93, 92, 1, 0, 0, 0, 93, 94, 1, 0, - 0, 0, 94, 95, 1, 0, 0, 0, 95, 97, 3, 28, 14, 0, 96, 91, 1, 0, 0, 0, 96, + 0, 0, 94, 95, 1, 0, 0, 0, 95, 97, 3, 20, 10, 0, 96, 91, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 99, 5, 12, 0, 0, 99, 102, 3, 30, 15, 0, 100, 101, 5, 9, 0, 0, 101, 103, 3, 28, 14, 0, 102, 100, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 11, 1, 0, 0, 0, 104, 105, 7, 0, 0, 0, 105, @@ -1364,7 +1364,7 @@ type ISelectStmtContext interface { SetCount(antlr.Token) // GetBucket returns the Bucket rule contexts. - GetBucket() IIdentContext + GetBucket() IFilterKeyContext // GetFilter returns the Filter rule contexts. GetFilter() IIdentWCContext @@ -1373,7 +1373,7 @@ type ISelectStmtContext interface { GetName() IIdentContext // SetBucket sets the Bucket rule contexts. - SetBucket(IIdentContext) + SetBucket(IFilterKeyContext) // SetFilter sets the Filter rule contexts. SetFilter(IIdentWCContext) @@ -1388,8 +1388,8 @@ type ISelectStmtContext interface { IdentWC() IIdentWCContext IN() antlr.TerminalNode AS() antlr.TerminalNode - AllIdent() []IIdentContext - Ident(i int) IIdentContext + FilterKey() IFilterKeyContext + Ident() IIdentContext Clause() IClauseContext // IsSelectStmtContext differentiates from other interfaces. @@ -1400,7 +1400,7 @@ type SelectStmtContext struct { antlr.BaseParserRuleContext parser antlr.Parser Count antlr.Token - Bucket IIdentContext + Bucket IFilterKeyContext Filter IIdentWCContext Name IIdentContext } @@ -1436,13 +1436,13 @@ func (s *SelectStmtContext) GetCount() antlr.Token { return s.Count } func (s *SelectStmtContext) SetCount(v antlr.Token) { s.Count = v } -func (s *SelectStmtContext) GetBucket() IIdentContext { return s.Bucket } +func (s *SelectStmtContext) GetBucket() IFilterKeyContext { return s.Bucket } func (s *SelectStmtContext) GetFilter() IIdentWCContext { return s.Filter } func (s *SelectStmtContext) GetName() IIdentContext { return s.Name } -func (s *SelectStmtContext) SetBucket(v IIdentContext) { s.Bucket = v } +func (s *SelectStmtContext) SetBucket(v IFilterKeyContext) { s.Bucket = v } func (s *SelectStmtContext) SetFilter(v IIdentWCContext) { s.Filter = v } @@ -1484,37 +1484,28 @@ func (s *SelectStmtContext) AS() antlr.TerminalNode { return s.GetToken(QueryAS, 0) } -func (s *SelectStmtContext) AllIdent() []IIdentContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IIdentContext); ok { - len++ +func (s *SelectStmtContext) FilterKey() IFilterKeyContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFilterKeyContext); ok { + t = ctx.(antlr.RuleContext) + break } } - tst := make([]IIdentContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IIdentContext); ok { - tst[i] = t.(IIdentContext) - i++ - } + if t == nil { + return nil } - return tst + return t.(IFilterKeyContext) } -func (s *SelectStmtContext) Ident(i int) IIdentContext { +func (s *SelectStmtContext) Ident() IIdentContext { var t antlr.RuleContext - j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IIdentContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ + t = ctx.(antlr.RuleContext) + break } } @@ -1617,7 +1608,7 @@ func (p *Query) SelectStmt() (localctx ISelectStmtContext) { { p.SetState(95) - var _x = p.Ident() + var _x = p.FilterKey() localctx.(*SelectStmtContext).Bucket = _x } diff --git a/netmap/parser/query_visitor.go b/netmap/parser/query_visitor.go index c251e90..559f416 100644 --- a/netmap/parser/query_visitor.go +++ b/netmap/parser/query_visitor.go @@ -1,4 +1,4 @@ -// Code generated from /repo/frostfs/sdk-go/netmap/parser/Query.g4 by ANTLR 4.13.0. DO NOT EDIT. +// Code generated from netmap/parser/Query.g4 by ANTLR 4.13.1. DO NOT EDIT. package parser // Query From 99d5bf913bfff2bc2d304a6ca2645ad5ac6777cc Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Tue, 17 Sep 2024 17:32:56 +0300 Subject: [PATCH 101/197] [#269] netmap: Add tests for non-ascii attributes in `SELECT IN` Signed-off-by: Aleksey Savchuk --- netmap/policy_test.go | 12 ++++++++ netmap/selector_test.go | 62 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) diff --git a/netmap/policy_test.go b/netmap/policy_test.go index 7c639c6..bf0c03b 100644 --- a/netmap/policy_test.go +++ b/netmap/policy_test.go @@ -82,6 +82,13 @@ CBF 1 SELECT 1 FROM Color FILTER (Color EQ Red OR Color EQ Blue OR Color EQ Yellow) AND Color NE Green AS Color`, }, + { + name: "non-ascii attributes in SELECT IN", + input: `REP 1 +CBF 1 +SELECT 1 IN SAME 'Цвет' FROM Colorful +FILTER 'Цвет' EQ 'Красный' OR 'Цвет' EQ 'Синий' AS Colorful`, + }, } for _, tc := range testCases { @@ -127,6 +134,11 @@ func TestDecodeSelectFilterExpr(t *testing.T) { SELECT 1 FROM R FILTER Color LIKE 'R' AS R `, + ` + CBF 1 + SELECT 1 IN SAME 'Цвет' FROM Colorful + FILTER 'Цвет' EQ 'Красный' OR 'Цвет' EQ 'Синий' AS Colorful + `, } { _, err := DecodeSelectFilterString(s) require.NoError(t, err) diff --git a/netmap/selector_test.go b/netmap/selector_test.go index 2d54987..6ef5883 100644 --- a/netmap/selector_test.go +++ b/netmap/selector_test.go @@ -6,6 +6,7 @@ import ( "encoding/binary" "fmt" mrand "math/rand" + "reflect" "slices" "strconv" "strings" @@ -13,6 +14,7 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" "git.frostfs.info/TrueCloudLab/hrw" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -542,6 +544,66 @@ func TestPlacementPolicy_ProcessSelectorsExceptForNodes(t *testing.T) { } } +func TestPlacementPolicy_NonAsciiAttributes(t *testing.T) { + p := newPlacementPolicy( + 1, + []ReplicaDescriptor{ + newReplica(2, "Nodes"), + newReplica(2, "Nodes"), + }, + []Selector{ + newSelector("Nodes", "Цвет", 2, "Colorful", (*Selector).SelectSame), + }, + []Filter{ + newFilter("Colorful", "", "", netmap.OR, + newFilter("", "Цвет", "Красный", netmap.EQ), + newFilter("", "Цвет", "Синий", netmap.EQ), + ), + }, + ) + p.SetUnique(true) + + nodes := []NodeInfo{ + nodeInfoFromAttributes("Цвет", "Красный", "Форма", "Треугольник"), + nodeInfoFromAttributes("Цвет", "Красный", "Форма", "Круг"), + nodeInfoFromAttributes("Цвет", "Синий", "Форма", "Треугольник"), + nodeInfoFromAttributes("Цвет", "Синий", "Форма", "Круг"), + nodeInfoFromAttributes("Свойство", "Мягкий", "Форма", "Треугольник"), + nodeInfoFromAttributes("Свойство", "Теплый", "Форма", "Круг"), + } + for i := range nodes { + nodes[i].SetPublicKey([]byte{byte(i)}) + } + + redNodes := nodes[:2] + blueNodes := nodes[2:4] + + var nm NetMap + nm.SetNodes(nodes) + + pivot := make([]byte, 42) + _, _ = rand.Read(pivot) + + nodesPerReplica, err := nm.ContainerNodes(p, pivot) + require.NoError(t, err) + require.Len(t, nodesPerReplica, 2) + + for i := range nodesPerReplica { + slices.SortFunc(nodesPerReplica[i], func(n1, n2 NodeInfo) int { + pk1, pk2 := string(n1.PublicKey()), string(n2.PublicKey()) + return cmp.Compare(pk1, pk2) + }) + } + + redMatchFirst := reflect.DeepEqual(redNodes, nodesPerReplica[0]) + blueMatchFirst := reflect.DeepEqual(blueNodes, nodesPerReplica[0]) + + redMatchSecond := reflect.DeepEqual(redNodes, nodesPerReplica[1]) + blueMatchSecond := reflect.DeepEqual(blueNodes, nodesPerReplica[1]) + + assert.True(t, redMatchFirst && blueMatchSecond || blueMatchFirst && redMatchSecond) +} + func TestSelector_SetName(t *testing.T) { const name = "some name" var s Selector From 1b67ab9608482f2f862fb582cd2570949ef83528 Mon Sep 17 00:00:00 2001 From: Marina Biryukova Date: Tue, 24 Sep 2024 16:31:56 +0300 Subject: [PATCH 102/197] [#275] client: Return status from all methods Since status is checked first in handleError method, it should be returned from client methods Signed-off-by: Marina Biryukova --- client/apemanager_list_chains.go | 2 +- client/netmap.go | 8 ++------ client/object_delete.go | 8 ++------ client/object_get.go | 8 ++------ client/object_hash.go | 8 ++------ client/object_patch.go | 8 ++------ client/object_put_raw.go | 8 ++------ client/object_put_single.go | 2 +- 8 files changed, 14 insertions(+), 38 deletions(-) diff --git a/client/apemanager_list_chains.go b/client/apemanager_list_chains.go index a608f1e..a8a3e8a 100644 --- a/client/apemanager_list_chains.go +++ b/client/apemanager_list_chains.go @@ -65,7 +65,7 @@ func (c *Client) APEManagerListChains(ctx context.Context, prm PrmAPEManagerList var res ResAPEManagerListChains res.st, err = c.processResponse(resp) if err != nil || !apistatus.IsSuccessful(res.st) { - return nil, err + return &res, err } for _, ch := range resp.GetBody().GetChains() { diff --git a/client/netmap.go b/client/netmap.go index 8bedf46..a870ab2 100644 --- a/client/netmap.go +++ b/client/netmap.go @@ -239,12 +239,8 @@ func (c *Client) NetMapSnapshot(ctx context.Context, _ PrmNetMapSnapshot) (*ResN var res ResNetMapSnapshot res.st, err = c.processResponse(resp) - if err != nil { - return nil, err - } - - if !apistatus.IsSuccessful(res.st) { - return &res, nil + if err != nil || !apistatus.IsSuccessful(res.st) { + return &res, err } const fieldNetMap = "network map" diff --git a/client/object_delete.go b/client/object_delete.go index a9fe8e8..3214cff 100644 --- a/client/object_delete.go +++ b/client/object_delete.go @@ -148,12 +148,8 @@ func (c *Client) ObjectDelete(ctx context.Context, prm PrmObjectDelete) (*ResObj var res ResObjectDelete res.st, err = c.processResponse(resp) - if err != nil { - return nil, err - } - - if !apistatus.IsSuccessful(res.st) { - return &res, nil + if err != nil || !apistatus.IsSuccessful(res.st) { + return &res, err } const fieldTombstone = "tombstone" diff --git a/client/object_get.go b/client/object_get.go index 8c821de..ba4f72d 100644 --- a/client/object_get.go +++ b/client/object_get.go @@ -492,12 +492,8 @@ func (c *Client) ObjectHead(ctx context.Context, prm PrmObjectHead) (*ResObjectH var res ResObjectHead res.st, err = c.processResponse(resp) - if err != nil { - return nil, err - } - - if !apistatus.IsSuccessful(res.st) { - return &res, nil + if err != nil || !apistatus.IsSuccessful(res.st) { + return &res, err } res.idObj = *prm.ObjectID diff --git a/client/object_hash.go b/client/object_hash.go index 108e0ce..b1b9ffc 100644 --- a/client/object_hash.go +++ b/client/object_hash.go @@ -189,12 +189,8 @@ func (c *Client) ObjectHash(ctx context.Context, prm PrmObjectHash) (*ResObjectH var res ResObjectHash res.st, err = c.processResponse(resp) - if err != nil { - return nil, err - } - - if !apistatus.IsSuccessful(res.st) { - return &res, nil + if err != nil || !apistatus.IsSuccessful(res.st) { + return &res, err } res.checksums = resp.GetBody().GetHashList() diff --git a/client/object_patch.go b/client/object_patch.go index ca7e8ed..7b054db 100644 --- a/client/object_patch.go +++ b/client/object_patch.go @@ -246,12 +246,8 @@ func (x *objectPatcher) Close(_ context.Context) (*ResObjectPatch, error) { } x.res.st, x.err = x.client.processResponse(&x.respV2) - if x.err != nil { - return nil, x.err - } - - if !apistatus.IsSuccessful(x.res.st) { - return &x.res, nil + if x.err != nil || !apistatus.IsSuccessful(x.res.st) { + return &x.res, x.err } const fieldID = "ID" diff --git a/client/object_put_raw.go b/client/object_put_raw.go index c22bd05..e47c6a2 100644 --- a/client/object_put_raw.go +++ b/client/object_put_raw.go @@ -156,12 +156,8 @@ func (x *objectWriterRaw) Close(_ context.Context) (*ResObjectPut, error) { } x.res.st, x.err = x.client.processResponse(&x.respV2) - if x.err != nil { - return nil, x.err - } - - if !apistatus.IsSuccessful(x.res.st) { - return &x.res, nil + if x.err != nil || !apistatus.IsSuccessful(x.res.st) { + return &x.res, x.err } const fieldID = "ID" diff --git a/client/object_put_single.go b/client/object_put_single.go index bdef026..a2ff8a0 100644 --- a/client/object_put_single.go +++ b/client/object_put_single.go @@ -167,7 +167,7 @@ func (c *Client) ObjectPutSingle(ctx context.Context, prm PrmObjectPutSingle) (* var res ResObjectPutSingle res.st, err = c.processResponse(resp) if err != nil { - return nil, err + return &res, err } res.epoch = resp.GetMetaHeader().GetEpoch() From b9092aeb0cdc94193d1a002a341649a567636411 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Wed, 2 Oct 2024 11:07:19 +0300 Subject: [PATCH 103/197] [#274] go.mod: Update api-go Signed-off-by: Aleksey Savchuk --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index eb6de13..788de4a 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.22 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240916093537-13fa0da3741e + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20241002064811-3e705a3cbe84 git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 diff --git a/go.sum b/go.sum index 54be09c..bf04bf0 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240916093537-13fa0da3741e h1:740ABnOBYx4o6jxULHdSSnVW2fYIO35ohg+Uz59sxd0= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240916093537-13fa0da3741e/go.mod h1:F5GS7hRb62PUy5sTYDC4ajVdeffoAfjHSSHTKUJEaYU= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20241002064811-3e705a3cbe84 h1:enycv8Uaji5Ic1+hk+F4BpYOQKV5U5t8A9CV8AmU2+M= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20241002064811-3e705a3cbe84/go.mod h1:F5GS7hRb62PUy5sTYDC4ajVdeffoAfjHSSHTKUJEaYU= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e h1:kcBqZBiFIUBATUqEuvVigtkJJWQ2Gug/eYXn967o3M4= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e/go.mod h1:F/fe1OoIDKr5Bz99q4sriuHDuf3aZefZy9ZsCqEtgxc= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= From d00892f4188f558bb8cadde78ac4e1c6756e2e65 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Wed, 2 Oct 2024 11:12:49 +0300 Subject: [PATCH 104/197] [#274] client/status: Support INVALID_ARGUMENT status Signed-off-by: Aleksey Savchuk --- client/status/common.go | 58 ++++++++++++++++++++++++++++++++++++ client/status/common_test.go | 39 ++++++++++++++++++++++++ client/status/v2.go | 25 ++++++++++++++-- client/status/v2_test.go | 6 ++++ pool/pool_test.go | 6 ++-- 5 files changed, 128 insertions(+), 6 deletions(-) diff --git a/client/status/common.go b/client/status/common.go index af0dc8e..598631b 100644 --- a/client/status/common.go +++ b/client/status/common.go @@ -238,3 +238,61 @@ func (x *NodeUnderMaintenance) SetMessage(v string) { func (x NodeUnderMaintenance) Message() string { return x.v2.Message() } + +// InvalidArgument describes failure status related to invalid argument. +// Instances provide Status and StatusV2 interfaces. +type InvalidArgument struct { + v2 status.Status +} + +const defaultInvalidArgumentMsg = "argument is invalid" + +// Error implements the error interface. +func (x *InvalidArgument) Error() string { + msg := x.v2.Message() + if msg == "" { + msg = defaultInvalidArgumentMsg + } + + return errMessageStatusV2( + globalizeCodeV2(status.InvalidArgument, status.GlobalizeCommonFail), + msg, + ) +} + +// implements local interface defined in FromStatusV2 func. +func (x *InvalidArgument) fromStatusV2(st *status.Status) { + x.v2 = *st +} + +// ToStatusV2 implements StatusV2 interface method. +// If the value was returned by FromStatusV2, returns the source message. +// Otherwise, returns message with +// - code: INVALID_ARGUMENT; +// - string message: written message via SetMessage or +// "argument is invalid" as a default message; +// - details: empty. +func (x InvalidArgument) ToStatusV2() *status.Status { + x.v2.SetCode(globalizeCodeV2(status.InvalidArgument, status.GlobalizeCommonFail)) + if x.v2.Message() == "" { + x.v2.SetMessage(defaultInvalidArgumentMsg) + } + + return &x.v2 +} + +// SetMessage writes invalid argument failure message. +// Message should be used for debug purposes only. +// +// See also Message. +func (x *InvalidArgument) SetMessage(v string) { + x.v2.SetMessage(v) +} + +// Message returns status message. Zero status returns empty message. +// Message should be used for debug purposes only. +// +// See also SetMessage. +func (x InvalidArgument) Message() string { + return x.v2.Message() +} diff --git a/client/status/common_test.go b/client/status/common_test.go index d66b5b5..61125d9 100644 --- a/client/status/common_test.go +++ b/client/status/common_test.go @@ -128,3 +128,42 @@ func TestNodeUnderMaintenance(t *testing.T) { require.Equal(t, msg, stV2.Message()) }) } + +func TestInvalidArgument(t *testing.T) { + t.Run("default", func(t *testing.T) { + var st apistatus.InvalidArgument + + require.Empty(t, st.Message()) + }) + + t.Run("custom message", func(t *testing.T) { + var st apistatus.InvalidArgument + msg := "some message" + + st.SetMessage(msg) + + stV2 := st.ToStatusV2() + + require.Equal(t, msg, st.Message()) + require.Equal(t, msg, stV2.Message()) + }) + + t.Run("empty to V2", func(t *testing.T) { + var st apistatus.InvalidArgument + + stV2 := st.ToStatusV2() + + require.Equal(t, "argument is invalid", stV2.Message()) + }) + + t.Run("non-empty to V2", func(t *testing.T) { + var st apistatus.InvalidArgument + msg := "some other msg" + + st.SetMessage(msg) + + stV2 := st.ToStatusV2() + + require.Equal(t, msg, stV2.Message()) + }) +} diff --git a/client/status/v2.go b/client/status/v2.go index f5bef6a..5cee3be 100644 --- a/client/status/v2.go +++ b/client/status/v2.go @@ -33,12 +33,29 @@ type StatusV2 interface { // // Common failures: // - status.Internal: *ServerInternal; -// - status.SignatureVerificationFail: *SignatureVerification. +// - status.WrongMagicNumber: *WrongMagicNumber; +// - status.SignatureVerificationFail: *SignatureVerification; +// - status.NodeUnderMaintenance: *NodeUnderMaintenance; +// - status.InvalidArgument: *InvalidArgument. // // Object failures: // - object.StatusLocked: *ObjectLocked; -// - object.StatusLockNonRegularObject: *LockNonRegularObject. -// - object.StatusAccessDenied: *ObjectAccessDenied. +// - object.StatusLockNonRegularObject: *LockNonRegularObject; +// - object.StatusAccessDenied: *ObjectAccessDenied; +// - object.StatusNotFound: *ObjectNotFound; +// - object.StatusAlreadyRemoved: *ObjectAlreadyRemoved; +// - object.StatusOutOfRange: *ObjectOutOfRange. +// +// Container failures: +// - container.StatusNotFound: *ContainerNotFound; +// - container.StatusEACLNotFound: *EACLNotFound. +// +// Session failures: +// - session.StatusTokenNotFound: *SessionTokenNotFound; +// - session.StatusTokenExpired: *SessionTokenExpired. +// +// APE Manager failures +// - apemanager.StatusAPEManagerAccessDenied: *APEManagerAccessDenied. func FromStatusV2(st *status.Status) Status { var decoder interface { fromStatusV2(*status.Status) @@ -61,6 +78,8 @@ func FromStatusV2(st *status.Status) Status { decoder = new(SignatureVerification) case status.NodeUnderMaintenance: decoder = new(NodeUnderMaintenance) + case status.InvalidArgument: + decoder = new(InvalidArgument) } case object.LocalizeFailStatus(&code): switch code { diff --git a/client/status/v2_test.go b/client/status/v2_test.go index 2295c47..242c365 100644 --- a/client/status/v2_test.go +++ b/client/status/v2_test.go @@ -137,6 +137,12 @@ func TestToStatusV2(t *testing.T) { }), codeV2: 1027, }, + { + status: (statusConstructor)(func() apistatus.Status { + return new(apistatus.InvalidArgument) + }), + codeV2: 1028, + }, } { var st apistatus.Status diff --git a/pool/pool_test.go b/pool/pool_test.go index 656524a..0c61115 100644 --- a/pool/pool_test.go +++ b/pool/pool_test.go @@ -649,17 +649,17 @@ func TestHandleError(t *testing.T) { }, { ctx: ctx, - status: new(apistatus.SignatureVerification), + status: new(apistatus.NodeUnderMaintenance), err: nil, expectedError: true, countError: true, }, { ctx: ctx, - status: new(apistatus.NodeUnderMaintenance), + status: new(apistatus.InvalidArgument), err: nil, expectedError: true, - countError: true, + countError: false, }, { ctx: canceledCtx, From 7f6eda566a15e2892857bb77ff0070bfa6430048 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Wed, 2 Oct 2024 11:16:04 +0300 Subject: [PATCH 105/197] [#274] client/status: Fix check in `TestNodeUnderMaintenance` test Signed-off-by: Aleksey Savchuk --- client/status/common_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/status/common_test.go b/client/status/common_test.go index 61125d9..5a7a2b7 100644 --- a/client/status/common_test.go +++ b/client/status/common_test.go @@ -114,7 +114,7 @@ func TestNodeUnderMaintenance(t *testing.T) { stV2 := st.ToStatusV2() - require.Empty(t, "", stV2.Message()) + require.Equal(t, "node is under maintenance", stV2.Message()) }) t.Run("non-empty to V2", func(t *testing.T) { From 997346ef954f15bf0a9b3f6ee98805ee8028537b Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Wed, 2 Oct 2024 11:20:14 +0300 Subject: [PATCH 106/197] [#274] client/status: Add missing test cases for commom statuses Signed-off-by: Aleksey Savchuk --- client/status/v2_test.go | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/client/status/v2_test.go b/client/status/v2_test.go index 242c365..cecd075 100644 --- a/client/status/v2_test.go +++ b/client/status/v2_test.go @@ -61,6 +61,24 @@ func TestToStatusV2(t *testing.T) { }), codeV2: 1025, }, + { + status: (statusConstructor)(func() apistatus.Status { + return new(apistatus.SignatureVerification) + }), + codeV2: 1026, + }, + { + status: (statusConstructor)(func() apistatus.Status { + return new(apistatus.NodeUnderMaintenance) + }), + codeV2: 1027, + }, + { + status: (statusConstructor)(func() apistatus.Status { + return new(apistatus.InvalidArgument) + }), + codeV2: 1028, + }, { status: (statusConstructor)(func() apistatus.Status { return new(apistatus.ObjectLocked) @@ -131,18 +149,6 @@ func TestToStatusV2(t *testing.T) { }), codeV2: 5120, }, - { - status: (statusConstructor)(func() apistatus.Status { - return new(apistatus.NodeUnderMaintenance) - }), - codeV2: 1027, - }, - { - status: (statusConstructor)(func() apistatus.Status { - return new(apistatus.InvalidArgument) - }), - codeV2: 1028, - }, } { var st apistatus.Status From 4c310ae1c7fa0a5d95ea941e18d0dcf56fc95a08 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Mon, 7 Oct 2024 16:54:54 +0300 Subject: [PATCH 107/197] [#280] client: Use `DialTimeout` for gRPC dial After removing `grpc.Dial` from client `DialTimeout` used only if custom dialer provided. Client uses `BalanceOf` instead of `grpc.Dial`, so it is required to use `DialTimeout` to not to use RPC timeout. Signed-off-by: Dmitrii Stepanov --- client/client.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/client.go b/client/client.go index f6530de..4dd5059 100644 --- a/client/client.go +++ b/client/client.go @@ -100,6 +100,8 @@ func (c *Client) Dial(ctx context.Context, prm PrmDial) error { c.setFrostFSAPIServer((*coreServer)(&c.c)) + ctx, cancel := context.WithTimeout(ctx, prm.DialTimeout) + defer cancel() _, err := rpc.Balance(&c.c, new(v2accounting.BalanceRequest), client.WithContext(ctx), ) From 99c5c583650992659175bce9df256b4398c35ebe Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 10 Oct 2024 14:00:54 +0300 Subject: [PATCH 108/197] [#282] client: Close connection on non-nil error in Dial A particular status code does not imply that a connection has not been established. However, `Dial()` requires user to call `Close()` only if the error was nil. Thus, it is `Dial()` responsibility to close everything if it returns an error. Introduced after the gRPC update in #270 (6009d089fc69). Signed-off-by: Evgenii Stratonikov --- client/client.go | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/client/client.go b/client/client.go index 4dd5059..0894f0e 100644 --- a/client/client.go +++ b/client/client.go @@ -106,16 +106,21 @@ func (c *Client) Dial(ctx context.Context, prm PrmDial) error { client.WithContext(ctx), ) if err != nil { + var ctxErr error + // return context errors since they signal about dial problem if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) { - return err + ctxErr = err + } else if st, ok := status.FromError(err); ok && st.Code() == codes.Canceled { + ctxErr = context.Canceled + } else if ok && st.Code() == codes.DeadlineExceeded { + ctxErr = context.DeadlineExceeded } - st, ok := status.FromError(err) - if ok && st.Code() == codes.Canceled { - return context.Canceled - } - if ok && st.Code() == codes.DeadlineExceeded { - return context.DeadlineExceeded + if ctxErr != nil { + if conn := c.c.Conn(); conn != nil { + _ = conn.Close() + } + return ctxErr } } From d7872061f8595aee624d567cd929a23c182debc7 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 11 Oct 2024 15:16:48 +0300 Subject: [PATCH 109/197] [#284] go.mod: Update api-go Signed-off-by: Evgenii Stratonikov --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 788de4a..7c46916 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.22 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20241002064811-3e705a3cbe84 + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20241011114054-f0fc40e116d1 git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 diff --git a/go.sum b/go.sum index bf04bf0..20c14ae 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20241002064811-3e705a3cbe84 h1:enycv8Uaji5Ic1+hk+F4BpYOQKV5U5t8A9CV8AmU2+M= git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20241002064811-3e705a3cbe84/go.mod h1:F5GS7hRb62PUy5sTYDC4ajVdeffoAfjHSSHTKUJEaYU= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20241011114054-f0fc40e116d1 h1:ivcdxQeQDnx4srF2ezoaeVlF0FAycSAztwfIUJnUI4s= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20241011114054-f0fc40e116d1/go.mod h1:F5GS7hRb62PUy5sTYDC4ajVdeffoAfjHSSHTKUJEaYU= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e h1:kcBqZBiFIUBATUqEuvVigtkJJWQ2Gug/eYXn967o3M4= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e/go.mod h1:F/fe1OoIDKr5Bz99q4sriuHDuf3aZefZy9ZsCqEtgxc= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= From 3ea47412316ab68444bfe6032c169b9562887a38 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Wed, 16 Oct 2024 15:20:53 +0300 Subject: [PATCH 110/197] [#283] go.mod: Tidy Signed-off-by: Denis Kirillov --- go.sum | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.sum b/go.sum index 20c14ae..7451104 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,3 @@ -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20241002064811-3e705a3cbe84 h1:enycv8Uaji5Ic1+hk+F4BpYOQKV5U5t8A9CV8AmU2+M= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20241002064811-3e705a3cbe84/go.mod h1:F5GS7hRb62PUy5sTYDC4ajVdeffoAfjHSSHTKUJEaYU= git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20241011114054-f0fc40e116d1 h1:ivcdxQeQDnx4srF2ezoaeVlF0FAycSAztwfIUJnUI4s= git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20241011114054-f0fc40e116d1/go.mod h1:F5GS7hRb62PUy5sTYDC4ajVdeffoAfjHSSHTKUJEaYU= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e h1:kcBqZBiFIUBATUqEuvVigtkJJWQ2Gug/eYXn967o3M4= From 79f387317a1bbd53ae41b97bbfaad3a5fc9c8553 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Wed, 16 Oct 2024 15:22:05 +0300 Subject: [PATCH 111/197] [#283] pool: Mark node unhealthy if node is under maintenance Signed-off-by: Denis Kirillov --- pool/pool.go | 21 +++++++++++++--- pool/pool_test.go | 61 ++++++++++++++++++++++++++++++++++------------- 2 files changed, 63 insertions(+), 19 deletions(-) diff --git a/pool/pool.go b/pool/pool.go index 36d6340..950c2f7 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -1159,6 +1159,16 @@ func (c *clientStatusMonitor) incErrorRate() { } } +func (c *clientStatusMonitor) incErrorRateToUnhealthy(err error) { + c.mu.Lock() + c.currentErrorCount = 0 + c.overallErrorCount++ + c.setUnhealthy() + c.mu.Unlock() + + c.log(zapcore.WarnLevel, "explicitly mark node unhealthy", zap.String("address", c.addr), zap.Error(err)) +} + func (c *clientStatusMonitor) log(level zapcore.Level, msg string, fields ...zap.Field) { if c.logger == nil { return @@ -1225,9 +1235,10 @@ func (c *clientStatusMonitor) handleError(ctx context.Context, st apistatus.Stat switch stErr.(type) { case *apistatus.ServerInternal, *apistatus.WrongMagicNumber, - *apistatus.SignatureVerification, - *apistatus.NodeUnderMaintenance: + *apistatus.SignatureVerification: c.incErrorRate() + case *apistatus.NodeUnderMaintenance: + c.incErrorRateToUnhealthy(stErr) } if err == nil { @@ -1239,7 +1250,11 @@ func (c *clientStatusMonitor) handleError(ctx context.Context, st apistatus.Stat if err != nil { if needCountError(ctx, err) { - c.incErrorRate() + if sdkClient.IsErrNodeUnderMaintenance(err) { + c.incErrorRateToUnhealthy(err) + } else { + c.incErrorRate() + } } return err diff --git a/pool/pool_test.go b/pool/pool_test.go index 0c61115..9270faf 100644 --- a/pool/pool_test.go +++ b/pool/pool_test.go @@ -4,7 +4,6 @@ import ( "context" "crypto/ecdsa" "errors" - "strconv" "testing" "time" @@ -17,6 +16,7 @@ import ( "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "github.com/stretchr/testify/require" "go.uber.org/zap" + "go.uber.org/zap/zaptest" ) func TestBuildPoolClientFailed(t *testing.T) { @@ -562,19 +562,22 @@ func TestStatusMonitor(t *testing.T) { func TestHandleError(t *testing.T) { ctx := context.Background() - monitor := newClientStatusMonitor(zap.NewExample(), "", 10) + log := zaptest.NewLogger(t) canceledCtx, cancel := context.WithCancel(context.Background()) cancel() - for i, tc := range []struct { - ctx context.Context - status apistatus.Status - err error - expectedError bool - countError bool + for _, tc := range []struct { + name string + ctx context.Context + status apistatus.Status + err error + expectedError bool + countError bool + markedUnhealthy bool }{ { + name: "no error, no status", ctx: ctx, status: nil, err: nil, @@ -582,6 +585,7 @@ func TestHandleError(t *testing.T) { countError: false, }, { + name: "no error, success status", ctx: ctx, status: new(apistatus.SuccessDefaultV2), err: nil, @@ -589,6 +593,7 @@ func TestHandleError(t *testing.T) { countError: false, }, { + name: "error, success status", ctx: ctx, status: new(apistatus.SuccessDefaultV2), err: errors.New("error"), @@ -596,6 +601,7 @@ func TestHandleError(t *testing.T) { countError: true, }, { + name: "error, no status", ctx: ctx, status: nil, err: errors.New("error"), @@ -603,6 +609,7 @@ func TestHandleError(t *testing.T) { countError: true, }, { + name: "no error, object not found status", ctx: ctx, status: new(apistatus.ObjectNotFound), err: nil, @@ -610,6 +617,7 @@ func TestHandleError(t *testing.T) { countError: false, }, { + name: "object not found error, object not found status", ctx: ctx, status: new(apistatus.ObjectNotFound), err: &apistatus.ObjectNotFound{}, @@ -617,6 +625,7 @@ func TestHandleError(t *testing.T) { countError: false, }, { + name: "eacl not found error, no status", ctx: ctx, status: nil, err: &apistatus.EACLNotFound{}, @@ -627,6 +636,7 @@ func TestHandleError(t *testing.T) { countError: true, }, { + name: "no error, internal status", ctx: ctx, status: new(apistatus.ServerInternal), err: nil, @@ -634,6 +644,7 @@ func TestHandleError(t *testing.T) { countError: true, }, { + name: "no error, wrong magic status", ctx: ctx, status: new(apistatus.WrongMagicNumber), err: nil, @@ -641,6 +652,7 @@ func TestHandleError(t *testing.T) { countError: true, }, { + name: "no error, signature verification status", ctx: ctx, status: new(apistatus.SignatureVerification), err: nil, @@ -648,13 +660,25 @@ func TestHandleError(t *testing.T) { countError: true, }, { - ctx: ctx, - status: new(apistatus.NodeUnderMaintenance), - err: nil, - expectedError: true, - countError: true, + name: "no error, maintenance status", + ctx: ctx, + status: new(apistatus.NodeUnderMaintenance), + err: nil, + expectedError: true, + countError: true, + markedUnhealthy: true, }, { + name: "maintenance error, no status", + ctx: ctx, + status: nil, + err: &apistatus.NodeUnderMaintenance{}, + expectedError: true, + countError: true, + markedUnhealthy: true, + }, + { + name: "no error, invalid argument status", ctx: ctx, status: new(apistatus.InvalidArgument), err: nil, @@ -662,6 +686,7 @@ func TestHandleError(t *testing.T) { countError: false, }, { + name: "context canceled error, no status", ctx: canceledCtx, status: nil, err: errors.New("error"), @@ -669,8 +694,9 @@ func TestHandleError(t *testing.T) { countError: false, }, } { - t.Run(strconv.Itoa(i), func(t *testing.T) { - errCount := monitor.currentErrorRate() + t.Run(tc.name, func(t *testing.T) { + monitor := newClientStatusMonitor(log, "", 10) + errCount := monitor.overallErrorRate() err := monitor.handleError(tc.ctx, tc.status, tc.err) if tc.expectedError { require.Error(t, err) @@ -680,7 +706,10 @@ func TestHandleError(t *testing.T) { if tc.countError { errCount++ } - require.Equal(t, errCount, monitor.currentErrorRate()) + require.Equal(t, errCount, monitor.overallErrorRate()) + if tc.markedUnhealthy { + require.False(t, monitor.isHealthy()) + } }) } } From 05aa3becaef2a594bf621b6b444351b0e8a1b5b5 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Thu, 17 Oct 2024 16:26:13 +0300 Subject: [PATCH 112/197] [#278] pool: Don't make maintenance node healthy in rebalance Signed-off-by: Denis Kirillov --- pool/mock_test.go | 57 ++++++++------ pool/pool.go | 139 +++++++++++++++++++++------------- pool/pool_test.go | 184 ++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 301 insertions(+), 79 deletions(-) diff --git a/pool/mock_test.go b/pool/mock_test.go index d5a635a..583b1a0 100644 --- a/pool/mock_test.go +++ b/pool/mock_test.go @@ -26,11 +26,15 @@ type mockClient struct { errorOnDial bool errorOnCreateSession bool - errorOnEndpointInfo bool + errorOnEndpointInfo error + resOnEndpointInfo netmap.NodeInfo + healthcheckFn func() errorOnNetworkInfo bool stOnGetObject apistatus.Status } +var _ client = (*mockClient)(nil) + func newMockClient(addr string, key ecdsa.PrivateKey) *mockClient { return &mockClient{ key: key, @@ -38,6 +42,16 @@ func newMockClient(addr string, key ecdsa.PrivateKey) *mockClient { } } +func newMockClientHealthy(addr string, key ecdsa.PrivateKey, healthy bool) *mockClient { + m := newMockClient(addr, key) + if healthy { + m.setHealthy() + } else { + m.setUnhealthy() + } + return m +} + func (m *mockClient) setThreshold(threshold uint32) { m.errorThreshold = threshold } @@ -47,11 +61,11 @@ func (m *mockClient) errOnCreateSession() { } func (m *mockClient) errOnEndpointInfo() { - m.errorOnEndpointInfo = true + m.errorOnEndpointInfo = errors.New("error") } func (m *mockClient) errOnNetworkInfo() { - m.errorOnEndpointInfo = true + m.errorOnEndpointInfo = errors.New("error") } func (m *mockClient) errOnDial() { @@ -94,27 +108,32 @@ func (m *mockClient) containerDelete(context.Context, PrmContainerDelete) error return nil } -func (c *mockClient) apeManagerAddChain(ctx context.Context, prm PrmAddAPEChain) error { +func (m *mockClient) apeManagerAddChain(context.Context, PrmAddAPEChain) error { return nil } -func (c *mockClient) apeManagerRemoveChain(ctx context.Context, prm PrmRemoveAPEChain) error { +func (m *mockClient) apeManagerRemoveChain(context.Context, PrmRemoveAPEChain) error { return nil } -func (c *mockClient) apeManagerListChains(ctx context.Context, prm PrmListAPEChains) ([]ape.Chain, error) { +func (m *mockClient) apeManagerListChains(context.Context, PrmListAPEChains) ([]ape.Chain, error) { return []ape.Chain{}, nil } func (m *mockClient) endpointInfo(ctx context.Context, _ prmEndpointInfo) (netmap.NodeInfo, error) { - var ni netmap.NodeInfo - - if m.errorOnEndpointInfo { - return ni, m.handleError(ctx, nil, errors.New("error")) + if m.errorOnEndpointInfo != nil { + return netmap.NodeInfo{}, m.handleError(ctx, nil, m.errorOnEndpointInfo) } - ni.SetNetworkEndpoints(m.addr) - return ni, nil + m.resOnEndpointInfo.SetNetworkEndpoints(m.addr) + return m.resOnEndpointInfo, nil +} + +func (m *mockClient) healthcheck(ctx context.Context) (netmap.NodeInfo, error) { + if m.healthcheckFn != nil { + m.healthcheckFn() + } + return m.endpointInfo(ctx, prmEndpointInfo{}) } func (m *mockClient) networkInfo(ctx context.Context, _ prmNetworkInfo) (netmap.NetworkInfo, error) { @@ -190,16 +209,12 @@ func (m *mockClient) dial(context.Context) error { return nil } -func (m *mockClient) restartIfUnhealthy(ctx context.Context) (changed bool, err error) { - _, err = m.endpointInfo(ctx, prmEndpointInfo{}) - healthy := err == nil - changed = healthy != m.isHealthy() - if healthy { - m.setHealthy() - } else { - m.setUnhealthy() +func (m *mockClient) restart(context.Context) error { + if m.errorOnDial { + return errors.New("restart dial error") } - return + + return nil } func (m *mockClient) close() error { diff --git a/pool/pool.go b/pool/pool.go index 950c2f7..4e76978 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -57,6 +57,8 @@ type client interface { apeManagerListChains(context.Context, PrmListAPEChains) ([]ape.Chain, error) // see clientWrapper.endpointInfo. endpointInfo(context.Context, prmEndpointInfo) (netmap.NodeInfo, error) + // see clientWrapper.healthcheck. + healthcheck(ctx context.Context) (netmap.NodeInfo, error) // see clientWrapper.networkInfo. networkInfo(context.Context, prmNetworkInfo) (netmap.NetworkInfo, error) // see clientWrapper.netMapSnapshot @@ -82,8 +84,8 @@ type client interface { // see clientWrapper.dial. dial(ctx context.Context) error - // see clientWrapper.restartIfUnhealthy. - restartIfUnhealthy(ctx context.Context) (bool, error) + // see clientWrapper.restart. + restart(ctx context.Context) error // see clientWrapper.close. close() error } @@ -92,10 +94,10 @@ type client interface { type clientStatus interface { // isHealthy checks if the connection can handle requests. isHealthy() bool - // isDialed checks if the connection was created. - isDialed() bool // setUnhealthy marks client as unhealthy. setUnhealthy() + // setHealthy marks client as healthy. + setHealthy() // address return address of endpoint. address() string // currentErrorRate returns current errors rate. @@ -126,15 +128,10 @@ type clientStatusMonitor struct { // values for healthy status of clientStatusMonitor. const ( - // statusUnhealthyOnDial is set when dialing to the endpoint is failed, - // so there is no connection to the endpoint, and pool should not close it - // before re-establishing connection once again. - statusUnhealthyOnDial = iota - // statusUnhealthyOnRequest is set when communication after dialing to the // endpoint is failed due to immediate or accumulated errors, connection is // available and pool should close it before re-establishing connection once again. - statusUnhealthyOnRequest + statusUnhealthyOnRequest = iota // statusHealthy is set when connection is ready to be used by the pool. statusHealthy @@ -233,6 +230,7 @@ func newClientStatusMonitor(logger *zap.Logger, addr string, errorThreshold uint type clientWrapper struct { clientMutex sync.RWMutex client *sdkClient.Client + dialed bool prm wrapperPrm clientStatusMonitor @@ -342,30 +340,17 @@ func (c *clientWrapper) dial(ctx context.Context) error { GRPCDialOptions: c.prm.dialOptions, } - if err = cl.Dial(ctx, prmDial); err != nil { - c.setUnhealthyOnDial() + err = cl.Dial(ctx, prmDial) + c.setDialed(err == nil) + if err != nil { return err } return nil } -// restartIfUnhealthy checks healthy status of client and recreate it if status is unhealthy. -// Indicating if status was changed by this function call and returns error that caused unhealthy status. -func (c *clientWrapper) restartIfUnhealthy(ctx context.Context) (changed bool, err error) { - var wasHealthy bool - if _, err = c.endpointInfo(ctx, prmEndpointInfo{}); err == nil { - return false, nil - } else if !errors.Is(err, errPoolClientUnhealthy) { - wasHealthy = true - } - - // if connection is dialed before, to avoid routine / connection leak, - // pool has to close it and then initialize once again. - if c.isDialed() { - c.scheduleGracefulClose() - } - +// restart recreates and redial inner sdk client. +func (c *clientWrapper) restart(ctx context.Context) error { var cl sdkClient.Client prmInit := sdkClient.PrmInit{ Key: c.prm.key, @@ -381,22 +366,35 @@ func (c *clientWrapper) restartIfUnhealthy(ctx context.Context) (changed bool, e GRPCDialOptions: c.prm.dialOptions, } - if err = cl.Dial(ctx, prmDial); err != nil { - c.setUnhealthyOnDial() - return wasHealthy, err + // if connection is dialed before, to avoid routine / connection leak, + // pool has to close it and then initialize once again. + if c.isDialed() { + c.scheduleGracefulClose() + } + + err := cl.Dial(ctx, prmDial) + c.setDialed(err == nil) + if err != nil { + return err } c.clientMutex.Lock() c.client = &cl c.clientMutex.Unlock() - if _, err = cl.EndpointInfo(ctx, sdkClient.PrmEndpointInfo{}); err != nil { - c.setUnhealthy() - return wasHealthy, err - } + return nil +} - c.setHealthy() - return !wasHealthy, nil +func (c *clientWrapper) isDialed() bool { + c.mu.RLock() + defer c.mu.RUnlock() + return c.dialed +} + +func (c *clientWrapper) setDialed(dialed bool) { + c.mu.Lock() + c.dialed = dialed + c.mu.Unlock() } func (c *clientWrapper) getClient() (*sdkClient.Client, error) { @@ -654,6 +652,15 @@ func (c *clientWrapper) endpointInfo(ctx context.Context, _ prmEndpointInfo) (ne return netmap.NodeInfo{}, err } + return c.endpointInfoRaw(ctx, cl) +} + +func (c *clientWrapper) healthcheck(ctx context.Context) (netmap.NodeInfo, error) { + cl := c.getClientRaw() + return c.endpointInfoRaw(ctx, cl) +} + +func (c *clientWrapper) endpointInfoRaw(ctx context.Context, cl *sdkClient.Client) (netmap.NodeInfo, error) { start := time.Now() res, err := cl.EndpointInfo(ctx, sdkClient.PrmEndpointInfo{}) c.incRequests(time.Since(start), methodEndpointInfo) @@ -1121,10 +1128,6 @@ func (c *clientStatusMonitor) isHealthy() bool { return c.healthy.Load() == statusHealthy } -func (c *clientStatusMonitor) isDialed() bool { - return c.healthy.Load() != statusUnhealthyOnDial -} - func (c *clientStatusMonitor) setHealthy() { c.healthy.Store(statusHealthy) } @@ -1133,10 +1136,6 @@ func (c *clientStatusMonitor) setUnhealthy() { c.healthy.Store(statusUnhealthyOnRequest) } -func (c *clientStatusMonitor) setUnhealthyOnDial() { - c.healthy.Store(statusUnhealthyOnDial) -} - func (c *clientStatusMonitor) address() string { return c.addr } @@ -1211,6 +1210,9 @@ func (c *clientWrapper) incRequests(elapsed time.Duration, method MethodIndex) { } func (c *clientWrapper) close() error { + if !c.isDialed() { + return nil + } if cl := c.getClientRaw(); cl != nil { return cl.Close() } @@ -2153,7 +2155,9 @@ func adjustNodeParams(nodeParams []NodeParam) ([]*nodesParam, error) { // startRebalance runs loop to monitor connection healthy status. func (p *Pool) startRebalance(ctx context.Context) { - ticker := time.NewTimer(p.rebalanceParams.clientRebalanceInterval) + ticker := time.NewTicker(p.rebalanceParams.clientRebalanceInterval) + defer ticker.Stop() + buffers := make([][]float64, len(p.rebalanceParams.nodesParams)) for i, params := range p.rebalanceParams.nodesParams { buffers[i] = make([]float64, len(params.weights)) @@ -2203,7 +2207,7 @@ func (p *Pool) updateInnerNodesHealth(ctx context.Context, i int, bufferWeights tctx, c := context.WithTimeout(ctx, options.nodeRequestTimeout) defer c() - changed, err := cli.restartIfUnhealthy(tctx) + changed, err := restartIfUnhealthy(tctx, cli) healthy := err == nil if healthy { bufferWeights[j] = options.nodesParams[i].weights[j] @@ -2234,6 +2238,43 @@ func (p *Pool) updateInnerNodesHealth(ctx context.Context, i int, bufferWeights } } +// restartIfUnhealthy checks healthy status of client and recreate it if status is unhealthy. +// Indicating if status was changed by this function call and returns error that caused unhealthy status. +func restartIfUnhealthy(ctx context.Context, c client) (changed bool, err error) { + defer func() { + if err != nil { + c.setUnhealthy() + } else { + c.setHealthy() + } + }() + + wasHealthy := c.isHealthy() + + if res, err := c.healthcheck(ctx); err == nil { + if res.Status().IsMaintenance() { + return wasHealthy, new(apistatus.NodeUnderMaintenance) + } + + return !wasHealthy, nil + } + + if err = c.restart(ctx); err != nil { + return wasHealthy, err + } + + res, err := c.healthcheck(ctx) + if err != nil { + return wasHealthy, err + } + + if res.Status().IsMaintenance() { + return wasHealthy, new(apistatus.NodeUnderMaintenance) + } + + return !wasHealthy, nil +} + func adjustWeights(weights []float64) []float64 { adjusted := make([]float64, len(weights)) sum := 0.0 @@ -3032,9 +3073,7 @@ func (p *Pool) Close() { // close all clients for _, pools := range p.innerPools { for _, cli := range pools.clients { - if cli.isDialed() { - _ = cli.close() - } + _ = cli.close() } } } diff --git a/pool/pool_test.go b/pool/pool_test.go index 9270faf..1362654 100644 --- a/pool/pool_test.go +++ b/pool/pool_test.go @@ -4,11 +4,13 @@ import ( "context" "crypto/ecdsa" "errors" + "math/rand" "testing" "time" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session" @@ -17,6 +19,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap" "go.uber.org/zap/zaptest" + "go.uber.org/zap/zaptest/observer" ) func TestBuildPoolClientFailed(t *testing.T) { @@ -230,6 +233,179 @@ func TestOneOfTwoFailed(t *testing.T) { } } +func TestUpdateNodesHealth(t *testing.T) { + ctx := context.Background() + key := newPrivateKey(t) + + for _, tc := range []struct { + name string + wasHealthy bool + willHealthy bool + prepareCli func(*mockClient) + }{ + { + name: "healthy, maintenance, unhealthy", + wasHealthy: true, + willHealthy: false, + prepareCli: func(c *mockClient) { c.resOnEndpointInfo.SetStatus(netmap.Maintenance) }, + }, + { + name: "unhealthy, maintenance, unhealthy", + wasHealthy: false, + willHealthy: false, + prepareCli: func(c *mockClient) { c.resOnEndpointInfo.SetStatus(netmap.Maintenance) }, + }, + { + name: "healthy, no error, healthy", + wasHealthy: true, + willHealthy: true, + prepareCli: func(c *mockClient) { c.resOnEndpointInfo.SetStatus(netmap.Online) }, + }, + { + name: "unhealthy, no error, healthy", + wasHealthy: false, + willHealthy: true, + prepareCli: func(c *mockClient) { c.resOnEndpointInfo.SetStatus(netmap.Online) }, + }, + { + name: "healthy, error, failed restart, unhealthy", + wasHealthy: true, + willHealthy: false, + prepareCli: func(c *mockClient) { + c.errOnEndpointInfo() + c.errorOnDial = true + }, + }, + { + name: "unhealthy, error, failed restart, unhealthy", + wasHealthy: false, + willHealthy: false, + prepareCli: func(c *mockClient) { + c.errOnEndpointInfo() + c.errorOnDial = true + }, + }, + { + name: "healthy, error, restart, error, unhealthy", + wasHealthy: true, + willHealthy: false, + prepareCli: func(c *mockClient) { c.errOnEndpointInfo() }, + }, + { + name: "unhealthy, error, restart, error, unhealthy", + wasHealthy: false, + willHealthy: false, + prepareCli: func(c *mockClient) { c.errOnEndpointInfo() }, + }, + { + name: "healthy, error, restart, maintenance, unhealthy", + wasHealthy: true, + willHealthy: false, + prepareCli: func(c *mockClient) { + healthError := true + c.healthcheckFn = func() { + if healthError { + c.errorOnEndpointInfo = errors.New("error") + } else { + c.errorOnEndpointInfo = nil + c.resOnEndpointInfo.SetStatus(netmap.Maintenance) + } + healthError = !healthError + } + }, + }, + { + name: "unhealthy, error, restart, maintenance, unhealthy", + wasHealthy: false, + willHealthy: false, + prepareCli: func(c *mockClient) { + healthError := true + c.healthcheckFn = func() { + if healthError { + c.errorOnEndpointInfo = errors.New("error") + } else { + c.errorOnEndpointInfo = nil + c.resOnEndpointInfo.SetStatus(netmap.Maintenance) + } + healthError = !healthError + } + }, + }, + { + name: "healthy, error, restart, healthy", + wasHealthy: true, + willHealthy: true, + prepareCli: func(c *mockClient) { + healthError := true + c.healthcheckFn = func() { + if healthError { + c.errorOnEndpointInfo = errors.New("error") + } else { + c.errorOnEndpointInfo = nil + } + healthError = !healthError + } + }, + }, + { + name: "unhealthy, error, restart, healthy", + wasHealthy: false, + willHealthy: true, + prepareCli: func(c *mockClient) { + healthError := true + c.healthcheckFn = func() { + if healthError { + c.errorOnEndpointInfo = errors.New("error") + } else { + c.errorOnEndpointInfo = nil + } + healthError = !healthError + } + }, + }, + } { + t.Run(tc.name, func(t *testing.T) { + cli := newMockClientHealthy("peer0", *key, tc.wasHealthy) + tc.prepareCli(cli) + p, log := newPool(t, cli) + + p.updateNodesHealth(ctx, [][]float64{{1}}) + + changed := tc.wasHealthy != tc.willHealthy + require.Equalf(t, tc.willHealthy, cli.isHealthy(), "healthy status should be: %v", tc.willHealthy) + require.Equalf(t, changed, 1 == log.Len(), "healthy status should be changed: %v", changed) + }) + } +} + +func newPool(t *testing.T, cli *mockClient) (*Pool, *observer.ObservedLogs) { + log, observedLog := getObservedLogger() + + cache, err := newCache(0) + require.NoError(t, err) + + return &Pool{ + innerPools: []*innerPool{{ + sampler: newSampler([]float64{1}, rand.NewSource(0)), + clients: []client{cli}, + }}, + cache: cache, + key: newPrivateKey(t), + closedCh: make(chan struct{}), + rebalanceParams: rebalanceParameters{ + nodesParams: []*nodesParam{{1, []string{"peer0"}, []float64{1}}}, + nodeRequestTimeout: time.Second, + clientRebalanceInterval: 200 * time.Millisecond, + }, + logger: log, + }, observedLog +} + +func getObservedLogger() (*zap.Logger, *observer.ObservedLogs) { + loggerCore, observedLog := observer.New(zap.DebugLevel) + return zap.New(loggerCore), observedLog +} + func TestTwoFailed(t *testing.T) { var clientKeys []*ecdsa.PrivateKey mockClientBuilder := func(addr string) client { @@ -529,13 +705,6 @@ func TestStatusMonitor(t *testing.T) { isHealthy bool description string }{ - { - action: func(m *clientStatusMonitor) { m.setUnhealthyOnDial() }, - status: statusUnhealthyOnDial, - isDialed: false, - isHealthy: false, - description: "set unhealthy on dial", - }, { action: func(m *clientStatusMonitor) { m.setUnhealthy() }, status: statusUnhealthyOnRequest, @@ -554,7 +723,6 @@ func TestStatusMonitor(t *testing.T) { for _, tc := range cases { tc.action(&monitor) require.Equal(t, tc.status, monitor.healthy.Load()) - require.Equal(t, tc.isDialed, monitor.isDialed()) require.Equal(t, tc.isHealthy, monitor.isHealthy()) } }) From 5361f0ecebd327163445b27ce73343390e512428 Mon Sep 17 00:00:00 2001 From: Marina Biryukova Date: Mon, 21 Oct 2024 11:59:37 +0300 Subject: [PATCH 113/197] [#279] pool: Count errors in object search Signed-off-by: Marina Biryukova --- client/object_search.go | 2 +- pool/pool.go | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/client/object_search.go b/client/object_search.go index aa02542..42018e5 100644 --- a/client/object_search.go +++ b/client/object_search.go @@ -220,7 +220,7 @@ func (x *ObjectListReader) Close() (*ResObjectSearch, error) { defer x.cancelCtxStream() if x.err != nil && !errors.Is(x.err, io.EOF) { - return nil, x.err + return &x.res, x.err } return &x.res, nil diff --git a/pool/pool.go b/pool/pool.go index 4e76978..d795af8 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -1092,7 +1092,7 @@ func (c *clientWrapper) objectSearch(ctx context.Context, prm PrmObjectSearch) ( return ResObjectSearch{}, fmt.Errorf("init object searching on client: %w", err) } - return ResObjectSearch{r: res}, nil + return ResObjectSearch{r: res, handleError: c.handleError}, nil } // sessionCreate invokes sdkClient.SessionCreate parse response status to error and return result as is. @@ -1278,7 +1278,7 @@ func needCountError(ctx context.Context, err error) bool { return false } - if errors.Is(ctx.Err(), context.Canceled) { + if ctx != nil && errors.Is(ctx.Err(), context.Canceled) { return false } @@ -2764,18 +2764,25 @@ func (p *Pool) ObjectRange(ctx context.Context, prm PrmObjectRange) (ResObjectRa // // Must be initialized using Pool.SearchObjects, any other usage is unsafe. type ResObjectSearch struct { - r *sdkClient.ObjectListReader + r *sdkClient.ObjectListReader + handleError func(context.Context, apistatus.Status, error) error } // Read reads another list of the object identifiers. func (x *ResObjectSearch) Read(buf []oid.ID) (int, error) { n, ok := x.r.Read(buf) if !ok { - _, err := x.r.Close() + res, err := x.r.Close() if err == nil { return n, io.EOF } + var status apistatus.Status + if res != nil { + status = res.Status() + } + err = x.handleError(nil, status, err) + return n, err } From 6ce73790ea89556327cc77d10ad49f5722aefe9e Mon Sep 17 00:00:00 2001 From: Pavel Pogodaev Date: Mon, 7 Oct 2024 17:20:25 +0300 Subject: [PATCH 114/197] [#276] Merge repo with frostfs-api-go Signed-off-by: Pavel Pogodaev --- .gitattributes | 3 + Makefile | 65 + accounting/decimal.go | 4 +- accounting/decimal_test.go | 2 +- accounting/doc.go | 2 +- ape/chain.go | 2 +- ape/chain_target.go | 2 +- ape/chain_target_test.go | 2 +- ape/chain_test.go | 2 +- ape/grpc/types_frostfs.pb.go | 424 + ape/grpc/types_frostfs_fuzz.go | 45 + ape/grpc/types_frostfs_test.go | 31 + api/accounting/accounting.go | 104 + api/accounting/convert.go | 178 + api/accounting/grpc/service_frostfs.pb.go | 768 ++ api/accounting/grpc/service_frostfs_fuzz.go | 45 + api/accounting/grpc/service_frostfs_test.go | 31 + api/accounting/grpc/service_grpc.pb.go | 119 + api/accounting/grpc/types_frostfs.pb.go | 204 + api/accounting/grpc/types_frostfs_fuzz.go | 26 + api/accounting/grpc/types_frostfs_test.go | 21 + api/accounting/json.go | 14 + api/accounting/marshal.go | 104 + api/accounting/message_test.go | 19 + api/accounting/test/generate.go | 64 + api/acl/bench_test.go | 51 + api/acl/convert.go | 592 ++ api/acl/filters.go | 33 + api/acl/grpc/types_frostfs.pb.go | 2184 ++++ api/acl/grpc/types_frostfs_fuzz.go | 64 + api/acl/grpc/types_frostfs_test.go | 41 + api/acl/json.go | 70 + api/acl/marshal.go | 350 + api/acl/message_test.go | 21 + api/acl/string.go | 110 + api/acl/test/generate.go | 144 + api/acl/types.go | 426 + api/ape/convert.go | 132 + api/ape/grpc/types_frostfs.pb.go | 430 + api/ape/grpc/types_frostfs_fuzz.go | 45 + api/ape/grpc/types_frostfs_test.go | 31 + api/ape/json.go | 14 + api/ape/marshal.go | 92 + api/ape/message_test.go | 15 + api/ape/string.go | 18 + api/ape/test/generate.go | 71 + api/ape/types.go | 79 + api/apemanager/convert.go | 358 + api/apemanager/grpc/service_frostfs.pb.go | 2337 ++++ api/apemanager/grpc/service_frostfs_fuzz.go | 121 + api/apemanager/grpc/service_frostfs_test.go | 71 + api/apemanager/grpc/service_grpc.pb.go | 245 + api/apemanager/marshal.go | 205 + api/apemanager/message_test.go | 26 + api/apemanager/status.go | 76 + api/apemanager/status_test.go | 30 + api/apemanager/test/generate.go | 143 + api/apemanager/types.go | 226 + api/container/attributes.go | 90 + api/container/attributes_test.go | 59 + api/container/convert.go | 764 ++ api/container/grpc/service_frostfs.pb.go | 3157 ++++++ api/container/grpc/service_frostfs_fuzz.go | 159 + api/container/grpc/service_frostfs_test.go | 91 + api/container/grpc/service_grpc.pb.go | 298 + api/container/grpc/types_frostfs.pb.go | 554 + api/container/grpc/types_frostfs_fuzz.go | 26 + api/container/grpc/types_frostfs_test.go | 21 + api/container/json.go | 22 + api/container/marshal.go | 345 + api/container/message_test.go | 36 + api/container/status.go | 33 + api/container/status_test.go | 15 + api/container/test/generate.go | 240 + api/container/types.go | 446 + api/lock/grpc/types_frostfs.pb.go | 171 + api/lock/grpc/types_frostfs_fuzz.go | 26 + api/lock/grpc/types_frostfs_test.go | 21 + api/netmap/convert.go | 916 ++ api/netmap/grpc/service_frostfs.pb.go | 2180 ++++ api/netmap/grpc/service_frostfs_fuzz.go | 121 + api/netmap/grpc/service_frostfs_test.go | 71 + api/netmap/grpc/service_grpc.pb.go | 227 + api/netmap/grpc/types_frostfs.pb.go | 2749 +++++ api/netmap/grpc/types_frostfs_fuzz.go | 159 + api/netmap/grpc/types_frostfs_test.go | 91 + api/netmap/json.go | 62 + api/netmap/marshal.go | 576 + api/netmap/message_test.go | 32 + api/netmap/string.go | 68 + api/netmap/test/generate.go | 335 + api/netmap/types.go | 783 ++ api/object/attributes.go | 187 + api/object/attributes_test.go | 89 + api/object/bench_test.go | 45 + api/object/convert.go | 2555 +++++ api/object/filters.go | 58 + api/object/grpc/service_frostfs.pb.go | 9389 +++++++++++++++++ api/object/grpc/service_frostfs_fuzz.go | 387 + api/object/grpc/service_frostfs_test.go | 211 + api/object/grpc/service_grpc.pb.go | 1159 ++ api/object/grpc/types_frostfs.pb.go | 2992 ++++++ api/object/grpc/types_frostfs_fuzz.go | 102 + api/object/grpc/types_frostfs_test.go | 61 + api/object/json.go | 94 + api/object/lock.go | 160 + api/object/lock_test.go | 26 + api/object/marshal.go | 1428 +++ api/object/message_test.go | 65 + api/object/status.go | 91 + api/object/status_test.go | 35 + api/object/string.go | 55 + api/object/test/generate.go | 766 ++ api/object/types.go | 1650 +++ api/refs/bench_test.go | 53 + api/refs/convert.go | 264 + api/refs/grpc/types_frostfs.pb.go | 1527 +++ api/refs/grpc/types_frostfs_fuzz.go | 159 + api/refs/grpc/types_frostfs_test.go | 91 + api/refs/json.go | 62 + api/refs/marshal.go | 264 + api/refs/message_test.go | 21 + api/refs/string.go | 47 + api/refs/test/generate.go | 127 + api/refs/types.go | 194 + api/rpc/accounting.go | 29 + api/rpc/apemanager.go | 60 + api/rpc/client/call_options.go | 40 + api/rpc/client/client.go | 30 + api/rpc/client/conn.go | 24 + api/rpc/client/connect.go | 72 + api/rpc/client/flows.go | 124 + api/rpc/client/init.go | 69 + api/rpc/client/options.go | 129 + api/rpc/client/options_test.go | 197 + api/rpc/client/stream_wrapper.go | 58 + api/rpc/client/util.go | 13 + api/rpc/common.go | 10 + api/rpc/common/call.go | 75 + api/rpc/common/call_test.go | 49 + api/rpc/container.go | 82 + api/rpc/grpc/init.go | 4 + api/rpc/message/encoding.go | 40 + api/rpc/message/message.go | 43 + api/rpc/message/test/message.go | 126 + api/rpc/netmap.go | 62 + api/rpc/object.go | 243 + api/rpc/session.go | 28 + api/session/convert.go | 898 ++ api/session/grpc/service_frostfs.pb.go | 866 ++ api/session/grpc/service_frostfs_fuzz.go | 45 + api/session/grpc/service_frostfs_test.go | 31 + api/session/grpc/service_grpc.pb.go | 119 + api/session/grpc/types_frostfs.pb.go | 3049 ++++++ api/session/grpc/types_frostfs_fuzz.go | 159 + api/session/grpc/types_frostfs_test.go | 91 + api/session/json.go | 86 + api/session/marshal.go | 536 + api/session/message_test.go | 27 + api/session/status.go | 32 + api/session/status_test.go | 15 + api/session/string.go | 47 + api/session/test/generate.go | 251 + api/session/types.go | 836 ++ api/session/util.go | 167 + api/session/xheaders.go | 34 + api/signature/body.go | 116 + api/signature/marshaller.go | 26 + api/signature/sign.go | 122 + api/signature/sign_test.go | 125 + api/signature/verify.go | 127 + api/status/convert.go | 95 + api/status/details.go | 8 + api/status/grpc/types_frostfs.pb.go | 694 ++ api/status/grpc/types_frostfs_fuzz.go | 26 + api/status/grpc/types_frostfs_test.go | 21 + api/status/marshal.go | 92 + api/status/message_test.go | 16 + api/status/status.go | 103 + api/status/test/codes.go | 28 + api/status/test/generate.go | 44 + api/status/types.go | 124 + api/tombstone/convert.go | 41 + api/tombstone/grpc/types_frostfs.pb.go | 264 + api/tombstone/grpc/types_frostfs_fuzz.go | 26 + api/tombstone/grpc/types_frostfs_test.go | 21 + api/tombstone/json.go | 14 + api/tombstone/marshal.go | 56 + api/tombstone/message_test.go | 15 + api/tombstone/test/generate.go | 23 + api/tombstone/types.go | 57 + api/util/pool/buffer.go | 54 + api/util/pool/marshal.go | 7 + api/util/proto/encoding/compat.go | 22 + api/util/proto/encoding/json.go | 48 + api/util/proto/encoding/proto.go | 57 + api/util/proto/marshal.go | 413 + api/util/proto/marshal_test.go | 247 + api/util/proto/test/custom/test_frostfs.pb.go | 1687 +++ api/util/proto/test/test.pb.go | 625 ++ api/util/protogen/internalgengo/file.go | 245 + api/util/protogen/internalgengo/fuzz.go | 69 + api/util/protogen/internalgengo/getter.go | 14 + api/util/protogen/internalgengo/json.go | 284 + api/util/protogen/internalgengo/options.go | 7 + api/util/protogen/internalgengo/proto.go | 202 + .../internalgengo/proto_field_type.go | 59 + .../internalgengo/proto_stable_compat.go | 124 + api/util/protogen/internalgengo/writer.go | 30 + api/util/protogen/main.go | 27 + api/util/signature/data.go | 93 + api/util/signature/options.go | 77 + api/util/signature/sign_test.go | 44 + api/util/signature/walletconnect/sign.go | 142 + api/util/signature/walletconnect/sign_test.go | 112 + bearer/bearer.go | 8 +- bearer/bearer_test.go | 4 +- checksum/checksum.go | 4 +- checksum/checksum_test.go | 2 +- checksum/example_test.go | 2 +- client/accounting.go | 12 +- client/apemanager_add_chain.go | 10 +- client/apemanager_list_chains.go | 10 +- client/apemanager_remove_chain.go | 10 +- client/api.go | 6 +- client/client.go | 8 +- client/common.go | 12 +- client/container_delete.go | 12 +- client/container_get.go | 12 +- client/container_list.go | 12 +- client/container_put.go | 12 +- client/doc.go | 4 +- client/netmap.go | 10 +- client/netmap_test.go | 6 +- client/object_delete.go | 14 +- client/object_get.go | 14 +- client/object_hash.go | 14 +- client/object_patch.go | 12 +- client/object_patch_test.go | 2 +- client/object_put.go | 2 +- client/object_put_raw.go | 12 +- client/object_put_single.go | 12 +- client/object_put_transformer.go | 2 +- client/object_search.go | 14 +- client/object_search_test.go | 6 +- client/response.go | 2 +- client/session.go | 10 +- client/status/apemanager.go | 4 +- client/status/common.go | 6 +- client/status/common_test.go | 2 +- client/status/container.go | 4 +- client/status/object.go | 4 +- client/status/session.go | 4 +- client/status/success.go | 2 +- client/status/unrecognized.go | 2 +- client/status/v2.go | 12 +- container/container.go | 8 +- container/container_test.go | 6 +- container/doc.go | 2 +- container/id/id.go | 4 +- container/id/id_test.go | 2 +- crypto/crypto_test.go | 2 +- crypto/doc.go | 2 +- crypto/ecdsa/wallet_connect.go | 2 +- crypto/signature.go | 4 +- crypto/signer.go | 2 +- eacl/enums.go | 2 +- eacl/enums_test.go | 2 +- eacl/filter.go | 2 +- eacl/filter_test.go | 2 +- eacl/record.go | 2 +- eacl/record_test.go | 2 +- eacl/table.go | 4 +- eacl/table_test.go | 2 +- eacl/target.go | 2 +- eacl/target_test.go | 2 +- go.mod | 11 +- go.sum | 4 +- netmap/context.go | 2 +- netmap/doc.go | 2 +- netmap/filter.go | 2 +- netmap/filter_test.go | 2 +- netmap/helper_test.go | 2 +- netmap/netmap.go | 4 +- netmap/netmap_test.go | 2 +- netmap/network_info.go | 4 +- netmap/network_info_test.go | 2 +- netmap/node_info.go | 4 +- netmap/node_info_test.go | 2 +- netmap/policy.go | 4 +- netmap/selector.go | 2 +- netmap/selector_test.go | 2 +- netmap/yml_unmarshal.go | 2 +- object/attribute.go | 2 +- object/attribute_test.go | 2 +- object/ecinfo.go | 4 +- object/erasure_code.go | 4 +- object/error_test.go | 4 +- object/fmt.go | 2 +- object/id/address.go | 4 +- object/id/address_test.go | 2 +- object/id/id.go | 4 +- object/id/id_test.go | 2 +- object/lock.go | 4 +- object/object.go | 8 +- object/object_test.go | 2 +- object/patch.go | 4 +- object/patch_test.go | 4 +- object/range.go | 2 +- object/range_test.go | 2 +- object/raw.go | 2 +- object/raw_test.go | 2 +- object/search.go | 2 +- object/search_test.go | 2 +- object/splitinfo.go | 4 +- object/splitinfo_test.go | 2 +- object/tombstone.go | 4 +- object/tombstone_test.go | 2 +- object/transformer/transformer.go | 2 +- object/type.go | 2 +- object/type_test.go | 2 +- pool/mock_test.go | 2 +- pool/tree/client.go | 2 +- pool/tree/service/service_frostfs.pb.go | 2 +- pool/tree/service/types_frostfs.pb.go | 2 +- prepare.sh | 39 + session/common.go | 4 +- session/container.go | 6 +- session/container_test.go | 4 +- session/doc.go | 2 +- session/object.go | 6 +- session/object_test.go | 4 +- user/doc.go | 2 +- user/id.go | 4 +- user/id_test.go | 2 +- version/version.go | 4 +- version/version_test.go | 2 +- 337 files changed, 66666 insertions(+), 283 deletions(-) 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 create mode 100644 api/accounting/accounting.go create mode 100644 api/accounting/convert.go create mode 100644 api/accounting/grpc/service_frostfs.pb.go create mode 100644 api/accounting/grpc/service_frostfs_fuzz.go create mode 100644 api/accounting/grpc/service_frostfs_test.go create mode 100644 api/accounting/grpc/service_grpc.pb.go create mode 100644 api/accounting/grpc/types_frostfs.pb.go create mode 100644 api/accounting/grpc/types_frostfs_fuzz.go create mode 100644 api/accounting/grpc/types_frostfs_test.go create mode 100644 api/accounting/json.go create mode 100644 api/accounting/marshal.go create mode 100644 api/accounting/message_test.go create mode 100644 api/accounting/test/generate.go create mode 100644 api/acl/bench_test.go create mode 100644 api/acl/convert.go create mode 100644 api/acl/filters.go create mode 100644 api/acl/grpc/types_frostfs.pb.go create mode 100644 api/acl/grpc/types_frostfs_fuzz.go create mode 100644 api/acl/grpc/types_frostfs_test.go create mode 100644 api/acl/json.go create mode 100644 api/acl/marshal.go create mode 100644 api/acl/message_test.go create mode 100644 api/acl/string.go create mode 100644 api/acl/test/generate.go create mode 100644 api/acl/types.go create mode 100644 api/ape/convert.go create mode 100644 api/ape/grpc/types_frostfs.pb.go create mode 100644 api/ape/grpc/types_frostfs_fuzz.go create mode 100644 api/ape/grpc/types_frostfs_test.go create mode 100644 api/ape/json.go create mode 100644 api/ape/marshal.go create mode 100644 api/ape/message_test.go create mode 100644 api/ape/string.go create mode 100644 api/ape/test/generate.go create mode 100644 api/ape/types.go create mode 100644 api/apemanager/convert.go create mode 100644 api/apemanager/grpc/service_frostfs.pb.go create mode 100644 api/apemanager/grpc/service_frostfs_fuzz.go create mode 100644 api/apemanager/grpc/service_frostfs_test.go create mode 100644 api/apemanager/grpc/service_grpc.pb.go create mode 100644 api/apemanager/marshal.go create mode 100644 api/apemanager/message_test.go create mode 100644 api/apemanager/status.go create mode 100644 api/apemanager/status_test.go create mode 100644 api/apemanager/test/generate.go create mode 100644 api/apemanager/types.go create mode 100644 api/container/attributes.go create mode 100644 api/container/attributes_test.go create mode 100644 api/container/convert.go create mode 100644 api/container/grpc/service_frostfs.pb.go create mode 100644 api/container/grpc/service_frostfs_fuzz.go create mode 100644 api/container/grpc/service_frostfs_test.go create mode 100644 api/container/grpc/service_grpc.pb.go create mode 100644 api/container/grpc/types_frostfs.pb.go create mode 100644 api/container/grpc/types_frostfs_fuzz.go create mode 100644 api/container/grpc/types_frostfs_test.go create mode 100644 api/container/json.go create mode 100644 api/container/marshal.go create mode 100644 api/container/message_test.go create mode 100644 api/container/status.go create mode 100644 api/container/status_test.go create mode 100644 api/container/test/generate.go create mode 100644 api/container/types.go create mode 100644 api/lock/grpc/types_frostfs.pb.go create mode 100644 api/lock/grpc/types_frostfs_fuzz.go create mode 100644 api/lock/grpc/types_frostfs_test.go create mode 100644 api/netmap/convert.go create mode 100644 api/netmap/grpc/service_frostfs.pb.go create mode 100644 api/netmap/grpc/service_frostfs_fuzz.go create mode 100644 api/netmap/grpc/service_frostfs_test.go create mode 100644 api/netmap/grpc/service_grpc.pb.go create mode 100644 api/netmap/grpc/types_frostfs.pb.go create mode 100644 api/netmap/grpc/types_frostfs_fuzz.go create mode 100644 api/netmap/grpc/types_frostfs_test.go create mode 100644 api/netmap/json.go create mode 100644 api/netmap/marshal.go create mode 100644 api/netmap/message_test.go create mode 100644 api/netmap/string.go create mode 100644 api/netmap/test/generate.go create mode 100644 api/netmap/types.go create mode 100644 api/object/attributes.go create mode 100644 api/object/attributes_test.go create mode 100644 api/object/bench_test.go create mode 100644 api/object/convert.go create mode 100644 api/object/filters.go create mode 100644 api/object/grpc/service_frostfs.pb.go create mode 100644 api/object/grpc/service_frostfs_fuzz.go create mode 100644 api/object/grpc/service_frostfs_test.go create mode 100644 api/object/grpc/service_grpc.pb.go create mode 100644 api/object/grpc/types_frostfs.pb.go create mode 100644 api/object/grpc/types_frostfs_fuzz.go create mode 100644 api/object/grpc/types_frostfs_test.go create mode 100644 api/object/json.go create mode 100644 api/object/lock.go create mode 100644 api/object/lock_test.go create mode 100644 api/object/marshal.go create mode 100644 api/object/message_test.go create mode 100644 api/object/status.go create mode 100644 api/object/status_test.go create mode 100644 api/object/string.go create mode 100644 api/object/test/generate.go create mode 100644 api/object/types.go create mode 100644 api/refs/bench_test.go create mode 100644 api/refs/convert.go create mode 100644 api/refs/grpc/types_frostfs.pb.go create mode 100644 api/refs/grpc/types_frostfs_fuzz.go create mode 100644 api/refs/grpc/types_frostfs_test.go create mode 100644 api/refs/json.go create mode 100644 api/refs/marshal.go create mode 100644 api/refs/message_test.go create mode 100644 api/refs/string.go create mode 100644 api/refs/test/generate.go create mode 100644 api/refs/types.go create mode 100644 api/rpc/accounting.go create mode 100644 api/rpc/apemanager.go create mode 100644 api/rpc/client/call_options.go create mode 100644 api/rpc/client/client.go create mode 100644 api/rpc/client/conn.go create mode 100644 api/rpc/client/connect.go create mode 100644 api/rpc/client/flows.go create mode 100644 api/rpc/client/init.go create mode 100644 api/rpc/client/options.go create mode 100644 api/rpc/client/options_test.go create mode 100644 api/rpc/client/stream_wrapper.go create mode 100644 api/rpc/client/util.go create mode 100644 api/rpc/common.go create mode 100644 api/rpc/common/call.go create mode 100644 api/rpc/common/call_test.go create mode 100644 api/rpc/container.go create mode 100644 api/rpc/grpc/init.go create mode 100644 api/rpc/message/encoding.go create mode 100644 api/rpc/message/message.go create mode 100644 api/rpc/message/test/message.go create mode 100644 api/rpc/netmap.go create mode 100644 api/rpc/object.go create mode 100644 api/rpc/session.go create mode 100644 api/session/convert.go create mode 100644 api/session/grpc/service_frostfs.pb.go create mode 100644 api/session/grpc/service_frostfs_fuzz.go create mode 100644 api/session/grpc/service_frostfs_test.go create mode 100644 api/session/grpc/service_grpc.pb.go create mode 100644 api/session/grpc/types_frostfs.pb.go create mode 100644 api/session/grpc/types_frostfs_fuzz.go create mode 100644 api/session/grpc/types_frostfs_test.go create mode 100644 api/session/json.go create mode 100644 api/session/marshal.go create mode 100644 api/session/message_test.go create mode 100644 api/session/status.go create mode 100644 api/session/status_test.go create mode 100644 api/session/string.go create mode 100644 api/session/test/generate.go create mode 100644 api/session/types.go create mode 100644 api/session/util.go create mode 100644 api/session/xheaders.go create mode 100644 api/signature/body.go create mode 100644 api/signature/marshaller.go create mode 100644 api/signature/sign.go create mode 100644 api/signature/sign_test.go create mode 100644 api/signature/verify.go create mode 100644 api/status/convert.go create mode 100644 api/status/details.go create mode 100644 api/status/grpc/types_frostfs.pb.go create mode 100644 api/status/grpc/types_frostfs_fuzz.go create mode 100644 api/status/grpc/types_frostfs_test.go create mode 100644 api/status/marshal.go create mode 100644 api/status/message_test.go create mode 100644 api/status/status.go create mode 100644 api/status/test/codes.go create mode 100644 api/status/test/generate.go create mode 100644 api/status/types.go create mode 100644 api/tombstone/convert.go create mode 100644 api/tombstone/grpc/types_frostfs.pb.go create mode 100644 api/tombstone/grpc/types_frostfs_fuzz.go create mode 100644 api/tombstone/grpc/types_frostfs_test.go create mode 100644 api/tombstone/json.go create mode 100644 api/tombstone/marshal.go create mode 100644 api/tombstone/message_test.go create mode 100644 api/tombstone/test/generate.go create mode 100644 api/tombstone/types.go create mode 100644 api/util/pool/buffer.go create mode 100644 api/util/pool/marshal.go create mode 100644 api/util/proto/encoding/compat.go create mode 100644 api/util/proto/encoding/json.go create mode 100644 api/util/proto/encoding/proto.go create mode 100644 api/util/proto/marshal.go create mode 100644 api/util/proto/marshal_test.go create mode 100644 api/util/proto/test/custom/test_frostfs.pb.go create mode 100644 api/util/proto/test/test.pb.go create mode 100644 api/util/protogen/internalgengo/file.go create mode 100644 api/util/protogen/internalgengo/fuzz.go create mode 100644 api/util/protogen/internalgengo/getter.go create mode 100644 api/util/protogen/internalgengo/json.go create mode 100644 api/util/protogen/internalgengo/options.go create mode 100644 api/util/protogen/internalgengo/proto.go create mode 100644 api/util/protogen/internalgengo/proto_field_type.go create mode 100644 api/util/protogen/internalgengo/proto_stable_compat.go create mode 100644 api/util/protogen/internalgengo/writer.go create mode 100644 api/util/protogen/main.go create mode 100644 api/util/signature/data.go create mode 100644 api/util/signature/options.go create mode 100644 api/util/signature/sign_test.go create mode 100644 api/util/signature/walletconnect/sign.go create mode 100644 api/util/signature/walletconnect/sign_test.go create mode 100755 prepare.sh diff --git a/.gitattributes b/.gitattributes index b371347..f7ff250 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,3 +2,6 @@ /pkg/policy/parser/generate.go diff **/*.interp -diff **/*.tokens -diff +/**/*.pb.go -diff -merge +/**/*.pb.go linguist-generated=true +/go.sum -diff diff --git a/Makefile b/Makefile index 32b588e..6f62f6d 100755 --- a/Makefile +++ b/Makefile @@ -7,11 +7,76 @@ TRUECLOUDLAB_LINT_VERSION ?= 0.0.6 OUTPUT_LINT_DIR ?= $(shell pwd)/bin LINT_DIR = $(OUTPUT_LINT_DIR)/golangci-lint-$(LINT_VERSION)-v$(TRUECLOUDLAB_LINT_VERSION) +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 imports protoc test lint help $(BIN)/protogen protoc-test + # Run tests test: GOFLAGS ?= "-cover -count=1" test: @GOFLAGS=$(GOFLAGS) go test ./... +# Reformat imports +imports: + @echo "⇒ Processing goimports check" + @for f in `find . -type f -name '*.go' -not -name '*.pb.go' -prune`; do \ + goimports -w $$f; \ + done + +# 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: + @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 './bin/*' -not -path './api/util/proto/test/*'`; do \ + echo "⇒ Processing $$f "; \ + $(PROTOC_DIR)/bin/protoc \ + --proto_path=.:$(PROTOC_DIR)/include:/usr/local/include \ + --plugin=protoc-gen-go-frostfs=$(abspath ./bin/protogen) \ + --go-frostfs_out=fuzz=true:. \ + --go-frostfs_opt=paths=source_relative \ + --go-grpc_opt=require_unimplemented_servers=false \ + --go-grpc_out=. --go-grpc_opt=paths=source_relative $$f; \ + done + +$(BIN)/protogen: + @go build -v -trimpath \ + -o $(BIN)/protogen \ + ./api/util/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=Mapi/util/proto/test/test.proto=git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/test/custom \ + --go-frostfs_opt=module=git.frostfs.info/TrueCloudLab/frostfs-sdk-go \ + --go-frostfs_out=. --go-frostfs_opt=paths=import \ + ./api/util/proto/test/test.proto + # Pull go dependencies dep: @printf "⇒ Download requirements: " diff --git a/accounting/decimal.go b/accounting/decimal.go index bb01f28..b6d7386 100644 --- a/accounting/decimal.go +++ b/accounting/decimal.go @@ -1,10 +1,10 @@ package accounting -import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" +import "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/accounting" // Decimal represents decimal number for accounting operations. // -// Decimal is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting.Decimal +// Decimal is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/accounting.Decimal // message. See ReadFromV2 / WriteToV2 methods. // // Instances can be created using built-in var declaration. diff --git a/accounting/decimal_test.go b/accounting/decimal_test.go index af46dd4..cdc6b69 100644 --- a/accounting/decimal_test.go +++ b/accounting/decimal_test.go @@ -3,8 +3,8 @@ package accounting_test import ( "testing" - v2accounting "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/accounting" + v2accounting "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/accounting" "github.com/stretchr/testify/require" ) diff --git a/accounting/doc.go b/accounting/doc.go index defcb0d..d5a9bfb 100644 --- a/accounting/doc.go +++ b/accounting/doc.go @@ -13,7 +13,7 @@ Instances can be also used to process FrostFS API V2 protocol messages On client side: - import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" + import "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/accounting" var msg accounting.Decimal dec.WriteToV2(&msg) diff --git a/ape/chain.go b/ape/chain.go index eae441d..5a5548d 100644 --- a/ape/chain.go +++ b/ape/chain.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - apeV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape" + apeV2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape" ) var ( diff --git a/ape/chain_target.go b/ape/chain_target.go index 13b7e87..cb63db7 100644 --- a/ape/chain_target.go +++ b/ape/chain_target.go @@ -1,7 +1,7 @@ package ape import ( - apeV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape" + apeV2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape" ) // TargetType is an SDK representation for v2's TargetType. diff --git a/ape/chain_target_test.go b/ape/chain_target_test.go index 21a11b7..e7416d1 100644 --- a/ape/chain_target_test.go +++ b/ape/chain_target_test.go @@ -6,7 +6,7 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ape" "github.com/stretchr/testify/require" - apeV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape" + apeV2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape" ) var ( diff --git a/ape/chain_test.go b/ape/chain_test.go index 83991f6..4e47fc6 100644 --- a/ape/chain_test.go +++ b/ape/chain_test.go @@ -6,7 +6,7 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ape" "github.com/stretchr/testify/require" - apeV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape" + apeV2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape" ) const ( diff --git a/ape/grpc/types_frostfs.pb.go b/ape/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..c16e867 --- /dev/null +++ b/ape/grpc/types_frostfs.pb.go @@ -0,0 +1,424 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package ape + +import ( + json "encoding/json" + fmt "fmt" + pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" +) + +type TargetType int32 + +const ( + TargetType_UNDEFINED TargetType = 0 + TargetType_NAMESPACE TargetType = 1 + TargetType_CONTAINER TargetType = 2 + TargetType_USER TargetType = 3 + TargetType_GROUP TargetType = 4 +) + +var ( + TargetType_name = map[int32]string{ + 0: "UNDEFINED", + 1: "NAMESPACE", + 2: "CONTAINER", + 3: "USER", + 4: "GROUP", + } + TargetType_value = map[string]int32{ + "UNDEFINED": 0, + "NAMESPACE": 1, + "CONTAINER": 2, + "USER": 3, + "GROUP": 4, + } +) + +func (x TargetType) String() string { + if v, ok := TargetType_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *TargetType) FromString(s string) bool { + if v, ok := TargetType_value[s]; ok { + *x = TargetType(v) + return true + } + return false +} + +type ChainTarget struct { + Type TargetType `json:"type"` + Name string `json:"name"` +} + +var ( + _ encoding.ProtoMarshaler = (*ChainTarget)(nil) + _ encoding.ProtoUnmarshaler = (*ChainTarget)(nil) + _ json.Marshaler = (*ChainTarget)(nil) + _ json.Unmarshaler = (*ChainTarget)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ChainTarget) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.EnumSize(1, int32(x.Type)) + size += proto.StringSize(2, x.Name) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ChainTarget) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *ChainTarget) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if int32(x.Type) != 0 { + mm.AppendInt32(1, int32(x.Type)) + } + if len(x.Name) != 0 { + mm.AppendString(2, x.Name) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ChainTarget) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "ChainTarget") + } + switch fc.FieldNum { + case 1: // Type + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Type") + } + x.Type = TargetType(data) + case 2: // Name + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Name") + } + x.Name = data + } + } + return nil +} +func (x *ChainTarget) GetType() TargetType { + if x != nil { + return x.Type + } + return 0 +} +func (x *ChainTarget) SetType(v TargetType) { + x.Type = v +} +func (x *ChainTarget) GetName() string { + if x != nil { + return x.Name + } + return "" +} +func (x *ChainTarget) SetName(v string) { + x.Name = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ChainTarget) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ChainTarget) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"type\":" + out.RawString(prefix) + v := int32(x.Type) + if vv, ok := TargetType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"name\":" + out.RawString(prefix) + out.String(x.Name) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ChainTarget) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ChainTarget) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "type": + { + var f TargetType + var parsedValue TargetType + switch v := in.Interface().(type) { + case string: + if vv, ok := TargetType_value[v]; ok { + parsedValue = TargetType(vv) + break + } + vv, err := strconv.ParseInt(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = TargetType(vv) + case float64: + parsedValue = TargetType(v) + } + f = parsedValue + x.Type = f + } + case "name": + { + var f string + f = in.String() + x.Name = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type Chain struct { + Kind isChain_Kind +} + +var ( + _ encoding.ProtoMarshaler = (*Chain)(nil) + _ encoding.ProtoUnmarshaler = (*Chain)(nil) + _ json.Marshaler = (*Chain)(nil) + _ json.Unmarshaler = (*Chain)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Chain) StableSize() (size int) { + if x == nil { + return 0 + } + if inner, ok := x.Kind.(*Chain_Raw); ok { + size += proto.BytesSize(1, inner.Raw) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Chain) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *Chain) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if inner, ok := x.Kind.(*Chain_Raw); ok { + if len(inner.Raw) != 0 { + mm.AppendBytes(1, inner.Raw) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Chain) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "Chain") + } + switch fc.FieldNum { + case 1: // Raw + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Raw") + } + x.Kind = &Chain_Raw{Raw: data} + } + } + return nil +} +func (x *Chain) GetKind() isChain_Kind { + if x != nil { + return x.Kind + } + return nil +} +func (x *Chain) SetKind(v isChain_Kind) { + x.Kind = v +} +func (x *Chain) GetRaw() []byte { + if xx, ok := x.GetKind().(*Chain_Raw); ok { + return xx.Raw + } + return nil +} +func (x *Chain) SetRaw(v *Chain_Raw) { + x.Kind = v +} +func (x *Chain_Raw) GetRaw() []byte { + if x != nil { + return x.Raw + } + return nil +} +func (x *Chain_Raw) SetRaw(v []byte) { + x.Raw = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Chain) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Chain) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + first := true + out.RawByte('{') + switch xx := x.Kind.(type) { + case *Chain_Raw: + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"raw\":" + out.RawString(prefix) + if xx.Raw != nil { + out.Base64Bytes(xx.Raw) + } else { + out.String("") + } + } + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Chain) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Chain) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "raw": + xx := new(Chain_Raw) + x.Kind = xx + { + var f []byte + 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/api/accounting/accounting.go b/api/accounting/accounting.go new file mode 100644 index 0000000..04603cd --- /dev/null +++ b/api/accounting/accounting.go @@ -0,0 +1,104 @@ +package accounting + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" +) + +type BalanceRequestBody struct { + ownerID *refs.OwnerID +} + +type BalanceResponseBody struct { + bal *Decimal +} + +type Decimal struct { + val int64 + + prec uint32 +} + +type BalanceRequest struct { + body *BalanceRequestBody + + session.RequestHeaders +} + +type BalanceResponse struct { + body *BalanceResponseBody + + session.ResponseHeaders +} + +func (b *BalanceRequestBody) GetOwnerID() *refs.OwnerID { + if b != nil { + return b.ownerID + } + + return nil +} + +func (b *BalanceRequestBody) SetOwnerID(v *refs.OwnerID) { + b.ownerID = v +} + +func (b *BalanceRequest) GetBody() *BalanceRequestBody { + if b != nil { + return b.body + } + + return nil +} + +func (b *BalanceRequest) SetBody(v *BalanceRequestBody) { + b.body = v +} + +func (d *Decimal) GetValue() int64 { + if d != nil { + return d.val + } + + return 0 +} + +func (d *Decimal) SetValue(v int64) { + d.val = v +} + +func (d *Decimal) GetPrecision() uint32 { + if d != nil { + return d.prec + } + + return 0 +} + +func (d *Decimal) SetPrecision(v uint32) { + d.prec = v +} + +func (br *BalanceResponseBody) GetBalance() *Decimal { + if br != nil { + return br.bal + } + + return nil +} + +func (br *BalanceResponseBody) SetBalance(v *Decimal) { + br.bal = v +} + +func (br *BalanceResponse) GetBody() *BalanceResponseBody { + if br != nil { + return br.body + } + + return nil +} + +func (br *BalanceResponse) SetBody(v *BalanceResponseBody) { + br.body = v +} diff --git a/api/accounting/convert.go b/api/accounting/convert.go new file mode 100644 index 0000000..53b7491 --- /dev/null +++ b/api/accounting/convert.go @@ -0,0 +1,178 @@ +package accounting + +import ( + accounting "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/accounting/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" +) + +func (b *BalanceRequestBody) ToGRPCMessage() grpc.Message { + var m *accounting.BalanceRequest_Body + + if b != nil { + m = new(accounting.BalanceRequest_Body) + + m.SetOwnerId(b.ownerID.ToGRPCMessage().(*refsGRPC.OwnerID)) + } + + return m +} + +func (b *BalanceRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*accounting.BalanceRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + ownerID := v.GetOwnerId() + if ownerID == nil { + b.ownerID = nil + } else { + if b.ownerID == nil { + b.ownerID = new(refs.OwnerID) + } + + err = b.ownerID.FromGRPCMessage(ownerID) + } + + return err +} + +func (b *BalanceRequest) ToGRPCMessage() grpc.Message { + var m *accounting.BalanceRequest + + if b != nil { + m = new(accounting.BalanceRequest) + + m.SetBody(b.body.ToGRPCMessage().(*accounting.BalanceRequest_Body)) + b.RequestHeaders.ToMessage(m) + } + + return m +} + +func (b *BalanceRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*accounting.BalanceRequest) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + body := v.GetBody() + if body == nil { + b.body = nil + } else { + if b.body == nil { + b.body = new(BalanceRequestBody) + } + + err = b.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return b.RequestHeaders.FromMessage(v) +} + +func (d *Decimal) ToGRPCMessage() grpc.Message { + var m *accounting.Decimal + + if d != nil { + m = new(accounting.Decimal) + + m.SetValue(d.val) + m.SetPrecision(d.prec) + } + + return m +} + +func (d *Decimal) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*accounting.Decimal) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + d.val = v.GetValue() + d.prec = v.GetPrecision() + + return nil +} + +func (br *BalanceResponseBody) ToGRPCMessage() grpc.Message { + var m *accounting.BalanceResponse_Body + + if br != nil { + m = new(accounting.BalanceResponse_Body) + + m.SetBalance(br.bal.ToGRPCMessage().(*accounting.Decimal)) + } + + return m +} + +func (br *BalanceResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*accounting.BalanceResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + bal := v.GetBalance() + if bal == nil { + br.bal = nil + } else { + if br.bal == nil { + br.bal = new(Decimal) + } + + err = br.bal.FromGRPCMessage(bal) + } + + return err +} + +func (br *BalanceResponse) ToGRPCMessage() grpc.Message { + var m *accounting.BalanceResponse + + if br != nil { + m = new(accounting.BalanceResponse) + + m.SetBody(br.body.ToGRPCMessage().(*accounting.BalanceResponse_Body)) + br.ResponseHeaders.ToMessage(m) + } + + return m +} + +func (br *BalanceResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*accounting.BalanceResponse) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + body := v.GetBody() + if body == nil { + br.body = nil + } else { + if br.body == nil { + br.body = new(BalanceResponseBody) + } + + err = br.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return br.ResponseHeaders.FromMessage(v) +} diff --git a/api/accounting/grpc/service_frostfs.pb.go b/api/accounting/grpc/service_frostfs.pb.go new file mode 100644 index 0000000..86502ef --- /dev/null +++ b/api/accounting/grpc/service_frostfs.pb.go @@ -0,0 +1,768 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package accounting + +import ( + json "encoding/json" + fmt "fmt" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" +) + +type BalanceRequest_Body struct { + OwnerId *grpc.OwnerID `json:"ownerId"` +} + +var ( + _ encoding.ProtoMarshaler = (*BalanceRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*BalanceRequest_Body)(nil) + _ json.Marshaler = (*BalanceRequest_Body)(nil) + _ json.Unmarshaler = (*BalanceRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *BalanceRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.OwnerId) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *BalanceRequest_Body) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *BalanceRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.OwnerId != nil { + x.OwnerId.EmitProtobuf(mm.AppendMessage(1)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *BalanceRequest_Body) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "BalanceRequest_Body") + } + switch fc.FieldNum { + case 1: // OwnerId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "OwnerId") + } + x.OwnerId = new(grpc.OwnerID) + if err := x.OwnerId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *BalanceRequest_Body) GetOwnerId() *grpc.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} +func (x *BalanceRequest_Body) SetOwnerId(v *grpc.OwnerID) { + x.OwnerId = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *BalanceRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *BalanceRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ownerId\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *BalanceRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *BalanceRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "ownerId": + { + var f *grpc.OwnerID + f = new(grpc.OwnerID) + f.UnmarshalEasyJSON(in) + x.OwnerId = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type BalanceRequest struct { + Body *BalanceRequest_Body `json:"body"` + MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*BalanceRequest)(nil) + _ encoding.ProtoUnmarshaler = (*BalanceRequest)(nil) + _ json.Marshaler = (*BalanceRequest)(nil) + _ json.Unmarshaler = (*BalanceRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *BalanceRequest) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.MetaHeader) + size += proto.NestedStructureSize(3, x.VerifyHeader) + return size +} + +// ReadSignedData fills buf with signed data of x. +// If buffer length is less than x.SignedDataSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same signed data. +func (x *BalanceRequest) SignedDataSize() int { + return x.GetBody().StableSize() +} + +// SignedDataSize returns size of the request signed data in bytes. +// +// Structures with the same field values have the same signed data size. +func (x *BalanceRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *BalanceRequest) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *BalanceRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *BalanceRequest) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "BalanceRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(BalanceRequest_Body) + if err := x.Body.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // MetaHeader + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "MetaHeader") + } + x.MetaHeader = new(grpc1.RequestMetaHeader) + if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // VerifyHeader + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader") + } + x.VerifyHeader = new(grpc1.RequestVerificationHeader) + if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *BalanceRequest) GetBody() *BalanceRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *BalanceRequest) SetBody(v *BalanceRequest_Body) { + x.Body = v +} +func (x *BalanceRequest) GetMetaHeader() *grpc1.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *BalanceRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *BalanceRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *BalanceRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *BalanceRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *BalanceRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *BalanceRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *BalanceRequest) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "body": + { + var f *BalanceRequest_Body + f = new(BalanceRequest_Body) + f.UnmarshalEasyJSON(in) + x.Body = f + } + case "metaHeader": + { + var f *grpc1.RequestMetaHeader + f = new(grpc1.RequestMetaHeader) + f.UnmarshalEasyJSON(in) + x.MetaHeader = f + } + case "verifyHeader": + { + var f *grpc1.RequestVerificationHeader + f = new(grpc1.RequestVerificationHeader) + f.UnmarshalEasyJSON(in) + x.VerifyHeader = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type BalanceResponse_Body struct { + Balance *Decimal `json:"balance"` +} + +var ( + _ encoding.ProtoMarshaler = (*BalanceResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*BalanceResponse_Body)(nil) + _ json.Marshaler = (*BalanceResponse_Body)(nil) + _ json.Unmarshaler = (*BalanceResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *BalanceResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Balance) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *BalanceResponse_Body) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *BalanceResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Balance != nil { + x.Balance.EmitProtobuf(mm.AppendMessage(1)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *BalanceResponse_Body) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "BalanceResponse_Body") + } + switch fc.FieldNum { + case 1: // Balance + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Balance") + } + x.Balance = new(Decimal) + if err := x.Balance.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *BalanceResponse_Body) GetBalance() *Decimal { + if x != nil { + return x.Balance + } + return nil +} +func (x *BalanceResponse_Body) SetBalance(v *Decimal) { + x.Balance = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *BalanceResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *BalanceResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"balance\":" + out.RawString(prefix) + x.Balance.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *BalanceResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *BalanceResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "balance": + { + var f *Decimal + f = new(Decimal) + f.UnmarshalEasyJSON(in) + x.Balance = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type BalanceResponse struct { + Body *BalanceResponse_Body `json:"body"` + MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*BalanceResponse)(nil) + _ encoding.ProtoUnmarshaler = (*BalanceResponse)(nil) + _ json.Marshaler = (*BalanceResponse)(nil) + _ json.Unmarshaler = (*BalanceResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *BalanceResponse) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.MetaHeader) + size += proto.NestedStructureSize(3, x.VerifyHeader) + return size +} + +// ReadSignedData fills buf with signed data of x. +// If buffer length is less than x.SignedDataSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same signed data. +func (x *BalanceResponse) SignedDataSize() int { + return x.GetBody().StableSize() +} + +// SignedDataSize returns size of the request signed data in bytes. +// +// Structures with the same field values have the same signed data size. +func (x *BalanceResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *BalanceResponse) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *BalanceResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *BalanceResponse) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "BalanceResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(BalanceResponse_Body) + if err := x.Body.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // MetaHeader + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "MetaHeader") + } + x.MetaHeader = new(grpc1.ResponseMetaHeader) + if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // VerifyHeader + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader") + } + x.VerifyHeader = new(grpc1.ResponseVerificationHeader) + if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *BalanceResponse) GetBody() *BalanceResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *BalanceResponse) SetBody(v *BalanceResponse_Body) { + x.Body = v +} +func (x *BalanceResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *BalanceResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *BalanceResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *BalanceResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *BalanceResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *BalanceResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *BalanceResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *BalanceResponse) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "body": + { + var f *BalanceResponse_Body + f = new(BalanceResponse_Body) + f.UnmarshalEasyJSON(in) + x.Body = f + } + case "metaHeader": + { + var f *grpc1.ResponseMetaHeader + f = new(grpc1.ResponseMetaHeader) + f.UnmarshalEasyJSON(in) + x.MetaHeader = f + } + case "verifyHeader": + { + var f *grpc1.ResponseVerificationHeader + f = new(grpc1.ResponseVerificationHeader) + f.UnmarshalEasyJSON(in) + x.VerifyHeader = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/api/accounting/grpc/service_frostfs_fuzz.go b/api/accounting/grpc/service_frostfs_fuzz.go new file mode 100644 index 0000000..69e7174 --- /dev/null +++ b/api/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/api/accounting/grpc/service_frostfs_test.go b/api/accounting/grpc/service_frostfs_test.go new file mode 100644 index 0000000..b97a13e --- /dev/null +++ b/api/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/api/accounting/grpc/service_grpc.pb.go b/api/accounting/grpc/service_grpc.pb.go new file mode 100644 index 0000000..c3a2c61 --- /dev/null +++ b/api/accounting/grpc/service_grpc.pb.go @@ -0,0 +1,119 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v5.27.2 +// source: api/accounting/grpc/service.proto + +package accounting + +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 ( + 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. +type AccountingServiceClient interface { + // Returns the amount of funds in GAS token for the requested FrostFS account. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // balance has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). + Balance(ctx context.Context, in *BalanceRequest, opts ...grpc.CallOption) (*BalanceResponse, error) +} + +type accountingServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAccountingServiceClient(cc grpc.ClientConnInterface) AccountingServiceClient { + return &accountingServiceClient{cc} +} + +func (c *accountingServiceClient) Balance(ctx context.Context, in *BalanceRequest, opts ...grpc.CallOption) (*BalanceResponse, error) { + out := new(BalanceResponse) + err := c.cc.Invoke(ctx, AccountingService_Balance_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AccountingServiceServer is the server API for AccountingService service. +// All implementations should embed UnimplementedAccountingServiceServer +// for forward compatibility +type AccountingServiceServer interface { + // Returns the amount of funds in GAS token for the requested FrostFS account. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // balance has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). + Balance(context.Context, *BalanceRequest) (*BalanceResponse, error) +} + +// UnimplementedAccountingServiceServer should be embedded to have forward compatible implementations. +type UnimplementedAccountingServiceServer struct { +} + +func (UnimplementedAccountingServiceServer) Balance(context.Context, *BalanceRequest) (*BalanceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Balance not implemented") +} + +// UnsafeAccountingServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AccountingServiceServer will +// result in compilation errors. +type UnsafeAccountingServiceServer interface { + mustEmbedUnimplementedAccountingServiceServer() +} + +func RegisterAccountingServiceServer(s grpc.ServiceRegistrar, srv AccountingServiceServer) { + s.RegisterService(&AccountingService_ServiceDesc, srv) +} + +func _AccountingService_Balance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BalanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountingServiceServer).Balance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AccountingService_Balance_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountingServiceServer).Balance(ctx, req.(*BalanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AccountingService_ServiceDesc is the grpc.ServiceDesc for AccountingService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AccountingService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "neo.fs.v2.accounting.AccountingService", + HandlerType: (*AccountingServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Balance", + Handler: _AccountingService_Balance_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/accounting/grpc/service.proto", +} diff --git a/api/accounting/grpc/types_frostfs.pb.go b/api/accounting/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..9d0e9ea --- /dev/null +++ b/api/accounting/grpc/types_frostfs.pb.go @@ -0,0 +1,204 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package accounting + +import ( + json "encoding/json" + fmt "fmt" + pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" +) + +type Decimal struct { + Value int64 `json:"value"` + Precision uint32 `json:"precision"` +} + +var ( + _ encoding.ProtoMarshaler = (*Decimal)(nil) + _ encoding.ProtoUnmarshaler = (*Decimal)(nil) + _ json.Marshaler = (*Decimal)(nil) + _ json.Unmarshaler = (*Decimal)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Decimal) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.Int64Size(1, x.Value) + size += proto.UInt32Size(2, x.Precision) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Decimal) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *Decimal) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Value != 0 { + mm.AppendInt64(1, x.Value) + } + if x.Precision != 0 { + mm.AppendUint32(2, x.Precision) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Decimal) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "Decimal") + } + switch fc.FieldNum { + case 1: // Value + data, ok := fc.Int64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Value") + } + x.Value = data + case 2: // Precision + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Precision") + } + x.Precision = data + } + } + return nil +} +func (x *Decimal) GetValue() int64 { + if x != nil { + return x.Value + } + return 0 +} +func (x *Decimal) SetValue(v int64) { + x.Value = v +} +func (x *Decimal) GetPrecision() uint32 { + if x != nil { + return x.Precision + } + return 0 +} +func (x *Decimal) SetPrecision(v uint32) { + x.Precision = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Decimal) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Decimal) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.Value, 10) + out.RawByte('"') + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"precision\":" + out.RawString(prefix) + out.Uint32(x.Precision) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Decimal) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Decimal) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "value": + { + var f int64 + r := in.JsonNumber() + n := r.String() + v, err := strconv.ParseInt(n, 10, 64) + if err != nil { + in.AddError(err) + return + } + pv := int64(v) + f = pv + x.Value = f + } + case "precision": + { + var f uint32 + r := in.JsonNumber() + n := r.String() + v, err := strconv.ParseUint(n, 10, 32) + if err != nil { + in.AddError(err) + return + } + pv := uint32(v) + f = pv + x.Precision = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/api/accounting/grpc/types_frostfs_fuzz.go b/api/accounting/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..5eb5e97 --- /dev/null +++ b/api/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/api/accounting/grpc/types_frostfs_test.go b/api/accounting/grpc/types_frostfs_test.go new file mode 100644 index 0000000..404b75e --- /dev/null +++ b/api/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/api/accounting/json.go b/api/accounting/json.go new file mode 100644 index 0000000..c5ff977 --- /dev/null +++ b/api/accounting/json.go @@ -0,0 +1,14 @@ +package accounting + +import ( + accounting "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/accounting/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" +) + +func (d *Decimal) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(d) +} + +func (d *Decimal) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(d, data, new(accounting.Decimal)) +} diff --git a/api/accounting/marshal.go b/api/accounting/marshal.go new file mode 100644 index 0000000..84771cc --- /dev/null +++ b/api/accounting/marshal.go @@ -0,0 +1,104 @@ +package accounting + +import ( + accounting "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/accounting/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + protoutil "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" +) + +const ( + decimalValueField = 1 + decimalPrecisionField = 2 + + balanceReqBodyOwnerField = 1 + + balanceRespBodyDecimalField = 1 +) + +func (d *Decimal) StableMarshal(buf []byte) []byte { + if d == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, d.StableSize()) + } + + var offset int + + offset += protoutil.Int64Marshal(decimalValueField, buf[offset:], d.val) + protoutil.UInt32Marshal(decimalPrecisionField, buf[offset:], d.prec) + + return buf +} + +func (d *Decimal) StableSize() (size int) { + if d == nil { + return 0 + } + + size += protoutil.Int64Size(decimalValueField, d.val) + size += protoutil.UInt32Size(decimalPrecisionField, d.prec) + + return size +} + +func (d *Decimal) Unmarshal(data []byte) error { + return message.Unmarshal(d, data, new(accounting.Decimal)) +} + +func (b *BalanceRequestBody) StableMarshal(buf []byte) []byte { + if b == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, b.StableSize()) + } + + protoutil.NestedStructureMarshal(balanceReqBodyOwnerField, buf, b.ownerID) + + return buf +} + +func (b *BalanceRequestBody) StableSize() (size int) { + if b == nil { + return 0 + } + + size = protoutil.NestedStructureSize(balanceReqBodyOwnerField, b.ownerID) + + return size +} + +func (b *BalanceRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(b, data, new(accounting.BalanceRequest_Body)) +} + +func (br *BalanceResponseBody) StableMarshal(buf []byte) []byte { + if br == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, br.StableSize()) + } + + protoutil.NestedStructureMarshal(balanceRespBodyDecimalField, buf, br.bal) + + return buf +} + +func (br *BalanceResponseBody) StableSize() (size int) { + if br == nil { + return 0 + } + + size = protoutil.NestedStructureSize(balanceRespBodyDecimalField, br.bal) + + return size +} + +func (br *BalanceResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(br, data, new(accounting.BalanceResponse_Body)) +} diff --git a/api/accounting/message_test.go b/api/accounting/message_test.go new file mode 100644 index 0000000..214c171 --- /dev/null +++ b/api/accounting/message_test.go @@ -0,0 +1,19 @@ +package accounting_test + +import ( + "testing" + + accountingtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/accounting/test" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message/test" +) + +func TestMessage(t *testing.T) { + messagetest.TestRPCMessage(t, + func(empty bool) message.Message { return accountingtest.GenerateDecimal(empty) }, + func(empty bool) message.Message { return accountingtest.GenerateBalanceRequestBody(empty) }, + func(empty bool) message.Message { return accountingtest.GenerateBalanceRequest(empty) }, + func(empty bool) message.Message { return accountingtest.GenerateBalanceResponseBody(empty) }, + func(empty bool) message.Message { return accountingtest.GenerateBalanceResponse(empty) }, + ) +} diff --git a/api/accounting/test/generate.go b/api/accounting/test/generate.go new file mode 100644 index 0000000..e9f45df --- /dev/null +++ b/api/accounting/test/generate.go @@ -0,0 +1,64 @@ +package accountingtest + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/accounting" + accountingtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/test" + sessiontest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/test" +) + +func GenerateBalanceRequest(empty bool) *accounting.BalanceRequest { + m := new(accounting.BalanceRequest) + + if !empty { + m.SetBody(GenerateBalanceRequestBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + + return m +} + +func GenerateBalanceRequestBody(empty bool) *accounting.BalanceRequestBody { + m := new(accounting.BalanceRequestBody) + + if !empty { + m.SetOwnerID(accountingtest.GenerateOwnerID(false)) + } + + return m +} + +func GenerateBalanceResponse(empty bool) *accounting.BalanceResponse { + m := new(accounting.BalanceResponse) + + if !empty { + m.SetBody(GenerateBalanceResponseBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + + return m +} + +func GenerateBalanceResponseBody(empty bool) *accounting.BalanceResponseBody { + m := new(accounting.BalanceResponseBody) + + if !empty { + m.SetBalance(GenerateDecimal(false)) + } + + return m +} + +func GenerateDecimal(empty bool) *accounting.Decimal { + m := new(accounting.Decimal) + + if !empty { + m.SetValue(1) + m.SetPrecision(2) + } + + return m +} diff --git a/api/acl/bench_test.go b/api/acl/bench_test.go new file mode 100644 index 0000000..200270c --- /dev/null +++ b/api/acl/bench_test.go @@ -0,0 +1,51 @@ +package acl_test + +import ( + "testing" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" + aclGrpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl/grpc" + acltest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl/test" +) + +func BenchmarkTable_ToGRPCMessage(b *testing.B) { + const size = 4 + + tb := new(acl.Table) + rs := make([]acl.Record, size) + for i := range rs { + fs := make([]acl.HeaderFilter, size) + for j := range fs { + fs[j] = *acltest.GenerateFilter(false) + } + ts := make([]acl.Target, size) + for j := range ts { + ts[j] = *acltest.GenerateTarget(false) + } + + rs[i].SetFilters(fs) + rs[i].SetTargets(ts) + } + tb.SetRecords(rs) + + raw := tb.ToGRPCMessage() + + b.Run("to grpc message", func(b *testing.B) { + b.ReportAllocs() + for range b.N { + raw := tb.ToGRPCMessage() + if len(tb.GetRecords()) != len(raw.(*aclGrpc.EACLTable).Records) { + b.FailNow() + } + } + }) + b.Run("from grpc message", func(b *testing.B) { + b.ReportAllocs() + for range b.N { + tb := new(acl.Table) + if tb.FromGRPCMessage(raw) != nil { + b.FailNow() + } + } + }) +} diff --git a/api/acl/convert.go b/api/acl/convert.go new file mode 100644 index 0000000..3f389e3 --- /dev/null +++ b/api/acl/convert.go @@ -0,0 +1,592 @@ +package acl + +import ( + acl "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape" + apeGRPC "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" +) + +// RoleToGRPCField converts unified role enum into grpc enum. +func RoleToGRPCField(t Role) acl.Role { + switch t { + case RoleUser: + return acl.Role_USER + case RoleSystem: + return acl.Role_SYSTEM + case RoleOthers: + return acl.Role_OTHERS + default: + return acl.Role_ROLE_UNSPECIFIED + } +} + +// RoleFromGRPCField converts grpc enum into unified role enum. +func RoleFromGRPCField(t acl.Role) Role { + switch t { + case acl.Role_USER: + return RoleUser + case acl.Role_SYSTEM: + return RoleSystem + case acl.Role_OTHERS: + return RoleOthers + default: + return RoleUnknown + } +} + +// OperationToGRPCField converts unified operation enum into grpc enum. +func OperationToGRPCField(t Operation) acl.Operation { + switch t { + case OperationPut: + return acl.Operation_PUT + case OperationDelete: + return acl.Operation_DELETE + case OperationGet: + return acl.Operation_GET + case OperationHead: + return acl.Operation_HEAD + case OperationSearch: + return acl.Operation_SEARCH + case OperationRange: + return acl.Operation_GETRANGE + case OperationRangeHash: + return acl.Operation_GETRANGEHASH + default: + return acl.Operation_OPERATION_UNSPECIFIED + } +} + +// OperationFromGRPCField converts grpc enum into unified operation enum. +func OperationFromGRPCField(t acl.Operation) Operation { + switch t { + case acl.Operation_PUT: + return OperationPut + case acl.Operation_DELETE: + return OperationDelete + case acl.Operation_GET: + return OperationGet + case acl.Operation_HEAD: + return OperationHead + case acl.Operation_SEARCH: + return OperationSearch + case acl.Operation_GETRANGE: + return OperationRange + case acl.Operation_GETRANGEHASH: + return OperationRangeHash + default: + return OperationUnknown + } +} + +// ActionToGRPCField converts unified action enum into grpc enum. +func ActionToGRPCField(t Action) acl.Action { + switch t { + case ActionDeny: + return acl.Action_DENY + case ActionAllow: + return acl.Action_ALLOW + default: + return acl.Action_ACTION_UNSPECIFIED + } +} + +// ActionFromGRPCField converts grpc enum into unified action enum. +func ActionFromGRPCField(t acl.Action) Action { + switch t { + case acl.Action_DENY: + return ActionDeny + case acl.Action_ALLOW: + return ActionAllow + default: + return ActionUnknown + } +} + +// HeaderTypeToGRPCField converts unified header type enum into grpc enum. +func HeaderTypeToGRPCField(t HeaderType) acl.HeaderType { + switch t { + case HeaderTypeRequest: + return acl.HeaderType_REQUEST + case HeaderTypeObject: + return acl.HeaderType_OBJECT + case HeaderTypeService: + return acl.HeaderType_SERVICE + default: + return acl.HeaderType_HEADER_UNSPECIFIED + } +} + +// HeaderTypeFromGRPCField converts grpc enum into unified header type enum. +func HeaderTypeFromGRPCField(t acl.HeaderType) HeaderType { + switch t { + case acl.HeaderType_REQUEST: + return HeaderTypeRequest + case acl.HeaderType_OBJECT: + return HeaderTypeObject + case acl.HeaderType_SERVICE: + return HeaderTypeService + default: + return HeaderTypeUnknown + } +} + +// MatchTypeToGRPCField converts unified match type enum into grpc enum. +func MatchTypeToGRPCField(t MatchType) acl.MatchType { + switch t { + case MatchTypeStringEqual: + return acl.MatchType_STRING_EQUAL + case MatchTypeStringNotEqual: + return acl.MatchType_STRING_NOT_EQUAL + default: + return acl.MatchType_MATCH_TYPE_UNSPECIFIED + } +} + +// MatchTypeFromGRPCField converts grpc enum into unified match type enum. +func MatchTypeFromGRPCField(t acl.MatchType) MatchType { + switch t { + case acl.MatchType_STRING_EQUAL: + return MatchTypeStringEqual + case acl.MatchType_STRING_NOT_EQUAL: + return MatchTypeStringNotEqual + default: + return MatchTypeUnknown + } +} + +func (f *HeaderFilter) ToGRPCMessage() grpc.Message { + var m *acl.EACLRecord_Filter + + if f != nil { + m = new(acl.EACLRecord_Filter) + + m.SetKey(f.key) + m.SetValue(f.value) + m.SetHeaderType(HeaderTypeToGRPCField(f.hdrType)) + m.SetMatchType(MatchTypeToGRPCField(f.matchType)) + } + + return m +} + +func (f *HeaderFilter) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*acl.EACLRecord_Filter) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + f.key = v.GetKey() + f.value = v.GetValue() + f.hdrType = HeaderTypeFromGRPCField(v.GetHeaderType()) + f.matchType = MatchTypeFromGRPCField(v.GetMatchType()) + + return nil +} + +func HeaderFiltersToGRPC(fs []HeaderFilter) (res []acl.EACLRecord_Filter) { + if fs != nil { + res = make([]acl.EACLRecord_Filter, 0, len(fs)) + + for i := range fs { + res = append(res, *fs[i].ToGRPCMessage().(*acl.EACLRecord_Filter)) + } + } + + return +} + +func HeaderFiltersFromGRPC(fs []acl.EACLRecord_Filter) (res []HeaderFilter, err error) { + if fs != nil { + res = make([]HeaderFilter, len(fs)) + + for i := range fs { + err = res[i].FromGRPCMessage(&fs[i]) + if err != nil { + return + } + } + } + + return +} + +func (t *Target) ToGRPCMessage() grpc.Message { + var m *acl.EACLRecord_Target + + if t != nil { + m = new(acl.EACLRecord_Target) + + m.SetRole(RoleToGRPCField(t.role)) + m.SetKeys(t.keys) + } + + return m +} + +func (t *Target) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*acl.EACLRecord_Target) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + t.role = RoleFromGRPCField(v.GetRole()) + t.keys = v.GetKeys() + + return nil +} + +func TargetsToGRPC(ts []Target) (res []acl.EACLRecord_Target) { + if ts != nil { + res = make([]acl.EACLRecord_Target, 0, len(ts)) + + for i := range ts { + res = append(res, *ts[i].ToGRPCMessage().(*acl.EACLRecord_Target)) + } + } + + return +} + +func TargetsFromGRPC(fs []acl.EACLRecord_Target) (res []Target, err error) { + if fs != nil { + res = make([]Target, len(fs)) + + for i := range fs { + err = res[i].FromGRPCMessage(&fs[i]) + if err != nil { + return + } + } + } + + return +} + +func (r *Record) ToGRPCMessage() grpc.Message { + var m *acl.EACLRecord + + if r != nil { + m = new(acl.EACLRecord) + + m.SetOperation(OperationToGRPCField(r.op)) + m.SetAction(ActionToGRPCField(r.action)) + m.SetFilters(HeaderFiltersToGRPC(r.filters)) + m.SetTargets(TargetsToGRPC(r.targets)) + } + + return m +} + +func (r *Record) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*acl.EACLRecord) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + r.filters, err = HeaderFiltersFromGRPC(v.GetFilters()) + if err != nil { + return err + } + + r.targets, err = TargetsFromGRPC(v.GetTargets()) + if err != nil { + return err + } + + r.op = OperationFromGRPCField(v.GetOperation()) + r.action = ActionFromGRPCField(v.GetAction()) + + return nil +} + +func RecordsToGRPC(ts []Record) (res []acl.EACLRecord) { + if ts != nil { + res = make([]acl.EACLRecord, 0, len(ts)) + + for i := range ts { + res = append(res, *ts[i].ToGRPCMessage().(*acl.EACLRecord)) + } + } + + return +} + +func RecordsFromGRPC(fs []acl.EACLRecord) (res []Record, err error) { + if fs != nil { + res = make([]Record, len(fs)) + + for i := range fs { + err = res[i].FromGRPCMessage(&fs[i]) + if err != nil { + return + } + } + } + + return +} + +func (t *Table) ToGRPCMessage() grpc.Message { + var m *acl.EACLTable + + if t != nil { + m = new(acl.EACLTable) + + m.SetVersion(t.version.ToGRPCMessage().(*refsGRPC.Version)) + m.SetContainerId(t.cid.ToGRPCMessage().(*refsGRPC.ContainerID)) + m.SetRecords(RecordsToGRPC(t.records)) + } + + return m +} + +func (t *Table) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*acl.EACLTable) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + cid := v.GetContainerId() + if cid == nil { + t.cid = nil + } else { + if t.cid == nil { + t.cid = new(refs.ContainerID) + } + + err = t.cid.FromGRPCMessage(cid) + if err != nil { + return err + } + } + + version := v.GetVersion() + if version == nil { + t.version = nil + } else { + if t.version == nil { + t.version = new(refs.Version) + } + + err = t.version.FromGRPCMessage(version) + if err != nil { + return err + } + } + + t.records, err = RecordsFromGRPC(v.GetRecords()) + + return err +} + +func (l *TokenLifetime) ToGRPCMessage() grpc.Message { + var m *acl.BearerToken_Body_TokenLifetime + + if l != nil { + m = new(acl.BearerToken_Body_TokenLifetime) + + m.SetExp(l.exp) + m.SetIat(l.iat) + m.SetNbf(l.nbf) + } + + return m +} + +func (l *TokenLifetime) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*acl.BearerToken_Body_TokenLifetime) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + l.exp = v.GetExp() + l.iat = v.GetIat() + l.nbf = v.GetNbf() + + 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 + + if bt != nil { + m = new(acl.BearerToken_Body) + + m.SetOwnerId(bt.ownerID.ToGRPCMessage().(*refsGRPC.OwnerID)) + 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 +} + +func (bt *BearerTokenBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*acl.BearerToken_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + ownerID := v.GetOwnerId() + if ownerID == nil { + bt.ownerID = nil + } else { + if bt.ownerID == nil { + bt.ownerID = new(refs.OwnerID) + } + + err = bt.ownerID.FromGRPCMessage(ownerID) + if err != nil { + return err + } + } + + lifetime := v.GetLifetime() + if lifetime == nil { + bt.lifetime = nil + } else { + if bt.lifetime == nil { + bt.lifetime = new(TokenLifetime) + } + + err = bt.lifetime.FromGRPCMessage(lifetime) + if err != nil { + return err + } + } + + eacl := v.GetEaclTable() + if eacl == nil { + bt.eacl = nil + } else { + if bt.eacl == nil { + bt.eacl = new(Table) + } + + 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() + + return err +} + +func (bt *BearerToken) ToGRPCMessage() grpc.Message { + var m *acl.BearerToken + + if bt != nil { + m = new(acl.BearerToken) + + m.SetBody(bt.body.ToGRPCMessage().(*acl.BearerToken_Body)) + m.SetSignature(bt.sig.ToGRPCMessage().(*refsGRPC.Signature)) + } + + return m +} + +func (bt *BearerToken) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*acl.BearerToken) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + body := v.GetBody() + if body == nil { + bt.body = nil + } else { + if bt.body == nil { + bt.body = new(BearerTokenBody) + } + + err = bt.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + sig := v.GetSignature() + if sig == nil { + bt.sig = nil + } else { + if bt.sig == nil { + bt.sig = new(refs.Signature) + } + + err = bt.sig.FromGRPCMessage(sig) + } + + return err +} diff --git a/api/acl/filters.go b/api/acl/filters.go new file mode 100644 index 0000000..c1d8afe --- /dev/null +++ b/api/acl/filters.go @@ -0,0 +1,33 @@ +package acl + +// ObjectFilterPrefix is a prefix of key to object header value or property. +const ObjectFilterPrefix = "$Object:" + +const ( + // FilterObjectVersion is a filter key to "version" field of the object header. + FilterObjectVersion = ObjectFilterPrefix + "version" + + // FilterObjectID is a filter key to "object_id" field of the object. + FilterObjectID = ObjectFilterPrefix + "objectID" + + // FilterObjectContainerID is a filter key to "container_id" field of the object header. + FilterObjectContainerID = ObjectFilterPrefix + "containerID" + + // FilterObjectOwnerID is a filter key to "owner_id" field of the object header. + FilterObjectOwnerID = ObjectFilterPrefix + "ownerID" + + // FilterObjectCreationEpoch is a filter key to "creation_epoch" field of the object header. + FilterObjectCreationEpoch = ObjectFilterPrefix + "creationEpoch" + + // FilterObjectPayloadLength is a filter key to "payload_length" field of the object header. + FilterObjectPayloadLength = ObjectFilterPrefix + "payloadLength" + + // FilterObjectPayloadHash is a filter key to "payload_hash" field of the object header. + FilterObjectPayloadHash = ObjectFilterPrefix + "payloadHash" + + // FilterObjectType is a filter key to "object_type" field of the object header. + FilterObjectType = ObjectFilterPrefix + "objectType" + + // FilterObjectHomomorphicHash is a filter key to "homomorphic_hash" field of the object header. + FilterObjectHomomorphicHash = ObjectFilterPrefix + "homomorphicHash" +) diff --git a/api/acl/grpc/types_frostfs.pb.go b/api/acl/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..eed28d6 --- /dev/null +++ b/api/acl/grpc/types_frostfs.pb.go @@ -0,0 +1,2184 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package acl + +import ( + json "encoding/json" + fmt "fmt" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" +) + +type 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 + } + first := true + out.RawByte('{') + { + 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 = "\"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 = "\"key\":" + out.RawString(prefix) + out.String(x.Key) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + out.String(x.Value) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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 + } + first := true + out.RawByte('{') + { + 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 = "\"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('}') +} + +// 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(']') { + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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.NestedStructureSizeUnchecked(3, &x.Filters[i]) + } + for i := range x.Targets { + size += proto.NestedStructureSizeUnchecked(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 { + x.Filters[i].EmitProtobuf(mm.AppendMessage(3)) + } + for i := range x.Targets { + 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, 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, 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 + } + first := true + out.RawByte('{') + { + 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 = "\"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 = "\"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 = "\"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 = 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 = 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.NestedStructureSizeUnchecked(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.EmitProtobuf(mm.AppendMessage(1)) + } + if x.ContainerId != nil { + x.ContainerId.EmitProtobuf(mm.AppendMessage(2)) + } + for i := range x.Records { + 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, 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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"version\":" + out.RawString(prefix) + x.Version.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"containerID\":" + out.RawString(prefix) + x.ContainerId.MarshalEasyJSON(out) + } + { + 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('}') +} + +// 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 = 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 + } + first := true + 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 !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 = "\"iat\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Iat, 10) + out.RawByte('"') + } + 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 + 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 + 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 + 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 + } + } + 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.NestedStructureSizeUnchecked(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.EmitProtobuf(mm.AppendMessage(1)) + } + for i := range x.Chains { + 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, 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 + } + first := true + out.RawByte('{') + { + 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 = "\"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 = 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.EmitProtobuf(mm.AppendMessage(1)) + } + if x.OwnerId != nil { + x.OwnerId.EmitProtobuf(mm.AppendMessage(2)) + } + if x.Lifetime != nil { + x.Lifetime.EmitProtobuf(mm.AppendMessage(3)) + } + if x.AllowImpersonate { + mm.AppendBool(4, x.AllowImpersonate) + } + if x.ApeOverride != nil { + 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 + } + first := true + out.RawByte('{') + { + 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 = "\"ownerID\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) + } + { + 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 = "\"allowImpersonate\":" + out.RawString(prefix) + out.Bool(x.AllowImpersonate) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + 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.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Signature != nil { + 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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"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/api/acl/grpc/types_frostfs_fuzz.go b/api/acl/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..5d5b763 --- /dev/null +++ b/api/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/api/acl/grpc/types_frostfs_test.go b/api/acl/grpc/types_frostfs_test.go new file mode 100644 index 0000000..c6d1c43 --- /dev/null +++ b/api/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/api/acl/json.go b/api/acl/json.go new file mode 100644 index 0000000..9192956 --- /dev/null +++ b/api/acl/json.go @@ -0,0 +1,70 @@ +package acl + +import ( + acl "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" +) + +func (f *HeaderFilter) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(f) +} + +func (f *HeaderFilter) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(f, data, new(acl.EACLRecord_Filter)) +} + +func (t *Target) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(t) +} + +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) +} + +func (r *Record) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(r, data, new(acl.EACLRecord)) +} + +func (t *Table) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(t) +} + +func (t *Table) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(t, data, new(acl.EACLTable)) +} + +func (l *TokenLifetime) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(l) +} + +func (l *TokenLifetime) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(l, data, new(acl.BearerToken_Body_TokenLifetime)) +} + +func (bt *BearerTokenBody) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(bt) +} + +func (bt *BearerTokenBody) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(bt, data, new(acl.BearerToken_Body)) +} + +func (bt *BearerToken) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(bt) +} + +func (bt *BearerToken) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(bt, data, new(acl.BearerToken)) +} diff --git a/api/acl/marshal.go b/api/acl/marshal.go new file mode 100644 index 0000000..29bfa06 --- /dev/null +++ b/api/acl/marshal.go @@ -0,0 +1,350 @@ +package acl + +import ( + acl "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + protoutil "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" +) + +const ( + filterHeaderTypeField = 1 + filterMatchTypeField = 2 + filterNameField = 3 + filterValueField = 4 + + targetTypeField = 1 + targetKeysField = 2 + + recordOperationField = 1 + recordActionField = 2 + recordFiltersField = 3 + recordTargetsField = 4 + + tableVersionField = 1 + tableContainerIDField = 2 + tableRecordsField = 3 + + lifetimeExpirationField = 1 + lifetimeNotValidBeforeField = 2 + lifetimeIssuedAtField = 3 + + tokenAPEChainsTargetField = 1 + tokenAPEChainsChainsField = 2 + + bearerTokenBodyACLField = 1 + bearerTokenBodyOwnerField = 2 + bearerTokenBodyLifetimeField = 3 + bearerTokenBodyImpersonate = 4 + bearerTokenTokenAPEChainsField = 5 + + bearerTokenBodyField = 1 + bearerTokenSignatureField = 2 +) + +// StableMarshal marshals unified acl table structure in a protobuf +// compatible way without field order shuffle. +func (t *Table) StableMarshal(buf []byte) []byte { + if t == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, t.StableSize()) + } + + var offset int + + offset += protoutil.NestedStructureMarshal(tableVersionField, buf[offset:], t.version) + offset += protoutil.NestedStructureMarshal(tableContainerIDField, buf[offset:], t.cid) + + for i := range t.records { + offset += protoutil.NestedStructureMarshal(tableRecordsField, buf[offset:], &t.records[i]) + } + + return buf +} + +// StableSize of acl table structure marshalled by StableMarshal function. +func (t *Table) StableSize() (size int) { + if t == nil { + return 0 + } + + size += protoutil.NestedStructureSize(tableVersionField, t.version) + size += protoutil.NestedStructureSize(tableContainerIDField, t.cid) + + for i := range t.records { + size += protoutil.NestedStructureSize(tableRecordsField, &t.records[i]) + } + + return size +} + +func (t *Table) Unmarshal(data []byte) error { + return message.Unmarshal(t, data, new(acl.EACLTable)) +} + +// StableMarshal marshals unified acl record structure in a protobuf +// compatible way without field order shuffle. +func (r *Record) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + + offset += protoutil.EnumMarshal(recordOperationField, buf[offset:], int32(r.op)) + offset += protoutil.EnumMarshal(recordActionField, buf[offset:], int32(r.action)) + + for i := range r.filters { + offset += protoutil.NestedStructureMarshal(recordFiltersField, buf[offset:], &r.filters[i]) + } + + for i := range r.targets { + offset += protoutil.NestedStructureMarshal(recordTargetsField, buf[offset:], &r.targets[i]) + } + + return buf +} + +// StableSize of acl record structure marshalled by StableMarshal function. +func (r *Record) StableSize() (size int) { + if r == nil { + return 0 + } + + size += protoutil.EnumSize(recordOperationField, int32(r.op)) + size += protoutil.EnumSize(recordActionField, int32(r.action)) + + for i := range r.filters { + size += protoutil.NestedStructureSize(recordFiltersField, &r.filters[i]) + } + + for i := range r.targets { + size += protoutil.NestedStructureSize(recordTargetsField, &r.targets[i]) + } + + return size +} + +func (r *Record) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(acl.EACLRecord)) +} + +// StableMarshal marshals unified header filter structure in a protobuf +// compatible way without field order shuffle. +func (f *HeaderFilter) StableMarshal(buf []byte) []byte { + if f == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, f.StableSize()) + } + + var offset int + + offset += protoutil.EnumMarshal(filterHeaderTypeField, buf[offset:], int32(f.hdrType)) + offset += protoutil.EnumMarshal(filterMatchTypeField, buf[offset:], int32(f.matchType)) + offset += protoutil.StringMarshal(filterNameField, buf[offset:], f.key) + protoutil.StringMarshal(filterValueField, buf[offset:], f.value) + + return buf +} + +// StableSize of header filter structure marshalled by StableMarshal function. +func (f *HeaderFilter) StableSize() (size int) { + if f == nil { + return 0 + } + + size += protoutil.EnumSize(filterHeaderTypeField, int32(f.hdrType)) + size += protoutil.EnumSize(filterMatchTypeField, int32(f.matchType)) + size += protoutil.StringSize(filterNameField, f.key) + size += protoutil.StringSize(filterValueField, f.value) + + return size +} + +func (f *HeaderFilter) Unmarshal(data []byte) error { + return message.Unmarshal(f, data, new(acl.EACLRecord_Filter)) +} + +// StableMarshal marshals unified role info structure in a protobuf +// compatible way without field order shuffle. +func (t *Target) StableMarshal(buf []byte) []byte { + if t == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, t.StableSize()) + } + + var offset int + + offset += protoutil.EnumMarshal(targetTypeField, buf[offset:], int32(t.role)) + protoutil.RepeatedBytesMarshal(targetKeysField, buf[offset:], t.keys) + + return buf +} + +// StableSize of role info structure marshalled by StableMarshal function. +func (t *Target) StableSize() (size int) { + if t == nil { + return 0 + } + + size += protoutil.EnumSize(targetTypeField, int32(t.role)) + size += protoutil.RepeatedBytesSize(targetKeysField, t.keys) + + return size +} + +func (t *Target) Unmarshal(data []byte) error { + return message.Unmarshal(t, data, new(acl.EACLRecord_Target)) +} + +func (l *TokenLifetime) StableMarshal(buf []byte) []byte { + if l == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, l.StableSize()) + } + + var offset int + + offset += protoutil.UInt64Marshal(lifetimeExpirationField, buf[offset:], l.exp) + offset += protoutil.UInt64Marshal(lifetimeNotValidBeforeField, buf[offset:], l.nbf) + protoutil.UInt64Marshal(lifetimeIssuedAtField, buf[offset:], l.iat) + + return buf +} + +func (l *TokenLifetime) StableSize() (size int) { + if l == nil { + return 0 + } + + size += protoutil.UInt64Size(lifetimeExpirationField, l.exp) + size += protoutil.UInt64Size(lifetimeNotValidBeforeField, l.nbf) + size += protoutil.UInt64Size(lifetimeIssuedAtField, l.iat) + + return size +} + +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{} + } + + if buf == nil { + buf = make([]byte, bt.StableSize()) + } + + var offset int + + offset += protoutil.NestedStructureMarshal(bearerTokenBodyACLField, buf[offset:], bt.eacl) + offset += protoutil.NestedStructureMarshal(bearerTokenBodyOwnerField, buf[offset:], bt.ownerID) + offset += protoutil.NestedStructureMarshal(bearerTokenBodyLifetimeField, buf[offset:], bt.lifetime) + offset += protoutil.BoolMarshal(bearerTokenBodyImpersonate, buf[offset:], bt.impersonate) + protoutil.NestedStructureMarshal(bearerTokenTokenAPEChainsField, buf[offset:], bt.apeOverride) + + return buf +} + +func (bt *BearerTokenBody) StableSize() (size int) { + if bt == nil { + return 0 + } + + size += protoutil.NestedStructureSize(bearerTokenBodyACLField, bt.eacl) + 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 +} + +func (bt *BearerTokenBody) Unmarshal(data []byte) error { + return message.Unmarshal(bt, data, new(acl.BearerToken_Body)) +} + +func (bt *BearerToken) StableMarshal(buf []byte) []byte { + if bt == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, bt.StableSize()) + } + + var offset int + + offset += protoutil.NestedStructureMarshal(bearerTokenBodyField, buf[offset:], bt.body) + protoutil.NestedStructureMarshal(bearerTokenSignatureField, buf[offset:], bt.sig) + + return buf +} + +func (bt *BearerToken) StableSize() (size int) { + if bt == nil { + return 0 + } + + size += protoutil.NestedStructureSize(bearerTokenBodyField, bt.body) + size += protoutil.NestedStructureSize(bearerTokenSignatureField, bt.sig) + + return size +} + +func (bt *BearerToken) Unmarshal(data []byte) error { + return message.Unmarshal(bt, data, new(acl.BearerToken)) +} diff --git a/api/acl/message_test.go b/api/acl/message_test.go new file mode 100644 index 0000000..0131137 --- /dev/null +++ b/api/acl/message_test.go @@ -0,0 +1,21 @@ +package acl_test + +import ( + "testing" + + acltest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl/test" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message/test" +) + +func TestMessageConvert(t *testing.T) { + messagetest.TestRPCMessage(t, + func(empty bool) message.Message { return acltest.GenerateFilter(empty) }, + func(empty bool) message.Message { return acltest.GenerateTarget(empty) }, + func(empty bool) message.Message { return acltest.GenerateRecord(empty) }, + func(empty bool) message.Message { return acltest.GenerateTable(empty) }, + func(empty bool) message.Message { return acltest.GenerateTokenLifetime(empty) }, + func(empty bool) message.Message { return acltest.GenerateBearerTokenBody(empty) }, + func(empty bool) message.Message { return acltest.GenerateBearerToken(empty) }, + ) +} diff --git a/api/acl/string.go b/api/acl/string.go new file mode 100644 index 0000000..e5a4462 --- /dev/null +++ b/api/acl/string.go @@ -0,0 +1,110 @@ +package acl + +import ( + acl "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl/grpc" +) + +// String returns string representation of Action. +func (x Action) String() string { + return ActionToGRPCField(x).String() +} + +// 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 { + var g acl.Action + + ok := g.FromString(s) + + if ok { + *x = ActionFromGRPCField(g) + } + + return ok +} + +// String returns string representation of Role. +func (x Role) String() string { + return RoleToGRPCField(x).String() +} + +// 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 { + var g acl.Role + + ok := g.FromString(s) + + if ok { + *x = RoleFromGRPCField(g) + } + + return ok +} + +// String returns string representation of Operation. +func (x Operation) String() string { + return OperationToGRPCField(x).String() +} + +// 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 { + var g acl.Operation + + ok := g.FromString(s) + + if ok { + *x = OperationFromGRPCField(g) + } + + return ok +} + +// String returns string representation of MatchType. +func (x MatchType) String() string { + return MatchTypeToGRPCField(x).String() +} + +// 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 { + var g acl.MatchType + + ok := g.FromString(s) + + if ok { + *x = MatchTypeFromGRPCField(g) + } + + return ok +} + +// String returns string representation of HeaderType. +func (x HeaderType) String() string { + return HeaderTypeToGRPCField(x).String() +} + +// 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 { + var g acl.HeaderType + + ok := g.FromString(s) + + if ok { + *x = HeaderTypeFromGRPCField(g) + } + + return ok +} diff --git a/api/acl/test/generate.go b/api/acl/test/generate.go new file mode 100644 index 0000000..8b265ad --- /dev/null +++ b/api/acl/test/generate.go @@ -0,0 +1,144 @@ +package acltest + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" + apetest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape/test" + accountingtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/test" +) + +func GenerateBearerToken(empty bool) *acl.BearerToken { + m := new(acl.BearerToken) + + if !empty { + m.SetBody(GenerateBearerTokenBody(false)) + } + + m.SetSignature(accountingtest.GenerateSignature(empty)) + + return m +} + +func GenerateBearerTokenBody(empty bool) *acl.BearerTokenBody { + m := new(acl.BearerTokenBody) + + if !empty { + m.SetOwnerID(accountingtest.GenerateOwnerID(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 +} + +func GenerateTable(empty bool) *acl.Table { + m := new(acl.Table) + + if !empty { + m.SetRecords(GenerateRecords(false)) + m.SetContainerID(accountingtest.GenerateContainerID(false)) + } + + m.SetVersion(accountingtest.GenerateVersion(empty)) + + return m +} + +func GenerateRecords(empty bool) []acl.Record { + var rs []acl.Record + + if !empty { + rs = append(rs, + *GenerateRecord(false), + *GenerateRecord(false), + ) + } + + return rs +} + +func GenerateRecord(empty bool) *acl.Record { + m := new(acl.Record) + + if !empty { + m.SetAction(acl.ActionAllow) + m.SetOperation(acl.OperationGet) + m.SetFilters(GenerateFilters(false)) + m.SetTargets(GenerateTargets(false)) + } + + return m +} + +func GenerateFilters(empty bool) []acl.HeaderFilter { + var fs []acl.HeaderFilter + + if !empty { + fs = append(fs, + *GenerateFilter(false), + *GenerateFilter(false), + ) + } + + return fs +} + +func GenerateFilter(empty bool) *acl.HeaderFilter { + m := new(acl.HeaderFilter) + + if !empty { + m.SetKey("key") + m.SetValue("val") + m.SetHeaderType(acl.HeaderTypeRequest) + m.SetMatchType(acl.MatchTypeStringEqual) + } + + return m +} + +func GenerateTargets(empty bool) []acl.Target { + var ts []acl.Target + + if !empty { + ts = append(ts, + *GenerateTarget(false), + *GenerateTarget(false), + ) + } + + return ts +} + +func GenerateTarget(empty bool) *acl.Target { + m := new(acl.Target) + + if !empty { + m.SetRole(acl.RoleSystem) + m.SetKeys([][]byte{{1}, {2}}) + } + + return m +} + +func GenerateTokenLifetime(empty bool) *acl.TokenLifetime { + m := new(acl.TokenLifetime) + + if !empty { + m.SetExp(1) + m.SetIat(2) + m.SetExp(3) + } + + return m +} diff --git a/api/acl/types.go b/api/acl/types.go new file mode 100644 index 0000000..e0bae3a --- /dev/null +++ b/api/acl/types.go @@ -0,0 +1,426 @@ +package acl + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" +) + +// HeaderFilter is a unified structure of FilterInfo +// message from proto definition. +type HeaderFilter struct { + hdrType HeaderType + + matchType MatchType + + key, value string +} + +// Target is a unified structure of Target +// message from proto definition. +type Target struct { + role Role + + keys [][]byte +} + +// Record is a unified structure of EACLRecord +// message from proto definition. +type Record struct { + op Operation + + action Action + + filters []HeaderFilter + + targets []Target +} + +// Table is a unified structure of EACLTable +// message from proto definition. +type Table struct { + version *refs.Version + + cid *refs.ContainerID + + records []Record +} + +type TokenLifetime struct { + exp, nbf, iat uint64 +} + +type APEOverride struct { + target *ape.ChainTarget + + chains []*ape.Chain +} + +type BearerTokenBody struct { + eacl *Table + + ownerID *refs.OwnerID + + lifetime *TokenLifetime + + apeOverride *APEOverride + + impersonate bool +} + +type BearerToken struct { + body *BearerTokenBody + + sig *refs.Signature +} + +// Target is a unified enum of MatchType enum from proto definition. +type MatchType uint32 + +// HeaderType is a unified enum of HeaderType enum from proto definition. +type HeaderType uint32 + +// Action is a unified enum of Action enum from proto definition. +type Action uint32 + +// Operation is a unified enum of Operation enum from proto definition. +type Operation uint32 + +// Role is a unified enum of Role enum from proto definition. +type Role uint32 + +const ( + MatchTypeUnknown MatchType = iota + MatchTypeStringEqual + MatchTypeStringNotEqual +) + +const ( + HeaderTypeUnknown HeaderType = iota + HeaderTypeRequest + HeaderTypeObject + HeaderTypeService +) + +const ( + ActionUnknown Action = iota + ActionAllow + ActionDeny +) + +const ( + OperationUnknown Operation = iota + OperationGet + OperationHead + OperationPut + OperationDelete + OperationSearch + OperationRange + OperationRangeHash +) + +const ( + RoleUnknown Role = iota + RoleUser + RoleSystem + RoleOthers +) + +func (f *HeaderFilter) GetHeaderType() HeaderType { + if f != nil { + return f.hdrType + } + + return HeaderTypeUnknown +} + +func (f *HeaderFilter) SetHeaderType(v HeaderType) { + f.hdrType = v +} + +func (f *HeaderFilter) GetMatchType() MatchType { + if f != nil { + return f.matchType + } + + return MatchTypeUnknown +} + +func (f *HeaderFilter) SetMatchType(v MatchType) { + f.matchType = v +} + +func (f *HeaderFilter) GetKey() string { + if f != nil { + return f.key + } + + return "" +} + +func (f *HeaderFilter) SetKey(v string) { + f.key = v +} + +func (f *HeaderFilter) GetValue() string { + if f != nil { + return f.value + } + + return "" +} + +func (f *HeaderFilter) SetValue(v string) { + f.value = v +} + +func (t *Target) GetRole() Role { + if t != nil { + return t.role + } + + return RoleUnknown +} + +func (t *Target) SetRole(v Role) { + t.role = v +} + +func (t *Target) GetKeys() [][]byte { + if t != nil { + return t.keys + } + + return nil +} + +func (t *Target) SetKeys(v [][]byte) { + t.keys = v +} + +func (r *Record) GetOperation() Operation { + if r != nil { + return r.op + } + + return OperationUnknown +} + +func (r *Record) SetOperation(v Operation) { + r.op = v +} + +func (r *Record) GetAction() Action { + if r != nil { + return r.action + } + + return ActionUnknown +} + +func (r *Record) SetAction(v Action) { + r.action = v +} + +func (r *Record) GetFilters() []HeaderFilter { + if r != nil { + return r.filters + } + + return nil +} + +func (r *Record) SetFilters(v []HeaderFilter) { + r.filters = v +} + +func (r *Record) GetTargets() []Target { + if r != nil { + return r.targets + } + + return nil +} + +func (r *Record) SetTargets(v []Target) { + r.targets = v +} + +func (t *Table) GetVersion() *refs.Version { + if t != nil { + return t.version + } + + return nil +} + +func (t *Table) SetVersion(v *refs.Version) { + t.version = v +} + +func (t *Table) GetContainerID() *refs.ContainerID { + if t != nil { + return t.cid + } + + return nil +} + +func (t *Table) SetContainerID(v *refs.ContainerID) { + t.cid = v +} + +func (t *Table) GetRecords() []Record { + if t != nil { + return t.records + } + + return nil +} + +func (t *Table) SetRecords(v []Record) { + t.records = v +} + +func (l *TokenLifetime) GetExp() uint64 { + if l != nil { + return l.exp + } + + return 0 +} + +func (l *TokenLifetime) SetExp(v uint64) { + l.exp = v +} + +func (l *TokenLifetime) GetNbf() uint64 { + if l != nil { + return l.nbf + } + + return 0 +} + +func (l *TokenLifetime) SetNbf(v uint64) { + l.nbf = v +} + +func (l *TokenLifetime) GetIat() uint64 { + if l != nil { + return l.iat + } + + return 0 +} + +func (l *TokenLifetime) SetIat(v uint64) { + l.iat = v +} + +func (bt *BearerTokenBody) GetEACL() *Table { + if bt != nil { + return bt.eacl + } + + return nil +} + +func (bt *BearerTokenBody) SetEACL(v *Table) { + bt.eacl = v +} + +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 +} + +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 + } + + return nil +} + +func (bt *BearerTokenBody) SetOwnerID(v *refs.OwnerID) { + bt.ownerID = v +} + +func (bt *BearerTokenBody) GetLifetime() *TokenLifetime { + if bt != nil { + return bt.lifetime + } + + return nil +} + +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 + } + + return nil +} + +func (bt *BearerToken) SetBody(v *BearerTokenBody) { + bt.body = v +} + +func (bt *BearerToken) GetSignature() *refs.Signature { + if bt != nil { + return bt.sig + } + + return nil +} + +func (bt *BearerToken) SetSignature(v *refs.Signature) { + bt.sig = v +} diff --git a/api/ape/convert.go b/api/ape/convert.go new file mode 100644 index 0000000..7bb0bde --- /dev/null +++ b/api/ape/convert.go @@ -0,0 +1,132 @@ +package ape + +import ( + "fmt" + + ape "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/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/api/ape/grpc/types_frostfs.pb.go b/api/ape/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..0e204bd --- /dev/null +++ b/api/ape/grpc/types_frostfs.pb.go @@ -0,0 +1,430 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package ape + +import ( + json "encoding/json" + fmt "fmt" + pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" +) + +type TargetType int32 + +const ( + TargetType_UNDEFINED TargetType = 0 + TargetType_NAMESPACE TargetType = 1 + TargetType_CONTAINER TargetType = 2 + TargetType_USER TargetType = 3 + TargetType_GROUP TargetType = 4 +) + +var ( + TargetType_name = map[int32]string{ + 0: "UNDEFINED", + 1: "NAMESPACE", + 2: "CONTAINER", + 3: "USER", + 4: "GROUP", + } + TargetType_value = map[string]int32{ + "UNDEFINED": 0, + "NAMESPACE": 1, + "CONTAINER": 2, + "USER": 3, + "GROUP": 4, + } +) + +func (x TargetType) String() string { + if v, ok := TargetType_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *TargetType) FromString(s string) bool { + if v, ok := TargetType_value[s]; ok { + *x = TargetType(v) + return true + } + return false +} + +type ChainTarget struct { + Type TargetType `json:"type"` + Name string `json:"name"` +} + +var ( + _ encoding.ProtoMarshaler = (*ChainTarget)(nil) + _ encoding.ProtoUnmarshaler = (*ChainTarget)(nil) + _ json.Marshaler = (*ChainTarget)(nil) + _ json.Unmarshaler = (*ChainTarget)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ChainTarget) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.EnumSize(1, int32(x.Type)) + size += proto.StringSize(2, x.Name) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ChainTarget) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *ChainTarget) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if int32(x.Type) != 0 { + mm.AppendInt32(1, int32(x.Type)) + } + if len(x.Name) != 0 { + mm.AppendString(2, x.Name) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ChainTarget) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "ChainTarget") + } + switch fc.FieldNum { + case 1: // Type + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Type") + } + x.Type = TargetType(data) + case 2: // Name + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Name") + } + x.Name = data + } + } + return nil +} +func (x *ChainTarget) GetType() TargetType { + if x != nil { + return x.Type + } + return 0 +} +func (x *ChainTarget) SetType(v TargetType) { + x.Type = v +} +func (x *ChainTarget) GetName() string { + if x != nil { + return x.Name + } + return "" +} +func (x *ChainTarget) SetName(v string) { + x.Name = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ChainTarget) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ChainTarget) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"type\":" + out.RawString(prefix) + v := int32(x.Type) + if vv, ok := TargetType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"name\":" + out.RawString(prefix) + out.String(x.Name) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ChainTarget) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ChainTarget) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "type": + { + var f TargetType + var parsedValue TargetType + switch v := in.Interface().(type) { + case string: + if vv, ok := TargetType_value[v]; ok { + parsedValue = TargetType(vv) + break + } + vv, err := strconv.ParseInt(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = TargetType(vv) + case float64: + parsedValue = TargetType(v) + } + f = parsedValue + x.Type = f + } + case "name": + { + var f string + f = in.String() + x.Name = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type Chain struct { + Kind isChain_Kind +} + +var ( + _ encoding.ProtoMarshaler = (*Chain)(nil) + _ encoding.ProtoUnmarshaler = (*Chain)(nil) + _ json.Marshaler = (*Chain)(nil) + _ json.Unmarshaler = (*Chain)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Chain) StableSize() (size int) { + if x == nil { + return 0 + } + if inner, ok := x.Kind.(*Chain_Raw); ok { + size += proto.BytesSize(1, inner.Raw) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Chain) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *Chain) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if inner, ok := x.Kind.(*Chain_Raw); ok { + if len(inner.Raw) != 0 { + mm.AppendBytes(1, inner.Raw) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Chain) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "Chain") + } + switch fc.FieldNum { + case 1: // Raw + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Raw") + } + x.Kind = &Chain_Raw{Raw: data} + } + } + return nil +} +func (x *Chain) GetKind() isChain_Kind { + if x != nil { + return x.Kind + } + return nil +} +func (x *Chain) SetKind(v isChain_Kind) { + x.Kind = v +} +func (x *Chain) GetRaw() []byte { + if xx, ok := x.GetKind().(*Chain_Raw); ok { + return xx.Raw + } + return nil +} +func (x *Chain) SetRaw(v *Chain_Raw) { + x.Kind = v +} +func (x *Chain_Raw) GetRaw() []byte { + if x != nil { + return x.Raw + } + return nil +} +func (x *Chain_Raw) SetRaw(v []byte) { + x.Raw = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Chain) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Chain) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + first := true + out.RawByte('{') + switch xx := x.Kind.(type) { + case *Chain_Raw: + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"raw\":" + out.RawString(prefix) + if xx.Raw != nil { + out.Base64Bytes(xx.Raw) + } else { + out.String("") + } + } + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Chain) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Chain) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "raw": + xx := new(Chain_Raw) + x.Kind = xx + { + var f []byte + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + xx.Raw = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type isChain_Kind interface { + isChain_Kind() +} + +type Chain_Raw struct { + Raw []byte +} + +func (*Chain_Raw) isChain_Kind() {} diff --git a/api/ape/grpc/types_frostfs_fuzz.go b/api/ape/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..b7bf367 --- /dev/null +++ b/api/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/api/ape/grpc/types_frostfs_test.go b/api/ape/grpc/types_frostfs_test.go new file mode 100644 index 0000000..93d7eea --- /dev/null +++ b/api/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/api/ape/json.go b/api/ape/json.go new file mode 100644 index 0000000..ffa3a8b --- /dev/null +++ b/api/ape/json.go @@ -0,0 +1,14 @@ +package ape + +import ( + ape "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/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(ape.ChainTarget)) +} diff --git a/api/ape/marshal.go b/api/ape/marshal.go new file mode 100644 index 0000000..e8f377b --- /dev/null +++ b/api/ape/marshal.go @@ -0,0 +1,92 @@ +package ape + +import ( + "fmt" + + ape "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/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/api/ape/message_test.go b/api/ape/message_test.go new file mode 100644 index 0000000..23b929b --- /dev/null +++ b/api/ape/message_test.go @@ -0,0 +1,15 @@ +package ape_test + +import ( + "testing" + + apetest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape/test" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message/test" +) + +func TestMessageConvert(t *testing.T) { + messagetest.TestRPCMessage(t, + func(empty bool) message.Message { return apetest.GenerateChainTarget(empty) }, + ) +} diff --git a/api/ape/string.go b/api/ape/string.go new file mode 100644 index 0000000..1d26c28 --- /dev/null +++ b/api/ape/string.go @@ -0,0 +1,18 @@ +package ape + +import ( + apegrpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape/grpc" +) + +func (tt TargetType) String() string { + return TargetTypeToGRPCField(tt).String() +} + +func (tt *TargetType) FromString(s string) bool { + i, ok := apegrpc.TargetType_value[s] + if ok { + *tt = TargetType(i) + } + + return ok +} diff --git a/api/ape/test/generate.go b/api/ape/test/generate.go new file mode 100644 index 0000000..4fd3dc2 --- /dev/null +++ b/api/ape/test/generate.go @@ -0,0 +1,71 @@ +package test + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/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/api/ape/types.go b/api/ape/types.go new file mode 100644 index 0000000..467a441 --- /dev/null +++ b/api/ape/types.go @@ -0,0 +1,79 @@ +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 { + if c == nil { + return nil + } + + 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 { + if c == nil { + return nil + } + + return c.Raw +} diff --git a/api/apemanager/convert.go b/api/apemanager/convert.go new file mode 100644 index 0000000..5591791 --- /dev/null +++ b/api/apemanager/convert.go @@ -0,0 +1,358 @@ +package apemanager + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape" + apeGRPC "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape/grpc" + apemanager "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/apemanager/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" +) + +func (reqBody *AddChainRequestBody) ToGRPCMessage() grpc.Message { + var reqBodygrpc *apemanager.AddChainRequest_Body + + if reqBody != nil { + reqBodygrpc = new(apemanager.AddChainRequest_Body) + + reqBodygrpc.SetTarget(reqBody.GetTarget().ToGRPCMessage().(*apeGRPC.ChainTarget)) + reqBodygrpc.SetChain(reqBody.GetChain().ToGRPCMessage().(*apeGRPC.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(ape.ChainTarget) + if err := reqBody.target.FromGRPCMessage(targetgrpc); err != nil { + return err + } + } + + if chaingrpc := reqBodygrpc.GetChain(); chaingrpc != nil { + reqBody.chain = new(ape.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().(*apeGRPC.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(ape.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().(*apeGRPC.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(ape.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([]apeGRPC.Chain, 0, len(respBody.GetChains())) + for _, chain := range respBody.GetChains() { + chainsgrpc = append(chainsgrpc, *chain.ToGRPCMessage().(*apeGRPC.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([]*ape.Chain, 0, len(respBodygrpc.GetChains())) + + for _, chaingrpc := range respBodygrpc.GetChains() { + chain := new(ape.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/api/apemanager/grpc/service_frostfs.pb.go b/api/apemanager/grpc/service_frostfs.pb.go new file mode 100644 index 0000000..402c908 --- /dev/null +++ b/api/apemanager/grpc/service_frostfs.pb.go @@ -0,0 +1,2337 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package apemanager + +import ( + json "encoding/json" + fmt "fmt" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape/grpc" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" +) + +type 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.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Chain != nil { + 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 + } + first := true + out.RawByte('{') + { + 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 = "\"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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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 + } + first := true + out.RawByte('{') + { + 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('}') +} + +// 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 + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.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 + } + first := true + out.RawByte('{') + { + 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 = "\"chainId\":" + out.RawString(prefix) + if x.ChainId != nil { + out.Base64Bytes(x.ChainId) + } else { + out.String("") + } + } + 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 + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"target\":" + out.RawString(prefix) + 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.NestedStructureSizeUnchecked(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 { + 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, 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 + } + first := true + 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('}') +} + +// 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 = 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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/api/apemanager/grpc/service_frostfs_fuzz.go b/api/apemanager/grpc/service_frostfs_fuzz.go new file mode 100644 index 0000000..08af63e --- /dev/null +++ b/api/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/api/apemanager/grpc/service_frostfs_test.go b/api/apemanager/grpc/service_frostfs_test.go new file mode 100644 index 0000000..5c4653c --- /dev/null +++ b/api/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/api/apemanager/grpc/service_grpc.pb.go b/api/apemanager/grpc/service_grpc.pb.go new file mode 100644 index 0000000..eb11f3f --- /dev/null +++ b/api/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 v5.27.2 +// source: api/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: "api/apemanager/grpc/service.proto", +} diff --git a/api/apemanager/marshal.go b/api/apemanager/marshal.go new file mode 100644 index 0000000..ac6fdde --- /dev/null +++ b/api/apemanager/marshal.go @@ -0,0 +1,205 @@ +package apemanager + +import ( + apemanager "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/apemanager/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" +) + +const ( + addChainReqBodyTargetField = 1 + addChainReqBodyChainField = 2 + + addChainRespBodyChainIDField = 1 + + removeChainReqBodyTargetField = 1 + removeChainReqBodyChainField = 2 + + /* + Fields for RemoveResponseBody are missed since RemoveResponseBody is empty. + */ + + listChainsReqBodyTargetField = 1 + + listChainsRespBodyChainsField = 1 +) + +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/api/apemanager/message_test.go b/api/apemanager/message_test.go new file mode 100644 index 0000000..d64688c --- /dev/null +++ b/api/apemanager/message_test.go @@ -0,0 +1,26 @@ +package apemanager_test + +import ( + "testing" + + apemanagertest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/apemanager/test" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message/test" +) + +func TestMessageConvert(t *testing.T) { + messagetest.TestRPCMessage(t, + 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/api/apemanager/status.go b/api/apemanager/status.go new file mode 100644 index 0000000..3b7f435 --- /dev/null +++ b/api/apemanager/status.go @@ -0,0 +1,76 @@ +package apemanager + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status" + statusgrpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/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/api/apemanager/status_test.go b/api/apemanager/status_test.go new file mode 100644 index 0000000..af6cd66 --- /dev/null +++ b/api/apemanager/status_test.go @@ -0,0 +1,30 @@ +package apemanager_test + +import ( + "testing" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/apemanager" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status" + statustest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/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/api/apemanager/test/generate.go b/api/apemanager/test/generate.go new file mode 100644 index 0000000..47427d7 --- /dev/null +++ b/api/apemanager/test/generate.go @@ -0,0 +1,143 @@ +package apemanagertest + +import ( + apetest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape/test" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/apemanager" + sessiontest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/test" +) + +func generateChainID(empty bool) []byte { + if empty { + return []byte{} + } + + return []byte("616c6c6f774f626a476574436e72") +} + +func GenerateAddChainRequestBody(empty bool) *apemanager.AddChainRequestBody { + m := new(apemanager.AddChainRequestBody) + + if !empty { + m.SetTarget(apetest.GenerateChainTarget(empty)) + m.SetChain(apetest.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(apetest.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(apetest.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(apetest.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/api/apemanager/types.go b/api/apemanager/types.go new file mode 100644 index 0000000..077488b --- /dev/null +++ b/api/apemanager/types.go @@ -0,0 +1,226 @@ +package apemanager + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" +) + +type AddChainRequest struct { + body *AddChainRequestBody + + session.RequestHeaders +} + +func (r *AddChainRequest) SetBody(body *AddChainRequestBody) { + r.body = body +} + +func (r *AddChainRequest) GetBody() *AddChainRequestBody { + if r == nil { + return nil + } + + return r.body +} + +type AddChainRequestBody struct { + target *ape.ChainTarget + + chain *ape.Chain +} + +func (rb *AddChainRequestBody) SetTarget(target *ape.ChainTarget) { + rb.target = target +} + +func (rb *AddChainRequestBody) GetTarget() *ape.ChainTarget { + if rb == nil { + return nil + } + + return rb.target +} + +func (rb *AddChainRequestBody) SetChain(chain *ape.Chain) { + rb.chain = chain +} + +func (rb *AddChainRequestBody) GetChain() *ape.Chain { + if rb == nil { + return nil + } + + return rb.chain +} + +type AddChainResponse struct { + body *AddChainResponseBody + + session.ResponseHeaders +} + +func (r *AddChainResponse) SetBody(body *AddChainResponseBody) { + r.body = body +} + +func (r *AddChainResponse) GetBody() *AddChainResponseBody { + if r == nil { + return nil + } + + return r.body +} + +type AddChainResponseBody struct { + chainID []byte +} + +func (rb *AddChainResponseBody) SetChainID(chainID []byte) { + rb.chainID = chainID +} + +func (rb *AddChainResponseBody) GetChainID() []byte { + if rb == nil { + return nil + } + + return rb.chainID +} + +type RemoveChainRequest struct { + body *RemoveChainRequestBody + + session.RequestHeaders +} + +func (r *RemoveChainRequest) SetBody(body *RemoveChainRequestBody) { + r.body = body +} + +func (r *RemoveChainRequest) GetBody() *RemoveChainRequestBody { + if r == nil { + return nil + } + + return r.body +} + +type RemoveChainRequestBody struct { + target *ape.ChainTarget + + chainID []byte +} + +func (rb *RemoveChainRequestBody) SetTarget(target *ape.ChainTarget) { + rb.target = target +} + +func (rb *RemoveChainRequestBody) GetTarget() *ape.ChainTarget { + if rb == nil { + return nil + } + + return rb.target +} + +func (rb *RemoveChainRequestBody) SetChainID(chainID []byte) { + rb.chainID = chainID +} + +func (rb *RemoveChainRequestBody) GetChainID() []byte { + if rb == nil { + return nil + } + + 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 { + if r == nil { + return nil + } + + return r.body +} + +type ListChainsRequest struct { + body *ListChainsRequestBody + + session.RequestHeaders +} + +func (r *ListChainsRequest) SetBody(body *ListChainsRequestBody) { + r.body = body +} + +func (r *ListChainsRequest) GetBody() *ListChainsRequestBody { + if r == nil { + return nil + } + + return r.body +} + +type ListChainsRequestBody struct { + target *ape.ChainTarget +} + +func (rb *ListChainsRequestBody) SetTarget(target *ape.ChainTarget) { + rb.target = target +} + +func (rb *ListChainsRequestBody) GetTarget() *ape.ChainTarget { + if rb == nil { + return nil + } + + return rb.target +} + +type ListChainsResponse struct { + body *ListChainsResponseBody + + session.ResponseHeaders +} + +func (r *ListChainsResponse) SetBody(body *ListChainsResponseBody) { + r.body = body +} + +func (r *ListChainsResponse) GetBody() *ListChainsResponseBody { + if r == nil { + return nil + } + + return r.body +} + +type ListChainsResponseBody struct { + chains []*ape.Chain + + session.RequestHeaders +} + +func (r *ListChainsResponseBody) SetChains(chains []*ape.Chain) { + r.chains = chains +} + +func (r *ListChainsResponseBody) GetChains() []*ape.Chain { + if r == nil { + return nil + } + + return r.chains +} diff --git a/api/container/attributes.go b/api/container/attributes.go new file mode 100644 index 0000000..288d048 --- /dev/null +++ b/api/container/attributes.go @@ -0,0 +1,90 @@ +package container + +// SysAttributePrefix is a prefix of key to system attribute. +const SysAttributePrefix = "__SYSTEM__" + +const ( + // SysAttributeName is a string of human-friendly container name registered as the domain in NNS contract. + SysAttributeName = SysAttributePrefix + "NAME" + + // SysAttributeZone is a string of zone for container name. + SysAttributeZone = SysAttributePrefix + "ZONE" + + // SysAttributeHomomorphicHashing is a container's homomorphic hashing state. + SysAttributeHomomorphicHashing = SysAttributePrefix + "DISABLE_HOMOMORPHIC_HASHING" +) + +// SysAttributePrefixNeoFS is a prefix of key to system attribute. +// 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. + 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" +) + +// SysAttributeZoneDefault is a default value for SysAttributeZone attribute. +const SysAttributeZoneDefault = "container" + +const disabledHomomorphicHashingValue = "true" + +// HomomorphicHashingState returns container's homomorphic +// hashing state: +// - true if hashing is enabled; +// - false if hashing is disabled. +// +// All container's attributes must be unique, otherwise behavior +// is undefined. +// +// See also SetHomomorphicHashingState. +func (c Container) HomomorphicHashingState() bool { + for i := range c.attr { + if c.attr[i].GetKey() == SysAttributeHomomorphicHashing || c.attr[i].GetKey() == SysAttributeHomomorphicHashingNeoFS { + return c.attr[i].GetValue() != disabledHomomorphicHashingValue + } + } + + return true +} + +// SetHomomorphicHashingState sets homomorphic hashing state for +// container. +// +// All container's attributes must be unique, otherwise behavior +// is undefined. +// +// See also HomomorphicHashingState. +func (c *Container) SetHomomorphicHashingState(enable bool) { + for i := range c.attr { + if c.attr[i].GetKey() == SysAttributeHomomorphicHashing || c.attr[i].GetKey() == SysAttributeHomomorphicHashingNeoFS { + if enable { + // approach without allocation/waste + // coping works since the attributes + // order is not important + c.attr[i] = c.attr[len(c.attr)-1] + c.attr = c.attr[:len(c.attr)-1] + } else { + c.attr[i].SetValue(disabledHomomorphicHashingValue) + } + + return + } + } + + if !enable { + attr := Attribute{} + attr.SetKey(SysAttributeHomomorphicHashing) + attr.SetValue(disabledHomomorphicHashingValue) + + c.attr = append(c.attr, attr) + } +} diff --git a/api/container/attributes_test.go b/api/container/attributes_test.go new file mode 100644 index 0000000..2b00d33 --- /dev/null +++ b/api/container/attributes_test.go @@ -0,0 +1,59 @@ +package container_test + +import ( + "testing" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container" + containertest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container/test" + "github.com/stretchr/testify/require" +) + +func TestContainer_HomomorphicHashingDisabled(t *testing.T) { + cnr := containertest.GenerateContainer(false) + + t.Run("defaults", func(t *testing.T) { + require.True(t, cnr.HomomorphicHashingState()) + }) + + t.Run("disabled", func(t *testing.T) { + attr := container.Attribute{} + attr.SetKey(container.SysAttributeHomomorphicHashing) + attr.SetValue("NOT_true") + + cnr.SetAttributes(append(cnr.GetAttributes(), attr)) + require.True(t, cnr.HomomorphicHashingState()) + + attr.SetValue("true") + + cnr.SetAttributes([]container.Attribute{attr}) + require.False(t, cnr.HomomorphicHashingState()) + }) +} + +func TestContainer_SetHomomorphicHashingState(t *testing.T) { + cnr := containertest.GenerateContainer(false) + attrs := cnr.GetAttributes() + attrLen := len(attrs) + + cnr.SetHomomorphicHashingState(true) + + // enabling hashing should not add any new attributes + require.Equal(t, attrLen, len(cnr.GetAttributes())) + require.True(t, cnr.HomomorphicHashingState()) + + cnr.SetHomomorphicHashingState(false) + + // disabling hashing should add exactly one attribute + require.Equal(t, attrLen+1, len(cnr.GetAttributes())) + require.False(t, cnr.HomomorphicHashingState()) + + cnr.SetHomomorphicHashingState(true) + + // enabling hashing should remove 1 attribute if + // hashing was disabled before + require.Equal(t, attrLen, len(cnr.GetAttributes())) + require.True(t, cnr.HomomorphicHashingState()) + + // hashing operations should not change any other attributes + require.ElementsMatch(t, attrs, cnr.GetAttributes()) +} diff --git a/api/container/convert.go b/api/container/convert.go new file mode 100644 index 0000000..c91bdfd --- /dev/null +++ b/api/container/convert.go @@ -0,0 +1,764 @@ +package container + +import ( + container "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" + netmapGRPC "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" +) + +func (a *Attribute) ToGRPCMessage() grpc.Message { + var m *container.Container_Attribute + + if a != nil { + m = new(container.Container_Attribute) + + m.SetKey(a.key) + m.SetValue(a.val) + } + + return m +} + +func (a *Attribute) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.Container_Attribute) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + a.key = v.GetKey() + a.val = v.GetValue() + + return nil +} + +func AttributesToGRPC(xs []Attribute) (res []container.Container_Attribute) { + if xs != nil { + res = make([]container.Container_Attribute, 0, len(xs)) + + for i := range xs { + res = append(res, *xs[i].ToGRPCMessage().(*container.Container_Attribute)) + } + } + + return +} + +func AttributesFromGRPC(xs []container.Container_Attribute) (res []Attribute, err error) { + if xs != nil { + res = make([]Attribute, len(xs)) + + for i := range xs { + err = res[i].FromGRPCMessage(&xs[i]) + if err != nil { + return + } + } + } + + return +} + +func (c *Container) ToGRPCMessage() grpc.Message { + var m *container.Container + + if c != nil { + m = new(container.Container) + + m.SetVersion(c.version.ToGRPCMessage().(*refsGRPC.Version)) + m.SetOwnerId(c.ownerID.ToGRPCMessage().(*refsGRPC.OwnerID)) + m.SetPlacementPolicy(c.policy.ToGRPCMessage().(*netmapGRPC.PlacementPolicy)) + m.SetAttributes(AttributesToGRPC(c.attr)) + m.SetBasicAcl(c.basicACL) + m.SetNonce(c.nonce) + } + + return m +} + +func (c *Container) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.Container) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + version := v.GetVersion() + if version == nil { + c.version = nil + } else { + if c.version == nil { + c.version = new(refs.Version) + } + + err = c.version.FromGRPCMessage(version) + if err != nil { + return err + } + } + + ownerID := v.GetOwnerId() + if ownerID == nil { + c.ownerID = nil + } else { + if c.ownerID == nil { + c.ownerID = new(refs.OwnerID) + } + + err = c.ownerID.FromGRPCMessage(ownerID) + if err != nil { + return err + } + } + + policy := v.GetPlacementPolicy() + if policy == nil { + c.policy = nil + } else { + if c.policy == nil { + c.policy = new(netmap.PlacementPolicy) + } + + err = c.policy.FromGRPCMessage(policy) + if err != nil { + return err + } + } + + c.attr, err = AttributesFromGRPC(v.GetAttributes()) + if err != nil { + return err + } + + c.basicACL = v.GetBasicAcl() + c.nonce = v.GetNonce() + + return nil +} + +func toSignatureRFC6979(s *refs.Signature) *refsGRPC.SignatureRFC6979 { + var res *refsGRPC.SignatureRFC6979 + + if s != nil { + res = new(refsGRPC.SignatureRFC6979) + res.SetKey(s.GetKey()) + res.SetSign(s.GetSign()) + } + + return res +} + +func (r *PutRequestBody) ToGRPCMessage() grpc.Message { + var m *container.PutRequest_Body + + if r != nil { + m = new(container.PutRequest_Body) + + m.SetContainer(r.cnr.ToGRPCMessage().(*container.Container)) + m.SetSignature(toSignatureRFC6979(r.sig)) + } + + return m +} + +func (r *PutRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.PutRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + cnr := v.GetContainer() + if cnr == nil { + r.cnr = nil + } else { + if r.cnr == nil { + r.cnr = new(Container) + } + + err = r.cnr.FromGRPCMessage(cnr) + 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 *PutRequest) ToGRPCMessage() grpc.Message { + var m *container.PutRequest + + if r != nil { + m = new(container.PutRequest) + + m.SetBody(r.body.ToGRPCMessage().(*container.PutRequest_Body)) + r.RequestHeaders.ToMessage(m) + } + + return m +} + +func (r *PutRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.PutRequest) + 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(PutRequestBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.RequestHeaders.FromMessage(v) +} + +func (r *PutResponseBody) ToGRPCMessage() grpc.Message { + var m *container.PutResponse_Body + + if r != nil { + m = new(container.PutResponse_Body) + + m.SetContainerId(r.cid.ToGRPCMessage().(*refsGRPC.ContainerID)) + } + + return m +} + +func (r *PutResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.PutResponse_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 *PutResponse) ToGRPCMessage() grpc.Message { + var m *container.PutResponse + + if r != nil { + m = new(container.PutResponse) + + m.SetBody(r.body.ToGRPCMessage().(*container.PutResponse_Body)) + r.ResponseHeaders.ToMessage(m) + } + + return m +} + +func (r *PutResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.PutResponse) + 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(PutResponseBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.ResponseHeaders.FromMessage(v) +} + +func (r *GetRequestBody) ToGRPCMessage() grpc.Message { + var m *container.GetRequest_Body + + if r != nil { + m = new(container.GetRequest_Body) + + m.SetContainerId(r.cid.ToGRPCMessage().(*refsGRPC.ContainerID)) + } + + return m +} + +func (r *GetRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.GetRequest_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 *GetRequest) ToGRPCMessage() grpc.Message { + var m *container.GetRequest + + if r != nil { + m = new(container.GetRequest) + + m.SetBody(r.body.ToGRPCMessage().(*container.GetRequest_Body)) + r.RequestHeaders.ToMessage(m) + } + + return m +} + +func (r *GetRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.GetRequest) + 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(GetRequestBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.RequestHeaders.FromMessage(v) +} + +func (r *GetResponseBody) ToGRPCMessage() grpc.Message { + var m *container.GetResponse_Body + + if r != nil { + m = new(container.GetResponse_Body) + + m.SetContainer(r.cnr.ToGRPCMessage().(*container.Container)) + m.SetSessionToken(r.token.ToGRPCMessage().(*sessionGRPC.SessionToken)) + m.SetSignature(toSignatureRFC6979(r.sig)) + } + + return m +} + +func (r *GetResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.GetResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + cnr := v.GetContainer() + if cnr == nil { + r.cnr = nil + } else { + if r.cnr == nil { + r.cnr = new(Container) + } + + err = r.cnr.FromGRPCMessage(cnr) + } + + 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 *GetResponse) ToGRPCMessage() grpc.Message { + var m *container.GetResponse + + if r != nil { + m = new(container.GetResponse) + + m.SetBody(r.body.ToGRPCMessage().(*container.GetResponse_Body)) + r.ResponseHeaders.ToMessage(m) + } + + return m +} + +func (r *GetResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.GetResponse) + 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(GetResponseBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.ResponseHeaders.FromMessage(v) +} + +func (r *DeleteRequestBody) ToGRPCMessage() grpc.Message { + var m *container.DeleteRequest_Body + + if r != nil { + m = new(container.DeleteRequest_Body) + + m.SetContainerId(r.cid.ToGRPCMessage().(*refsGRPC.ContainerID)) + m.SetSignature(toSignatureRFC6979(r.sig)) + } + + return m +} + +func (r *DeleteRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.DeleteRequest_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) + 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 *DeleteRequest) ToGRPCMessage() grpc.Message { + var m *container.DeleteRequest + + if r != nil { + m = new(container.DeleteRequest) + + m.SetBody(r.body.ToGRPCMessage().(*container.DeleteRequest_Body)) + r.RequestHeaders.ToMessage(m) + } + + return m +} + +func (r *DeleteRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.DeleteRequest) + 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(DeleteRequestBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.RequestHeaders.FromMessage(v) +} + +func (r *DeleteResponseBody) ToGRPCMessage() grpc.Message { + var m *container.DeleteResponse_Body + + if r != nil { + m = new(container.DeleteResponse_Body) + } + + return m +} + +func (r *DeleteResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.DeleteResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + return nil +} + +func (r *DeleteResponse) ToGRPCMessage() grpc.Message { + var m *container.DeleteResponse + + if r != nil { + m = new(container.DeleteResponse) + + m.SetBody(r.body.ToGRPCMessage().(*container.DeleteResponse_Body)) + r.ResponseHeaders.ToMessage(m) + } + + return m +} + +func (r *DeleteResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.DeleteResponse) + 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(DeleteResponseBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.ResponseHeaders.FromMessage(v) +} + +func (r *ListRequestBody) ToGRPCMessage() grpc.Message { + var m *container.ListRequest_Body + + if r != nil { + m = new(container.ListRequest_Body) + + m.SetOwnerId(r.ownerID.ToGRPCMessage().(*refsGRPC.OwnerID)) + } + + return m +} + +func (r *ListRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.ListRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + ownerID := v.GetOwnerId() + if ownerID == nil { + r.ownerID = nil + } else { + if r.ownerID == nil { + r.ownerID = new(refs.OwnerID) + } + + err = r.ownerID.FromGRPCMessage(ownerID) + } + + return err +} + +func (r *ListRequest) ToGRPCMessage() grpc.Message { + var m *container.ListRequest + + if r != nil { + m = new(container.ListRequest) + + m.SetBody(r.body.ToGRPCMessage().(*container.ListRequest_Body)) + r.RequestHeaders.ToMessage(m) + } + + return m +} + +func (r *ListRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.ListRequest) + 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(ListRequestBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.RequestHeaders.FromMessage(v) +} + +func (r *ListResponseBody) ToGRPCMessage() grpc.Message { + var m *container.ListResponse_Body + + if r != nil { + m = new(container.ListResponse_Body) + + m.SetContainerIds(refs.ContainerIDsToGRPCMessage(r.cidList)) + } + + return m +} + +func (r *ListResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.ListResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + r.cidList, err = refs.ContainerIDsFromGRPCMessage(v.GetContainerIds()) + + return err +} + +func (r *ListResponse) ToGRPCMessage() grpc.Message { + var m *container.ListResponse + + if r != nil { + m = new(container.ListResponse) + + m.SetBody(r.body.ToGRPCMessage().(*container.ListResponse_Body)) + r.ResponseHeaders.ToMessage(m) + } + + return m +} + +func (r *ListResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.ListResponse) + 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(ListResponseBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.ResponseHeaders.FromMessage(v) +} diff --git a/api/container/grpc/service_frostfs.pb.go b/api/container/grpc/service_frostfs.pb.go new file mode 100644 index 0000000..0743824 --- /dev/null +++ b/api/container/grpc/service_frostfs.pb.go @@ -0,0 +1,3157 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package container + +import ( + json "encoding/json" + fmt "fmt" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" +) + +type 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.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Signature != nil { + 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 + } + first := true + out.RawByte('{') + { + 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 = "\"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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"containerId\":" + out.RawString(prefix) + 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Signature != nil { + 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 + } + first := true + out.RawByte('{') + { + 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 = "\"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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"containerId\":" + out.RawString(prefix) + 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.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 *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 + } + first := true + out.RawByte('{') + { + 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 = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ownerId\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.NestedStructureSizeUnchecked(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 { + 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, 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 + } + first := true + 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('}') +} + +// 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 = 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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() + } +} diff --git a/api/container/grpc/service_frostfs_fuzz.go b/api/container/grpc/service_frostfs_fuzz.go new file mode 100644 index 0000000..7e6d6e6 --- /dev/null +++ b/api/container/grpc/service_frostfs_fuzz.go @@ -0,0 +1,159 @@ +//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 +} diff --git a/api/container/grpc/service_frostfs_test.go b/api/container/grpc/service_frostfs_test.go new file mode 100644 index 0000000..804b89c --- /dev/null +++ b/api/container/grpc/service_frostfs_test.go @@ -0,0 +1,91 @@ +//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) + }) +} diff --git a/api/container/grpc/service_grpc.pb.go b/api/container/grpc/service_grpc.pb.go new file mode 100644 index 0000000..ea22604 --- /dev/null +++ b/api/container/grpc/service_grpc.pb.go @@ -0,0 +1,298 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v5.27.2 +// source: api/container/grpc/service.proto + +package container + +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 ( + 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. +// +// 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 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. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // request to save the container has been sent to the sidechain; + // - 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 + // verified by Inner Ring nodes. After one more block in sidechain, the + // container 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); + // - **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. + // + // 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; + // - **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); + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // container list access denied. + List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) +} + +type containerServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewContainerServiceClient(cc grpc.ClientConnInterface) ContainerServiceClient { + return &containerServiceClient{cc} +} + +func (c *containerServiceClient) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) { + out := new(PutResponse) + err := c.cc.Invoke(ctx, ContainerService_Put_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { + out := new(DeleteResponse) + err := c.cc.Invoke(ctx, ContainerService_Delete_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { + out := new(GetResponse) + err := c.cc.Invoke(ctx, ContainerService_Get_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerServiceClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) { + out := new(ListResponse) + err := c.cc.Invoke(ctx, ContainerService_List_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 +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. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // request to save the container has been sent to the sidechain; + // - 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 + // verified by Inner Ring nodes. After one more block in sidechain, the + // container 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); + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // container delete access denied. + 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; + // - **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); + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // container list access denied. + List(context.Context, *ListRequest) (*ListResponse, error) +} + +// UnimplementedContainerServiceServer should be embedded to have forward compatible implementations. +type UnimplementedContainerServiceServer struct { +} + +func (UnimplementedContainerServiceServer) Put(context.Context, *PutRequest) (*PutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Put not implemented") +} +func (UnimplementedContainerServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") +} +func (UnimplementedContainerServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") +} +func (UnimplementedContainerServiceServer) List(context.Context, *ListRequest) (*ListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method List 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 +// result in compilation errors. +type UnsafeContainerServiceServer interface { + mustEmbedUnimplementedContainerServiceServer() +} + +func RegisterContainerServiceServer(s grpc.ServiceRegistrar, srv ContainerServiceServer) { + s.RegisterService(&ContainerService_ServiceDesc, srv) +} + +func _ContainerService_Put_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PutRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerServiceServer).Put(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ContainerService_Put_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerServiceServer).Put(ctx, req.(*PutRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerServiceServer).Delete(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ContainerService_Delete_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerServiceServer).Delete(ctx, req.(*DeleteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerServiceServer).Get(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ContainerService_Get_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerServiceServer).Get(ctx, req.(*GetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerServiceServer).List(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ContainerService_List_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerServiceServer).List(ctx, req.(*ListRequest)) + } + 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) +var ContainerService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "neo.fs.v2.container.ContainerService", + HandlerType: (*ContainerServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Put", + Handler: _ContainerService_Put_Handler, + }, + { + MethodName: "Delete", + Handler: _ContainerService_Delete_Handler, + }, + { + MethodName: "Get", + Handler: _ContainerService_Get_Handler, + }, + { + MethodName: "List", + Handler: _ContainerService_List_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/container/grpc/service.proto", +} diff --git a/api/container/grpc/types_frostfs.pb.go b/api/container/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..fa4aead --- /dev/null +++ b/api/container/grpc/types_frostfs.pb.go @@ -0,0 +1,554 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package container + +import ( + json "encoding/json" + fmt "fmt" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" +) + +type Container_Attribute struct { + Key string `json:"key"` + Value string `json:"value"` +} + +var ( + _ encoding.ProtoMarshaler = (*Container_Attribute)(nil) + _ encoding.ProtoUnmarshaler = (*Container_Attribute)(nil) + _ json.Marshaler = (*Container_Attribute)(nil) + _ json.Unmarshaler = (*Container_Attribute)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Container_Attribute) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.StringSize(1, x.Key) + size += proto.StringSize(2, x.Value) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Container_Attribute) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *Container_Attribute) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if len(x.Key) != 0 { + mm.AppendString(1, x.Key) + } + if len(x.Value) != 0 { + mm.AppendString(2, x.Value) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Container_Attribute) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "Container_Attribute") + } + switch fc.FieldNum { + case 1: // Key + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Key") + } + x.Key = data + case 2: // Value + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Value") + } + x.Value = data + } + } + return nil +} +func (x *Container_Attribute) GetKey() string { + if x != nil { + return x.Key + } + return "" +} +func (x *Container_Attribute) SetKey(v string) { + x.Key = v +} +func (x *Container_Attribute) GetValue() string { + if x != nil { + return x.Value + } + return "" +} +func (x *Container_Attribute) SetValue(v string) { + x.Value = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Container_Attribute) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Container_Attribute) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"key\":" + out.RawString(prefix) + out.String(x.Key) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + out.String(x.Value) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Container_Attribute) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Container_Attribute) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "key": + { + var f string + f = in.String() + x.Key = f + } + case "value": + { + var f string + f = in.String() + x.Value = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type Container struct { + Version *grpc.Version `json:"version"` + OwnerId *grpc.OwnerID `json:"ownerID"` + Nonce []byte `json:"nonce"` + BasicAcl uint32 `json:"basicACL"` + Attributes []Container_Attribute `json:"attributes"` + PlacementPolicy *grpc1.PlacementPolicy `json:"placementPolicy"` +} + +var ( + _ encoding.ProtoMarshaler = (*Container)(nil) + _ encoding.ProtoUnmarshaler = (*Container)(nil) + _ json.Marshaler = (*Container)(nil) + _ json.Unmarshaler = (*Container)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Container) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Version) + size += proto.NestedStructureSize(2, x.OwnerId) + size += proto.BytesSize(3, x.Nonce) + size += proto.UInt32Size(4, x.BasicAcl) + for i := range x.Attributes { + size += proto.NestedStructureSizeUnchecked(5, &x.Attributes[i]) + } + size += proto.NestedStructureSize(6, x.PlacementPolicy) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Container) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *Container) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Version != nil { + x.Version.EmitProtobuf(mm.AppendMessage(1)) + } + if x.OwnerId != nil { + x.OwnerId.EmitProtobuf(mm.AppendMessage(2)) + } + if len(x.Nonce) != 0 { + mm.AppendBytes(3, x.Nonce) + } + if x.BasicAcl != 0 { + mm.AppendUint32(4, x.BasicAcl) + } + for i := range x.Attributes { + x.Attributes[i].EmitProtobuf(mm.AppendMessage(5)) + } + if x.PlacementPolicy != nil { + x.PlacementPolicy.EmitProtobuf(mm.AppendMessage(6)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Container) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "Container") + } + switch fc.FieldNum { + case 1: // Version + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Version") + } + x.Version = new(grpc.Version) + if err := x.Version.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // OwnerId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "OwnerId") + } + x.OwnerId = new(grpc.OwnerID) + if err := x.OwnerId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // Nonce + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Nonce") + } + x.Nonce = data + case 4: // BasicAcl + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "BasicAcl") + } + x.BasicAcl = data + case 5: // Attributes + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Attributes") + } + x.Attributes = append(x.Attributes, Container_Attribute{}) + ff := &x.Attributes[len(x.Attributes)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 6: // PlacementPolicy + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "PlacementPolicy") + } + x.PlacementPolicy = new(grpc1.PlacementPolicy) + if err := x.PlacementPolicy.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *Container) GetVersion() *grpc.Version { + if x != nil { + return x.Version + } + return nil +} +func (x *Container) SetVersion(v *grpc.Version) { + x.Version = v +} +func (x *Container) GetOwnerId() *grpc.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} +func (x *Container) SetOwnerId(v *grpc.OwnerID) { + x.OwnerId = v +} +func (x *Container) GetNonce() []byte { + if x != nil { + return x.Nonce + } + return nil +} +func (x *Container) SetNonce(v []byte) { + x.Nonce = v +} +func (x *Container) GetBasicAcl() uint32 { + if x != nil { + return x.BasicAcl + } + return 0 +} +func (x *Container) SetBasicAcl(v uint32) { + x.BasicAcl = v +} +func (x *Container) GetAttributes() []Container_Attribute { + if x != nil { + return x.Attributes + } + return nil +} +func (x *Container) SetAttributes(v []Container_Attribute) { + x.Attributes = v +} +func (x *Container) GetPlacementPolicy() *grpc1.PlacementPolicy { + if x != nil { + return x.PlacementPolicy + } + return nil +} +func (x *Container) SetPlacementPolicy(v *grpc1.PlacementPolicy) { + x.PlacementPolicy = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Container) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Container) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"version\":" + out.RawString(prefix) + x.Version.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ownerID\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"nonce\":" + out.RawString(prefix) + if x.Nonce != nil { + out.Base64Bytes(x.Nonce) + } else { + out.String("") + } + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"basicACL\":" + out.RawString(prefix) + out.Uint32(x.BasicAcl) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"attributes\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Attributes { + if i != 0 { + out.RawByte(',') + } + x.Attributes[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"placementPolicy\":" + out.RawString(prefix) + x.PlacementPolicy.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Container) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Container) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "version": + { + var f *grpc.Version + f = new(grpc.Version) + f.UnmarshalEasyJSON(in) + x.Version = f + } + case "ownerID": + { + var f *grpc.OwnerID + f = new(grpc.OwnerID) + f.UnmarshalEasyJSON(in) + x.OwnerId = f + } + case "nonce": + { + var f []byte + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + x.Nonce = f + } + case "basicACL": + { + var f uint32 + r := in.JsonNumber() + n := r.String() + v, err := strconv.ParseUint(n, 10, 32) + if err != nil { + in.AddError(err) + return + } + pv := uint32(v) + f = pv + x.BasicAcl = f + } + case "attributes": + { + var f Container_Attribute + var list []Container_Attribute + in.Delim('[') + for !in.IsDelim(']') { + f = Container_Attribute{} + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Attributes = list + in.Delim(']') + } + case "placementPolicy": + { + var f *grpc1.PlacementPolicy + f = new(grpc1.PlacementPolicy) + f.UnmarshalEasyJSON(in) + x.PlacementPolicy = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/api/container/grpc/types_frostfs_fuzz.go b/api/container/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..5551978 --- /dev/null +++ b/api/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/api/container/grpc/types_frostfs_test.go b/api/container/grpc/types_frostfs_test.go new file mode 100644 index 0000000..64d840e --- /dev/null +++ b/api/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/api/container/json.go b/api/container/json.go new file mode 100644 index 0000000..838fb8d --- /dev/null +++ b/api/container/json.go @@ -0,0 +1,22 @@ +package container + +import ( + container "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" +) + +func (a *Attribute) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(a) +} + +func (a *Attribute) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(a, data, new(container.Container_Attribute)) +} + +func (c *Container) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(c) +} + +func (c *Container) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(c, data, new(container.Container)) +} diff --git a/api/container/marshal.go b/api/container/marshal.go new file mode 100644 index 0000000..2b16669 --- /dev/null +++ b/api/container/marshal.go @@ -0,0 +1,345 @@ +package container + +import ( + container "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + protoutil "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" +) + +const ( + attributeKeyField = 1 + attributeValueField = 2 + + containerVersionField = 1 + containerOwnerField = 2 + containerNonceField = 3 + containerBasicACLField = 4 + containerAttributesField = 5 + containerPlacementField = 6 + + putReqBodyContainerField = 1 + putReqBodySignatureField = 2 + + putRespBodyIDField = 1 + + deleteReqBodyIDField = 1 + deleteReqBodySignatureField = 2 + + getReqBodyIDField = 1 + + getRespBodyContainerField = 1 + getRespBodySignatureField = 2 + getRespBodyTokenField = 3 + + listReqBodyOwnerField = 1 + + listRespBodyIDsField = 1 +) + +func (a *Attribute) StableMarshal(buf []byte) []byte { + if a == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, a.StableSize()) + } + + var offset int + + offset += protoutil.StringMarshal(attributeKeyField, buf[offset:], a.key) + protoutil.StringMarshal(attributeValueField, buf[offset:], a.val) + + return buf +} + +func (a *Attribute) StableSize() (size int) { + if a == nil { + return 0 + } + + size += protoutil.StringSize(attributeKeyField, a.key) + size += protoutil.StringSize(attributeValueField, a.val) + + return size +} + +func (a *Attribute) Unmarshal(data []byte) error { + return message.Unmarshal(a, data, new(container.Container_Attribute)) +} + +func (c *Container) StableMarshal(buf []byte) []byte { + if c == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, c.StableSize()) + } + + var offset int + + offset += protoutil.NestedStructureMarshal(containerVersionField, buf[offset:], c.version) + offset += protoutil.NestedStructureMarshal(containerOwnerField, buf[offset:], c.ownerID) + offset += protoutil.BytesMarshal(containerNonceField, buf[offset:], c.nonce) + offset += protoutil.UInt32Marshal(containerBasicACLField, buf[offset:], c.basicACL) + + for i := range c.attr { + offset += protoutil.NestedStructureMarshal(containerAttributesField, buf[offset:], &c.attr[i]) + } + + protoutil.NestedStructureMarshal(containerPlacementField, buf[offset:], c.policy) + + return buf +} + +func (c *Container) StableSize() (size int) { + if c == nil { + return 0 + } + + size += protoutil.NestedStructureSize(containerVersionField, c.version) + size += protoutil.NestedStructureSize(containerOwnerField, c.ownerID) + size += protoutil.BytesSize(containerNonceField, c.nonce) + size += protoutil.UInt32Size(containerBasicACLField, c.basicACL) + + for i := range c.attr { + size += protoutil.NestedStructureSize(containerAttributesField, &c.attr[i]) + } + + size += protoutil.NestedStructureSize(containerPlacementField, c.policy) + + return size +} + +func (c *Container) Unmarshal(data []byte) error { + return message.Unmarshal(c, data, new(container.Container)) +} + +func (r *PutRequestBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + + offset += protoutil.NestedStructureMarshal(putReqBodyContainerField, buf[offset:], r.cnr) + protoutil.NestedStructureMarshal(putReqBodySignatureField, buf[offset:], r.sig) + + return buf +} + +func (r *PutRequestBody) StableSize() (size int) { + if r == nil { + return 0 + } + + size += protoutil.NestedStructureSize(putReqBodyContainerField, r.cnr) + size += protoutil.NestedStructureSize(putReqBodySignatureField, r.sig) + + return size +} + +func (r *PutRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(container.PutRequest_Body)) +} + +func (r *PutResponseBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + protoutil.NestedStructureMarshal(putRespBodyIDField, buf, r.cid) + + return buf +} + +func (r *PutResponseBody) StableSize() (size int) { + if r == nil { + return 0 + } + + size += protoutil.NestedStructureSize(putRespBodyIDField, r.cid) + + return size +} + +func (r *PutResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(container.PutResponse_Body)) +} + +func (r *DeleteRequestBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + + offset += protoutil.NestedStructureMarshal(deleteReqBodyIDField, buf[offset:], r.cid) + protoutil.NestedStructureMarshal(deleteReqBodySignatureField, buf[offset:], r.sig) + + return buf +} + +func (r *DeleteRequestBody) StableSize() (size int) { + if r == nil { + return 0 + } + + size += protoutil.NestedStructureSize(deleteReqBodyIDField, r.cid) + size += protoutil.NestedStructureSize(deleteReqBodySignatureField, r.sig) + + return size +} + +func (r *DeleteRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(container.DeleteRequest_Body)) +} + +func (r *DeleteResponseBody) StableMarshal(_ []byte) []byte { + return nil +} + +func (r *DeleteResponseBody) StableSize() (size int) { + return 0 +} + +func (r *DeleteResponseBody) Unmarshal([]byte) error { + return nil +} + +func (r *GetRequestBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + protoutil.NestedStructureMarshal(getReqBodyIDField, buf, r.cid) + + return buf +} + +func (r *GetRequestBody) StableSize() (size int) { + if r == nil { + return 0 + } + + size += protoutil.NestedStructureSize(getReqBodyIDField, r.cid) + + return size +} + +func (r *GetRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(container.GetRequest_Body)) +} + +func (r *GetResponseBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + + offset += protoutil.NestedStructureMarshal(getRespBodyContainerField, buf, r.cnr) + offset += protoutil.NestedStructureMarshal(getRespBodySignatureField, buf[offset:], r.sig) + protoutil.NestedStructureMarshal(getRespBodyTokenField, buf[offset:], r.token) + + return buf +} + +func (r *GetResponseBody) StableSize() (size int) { + if r == nil { + return 0 + } + + size += protoutil.NestedStructureSize(getRespBodyContainerField, r.cnr) + size += protoutil.NestedStructureSize(getRespBodySignatureField, r.sig) + size += protoutil.NestedStructureSize(getRespBodyTokenField, r.token) + + return size +} + +func (r *GetResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(container.GetResponse_Body)) +} + +func (r *ListRequestBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + protoutil.NestedStructureMarshal(listReqBodyOwnerField, buf, r.ownerID) + + return buf +} + +func (r *ListRequestBody) StableSize() (size int) { + if r == nil { + return 0 + } + + size += protoutil.NestedStructureSize(listReqBodyOwnerField, r.ownerID) + + return size +} + +func (r *ListRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(container.ListRequest_Body)) +} + +func (r *ListResponseBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + + for i := range r.cidList { + offset += protoutil.NestedStructureMarshal(listRespBodyIDsField, buf[offset:], &r.cidList[i]) + } + + return buf +} + +func (r *ListResponseBody) StableSize() (size int) { + if r == nil { + return 0 + } + + for i := range r.cidList { + size += protoutil.NestedStructureSize(listRespBodyIDsField, &r.cidList[i]) + } + + return size +} + +func (r *ListResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(container.ListResponse_Body)) +} diff --git a/api/container/message_test.go b/api/container/message_test.go new file mode 100644 index 0000000..b32475d --- /dev/null +++ b/api/container/message_test.go @@ -0,0 +1,36 @@ +package container_test + +import ( + "testing" + + containertest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container/test" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message/test" +) + +func TestMessageConvert(t *testing.T) { + messagetest.TestRPCMessage(t, + func(empty bool) message.Message { return containertest.GenerateAttribute(empty) }, + func(empty bool) message.Message { return containertest.GenerateContainer(empty) }, + func(empty bool) message.Message { return containertest.GeneratePutRequestBody(empty) }, + func(empty bool) message.Message { return containertest.GeneratePutRequest(empty) }, + func(empty bool) message.Message { return containertest.GeneratePutResponseBody(empty) }, + func(empty bool) message.Message { return containertest.GeneratePutResponse(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) }, + func(empty bool) message.Message { return containertest.GenerateGetResponse(empty) }, + func(empty bool) message.Message { return containertest.GenerateDeleteRequestBody(empty) }, + func(empty bool) message.Message { return containertest.GenerateDeleteRequest(empty) }, + func(empty bool) message.Message { return containertest.GenerateDeleteResponseBody(empty) }, + func(empty bool) message.Message { return containertest.GenerateDeleteResponse(empty) }, + func(empty bool) message.Message { return containertest.GenerateListRequestBody(empty) }, + 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.GenerateGetRequestBody(empty) }, + 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) }, + ) +} diff --git a/api/container/status.go b/api/container/status.go new file mode 100644 index 0000000..93b2983 --- /dev/null +++ b/api/container/status.go @@ -0,0 +1,33 @@ +package container + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status" + statusgrpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status/grpc" +) + +// LocalizeFailStatus checks if passed global status.Code is related to container failure and: +// +// then localizes the code and returns true, +// else leaves the code unchanged and returns false. +// +// Arg must not be nil. +func LocalizeFailStatus(c *status.Code) bool { + return status.LocalizeIfInSection(c, uint32(statusgrpc.Section_SECTION_CONTAINER)) +} + +// GlobalizeFail globalizes local code of container failure. +// +// Arg must not be nil. +func GlobalizeFail(c *status.Code) { + c.GlobalizeSection(uint32(statusgrpc.Section_SECTION_CONTAINER)) +} + +const ( + // StatusNotFound is a local status.Code value for + // CONTAINER_NOT_FOUND container failure. + StatusNotFound status.Code = iota + + // StatusEACLNotFound is a local status.Code value for + // EACL_NOT_FOUND failure. + StatusEACLNotFound +) diff --git a/api/container/status_test.go b/api/container/status_test.go new file mode 100644 index 0000000..92c738d --- /dev/null +++ b/api/container/status_test.go @@ -0,0 +1,15 @@ +package container_test + +import ( + "testing" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container" + statustest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status/test" +) + +func TestStatusCodes(t *testing.T) { + statustest.TestCodes(t, container.LocalizeFailStatus, container.GlobalizeFail, + container.StatusNotFound, 3072, + container.StatusEACLNotFound, 3073, + ) +} diff --git a/api/container/test/generate.go b/api/container/test/generate.go new file mode 100644 index 0000000..f804da5 --- /dev/null +++ b/api/container/test/generate.go @@ -0,0 +1,240 @@ +package containertest + +import ( + "crypto/rand" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container" + netmaptest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap/test" + refstest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/test" + sessiontest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/test" +) + +func GenerateAttribute(empty bool) *container.Attribute { + m := new(container.Attribute) + + if !empty { + m.SetKey("key") + m.SetValue("val") + } + + return m +} + +func GenerateAttributes(empty bool) []container.Attribute { + var res []container.Attribute + + if !empty { + res = append(res, + *GenerateAttribute(false), + *GenerateAttribute(false), + ) + } + + return res +} + +func GenerateContainer(empty bool) *container.Container { + m := new(container.Container) + + if !empty { + nonce := make([]byte, 16) + _, _ = rand.Read(nonce) + + m.SetBasicACL(12) + m.SetNonce(nonce) + m.SetOwnerID(refstest.GenerateOwnerID(false)) + m.SetAttributes(GenerateAttributes(false)) + m.SetPlacementPolicy(netmaptest.GeneratePlacementPolicy(false)) + } + + m.SetVersion(refstest.GenerateVersion(empty)) + + return m +} + +func GeneratePutRequestBody(empty bool) *container.PutRequestBody { + m := new(container.PutRequestBody) + + if !empty { + m.SetContainer(GenerateContainer(false)) + } + + m.SetSignature(refstest.GenerateSignature(empty)) + + return m +} + +func GeneratePutRequest(empty bool) *container.PutRequest { + m := new(container.PutRequest) + + if !empty { + m.SetBody(GeneratePutRequestBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + + return m +} + +func GeneratePutResponseBody(empty bool) *container.PutResponseBody { + m := new(container.PutResponseBody) + + if !empty { + m.SetContainerID(refstest.GenerateContainerID(false)) + } + + return m +} + +func GeneratePutResponse(empty bool) *container.PutResponse { + m := new(container.PutResponse) + + if !empty { + m.SetBody(GeneratePutResponseBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + + return m +} + +func GenerateGetRequestBody(empty bool) *container.GetRequestBody { + m := new(container.GetRequestBody) + + if !empty { + m.SetContainerID(refstest.GenerateContainerID(false)) + } + + return m +} + +func GenerateGetRequest(empty bool) *container.GetRequest { + m := new(container.GetRequest) + + if !empty { + m.SetBody(GenerateGetRequestBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + + return m +} + +func GenerateGetResponseBody(empty bool) *container.GetResponseBody { + m := new(container.GetResponseBody) + + if !empty { + m.SetContainer(GenerateContainer(false)) + } + + m.SetSignature(refstest.GenerateSignature(empty)) + m.SetSessionToken(sessiontest.GenerateSessionToken(empty)) + + return m +} + +func GenerateGetResponse(empty bool) *container.GetResponse { + m := new(container.GetResponse) + + if !empty { + m.SetBody(GenerateGetResponseBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + + return m +} + +func GenerateDeleteRequestBody(empty bool) *container.DeleteRequestBody { + m := new(container.DeleteRequestBody) + + if !empty { + m.SetContainerID(refstest.GenerateContainerID(false)) + } + + m.SetSignature(refstest.GenerateSignature(empty)) + + return m +} + +func GenerateDeleteRequest(empty bool) *container.DeleteRequest { + m := new(container.DeleteRequest) + + if !empty { + m.SetBody(GenerateDeleteRequestBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + + return m +} + +func GenerateDeleteResponseBody(_ bool) *container.DeleteResponseBody { + m := new(container.DeleteResponseBody) + + return m +} + +func GenerateDeleteResponse(empty bool) *container.DeleteResponse { + m := new(container.DeleteResponse) + + if !empty { + m.SetBody(GenerateDeleteResponseBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + + return m +} + +func GenerateListRequestBody(empty bool) *container.ListRequestBody { + m := new(container.ListRequestBody) + + if !empty { + m.SetOwnerID(refstest.GenerateOwnerID(false)) + } + + return m +} + +func GenerateListRequest(empty bool) *container.ListRequest { + m := new(container.ListRequest) + + if !empty { + m.SetBody(GenerateListRequestBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + + return m +} + +func GenerateListResponseBody(empty bool) *container.ListResponseBody { + m := new(container.ListResponseBody) + + if !empty { + m.SetContainerIDs(refstest.GenerateContainerIDs(false)) + } + + return m +} + +func GenerateListResponse(empty bool) *container.ListResponse { + m := new(container.ListResponse) + + if !empty { + m.SetBody(GenerateListResponseBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + + return m +} diff --git a/api/container/types.go b/api/container/types.go new file mode 100644 index 0000000..92c4706 --- /dev/null +++ b/api/container/types.go @@ -0,0 +1,446 @@ +package container + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" +) + +type Attribute struct { + key, val string +} + +type Container struct { + version *refs.Version + + ownerID *refs.OwnerID + + nonce []byte + + basicACL uint32 + + attr []Attribute + + policy *netmap.PlacementPolicy +} + +type PutRequestBody struct { + cnr *Container + + sig *refs.Signature +} +type PutRequest struct { + body *PutRequestBody + + session.RequestHeaders +} + +type PutResponseBody struct { + cid *refs.ContainerID +} + +type PutResponse struct { + body *PutResponseBody + + session.ResponseHeaders +} + +type GetRequestBody struct { + cid *refs.ContainerID +} + +type GetRequest struct { + body *GetRequestBody + + session.RequestHeaders +} + +type GetResponseBody struct { + cnr *Container + + token *session.Token + + sig *refs.Signature +} + +type GetResponse struct { + body *GetResponseBody + + session.ResponseHeaders +} + +type DeleteRequestBody struct { + cid *refs.ContainerID + + sig *refs.Signature +} + +type DeleteRequest struct { + body *DeleteRequestBody + + session.RequestHeaders +} + +type DeleteResponseBody struct{} + +type DeleteResponse struct { + body *DeleteResponseBody + + session.ResponseHeaders +} + +type ListRequestBody struct { + ownerID *refs.OwnerID +} + +type ListRequest struct { + body *ListRequestBody + + session.RequestHeaders +} + +type ListResponseBody struct { + cidList []refs.ContainerID +} + +type ListResponse struct { + body *ListResponseBody + + session.ResponseHeaders +} + +func (a *Attribute) GetKey() string { + if a != nil { + return a.key + } + + return "" +} + +func (a *Attribute) SetKey(v string) { + a.key = v +} + +func (a *Attribute) GetValue() string { + if a != nil { + return a.val + } + + return "" +} + +func (a *Attribute) SetValue(v string) { + a.val = v +} + +func (c *Container) GetVersion() *refs.Version { + if c != nil { + return c.version + } + + return nil +} + +func (c *Container) SetVersion(v *refs.Version) { + c.version = v +} + +func (c *Container) GetOwnerID() *refs.OwnerID { + if c != nil { + return c.ownerID + } + + return nil +} + +func (c *Container) SetOwnerID(v *refs.OwnerID) { + c.ownerID = v +} + +func (c *Container) GetNonce() []byte { + if c != nil { + return c.nonce + } + + return nil +} + +func (c *Container) SetNonce(v []byte) { + c.nonce = v +} + +func (c *Container) GetBasicACL() uint32 { + if c != nil { + return c.basicACL + } + + return 0 +} + +func (c *Container) SetBasicACL(v uint32) { + c.basicACL = v +} + +func (c *Container) GetAttributes() []Attribute { + if c != nil { + return c.attr + } + + return nil +} + +func (c *Container) SetAttributes(v []Attribute) { + c.attr = v +} + +func (c *Container) GetPlacementPolicy() *netmap.PlacementPolicy { + if c != nil { + return c.policy + } + + return nil +} + +func (c *Container) SetPlacementPolicy(v *netmap.PlacementPolicy) { + c.policy = v +} + +func (r *PutRequestBody) GetContainer() *Container { + if r != nil { + return r.cnr + } + + return nil +} + +func (r *PutRequestBody) SetContainer(v *Container) { + r.cnr = v +} + +func (r *PutRequestBody) GetSignature() *refs.Signature { + if r != nil { + return r.sig + } + + return nil +} + +func (r *PutRequestBody) 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 *PutRequest) GetBody() *PutRequestBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *PutRequest) SetBody(v *PutRequestBody) { + r.body = v +} + +func (r *PutResponseBody) GetContainerID() *refs.ContainerID { + if r != nil { + return r.cid + } + + return nil +} + +func (r *PutResponseBody) SetContainerID(v *refs.ContainerID) { + r.cid = v +} + +func (r *PutResponse) GetBody() *PutResponseBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *PutResponse) SetBody(v *PutResponseBody) { + r.body = v +} + +func (r *GetRequestBody) GetContainerID() *refs.ContainerID { + if r != nil { + return r.cid + } + + return nil +} + +func (r *GetRequestBody) SetContainerID(v *refs.ContainerID) { + r.cid = v +} + +func (r *GetRequest) GetBody() *GetRequestBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *GetRequest) SetBody(v *GetRequestBody) { + r.body = v +} + +func (r *GetResponseBody) GetContainer() *Container { + if r != nil { + return r.cnr + } + + return nil +} + +func (r *GetResponseBody) SetContainer(v *Container) { + r.cnr = v +} + +// GetSessionToken returns token of the session within which requested +// container was created. +func (r *GetResponseBody) GetSessionToken() *session.Token { + if r != nil { + return r.token + } + + return nil +} + +// SetSessionToken sets token of the session within which requested +// container was created. +func (r *GetResponseBody) SetSessionToken(v *session.Token) { + r.token = v +} + +// GetSignature returns signature of the requested container. +func (r *GetResponseBody) GetSignature() *refs.Signature { + if r != nil { + return r.sig + } + + return nil +} + +// SetSignature sets signature of the requested container. +func (r *GetResponseBody) 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 *GetResponse) GetBody() *GetResponseBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *GetResponse) SetBody(v *GetResponseBody) { + r.body = v +} + +func (r *DeleteRequestBody) GetContainerID() *refs.ContainerID { + if r != nil { + return r.cid + } + + return nil +} + +func (r *DeleteRequestBody) SetContainerID(v *refs.ContainerID) { + r.cid = v +} + +func (r *DeleteRequestBody) GetSignature() *refs.Signature { + if r != nil { + return r.sig + } + + return nil +} + +func (r *DeleteRequestBody) 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 *DeleteRequest) GetBody() *DeleteRequestBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *DeleteRequest) SetBody(v *DeleteRequestBody) { + r.body = v +} + +func (r *DeleteResponse) GetBody() *DeleteResponseBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *DeleteResponse) SetBody(v *DeleteResponseBody) { + r.body = v +} + +func (r *ListRequestBody) GetOwnerID() *refs.OwnerID { + if r != nil { + return r.ownerID + } + + return nil +} + +func (r *ListRequestBody) SetOwnerID(v *refs.OwnerID) { + r.ownerID = v +} + +func (r *ListRequest) GetBody() *ListRequestBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *ListRequest) SetBody(v *ListRequestBody) { + r.body = v +} + +func (r *ListResponseBody) GetContainerIDs() []refs.ContainerID { + if r != nil { + return r.cidList + } + + return nil +} + +func (r *ListResponseBody) SetContainerIDs(v []refs.ContainerID) { + r.cidList = v +} + +func (r *ListResponse) GetBody() *ListResponseBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *ListResponse) SetBody(v *ListResponseBody) { + r.body = v +} diff --git a/api/lock/grpc/types_frostfs.pb.go b/api/lock/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..19e45b0 --- /dev/null +++ b/api/lock/grpc/types_frostfs.pb.go @@ -0,0 +1,171 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package lock + +import ( + json "encoding/json" + fmt "fmt" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" +) + +type Lock struct { + Members []grpc.ObjectID `json:"members"` +} + +var ( + _ encoding.ProtoMarshaler = (*Lock)(nil) + _ encoding.ProtoUnmarshaler = (*Lock)(nil) + _ json.Marshaler = (*Lock)(nil) + _ json.Unmarshaler = (*Lock)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Lock) StableSize() (size int) { + if x == nil { + return 0 + } + for i := range x.Members { + size += proto.NestedStructureSizeUnchecked(1, &x.Members[i]) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Lock) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *Lock) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + for i := range x.Members { + x.Members[i].EmitProtobuf(mm.AppendMessage(1)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Lock) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "Lock") + } + switch fc.FieldNum { + case 1: // Members + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Members") + } + x.Members = append(x.Members, grpc.ObjectID{}) + ff := &x.Members[len(x.Members)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *Lock) GetMembers() []grpc.ObjectID { + if x != nil { + return x.Members + } + return nil +} +func (x *Lock) SetMembers(v []grpc.ObjectID) { + x.Members = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Lock) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Lock) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"members\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Members { + if i != 0 { + out.RawByte(',') + } + x.Members[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Lock) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Lock) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "members": + { + var f grpc.ObjectID + var list []grpc.ObjectID + in.Delim('[') + for !in.IsDelim(']') { + f = grpc.ObjectID{} + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Members = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/api/lock/grpc/types_frostfs_fuzz.go b/api/lock/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..cb55151 --- /dev/null +++ b/api/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/api/lock/grpc/types_frostfs_test.go b/api/lock/grpc/types_frostfs_test.go new file mode 100644 index 0000000..7c69064 --- /dev/null +++ b/api/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/api/netmap/convert.go b/api/netmap/convert.go new file mode 100644 index 0000000..f8117a5 --- /dev/null +++ b/api/netmap/convert.go @@ -0,0 +1,916 @@ +package netmap + +import ( + netmap "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" +) + +func (f *Filter) ToGRPCMessage() grpc.Message { + var m *netmap.Filter + + if f != nil { + m = new(netmap.Filter) + + m.SetKey(f.key) + m.SetValue(f.value) + m.SetName(f.name) + m.SetOp(OperationToGRPCMessage(f.op)) + m.SetFilters(FiltersToGRPC(f.filters)) + } + + return m +} + +func (f *Filter) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.Filter) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + f.filters, err = FiltersFromGRPC(v.GetFilters()) + if err != nil { + return err + } + + f.key = v.GetKey() + f.value = v.GetValue() + f.name = v.GetName() + f.op = OperationFromGRPCMessage(v.GetOp()) + + return nil +} + +func FiltersToGRPC(fs []Filter) (res []netmap.Filter) { + if fs != nil { + res = make([]netmap.Filter, 0, len(fs)) + + for i := range fs { + res = append(res, *fs[i].ToGRPCMessage().(*netmap.Filter)) + } + } + + return +} + +func FiltersFromGRPC(fs []netmap.Filter) (res []Filter, err error) { + if fs != nil { + res = make([]Filter, len(fs)) + + for i := range fs { + err = res[i].FromGRPCMessage(&fs[i]) + if err != nil { + return + } + } + } + + return +} + +func (s *Selector) ToGRPCMessage() grpc.Message { + var m *netmap.Selector + + if s != nil { + m = new(netmap.Selector) + + m.SetName(s.name) + m.SetAttribute(s.attribute) + m.SetFilter(s.filter) + m.SetCount(s.count) + m.SetClause(ClauseToGRPCMessage(s.clause)) + } + + return m +} + +func (s *Selector) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.Selector) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + s.name = v.GetName() + s.attribute = v.GetAttribute() + s.filter = v.GetFilter() + s.count = v.GetCount() + s.clause = ClauseFromGRPCMessage(v.GetClause()) + + return nil +} + +func SelectorsToGRPC(ss []Selector) (res []netmap.Selector) { + if ss != nil { + res = make([]netmap.Selector, 0, len(ss)) + + for i := range ss { + res = append(res, *ss[i].ToGRPCMessage().(*netmap.Selector)) + } + } + + return +} + +func SelectorsFromGRPC(ss []netmap.Selector) (res []Selector, err error) { + if ss != nil { + res = make([]Selector, len(ss)) + + for i := range ss { + err = res[i].FromGRPCMessage(&ss[i]) + if err != nil { + return + } + } + } + + return +} + +func (r *Replica) ToGRPCMessage() grpc.Message { + var m *netmap.Replica + + if r != nil { + m = new(netmap.Replica) + + m.SetSelector(r.selector) + m.SetCount(r.count) + m.EcDataCount = r.ecDataCount + m.EcParityCount = r.ecParityCount + } + + return m +} + +func (r *Replica) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.Replica) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + r.selector = v.GetSelector() + r.count = v.GetCount() + r.ecDataCount = v.GetEcDataCount() + r.ecParityCount = v.GetEcParityCount() + + return nil +} + +func ReplicasToGRPC(rs []Replica) (res []netmap.Replica) { + if rs != nil { + res = make([]netmap.Replica, 0, len(rs)) + + for i := range rs { + res = append(res, *rs[i].ToGRPCMessage().(*netmap.Replica)) + } + } + + return +} + +func ReplicasFromGRPC(rs []netmap.Replica) (res []Replica, err error) { + if rs != nil { + res = make([]Replica, len(rs)) + + for i := range rs { + err = res[i].FromGRPCMessage(&rs[i]) + if err != nil { + return + } + } + } + + return +} + +func (p *PlacementPolicy) ToGRPCMessage() grpc.Message { + var m *netmap.PlacementPolicy + + if p != nil { + m = new(netmap.PlacementPolicy) + + m.SetFilters(FiltersToGRPC(p.filters)) + m.SetSelectors(SelectorsToGRPC(p.selectors)) + m.SetReplicas(ReplicasToGRPC(p.replicas)) + m.SetContainerBackupFactor(p.backupFactor) + m.SetUnique(p.unique) + } + + return m +} + +func (p *PlacementPolicy) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.PlacementPolicy) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + p.filters, err = FiltersFromGRPC(v.GetFilters()) + if err != nil { + return err + } + + p.selectors, err = SelectorsFromGRPC(v.GetSelectors()) + if err != nil { + return err + } + + p.replicas, err = ReplicasFromGRPC(v.GetReplicas()) + if err != nil { + return err + } + + p.backupFactor = v.GetContainerBackupFactor() + + p.unique = v.GetUnique() + + return nil +} + +func ClauseToGRPCMessage(n Clause) netmap.Clause { + return netmap.Clause(n) +} + +func ClauseFromGRPCMessage(n netmap.Clause) Clause { + return Clause(n) +} + +func OperationToGRPCMessage(n Operation) netmap.Operation { + return netmap.Operation(n) +} + +func OperationFromGRPCMessage(n netmap.Operation) Operation { + return Operation(n) +} + +func NodeStateToGRPCMessage(n NodeState) netmap.NodeInfo_State { + return netmap.NodeInfo_State(n) +} + +func NodeStateFromRPCMessage(n netmap.NodeInfo_State) NodeState { + return NodeState(n) +} + +func (a *Attribute) ToGRPCMessage() grpc.Message { + var m *netmap.NodeInfo_Attribute + + if a != nil { + m = new(netmap.NodeInfo_Attribute) + + m.SetKey(a.key) + m.SetValue(a.value) + m.SetParents(a.parents) + } + + return m +} + +func (a *Attribute) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.NodeInfo_Attribute) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + a.key = v.GetKey() + a.value = v.GetValue() + a.parents = v.GetParents() + + return nil +} + +func AttributesToGRPC(as []Attribute) (res []netmap.NodeInfo_Attribute) { + if as != nil { + res = make([]netmap.NodeInfo_Attribute, 0, len(as)) + + for i := range as { + res = append(res, *as[i].ToGRPCMessage().(*netmap.NodeInfo_Attribute)) + } + } + + return +} + +func AttributesFromGRPC(as []netmap.NodeInfo_Attribute) (res []Attribute, err error) { + if as != nil { + res = make([]Attribute, len(as)) + + for i := range as { + err = res[i].FromGRPCMessage(&as[i]) + if err != nil { + return + } + } + } + + return +} + +func (ni *NodeInfo) ToGRPCMessage() grpc.Message { + var m *netmap.NodeInfo + + if ni != nil { + m = new(netmap.NodeInfo) + + m.SetPublicKey(ni.publicKey) + m.SetAddresses(ni.addresses) + m.SetState(NodeStateToGRPCMessage(ni.state)) + m.SetAttributes(AttributesToGRPC(ni.attributes)) + } + + return m +} + +func (ni *NodeInfo) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.NodeInfo) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + ni.attributes, err = AttributesFromGRPC(v.GetAttributes()) + if err != nil { + return err + } + + ni.publicKey = v.GetPublicKey() + ni.addresses = v.GetAddresses() + ni.state = NodeStateFromRPCMessage(v.GetState()) + + return nil +} + +func (l *LocalNodeInfoRequestBody) ToGRPCMessage() grpc.Message { + var m *netmap.LocalNodeInfoRequest_Body + + if l != nil { + m = new(netmap.LocalNodeInfoRequest_Body) + } + + return m +} + +func (l *LocalNodeInfoRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.LocalNodeInfoRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + return nil +} + +func (l *LocalNodeInfoRequest) ToGRPCMessage() grpc.Message { + var m *netmap.LocalNodeInfoRequest + + if l != nil { + m = new(netmap.LocalNodeInfoRequest) + + m.SetBody(l.body.ToGRPCMessage().(*netmap.LocalNodeInfoRequest_Body)) + l.RequestHeaders.ToMessage(m) + } + + return m +} + +func (l *LocalNodeInfoRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.LocalNodeInfoRequest) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + body := v.GetBody() + if body == nil { + l.body = nil + } else { + if l.body == nil { + l.body = new(LocalNodeInfoRequestBody) + } + + err = l.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return l.RequestHeaders.FromMessage(v) +} + +func (l *LocalNodeInfoResponseBody) ToGRPCMessage() grpc.Message { + var m *netmap.LocalNodeInfoResponse_Body + + if l != nil { + m = new(netmap.LocalNodeInfoResponse_Body) + + m.SetVersion(l.version.ToGRPCMessage().(*refsGRPC.Version)) + m.SetNodeInfo(l.nodeInfo.ToGRPCMessage().(*netmap.NodeInfo)) + } + + return m +} + +func (l *LocalNodeInfoResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.LocalNodeInfoResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + version := v.GetVersion() + if version == nil { + l.version = nil + } else { + if l.version == nil { + l.version = new(refs.Version) + } + + err = l.version.FromGRPCMessage(version) + if err != nil { + return err + } + } + + nodeInfo := v.GetNodeInfo() + if nodeInfo == nil { + l.nodeInfo = nil + } else { + if l.nodeInfo == nil { + l.nodeInfo = new(NodeInfo) + } + + err = l.nodeInfo.FromGRPCMessage(nodeInfo) + } + + return err +} + +func (l *LocalNodeInfoResponse) ToGRPCMessage() grpc.Message { + var m *netmap.LocalNodeInfoResponse + + if l != nil { + m = new(netmap.LocalNodeInfoResponse) + + m.SetBody(l.body.ToGRPCMessage().(*netmap.LocalNodeInfoResponse_Body)) + l.ResponseHeaders.ToMessage(m) + } + + return m +} + +func (l *LocalNodeInfoResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.LocalNodeInfoResponse) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + body := v.GetBody() + if body == nil { + l.body = nil + } else { + if l.body == nil { + l.body = new(LocalNodeInfoResponseBody) + } + + err = l.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return l.ResponseHeaders.FromMessage(v) +} + +func (x *NetworkParameter) ToGRPCMessage() grpc.Message { + var m *netmap.NetworkConfig_Parameter + + if x != nil { + m = new(netmap.NetworkConfig_Parameter) + + m.SetKey(x.k) + m.SetValue(x.v) + } + + return m +} + +func (x *NetworkParameter) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.NetworkConfig_Parameter) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + x.k = v.GetKey() + x.v = v.GetValue() + + return nil +} + +func (x *NetworkConfig) ToGRPCMessage() grpc.Message { + var m *netmap.NetworkConfig + + if x != nil { + m = new(netmap.NetworkConfig) + + var ps []netmap.NetworkConfig_Parameter + + if ln := len(x.ps); ln > 0 { + ps = make([]netmap.NetworkConfig_Parameter, 0, ln) + + for i := range ln { + ps = append(ps, *x.ps[i].ToGRPCMessage().(*netmap.NetworkConfig_Parameter)) + } + } + + m.SetParameters(ps) + } + + return m +} + +func (x *NetworkConfig) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.NetworkConfig) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var ( + ps []NetworkParameter + psV2 = v.GetParameters() + ) + + if psV2 != nil { + ln := len(psV2) + + ps = make([]NetworkParameter, ln) + + for i := range ln { + if err := ps[i].FromGRPCMessage(&psV2[i]); err != nil { + return err + } + } + } + + x.ps = ps + + return nil +} + +func (i *NetworkInfo) ToGRPCMessage() grpc.Message { + var m *netmap.NetworkInfo + + if i != nil { + m = new(netmap.NetworkInfo) + + m.SetMagicNumber(i.magicNum) + m.SetCurrentEpoch(i.curEpoch) + m.SetMsPerBlock(i.msPerBlock) + m.SetNetworkConfig(i.netCfg.ToGRPCMessage().(*netmap.NetworkConfig)) + } + + return m +} + +func (i *NetworkInfo) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.NetworkInfo) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + netCfg := v.GetNetworkConfig() + if netCfg == nil { + i.netCfg = nil + } else { + if i.netCfg == nil { + i.netCfg = new(NetworkConfig) + } + + err = i.netCfg.FromGRPCMessage(netCfg) + if err != nil { + return err + } + } + + i.magicNum = v.GetMagicNumber() + i.curEpoch = v.GetCurrentEpoch() + i.msPerBlock = v.GetMsPerBlock() + + return nil +} + +func (l *NetworkInfoRequestBody) ToGRPCMessage() grpc.Message { + var m *netmap.NetworkInfoRequest_Body + + if l != nil { + m = new(netmap.NetworkInfoRequest_Body) + } + + return m +} + +func (l *NetworkInfoRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.NetworkInfoRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + return nil +} + +func (l *NetworkInfoRequest) ToGRPCMessage() grpc.Message { + var m *netmap.NetworkInfoRequest + + if l != nil { + m = new(netmap.NetworkInfoRequest) + + m.SetBody(l.body.ToGRPCMessage().(*netmap.NetworkInfoRequest_Body)) + l.RequestHeaders.ToMessage(m) + } + + return m +} + +func (l *NetworkInfoRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.NetworkInfoRequest) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + body := v.GetBody() + if body == nil { + l.body = nil + } else { + if l.body == nil { + l.body = new(NetworkInfoRequestBody) + } + + err = l.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return l.RequestHeaders.FromMessage(v) +} + +func (i *NetworkInfoResponseBody) ToGRPCMessage() grpc.Message { + var m *netmap.NetworkInfoResponse_Body + + if i != nil { + m = new(netmap.NetworkInfoResponse_Body) + + m.SetNetworkInfo(i.netInfo.ToGRPCMessage().(*netmap.NetworkInfo)) + } + + return m +} + +func (i *NetworkInfoResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.NetworkInfoResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + netInfo := v.GetNetworkInfo() + if netInfo == nil { + i.netInfo = nil + } else { + if i.netInfo == nil { + i.netInfo = new(NetworkInfo) + } + + err = i.netInfo.FromGRPCMessage(netInfo) + } + + return err +} + +func (l *NetworkInfoResponse) ToGRPCMessage() grpc.Message { + var m *netmap.NetworkInfoResponse + + if l != nil { + m = new(netmap.NetworkInfoResponse) + + m.SetBody(l.body.ToGRPCMessage().(*netmap.NetworkInfoResponse_Body)) + l.ResponseHeaders.ToMessage(m) + } + + return m +} + +func (l *NetworkInfoResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.NetworkInfoResponse) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + body := v.GetBody() + if body == nil { + l.body = nil + } else { + if l.body == nil { + l.body = new(NetworkInfoResponseBody) + } + + err = l.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return l.ResponseHeaders.FromMessage(v) +} + +func (x *NetMap) ToGRPCMessage() grpc.Message { + var m *netmap.Netmap + + if x != nil { + m = new(netmap.Netmap) + + m.SetEpoch(x.epoch) + + if x.nodes != nil { + nodes := make([]netmap.NodeInfo, len(x.nodes)) + + for i := range x.nodes { + nodes[i] = *x.nodes[i].ToGRPCMessage().(*netmap.NodeInfo) + } + + m.SetNodes(nodes) + } + } + + return m +} + +func (x *NetMap) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.Netmap) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + nodes := v.GetNodes() + if nodes == nil { + x.nodes = nil + } else { + x.nodes = make([]NodeInfo, len(nodes)) + + for i := range nodes { + err = x.nodes[i].FromGRPCMessage(&nodes[i]) + if err != nil { + return err + } + } + } + + x.epoch = v.GetEpoch() + + return nil +} + +func (x *SnapshotRequestBody) ToGRPCMessage() grpc.Message { + var m *netmap.NetmapSnapshotRequest_Body + + if x != nil { + m = new(netmap.NetmapSnapshotRequest_Body) + } + + return m +} + +func (x *SnapshotRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.NetmapSnapshotRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + return nil +} + +func (x *SnapshotRequest) ToGRPCMessage() grpc.Message { + var m *netmap.NetmapSnapshotRequest + + if x != nil { + m = new(netmap.NetmapSnapshotRequest) + + m.SetBody(x.body.ToGRPCMessage().(*netmap.NetmapSnapshotRequest_Body)) + x.RequestHeaders.ToMessage(m) + } + + return m +} + +func (x *SnapshotRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.NetmapSnapshotRequest) + 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(SnapshotRequestBody) + } + + err = x.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return x.RequestHeaders.FromMessage(v) +} + +func (x *SnapshotResponseBody) ToGRPCMessage() grpc.Message { + var m *netmap.NetmapSnapshotResponse_Body + + if x != nil { + m = new(netmap.NetmapSnapshotResponse_Body) + + m.SetNetmap(x.netMap.ToGRPCMessage().(*netmap.Netmap)) + } + + return m +} + +func (x *SnapshotResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.NetmapSnapshotResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + netMap := v.GetNetmap() + if netMap == nil { + x.netMap = nil + } else { + if x.netMap == nil { + x.netMap = new(NetMap) + } + + err = x.netMap.FromGRPCMessage(netMap) + } + + return err +} + +func (x *SnapshotResponse) ToGRPCMessage() grpc.Message { + var m *netmap.NetmapSnapshotResponse + + if x != nil { + m = new(netmap.NetmapSnapshotResponse) + + m.SetBody(x.body.ToGRPCMessage().(*netmap.NetmapSnapshotResponse_Body)) + x.ResponseHeaders.ToMessage(m) + } + + return m +} + +func (x *SnapshotResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.NetmapSnapshotResponse) + 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(SnapshotResponseBody) + } + + err = x.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return x.ResponseHeaders.FromMessage(v) +} diff --git a/api/netmap/grpc/service_frostfs.pb.go b/api/netmap/grpc/service_frostfs.pb.go new file mode 100644 index 0000000..7e2d7a3 --- /dev/null +++ b/api/netmap/grpc/service_frostfs.pb.go @@ -0,0 +1,2180 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package netmap + +import ( + json "encoding/json" + fmt "fmt" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" +) + +type 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.EmitProtobuf(mm.AppendMessage(1)) + } + if x.NodeInfo != nil { + 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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"version\":" + out.RawString(prefix) + x.Version.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"networkInfo\":" + out.RawString(prefix) + 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"netmap\":" + out.RawString(prefix) + 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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/api/netmap/grpc/service_frostfs_fuzz.go b/api/netmap/grpc/service_frostfs_fuzz.go new file mode 100644 index 0000000..ebb59bc --- /dev/null +++ b/api/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/api/netmap/grpc/service_frostfs_test.go b/api/netmap/grpc/service_frostfs_test.go new file mode 100644 index 0000000..5c9035f --- /dev/null +++ b/api/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/api/netmap/grpc/service_grpc.pb.go b/api/netmap/grpc/service_grpc.pb.go new file mode 100644 index 0000000..7deee56 --- /dev/null +++ b/api/netmap/grpc/service_grpc.pb.go @@ -0,0 +1,227 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v5.27.2 +// source: api/netmap/grpc/service.proto + +package netmap + +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 ( + 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. +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. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // 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 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 FrostFS epoch. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // information about the current network map has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). + NetmapSnapshot(ctx context.Context, in *NetmapSnapshotRequest, opts ...grpc.CallOption) (*NetmapSnapshotResponse, error) +} + +type netmapServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewNetmapServiceClient(cc grpc.ClientConnInterface) NetmapServiceClient { + return &netmapServiceClient{cc} +} + +func (c *netmapServiceClient) LocalNodeInfo(ctx context.Context, in *LocalNodeInfoRequest, opts ...grpc.CallOption) (*LocalNodeInfoResponse, error) { + out := new(LocalNodeInfoResponse) + err := c.cc.Invoke(ctx, NetmapService_LocalNodeInfo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *netmapServiceClient) NetworkInfo(ctx context.Context, in *NetworkInfoRequest, opts ...grpc.CallOption) (*NetworkInfoResponse, error) { + out := new(NetworkInfoResponse) + err := c.cc.Invoke(ctx, NetmapService_NetworkInfo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *netmapServiceClient) NetmapSnapshot(ctx context.Context, in *NetmapSnapshotRequest, opts ...grpc.CallOption) (*NetmapSnapshotResponse, error) { + out := new(NetmapSnapshotResponse) + err := c.cc.Invoke(ctx, NetmapService_NetmapSnapshot_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// NetmapServiceServer is the server API for NetmapService service. +// All implementations should embed UnimplementedNetmapServiceServer +// 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. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // information about the server has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). + LocalNodeInfo(context.Context, *LocalNodeInfoRequest) (*LocalNodeInfoResponse, error) + // 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 FrostFS epoch. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // information about the current network map has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). + NetmapSnapshot(context.Context, *NetmapSnapshotRequest) (*NetmapSnapshotResponse, error) +} + +// UnimplementedNetmapServiceServer should be embedded to have forward compatible implementations. +type UnimplementedNetmapServiceServer struct { +} + +func (UnimplementedNetmapServiceServer) LocalNodeInfo(context.Context, *LocalNodeInfoRequest) (*LocalNodeInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LocalNodeInfo not implemented") +} +func (UnimplementedNetmapServiceServer) NetworkInfo(context.Context, *NetworkInfoRequest) (*NetworkInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NetworkInfo not implemented") +} +func (UnimplementedNetmapServiceServer) NetmapSnapshot(context.Context, *NetmapSnapshotRequest) (*NetmapSnapshotResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NetmapSnapshot not implemented") +} + +// UnsafeNetmapServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to NetmapServiceServer will +// result in compilation errors. +type UnsafeNetmapServiceServer interface { + mustEmbedUnimplementedNetmapServiceServer() +} + +func RegisterNetmapServiceServer(s grpc.ServiceRegistrar, srv NetmapServiceServer) { + s.RegisterService(&NetmapService_ServiceDesc, srv) +} + +func _NetmapService_LocalNodeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LocalNodeInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetmapServiceServer).LocalNodeInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NetmapService_LocalNodeInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetmapServiceServer).LocalNodeInfo(ctx, req.(*LocalNodeInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NetmapService_NetworkInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NetworkInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetmapServiceServer).NetworkInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NetmapService_NetworkInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetmapServiceServer).NetworkInfo(ctx, req.(*NetworkInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NetmapService_NetmapSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NetmapSnapshotRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetmapServiceServer).NetmapSnapshot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NetmapService_NetmapSnapshot_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetmapServiceServer).NetmapSnapshot(ctx, req.(*NetmapSnapshotRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// NetmapService_ServiceDesc is the grpc.ServiceDesc for NetmapService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var NetmapService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "neo.fs.v2.netmap.NetmapService", + HandlerType: (*NetmapServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "LocalNodeInfo", + Handler: _NetmapService_LocalNodeInfo_Handler, + }, + { + MethodName: "NetworkInfo", + Handler: _NetmapService_NetworkInfo_Handler, + }, + { + MethodName: "NetmapSnapshot", + Handler: _NetmapService_NetmapSnapshot_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/netmap/grpc/service.proto", +} diff --git a/api/netmap/grpc/types_frostfs.pb.go b/api/netmap/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..15f8959 --- /dev/null +++ b/api/netmap/grpc/types_frostfs.pb.go @@ -0,0 +1,2749 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package netmap + +import ( + json "encoding/json" + fmt "fmt" + pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" +) + +type 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.NestedStructureSizeUnchecked(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 { + 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, 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 + } + first := true + out.RawByte('{') + { + 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 !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 = "\"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 = 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 + } + first := true + out.RawByte('{') + { + 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 !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"attribute\":" + out.RawString(prefix) + out.String(x.Attribute) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + 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 + 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": + { + 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 + } + first := true + out.RawByte('{') + { + 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 = "\"selector\":" + out.RawString(prefix) + out.String(x.Selector) + } + { + 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 = "\"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 + 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": + { + var f string + f = in.String() + x.Selector = f + } + case "ecDataCount": + { + var f uint32 + r := in.JsonNumber() + n := r.String() + v, err := strconv.ParseUint(n, 10, 32) + if err != nil { + in.AddError(err) + return + } + pv := uint32(v) + f = pv + x.EcDataCount = f + } + case "ecParityCount": + { + var f uint32 + r := in.JsonNumber() + n := r.String() + v, err := strconv.ParseUint(n, 10, 32) + if err != nil { + in.AddError(err) + return + } + pv := uint32(v) + f = pv + x.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.NestedStructureSizeUnchecked(1, &x.Replicas[i]) + } + size += proto.UInt32Size(2, x.ContainerBackupFactor) + for i := range x.Selectors { + size += proto.NestedStructureSizeUnchecked(3, &x.Selectors[i]) + } + for i := range x.Filters { + size += proto.NestedStructureSizeUnchecked(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 { + x.Replicas[i].EmitProtobuf(mm.AppendMessage(1)) + } + if x.ContainerBackupFactor != 0 { + mm.AppendUint32(2, x.ContainerBackupFactor) + } + for i := range x.Selectors { + x.Selectors[i].EmitProtobuf(mm.AppendMessage(3)) + } + for i := range x.Filters { + 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, 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, 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, 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 + } + first := true + 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 !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 = "\"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 = "\"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 = "\"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 = Replica{} + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Replicas = list + in.Delim(']') + } + case "containerBackupFactor": + { + var f uint32 + r := in.JsonNumber() + n := r.String() + v, err := strconv.ParseUint(n, 10, 32) + if err != nil { + in.AddError(err) + return + } + pv := uint32(v) + f = pv + x.ContainerBackupFactor = f + } + case "selectors": + { + var f Selector + var list []Selector + in.Delim('[') + for !in.IsDelim(']') { + f = 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 = 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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"key\":" + out.RawString(prefix) + out.String(x.Key) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + out.String(x.Value) + } + { + 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('}') +} + +// 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.NestedStructureSizeUnchecked(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 { + 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, 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 + } + first := true + out.RawByte('{') + { + 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 !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 = "\"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 = "\"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('}') +} + +// 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 + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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 = 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.NestedStructureSizeUnchecked(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 { + 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, 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 + } + first := true + 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 !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('}') +} + +// 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 + 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": + { + var f NodeInfo + var list []NodeInfo + in.Delim('[') + for !in.IsDelim(']') { + f = 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 + } + first := true + out.RawByte('{') + { + 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 !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('}') +} + +// 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 + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + x.Key = f + } + case "value": + { + var f []byte + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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.NestedStructureSizeUnchecked(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 { + 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, 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 + } + first := true + 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('}') +} + +// 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 = 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.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 + } + first := true + 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 !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 = "\"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 = "\"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 + 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 + 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 + 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": + { + var f *NetworkConfig + f = new(NetworkConfig) + f.UnmarshalEasyJSON(in) + x.NetworkConfig = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/api/netmap/grpc/types_frostfs_fuzz.go b/api/netmap/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..89ccd74 --- /dev/null +++ b/api/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/api/netmap/grpc/types_frostfs_test.go b/api/netmap/grpc/types_frostfs_test.go new file mode 100644 index 0000000..9996dc9 --- /dev/null +++ b/api/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/api/netmap/json.go b/api/netmap/json.go new file mode 100644 index 0000000..6a1c257 --- /dev/null +++ b/api/netmap/json.go @@ -0,0 +1,62 @@ +package netmap + +import ( + netmap "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" +) + +func (p *PlacementPolicy) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(p) +} + +func (p *PlacementPolicy) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(p, data, new(netmap.PlacementPolicy)) +} + +func (f *Filter) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(f) +} + +func (f *Filter) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(f, data, new(netmap.Filter)) +} + +func (s *Selector) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(s) +} + +func (s *Selector) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(s, data, new(netmap.Selector)) +} + +func (r *Replica) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(r) +} + +func (r *Replica) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(r, data, new(netmap.Replica)) +} + +func (a *Attribute) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(a) +} + +func (a *Attribute) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(a, data, new(netmap.NodeInfo_Attribute)) +} + +func (ni *NodeInfo) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(ni) +} + +func (ni *NodeInfo) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(ni, data, new(netmap.NodeInfo)) +} + +func (i *NetworkInfo) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(i) +} + +func (i *NetworkInfo) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(i, data, new(netmap.NetworkInfo)) +} diff --git a/api/netmap/marshal.go b/api/netmap/marshal.go new file mode 100644 index 0000000..4d5e4f1 --- /dev/null +++ b/api/netmap/marshal.go @@ -0,0 +1,576 @@ +package netmap + +import ( + netmap "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + protoutil "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" +) + +const ( + nameFilterField = 1 + keyFilterField = 2 + opFilterField = 3 + valueFilterField = 4 + filtersFilterField = 5 + + nameSelectorField = 1 + countSelectorField = 2 + clauseSelectorField = 3 + attributeSelectorField = 4 + filterSelectorField = 5 + + countReplicaField = 1 + selectorReplicaField = 2 + ecDataCountReplicaField = 3 + ecParityCountReplicaField = 4 + + replicasPolicyField = 1 + backupPolicyField = 2 + selectorsPolicyField = 3 + filtersPolicyField = 4 + uniquePolicyField = 5 + + keyAttributeField = 1 + valueAttributeField = 2 + parentsAttributeField = 3 + + keyNodeInfoField = 1 + addressNodeInfoField = 2 + attributesNodeInfoField = 3 + stateNodeInfoField = 4 + + versionInfoResponseBodyField = 1 + nodeInfoResponseBodyField = 2 +) + +func (f *Filter) StableMarshal(buf []byte) []byte { + if f == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, f.StableSize()) + } + + var offset int + + offset += protoutil.StringMarshal(nameFilterField, buf[offset:], f.name) + offset += protoutil.StringMarshal(keyFilterField, buf[offset:], f.key) + offset += protoutil.EnumMarshal(opFilterField, buf[offset:], int32(f.op)) + offset += protoutil.StringMarshal(valueFilterField, buf[offset:], f.value) + + for i := range f.filters { + offset += protoutil.NestedStructureMarshal(filtersFilterField, buf[offset:], &f.filters[i]) + } + + return buf +} + +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)) + size += protoutil.StringSize(valueFilterField, f.value) + for i := range f.filters { + size += protoutil.NestedStructureSize(filtersFilterField, &f.filters[i]) + } + + return size +} + +func (f *Filter) Unmarshal(data []byte) error { + return message.Unmarshal(f, data, new(netmap.Filter)) +} + +func (s *Selector) StableMarshal(buf []byte) []byte { + if s == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, s.StableSize()) + } + + var offset int + + offset += protoutil.StringMarshal(nameSelectorField, buf[offset:], s.name) + offset += protoutil.UInt32Marshal(countSelectorField, buf[offset:], s.count) + offset += protoutil.EnumMarshal(clauseSelectorField, buf[offset:], int32(s.clause)) + offset += protoutil.StringMarshal(attributeSelectorField, buf[offset:], s.attribute) + protoutil.StringMarshal(filterSelectorField, buf[offset:], s.filter) + + return buf +} + +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)) + size += protoutil.StringSize(attributeSelectorField, s.attribute) + size += protoutil.StringSize(filterSelectorField, s.filter) + + return size +} + +func (s *Selector) Unmarshal(data []byte) error { + return message.Unmarshal(s, data, new(netmap.Selector)) +} + +func (r *Replica) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + + offset += protoutil.UInt32Marshal(countReplicaField, buf[offset:], r.count) + 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 +} + +func (r *Replica) StableSize() (size int) { + if r == nil { + return 0 + } + + 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 +} + +func (r *Replica) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(netmap.Replica)) +} + +func (p *PlacementPolicy) StableMarshal(buf []byte) []byte { + if p == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, p.StableSize()) + } + + var offset int + + for i := range p.replicas { + offset += protoutil.NestedStructureMarshal(replicasPolicyField, buf[offset:], &p.replicas[i]) + } + + offset += protoutil.UInt32Marshal(backupPolicyField, buf[offset:], p.backupFactor) + + for i := range p.selectors { + offset += protoutil.NestedStructureMarshal(selectorsPolicyField, buf[offset:], &p.selectors[i]) + } + + for i := range p.filters { + offset += protoutil.NestedStructureMarshal(filtersPolicyField, buf[offset:], &p.filters[i]) + } + + protoutil.BoolMarshal(uniquePolicyField, buf[offset:], p.unique) + + return buf +} + +func (p *PlacementPolicy) StableSize() (size int) { + if p == nil { + return 0 + } + + for i := range p.replicas { + size += protoutil.NestedStructureSize(replicasPolicyField, &p.replicas[i]) + } + + size += protoutil.UInt32Size(backupPolicyField, p.backupFactor) + + for i := range p.selectors { + size += protoutil.NestedStructureSize(selectorsPolicyField, &p.selectors[i]) + } + + for i := range p.filters { + size += protoutil.NestedStructureSize(filtersPolicyField, &p.filters[i]) + } + + size += protoutil.BoolSize(uniquePolicyField, p.unique) + + return size +} + +func (p *PlacementPolicy) Unmarshal(data []byte) error { + return message.Unmarshal(p, data, new(netmap.PlacementPolicy)) +} + +func (a *Attribute) StableMarshal(buf []byte) []byte { + if a == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, a.StableSize()) + } + + var offset int + + offset += protoutil.StringMarshal(keyAttributeField, buf[offset:], a.key) + offset += protoutil.StringMarshal(valueAttributeField, buf[offset:], a.value) + + for i := range a.parents { + offset += protoutil.StringMarshal(parentsAttributeField, buf[offset:], a.parents[i]) + } + + return buf +} + +func (a *Attribute) StableSize() (size int) { + if a == nil { + return 0 + } + + size += protoutil.StringSize(keyAttributeField, a.key) + size += protoutil.StringSize(valueAttributeField, a.value) + + for i := range a.parents { + size += protoutil.StringSize(parentsAttributeField, a.parents[i]) + } + + return size +} + +func (a *Attribute) Unmarshal(data []byte) error { + return message.Unmarshal(a, data, new(netmap.NodeInfo_Attribute)) +} + +func (ni *NodeInfo) StableMarshal(buf []byte) []byte { + if ni == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, ni.StableSize()) + } + + var offset int + + offset += protoutil.BytesMarshal(keyNodeInfoField, buf[offset:], ni.publicKey) + offset += protoutil.RepeatedStringMarshal(addressNodeInfoField, buf[offset:], ni.addresses) + + for i := range ni.attributes { + offset += protoutil.NestedStructureMarshal(attributesNodeInfoField, buf[offset:], &ni.attributes[i]) + } + + protoutil.EnumMarshal(stateNodeInfoField, buf[offset:], int32(ni.state)) + + return buf +} + +func (ni *NodeInfo) StableSize() (size int) { + if ni == nil { + return 0 + } + + size += protoutil.BytesSize(keyNodeInfoField, ni.publicKey) + size += protoutil.RepeatedStringSize(addressNodeInfoField, ni.addresses) + + for i := range ni.attributes { + size += protoutil.NestedStructureSize(attributesNodeInfoField, &ni.attributes[i]) + } + + size += protoutil.EnumSize(stateNodeInfoField, int32(ni.state)) + + return size +} + +func (ni *NodeInfo) Unmarshal(data []byte) error { + return message.Unmarshal(ni, data, new(netmap.NodeInfo)) +} + +func (l *LocalNodeInfoRequestBody) StableMarshal(_ []byte) []byte { + return nil +} + +func (l *LocalNodeInfoRequestBody) StableSize() (size int) { + return 0 +} + +func (l *LocalNodeInfoRequestBody) Unmarshal([]byte) error { + return nil +} + +func (l *LocalNodeInfoResponseBody) StableMarshal(buf []byte) []byte { + if l == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, l.StableSize()) + } + + var offset int + + offset += protoutil.NestedStructureMarshal(versionInfoResponseBodyField, buf[offset:], l.version) + protoutil.NestedStructureMarshal(nodeInfoResponseBodyField, buf[offset:], l.nodeInfo) + + return buf +} + +func (l *LocalNodeInfoResponseBody) StableSize() (size int) { + if l == nil { + return 0 + } + + size += protoutil.NestedStructureSize(versionInfoResponseBodyField, l.version) + size += protoutil.NestedStructureSize(nodeInfoResponseBodyField, l.nodeInfo) + + return size +} + +func (l *LocalNodeInfoResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(l, data, new(netmap.LocalNodeInfoResponse_Body)) +} + +const ( + _ = iota + netPrmKeyFNum + netPrmValFNum +) + +func (x *NetworkParameter) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, x.StableSize()) + } + + var offset int + + offset += protoutil.BytesMarshal(netPrmKeyFNum, buf[offset:], x.k) + protoutil.BytesMarshal(netPrmValFNum, buf[offset:], x.v) + + return buf +} + +func (x *NetworkParameter) StableSize() (size int) { + if x == nil { + return 0 + } + + size += protoutil.BytesSize(netPrmKeyFNum, x.k) + size += protoutil.BytesSize(netPrmValFNum, x.v) + + return size +} + +const ( + _ = iota + netCfgPrmsFNum +) + +func (x *NetworkConfig) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, x.StableSize()) + } + + var offset int + + for i := range x.ps { + offset += protoutil.NestedStructureMarshal(netCfgPrmsFNum, buf[offset:], &x.ps[i]) + } + + return buf +} + +func (x *NetworkConfig) StableSize() (size int) { + if x == nil { + return 0 + } + + for i := range x.ps { + size += protoutil.NestedStructureSize(netCfgPrmsFNum, &x.ps[i]) + } + + return size +} + +const ( + _ = iota + netInfoCurEpochFNum + netInfoMagicNumFNum + netInfoMSPerBlockFNum + netInfoCfgFNum +) + +func (i *NetworkInfo) StableMarshal(buf []byte) []byte { + if i == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, i.StableSize()) + } + + var offset int + + offset += protoutil.UInt64Marshal(netInfoCurEpochFNum, buf[offset:], i.curEpoch) + offset += protoutil.UInt64Marshal(netInfoMagicNumFNum, buf[offset:], i.magicNum) + offset += protoutil.Int64Marshal(netInfoMSPerBlockFNum, buf[offset:], i.msPerBlock) + protoutil.NestedStructureMarshal(netInfoCfgFNum, buf[offset:], i.netCfg) + + return buf +} + +func (i *NetworkInfo) StableSize() (size int) { + if i == nil { + return 0 + } + + size += protoutil.UInt64Size(netInfoCurEpochFNum, i.curEpoch) + size += protoutil.UInt64Size(netInfoMagicNumFNum, i.magicNum) + size += protoutil.Int64Size(netInfoMSPerBlockFNum, i.msPerBlock) + size += protoutil.NestedStructureSize(netInfoCfgFNum, i.netCfg) + + return size +} + +func (i *NetworkInfo) Unmarshal(data []byte) error { + return message.Unmarshal(i, data, new(netmap.NetworkInfo)) +} + +func (l *NetworkInfoRequestBody) StableMarshal(_ []byte) []byte { + return nil +} + +func (l *NetworkInfoRequestBody) StableSize() (size int) { + return 0 +} + +func (l *NetworkInfoRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(l, data, new(netmap.NetworkInfoRequest_Body)) +} + +const ( + _ = iota + netInfoRespBodyNetInfoFNum +) + +func (i *NetworkInfoResponseBody) StableMarshal(buf []byte) []byte { + if i == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, i.StableSize()) + } + + protoutil.NestedStructureMarshal(netInfoRespBodyNetInfoFNum, buf, i.netInfo) + + return buf +} + +func (i *NetworkInfoResponseBody) StableSize() (size int) { + if i == nil { + return 0 + } + + size += protoutil.NestedStructureSize(netInfoRespBodyNetInfoFNum, i.netInfo) + + return size +} + +func (i *NetworkInfoResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(i, data, new(netmap.NetworkInfoResponse_Body)) +} + +const ( + _ = iota + fNumNetMapEpoch + fNumNetMapNodes +) + +func (x *NetMap) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, x.StableSize()) + } + + offset := protoutil.UInt64Marshal(fNumNetMapEpoch, buf, x.epoch) + + for i := range x.nodes { + offset += protoutil.NestedStructureMarshal(fNumNetMapNodes, buf[offset:], &x.nodes[i]) + } + + return buf +} + +func (x *NetMap) StableSize() (size int) { + if x != nil { + size = protoutil.UInt64Size(fNumNetMapEpoch, x.epoch) + + for i := range x.nodes { + size += protoutil.NestedStructureSize(fNumNetMapNodes, &x.nodes[i]) + } + } + + return +} + +func (x *SnapshotRequestBody) StableMarshal([]byte) []byte { + return nil +} + +func (x *SnapshotRequestBody) StableSize() int { + return 0 +} + +const ( + _ = iota + fNumSnapshotResponseBodyNetMap +) + +func (x *SnapshotResponseBody) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, x.StableSize()) + } + + protoutil.NestedStructureMarshal(fNumSnapshotResponseBodyNetMap, buf, x.netMap) + + return buf +} + +func (x *SnapshotResponseBody) StableSize() (size int) { + if x != nil { + size = protoutil.NestedStructureSize(fNumSnapshotResponseBodyNetMap, x.netMap) + } + + return +} diff --git a/api/netmap/message_test.go b/api/netmap/message_test.go new file mode 100644 index 0000000..2406ece --- /dev/null +++ b/api/netmap/message_test.go @@ -0,0 +1,32 @@ +package netmap_test + +import ( + "testing" + + netmaptest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap/test" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message/test" +) + +func TestMessageConvert(t *testing.T) { + messagetest.TestRPCMessage(t, + func(empty bool) message.Message { return netmaptest.GenerateFilter(empty) }, + func(empty bool) message.Message { return netmaptest.GenerateSelector(empty) }, + func(empty bool) message.Message { return netmaptest.GenerateReplica(empty) }, + func(empty bool) message.Message { return netmaptest.GeneratePlacementPolicy(empty) }, + func(empty bool) message.Message { return netmaptest.GenerateAttribute(empty) }, + func(empty bool) message.Message { return netmaptest.GenerateNodeInfo(empty) }, + func(empty bool) message.Message { return netmaptest.GenerateLocalNodeInfoRequest(empty) }, + func(empty bool) message.Message { return netmaptest.GenerateLocalNodeInfoResponseBody(empty) }, + func(empty bool) message.Message { return netmaptest.GenerateNetworkParameter(empty) }, + func(empty bool) message.Message { return netmaptest.GenerateNetworkConfig(empty) }, + func(empty bool) message.Message { return netmaptest.GenerateNetworkInfo(empty) }, + func(empty bool) message.Message { return netmaptest.GenerateNetworkInfoRequest(empty) }, + func(empty bool) message.Message { return netmaptest.GenerateNetworkInfoResponseBody(empty) }, + func(empty bool) message.Message { return netmaptest.GenerateNetMap(empty) }, + func(empty bool) message.Message { return netmaptest.GenerateSnapshotRequestBody(empty) }, + func(empty bool) message.Message { return netmaptest.GenerateSnapshotRequest(empty) }, + func(empty bool) message.Message { return netmaptest.GenerateSnapshotResponseBody(empty) }, + func(empty bool) message.Message { return netmaptest.GenerateSnapshotResponse(empty) }, + ) +} diff --git a/api/netmap/string.go b/api/netmap/string.go new file mode 100644 index 0000000..a6805ae --- /dev/null +++ b/api/netmap/string.go @@ -0,0 +1,68 @@ +package netmap + +import ( + netmap "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap/grpc" +) + +// String returns string representation of Clause. +func (x Clause) String() string { + return ClauseToGRPCMessage(x).String() +} + +// 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 { + var g netmap.Clause + + ok := g.FromString(s) + + if ok { + *x = ClauseFromGRPCMessage(g) + } + + return ok +} + +// String returns string representation of Operation. +func (x Operation) String() string { + return OperationToGRPCMessage(x).String() +} + +// 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 { + var g netmap.Operation + + ok := g.FromString(s) + + if ok { + *x = OperationFromGRPCMessage(g) + } + + return ok +} + +// String returns string representation of NodeState. +func (x NodeState) String() string { + return NodeStateToGRPCMessage(x).String() +} + +// FromString parses NodeState from a string representation. +// It is a reverse action to String(). +// +// Returns true if s was parsed successfully. +func (x *NodeState) FromString(s string) bool { + var g netmap.NodeInfo_State + + ok := g.FromString(s) + + if ok { + *x = NodeStateFromRPCMessage(g) + } + + return ok +} diff --git a/api/netmap/test/generate.go b/api/netmap/test/generate.go new file mode 100644 index 0000000..4ac9254 --- /dev/null +++ b/api/netmap/test/generate.go @@ -0,0 +1,335 @@ +package netmaptest + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" + refstest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/test" + sessiontest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/test" +) + +func GenerateFilter(empty bool) *netmap.Filter { + return generateFilter(empty, true) +} + +func generateFilter(empty, withSub bool) *netmap.Filter { + m := new(netmap.Filter) + + if !empty { + m.SetKey("filter key") + m.SetValue("filter value") + m.SetName("filter name") + m.SetOp(1) + + if withSub { + m.SetFilters([]netmap.Filter{ + *generateFilter(empty, false), + *generateFilter(empty, false), + }) + } + } + + return m +} + +func GenerateFilters(empty bool) []netmap.Filter { + var res []netmap.Filter + + if !empty { + res = append(res, + *GenerateFilter(false), + *GenerateFilter(false), + ) + } + + return res +} + +func GenerateSelector(empty bool) *netmap.Selector { + m := new(netmap.Selector) + + if !empty { + m.SetCount(66) + m.SetAttribute("selector attribute") + m.SetFilter("select filter") + m.SetName("select name") + m.SetClause(1) + } + + return m +} + +func GenerateSelectors(empty bool) []netmap.Selector { + var res []netmap.Selector + + if !empty { + res = append(res, + *GenerateSelector(false), + *GenerateSelector(false), + ) + } + + return res +} + +func GenerateReplica(empty bool) *netmap.Replica { + m := new(netmap.Replica) + + if !empty { + m.SetCount(42) + m.SetSelector("replica selector") + } + + 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 + + if !empty { + res = append(res, + *GenerateReplica(false), + *GenerateReplica(false), + *GenerateEC(false), + ) + } + + return res +} + +func GeneratePlacementPolicy(empty bool) *netmap.PlacementPolicy { + m := new(netmap.PlacementPolicy) + + if !empty { + m.SetContainerBackupFactor(322) + m.SetFilters(GenerateFilters(false)) + m.SetSelectors(GenerateSelectors(false)) + m.SetReplicas(GenerateReplicas(false)) + m.SetUnique(true) + } + + return m +} + +func GenerateAttribute(empty bool) *netmap.Attribute { + m := new(netmap.Attribute) + + if !empty { + m.SetKey("attribute key") + m.SetValue("attribute val") + } + + return m +} + +func GenerateAttributes(empty bool) []netmap.Attribute { + var res []netmap.Attribute + + if !empty { + res = append(res, + *GenerateAttribute(false), + *GenerateAttribute(false), + ) + } + + return res +} + +func GenerateNodeInfo(empty bool) *netmap.NodeInfo { + m := new(netmap.NodeInfo) + + if !empty { + m.SetAddresses("node address", "node address 2") + m.SetPublicKey([]byte{1, 2, 3}) + m.SetState(33) + m.SetAttributes(GenerateAttributes(empty)) + } + + return m +} + +func GenerateLocalNodeInfoRequestBody(_ bool) *netmap.LocalNodeInfoRequestBody { + m := new(netmap.LocalNodeInfoRequestBody) + + return m +} + +func GenerateLocalNodeInfoRequest(empty bool) *netmap.LocalNodeInfoRequest { + m := new(netmap.LocalNodeInfoRequest) + + if !empty { + m.SetBody(GenerateLocalNodeInfoRequestBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + + return m +} + +func GenerateLocalNodeInfoResponseBody(empty bool) *netmap.LocalNodeInfoResponseBody { + m := new(netmap.LocalNodeInfoResponseBody) + + if !empty { + m.SetNodeInfo(GenerateNodeInfo(false)) + } + + m.SetVersion(refstest.GenerateVersion(empty)) + + return m +} + +func GenerateLocalNodeInfoResponse(empty bool) *netmap.LocalNodeInfoResponse { + m := new(netmap.LocalNodeInfoResponse) + + if !empty { + m.SetBody(GenerateLocalNodeInfoResponseBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + + return m +} + +func GenerateNetworkParameter(empty bool) *netmap.NetworkParameter { + m := new(netmap.NetworkParameter) + + if !empty { + m.SetKey([]byte("key")) + m.SetValue([]byte("value")) + } + + return m +} + +func GenerateNetworkConfig(empty bool) *netmap.NetworkConfig { + m := new(netmap.NetworkConfig) + + if !empty { + m.SetParameters( + *GenerateNetworkParameter(empty), + *GenerateNetworkParameter(empty), + ) + } + + return m +} + +func GenerateNetworkInfo(empty bool) *netmap.NetworkInfo { + m := new(netmap.NetworkInfo) + + if !empty { + m.SetMagicNumber(228) + m.SetCurrentEpoch(666) + m.SetMsPerBlock(5678) + m.SetNetworkConfig(GenerateNetworkConfig(empty)) + } + + return m +} + +func GenerateNetworkInfoRequestBody(_ bool) *netmap.NetworkInfoRequestBody { + m := new(netmap.NetworkInfoRequestBody) + + return m +} + +func GenerateNetworkInfoRequest(empty bool) *netmap.NetworkInfoRequest { + m := new(netmap.NetworkInfoRequest) + + if !empty { + m.SetBody(GenerateNetworkInfoRequestBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + + return m +} + +func GenerateNetworkInfoResponseBody(empty bool) *netmap.NetworkInfoResponseBody { + m := new(netmap.NetworkInfoResponseBody) + + if !empty { + m.SetNetworkInfo(GenerateNetworkInfo(false)) + } + + return m +} + +func GenerateNetworkInfoResponse(empty bool) *netmap.NetworkInfoResponse { + m := new(netmap.NetworkInfoResponse) + + if !empty { + m.SetBody(GenerateNetworkInfoResponseBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + + return m +} + +func GenerateNetMap(empty bool) *netmap.NetMap { + m := new(netmap.NetMap) + + if !empty { + m.SetEpoch(987) + m.SetNodes([]netmap.NodeInfo{ + *GenerateNodeInfo(false), + *GenerateNodeInfo(false), + }) + } + + return m +} + +func GenerateSnapshotRequestBody(_ bool) *netmap.SnapshotRequestBody { + return new(netmap.SnapshotRequestBody) +} + +func GenerateSnapshotRequest(empty bool) *netmap.SnapshotRequest { + m := new(netmap.SnapshotRequest) + + if !empty { + m.SetBody(GenerateSnapshotRequestBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + + return m +} + +func GenerateSnapshotResponseBody(empty bool) *netmap.SnapshotResponseBody { + m := new(netmap.SnapshotResponseBody) + + if !empty { + m.SetNetMap(GenerateNetMap(false)) + } + + return m +} + +func GenerateSnapshotResponse(empty bool) *netmap.SnapshotResponse { + m := new(netmap.SnapshotResponse) + + if !empty { + m.SetBody(GenerateSnapshotResponseBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + + return m +} diff --git a/api/netmap/types.go b/api/netmap/types.go new file mode 100644 index 0000000..877357d --- /dev/null +++ b/api/netmap/types.go @@ -0,0 +1,783 @@ +package netmap + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" +) + +type LocalNodeInfoRequest struct { + body *LocalNodeInfoRequestBody + + session.RequestHeaders +} + +type LocalNodeInfoResponse struct { + body *LocalNodeInfoResponseBody + + session.ResponseHeaders +} + +// NetworkInfoRequest is a structure of NetworkInfo request. +type NetworkInfoRequest struct { + body *NetworkInfoRequestBody + + session.RequestHeaders +} + +// NetworkInfoResponse is a structure of NetworkInfo response. +type NetworkInfoResponse struct { + body *NetworkInfoResponseBody + + session.ResponseHeaders +} + +type Filter struct { + name string + key string + op Operation + value string + filters []Filter +} + +type Selector struct { + name string + count uint32 + clause Clause + attribute string + filter string +} + +type Replica struct { + count uint32 + selector string + + ecDataCount uint32 + ecParityCount uint32 +} + +type Operation uint32 + +type PlacementPolicy struct { + replicas []Replica + backupFactor uint32 + selectors []Selector + filters []Filter + unique bool +} + +// Attribute of storage node. +type Attribute struct { + key string + value string + parents []string +} + +// NodeInfo of storage node. +type NodeInfo struct { + publicKey []byte + addresses []string + attributes []Attribute + state NodeState +} + +// NodeState of storage node. +type NodeState uint32 + +// Clause of placement selector. +type Clause uint32 + +type LocalNodeInfoRequestBody struct{} + +type LocalNodeInfoResponseBody struct { + version *refs.Version + nodeInfo *NodeInfo +} + +const ( + UnspecifiedState NodeState = iota + Online + Offline + Maintenance +) + +const ( + UnspecifiedOperation Operation = iota + EQ + NE + GT + GE + LT + LE + OR + AND + NOT + LIKE +) + +const ( + UnspecifiedClause Clause = iota + Same + Distinct +) + +func (f *Filter) GetFilters() []Filter { + if f != nil { + return f.filters + } + + return nil +} + +func (f *Filter) SetFilters(filters []Filter) { + f.filters = filters +} + +func (f *Filter) GetValue() string { + if f != nil { + return f.value + } + + return "" +} + +func (f *Filter) SetValue(value string) { + f.value = value +} + +func (f *Filter) GetOp() Operation { + if f != nil { + return f.op + } + return UnspecifiedOperation +} + +func (f *Filter) SetOp(op Operation) { + f.op = op +} + +func (f *Filter) GetKey() string { + if f != nil { + return f.key + } + + return "" +} + +func (f *Filter) SetKey(key string) { + f.key = key +} + +func (f *Filter) GetName() string { + if f != nil { + return f.name + } + + return "" +} + +func (f *Filter) SetName(name string) { + f.name = name +} + +func (s *Selector) GetFilter() string { + if s != nil { + return s.filter + } + + return "" +} + +func (s *Selector) SetFilter(filter string) { + s.filter = filter +} + +func (s *Selector) GetAttribute() string { + if s != nil { + return s.attribute + } + + return "" +} + +func (s *Selector) SetAttribute(attribute string) { + s.attribute = attribute +} + +func (s *Selector) GetClause() Clause { + if s != nil { + return s.clause + } + + return UnspecifiedClause +} + +func (s *Selector) SetClause(clause Clause) { + s.clause = clause +} + +func (s *Selector) GetCount() uint32 { + if s != nil { + return s.count + } + + return 0 +} + +func (s *Selector) SetCount(count uint32) { + s.count = count +} + +func (s *Selector) GetName() string { + if s != nil { + return s.name + } + + return "" +} + +func (s *Selector) SetName(name string) { + s.name = name +} + +func (r *Replica) GetSelector() string { + if r != nil { + return r.selector + } + + return "" +} + +func (r *Replica) SetSelector(selector string) { + r.selector = selector +} + +func (r *Replica) GetCount() uint32 { + if r != nil { + return r.count + } + + return 0 +} + +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 + } + return false +} + +func (p *PlacementPolicy) SetUnique(unique bool) { + p.unique = unique +} + +func (p *PlacementPolicy) GetFilters() []Filter { + if p != nil { + return p.filters + } + + return nil +} + +func (p *PlacementPolicy) SetFilters(filters []Filter) { + p.filters = filters +} + +func (p *PlacementPolicy) GetSelectors() []Selector { + if p != nil { + return p.selectors + } + + return nil +} + +func (p *PlacementPolicy) SetSelectors(selectors []Selector) { + p.selectors = selectors +} + +func (p *PlacementPolicy) GetContainerBackupFactor() uint32 { + if p != nil { + return p.backupFactor + } + + return 0 +} + +func (p *PlacementPolicy) SetContainerBackupFactor(backupFactor uint32) { + p.backupFactor = backupFactor +} + +func (p *PlacementPolicy) GetReplicas() []Replica { + if p == nil { + return nil + } + + return p.replicas +} + +func (p *PlacementPolicy) SetReplicas(replicas []Replica) { + p.replicas = replicas +} + +func (a *Attribute) GetKey() string { + if a != nil { + return a.key + } + + return "" +} + +func (a *Attribute) SetKey(v string) { + a.key = v +} + +func (a *Attribute) GetValue() string { + if a != nil { + return a.value + } + + return "" +} + +func (a *Attribute) SetValue(v string) { + a.value = v +} + +func (a *Attribute) GetParents() []string { + if a != nil { + return a.parents + } + + return nil +} + +func (a *Attribute) SetParents(parent []string) { + a.parents = parent +} + +func (ni *NodeInfo) GetPublicKey() []byte { + if ni != nil { + return ni.publicKey + } + + return nil +} + +func (ni *NodeInfo) SetPublicKey(v []byte) { + ni.publicKey = v +} + +// GetAddress returns node's network address. +// +// Deprecated: use IterateAddresses. +func (ni *NodeInfo) GetAddress() (addr string) { + ni.IterateAddresses(func(s string) bool { + addr = s + return true + }) + + return +} + +// SetAddress sets node's network address. +// +// Deprecated: use SetAddresses. +func (ni *NodeInfo) SetAddress(v string) { + ni.SetAddresses(v) +} + +// SetAddresses sets list of network addresses of the node. +func (ni *NodeInfo) SetAddresses(v ...string) { + ni.addresses = v +} + +// NumberOfAddresses returns number of network addresses of the node. +func (ni *NodeInfo) NumberOfAddresses() int { + if ni != nil { + return len(ni.addresses) + } + + return 0 +} + +// IterateAddresses iterates over network addresses of the node. +// Breaks iteration on f's true return. +// +// Handler should not be nil. +func (ni *NodeInfo) IterateAddresses(f func(string) bool) { + if ni != nil { + for i := range ni.addresses { + if f(ni.addresses[i]) { + break + } + } + } +} + +func (ni *NodeInfo) GetAttributes() []Attribute { + if ni != nil { + return ni.attributes + } + + return nil +} + +func (ni *NodeInfo) SetAttributes(v []Attribute) { + ni.attributes = v +} + +func (ni *NodeInfo) GetState() NodeState { + if ni != nil { + return ni.state + } + + return UnspecifiedState +} + +func (ni *NodeInfo) SetState(state NodeState) { + ni.state = state +} + +func (l *LocalNodeInfoResponseBody) GetVersion() *refs.Version { + if l != nil { + return l.version + } + + return nil +} + +func (l *LocalNodeInfoResponseBody) SetVersion(version *refs.Version) { + l.version = version +} + +func (l *LocalNodeInfoResponseBody) GetNodeInfo() *NodeInfo { + if l != nil { + return l.nodeInfo + } + + return nil +} + +func (l *LocalNodeInfoResponseBody) SetNodeInfo(nodeInfo *NodeInfo) { + l.nodeInfo = nodeInfo +} + +func (l *LocalNodeInfoRequest) GetBody() *LocalNodeInfoRequestBody { + if l != nil { + return l.body + } + return nil +} + +func (l *LocalNodeInfoRequest) SetBody(body *LocalNodeInfoRequestBody) { + l.body = body +} + +func (l *LocalNodeInfoResponse) GetBody() *LocalNodeInfoResponseBody { + if l != nil { + return l.body + } + return nil +} + +func (l *LocalNodeInfoResponse) SetBody(body *LocalNodeInfoResponseBody) { + l.body = body +} + +// NetworkParameter represents NeoFS network parameter. +type NetworkParameter struct { + k, v []byte +} + +// GetKey returns parameter key. +func (x *NetworkParameter) GetKey() []byte { + if x != nil { + return x.k + } + + return nil +} + +// SetKey sets parameter key. +func (x *NetworkParameter) SetKey(k []byte) { + x.k = k +} + +// GetValue returns parameter value. +func (x *NetworkParameter) GetValue() []byte { + if x != nil { + return x.v + } + + return nil +} + +// SetValue sets parameter value. +func (x *NetworkParameter) SetValue(v []byte) { + x.v = v +} + +// NetworkConfig represents NeoFS network configuration. +type NetworkConfig struct { + ps []NetworkParameter +} + +// NumberOfParameters returns number of network parameters. +func (x *NetworkConfig) NumberOfParameters() int { + if x != nil { + return len(x.ps) + } + + return 0 +} + +// IterateParameters iterates over network parameters. +// Breaks iteration on f's true return. +// +// Handler must not be nil. +func (x *NetworkConfig) IterateParameters(f func(*NetworkParameter) bool) { + if x != nil { + for i := range x.ps { + if f(&x.ps[i]) { + break + } + } + } +} + +// SetParameters sets list of network parameters. +func (x *NetworkConfig) SetParameters(v ...NetworkParameter) { + x.ps = v +} + +// NetworkInfo groups information about +// NeoFS network. +type NetworkInfo struct { + curEpoch, magicNum uint64 + + msPerBlock int64 + + netCfg *NetworkConfig +} + +// GetCurrentEpoch returns number of the current epoch. +func (i *NetworkInfo) GetCurrentEpoch() uint64 { + if i != nil { + return i.curEpoch + } + + return 0 +} + +// SetCurrentEpoch sets number of the current epoch. +func (i *NetworkInfo) SetCurrentEpoch(epoch uint64) { + i.curEpoch = epoch +} + +// GetMagicNumber returns magic number of the sidechain. +func (i *NetworkInfo) GetMagicNumber() uint64 { + if i != nil { + return i.magicNum + } + + return 0 +} + +// SetMagicNumber sets magic number of the sidechain. +func (i *NetworkInfo) SetMagicNumber(magic uint64) { + i.magicNum = magic +} + +// GetMsPerBlock returns MillisecondsPerBlock network parameter. +func (i *NetworkInfo) GetMsPerBlock() int64 { + if i != nil { + return i.msPerBlock + } + + return 0 +} + +// SetMsPerBlock sets MillisecondsPerBlock network parameter. +func (i *NetworkInfo) SetMsPerBlock(v int64) { + i.msPerBlock = v +} + +// GetNetworkConfig returns NeoFS network configuration. +func (i *NetworkInfo) GetNetworkConfig() *NetworkConfig { + if i != nil { + return i.netCfg + } + + return nil +} + +// SetNetworkConfig sets NeoFS network configuration. +func (i *NetworkInfo) SetNetworkConfig(v *NetworkConfig) { + i.netCfg = v +} + +// NetworkInfoRequestBody is a structure of NetworkInfo request body. +type NetworkInfoRequestBody struct{} + +// NetworkInfoResponseBody is a structure of NetworkInfo response body. +type NetworkInfoResponseBody struct { + netInfo *NetworkInfo +} + +// GetNetworkInfo returns information about the NeoFS network. +func (i *NetworkInfoResponseBody) GetNetworkInfo() *NetworkInfo { + if i != nil { + return i.netInfo + } + + return nil +} + +// SetNetworkInfo sets information about the NeoFS network. +func (i *NetworkInfoResponseBody) SetNetworkInfo(netInfo *NetworkInfo) { + i.netInfo = netInfo +} + +func (l *NetworkInfoRequest) GetBody() *NetworkInfoRequestBody { + if l != nil { + return l.body + } + return nil +} + +func (l *NetworkInfoRequest) SetBody(body *NetworkInfoRequestBody) { + l.body = body +} + +func (l *NetworkInfoResponse) GetBody() *NetworkInfoResponseBody { + if l != nil { + return l.body + } + return nil +} + +func (l *NetworkInfoResponse) SetBody(body *NetworkInfoResponseBody) { + l.body = body +} + +// NetMap represents structure of NeoFS network map. +type NetMap struct { + epoch uint64 + + nodes []NodeInfo +} + +// Epoch returns revision number of the NetMap. +func (x *NetMap) Epoch() uint64 { + if x != nil { + return x.epoch + } + + return 0 +} + +// SetEpoch sets revision number of the NetMap. +func (x *NetMap) SetEpoch(v uint64) { + x.epoch = v +} + +// Nodes returns nodes presented in the NetMap. +func (x *NetMap) Nodes() []NodeInfo { + if x != nil { + return x.nodes + } + + return nil +} + +// SetNodes sets nodes presented in the NetMap. +func (x *NetMap) SetNodes(v []NodeInfo) { + x.nodes = v +} + +// SnapshotRequestBody represents structure of Snapshot request body. +type SnapshotRequestBody struct{} + +// SnapshotRequest represents structure of Snapshot request. +type SnapshotRequest struct { + body *SnapshotRequestBody + + session.RequestHeaders +} + +func (x *SnapshotRequest) GetBody() *SnapshotRequestBody { + if x != nil { + return x.body + } + + return nil +} + +func (x *SnapshotRequest) SetBody(body *SnapshotRequestBody) { + x.body = body +} + +// SnapshotResponseBody represents structure of Snapshot response body. +type SnapshotResponseBody struct { + netMap *NetMap +} + +// NetMap returns current NetMap. +func (x *SnapshotResponseBody) NetMap() *NetMap { + if x != nil { + return x.netMap + } + + return nil +} + +// SetNetMap sets current NetMap. +func (x *SnapshotResponseBody) SetNetMap(netMap *NetMap) { + x.netMap = netMap +} + +// SnapshotResponse represents structure of Snapshot response. +type SnapshotResponse struct { + body *SnapshotResponseBody + + session.ResponseHeaders +} + +func (x *SnapshotResponse) GetBody() *SnapshotResponseBody { + if x != nil { + return x.body + } + + return nil +} + +func (x *SnapshotResponse) SetBody(body *SnapshotResponseBody) { + x.body = body +} diff --git a/api/object/attributes.go b/api/object/attributes.go new file mode 100644 index 0000000..7f4fca0 --- /dev/null +++ b/api/object/attributes.go @@ -0,0 +1,187 @@ +package object + +import ( + "errors" + "fmt" + "strconv" +) + +// SysAttributePrefix is a prefix of key to system attribute. +const SysAttributePrefix = "__SYSTEM__" + +const ( + // SysAttributeUploadID marks smaller parts of a split bigger object. + SysAttributeUploadID = SysAttributePrefix + "UPLOAD_ID" + + // SysAttributeExpEpoch tells GC to delete object after that epoch. + SysAttributeExpEpoch = SysAttributePrefix + "EXPIRATION_EPOCH" + + // SysAttributeTickEpoch defines what epoch must produce object + // notification. + SysAttributeTickEpoch = SysAttributePrefix + "TICK_EPOCH" + + // SysAttributeTickTopic defines what topic object notification + // must be sent to. + SysAttributeTickTopic = SysAttributePrefix + "TICK_TOPIC" +) + +// 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" +) + +// NotificationInfo groups information about object notification +// that can be written to object. +// +// Topic is an optional field. +type NotificationInfo struct { + epoch uint64 + topic string +} + +// Epoch returns object notification tick +// epoch. +func (n NotificationInfo) Epoch() uint64 { + return n.epoch +} + +// SetEpoch sets object notification tick +// epoch. +func (n *NotificationInfo) SetEpoch(epoch uint64) { + n.epoch = epoch +} + +// Topic return optional object notification +// topic. +func (n NotificationInfo) Topic() string { + return n.topic +} + +// SetTopic sets optional object notification +// topic. +func (n *NotificationInfo) SetTopic(topic string) { + n.topic = topic +} + +// WriteNotificationInfo writes NotificationInfo to the Object via attributes. Object must not be nil. +// +// Existing notification attributes are expected to be key-unique, otherwise undefined behavior. +func WriteNotificationInfo(o *Object, ni NotificationInfo) { + h := o.GetHeader() + if h == nil { + h = new(Header) + o.SetHeader(h) + } + + var ( + attrs = h.GetAttributes() + + epoch = strconv.FormatUint(ni.Epoch(), 10) + topic = ni.Topic() + + changedEpoch bool + changedTopic bool + deleteIndex = -1 + ) + + for i := range attrs { + switch attrs[i].GetKey() { + case SysAttributeTickEpoch, SysAttributeTickEpochNeoFS: + attrs[i].SetValue(epoch) + changedEpoch = true + case SysAttributeTickTopic, SysAttributeTickTopicNeoFS: + changedTopic = true + + if topic == "" { + deleteIndex = i + break + } + + attrs[i].SetValue(topic) + } + + if changedEpoch && changedTopic { + break + } + } + + if deleteIndex != -1 { + // approach without allocation/waste + // coping works since the attributes + // order is not important + attrs[deleteIndex] = attrs[len(attrs)-1] + attrs = attrs[:len(attrs)-1] + } + + if !changedEpoch { + index := len(attrs) + attrs = append(attrs, Attribute{}) + attrs[index].SetKey(SysAttributeTickEpoch) + attrs[index].SetValue(epoch) + } + + if !changedTopic && topic != "" { + index := len(attrs) + attrs = append(attrs, Attribute{}) + attrs[index].SetKey(SysAttributeTickTopic) + attrs[index].SetValue(topic) + } + + h.SetAttributes(attrs) +} + +// ErrNotificationNotSet means that object does not have notification. +var ErrNotificationNotSet = errors.New("notification for object is not set") + +// GetNotificationInfo looks for object notification attributes. Object must not be nil. +// Returns ErrNotificationNotSet if no corresponding attributes +// were found. +// +// Existing notification attributes are expected to be key-unique, otherwise undefined behavior. +func GetNotificationInfo(o *Object) (*NotificationInfo, error) { + var ( + foundEpoch bool + ni = new(NotificationInfo) + ) + + for _, attr := range o.GetHeader().GetAttributes() { + switch key := attr.GetKey(); key { + case SysAttributeTickEpoch, SysAttributeTickEpochNeoFS: + epoch, err := strconv.ParseUint(attr.GetValue(), 10, 64) + if err != nil { + return nil, fmt.Errorf("could not parse epoch: %w", err) + } + + ni.SetEpoch(epoch) + + foundEpoch = true + case SysAttributeTickTopic, SysAttributeTickTopicNeoFS: + ni.SetTopic(attr.GetValue()) + } + } + + if !foundEpoch { + return nil, ErrNotificationNotSet + } + + return ni, nil +} diff --git a/api/object/attributes_test.go b/api/object/attributes_test.go new file mode 100644 index 0000000..85635da --- /dev/null +++ b/api/object/attributes_test.go @@ -0,0 +1,89 @@ +package object + +import ( + "strconv" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestSetNotification(t *testing.T) { + o := new(Object) + + ni := NotificationInfo{ + epoch: 10, + topic: "test", + } + + WriteNotificationInfo(o, ni) + + var foundEpoch, foundTopic bool + + for _, attr := range o.GetHeader().GetAttributes() { + switch key := attr.GetKey(); key { + case SysAttributeTickEpoch: + require.Equal(t, false, foundEpoch) + + uEpoch, err := strconv.ParseUint(attr.GetValue(), 10, 64) + require.NoError(t, err) + + require.Equal(t, ni.Epoch(), uEpoch) + foundEpoch = true + case SysAttributeTickTopic: + require.Equal(t, false, foundTopic) + require.Equal(t, ni.Topic(), attr.GetValue()) + foundTopic = true + } + } + + require.Equal(t, true, foundEpoch && foundTopic) +} + +func TestGetNotification(t *testing.T) { + o := new(Object) + + attr := []Attribute{ + {SysAttributeTickEpoch, "10"}, + {SysAttributeTickTopic, "test"}, + } + + h := new(Header) + h.SetAttributes(attr) + + o.SetHeader(h) + + t.Run("No error", func(t *testing.T) { + ni, err := GetNotificationInfo(o) + require.NoError(t, err) + + require.Equal(t, uint64(10), ni.Epoch()) + require.Equal(t, "test", ni.Topic()) + }) +} + +func TestIntegration(t *testing.T) { + o := new(Object) + + var ( + ni1 = NotificationInfo{ + epoch: 10, + topic: "", + } + ni2 = NotificationInfo{ + epoch: 11, + topic: "test", + } + ) + + WriteNotificationInfo(o, ni1) + WriteNotificationInfo(o, ni2) + + t.Run("double set", func(t *testing.T) { + ni, err := GetNotificationInfo(o) + require.NoError(t, err) + + require.Equal(t, ni2.epoch, ni.Epoch()) + require.Equal(t, ni2.topic, ni.Topic()) + require.Equal(t, 2, len(o.GetHeader().GetAttributes())) + }) +} diff --git a/api/object/bench_test.go b/api/object/bench_test.go new file mode 100644 index 0000000..b29b1d1 --- /dev/null +++ b/api/object/bench_test.go @@ -0,0 +1,45 @@ +package object + +import ( + "math/rand" + "testing" + + "github.com/stretchr/testify/require" +) + +func randString(n int) string { + x := make([]byte, n) + for i := range x { + x[i] = byte('a' + rand.Intn('z'-'a')) + } + return string(x) +} + +func BenchmarkAttributesMarshal(b *testing.B) { + attrs := make([]Attribute, 50) + for i := range attrs { + attrs[i].key = SysAttributePrefix + randString(10) + attrs[i].val = randString(10) + } + raw := AttributesToGRPC(attrs) + require.Equal(b, len(raw), len(attrs)) + + b.Run("marshal", func(b *testing.B) { + b.ReportAllocs() + for range b.N { + res := AttributesToGRPC(attrs) + if len(res) != len(raw) { + b.FailNow() + } + } + }) + b.Run("unmarshal", func(b *testing.B) { + b.ReportAllocs() + for range b.N { + res, err := AttributesFromGRPC(raw) + if err != nil || len(res) != len(raw) { + b.FailNow() + } + } + }) +} diff --git a/api/object/convert.go b/api/object/convert.go new file mode 100644 index 0000000..7fb1d74 --- /dev/null +++ b/api/object/convert.go @@ -0,0 +1,2555 @@ +package object + +import ( + "fmt" + + object "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" +) + +func TypeToGRPCField(t Type) object.ObjectType { + return object.ObjectType(t) +} + +func TypeFromGRPCField(t object.ObjectType) Type { + return Type(t) +} + +func MatchTypeToGRPCField(t MatchType) object.MatchType { + return object.MatchType(t) +} + +func MatchTypeFromGRPCField(t object.MatchType) MatchType { + return MatchType(t) +} + +func (h *ShortHeader) ToGRPCMessage() grpc.Message { + var m *object.ShortHeader + + if h != nil { + m = new(object.ShortHeader) + + m.SetVersion(h.version.ToGRPCMessage().(*refsGRPC.Version)) + m.SetOwnerId(h.ownerID.ToGRPCMessage().(*refsGRPC.OwnerID)) + m.SetHomomorphicHash(h.homoHash.ToGRPCMessage().(*refsGRPC.Checksum)) + m.SetPayloadHash(h.payloadHash.ToGRPCMessage().(*refsGRPC.Checksum)) + m.SetObjectType(TypeToGRPCField(h.typ)) + m.SetCreationEpoch(h.creatEpoch) + m.SetPayloadLength(h.payloadLen) + } + + return m +} + +func (h *ShortHeader) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.ShortHeader) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + 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 + } + } + + 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 + } + } + + 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 + } + } + + 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 + } + } + + h.typ = TypeFromGRPCField(v.GetObjectType()) + h.creatEpoch = v.GetCreationEpoch() + h.payloadLen = v.GetPayloadLength() + + return nil +} + +func (a *Attribute) ToGRPCMessage() grpc.Message { + var m *object.Header_Attribute + + if a != nil { + m = new(object.Header_Attribute) + + m.SetKey(a.key) + m.SetValue(a.val) + } + + return m +} + +func (a *Attribute) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.Header_Attribute) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + a.key = v.GetKey() + a.val = v.GetValue() + + return nil +} + +func AttributesToGRPC(xs []Attribute) (res []object.Header_Attribute) { + if xs != nil { + res = make([]object.Header_Attribute, 0, len(xs)) + + for i := range xs { + res = append(res, *xs[i].ToGRPCMessage().(*object.Header_Attribute)) + } + } + + return +} + +func AttributesFromGRPC(xs []object.Header_Attribute) (res []Attribute, err error) { + if xs != nil { + res = make([]Attribute, len(xs)) + + for i := range xs { + err = res[i].FromGRPCMessage(&xs[i]) + if err != nil { + return + } + } + } + + return +} + +func (h *SplitHeader) ToGRPCMessage() grpc.Message { + var m *object.Header_Split + + if h != nil { + m = new(object.Header_Split) + + m.SetParent(h.par.ToGRPCMessage().(*refsGRPC.ObjectID)) + m.SetPrevious(h.prev.ToGRPCMessage().(*refsGRPC.ObjectID)) + m.SetParentHeader(h.parHdr.ToGRPCMessage().(*object.Header)) + m.SetParentSignature(h.parSig.ToGRPCMessage().(*refsGRPC.Signature)) + m.SetChildren(refs.ObjectIDListToGRPCMessage(h.children)) + m.SetSplitId(h.splitID) + } + + return m +} + +func (h *SplitHeader) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.Header_Split) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + par := v.GetParent() + if par == nil { + h.par = nil + } else { + if h.par == nil { + h.par = new(refs.ObjectID) + } + + err = h.par.FromGRPCMessage(par) + if err != nil { + return err + } + } + + prev := v.GetPrevious() + if prev == nil { + h.prev = nil + } else { + if h.prev == nil { + h.prev = new(refs.ObjectID) + } + + err = h.prev.FromGRPCMessage(prev) + if err != nil { + return err + } + } + + parHdr := v.GetParentHeader() + if parHdr == nil { + h.parHdr = nil + } else { + if h.parHdr == nil { + h.parHdr = new(Header) + } + + err = h.parHdr.FromGRPCMessage(parHdr) + if err != nil { + return err + } + } + + parSig := v.GetParentSignature() + if parSig == nil { + h.parSig = nil + } else { + if h.parSig == nil { + h.parSig = new(refs.Signature) + } + + err = h.parSig.FromGRPCMessage(parSig) + if err != nil { + return err + } + } + + h.children, err = refs.ObjectIDListFromGRPCMessage(v.GetChildren()) + if err != nil { + return err + } + + h.splitID = v.GetSplitId() + + 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.ParentSplitId = h.ParentSplitID + m.ParentSplitParentId = h.ParentSplitParentID.ToGRPCMessage().(*refsGRPC.ObjectID) + m.ParentAttributes = AttributesToGRPC(h.ParentAttributes) + m.Index = h.Index + m.Total = h.Total + m.Header = h.Header + m.HeaderLength = h.HeaderLength + } + + 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.ParentSplitID = v.GetParentSplitId() + + 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 + } + } + + if h.ParentAttributes, err = AttributesFromGRPC(v.GetParentAttributes()); 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 + + if h != nil { + m = new(object.Header) + + m.SetVersion(h.version.ToGRPCMessage().(*refsGRPC.Version)) + m.SetPayloadHash(h.payloadHash.ToGRPCMessage().(*refsGRPC.Checksum)) + m.SetOwnerId(h.ownerID.ToGRPCMessage().(*refsGRPC.OwnerID)) + m.SetHomomorphicHash(h.homoHash.ToGRPCMessage().(*refsGRPC.Checksum)) + 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) + m.SetObjectType(TypeToGRPCField(h.typ)) + } + + return m +} + +func (h *Header) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.Header) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + if err := h.fillVersion(v); err != nil { + return err + } + if err := h.fillPayloadHash(v); err != nil { + return err + } + if err := h.fillOwnerID(v); err != nil { + return err + } + if err := h.fillHomomorphicHash(v); err != nil { + return err + } + if err := h.fillContainerID(v); err != nil { + return err + } + if err := h.fillSessionToken(v); err != nil { + return err + } + 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 { + return err + } + + h.payloadLen = v.GetPayloadLength() + h.creatEpoch = v.GetCreationEpoch() + h.typ = TypeFromGRPCField(v.GetObjectType()) + + 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 *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 + + if h != nil { + m = new(object.HeaderWithSignature) + + m.SetSignature(h.signature.ToGRPCMessage().(*refsGRPC.Signature)) + m.SetHeader(h.header.ToGRPCMessage().(*object.Header)) + } + + return m +} + +func (h *HeaderWithSignature) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.HeaderWithSignature) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + signature := v.GetSignature() + if signature == nil { + h.signature = nil + } else { + if h.signature == nil { + h.signature = new(refs.Signature) + } + + err = h.signature.FromGRPCMessage(signature) + if err != nil { + return err + } + } + + header := v.GetHeader() + if header == nil { + h.header = nil + } else { + if h.header == nil { + h.header = new(Header) + } + + err = h.header.FromGRPCMessage(header) + } + + return err +} + +func (o *Object) ToGRPCMessage() grpc.Message { + var m *object.Object + + if o != nil { + m = new(object.Object) + + m.SetObjectId(o.objectID.ToGRPCMessage().(*refsGRPC.ObjectID)) + m.SetSignature(o.idSig.ToGRPCMessage().(*refsGRPC.Signature)) + m.SetHeader(o.header.ToGRPCMessage().(*object.Header)) + m.SetPayload(o.payload) + } + + return m +} + +func (o *Object) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.Object) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + objectID := v.GetObjectId() + if objectID == nil { + o.objectID = nil + } else { + if o.objectID == nil { + o.objectID = new(refs.ObjectID) + } + + err = o.objectID.FromGRPCMessage(objectID) + if err != nil { + return err + } + } + + idSig := v.GetSignature() + if idSig == nil { + o.idSig = nil + } else { + if o.idSig == nil { + o.idSig = new(refs.Signature) + } + + err = o.idSig.FromGRPCMessage(idSig) + if err != nil { + return err + } + } + + header := v.GetHeader() + if header == nil { + o.header = nil + } else { + if o.header == nil { + o.header = new(Header) + } + + err = o.header.FromGRPCMessage(header) + if err != nil { + return err + } + } + + o.payload = v.GetPayload() + + return nil +} + +func (s *SplitInfo) ToGRPCMessage() grpc.Message { + var m *object.SplitInfo + + if s != nil { + m = new(object.SplitInfo) + + m.SetLastPart(s.lastPart.ToGRPCMessage().(*refsGRPC.ObjectID)) + m.SetLink(s.link.ToGRPCMessage().(*refsGRPC.ObjectID)) + m.SetSplitId(s.splitID) + } + + return m +} + +func (s *SplitInfo) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.SplitInfo) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + lastPart := v.GetLastPart() + if lastPart == nil { + s.lastPart = nil + } else { + if s.lastPart == nil { + s.lastPart = new(refs.ObjectID) + } + + err = s.lastPart.FromGRPCMessage(lastPart) + if err != nil { + return err + } + } + + link := v.GetLink() + if link == nil { + s.link = nil + } else { + if s.link == nil { + s.link = new(refs.ObjectID) + } + + err = s.link.FromGRPCMessage(link) + if err != nil { + return err + } + } + + s.splitID = v.GetSplitId() + + 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] = *s.Chunks[i].ToGRPCMessage().(*object.ECInfo_Chunk) + } + 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].FromGRPCMessage(&chunks[i]); err != nil { + return err + } + } + } + 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 + + if r != nil { + m = new(object.GetRequest_Body) + + m.SetAddress(r.addr.ToGRPCMessage().(*refsGRPC.Address)) + m.SetRaw(r.raw) + } + + return m +} + +func (r *GetRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.GetRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + addr := v.GetAddress() + if addr == nil { + r.addr = nil + } else { + if r.addr == nil { + r.addr = new(refs.Address) + } + + err = r.addr.FromGRPCMessage(addr) + if err != nil { + return err + } + } + + r.raw = v.GetRaw() + + return nil +} + +func (r *GetRequest) ToGRPCMessage() grpc.Message { + var m *object.GetRequest + + if r != nil { + m = new(object.GetRequest) + + m.SetBody(r.body.ToGRPCMessage().(*object.GetRequest_Body)) + r.RequestHeaders.ToMessage(m) + } + + return m +} + +func (r *GetRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.GetRequest) + 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(GetRequestBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.RequestHeaders.FromMessage(v) +} + +func (r *GetObjectPartInit) ToGRPCMessage() grpc.Message { + var m *object.GetResponse_Body_Init + + if r != nil { + m = new(object.GetResponse_Body_Init) + + m.SetObjectId(r.id.ToGRPCMessage().(*refsGRPC.ObjectID)) + m.SetSignature(r.sig.ToGRPCMessage().(*refsGRPC.Signature)) + m.SetHeader(r.hdr.ToGRPCMessage().(*object.Header)) + } + + return m +} + +func (r *GetObjectPartInit) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.GetResponse_Body_Init) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + id := v.GetObjectId() + if id == nil { + r.id = nil + } else { + if r.id == nil { + r.id = new(refs.ObjectID) + } + + err = r.id.FromGRPCMessage(id) + if err != nil { + return err + } + } + + sig := v.GetSignature() + if sig == nil { + r.sig = nil + } else { + if r.sig == nil { + r.sig = new(refs.Signature) + } + + err = r.sig.FromGRPCMessage(sig) + if err != nil { + return err + } + } + + hdr := v.GetHeader() + if hdr == nil { + r.hdr = nil + } else { + if r.hdr == nil { + r.hdr = new(Header) + } + + err = r.hdr.FromGRPCMessage(hdr) + } + + return err +} + +func (r *GetObjectPartChunk) ToGRPCMessage() grpc.Message { + var m *object.GetResponse_Body_Chunk + + if r != nil { + m = new(object.GetResponse_Body_Chunk) + + m.SetChunk(r.chunk) + } + + return m +} + +func (r *GetObjectPartChunk) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.GetResponse_Body_Chunk) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + r.chunk = v.GetChunk() + + return nil +} + +func (r *GetResponseBody) ToGRPCMessage() grpc.Message { + var m *object.GetResponse_Body + + if r != nil { + m = new(object.GetResponse_Body) + + switch v := r.GetObjectPart(); t := v.(type) { + case nil: + m.ObjectPart = nil + case *GetObjectPartInit: + m.SetInit(t.ToGRPCMessage().(*object.GetResponse_Body_Init)) + case *GetObjectPartChunk: + 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)) + } + } + + return m +} + +func (r *GetResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.GetResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + r.objPart = nil + + switch pt := v.GetObjectPart().(type) { + case nil: + case *object.GetResponse_Body_Init_: + if pt != nil { + partInit := new(GetObjectPartInit) + r.objPart = partInit + err = partInit.FromGRPCMessage(pt.Init) + } + case *object.GetResponse_Body_Chunk: + if pt != nil { + partChunk := new(GetObjectPartChunk) + r.objPart = partChunk + err = partChunk.FromGRPCMessage(pt) + } + case *object.GetResponse_Body_SplitInfo: + if pt != nil { + partSplit := new(SplitInfo) + 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) + } + + return err +} + +func (r *GetResponse) ToGRPCMessage() grpc.Message { + var m *object.GetResponse + + if r != nil { + m = new(object.GetResponse) + + m.SetBody(r.body.ToGRPCMessage().(*object.GetResponse_Body)) + r.ResponseHeaders.ToMessage(m) + } + + return m +} + +func (r *GetResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.GetResponse) + 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(GetResponseBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.ResponseHeaders.FromMessage(v) +} + +func (r *PutObjectPartInit) ToGRPCMessage() grpc.Message { + var m *object.PutRequest_Body_Init + + if r != nil { + m = new(object.PutRequest_Body_Init) + + m.SetObjectId(r.id.ToGRPCMessage().(*refsGRPC.ObjectID)) + m.SetSignature(r.sig.ToGRPCMessage().(*refsGRPC.Signature)) + m.SetHeader(r.hdr.ToGRPCMessage().(*object.Header)) + m.SetCopiesNumber(r.copyNum) + } + + return m +} + +func (r *PutObjectPartInit) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.PutRequest_Body_Init) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + id := v.GetObjectId() + if id == nil { + r.id = nil + } else { + if r.id == nil { + r.id = new(refs.ObjectID) + } + + err = r.id.FromGRPCMessage(id) + if err != nil { + return err + } + } + + sig := v.GetSignature() + if sig == nil { + r.sig = nil + } else { + if r.sig == nil { + r.sig = new(refs.Signature) + } + + err = r.sig.FromGRPCMessage(sig) + if err != nil { + return err + } + } + + hdr := v.GetHeader() + if hdr == nil { + r.hdr = nil + } else { + if r.hdr == nil { + r.hdr = new(Header) + } + + err = r.hdr.FromGRPCMessage(hdr) + if err != nil { + return err + } + } + + r.copyNum = v.GetCopiesNumber() + + return nil +} + +func (r *PutObjectPartChunk) ToGRPCMessage() grpc.Message { + var m *object.PutRequest_Body_Chunk + + if r != nil { + m = new(object.PutRequest_Body_Chunk) + + m.SetChunk(r.chunk) + } + + return m +} + +func (r *PutObjectPartChunk) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.PutRequest_Body_Chunk) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + r.chunk = v.GetChunk() + + return nil +} + +func (r *PutRequestBody) ToGRPCMessage() grpc.Message { + var m *object.PutRequest_Body + + if r != nil { + m = new(object.PutRequest_Body) + + switch v := r.GetObjectPart(); t := v.(type) { + case nil: + m.ObjectPart = nil + case *PutObjectPartInit: + m.SetInit(t.ToGRPCMessage().(*object.PutRequest_Body_Init)) + case *PutObjectPartChunk: + m.SetChunk(t.ToGRPCMessage().(*object.PutRequest_Body_Chunk)) + default: + panic(fmt.Sprintf("unknown put object part %T", t)) + } + } + + return m +} + +func (r *PutRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.PutRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + r.objPart = nil + + switch pt := v.GetObjectPart().(type) { + case nil: + case *object.PutRequest_Body_Init_: + if pt != nil { + partInit := new(PutObjectPartInit) + r.objPart = partInit + err = partInit.FromGRPCMessage(pt.Init) + } + case *object.PutRequest_Body_Chunk: + if pt != nil { + partChunk := new(PutObjectPartChunk) + r.objPart = partChunk + err = partChunk.FromGRPCMessage(pt) + } + default: + err = fmt.Errorf("unknown put object part %T", pt) + } + + return err +} + +func (r *PutRequest) ToGRPCMessage() grpc.Message { + var m *object.PutRequest + + if r != nil { + m = new(object.PutRequest) + + m.SetBody(r.body.ToGRPCMessage().(*object.PutRequest_Body)) + r.RequestHeaders.ToMessage(m) + } + + return m +} + +func (r *PutRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.PutRequest) + 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(PutRequestBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.RequestHeaders.FromMessage(v) +} + +func (r *PutResponseBody) ToGRPCMessage() grpc.Message { + var m *object.PutResponse_Body + + if r != nil { + m = new(object.PutResponse_Body) + + m.SetObjectId(r.id.ToGRPCMessage().(*refsGRPC.ObjectID)) + } + + return m +} + +func (r *PutResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.PutResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + id := v.GetObjectId() + if id == nil { + r.id = nil + } else { + if r.id == nil { + r.id = new(refs.ObjectID) + } + + err = r.id.FromGRPCMessage(id) + } + + return err +} + +func (r *PutResponse) ToGRPCMessage() grpc.Message { + var m *object.PutResponse + + if r != nil { + m = new(object.PutResponse) + + m.SetBody(r.body.ToGRPCMessage().(*object.PutResponse_Body)) + r.ResponseHeaders.ToMessage(m) + } + + return m +} + +func (r *PutResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.PutResponse) + 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(PutResponseBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.ResponseHeaders.FromMessage(v) +} + +func (r *DeleteRequestBody) ToGRPCMessage() grpc.Message { + var m *object.DeleteRequest_Body + + if r != nil { + m = new(object.DeleteRequest_Body) + + m.SetAddress(r.addr.ToGRPCMessage().(*refsGRPC.Address)) + } + + return m +} + +func (r *DeleteRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.DeleteRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + addr := v.GetAddress() + if addr == nil { + r.addr = nil + } else { + if r.addr == nil { + r.addr = new(refs.Address) + } + + err = r.addr.FromGRPCMessage(addr) + } + + return err +} + +func (r *DeleteRequest) ToGRPCMessage() grpc.Message { + var m *object.DeleteRequest + + if r != nil { + m = new(object.DeleteRequest) + + m.SetBody(r.body.ToGRPCMessage().(*object.DeleteRequest_Body)) + r.RequestHeaders.ToMessage(m) + } + + return m +} + +func (r *DeleteRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.DeleteRequest) + 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(DeleteRequestBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.RequestHeaders.FromMessage(v) +} + +func (r *DeleteResponseBody) ToGRPCMessage() grpc.Message { + var m *object.DeleteResponse_Body + + if r != nil { + m = new(object.DeleteResponse_Body) + + m.SetTombstone(r.tombstone.ToGRPCMessage().(*refsGRPC.Address)) + } + + return m +} + +func (r *DeleteResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.DeleteResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + tombstone := v.GetTombstone() + if tombstone == nil { + r.tombstone = nil + } else { + if r.tombstone == nil { + r.tombstone = new(refs.Address) + } + + err = r.tombstone.FromGRPCMessage(tombstone) + } + + return err +} + +func (r *DeleteResponse) ToGRPCMessage() grpc.Message { + var m *object.DeleteResponse + + if r != nil { + m = new(object.DeleteResponse) + + m.SetBody(r.body.ToGRPCMessage().(*object.DeleteResponse_Body)) + r.ResponseHeaders.ToMessage(m) + } + + return m +} + +func (r *DeleteResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.DeleteResponse) + 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(DeleteResponseBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.ResponseHeaders.FromMessage(v) +} + +func (r *HeadRequestBody) ToGRPCMessage() grpc.Message { + var m *object.HeadRequest_Body + + if r != nil { + m = new(object.HeadRequest_Body) + + m.SetAddress(r.addr.ToGRPCMessage().(*refsGRPC.Address)) + m.SetRaw(r.raw) + m.SetMainOnly(r.mainOnly) + } + + return m +} + +func (r *HeadRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.HeadRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + addr := v.GetAddress() + if addr == nil { + r.addr = nil + } else { + if r.addr == nil { + r.addr = new(refs.Address) + } + + err = r.addr.FromGRPCMessage(addr) + if err != nil { + return err + } + } + + r.raw = v.GetRaw() + r.mainOnly = v.GetMainOnly() + + return nil +} + +func (r *HeadRequest) ToGRPCMessage() grpc.Message { + var m *object.HeadRequest + + if r != nil { + m = new(object.HeadRequest) + + m.SetBody(r.body.ToGRPCMessage().(*object.HeadRequest_Body)) + r.RequestHeaders.ToMessage(m) + } + + return m +} + +func (r *HeadRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.HeadRequest) + 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(HeadRequestBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.RequestHeaders.FromMessage(v) +} + +func (r *HeadResponseBody) ToGRPCMessage() grpc.Message { + var m *object.HeadResponse_Body + + if r != nil { + m = new(object.HeadResponse_Body) + + switch v := r.hdrPart.(type) { + case nil: + m.Head = nil + case *HeaderWithSignature: + m.SetHeader(v.ToGRPCMessage().(*object.HeaderWithSignature)) + case *ShortHeader: + 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)) + } + } + + return m +} + +func (r *HeadResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.HeadResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + r.hdrPart = nil + + switch pt := v.GetHead().(type) { + case nil: + case *object.HeadResponse_Body_Header: + if pt != nil { + partHdr := new(HeaderWithSignature) + r.hdrPart = partHdr + err = partHdr.FromGRPCMessage(pt.Header) + } + case *object.HeadResponse_Body_ShortHeader: + if pt != nil { + partShort := new(ShortHeader) + r.hdrPart = partShort + err = partShort.FromGRPCMessage(pt.ShortHeader) + } + case *object.HeadResponse_Body_SplitInfo: + if pt != nil { + partSplit := new(SplitInfo) + 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) + } + + return err +} + +func (r *HeadResponse) ToGRPCMessage() grpc.Message { + var m *object.HeadResponse + + if r != nil { + m = new(object.HeadResponse) + + m.SetBody(r.body.ToGRPCMessage().(*object.HeadResponse_Body)) + r.ResponseHeaders.ToMessage(m) + } + + return m +} + +func (r *HeadResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.HeadResponse) + 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(HeadResponseBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.ResponseHeaders.FromMessage(v) +} + +func (f *SearchFilter) ToGRPCMessage() grpc.Message { + var m *object.SearchRequest_Body_Filter + + if f != nil { + m = new(object.SearchRequest_Body_Filter) + + m.SetKey(f.key) + m.SetValue(f.val) + m.SetMatchType(MatchTypeToGRPCField(f.matchType)) + } + + return m +} + +func (f *SearchFilter) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.SearchRequest_Body_Filter) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + f.key = v.GetKey() + f.val = v.GetValue() + f.matchType = MatchTypeFromGRPCField(v.GetMatchType()) + + return nil +} + +func SearchFiltersToGRPC(fs []SearchFilter) (res []object.SearchRequest_Body_Filter) { + if fs != nil { + res = make([]object.SearchRequest_Body_Filter, 0, len(fs)) + + for i := range fs { + res = append(res, *fs[i].ToGRPCMessage().(*object.SearchRequest_Body_Filter)) + } + } + + return +} + +func SearchFiltersFromGRPC(fs []object.SearchRequest_Body_Filter) (res []SearchFilter, err error) { + if fs != nil { + res = make([]SearchFilter, len(fs)) + + for i := range fs { + err = res[i].FromGRPCMessage(&fs[i]) + if err != nil { + return + } + } + } + + return +} + +func (r *SearchRequestBody) ToGRPCMessage() grpc.Message { + var m *object.SearchRequest_Body + + if r != nil { + m = new(object.SearchRequest_Body) + + m.SetContainerId(r.cid.ToGRPCMessage().(*refsGRPC.ContainerID)) + m.SetFilters(SearchFiltersToGRPC(r.filters)) + m.SetVersion(r.version) + } + + return m +} + +func (r *SearchRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.SearchRequest_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) + if err != nil { + return err + } + } + + r.filters, err = SearchFiltersFromGRPC(v.GetFilters()) + if err != nil { + return err + } + + r.version = v.GetVersion() + + return nil +} + +func (r *SearchRequest) ToGRPCMessage() grpc.Message { + var m *object.SearchRequest + + if r != nil { + m = new(object.SearchRequest) + + m.SetBody(r.body.ToGRPCMessage().(*object.SearchRequest_Body)) + r.RequestHeaders.ToMessage(m) + } + + return m +} + +func (r *SearchRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.SearchRequest) + 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(SearchRequestBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.RequestHeaders.FromMessage(v) +} + +func (r *SearchResponseBody) ToGRPCMessage() grpc.Message { + var m *object.SearchResponse_Body + + if r != nil { + m = new(object.SearchResponse_Body) + + m.SetIdList(refs.ObjectIDListToGRPCMessage(r.idList)) + } + + return m +} + +func (r *SearchResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.SearchResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + r.idList, err = refs.ObjectIDListFromGRPCMessage(v.GetIdList()) + + return err +} + +func (r *SearchResponse) ToGRPCMessage() grpc.Message { + var m *object.SearchResponse + + if r != nil { + m = new(object.SearchResponse) + + m.SetBody(r.body.ToGRPCMessage().(*object.SearchResponse_Body)) + r.ResponseHeaders.ToMessage(m) + } + + return m +} + +func (r *SearchResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.SearchResponse) + 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(SearchResponseBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.ResponseHeaders.FromMessage(v) +} + +func (r *Range) ToGRPCMessage() grpc.Message { + var m *object.Range + + if r != nil { + m = new(object.Range) + + m.SetLength(r.len) + m.SetOffset(r.off) + } + + return m +} + +func (r *Range) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.Range) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + r.len = v.GetLength() + r.off = v.GetOffset() + + return nil +} + +func RangesToGRPC(rs []Range) (res []object.Range) { + if rs != nil { + res = make([]object.Range, 0, len(rs)) + + for i := range rs { + res = append(res, *rs[i].ToGRPCMessage().(*object.Range)) + } + } + + return +} + +func RangesFromGRPC(rs []object.Range) (res []Range, err error) { + if rs != nil { + res = make([]Range, len(rs)) + + for i := range rs { + err = res[i].FromGRPCMessage(&rs[i]) + if err != nil { + return + } + } + } + + return +} + +func (r *GetRangeRequestBody) ToGRPCMessage() grpc.Message { + var m *object.GetRangeRequest_Body + + if r != nil { + m = new(object.GetRangeRequest_Body) + + m.SetAddress(r.addr.ToGRPCMessage().(*refsGRPC.Address)) + m.SetRange(r.rng.ToGRPCMessage().(*object.Range)) + m.SetRaw(r.raw) + } + + return m +} + +func (r *GetRangeRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.GetRangeRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + addr := v.GetAddress() + if addr == nil { + r.addr = nil + } else { + if r.addr == nil { + r.addr = new(refs.Address) + } + + err = r.addr.FromGRPCMessage(addr) + if err != nil { + return err + } + } + + rng := v.GetRange() + if rng == nil { + r.rng = nil + } else { + if r.rng == nil { + r.rng = new(Range) + } + + err = r.rng.FromGRPCMessage(rng) + if err != nil { + return err + } + } + + r.raw = v.GetRaw() + + return nil +} + +func (r *GetRangeRequest) ToGRPCMessage() grpc.Message { + var m *object.GetRangeRequest + + if r != nil { + m = new(object.GetRangeRequest) + + m.SetBody(r.body.ToGRPCMessage().(*object.GetRangeRequest_Body)) + r.RequestHeaders.ToMessage(m) + } + + return m +} + +func (r *GetRangeRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.GetRangeRequest) + 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(GetRangeRequestBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.RequestHeaders.FromMessage(v) +} + +func (r *GetRangePartChunk) ToGRPCMessage() grpc.Message { + var m *object.GetRangeResponse_Body_Chunk + + if r != nil { + m = new(object.GetRangeResponse_Body_Chunk) + + m.SetChunk(r.chunk) + } + + return m +} + +func (r *GetRangePartChunk) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.GetRangeResponse_Body_Chunk) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + r.chunk = v.GetChunk() + + return nil +} + +func (r *GetRangeResponseBody) ToGRPCMessage() grpc.Message { + var m *object.GetRangeResponse_Body + + if r != nil { + m = new(object.GetRangeResponse_Body) + + switch v := r.rngPart.(type) { + case nil: + m.RangePart = nil + case *GetRangePartChunk: + 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)) + } + } + + return m +} + +func (r *GetRangeResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.GetRangeResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + r.rngPart = nil + + switch pt := v.GetRangePart().(type) { + case nil: + case *object.GetRangeResponse_Body_Chunk: + if pt != nil { + partChunk := new(GetRangePartChunk) + r.rngPart = partChunk + err = partChunk.FromGRPCMessage(pt) + } + case *object.GetRangeResponse_Body_SplitInfo: + if pt != nil { + partSplit := new(SplitInfo) + 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) + } + + return err +} + +func (r *GetRangeResponse) ToGRPCMessage() grpc.Message { + var m *object.GetRangeResponse + + if r != nil { + m = new(object.GetRangeResponse) + + m.SetBody(r.body.ToGRPCMessage().(*object.GetRangeResponse_Body)) + r.ResponseHeaders.ToMessage(m) + } + + return m +} + +func (r *GetRangeResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.GetRangeResponse) + 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(GetRangeResponseBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.ResponseHeaders.FromMessage(v) +} + +func (r *GetRangeHashRequestBody) ToGRPCMessage() grpc.Message { + var m *object.GetRangeHashRequest_Body + + if r != nil { + m = new(object.GetRangeHashRequest_Body) + + m.SetAddress(r.addr.ToGRPCMessage().(*refsGRPC.Address)) + m.SetRanges(RangesToGRPC(r.rngs)) + m.SetType(refs.ChecksumTypeToGRPC(r.typ)) + m.SetSalt(r.salt) + } + + return m +} + +func (r *GetRangeHashRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.GetRangeHashRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + addr := v.GetAddress() + if addr == nil { + r.addr = nil + } else { + if r.addr == nil { + r.addr = new(refs.Address) + } + + err = r.addr.FromGRPCMessage(addr) + if err != nil { + return err + } + } + + r.rngs, err = RangesFromGRPC(v.GetRanges()) + if err != nil { + return err + } + + r.typ = refs.ChecksumTypeFromGRPC(v.GetType()) + r.salt = v.GetSalt() + + return nil +} + +func (r *GetRangeHashRequest) ToGRPCMessage() grpc.Message { + var m *object.GetRangeHashRequest + + if r != nil { + m = new(object.GetRangeHashRequest) + + m.SetBody(r.body.ToGRPCMessage().(*object.GetRangeHashRequest_Body)) + r.RequestHeaders.ToMessage(m) + } + + return m +} + +func (r *GetRangeHashRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.GetRangeHashRequest) + 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(GetRangeHashRequestBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.RequestHeaders.FromMessage(v) +} + +func (r *GetRangeHashResponseBody) ToGRPCMessage() grpc.Message { + var m *object.GetRangeHashResponse_Body + + if r != nil { + m = new(object.GetRangeHashResponse_Body) + + m.SetType(refs.ChecksumTypeToGRPC(r.typ)) + m.SetHashList(r.hashList) + } + + return m +} + +func (r *GetRangeHashResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.GetRangeHashResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + r.typ = refs.ChecksumTypeFromGRPC(v.GetType()) + r.hashList = v.GetHashList() + + return nil +} + +func (r *GetRangeHashResponse) ToGRPCMessage() grpc.Message { + var m *object.GetRangeHashResponse + + if r != nil { + m = new(object.GetRangeHashResponse) + + m.SetBody(r.body.ToGRPCMessage().(*object.GetRangeHashResponse_Body)) + r.ResponseHeaders.ToMessage(m) + } + + return m +} + +func (r *GetRangeHashResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.GetRangeHashResponse) + 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(GetRangeHashResponseBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + 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) +} + +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) +} + +func (r *PatchRequestBodyPatch) ToGRPCMessage() grpc.Message { + var m *object.PatchRequest_Body_Patch + + if r != nil { + m = new(object.PatchRequest_Body_Patch) + + m.SetSourceRange(r.GetRange().ToGRPCMessage().(*object.Range)) + m.SetChunk(r.GetChunk()) + } + + 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/api/object/filters.go b/api/object/filters.go new file mode 100644 index 0000000..9fe024d --- /dev/null +++ b/api/object/filters.go @@ -0,0 +1,58 @@ +package object + +// ReservedFilterPrefix is a prefix of key to object header value or property. +const ReservedFilterPrefix = "$Object:" + +const ( + // FilterHeaderVersion is a filter key to "version" field of the object header. + FilterHeaderVersion = ReservedFilterPrefix + "version" + + // FilterHeaderObjectID is a filter key to "object_id" field of the object. + FilterHeaderObjectID = ReservedFilterPrefix + "objectID" + + // FilterHeaderContainerID is a filter key to "container_id" field of the object header. + FilterHeaderContainerID = ReservedFilterPrefix + "containerID" + + // FilterHeaderOwnerID is a filter key to "owner_id" field of the object header. + FilterHeaderOwnerID = ReservedFilterPrefix + "ownerID" + + // FilterHeaderCreationEpoch is a filter key to "creation_epoch" field of the object header. + FilterHeaderCreationEpoch = ReservedFilterPrefix + "creationEpoch" + + // FilterHeaderPayloadLength is a filter key to "payload_length" field of the object header. + FilterHeaderPayloadLength = ReservedFilterPrefix + "payloadLength" + + // FilterHeaderPayloadHash is a filter key to "payload_hash" field of the object header. + FilterHeaderPayloadHash = ReservedFilterPrefix + "payloadHash" + + // FilterHeaderObjectType is a filter key to "object_type" field of the object header. + FilterHeaderObjectType = ReservedFilterPrefix + "objectType" + + // FilterHeaderHomomorphicHash is a filter key to "homomorphic_hash" field of the object header. + FilterHeaderHomomorphicHash = ReservedFilterPrefix + "homomorphicHash" + + // FilterHeaderParent is a filter key to "split.parent" field of the object header. + FilterHeaderParent = ReservedFilterPrefix + "split.parent" + + // 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 ( + // FilterPropertyRoot is a filter key to check if regular object is on top of split hierarchy. + FilterPropertyRoot = ReservedFilterPrefix + "ROOT" + + // FilterPropertyPhy is a filter key to check if an object physically stored on a node. + FilterPropertyPhy = ReservedFilterPrefix + "PHY" +) + +const ( + // BooleanPropertyValueTrue is a true value for boolean property filters. + BooleanPropertyValueTrue = "true" + + // BooleanPropertyValueFalse is a false value for boolean property filters. + BooleanPropertyValueFalse = "" +) diff --git a/api/object/grpc/service_frostfs.pb.go b/api/object/grpc/service_frostfs.pb.go new file mode 100644 index 0000000..a195f86 --- /dev/null +++ b/api/object/grpc/service_frostfs.pb.go @@ -0,0 +1,9389 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package object + +import ( + json "encoding/json" + fmt "fmt" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + 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.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 + } + first := true + out.RawByte('{') + { + 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 = "\"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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Signature != nil { + x.Signature.EmitProtobuf(mm.AppendMessage(2)) + } + if x.Header != nil { + 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 + } + first := true + out.RawByte('{') + { + 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 = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + 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.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.EmitProtobuf(mm.AppendMessage(3)) + } + } + if inner, ok := x.ObjectPart.(*GetResponse_Body_EcInfo); ok { + if inner.EcInfo != nil { + 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() []byte { + if xx, ok := x.GetObjectPart().(*GetResponse_Body_Chunk); ok { + return xx.Chunk + } + 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 + } + first := true + out.RawByte('{') + switch xx := x.ObjectPart.(type) { + case *GetResponse_Body_Init_: + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"init\":" + out.RawString(prefix) + xx.Init.MarshalEasyJSON(out) + } + case *GetResponse_Body_Chunk: + { + 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 !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"splitInfo\":" + out.RawString(prefix) + xx.SplitInfo.MarshalEasyJSON(out) + } + case *GetResponse_Body_EcInfo: + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ecInfo\":" + out.RawString(prefix) + xx.EcInfo.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 "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 + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Signature != nil { + x.Signature.EmitProtobuf(mm.AppendMessage(2)) + } + if x.Header != nil { + 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 + } + first := true + out.RawByte('{') + { + 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 = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } + { + 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 = "\"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(']') { + 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() + } + 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.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() []byte { + if xx, ok := x.GetObjectPart().(*PutRequest_Body_Chunk); ok { + return xx.Chunk + } + 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 + } + first := true + out.RawByte('{') + switch xx := x.ObjectPart.(type) { + case *PutRequest_Body_Init_: + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"init\":" + out.RawString(prefix) + xx.Init.MarshalEasyJSON(out) + } + case *PutRequest_Body_Chunk: + { + 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("") + } + } + } + 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 + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"objectId\":" + out.RawString(prefix) + 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"address\":" + out.RawString(prefix) + 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"tombstone\":" + out.RawString(prefix) + 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.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 + } + first := true + out.RawByte('{') + { + 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 = "\"mainOnly\":" + out.RawString(prefix) + out.Bool(x.MainOnly) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Signature != nil { + 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 + } + first := true + out.RawByte('{') + { + 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 = "\"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.EmitProtobuf(mm.AppendMessage(1)) + } + } + if inner, ok := x.Head.(*HeadResponse_Body_ShortHeader); ok { + 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.EmitProtobuf(mm.AppendMessage(3)) + } + } + if inner, ok := x.Head.(*HeadResponse_Body_EcInfo); ok { + if inner.EcInfo != nil { + 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 + } + first := true + out.RawByte('{') + switch xx := x.Head.(type) { + case *HeadResponse_Body_Header: + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"header\":" + out.RawString(prefix) + xx.Header.MarshalEasyJSON(out) + } + case *HeadResponse_Body_ShortHeader: + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"shortHeader\":" + out.RawString(prefix) + xx.ShortHeader.MarshalEasyJSON(out) + } + case *HeadResponse_Body_SplitInfo: + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"splitInfo\":" + out.RawString(prefix) + xx.SplitInfo.MarshalEasyJSON(out) + } + case *HeadResponse_Body_EcInfo: + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ecInfo\":" + out.RawString(prefix) + xx.EcInfo.MarshalEasyJSON(out) + } + } + 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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 + } + first := true + out.RawByte('{') + { + 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 = "\"key\":" + out.RawString(prefix) + out.String(x.Key) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + out.String(x.Value) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.NestedStructureSizeUnchecked(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.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Version != 0 { + mm.AppendUint32(2, x.Version) + } + for i := range x.Filters { + 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, 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 + } + first := true + out.RawByte('{') + { + 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 = "\"version\":" + out.RawString(prefix) + out.Uint32(x.Version) + } + { + 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('}') +} + +// 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 + 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": + { + var f SearchRequest_Body_Filter + var list []SearchRequest_Body_Filter + in.Delim('[') + for !in.IsDelim(']') { + f = 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.NestedStructureSizeUnchecked(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 { + 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, 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 + } + first := true + 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('}') +} + +// 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 = 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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 + } + first := true + 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 !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('}') +} + +// 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 + 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 + 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 + } + } + 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.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Range != nil { + 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 + } + first := true + out.RawByte('{') + { + 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 = "\"range\":" + out.RawString(prefix) + x.Range.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.EmitProtobuf(mm.AppendMessage(2)) + } + } + if inner, ok := x.RangePart.(*GetRangeResponse_Body_EcInfo); ok { + if inner.EcInfo != nil { + 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() []byte { + if xx, ok := x.GetRangePart().(*GetRangeResponse_Body_Chunk); ok { + return xx.Chunk + } + 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 + } + first := true + out.RawByte('{') + switch xx := x.RangePart.(type) { + case *GetRangeResponse_Body_Chunk: + { + 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 !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"splitInfo\":" + out.RawString(prefix) + xx.SplitInfo.MarshalEasyJSON(out) + } + case *GetRangeResponse_Body_EcInfo: + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ecInfo\":" + out.RawString(prefix) + xx.EcInfo.MarshalEasyJSON(out) + } + } + 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 + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.NestedStructureSizeUnchecked(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.EmitProtobuf(mm.AppendMessage(1)) + } + for i := range x.Ranges { + 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, 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 + } + first := true + out.RawByte('{') + { + 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 = "\"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 = "\"salt\":" + out.RawString(prefix) + if x.Salt != nil { + out.Base64Bytes(x.Salt) + } else { + out.String("") + } + } + { + 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('}') +} + +// 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 = Range{} + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Ranges = list + in.Delim(']') + } + case "salt": + { + var f []byte + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"type\":" + out.RawString(prefix) + v := int32(x.Type) + if vv, ok := grpc.ChecksumType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } + } + { + 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('}') +} + +// 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(']') { + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.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 + } + first := true + out.RawByte('{') + { + 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 = "\"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(']') { + 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() + } + 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.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 + } + first := true + out.RawByte('{') + { + 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 = "\"chunk\":" + out.RawString(prefix) + if x.Chunk != nil { + out.Base64Bytes(x.Chunk) + } else { + out.String("") + } + } + 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 + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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.NestedStructureSizeUnchecked(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.EmitProtobuf(mm.AppendMessage(1)) + } + for i := range x.NewAttributes { + x.NewAttributes[i].EmitProtobuf(mm.AppendMessage(2)) + } + if x.ReplaceAttributes { + mm.AppendBool(3, x.ReplaceAttributes) + } + if x.Patch != nil { + 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, 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 + } + first := true + out.RawByte('{') + { + 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 = "\"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 = "\"replaceAttributes\":" + out.RawString(prefix) + out.Bool(x.ReplaceAttributes) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + 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 = 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"objectId\":" + out.RawString(prefix) + 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.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 *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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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/api/object/grpc/service_frostfs_fuzz.go b/api/object/grpc/service_frostfs_fuzz.go new file mode 100644 index 0000000..f58ee01 --- /dev/null +++ b/api/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/api/object/grpc/service_frostfs_test.go b/api/object/grpc/service_frostfs_test.go new file mode 100644 index 0000000..cb4baeb --- /dev/null +++ b/api/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/api/object/grpc/service_grpc.pb.go b/api/object/grpc/service_grpc.pb.go new file mode 100644 index 0000000..eb53afe --- /dev/null +++ b/api/object/grpc/service_grpc.pb.go @@ -0,0 +1,1159 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v5.27.2 +// source: api/object/grpc/service.proto + +package object + +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 ( + 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" + 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. +// +// 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. + // + // 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. + // + // 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; + // - **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) + // Put the object into container. Request uses gRPC stream. First message + // SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object + // SHOULD be set. Session token SHOULD be obtained before `PUT` operation (see + // session package). Chunk messages are considered by server as a part of an + // object payload. All messages, except first one, SHOULD be payload chunks. + // 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. + // + // 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; + // - **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. + 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. + // + // 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; + // - **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): \ + // 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) + // 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. + // + // 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; + // - **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) + // Search objects in container. Search query allows to match by Object + // Header's filed values. Please see the corresponding FrostFS 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. + // + // 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; + // - **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) + // 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. + // + // 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. + // + // 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; + // - **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) + // Returns homomorphic or regular hash of object's payload range after + // applying XOR operation with the provided `salt`. Ranges are set of (offset, + // length) tuples. Hashes order in response corresponds to the ranges order in + // 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. + // + // 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; + // - **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) + // Put the prepared object into container. + // `ContainerID`, `ObjectID`, `OwnerID`, `PayloadHash` and `PayloadLength` of + // an object MUST be set. + // + // 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; + // - **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. + 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 { + cc grpc.ClientConnInterface +} + +func NewObjectServiceClient(cc grpc.ClientConnInterface) ObjectServiceClient { + return &objectServiceClient{cc} +} + +func (c *objectServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (ObjectService_GetClient, error) { + stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[0], ObjectService_Get_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &objectServiceGetClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ObjectService_GetClient interface { + Recv() (*GetResponse, error) + grpc.ClientStream +} + +type objectServiceGetClient struct { + grpc.ClientStream +} + +func (x *objectServiceGetClient) Recv() (*GetResponse, error) { + m := new(GetResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *objectServiceClient) Put(ctx context.Context, opts ...grpc.CallOption) (ObjectService_PutClient, error) { + stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[1], ObjectService_Put_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &objectServicePutClient{stream} + return x, nil +} + +type ObjectService_PutClient interface { + Send(*PutRequest) error + CloseAndRecv() (*PutResponse, error) + grpc.ClientStream +} + +type objectServicePutClient struct { + grpc.ClientStream +} + +func (x *objectServicePutClient) Send(m *PutRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *objectServicePutClient) CloseAndRecv() (*PutResponse, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(PutResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *objectServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { + out := new(DeleteResponse) + err := c.cc.Invoke(ctx, ObjectService_Delete_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *objectServiceClient) Head(ctx context.Context, in *HeadRequest, opts ...grpc.CallOption) (*HeadResponse, error) { + out := new(HeadResponse) + err := c.cc.Invoke(ctx, ObjectService_Head_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *objectServiceClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (ObjectService_SearchClient, error) { + stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[2], ObjectService_Search_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &objectServiceSearchClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ObjectService_SearchClient interface { + Recv() (*SearchResponse, error) + grpc.ClientStream +} + +type objectServiceSearchClient struct { + grpc.ClientStream +} + +func (x *objectServiceSearchClient) Recv() (*SearchResponse, error) { + m := new(SearchResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *objectServiceClient) GetRange(ctx context.Context, in *GetRangeRequest, opts ...grpc.CallOption) (ObjectService_GetRangeClient, error) { + stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[3], ObjectService_GetRange_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &objectServiceGetRangeClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ObjectService_GetRangeClient interface { + Recv() (*GetRangeResponse, error) + grpc.ClientStream +} + +type objectServiceGetRangeClient struct { + grpc.ClientStream +} + +func (x *objectServiceGetRangeClient) Recv() (*GetRangeResponse, error) { + m := new(GetRangeResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *objectServiceClient) GetRangeHash(ctx context.Context, in *GetRangeHashRequest, opts ...grpc.CallOption) (*GetRangeHashResponse, error) { + out := new(GetRangeHashResponse) + err := c.cc.Invoke(ctx, ObjectService_GetRangeHash_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + 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 +} + +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 +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. + // + // 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. + // + // 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; + // - **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 + // Put the object into container. Request uses gRPC stream. First message + // SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object + // SHOULD be set. Session token SHOULD be obtained before `PUT` operation (see + // session package). Chunk messages are considered by server as a part of an + // object payload. All messages, except first one, SHOULD be payload chunks. + // 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. + // + // 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; + // - **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. + 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. + // + // 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; + // - **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): \ + // 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) + // 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. + // + // 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; + // - **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) + // Search objects in container. Search query allows to match by Object + // Header's filed values. Please see the corresponding FrostFS 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. + // + // 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; + // - **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 + // 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. + // + // 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. + // + // 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; + // - **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 + // Returns homomorphic or regular hash of object's payload range after + // applying XOR operation with the provided `salt`. Ranges are set of (offset, + // length) tuples. Hashes order in response corresponds to the ranges order in + // 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. + // + // 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; + // - **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) + // Put the prepared object into container. + // `ContainerID`, `ObjectID`, `OwnerID`, `PayloadHash` and `PayloadLength` of + // an object MUST be set. + // + // 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; + // - **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. + 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. +type UnimplementedObjectServiceServer struct { +} + +func (UnimplementedObjectServiceServer) Get(*GetRequest, ObjectService_GetServer) error { + return status.Errorf(codes.Unimplemented, "method Get not implemented") +} +func (UnimplementedObjectServiceServer) Put(ObjectService_PutServer) error { + return status.Errorf(codes.Unimplemented, "method Put not implemented") +} +func (UnimplementedObjectServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") +} +func (UnimplementedObjectServiceServer) Head(context.Context, *HeadRequest) (*HeadResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Head not implemented") +} +func (UnimplementedObjectServiceServer) Search(*SearchRequest, ObjectService_SearchServer) error { + return status.Errorf(codes.Unimplemented, "method Search not implemented") +} +func (UnimplementedObjectServiceServer) GetRange(*GetRangeRequest, ObjectService_GetRangeServer) error { + return status.Errorf(codes.Unimplemented, "method GetRange not implemented") +} +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") +} +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 +// result in compilation errors. +type UnsafeObjectServiceServer interface { + mustEmbedUnimplementedObjectServiceServer() +} + +func RegisterObjectServiceServer(s grpc.ServiceRegistrar, srv ObjectServiceServer) { + s.RegisterService(&ObjectService_ServiceDesc, srv) +} + +func _ObjectService_Get_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ObjectServiceServer).Get(m, &objectServiceGetServer{stream}) +} + +type ObjectService_GetServer interface { + Send(*GetResponse) error + grpc.ServerStream +} + +type objectServiceGetServer struct { + grpc.ServerStream +} + +func (x *objectServiceGetServer) Send(m *GetResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _ObjectService_Put_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ObjectServiceServer).Put(&objectServicePutServer{stream}) +} + +type ObjectService_PutServer interface { + SendAndClose(*PutResponse) error + Recv() (*PutRequest, error) + grpc.ServerStream +} + +type objectServicePutServer struct { + grpc.ServerStream +} + +func (x *objectServicePutServer) SendAndClose(m *PutResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *objectServicePutServer) Recv() (*PutRequest, error) { + m := new(PutRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _ObjectService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ObjectServiceServer).Delete(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ObjectService_Delete_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ObjectServiceServer).Delete(ctx, req.(*DeleteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ObjectService_Head_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HeadRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ObjectServiceServer).Head(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ObjectService_Head_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ObjectServiceServer).Head(ctx, req.(*HeadRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ObjectService_Search_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SearchRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ObjectServiceServer).Search(m, &objectServiceSearchServer{stream}) +} + +type ObjectService_SearchServer interface { + Send(*SearchResponse) error + grpc.ServerStream +} + +type objectServiceSearchServer struct { + grpc.ServerStream +} + +func (x *objectServiceSearchServer) Send(m *SearchResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _ObjectService_GetRange_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetRangeRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ObjectServiceServer).GetRange(m, &objectServiceGetRangeServer{stream}) +} + +type ObjectService_GetRangeServer interface { + Send(*GetRangeResponse) error + grpc.ServerStream +} + +type objectServiceGetRangeServer struct { + grpc.ServerStream +} + +func (x *objectServiceGetRangeServer) Send(m *GetRangeResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _ObjectService_GetRangeHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRangeHashRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ObjectServiceServer).GetRangeHash(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ObjectService_GetRangeHash_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ObjectServiceServer).GetRangeHash(ctx, req.(*GetRangeHashRequest)) + } + 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) +} + +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) +var ObjectService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "neo.fs.v2.object.ObjectService", + HandlerType: (*ObjectServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Delete", + Handler: _ObjectService_Delete_Handler, + }, + { + MethodName: "Head", + Handler: _ObjectService_Head_Handler, + }, + { + MethodName: "GetRangeHash", + Handler: _ObjectService_GetRangeHash_Handler, + }, + { + MethodName: "PutSingle", + Handler: _ObjectService_PutSingle_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Get", + Handler: _ObjectService_Get_Handler, + ServerStreams: true, + }, + { + StreamName: "Put", + Handler: _ObjectService_Put_Handler, + ClientStreams: true, + }, + { + StreamName: "Search", + Handler: _ObjectService_Search_Handler, + ServerStreams: true, + }, + { + StreamName: "GetRange", + Handler: _ObjectService_GetRange_Handler, + ServerStreams: true, + }, + { + StreamName: "Patch", + Handler: _ObjectService_Patch_Handler, + ClientStreams: true, + }, + }, + Metadata: "api/object/grpc/service.proto", +} diff --git a/api/object/grpc/types_frostfs.pb.go b/api/object/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..6c9925c --- /dev/null +++ b/api/object/grpc/types_frostfs.pb.go @@ -0,0 +1,2992 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package object + +import ( + json "encoding/json" + fmt "fmt" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + 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.EmitProtobuf(mm.AppendMessage(1)) + } + if x.CreationEpoch != 0 { + mm.AppendUint64(2, x.CreationEpoch) + } + if x.OwnerId != nil { + 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.EmitProtobuf(mm.AppendMessage(6)) + } + if x.HomomorphicHash != nil { + 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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"version\":" + out.RawString(prefix) + x.Version.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"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 !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 = "\"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 + 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": + { + 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 + 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": + { + 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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"key\":" + out.RawString(prefix) + out.String(x.Key) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + out.String(x.Value) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.NestedStructureSizeUnchecked(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.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Previous != nil { + x.Previous.EmitProtobuf(mm.AppendMessage(2)) + } + if x.ParentSignature != nil { + x.ParentSignature.EmitProtobuf(mm.AppendMessage(3)) + } + if x.ParentHeader != nil { + x.ParentHeader.EmitProtobuf(mm.AppendMessage(4)) + } + for i := range x.Children { + 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, 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 + } + first := true + out.RawByte('{') + { + 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 = "\"previous\":" + out.RawString(prefix) + x.Previous.MarshalEasyJSON(out) + } + { + 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 = "\"parentHeader\":" + out.RawString(prefix) + x.ParentHeader.MarshalEasyJSON(out) + } + { + 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 = "\"splitID\":" + out.RawString(prefix) + if x.SplitId != nil { + out.Base64Bytes(x.SplitId) + } else { + out.String("") + } + } + 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 = grpc.ObjectID{} + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Children = list + in.Delim(']') + } + case "splitID": + { + var f []byte + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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.NestedStructureSizeUnchecked(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.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.EmitProtobuf(mm.AppendMessage(7)) + } + for i := range x.ParentAttributes { + 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, 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 + } + first := true + out.RawByte('{') + { + 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 = "\"index\":" + out.RawString(prefix) + out.Uint32(x.Index) + } + { + 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 = "\"headerLength\":" + out.RawString(prefix) + out.Uint32(x.HeaderLength) + } + { + 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 !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 !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 = "\"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 + 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 + 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 + 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": + { + var f []byte + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + x.Header = f + } + case "parentSplitID": + { + var f []byte + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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 = 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.NestedStructureSizeUnchecked(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.EmitProtobuf(mm.AppendMessage(1)) + } + if x.ContainerId != nil { + x.ContainerId.EmitProtobuf(mm.AppendMessage(2)) + } + if x.OwnerId != nil { + 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.EmitProtobuf(mm.AppendMessage(6)) + } + if int32(x.ObjectType) != 0 { + mm.AppendInt32(7, int32(x.ObjectType)) + } + if x.HomomorphicHash != nil { + x.HomomorphicHash.EmitProtobuf(mm.AppendMessage(8)) + } + if x.SessionToken != nil { + x.SessionToken.EmitProtobuf(mm.AppendMessage(9)) + } + for i := range x.Attributes { + x.Attributes[i].EmitProtobuf(mm.AppendMessage(10)) + } + if x.Split != nil { + x.Split.EmitProtobuf(mm.AppendMessage(11)) + } + if x.Ec != nil { + 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, 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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"version\":" + out.RawString(prefix) + x.Version.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"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 !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 = "\"sessionToken\":" + out.RawString(prefix) + x.SessionToken.MarshalEasyJSON(out) + } + { + 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 = "\"split\":" + out.RawString(prefix) + x.Split.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + 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 + 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 + 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": + { + 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 = 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.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Signature != nil { + x.Signature.EmitProtobuf(mm.AppendMessage(2)) + } + if x.Header != nil { + 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 + } + first := true + out.RawByte('{') + { + 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 = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } + { + 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 = "\"payload\":" + out.RawString(prefix) + if x.Payload != nil { + out.Base64Bytes(x.Payload) + } else { + out.String("") + } + } + 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 + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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.EmitProtobuf(mm.AppendMessage(2)) + } + if x.Link != nil { + 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 + } + first := true + out.RawByte('{') + { + 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 !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 = "\"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 + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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.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 + } + first := true + out.RawByte('{') + { + 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 = "\"index\":" + out.RawString(prefix) + out.Uint32(x.Index) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + 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 + 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 + 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 + } + } + 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.NestedStructureSizeUnchecked(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 { + 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, 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 + } + first := true + 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('}') +} + +// 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 = 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/api/object/grpc/types_frostfs_fuzz.go b/api/object/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..8491638 --- /dev/null +++ b/api/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/api/object/grpc/types_frostfs_test.go b/api/object/grpc/types_frostfs_test.go new file mode 100644 index 0000000..11825be --- /dev/null +++ b/api/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/api/object/json.go b/api/object/json.go new file mode 100644 index 0000000..faef249 --- /dev/null +++ b/api/object/json.go @@ -0,0 +1,94 @@ +package object + +import ( + object "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" +) + +func (h *ShortHeader) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(h) +} + +func (h *ShortHeader) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(h, data, new(object.ShortHeader)) +} + +func (a *Attribute) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(a) +} + +func (a *Attribute) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(a, data, new(object.Header_Attribute)) +} + +func (h *SplitHeader) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(h) +} + +func (h *SplitHeader) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(h, data, new(object.Header_Split)) +} + +func (h *Header) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(h) +} + +func (h *Header) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(h, data, new(object.Header)) +} + +func (h *HeaderWithSignature) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(h) +} + +func (h *HeaderWithSignature) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(h, data, new(object.HeaderWithSignature)) +} + +func (o *Object) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(o) +} + +func (o *Object) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(o, data, new(object.Object)) +} + +func (s *SplitInfo) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(s) +} + +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) +} + +func (f *SearchFilter) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(f, data, new(object.SearchRequest_Body_Filter)) +} + +func (r *Range) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(r) +} + +func (r *Range) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(r, data, new(object.Range)) +} diff --git a/api/object/lock.go b/api/object/lock.go new file mode 100644 index 0000000..3af06c6 --- /dev/null +++ b/api/object/lock.go @@ -0,0 +1,160 @@ +package object + +import ( + "errors" + "fmt" + + lock "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/lock/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" +) + +// Lock represents object Lock message from NeoFS API V2 protocol. +type Lock struct { + members []refs.ObjectID +} + +// NumberOfMembers returns length of lock list. +func (x *Lock) NumberOfMembers() int { + if x != nil { + return len(x.members) + } + + return 0 +} + +// IterateMembers passes members of the lock list to f. +func (x *Lock) IterateMembers(f func(refs.ObjectID)) { + if x != nil { + for i := range x.members { + f(x.members[i]) + } + } +} + +// SetMembers sets list of locked members. +// Arg must not be mutated for the duration of the Lock. +func (x *Lock) SetMembers(ids []refs.ObjectID) { + x.members = ids +} + +const ( + _ = iota + fNumLockMembers +) + +// StableMarshal encodes the Lock into Protocol Buffers binary format +// with direct field order. +func (x *Lock) StableMarshal(buf []byte) []byte { + if x == nil || len(x.members) == 0 { + return []byte{} + } + + if buf == nil { + buf = make([]byte, x.StableSize()) + } + + var offset int + + for i := range x.members { + offset += proto.NestedStructureMarshal(fNumLockMembers, buf[offset:], &x.members[i]) + } + + return buf +} + +// StableSize size of the buffer required to write the Lock in Protocol Buffers +// binary format. +func (x *Lock) StableSize() (sz int) { + if x != nil { + for i := range x.members { + sz += proto.NestedStructureSize(fNumLockMembers, &x.members[i]) + } + } + + return +} + +// Unmarshal decodes the Lock from its Protocol Buffers binary format. +func (x *Lock) Unmarshal(data []byte) error { + return message.Unmarshal(x, data, new(lock.Lock)) +} + +func (x *Lock) ToGRPCMessage() grpc.Message { + var m *lock.Lock + + if x != nil { + m = new(lock.Lock) + + var members []refsGRPC.ObjectID + + if x.members != nil { + members = make([]refsGRPC.ObjectID, len(x.members)) + + for i := range x.members { + members[i] = *x.members[i].ToGRPCMessage().(*refsGRPC.ObjectID) + } + } + + m.SetMembers(members) + } + + return m +} + +func (x *Lock) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*lock.Lock) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + members := v.GetMembers() + if members == nil { + x.members = nil + } else { + x.members = make([]refs.ObjectID, len(members)) + var err error + + for i := range x.members { + err = x.members[i].FromGRPCMessage(&members[i]) + if err != nil { + return err + } + } + } + + return nil +} + +// WriteLock writes Lock to the Object as a payload content. +// The object must not be nil. +func WriteLock(obj *Object, lock Lock) { + hdr := obj.GetHeader() + if hdr == nil { + hdr = new(Header) + obj.SetHeader(hdr) + } + + hdr.SetObjectType(TypeLock) + + payload := lock.StableMarshal(nil) + obj.SetPayload(payload) +} + +// ReadLock reads Lock from the Object payload content. +func ReadLock(lock *Lock, obj Object) error { + payload := obj.GetPayload() + if len(payload) == 0 { + return errors.New("empty payload") + } + + err := lock.Unmarshal(payload) + if err != nil { + return fmt.Errorf("decode lock content from payload: %w", err) + } + + return nil +} diff --git a/api/object/lock_test.go b/api/object/lock_test.go new file mode 100644 index 0000000..2515723 --- /dev/null +++ b/api/object/lock_test.go @@ -0,0 +1,26 @@ +package object_test + +import ( + "testing" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + objecttest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object/test" + "github.com/stretchr/testify/require" +) + +func TestLockRW(t *testing.T) { + var l object.Lock + var obj object.Object + + require.Error(t, object.ReadLock(&l, obj)) + + l = *objecttest.GenerateLock(false) + + object.WriteLock(&obj, l) + + var l2 object.Lock + + require.NoError(t, object.ReadLock(&l2, obj)) + + require.Equal(t, l, l2) +} diff --git a/api/object/marshal.go b/api/object/marshal.go new file mode 100644 index 0000000..82e265b --- /dev/null +++ b/api/object/marshal.go @@ -0,0 +1,1428 @@ +package object + +import ( + object "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" +) + +const ( + shortHdrVersionField = 1 + shortHdrEpochField = 2 + shortHdrOwnerField = 3 + shortHdrObjectTypeField = 4 + shortHdrPayloadLength = 5 + shortHdrHashField = 6 + shortHdrHomoHashField = 7 + + attributeKeyField = 1 + attributeValueField = 2 + + splitHdrParentField = 1 + splitHdrPreviousField = 2 + splitHdrParentSignatureField = 3 + splitHdrParentHeaderField = 4 + splitHdrChildrenField = 5 + splitHdrSplitIDField = 6 + + ecHdrParentField = 1 + ecHdrIndexField = 2 + ecHdrTotalField = 3 + ecHdrHeaderLengthField = 4 + ecHdrHeaderField = 5 + ecHdrParentSplitID = 6 + ecHdrParentSplitParentID = 7 + ecHdrParentAttributes = 8 + + hdrVersionField = 1 + hdrContainerIDField = 2 + hdrOwnerIDField = 3 + hdrEpochField = 4 + hdrPayloadLengthField = 5 + hdrPayloadHashField = 6 + hdrObjectTypeField = 7 + hdrHomomorphicHashField = 8 + hdrSessionTokenField = 9 + hdrAttributesField = 10 + hdrSplitField = 11 + hdrECField = 12 + + hdrWithSigHeaderField = 1 + hdrWithSigSignatureField = 2 + + objIDField = 1 + objSignatureField = 2 + objHeaderField = 3 + objPayloadField = 4 + + splitInfoSplitIDField = 1 + splitInfoLastPartField = 2 + splitInfoLinkField = 3 + + ecInfoChunksField = 1 + + ecChunkIDField = 1 + ecChunkIndexField = 2 + ecChunkTotalField = 3 + + getReqBodyAddressField = 1 + getReqBodyRawFlagField = 2 + + getRespInitObjectIDField = 1 + getRespInitSignatureField = 2 + getRespInitHeaderField = 3 + + getRespBodyInitField = 1 + getRespBodyChunkField = 2 + getRespBodySplitInfoField = 3 + getRespBodyECInfoField = 4 + + putReqInitObjectIDField = 1 + putReqInitSignatureField = 2 + putReqInitHeaderField = 3 + putReqInitCopiesNumField = 4 + + putReqBodyInitField = 1 + putReqBodyChunkField = 2 + + putRespBodyObjectIDField = 1 + + deleteReqBodyAddressField = 1 + + deleteRespBodyTombstoneFNum = 1 + + headReqBodyAddressField = 1 + headReqBodyMainFlagField = 2 + headReqBodyRawFlagField = 3 + + headRespBodyHeaderField = 1 + headRespBodyShortHeaderField = 2 + headRespBodySplitInfoField = 3 + headRespBodyECInfoField = 4 + + searchFilterMatchField = 1 + searchFilterNameField = 2 + searchFilterValueField = 3 + + searchReqBodyContainerIDField = 1 + searchReqBodyVersionField = 2 + searchReqBodyFiltersField = 3 + + searchRespBodyObjectIDsField = 1 + + rangeOffsetField = 1 + rangeLengthField = 2 + + getRangeReqBodyAddressField = 1 + getRangeReqBodyRangeField = 2 + getRangeReqBodyRawField = 3 + + getRangeRespChunkField = 1 + getRangeRespSplitInfoField = 2 + getRangeRespECInfoField = 3 + + getRangeHashReqBodyAddressField = 1 + getRangeHashReqBodyRangesField = 2 + getRangeHashReqBodySaltField = 3 + getRangeHashReqBodyTypeField = 4 + + getRangeHashRespBodyTypeField = 1 + getRangeHashRespBodyHashListField = 2 + + 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 { + if h == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, h.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(shortHdrVersionField, buf[offset:], h.version) + offset += proto.UInt64Marshal(shortHdrEpochField, buf[offset:], h.creatEpoch) + offset += proto.NestedStructureMarshal(shortHdrOwnerField, buf[offset:], h.ownerID) + offset += proto.EnumMarshal(shortHdrObjectTypeField, buf[offset:], int32(h.typ)) + offset += proto.UInt64Marshal(shortHdrPayloadLength, buf[offset:], h.payloadLen) + offset += proto.NestedStructureMarshal(shortHdrHashField, buf[offset:], h.payloadHash) + proto.NestedStructureMarshal(shortHdrHomoHashField, buf[offset:], h.homoHash) + + return buf +} + +func (h *ShortHeader) StableSize() (size int) { + if h == nil { + return 0 + } + + size += proto.NestedStructureSize(shortHdrVersionField, h.version) + size += proto.UInt64Size(shortHdrEpochField, h.creatEpoch) + size += proto.NestedStructureSize(shortHdrOwnerField, h.ownerID) + size += proto.EnumSize(shortHdrObjectTypeField, int32(h.typ)) + size += proto.UInt64Size(shortHdrPayloadLength, h.payloadLen) + size += proto.NestedStructureSize(shortHdrHashField, h.payloadHash) + size += proto.NestedStructureSize(shortHdrHomoHashField, h.homoHash) + + return size +} + +func (h *ShortHeader) Unmarshal(data []byte) error { + return message.Unmarshal(h, data, new(object.ShortHeader)) +} + +func (a *Attribute) StableMarshal(buf []byte) []byte { + if a == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, a.StableSize()) + } + + var offset int + + offset += proto.StringMarshal(attributeKeyField, buf[offset:], a.key) + proto.StringMarshal(attributeValueField, buf[offset:], a.val) + + return buf +} + +func (a *Attribute) StableSize() (size int) { + if a == nil { + return 0 + } + + size += proto.StringSize(shortHdrVersionField, a.key) + size += proto.StringSize(shortHdrEpochField, a.val) + + return size +} + +func (a *Attribute) Unmarshal(data []byte) error { + return message.Unmarshal(a, data, new(object.Header_Attribute)) +} + +func (h *SplitHeader) StableMarshal(buf []byte) []byte { + if h == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, h.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(splitHdrParentField, buf[offset:], h.par) + offset += proto.NestedStructureMarshal(splitHdrPreviousField, buf[offset:], h.prev) + offset += proto.NestedStructureMarshal(splitHdrParentSignatureField, buf[offset:], h.parSig) + offset += proto.NestedStructureMarshal(splitHdrParentHeaderField, buf[offset:], h.parHdr) + offset += refs.ObjectIDNestedListMarshal(splitHdrChildrenField, buf[offset:], h.children) + proto.BytesMarshal(splitHdrSplitIDField, buf[offset:], h.splitID) + + return buf +} + +func (h *SplitHeader) StableSize() (size int) { + if h == nil { + return 0 + } + + size += proto.NestedStructureSize(splitHdrParentField, h.par) + size += proto.NestedStructureSize(splitHdrPreviousField, h.prev) + size += proto.NestedStructureSize(splitHdrParentSignatureField, h.parSig) + size += proto.NestedStructureSize(splitHdrParentHeaderField, h.parHdr) + size += refs.ObjectIDNestedListSize(splitHdrChildrenField, h.children) + size += proto.BytesSize(splitHdrSplitIDField, h.splitID) + + return size +} + +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) + offset += proto.BytesMarshal(ecHdrHeaderField, buf[offset:], h.Header) + offset += proto.BytesMarshal(ecHdrParentSplitID, buf[offset:], h.ParentSplitID) + offset += proto.NestedStructureMarshal(ecHdrParentSplitParentID, buf[offset:], h.ParentSplitParentID) + for i := range h.ParentAttributes { + offset += proto.NestedStructureMarshal(ecHdrParentAttributes, buf[offset:], &h.ParentAttributes[i]) + } + 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) + 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 +} + +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{} + } + + if buf == nil { + buf = make([]byte, h.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(hdrVersionField, buf[offset:], h.version) + offset += proto.NestedStructureMarshal(hdrContainerIDField, buf[offset:], h.cid) + offset += proto.NestedStructureMarshal(hdrOwnerIDField, buf[offset:], h.ownerID) + offset += proto.UInt64Marshal(hdrEpochField, buf[offset:], h.creatEpoch) + offset += proto.UInt64Marshal(hdrPayloadLengthField, buf[offset:], h.payloadLen) + offset += proto.NestedStructureMarshal(hdrPayloadHashField, buf[offset:], h.payloadHash) + offset += proto.EnumMarshal(hdrObjectTypeField, buf[offset:], int32(h.typ)) + offset += proto.NestedStructureMarshal(hdrHomomorphicHashField, buf[offset:], h.homoHash) + offset += proto.NestedStructureMarshal(hdrSessionTokenField, buf[offset:], h.sessionToken) + + for i := range h.attr { + offset += proto.NestedStructureMarshal(hdrAttributesField, buf[offset:], &h.attr[i]) + } + + proto.NestedStructureMarshal(hdrSplitField, buf[offset:], h.split) + proto.NestedStructureMarshal(hdrECField, buf[offset:], h.ec) + + return buf +} + +func (h *Header) StableSize() (size int) { + if h == nil { + return 0 + } + + size += proto.NestedStructureSize(hdrVersionField, h.version) + size += proto.NestedStructureSize(hdrContainerIDField, h.cid) + size += proto.NestedStructureSize(hdrOwnerIDField, h.ownerID) + size += proto.UInt64Size(hdrEpochField, h.creatEpoch) + size += proto.UInt64Size(hdrPayloadLengthField, h.payloadLen) + size += proto.NestedStructureSize(hdrPayloadHashField, h.payloadHash) + size += proto.EnumSize(hdrObjectTypeField, int32(h.typ)) + size += proto.NestedStructureSize(hdrHomomorphicHashField, h.homoHash) + size += proto.NestedStructureSize(hdrSessionTokenField, h.sessionToken) + for i := range h.attr { + size += proto.NestedStructureSize(hdrAttributesField, &h.attr[i]) + } + size += proto.NestedStructureSize(hdrSplitField, h.split) + size += proto.NestedStructureSize(hdrECField, h.ec) + + return size +} + +func (h *Header) Unmarshal(data []byte) error { + return message.Unmarshal(h, data, new(object.Header)) +} + +func (h *HeaderWithSignature) StableMarshal(buf []byte) []byte { + if h == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, h.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(hdrWithSigHeaderField, buf[offset:], h.header) + proto.NestedStructureMarshal(hdrWithSigSignatureField, buf[offset:], h.signature) + + return buf +} + +func (h *HeaderWithSignature) StableSize() (size int) { + if h == nil { + return 0 + } + + size += proto.NestedStructureSize(hdrVersionField, h.header) + size += proto.NestedStructureSize(hdrContainerIDField, h.signature) + + return size +} + +func (h *HeaderWithSignature) Unmarshal(data []byte) error { + return message.Unmarshal(h, data, new(object.HeaderWithSignature)) +} + +func (o *Object) StableMarshal(buf []byte) []byte { + if o == nil { + 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()) + } + + var offset int + + offset += proto.NestedStructureMarshal(objIDField, buf[offset:], o.objectID) + offset += proto.NestedStructureMarshal(objSignatureField, buf[offset:], o.idSig) + offset += proto.NestedStructureMarshal(objHeaderField, buf[offset:], o.header) + proto.BytesMarshal(objPayloadField, buf[offset:], o.payload) + + return buf +} + +// SetMarshalData sets marshal data to reduce memory allocations. +// +// It is unsafe to modify/copy object data after setting marshal data. +func (o *Object) SetMarshalData(data []byte) { + if o == nil { + return + } + o.marshalData = data +} + +func (o *Object) StableSize() (size int) { + if o == nil { + return 0 + } + + size += proto.NestedStructureSize(objIDField, o.objectID) + size += proto.NestedStructureSize(objSignatureField, o.idSig) + size += proto.NestedStructureSize(objHeaderField, o.header) + size += proto.BytesSize(objPayloadField, o.payload) + + return size +} + +func (o *Object) Unmarshal(data []byte) error { + return message.Unmarshal(o, data, new(object.Object)) +} + +func (s *SplitInfo) StableMarshal(buf []byte) []byte { + if s == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, s.StableSize()) + } + + var offset int + + offset += proto.BytesMarshal(splitInfoSplitIDField, buf[offset:], s.splitID) + offset += proto.NestedStructureMarshal(splitInfoLastPartField, buf[offset:], s.lastPart) + proto.NestedStructureMarshal(splitInfoLinkField, buf[offset:], s.link) + + return buf +} + +func (s *SplitInfo) StableSize() (size int) { + if s == nil { + return 0 + } + + size += proto.BytesSize(splitInfoSplitIDField, s.splitID) + size += proto.NestedStructureSize(splitInfoLastPartField, s.lastPart) + size += proto.NestedStructureSize(splitInfoLinkField, s.link) + + return size +} + +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{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(getReqBodyAddressField, buf[offset:], r.addr) + proto.BoolMarshal(getReqBodyRawFlagField, buf[offset:], r.raw) + + return buf +} + +func (r *GetRequestBody) StableSize() (size int) { + if r == nil { + return 0 + } + + size += proto.NestedStructureSize(getReqBodyAddressField, r.addr) + size += proto.BoolSize(getReqBodyRawFlagField, r.raw) + + return size +} + +func (r *GetRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(object.GetRequest_Body)) +} + +func (r *GetObjectPartInit) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(getRespInitObjectIDField, buf[offset:], r.id) + offset += proto.NestedStructureMarshal(getRespInitSignatureField, buf[offset:], r.sig) + proto.NestedStructureMarshal(getRespInitHeaderField, buf[offset:], r.hdr) + + return buf +} + +func (r *GetObjectPartInit) StableSize() (size int) { + if r == nil { + return 0 + } + + size += proto.NestedStructureSize(getRespInitObjectIDField, r.id) + size += proto.NestedStructureSize(getRespInitSignatureField, r.sig) + size += proto.NestedStructureSize(getRespInitHeaderField, r.hdr) + + return size +} + +func (r *GetObjectPartInit) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(object.GetResponse_Body_Init)) +} + +func (r *GetResponseBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + switch v := r.objPart.(type) { + case nil: + case *GetObjectPartInit: + proto.NestedStructureMarshal(getRespBodyInitField, buf, v) + case *GetObjectPartChunk: + if v != nil { + proto.BytesMarshal(getRespBodyChunkField, buf, v.chunk) + } + case *SplitInfo: + proto.NestedStructureMarshal(getRespBodySplitInfoField, buf, v) + case *ECInfo: + proto.NestedStructureMarshal(getRespBodyECInfoField, buf, v) + default: + panic("unknown one of object get response body type") + } + + return buf +} + +func (r *GetResponseBody) StableSize() (size int) { + if r == nil { + return 0 + } + + switch v := r.objPart.(type) { + case nil: + case *GetObjectPartInit: + size += proto.NestedStructureSize(getRespBodyInitField, v) + case *GetObjectPartChunk: + if v != nil { + size += proto.BytesSize(getRespBodyChunkField, v.chunk) + } + case *SplitInfo: + size += proto.NestedStructureSize(getRespBodySplitInfoField, v) + case *ECInfo: + size += proto.NestedStructureSize(getRespBodyECInfoField, v) + default: + panic("unknown one of object get response body type") + } + + return +} + +func (r *GetResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(object.GetResponse_Body)) +} + +func (r *PutObjectPartInit) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + + 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) + + return buf +} + +func (r *PutObjectPartInit) StableSize() (size int) { + if r == nil { + return 0 + } + + 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 + + return size +} + +func (r *PutObjectPartInit) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(object.PutRequest_Body_Init)) +} + +func (r *PutRequestBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + switch v := r.objPart.(type) { + case nil: + case *PutObjectPartInit: + proto.NestedStructureMarshal(putReqBodyInitField, buf, v) + case *PutObjectPartChunk: + if v != nil { + proto.BytesMarshal(putReqBodyChunkField, buf, v.chunk) + } + default: + panic("unknown one of object put request body type") + } + + return buf +} + +func (r *PutRequestBody) StableSize() (size int) { + if r == nil { + return 0 + } + + switch v := r.objPart.(type) { + case nil: + case *PutObjectPartInit: + size += proto.NestedStructureSize(putReqBodyInitField, v) + case *PutObjectPartChunk: + if v != nil { + size += proto.BytesSize(putReqBodyChunkField, v.chunk) + } + default: + panic("unknown one of object get response body type") + } + + return size +} + +func (r *PutRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(object.PutRequest_Body)) +} + +func (r *PutResponseBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + proto.NestedStructureMarshal(putRespBodyObjectIDField, buf, r.id) + + return buf +} + +func (r *PutResponseBody) StableSize() (size int) { + if r == nil { + return 0 + } + + size += proto.NestedStructureSize(putRespBodyObjectIDField, r.id) + + return size +} + +func (r *PutResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(object.PutResponse_Body)) +} + +func (r *DeleteRequestBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + proto.NestedStructureMarshal(deleteReqBodyAddressField, buf, r.addr) + + return buf +} + +func (r *DeleteRequestBody) StableSize() (size int) { + if r == nil { + return 0 + } + + size += proto.NestedStructureSize(deleteReqBodyAddressField, r.addr) + + return size +} + +func (r *DeleteRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(object.DeleteRequest_Body)) +} + +func (r *DeleteResponseBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + proto.NestedStructureMarshal(deleteRespBodyTombstoneFNum, buf, r.tombstone) + + return buf +} + +func (r *DeleteResponseBody) StableSize() (size int) { + if r == nil { + return 0 + } + + size += proto.NestedStructureSize(deleteRespBodyTombstoneFNum, r.tombstone) + + return size +} + +func (r *DeleteResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(object.DeleteResponse_Body)) +} + +func (r *HeadRequestBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(headReqBodyAddressField, buf[offset:], r.addr) + offset += proto.BoolMarshal(headReqBodyMainFlagField, buf[offset:], r.mainOnly) + proto.BoolMarshal(headReqBodyRawFlagField, buf[offset:], r.raw) + + return buf +} + +func (r *HeadRequestBody) StableSize() (size int) { + if r == nil { + return 0 + } + + size += proto.NestedStructureSize(headReqBodyAddressField, r.addr) + size += proto.BoolSize(headReqBodyMainFlagField, r.mainOnly) + size += proto.BoolSize(headReqBodyRawFlagField, r.raw) + + return size +} + +func (r *HeadRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(object.HeadRequest_Body)) +} + +func (r *HeadResponseBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + switch v := r.hdrPart.(type) { + case nil: + case *HeaderWithSignature: + if v != nil { + proto.NestedStructureMarshal(headRespBodyHeaderField, buf, v) + } + case *ShortHeader: + if v != nil { + proto.NestedStructureMarshal(headRespBodyShortHeaderField, buf, v) + } + case *SplitInfo: + 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") + } + + return buf +} + +func (r *HeadResponseBody) StableSize() (size int) { + if r == nil { + return 0 + } + + switch v := r.hdrPart.(type) { + case nil: + case *HeaderWithSignature: + if v != nil { + size += proto.NestedStructureSize(headRespBodyHeaderField, v) + } + case *ShortHeader: + if v != nil { + size += proto.NestedStructureSize(headRespBodyShortHeaderField, v) + } + case *SplitInfo: + 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") + } + + return +} + +func (r *HeadResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(object.HeadResponse_Body)) +} + +func (f *SearchFilter) StableMarshal(buf []byte) []byte { + if f == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, f.StableSize()) + } + + var offset int + + offset += proto.EnumMarshal(searchFilterMatchField, buf[offset:], int32(f.matchType)) + offset += proto.StringMarshal(searchFilterNameField, buf[offset:], f.key) + proto.StringMarshal(searchFilterValueField, buf[offset:], f.val) + + return buf +} + +func (f *SearchFilter) StableSize() (size int) { + if f == nil { + return 0 + } + + size += proto.EnumSize(searchFilterMatchField, int32(f.matchType)) + size += proto.StringSize(searchFilterNameField, f.key) + size += proto.StringSize(searchFilterValueField, f.val) + + return size +} + +func (f *SearchFilter) Unmarshal(data []byte) error { + return message.Unmarshal(f, data, new(object.SearchRequest_Body_Filter)) +} + +func (r *SearchRequestBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(searchReqBodyContainerIDField, buf[offset:], r.cid) + offset += proto.UInt32Marshal(searchReqBodyVersionField, buf[offset:], r.version) + + for i := range r.filters { + offset += proto.NestedStructureMarshal(searchReqBodyFiltersField, buf[offset:], &r.filters[i]) + } + + return buf +} + +func (r *SearchRequestBody) StableSize() (size int) { + if r == nil { + return 0 + } + + size += proto.NestedStructureSize(searchReqBodyContainerIDField, r.cid) + size += proto.UInt32Size(searchReqBodyVersionField, r.version) + + for i := range r.filters { + size += proto.NestedStructureSize(searchReqBodyFiltersField, &r.filters[i]) + } + + return size +} + +func (r *SearchRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(object.SearchRequest_Body)) +} + +func (r *SearchResponseBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + + refs.ObjectIDNestedListMarshal(searchRespBodyObjectIDsField, buf[offset:], r.idList) + + return buf +} + +func (r *SearchResponseBody) StableSize() (size int) { + if r == nil { + return 0 + } + + size += refs.ObjectIDNestedListSize(searchRespBodyObjectIDsField, r.idList) + + return size +} + +func (r *SearchResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(object.SearchResponse_Body)) +} + +func (r *Range) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + + offset += proto.UInt64Marshal(rangeOffsetField, buf[offset:], r.off) + proto.UInt64Marshal(rangeLengthField, buf[offset:], r.len) + + return buf +} + +func (r *Range) StableSize() (size int) { + if r == nil { + return 0 + } + + size += proto.UInt64Size(rangeOffsetField, r.off) + size += proto.UInt64Size(rangeLengthField, r.len) + + return size +} + +func (r *Range) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(object.Range)) +} + +func (r *GetRangeRequestBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(getRangeReqBodyAddressField, buf[offset:], r.addr) + offset += proto.NestedStructureMarshal(getRangeReqBodyRangeField, buf[offset:], r.rng) + proto.BoolMarshal(getRangeReqBodyRawField, buf[offset:], r.raw) + + return buf +} + +func (r *GetRangeRequestBody) StableSize() (size int) { + if r == nil { + return 0 + } + + size += proto.NestedStructureSize(getRangeReqBodyAddressField, r.addr) + size += proto.NestedStructureSize(getRangeReqBodyRangeField, r.rng) + size += proto.BoolSize(getRangeReqBodyRawField, r.raw) + + return size +} + +func (r *GetRangeRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(object.GetRangeRequest_Body)) +} + +func (r *GetRangeResponseBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + switch v := r.rngPart.(type) { + case nil: + case *GetRangePartChunk: + if v != nil { + proto.BytesMarshal(getRangeRespChunkField, buf, v.chunk) + } + case *SplitInfo: + 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") + } + + return buf +} + +func (r *GetRangeResponseBody) StableSize() (size int) { + if r == nil { + return 0 + } + + switch v := r.rngPart.(type) { + case nil: + case *GetRangePartChunk: + if v != nil { + size += proto.BytesSize(getRangeRespChunkField, v.chunk) + } + case *SplitInfo: + 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") + } + + return +} + +func (r *GetRangeResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(object.GetRangeResponse_Body)) +} + +func (r *GetRangeHashRequestBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(getRangeHashReqBodyAddressField, buf[offset:], r.addr) + + for i := range r.rngs { + offset += proto.NestedStructureMarshal(getRangeHashReqBodyRangesField, buf[offset:], &r.rngs[i]) + } + + offset += proto.BytesMarshal(getRangeHashReqBodySaltField, buf[offset:], r.salt) + proto.EnumMarshal(getRangeHashReqBodyTypeField, buf[offset:], int32(r.typ)) + + return buf +} + +func (r *GetRangeHashRequestBody) StableSize() (size int) { + if r == nil { + return 0 + } + + size += proto.NestedStructureSize(getRangeHashReqBodyAddressField, r.addr) + + for i := range r.rngs { + size += proto.NestedStructureSize(getRangeHashReqBodyRangesField, &r.rngs[i]) + } + + size += proto.BytesSize(getRangeHashReqBodySaltField, r.salt) + size += proto.EnumSize(getRangeHashReqBodyTypeField, int32(r.typ)) + + return size +} + +func (r *GetRangeHashRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(object.GetRangeHashRequest_Body)) +} + +func (r *GetRangeHashResponseBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + + offset += proto.EnumMarshal(getRangeHashRespBodyTypeField, buf, int32(r.typ)) + proto.RepeatedBytesMarshal(getRangeHashRespBodyHashListField, buf[offset:], r.hashList) + + return buf +} + +func (r *GetRangeHashResponseBody) StableSize() (size int) { + if r == nil { + return 0 + } + + size += proto.EnumSize(getRangeHashRespBodyTypeField, int32(r.typ)) + size += proto.RepeatedBytesSize(getRangeHashRespBodyHashListField, r.hashList) + + return size +} + +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 r.marshalData != nil { + if buf == nil { + return r.marshalData + } + copy(buf, r.marshalData) + return buf + } + + 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 +} + +// SetMarshalData sets marshal data to reduce memory allocations. +// +// It is unsafe to modify/copy request data after setting marshal data. +func (r *PutSingleRequestBody) SetMarshalData(data []byte) { + if r == nil { + return + } + + r.marshalData = data + + proto.NestedStructureSetMarshalData(putSingleReqObjectField, r.marshalData, r.object) +} + +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)) +} + +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)) +} + +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.GetRange()) + proto.BytesMarshal(patchRequestBodyPatchChunkField, buf[offset:], r.GetChunk()) + + return buf +} + +func (r *PatchRequestBodyPatch) StableSize() int { + if r == nil { + return 0 + } + + var size int + size += proto.NestedStructureSize(patchRequestBodyPatchRangeField, r.GetRange()) + size += proto.BytesSize(patchRequestBodyPatchChunkField, r.GetChunk()) + + 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) + 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 + 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/api/object/message_test.go b/api/object/message_test.go new file mode 100644 index 0000000..21568f8 --- /dev/null +++ b/api/object/message_test.go @@ -0,0 +1,65 @@ +package object_test + +import ( + "testing" + + objecttest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object/test" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message/test" +) + +func TestMessageConvert(t *testing.T) { + messagetest.TestRPCMessage(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.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) }, + 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) }, + func(empty bool) message.Message { return objecttest.GenerateGetObjectPartChunk(empty) }, + func(empty bool) message.Message { return objecttest.GenerateGetResponseBody(empty) }, + func(empty bool) message.Message { return objecttest.GenerateGetResponse(empty) }, + func(empty bool) message.Message { return objecttest.GeneratePutObjectPartInit(empty) }, + func(empty bool) message.Message { return objecttest.GeneratePutObjectPartChunk(empty) }, + func(empty bool) message.Message { return objecttest.GeneratePutRequestBody(empty) }, + func(empty bool) message.Message { return objecttest.GeneratePutRequest(empty) }, + func(empty bool) message.Message { return objecttest.GeneratePutResponseBody(empty) }, + func(empty bool) message.Message { return objecttest.GeneratePutResponse(empty) }, + func(empty bool) message.Message { return objecttest.GenerateDeleteRequestBody(empty) }, + func(empty bool) message.Message { return objecttest.GenerateDeleteRequest(empty) }, + func(empty bool) message.Message { return objecttest.GenerateDeleteResponseBody(empty) }, + func(empty bool) message.Message { return objecttest.GenerateDeleteResponse(empty) }, + func(empty bool) message.Message { return objecttest.GenerateHeadRequestBody(empty) }, + func(empty bool) message.Message { return objecttest.GenerateHeadRequest(empty) }, + func(empty bool) message.Message { return objecttest.GenerateHeadResponseBody(empty) }, + func(empty bool) message.Message { return objecttest.GenerateHeadResponse(empty) }, + func(empty bool) message.Message { return objecttest.GenerateSearchFilter(empty) }, + func(empty bool) message.Message { return objecttest.GenerateSearchRequestBody(empty) }, + func(empty bool) message.Message { return objecttest.GenerateSearchRequest(empty) }, + func(empty bool) message.Message { return objecttest.GenerateSearchResponseBody(empty) }, + func(empty bool) message.Message { return objecttest.GenerateSearchResponse(empty) }, + func(empty bool) message.Message { return objecttest.GenerateRange(empty) }, + func(empty bool) message.Message { return objecttest.GenerateGetRangeRequestBody(empty) }, + func(empty bool) message.Message { return objecttest.GenerateGetRangeRequest(empty) }, + func(empty bool) message.Message { return objecttest.GenerateGetRangeResponseBody(empty) }, + func(empty bool) message.Message { return objecttest.GenerateGetRangeResponse(empty) }, + func(empty bool) message.Message { return objecttest.GenerateGetRangeHashRequestBody(empty) }, + func(empty bool) message.Message { return objecttest.GenerateGetRangeHashRequest(empty) }, + 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) }, + 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/api/object/status.go b/api/object/status.go new file mode 100644 index 0000000..32fda2b --- /dev/null +++ b/api/object/status.go @@ -0,0 +1,91 @@ +package object + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status" + statusgrpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status/grpc" +) + +// LocalizeFailStatus checks if passed global status.Code is related to object failure and: +// +// then localizes the code and returns true, +// else leaves the code unchanged and returns false. +// +// Arg must not be nil. +func LocalizeFailStatus(c *status.Code) bool { + return status.LocalizeIfInSection(c, uint32(statusgrpc.Section_SECTION_OBJECT)) +} + +// GlobalizeFail globalizes local code of object failure. +// +// Arg must not be nil. +func GlobalizeFail(c *status.Code) { + c.GlobalizeSection(uint32(statusgrpc.Section_SECTION_OBJECT)) +} + +const ( + // StatusAccessDenied is a local status.Code value for + // ACCESS_DENIED object failure. + StatusAccessDenied status.Code = iota + // StatusNotFound is a local status.Code value for + // OBJECT_NOT_FOUND object failure. + StatusNotFound + // StatusLocked is a local status.Code value for + // LOCKED object failure. + StatusLocked + // StatusLockNonRegularObject is a local status.Code value for + // LOCK_NON_REGULAR_OBJECT object failure. + StatusLockNonRegularObject + // StatusAlreadyRemoved is a local status.Code value for + // OBJECT_ALREADY_REMOVED object failure. + StatusAlreadyRemoved + // StatusOutOfRange is a local status.Code value for + // OUT_OF_RANGE object failure. + StatusOutOfRange +) + +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/api/object/status_test.go b/api/object/status_test.go new file mode 100644 index 0000000..465f5c8 --- /dev/null +++ b/api/object/status_test.go @@ -0,0 +1,35 @@ +package object_test + +import ( + "testing" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status" + statustest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status/test" + "github.com/stretchr/testify/require" +) + +func TestStatusCodes(t *testing.T) { + statustest.TestCodes(t, object.LocalizeFailStatus, object.GlobalizeFail, + object.StatusAccessDenied, 2048, + object.StatusNotFound, 2049, + object.StatusLocked, 2050, + object.StatusLockNonRegularObject, 2051, + object.StatusAlreadyRemoved, 2052, + object.StatusOutOfRange, 2053, + ) +} + +func TestAccessDeniedDesc(t *testing.T) { + var st status.Status + + require.Empty(t, object.ReadAccessDeniedDesc(st)) + + const desc = "some description" + + object.WriteAccessDeniedDesc(&st, desc) + require.Equal(t, desc, object.ReadAccessDeniedDesc(st)) + + object.WriteAccessDeniedDesc(&st, desc+"1") + require.Equal(t, desc+"1", object.ReadAccessDeniedDesc(st)) +} diff --git a/api/object/string.go b/api/object/string.go new file mode 100644 index 0000000..9910df7 --- /dev/null +++ b/api/object/string.go @@ -0,0 +1,55 @@ +package object + +import ( + object "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object/grpc" +) + +// String returns string representation of Type. +func (t Type) String() string { + return TypeToGRPCField(t).String() +} + +// FromString parses Type from a string representation. +// It is a reverse action to String(). +// +// Returns true if s was parsed successfully. +func (t *Type) FromString(s string) bool { + var g object.ObjectType + + ok := g.FromString(s) + + if ok { + *t = TypeFromGRPCField(g) + } + + return ok +} + +// TypeFromString converts string to Type. +// +// Deprecated: use FromString method. +func TypeFromString(s string) (t Type) { + t.FromString(s) + return +} + +// String returns string representation of MatchType. +func (t MatchType) String() string { + return MatchTypeToGRPCField(t).String() +} + +// FromString parses MatchType from a string representation. +// It is a reverse action to String(). +// +// Returns true if s was parsed successfully. +func (t *MatchType) FromString(s string) bool { + var g object.MatchType + + ok := g.FromString(s) + + if ok { + *t = MatchTypeFromGRPCField(g) + } + + return ok +} diff --git a/api/object/test/generate.go b/api/object/test/generate.go new file mode 100644 index 0000000..37345f9 --- /dev/null +++ b/api/object/test/generate.go @@ -0,0 +1,766 @@ +package objecttest + +import ( + crand "crypto/rand" + "math/rand" + "time" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + refstest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/test" + sessiontest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/test" +) + +func GenerateShortHeader(empty bool) *object.ShortHeader { + m := new(object.ShortHeader) + + if !empty { + m.SetObjectType(13) + m.SetCreationEpoch(100) + m.SetPayloadLength(12321) + m.SetOwnerID(refstest.GenerateOwnerID(false)) + } + + m.SetVersion(refstest.GenerateVersion(empty)) + m.SetHomomorphicHash(refstest.GenerateChecksum(empty)) + m.SetPayloadHash(refstest.GenerateChecksum(empty)) + + return m +} + +func GenerateAttribute(empty bool) *object.Attribute { + m := new(object.Attribute) + + if !empty { + m.SetKey("object key") + m.SetValue("object value") + } + + return m +} + +func GenerateAttributes(empty bool) []object.Attribute { + var res []object.Attribute + + if !empty { + res = append(res, + *GenerateAttribute(false), + *GenerateAttribute(false), + ) + } + + return res +} + +func GenerateSplitHeader(empty bool) *object.SplitHeader { + return generateSplitHeader(empty, true) +} + +func generateSplitHeader(empty, withPar bool) *object.SplitHeader { + m := new(object.SplitHeader) + + if !empty { + 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)) + } + + m.SetParentSignature(refstest.GenerateSignature(empty)) + + if withPar { + m.SetParentHeader(GenerateHeaderWithSplitHeader(empty)) + } + + return m +} + +func GenerateHeaderWithSplitHeader(empty bool) *object.Header { + m := generateHeader(empty) + m.SetSplit(generateSplitHeader(empty, false)) + return m +} + +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 = make([]byte, 16) + _, _ = crand.Read(ech.ParentSplitID) + + ech.ParentSplitParentID = refstest.GenerateObjectID(empty) + ech.ParentAttributes = GenerateAttributes(empty) + 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 { + m.SetPayloadLength(777) + m.SetCreationEpoch(432) + m.SetObjectType(111) + m.SetOwnerID(refstest.GenerateOwnerID(false)) + m.SetContainerID(refstest.GenerateContainerID(false)) + m.SetAttributes(GenerateAttributes(false)) + } + + m.SetVersion(refstest.GenerateVersion(empty)) + m.SetPayloadHash(refstest.GenerateChecksum(empty)) + m.SetHomomorphicHash(refstest.GenerateChecksum(empty)) + m.SetSessionToken(sessiontest.GenerateSessionToken(empty)) + + return m +} + +func GenerateHeaderWithSignature(empty bool) *object.HeaderWithSignature { + m := new(object.HeaderWithSignature) + + m.SetSignature(refstest.GenerateSignature(empty)) + m.SetHeader(GenerateHeaderWithSplitHeader(empty)) + + return m +} + +func GenerateObject(empty bool) *object.Object { + m := new(object.Object) + + if !empty { + m.SetPayload([]byte{7, 8, 9}) + m.SetObjectID(refstest.GenerateObjectID(false)) + } + + m.SetSignature(refstest.GenerateSignature(empty)) + m.SetHeader(GenerateHeaderWithSplitHeader(empty)) + + return m +} + +func GenerateSplitInfo(empty bool) *object.SplitInfo { + m := new(object.SplitInfo) + + if !empty { + id := make([]byte, 16) + _, _ = crand.Read(id) + + m.SetSplitID(id) + m.SetLastPart(refstest.GenerateObjectID(false)) + m.SetLink(refstest.GenerateObjectID(false)) + } + + 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) + + if !empty { + m.SetRaw(true) + m.SetAddress(refstest.GenerateAddress(false)) + } + + return m +} + +func GenerateGetRequest(empty bool) *object.GetRequest { + m := new(object.GetRequest) + + if !empty { + m.SetBody(GenerateGetRequestBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + + return m +} + +func GenerateGetObjectPartInit(empty bool) *object.GetObjectPartInit { + m := new(object.GetObjectPartInit) + + if !empty { + m.SetObjectID(refstest.GenerateObjectID(false)) + } + + m.SetSignature(refstest.GenerateSignature(empty)) + m.SetHeader(GenerateHeaderWithSplitHeader(empty)) + + return m +} + +func GenerateGetObjectPartChunk(empty bool) *object.GetObjectPartChunk { + m := new(object.GetObjectPartChunk) + + if !empty { + m.SetChunk([]byte("get chunk")) + } + + return m +} + +func GenerateGetResponseBody(empty bool) *object.GetResponseBody { + m := new(object.GetResponseBody) + + if !empty { + switch randomInt(3) { + case 0: + m.SetObjectPart(GenerateGetObjectPartInit(false)) + case 1: + m.SetObjectPart(GenerateGetObjectPartChunk(false)) + case 2: + m.SetObjectPart(GenerateSplitInfo(false)) + } + } + + return m +} + +func GenerateGetResponse(empty bool) *object.GetResponse { + m := new(object.GetResponse) + + if !empty { + m.SetBody(GenerateGetResponseBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + + return m +} + +func GeneratePutObjectPartInit(empty bool) *object.PutObjectPartInit { + m := new(object.PutObjectPartInit) + + if !empty { + m.SetCopiesNumber([]uint32{234}) + m.SetObjectID(refstest.GenerateObjectID(false)) + } + + m.SetSignature(refstest.GenerateSignature(empty)) + m.SetHeader(GenerateHeaderWithSplitHeader(empty)) + + return m +} + +func GeneratePutObjectPartChunk(empty bool) *object.PutObjectPartChunk { + m := new(object.PutObjectPartChunk) + + if !empty { + m.SetChunk([]byte("put chunk")) + } + + return m +} + +func GeneratePutRequestBody(empty bool) *object.PutRequestBody { + m := new(object.PutRequestBody) + + if !empty { + switch randomInt(2) { + case 0: + m.SetObjectPart(GeneratePutObjectPartInit(false)) + case 1: + m.SetObjectPart(GeneratePutObjectPartChunk(false)) + } + } + + return m +} + +func GeneratePutRequest(empty bool) *object.PutRequest { + m := new(object.PutRequest) + + if !empty { + m.SetBody(GeneratePutRequestBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + + return m +} + +func GeneratePutResponseBody(empty bool) *object.PutResponseBody { + m := new(object.PutResponseBody) + + if !empty { + m.SetObjectID(refstest.GenerateObjectID(false)) + } + + return m +} + +func GeneratePutResponse(empty bool) *object.PutResponse { + m := new(object.PutResponse) + + if !empty { + m.SetBody(GeneratePutResponseBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + + return m +} + +func GenerateDeleteRequestBody(empty bool) *object.DeleteRequestBody { + m := new(object.DeleteRequestBody) + + if !empty { + m.SetAddress(refstest.GenerateAddress(false)) + } + + return m +} + +func GenerateDeleteRequest(empty bool) *object.DeleteRequest { + m := new(object.DeleteRequest) + + if !empty { + m.SetBody(GenerateDeleteRequestBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + + return m +} + +func GenerateDeleteResponseBody(empty bool) *object.DeleteResponseBody { + m := new(object.DeleteResponseBody) + + if !empty { + m.SetTombstone(refstest.GenerateAddress(false)) + } + + return m +} + +func GenerateDeleteResponse(empty bool) *object.DeleteResponse { + m := new(object.DeleteResponse) + + if !empty { + m.SetBody(GenerateDeleteResponseBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + + return m +} + +func GenerateHeadRequestBody(empty bool) *object.HeadRequestBody { + m := new(object.HeadRequestBody) + + if !empty { + m.SetRaw(true) + m.SetMainOnly(true) + m.SetAddress(refstest.GenerateAddress(false)) + } + + return m +} + +func GenerateHeadRequest(empty bool) *object.HeadRequest { + m := new(object.HeadRequest) + + if !empty { + m.SetBody(GenerateHeadRequestBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + + return m +} + +func GenerateHeadResponseBody(empty bool) *object.HeadResponseBody { + m := new(object.HeadResponseBody) + + if !empty { + switch randomInt(3) { + case 0: + m.SetHeaderPart(GenerateHeaderWithSignature(false)) + case 1: + m.SetHeaderPart(GenerateShortHeader(false)) + case 2: + m.SetHeaderPart(GenerateSplitInfo(false)) + } + } + + return m +} + +func GenerateHeadResponse(empty bool) *object.HeadResponse { + m := new(object.HeadResponse) + + if !empty { + m.SetBody(GenerateHeadResponseBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + + return m +} + +func GenerateSearchFilter(empty bool) *object.SearchFilter { + m := new(object.SearchFilter) + + if !empty { + m.SetKey("search filter key") + m.SetValue("search filter val") + m.SetMatchType(987) + } + + return m +} + +func GenerateSearchFilters(empty bool) []object.SearchFilter { + var res []object.SearchFilter + + if !empty { + res = append(res, + *GenerateSearchFilter(false), + *GenerateSearchFilter(false), + ) + } + + return res +} + +func GenerateSearchRequestBody(empty bool) *object.SearchRequestBody { + m := new(object.SearchRequestBody) + + if !empty { + m.SetVersion(555) + m.SetContainerID(refstest.GenerateContainerID(false)) + m.SetFilters(GenerateSearchFilters(false)) + } + + return m +} + +func GenerateSearchRequest(empty bool) *object.SearchRequest { + m := new(object.SearchRequest) + + if !empty { + m.SetBody(GenerateSearchRequestBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + + return m +} + +func GenerateSearchResponseBody(empty bool) *object.SearchResponseBody { + m := new(object.SearchResponseBody) + + if !empty { + m.SetIDList(refstest.GenerateObjectIDs(false)) + } + + return m +} + +func GenerateSearchResponse(empty bool) *object.SearchResponse { + m := new(object.SearchResponse) + + if !empty { + m.SetBody(GenerateSearchResponseBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + + return m +} + +func GenerateRange(empty bool) *object.Range { + m := new(object.Range) + + if !empty { + m.SetLength(11) + m.SetOffset(22) + } + + return m +} + +func GenerateRanges(empty bool) []object.Range { + var res []object.Range + + if !empty { + res = append(res, + *GenerateRange(false), + *GenerateRange(false), + ) + } + + return res +} + +func GenerateGetRangeRequestBody(empty bool) *object.GetRangeRequestBody { + m := new(object.GetRangeRequestBody) + + if !empty { + m.SetRaw(true) + m.SetAddress(refstest.GenerateAddress(empty)) + m.SetRange(GenerateRange(empty)) + } + + return m +} + +func GenerateGetRangeRequest(empty bool) *object.GetRangeRequest { + m := new(object.GetRangeRequest) + + if !empty { + m.SetBody(GenerateGetRangeRequestBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + + return m +} + +func GenerateGetRangePartChunk(empty bool) *object.GetRangePartChunk { + m := new(object.GetRangePartChunk) + + if !empty { + m.SetChunk([]byte("get range chunk")) + } + + return m +} + +func GenerateGetRangeResponseBody(empty bool) *object.GetRangeResponseBody { + m := new(object.GetRangeResponseBody) + + if !empty { + switch randomInt(2) { + case 0: + m.SetRangePart(GenerateGetRangePartChunk(false)) + case 1: + m.SetRangePart(GenerateSplitInfo(false)) + } + } + + return m +} + +func GenerateGetRangeResponse(empty bool) *object.GetRangeResponse { + m := new(object.GetRangeResponse) + + if !empty { + m.SetBody(GenerateGetRangeResponseBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + + return m +} + +func GenerateGetRangeHashRequestBody(empty bool) *object.GetRangeHashRequestBody { + m := new(object.GetRangeHashRequestBody) + + if !empty { + m.SetSalt([]byte("range hash salt")) + m.SetType(455) + m.SetAddress(refstest.GenerateAddress(false)) + m.SetRanges(GenerateRanges(false)) + } + + return m +} + +func GenerateGetRangeHashRequest(empty bool) *object.GetRangeHashRequest { + m := new(object.GetRangeHashRequest) + + if !empty { + m.SetBody(GenerateGetRangeHashRequestBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + + return m +} + +func GenerateGetRangeHashResponseBody(empty bool) *object.GetRangeHashResponseBody { + m := new(object.GetRangeHashResponseBody) + + if !empty { + m.SetType(678) + m.SetHashList([][]byte{ + refstest.GenerateChecksum(false).GetSum(), + refstest.GenerateChecksum(false).GetSum(), + }) + } + + return m +} + +func GenerateGetRangeHashResponse(empty bool) *object.GetRangeHashResponse { + m := new(object.GetRangeHashResponse) + + if !empty { + m.SetBody(GenerateGetRangeHashResponseBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + + return m +} + +func GenerateLock(empty bool) *object.Lock { + m := new(object.Lock) + + if !empty { + m.SetMembers([]refs.ObjectID{ + *refstest.GenerateObjectID(false), + *refstest.GenerateObjectID(false), + }) + } + + 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 +} + +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 +} + +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.SetAddress(refstest.GenerateAddress(empty)) + m.SetNewAttributes(GenerateAttributes(empty)) + m.SetReplaceAttributes(false) + m.SetPatch(GeneratePatchRequestBodyPatch(empty)) + } + + return m +} + +func GeneratePatchRequest(empty bool) *object.PatchRequest { + m := new(object.PatchRequest) + + if !empty { + m.SetBody(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/api/object/types.go b/api/object/types.go new file mode 100644 index 0000000..537fb02 --- /dev/null +++ b/api/object/types.go @@ -0,0 +1,1650 @@ +package object + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" +) + +type Type uint32 + +type MatchType uint32 + +type ShortHeader struct { + version *refs.Version + + creatEpoch uint64 + + ownerID *refs.OwnerID + + typ Type + + payloadLen uint64 + + payloadHash, homoHash *refs.Checksum +} + +type Attribute struct { + key, val string +} + +type SplitHeader struct { + par, prev *refs.ObjectID + + parSig *refs.Signature + + parHdr *Header + + children []refs.ObjectID + + splitID []byte +} + +type ECHeader struct { + Parent *refs.ObjectID + ParentSplitID []byte + ParentSplitParentID *refs.ObjectID + ParentAttributes []Attribute + Index uint32 + Total uint32 + Header []byte + HeaderLength uint32 +} + +type Header struct { + version *refs.Version + + cid *refs.ContainerID + + ownerID *refs.OwnerID + + creatEpoch uint64 + + payloadLen uint64 + + payloadHash, homoHash *refs.Checksum + + typ Type + + sessionToken *session.Token + + attr []Attribute + + split *SplitHeader + + ec *ECHeader +} + +type HeaderWithSignature struct { + header *Header + + signature *refs.Signature +} + +type Object struct { + objectID *refs.ObjectID + + idSig *refs.Signature + + header *Header + + payload []byte + + // marshalData holds marshaled data, must not be marshaled by StableMarshal + marshalData []byte +} + +type SplitInfo struct { + splitID []byte + + lastPart *refs.ObjectID + + link *refs.ObjectID +} + +type ECChunk struct { + ID refs.ObjectID + Index uint32 + Total uint32 +} + +type ECInfo struct { + Chunks []ECChunk +} + +type GetRequestBody struct { + addr *refs.Address + + raw bool +} + +type GetObjectPart interface { + getObjectPart() +} + +type GetObjectPartInit struct { + id *refs.ObjectID + + sig *refs.Signature + + hdr *Header +} + +type GetObjectPartChunk struct { + chunk []byte +} + +type GetRequest struct { + body *GetRequestBody + + session.RequestHeaders +} + +type GetResponseBody struct { + objPart GetObjectPart +} + +type PutObjectPart interface { + putObjectPart() +} + +type PutObjectPartInit struct { + id *refs.ObjectID + + sig *refs.Signature + + hdr *Header + + copyNum []uint32 +} + +type PutObjectPartChunk struct { + chunk []byte +} + +type GetResponse struct { + body *GetResponseBody + + session.ResponseHeaders +} + +type PutRequestBody struct { + objPart PutObjectPart +} + +type PutRequest struct { + body *PutRequestBody + + session.RequestHeaders +} + +type PutResponseBody struct { + id *refs.ObjectID +} + +type PutResponse struct { + body *PutResponseBody + + session.ResponseHeaders +} + +type DeleteRequestBody struct { + addr *refs.Address +} + +type DeleteRequest struct { + body *DeleteRequestBody + + session.RequestHeaders +} + +type DeleteResponseBody struct { + tombstone *refs.Address +} + +type DeleteResponse struct { + body *DeleteResponseBody + + session.ResponseHeaders +} + +type HeadRequestBody struct { + addr *refs.Address + + mainOnly, raw bool +} + +type GetHeaderPart interface { + getHeaderPart() +} + +type HeadRequest struct { + body *HeadRequestBody + + session.RequestHeaders +} + +type HeadResponseBody struct { + hdrPart GetHeaderPart +} + +type HeadResponse struct { + body *HeadResponseBody + + session.ResponseHeaders +} + +type SearchFilter struct { + matchType MatchType + + key, val string +} + +type SearchRequestBody struct { + cid *refs.ContainerID + + version uint32 + + filters []SearchFilter +} + +type SearchRequest struct { + body *SearchRequestBody + + session.RequestHeaders +} + +type SearchResponseBody struct { + idList []refs.ObjectID +} + +type SearchResponse struct { + body *SearchResponseBody + + session.ResponseHeaders +} + +type Range struct { + off, len uint64 +} + +type GetRangeRequestBody struct { + addr *refs.Address + + rng *Range + + raw bool +} + +type GetRangeRequest struct { + body *GetRangeRequestBody + + session.RequestHeaders +} + +type GetRangePart interface { + getRangePart() +} + +type GetRangePartChunk struct { + chunk []byte +} + +type GetRangeResponseBody struct { + rngPart GetRangePart +} + +type GetRangeResponse struct { + body *GetRangeResponseBody + + session.ResponseHeaders +} + +type GetRangeHashRequestBody struct { + addr *refs.Address + + rngs []Range + + salt []byte + + typ refs.ChecksumType +} + +type GetRangeHashRequest struct { + body *GetRangeHashRequestBody + + session.RequestHeaders +} + +type GetRangeHashResponseBody struct { + typ refs.ChecksumType + + hashList [][]byte +} + +type GetRangeHashResponse struct { + body *GetRangeHashResponseBody + + session.ResponseHeaders +} + +type PutSingleRequestBody struct { + object *Object + copyNum []uint32 + + // marshalData holds marshaled data, must not be marshaled by StableMarshal + marshalData []byte +} + +type PutSingleRequest struct { + body *PutSingleRequestBody + + session.RequestHeaders +} + +type PutSingleResponseBody struct{} + +type PutSingleResponse struct { + body *PutSingleResponseBody + + 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 + _ + TypeLock +) + +const ( + MatchUnknown MatchType = iota + MatchStringEqual + MatchStringNotEqual + MatchNotPresent + MatchCommonPrefix +) + +func (h *ShortHeader) GetVersion() *refs.Version { + if h != nil { + return h.version + } + + return nil +} + +func (h *ShortHeader) SetVersion(v *refs.Version) { + h.version = v +} + +func (h *ShortHeader) GetCreationEpoch() uint64 { + if h != nil { + return h.creatEpoch + } + + return 0 +} + +func (h *ShortHeader) SetCreationEpoch(v uint64) { + h.creatEpoch = v +} + +func (h *ShortHeader) GetOwnerID() *refs.OwnerID { + if h != nil { + return h.ownerID + } + + return nil +} + +func (h *ShortHeader) SetOwnerID(v *refs.OwnerID) { + h.ownerID = v +} + +func (h *ShortHeader) GetObjectType() Type { + if h != nil { + return h.typ + } + + return TypeRegular +} + +func (h *ShortHeader) SetObjectType(v Type) { + h.typ = v +} + +func (h *ShortHeader) GetPayloadLength() uint64 { + if h != nil { + return h.payloadLen + } + + return 0 +} + +func (h *ShortHeader) SetPayloadLength(v uint64) { + h.payloadLen = v +} + +func (h *ShortHeader) GetPayloadHash() *refs.Checksum { + if h != nil { + return h.payloadHash + } + + return nil +} + +func (h *ShortHeader) SetPayloadHash(v *refs.Checksum) { + h.payloadHash = v +} + +func (h *ShortHeader) GetHomomorphicHash() *refs.Checksum { + if h != nil { + return h.homoHash + } + + return nil +} + +func (h *ShortHeader) SetHomomorphicHash(v *refs.Checksum) { + h.homoHash = v +} + +func (h *ShortHeader) getHeaderPart() {} + +func (a *Attribute) GetKey() string { + if a != nil { + return a.key + } + + return "" +} + +func (a *Attribute) SetKey(v string) { + a.key = v +} + +func (a *Attribute) GetValue() string { + if a != nil { + return a.val + } + + return "" +} + +func (a *Attribute) SetValue(v string) { + a.val = v +} + +func (h *SplitHeader) GetParent() *refs.ObjectID { + if h != nil { + return h.par + } + + return nil +} + +func (h *SplitHeader) SetParent(v *refs.ObjectID) { + h.par = v +} + +func (h *SplitHeader) GetPrevious() *refs.ObjectID { + if h != nil { + return h.prev + } + + return nil +} + +func (h *SplitHeader) SetPrevious(v *refs.ObjectID) { + h.prev = v +} + +func (h *SplitHeader) GetParentSignature() *refs.Signature { + if h != nil { + return h.parSig + } + + return nil +} + +func (h *SplitHeader) SetParentSignature(v *refs.Signature) { + h.parSig = v +} + +func (h *SplitHeader) GetParentHeader() *Header { + if h != nil { + return h.parHdr + } + + return nil +} + +func (h *SplitHeader) SetParentHeader(v *Header) { + h.parHdr = v +} + +func (h *SplitHeader) GetChildren() []refs.ObjectID { + if h != nil { + return h.children + } + + return nil +} + +func (h *SplitHeader) SetChildren(v []refs.ObjectID) { + h.children = v +} + +func (h *SplitHeader) GetSplitID() []byte { + if h != nil { + return h.splitID + } + + return nil +} + +func (h *SplitHeader) SetSplitID(v []byte) { + h.splitID = v +} + +func (h *Header) GetVersion() *refs.Version { + if h != nil { + return h.version + } + + return nil +} + +func (h *Header) SetVersion(v *refs.Version) { + h.version = v +} + +func (h *Header) GetContainerID() *refs.ContainerID { + if h != nil { + return h.cid + } + + return nil +} + +func (h *Header) SetContainerID(v *refs.ContainerID) { + h.cid = v +} + +func (h *Header) GetOwnerID() *refs.OwnerID { + if h != nil { + return h.ownerID + } + + return nil +} + +func (h *Header) SetOwnerID(v *refs.OwnerID) { + h.ownerID = v +} + +func (h *Header) GetCreationEpoch() uint64 { + if h != nil { + return h.creatEpoch + } + + return 0 +} + +func (h *Header) SetCreationEpoch(v uint64) { + h.creatEpoch = v +} + +func (h *Header) GetPayloadLength() uint64 { + if h != nil { + return h.payloadLen + } + + return 0 +} + +func (h *Header) SetPayloadLength(v uint64) { + h.payloadLen = v +} + +func (h *Header) GetPayloadHash() *refs.Checksum { + if h != nil { + return h.payloadHash + } + + return nil +} + +func (h *Header) SetPayloadHash(v *refs.Checksum) { + h.payloadHash = v +} + +func (h *Header) GetObjectType() Type { + if h != nil { + return h.typ + } + + return TypeRegular +} + +func (h *Header) SetObjectType(v Type) { + h.typ = v +} + +func (h *Header) GetHomomorphicHash() *refs.Checksum { + if h != nil { + return h.homoHash + } + + return nil +} + +func (h *Header) SetHomomorphicHash(v *refs.Checksum) { + h.homoHash = v +} + +func (h *Header) GetSessionToken() *session.Token { + if h != nil { + return h.sessionToken + } + + return nil +} + +func (h *Header) SetSessionToken(v *session.Token) { + h.sessionToken = v +} + +func (h *Header) GetAttributes() []Attribute { + if h != nil { + return h.attr + } + + return nil +} + +func (h *Header) SetAttributes(v []Attribute) { + h.attr = v +} + +func (h *Header) GetSplit() *SplitHeader { + if h != nil { + return h.split + } + + return nil +} + +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 + } + + return nil +} + +func (h *HeaderWithSignature) SetHeader(v *Header) { + h.header = v +} + +func (h *HeaderWithSignature) GetSignature() *refs.Signature { + if h != nil { + return h.signature + } + + return nil +} + +func (h *HeaderWithSignature) SetSignature(v *refs.Signature) { + h.signature = v +} + +func (h *HeaderWithSignature) getHeaderPart() {} + +func (o *Object) GetObjectID() *refs.ObjectID { + if o != nil { + return o.objectID + } + + return nil +} + +func (o *Object) SetObjectID(v *refs.ObjectID) { + o.objectID = v +} + +func (o *Object) GetSignature() *refs.Signature { + if o != nil { + return o.idSig + } + + return nil +} + +func (o *Object) SetSignature(v *refs.Signature) { + o.idSig = v +} + +func (o *Object) GetHeader() *Header { + if o != nil { + return o.header + } + + return nil +} + +func (o *Object) SetHeader(v *Header) { + o.header = v +} + +func (o *Object) GetPayload() []byte { + if o != nil { + return o.payload + } + + return nil +} + +func (o *Object) SetPayload(v []byte) { + o.payload = v +} + +func (s *SplitInfo) GetSplitID() []byte { + if s != nil { + return s.splitID + } + + return nil +} + +func (s *SplitInfo) SetSplitID(v []byte) { + s.splitID = v +} + +func (s *SplitInfo) GetLastPart() *refs.ObjectID { + if s != nil { + return s.lastPart + } + + return nil +} + +func (s *SplitInfo) SetLastPart(v *refs.ObjectID) { + s.lastPart = v +} + +func (s *SplitInfo) GetLink() *refs.ObjectID { + if s != nil { + return s.link + } + + return nil +} + +func (s *SplitInfo) SetLink(v *refs.ObjectID) { + s.link = v +} + +func (s *SplitInfo) getObjectPart() {} + +func (s *SplitInfo) getHeaderPart() {} + +func (s *SplitInfo) getRangePart() {} + +func (r *GetRequestBody) GetAddress() *refs.Address { + if r != nil { + return r.addr + } + + return nil +} + +func (r *GetRequestBody) SetAddress(v *refs.Address) { + r.addr = v +} + +func (r *GetRequestBody) GetRaw() bool { + if r != nil { + return r.raw + } + + return false +} + +func (r *GetRequestBody) SetRaw(v bool) { + r.raw = v +} + +func (r *GetRequest) GetBody() *GetRequestBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *GetRequest) SetBody(v *GetRequestBody) { + r.body = v +} + +func (r *GetObjectPartInit) GetObjectID() *refs.ObjectID { + if r != nil { + return r.id + } + + return nil +} + +func (r *GetObjectPartInit) SetObjectID(v *refs.ObjectID) { + r.id = v +} + +func (r *GetObjectPartInit) GetSignature() *refs.Signature { + if r != nil { + return r.sig + } + + return nil +} + +func (r *GetObjectPartInit) SetSignature(v *refs.Signature) { + r.sig = v +} + +func (r *GetObjectPartInit) GetHeader() *Header { + if r != nil { + return r.hdr + } + + return nil +} + +func (r *GetObjectPartInit) SetHeader(v *Header) { + r.hdr = v +} + +func (r *GetObjectPartInit) getObjectPart() {} + +func (r *GetObjectPartChunk) GetChunk() []byte { + if r != nil { + return r.chunk + } + + return nil +} + +func (r *GetObjectPartChunk) SetChunk(v []byte) { + r.chunk = v +} + +func (r *GetObjectPartChunk) getObjectPart() {} + +func (r *GetResponseBody) GetObjectPart() GetObjectPart { + if r != nil { + return r.objPart + } + + return nil +} + +func (r *GetResponseBody) SetObjectPart(v GetObjectPart) { + r.objPart = v +} + +func (r *GetResponse) GetBody() *GetResponseBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *GetResponse) SetBody(v *GetResponseBody) { + r.body = v +} + +func (r *PutObjectPartInit) GetObjectID() *refs.ObjectID { + if r != nil { + return r.id + } + + return nil +} + +func (r *PutObjectPartInit) SetObjectID(v *refs.ObjectID) { + r.id = v +} + +func (r *PutObjectPartInit) GetSignature() *refs.Signature { + if r != nil { + return r.sig + } + + return nil +} + +func (r *PutObjectPartInit) SetSignature(v *refs.Signature) { + r.sig = v +} + +func (r *PutObjectPartInit) GetHeader() *Header { + if r != nil { + return r.hdr + } + + return nil +} + +func (r *PutObjectPartInit) SetHeader(v *Header) { + r.hdr = v +} + +func (r *PutObjectPartInit) GetCopiesNumber() []uint32 { + if r != nil { + return r.copyNum + } + + return nil +} + +func (r *PutObjectPartInit) SetCopiesNumber(v []uint32) { + r.copyNum = v +} + +func (r *PutObjectPartInit) putObjectPart() {} + +func (r *PutObjectPartChunk) GetChunk() []byte { + if r != nil { + return r.chunk + } + + return nil +} + +func (r *PutObjectPartChunk) SetChunk(v []byte) { + r.chunk = v +} + +func (r *PutObjectPartChunk) putObjectPart() {} + +func (r *PutRequestBody) GetObjectPart() PutObjectPart { + if r != nil { + return r.objPart + } + + return nil +} + +func (r *PutRequestBody) SetObjectPart(v PutObjectPart) { + r.objPart = v +} + +func (r *PutRequest) GetBody() *PutRequestBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *PutRequest) SetBody(v *PutRequestBody) { + r.body = v +} + +func (r *PutResponseBody) GetObjectID() *refs.ObjectID { + if r != nil { + return r.id + } + + return nil +} + +func (r *PutResponseBody) SetObjectID(v *refs.ObjectID) { + r.id = v +} + +func (r *PutResponse) GetBody() *PutResponseBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *PutResponse) SetBody(v *PutResponseBody) { + r.body = v +} + +func (r *DeleteRequestBody) GetAddress() *refs.Address { + if r != nil { + return r.addr + } + + return nil +} + +func (r *DeleteRequestBody) SetAddress(v *refs.Address) { + r.addr = v +} + +func (r *DeleteRequest) GetBody() *DeleteRequestBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *DeleteRequest) SetBody(v *DeleteRequestBody) { + r.body = v +} + +// GetTombstone returns tombstone address. +func (r *DeleteResponseBody) GetTombstone() *refs.Address { + if r != nil { + return r.tombstone + } + + return nil +} + +// SetTombstone sets tombstone address. +func (r *DeleteResponseBody) SetTombstone(v *refs.Address) { + r.tombstone = v +} + +func (r *DeleteResponse) GetBody() *DeleteResponseBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *DeleteResponse) SetBody(v *DeleteResponseBody) { + r.body = v +} + +func (r *HeadRequestBody) GetAddress() *refs.Address { + if r != nil { + return r.addr + } + + return nil +} + +func (r *HeadRequestBody) SetAddress(v *refs.Address) { + r.addr = v +} + +func (r *HeadRequestBody) GetMainOnly() bool { + if r != nil { + return r.mainOnly + } + + return false +} + +func (r *HeadRequestBody) SetMainOnly(v bool) { + r.mainOnly = v +} + +func (r *HeadRequestBody) GetRaw() bool { + if r != nil { + return r.raw + } + + return false +} + +func (r *HeadRequestBody) SetRaw(v bool) { + r.raw = v +} + +func (r *HeadRequest) GetBody() *HeadRequestBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *HeadRequest) SetBody(v *HeadRequestBody) { + r.body = v +} + +func (r *HeadResponseBody) GetHeaderPart() GetHeaderPart { + if r != nil { + return r.hdrPart + } + + return nil +} + +func (r *HeadResponseBody) SetHeaderPart(v GetHeaderPart) { + r.hdrPart = v +} + +func (r *HeadResponse) GetBody() *HeadResponseBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *HeadResponse) SetBody(v *HeadResponseBody) { + r.body = v +} + +func (f *SearchFilter) GetMatchType() MatchType { + if f != nil { + return f.matchType + } + + return MatchUnknown +} + +func (f *SearchFilter) SetMatchType(v MatchType) { + f.matchType = v +} + +func (f *SearchFilter) GetKey() string { + if f != nil { + return f.key + } + + return "" +} + +func (f *SearchFilter) SetKey(v string) { + f.key = v +} + +func (f *SearchFilter) GetValue() string { + if f != nil { + return f.val + } + + return "" +} + +func (f *SearchFilter) SetValue(v string) { + f.val = v +} + +func (r *SearchRequestBody) GetContainerID() *refs.ContainerID { + if r != nil { + return r.cid + } + + return nil +} + +func (r *SearchRequestBody) SetContainerID(v *refs.ContainerID) { + r.cid = v +} + +func (r *SearchRequestBody) GetVersion() uint32 { + if r != nil { + return r.version + } + + return 0 +} + +func (r *SearchRequestBody) SetVersion(v uint32) { + r.version = v +} + +func (r *SearchRequestBody) GetFilters() []SearchFilter { + if r != nil { + return r.filters + } + + return nil +} + +func (r *SearchRequestBody) SetFilters(v []SearchFilter) { + r.filters = v +} + +func (r *SearchRequest) GetBody() *SearchRequestBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *SearchRequest) SetBody(v *SearchRequestBody) { + r.body = v +} + +func (r *SearchResponseBody) GetIDList() []refs.ObjectID { + if r != nil { + return r.idList + } + + return nil +} + +func (r *SearchResponseBody) SetIDList(v []refs.ObjectID) { + r.idList = v +} + +func (r *SearchResponse) GetBody() *SearchResponseBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *SearchResponse) SetBody(v *SearchResponseBody) { + r.body = v +} + +func (r *Range) GetOffset() uint64 { + if r != nil { + return r.off + } + + return 0 +} + +func (r *Range) SetOffset(v uint64) { + r.off = v +} + +func (r *Range) GetLength() uint64 { + if r != nil { + return r.len + } + + return 0 +} + +func (r *Range) SetLength(v uint64) { + r.len = v +} + +func (r *GetRangeRequestBody) GetAddress() *refs.Address { + if r != nil { + return r.addr + } + + return nil +} + +func (r *GetRangeRequestBody) SetAddress(v *refs.Address) { + r.addr = v +} + +func (r *GetRangeRequestBody) GetRange() *Range { + if r != nil { + return r.rng + } + + return nil +} + +func (r *GetRangeRequestBody) SetRange(v *Range) { + r.rng = v +} + +func (r *GetRangeRequestBody) GetRaw() bool { + if r != nil { + return r.raw + } + + return false +} + +func (r *GetRangeRequestBody) SetRaw(v bool) { + r.raw = v +} + +func (r *GetRangeRequest) GetBody() *GetRangeRequestBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *GetRangeRequest) SetBody(v *GetRangeRequestBody) { + r.body = v +} + +func (r *GetRangePartChunk) GetChunk() []byte { + if r != nil { + return r.chunk + } + + return nil +} + +func (r *GetRangePartChunk) SetChunk(v []byte) { + r.chunk = v +} + +func (r *GetRangePartChunk) getRangePart() {} + +func (r *GetRangeResponseBody) GetRangePart() GetRangePart { + if r != nil { + return r.rngPart + } + + return nil +} + +func (r *GetRangeResponseBody) SetRangePart(v GetRangePart) { + r.rngPart = v +} + +func (r *GetRangeResponse) GetBody() *GetRangeResponseBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *GetRangeResponse) SetBody(v *GetRangeResponseBody) { + r.body = v +} + +func (r *GetRangeHashRequestBody) GetAddress() *refs.Address { + if r != nil { + return r.addr + } + + return nil +} + +func (r *GetRangeHashRequestBody) SetAddress(v *refs.Address) { + r.addr = v +} + +func (r *GetRangeHashRequestBody) GetRanges() []Range { + if r != nil { + return r.rngs + } + + return nil +} + +func (r *GetRangeHashRequestBody) SetRanges(v []Range) { + r.rngs = v +} + +func (r *GetRangeHashRequestBody) GetSalt() []byte { + if r != nil { + return r.salt + } + + return nil +} + +func (r *GetRangeHashRequestBody) SetSalt(v []byte) { + r.salt = v +} + +func (r *GetRangeHashRequestBody) GetType() refs.ChecksumType { + if r != nil { + return r.typ + } + + return refs.UnknownChecksum +} + +func (r *GetRangeHashRequestBody) SetType(v refs.ChecksumType) { + r.typ = v +} + +func (r *GetRangeHashRequest) GetBody() *GetRangeHashRequestBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *GetRangeHashRequest) SetBody(v *GetRangeHashRequestBody) { + r.body = v +} + +func (r *GetRangeHashResponseBody) GetType() refs.ChecksumType { + if r != nil { + return r.typ + } + + return refs.UnknownChecksum +} + +func (r *GetRangeHashResponseBody) SetType(v refs.ChecksumType) { + r.typ = v +} + +func (r *GetRangeHashResponseBody) GetHashList() [][]byte { + if r != nil { + return r.hashList + } + + return nil +} + +func (r *GetRangeHashResponseBody) SetHashList(v [][]byte) { + r.hashList = v +} + +func (r *GetRangeHashResponse) GetBody() *GetRangeHashResponseBody { + if r != nil { + return r.body + } + + return nil +} + +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 +} + +func (r *PutSingleResponse) GetBody() *PutSingleResponseBody { + if r != nil { + return r.body + } + + return nil +} + +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 (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 + } + + return nil +} + +func (r *PatchRequestBodyPatch) GetRange() *Range { + if r != nil { + return r.Range + } + + return nil +} + +func (s *ECInfo) getObjectPart() {} + +func (s *ECInfo) getHeaderPart() {} + +func (s *ECInfo) getRangePart() {} diff --git a/api/refs/bench_test.go b/api/refs/bench_test.go new file mode 100644 index 0000000..40784c6 --- /dev/null +++ b/api/refs/bench_test.go @@ -0,0 +1,53 @@ +package refs + +import ( + "math/rand" + "strconv" + "testing" +) + +func BenchmarkObjectIDSlice(b *testing.B) { + for _, size := range []int{0, 1, 50} { + b.Run(strconv.Itoa(size)+" elements", func(b *testing.B) { + benchmarkObjectIDSlice(b, size) + }) + } +} + +func benchmarkObjectIDSlice(b *testing.B, size int) { + ids := make([]ObjectID, size) + for i := range ids { + ids[i].val = make([]byte, 32) + rand.Read(ids[i].val) + } + raw := ObjectIDListToGRPCMessage(ids) + + b.Run("to grpc message", func(b *testing.B) { + b.ReportAllocs() + for range b.N { + raw := ObjectIDListToGRPCMessage(ids) + if len(raw) != len(ids) { + b.FailNow() + } + } + }) + b.Run("from grpc message", func(b *testing.B) { + b.ReportAllocs() + for range b.N { + ids, err := ObjectIDListFromGRPCMessage(raw) + if err != nil || len(raw) != len(ids) { + b.FailNow() + } + } + }) + b.Run("marshal", func(b *testing.B) { + b.ReportAllocs() + for range b.N { + buf := make([]byte, ObjectIDNestedListSize(1, ids)) + n := ObjectIDNestedListMarshal(1, buf, ids) + if n != len(buf) { + b.FailNow() + } + } + }) +} diff --git a/api/refs/convert.go b/api/refs/convert.go new file mode 100644 index 0000000..8e72c37 --- /dev/null +++ b/api/refs/convert.go @@ -0,0 +1,264 @@ +package refs + +import ( + refs "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" +) + +func (o *OwnerID) ToGRPCMessage() grpc.Message { + var m *refs.OwnerID + + if o != nil { + m = new(refs.OwnerID) + + m.SetValue(o.val) + } + + return m +} + +func (o *OwnerID) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*refs.OwnerID) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + o.val = v.GetValue() + + return nil +} + +func (c *ContainerID) ToGRPCMessage() grpc.Message { + var m *refs.ContainerID + + if c != nil { + m = new(refs.ContainerID) + + m.SetValue(c.val) + } + + return m +} + +func (c *ContainerID) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*refs.ContainerID) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + c.val = v.GetValue() + + return nil +} + +func ContainerIDsToGRPCMessage(ids []ContainerID) (res []refs.ContainerID) { + if ids != nil { + res = make([]refs.ContainerID, 0, len(ids)) + + for i := range ids { + res = append(res, *ids[i].ToGRPCMessage().(*refs.ContainerID)) + } + } + + return +} + +func ContainerIDsFromGRPCMessage(idsV2 []refs.ContainerID) (res []ContainerID, err error) { + if idsV2 != nil { + res = make([]ContainerID, len(idsV2)) + + for i := range idsV2 { + err = res[i].FromGRPCMessage(&idsV2[i]) + if err != nil { + return + } + } + } + + return +} + +func (o *ObjectID) ToGRPCMessage() grpc.Message { + var m *refs.ObjectID + + if o != nil { + m = new(refs.ObjectID) + + m.SetValue(o.val) + } + + return m +} + +func (o *ObjectID) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*refs.ObjectID) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + o.val = v.GetValue() + + return nil +} + +func ObjectIDListToGRPCMessage(ids []ObjectID) (res []refs.ObjectID) { + if ids != nil { + res = make([]refs.ObjectID, 0, len(ids)) + + for i := range ids { + res = append(res, *ids[i].ToGRPCMessage().(*refs.ObjectID)) + } + } + + return +} + +func ObjectIDListFromGRPCMessage(idsV2 []refs.ObjectID) (res []ObjectID, err error) { + if idsV2 != nil { + res = make([]ObjectID, len(idsV2)) + + for i := range idsV2 { + err = res[i].FromGRPCMessage(&idsV2[i]) + if err != nil { + return + } + } + } + + return +} + +func (a *Address) ToGRPCMessage() grpc.Message { + var m *refs.Address + + if a != nil { + m = new(refs.Address) + + m.SetContainerId(a.cid.ToGRPCMessage().(*refs.ContainerID)) + m.SetObjectId(a.oid.ToGRPCMessage().(*refs.ObjectID)) + } + + return m +} + +func (a *Address) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*refs.Address) + 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(ContainerID) + } + + err = a.cid.FromGRPCMessage(cid) + if err != nil { + return err + } + } + + oid := v.GetObjectId() + if oid == nil { + a.oid = nil + } else { + if a.oid == nil { + a.oid = new(ObjectID) + } + + err = a.oid.FromGRPCMessage(oid) + } + + return err +} + +func ChecksumTypeToGRPC(t ChecksumType) refs.ChecksumType { + return refs.ChecksumType(t) +} + +func ChecksumTypeFromGRPC(t refs.ChecksumType) ChecksumType { + return ChecksumType(t) +} + +func (c *Checksum) ToGRPCMessage() grpc.Message { + var m *refs.Checksum + + if c != nil { + m = new(refs.Checksum) + + m.SetType(ChecksumTypeToGRPC(c.typ)) + m.SetSum(c.sum) + } + + return m +} + +func (c *Checksum) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*refs.Checksum) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + c.typ = ChecksumTypeFromGRPC(v.GetType()) + c.sum = v.GetSum() + + return nil +} + +func (v *Version) ToGRPCMessage() grpc.Message { + var m *refs.Version + + if v != nil { + m = new(refs.Version) + + m.SetMajor(v.major) + m.SetMinor(v.minor) + } + + return m +} + +func (v *Version) FromGRPCMessage(m grpc.Message) error { + ver, ok := m.(*refs.Version) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + v.major = ver.GetMajor() + v.minor = ver.GetMinor() + + return nil +} + +func (s *Signature) ToGRPCMessage() grpc.Message { + var m *refs.Signature + + if s != nil { + m = new(refs.Signature) + + m.SetKey(s.key) + m.SetSign(s.sign) + m.SetScheme(refs.SignatureScheme(s.scheme)) + } + + return m +} + +func (s *Signature) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*refs.Signature) + if !ok { + return message.NewUnexpectedMessageType(m, s) + } + + s.key = v.GetKey() + s.sign = v.GetSign() + s.scheme = SignatureScheme(v.GetScheme()) + + return nil +} diff --git a/api/refs/grpc/types_frostfs.pb.go b/api/refs/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..f0a10f3 --- /dev/null +++ b/api/refs/grpc/types_frostfs.pb.go @@ -0,0 +1,1527 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package refs + +import ( + json "encoding/json" + fmt "fmt" + pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" +) + +type 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.EmitProtobuf(mm.AppendMessage(1)) + } + if x.ObjectId != nil { + 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 + } + first := true + out.RawByte('{') + { + 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 = "\"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 + } + first := true + out.RawByte('{') + { + 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('}') +} + +// 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 + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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 + } + first := true + out.RawByte('{') + { + 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('}') +} + +// 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 + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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 + } + first := true + out.RawByte('{') + { + 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('}') +} + +// 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 + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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 + } + first := true + out.RawByte('{') + { + 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 = "\"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 + 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 + 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 + } + } + 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 + } + first := true + out.RawByte('{') + { + 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 !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 !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('}') +} + +// 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 + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + x.Key = f + } + case "signature": + { + var f []byte + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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 + } + first := true + out.RawByte('{') + { + 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 !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('}') +} + +// 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 + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + x.Key = f + } + case "signature": + { + var f []byte + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"type\":" + out.RawString(prefix) + v := int32(x.Type) + if vv, ok := ChecksumType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } + } + { + 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('}') +} + +// 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 + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + x.Sum = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/api/refs/grpc/types_frostfs_fuzz.go b/api/refs/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..a64a9bf --- /dev/null +++ b/api/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/api/refs/grpc/types_frostfs_test.go b/api/refs/grpc/types_frostfs_test.go new file mode 100644 index 0000000..9b19892 --- /dev/null +++ b/api/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/api/refs/json.go b/api/refs/json.go new file mode 100644 index 0000000..652211f --- /dev/null +++ b/api/refs/json.go @@ -0,0 +1,62 @@ +package refs + +import ( + refs "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" +) + +func (a *Address) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(a) +} + +func (a *Address) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(a, data, new(refs.Address)) +} + +func (o *ObjectID) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(o) +} + +func (o *ObjectID) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(o, data, new(refs.ObjectID)) +} + +func (c *ContainerID) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(c) +} + +func (c *ContainerID) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(c, data, new(refs.ContainerID)) +} + +func (o *OwnerID) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(o) +} + +func (o *OwnerID) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(o, data, new(refs.OwnerID)) +} + +func (v *Version) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(v) +} + +func (v *Version) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(v, data, new(refs.Version)) +} + +func (s *Signature) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(s) +} + +func (s *Signature) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(s, data, new(refs.Signature)) +} + +func (c *Checksum) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(c) +} + +func (c *Checksum) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(c, data, new(refs.Checksum)) +} diff --git a/api/refs/marshal.go b/api/refs/marshal.go new file mode 100644 index 0000000..18f84b9 --- /dev/null +++ b/api/refs/marshal.go @@ -0,0 +1,264 @@ +package refs + +import ( + "encoding/binary" + + refs "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" + "google.golang.org/protobuf/encoding/protowire" +) + +const ( + ownerIDValField = 1 + + containerIDValField = 1 + + objectIDValField = 1 + + addressContainerField = 1 + addressObjectField = 2 + + checksumTypeField = 1 + checksumValueField = 2 + + signatureKeyField = 1 + signatureValueField = 2 + signatureSchemeField = 3 + + versionMajorField = 1 + versionMinorField = 2 +) + +func (o *OwnerID) StableMarshal(buf []byte) []byte { + if o == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, o.StableSize()) + } + + proto.BytesMarshal(ownerIDValField, buf, o.val) + + return buf +} + +func (o *OwnerID) StableSize() int { + if o == nil { + return 0 + } + + return proto.BytesSize(ownerIDValField, o.val) +} + +func (o *OwnerID) Unmarshal(data []byte) error { + return message.Unmarshal(o, data, new(refs.OwnerID)) +} + +func (c *ContainerID) StableMarshal(buf []byte) []byte { + if c == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, c.StableSize()) + } + + proto.BytesMarshal(containerIDValField, buf, c.val) + + return buf +} + +func (c *ContainerID) StableSize() int { + if c == nil { + return 0 + } + + return proto.BytesSize(containerIDValField, c.val) +} + +func (c *ContainerID) Unmarshal(data []byte) error { + return message.Unmarshal(c, data, new(refs.ContainerID)) +} + +func (o *ObjectID) StableMarshal(buf []byte) []byte { + if o == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, o.StableSize()) + } + + proto.BytesMarshal(objectIDValField, buf, o.val) + + return buf +} + +// ObjectIDNestedListSize returns byte length of nested +// repeated ObjectID field with fNum number. +func ObjectIDNestedListSize(fNum int64, ids []ObjectID) (sz int) { + for i := range ids { + sz += proto.NestedStructureSize(fNum, &ids[i]) + } + + return +} + +func (o *ObjectID) StableSize() int { + if o == nil { + return 0 + } + + return proto.BytesSize(objectIDValField, o.val) +} + +// ObjectIDNestedListMarshal writes protobuf repeated ObjectID field +// with fNum number to buf. +func ObjectIDNestedListMarshal(fNum int64, buf []byte, ids []ObjectID) (off int) { + prefix := protowire.EncodeTag(protowire.Number(fNum), protowire.BytesType) + for i := range ids { + off += binary.PutUvarint(buf[off:], prefix) + + n := ids[i].StableSize() + off += binary.PutUvarint(buf[off:], uint64(n)) + off += proto.BytesMarshal(objectIDValField, buf[off:], ids[i].val) + } + + return +} + +func (o *ObjectID) Unmarshal(data []byte) error { + return message.Unmarshal(o, data, new(refs.ObjectID)) +} + +func (a *Address) StableMarshal(buf []byte) []byte { + if a == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, a.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(addressContainerField, buf[offset:], a.cid) + proto.NestedStructureMarshal(addressObjectField, buf[offset:], a.oid) + + return buf +} + +func (a *Address) StableSize() (size int) { + if a == nil { + return 0 + } + + size += proto.NestedStructureSize(addressContainerField, a.cid) + size += proto.NestedStructureSize(addressObjectField, a.oid) + + return size +} + +func (a *Address) Unmarshal(data []byte) error { + return message.Unmarshal(a, data, new(refs.Address)) +} + +func (c *Checksum) StableMarshal(buf []byte) []byte { + if c == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, c.StableSize()) + } + + var offset int + + offset += proto.EnumMarshal(checksumTypeField, buf[offset:], int32(c.typ)) + proto.BytesMarshal(checksumValueField, buf[offset:], c.sum) + + return buf +} + +func (c *Checksum) StableSize() (size int) { + if c == nil { + return 0 + } + + size += proto.EnumSize(checksumTypeField, int32(c.typ)) + size += proto.BytesSize(checksumValueField, c.sum) + + return size +} + +func (c *Checksum) Unmarshal(data []byte) error { + return message.Unmarshal(c, data, new(refs.Checksum)) +} + +func (s *Signature) StableMarshal(buf []byte) []byte { + if s == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, s.StableSize()) + } + + var offset int + + offset += proto.BytesMarshal(signatureKeyField, buf[offset:], s.key) + offset += proto.BytesMarshal(signatureValueField, buf[offset:], s.sign) + proto.EnumMarshal(signatureSchemeField, buf[offset:], int32(s.scheme)) + + return buf +} + +func (s *Signature) StableSize() (size int) { + if s == nil { + return 0 + } + + size += proto.BytesSize(signatureKeyField, s.key) + size += proto.BytesSize(signatureValueField, s.sign) + size += proto.EnumSize(signatureSchemeField, int32(s.scheme)) + + return size +} + +func (s *Signature) Unmarshal(data []byte) error { + return message.Unmarshal(s, data, new(refs.Signature)) +} + +func (v *Version) StableMarshal(buf []byte) []byte { + if v == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, v.StableSize()) + } + + var offset int + + offset += proto.UInt32Marshal(versionMajorField, buf[offset:], v.major) + proto.UInt32Marshal(versionMinorField, buf[offset:], v.minor) + + return buf +} + +func (v *Version) StableSize() (size int) { + if v == nil { + return 0 + } + + size += proto.UInt32Size(versionMajorField, v.major) + size += proto.UInt32Size(versionMinorField, v.minor) + + return size +} + +func (v *Version) Unmarshal(data []byte) error { + return message.Unmarshal(v, data, new(refs.Version)) +} diff --git a/api/refs/message_test.go b/api/refs/message_test.go new file mode 100644 index 0000000..d844f93 --- /dev/null +++ b/api/refs/message_test.go @@ -0,0 +1,21 @@ +package refs_test + +import ( + "testing" + + refstest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/test" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message/test" +) + +func TestMessageConvert(t *testing.T) { + messagetest.TestRPCMessage(t, + func(empty bool) message.Message { return refstest.GenerateOwnerID(empty) }, + func(empty bool) message.Message { return refstest.GenerateObjectID(empty) }, + func(empty bool) message.Message { return refstest.GenerateContainerID(empty) }, + func(empty bool) message.Message { return refstest.GenerateAddress(empty) }, + 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) }, + ) +} diff --git a/api/refs/string.go b/api/refs/string.go new file mode 100644 index 0000000..c33a241 --- /dev/null +++ b/api/refs/string.go @@ -0,0 +1,47 @@ +package refs + +import ( + refs "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" +) + +// String returns string representation of ChecksumType. +func (t ChecksumType) String() string { + return ChecksumTypeToGRPC(t).String() +} + +// FromString parses ChecksumType from a string representation. +// It is a reverse action to String(). +// +// Returns true if s was parsed successfully. +func (t *ChecksumType) FromString(s string) bool { + var g refs.ChecksumType + + ok := g.FromString(s) + + if ok { + *t = ChecksumTypeFromGRPC(g) + } + + return ok +} + +// String returns string representation of SignatureScheme. +func (t SignatureScheme) String() string { + return refs.SignatureScheme(t).String() +} + +// FromString parses SignatureScheme from a string representation. +// It is a reverse action to String(). +// +// Returns true if s was parsed successfully. +func (t *SignatureScheme) FromString(s string) bool { + var g refs.SignatureScheme + + ok := g.FromString(s) + + if ok { + *t = SignatureScheme(g) + } + + return ok +} diff --git a/api/refs/test/generate.go b/api/refs/test/generate.go new file mode 100644 index 0000000..ec9151a --- /dev/null +++ b/api/refs/test/generate.go @@ -0,0 +1,127 @@ +package refstest + +import ( + crand "crypto/rand" + "crypto/sha256" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" +) + +func GenerateVersion(empty bool) *refs.Version { + m := new(refs.Version) + + if !empty { + m.SetMajor(2) + m.SetMinor(1) + } + + return m +} + +func GenerateOwnerID(empty bool) *refs.OwnerID { + m := new(refs.OwnerID) + + if !empty { + id := make([]byte, 25) + _, _ = crand.Read(id) + + m.SetValue(id) + } + + return m +} + +func GenerateAddress(empty bool) *refs.Address { + m := new(refs.Address) + + if !empty { + m.SetObjectID(GenerateObjectID(false)) + m.SetContainerID(GenerateContainerID(false)) + } + + return m +} + +func GenerateObjectID(empty bool) *refs.ObjectID { + m := new(refs.ObjectID) + + if !empty { + id := make([]byte, sha256.Size) + _, _ = crand.Read(id) + + m.SetValue(id) + } + + return m +} + +func GenerateObjectIDs(empty bool) []refs.ObjectID { + var ids []refs.ObjectID + + if !empty { + ids = append(ids, + *GenerateObjectID(false), + *GenerateObjectID(false), + ) + } + + return ids +} + +func GenerateContainerID(empty bool) *refs.ContainerID { + m := new(refs.ContainerID) + + if !empty { + id := make([]byte, sha256.Size) + _, _ = crand.Read(id) + + m.SetValue(id) + } + + return m +} + +func GenerateContainerIDs(empty bool) []refs.ContainerID { + var res []refs.ContainerID + + if !empty { + res = append(res, + *GenerateContainerID(false), + *GenerateContainerID(false), + ) + } + + return res +} + +func GenerateSignature(empty bool) *refs.Signature { + m := new(refs.Signature) + + if !empty { + 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 +} + +func GenerateChecksum(empty bool) *refs.Checksum { + m := new(refs.Checksum) + + if !empty { + cs := make([]byte, sha256.Size) + _, _ = crand.Read(cs) + + m.SetType(refs.SHA256) + m.SetSum(cs) + } + + return m +} diff --git a/api/refs/types.go b/api/refs/types.go new file mode 100644 index 0000000..d8f0d9b --- /dev/null +++ b/api/refs/types.go @@ -0,0 +1,194 @@ +package refs + +type OwnerID struct { + val []byte +} + +type ContainerID struct { + val []byte +} + +type ObjectID struct { + val []byte +} + +type Address struct { + cid *ContainerID + + oid *ObjectID +} + +type Checksum struct { + typ ChecksumType + + sum []byte +} + +type ChecksumType uint32 + +type SignatureScheme uint32 + +//nolint:revive +const ( + ECDSA_SHA512 SignatureScheme = iota + ECDSA_RFC6979_SHA256 + ECDSA_RFC6979_SHA256_WALLET_CONNECT +) + +type Signature struct { + key, sign []byte + scheme SignatureScheme +} + +type Version struct { + major, minor uint32 +} + +const ( + UnknownChecksum ChecksumType = iota + TillichZemor + SHA256 +) + +func (o *OwnerID) GetValue() []byte { + if o != nil { + return o.val + } + + return nil +} + +func (o *OwnerID) SetValue(v []byte) { + o.val = v +} + +func (c *ContainerID) GetValue() []byte { + if c != nil { + return c.val + } + + return nil +} + +func (c *ContainerID) SetValue(v []byte) { + c.val = v +} + +func (o *ObjectID) GetValue() []byte { + if o != nil { + return o.val + } + + return nil +} + +func (o *ObjectID) SetValue(v []byte) { + o.val = v +} + +func (a *Address) GetContainerID() *ContainerID { + if a != nil { + return a.cid + } + + return nil +} + +func (a *Address) SetContainerID(v *ContainerID) { + a.cid = v +} + +func (a *Address) GetObjectID() *ObjectID { + if a != nil { + return a.oid + } + + return nil +} + +func (a *Address) SetObjectID(v *ObjectID) { + a.oid = v +} + +func (c *Checksum) GetType() ChecksumType { + if c != nil { + return c.typ + } + + return UnknownChecksum +} + +func (c *Checksum) SetType(v ChecksumType) { + c.typ = v +} + +func (c *Checksum) GetSum() []byte { + if c != nil { + return c.sum + } + + return nil +} + +func (c *Checksum) SetSum(v []byte) { + c.sum = v +} + +func (s *Signature) GetKey() []byte { + if s != nil { + return s.key + } + + return nil +} + +func (s *Signature) SetKey(v []byte) { + s.key = v +} + +func (s *Signature) GetSign() []byte { + if s != nil { + return s.sign + } + + return nil +} + +func (s *Signature) SetSign(v []byte) { + s.sign = v +} + +func (s *Signature) GetScheme() SignatureScheme { + if s != nil { + return s.scheme + } + return 0 +} + +func (s *Signature) SetScheme(scheme SignatureScheme) { + s.scheme = scheme +} + +func (v *Version) GetMajor() uint32 { + if v != nil { + return v.major + } + + return 0 +} + +func (v *Version) SetMajor(val uint32) { + v.major = val +} + +func (v *Version) GetMinor() uint32 { + if v != nil { + return v.minor + } + + return 0 +} + +func (v *Version) SetMinor(val uint32) { + v.minor = val +} diff --git a/api/rpc/accounting.go b/api/rpc/accounting.go new file mode 100644 index 0000000..31259bd --- /dev/null +++ b/api/rpc/accounting.go @@ -0,0 +1,29 @@ +package rpc + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/accounting" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/common" +) + +const serviceAccounting = serviceNamePrefix + "accounting.AccountingService" + +const ( + rpcAccountingBalance = "Balance" +) + +// Balance executes AccountingService.Balance RPC. +func Balance( + cli *client.Client, + req *accounting.BalanceRequest, + opts ...client.CallOption, +) (*accounting.BalanceResponse, error) { + resp := new(accounting.BalanceResponse) + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceAccounting, rpcAccountingBalance), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} diff --git a/api/rpc/apemanager.go b/api/rpc/apemanager.go new file mode 100644 index 0000000..6494d16 --- /dev/null +++ b/api/rpc/apemanager.go @@ -0,0 +1,60 @@ +package rpc + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/apemanager" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/common" +) + +const serviceAPEManager = frostfsServiceNamePrefix + "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/api/rpc/client/call_options.go b/api/rpc/client/call_options.go new file mode 100644 index 0000000..4fe8791 --- /dev/null +++ b/api/rpc/client/call_options.go @@ -0,0 +1,40 @@ +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 + dialer func(context.Context, grpc.ClientConnInterface) error +} + +func defaultCallParameters() *callParameters { + return &callParameters{ + ctx: context.Background(), + } +} + +// WithContext returns option to specify call context. If provided, all network +// communications will be based on this context. Otherwise, context.Background() +// is used. +// +// Context SHOULD NOT be nil. +func WithContext(ctx context.Context) CallOption { + return func(prm *callParameters) { + 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/api/rpc/client/client.go b/api/rpc/client/client.go new file mode 100644 index 0000000..eeac896 --- /dev/null +++ b/api/rpc/client/client.go @@ -0,0 +1,30 @@ +package client + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" +) + +// Client represents client for exchanging messages +// with a remote server using Protobuf RPC. +type Client struct { + cfg +} + +// New creates, configures via options and returns new Client instance. +func New(opts ...Option) *Client { + var c Client + c.initDefault() + + for _, opt := range opts { + 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))) + } + + return &c +} diff --git a/api/rpc/client/conn.go b/api/rpc/client/conn.go new file mode 100644 index 0000000..f208413 --- /dev/null +++ b/api/rpc/client/conn.go @@ -0,0 +1,24 @@ +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 +// completed without a connection error. +// +// Client should not be used after Close() call +// on the connection: behavior is undefined. +func (c *Client) Conn() io.Closer { + return c.conn +} diff --git a/api/rpc/client/connect.go b/api/rpc/client/connect.go new file mode 100644 index 0000000..e22e0a6 --- /dev/null +++ b/api/rpc/client/connect.go @@ -0,0 +1,72 @@ +package client + +import ( + "context" + "errors" + "fmt" + "net" + "net/url" + + grpcstd "google.golang.org/grpc" +) + +var errInvalidEndpoint = errors.New("invalid endpoint options") + +func (c *Client) openGRPCConn(ctx context.Context, dialer func(ctx context.Context, cc grpcstd.ClientConnInterface) error) error { + if c.conn != nil { + return nil + } + + if c.addr == "" { + return errInvalidEndpoint + } + + var err error + + c.conn, err = grpcstd.NewClient(c.addr, c.grpcDialOpts...) + if err != nil { + 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 +} + +// ParseURI parses s as address and returns a host and a flag +// indicating that TLS is enabled. If multi-address is provided +// the argument is returned unchanged. +func ParseURI(s string) (string, bool, error) { + uri, err := url.ParseRequestURI(s) + if err != nil { + return s, false, nil + } + + // check if passed string was parsed correctly + // URIs that do not start with a slash after the scheme are interpreted as: + // `scheme:opaque` => if `opaque` is not empty, then it is supposed that URI + // is in `host:port` format + if uri.Host == "" { + uri.Host = uri.Scheme + uri.Scheme = grpcScheme // assume GRPC by default + if uri.Opaque != "" { + uri.Host = net.JoinHostPort(uri.Host, uri.Opaque) + } + } + + switch uri.Scheme { + case grpcTLSScheme, grpcScheme: + default: + return "", false, fmt.Errorf("unsupported scheme: %s", uri.Scheme) + } + + return uri.Host, uri.Scheme == grpcTLSScheme, nil +} diff --git a/api/rpc/client/flows.go b/api/rpc/client/flows.go new file mode 100644 index 0000000..671c679 --- /dev/null +++ b/api/rpc/client/flows.go @@ -0,0 +1,124 @@ +package client + +import ( + "errors" + "io" + "sync" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/common" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" +) + +// SendUnary initializes communication session by RPC info, performs unary RPC +// and closes the session. +func SendUnary(cli *Client, info common.CallMethodInfo, req, resp message.Message, opts ...CallOption) error { + rw, err := cli.Init(info, opts...) + if err != nil { + return err + } + + err = rw.WriteMessage(req) + if err != nil { + return err + } + + err = rw.ReadMessage(resp) + if err != nil { + return err + } + + return rw.Close() +} + +// MessageWriterCloser wraps MessageWriter +// and io.Closer interfaces. +type MessageWriterCloser interface { + MessageWriter + io.Closer +} + +type clientStreamWriterCloser struct { + MessageReadWriter + + resp message.Message +} + +func (c *clientStreamWriterCloser) Close() error { + err := c.MessageReadWriter.Close() + if err != nil { + return err + } + + return c.ReadMessage(c.resp) +} + +// OpenClientStream initializes communication session by RPC info, opens client-side stream +// and returns its interface. +// +// All stream writes must be performed before the closing. Close must be called once. +func OpenClientStream(cli *Client, info common.CallMethodInfo, resp message.Message, opts ...CallOption) (MessageWriterCloser, error) { + rw, err := cli.Init(info, opts...) + if err != nil { + return nil, err + } + + return &clientStreamWriterCloser{ + MessageReadWriter: rw, + resp: resp, + }, nil +} + +// MessageReaderCloser wraps MessageReader +// and io.Closer interface. +type MessageReaderCloser interface { + MessageReader + io.Closer +} + +type serverStreamReaderCloser struct { + rw MessageReadWriter + + once sync.Once + + req message.Message +} + +func (s *serverStreamReaderCloser) ReadMessage(msg message.Message) error { + var err error + + s.once.Do(func() { + err = s.rw.WriteMessage(s.req) + }) + + if err != nil { + return err + } + + err = s.rw.ReadMessage(msg) + if !errors.Is(err, io.EOF) { + return err + } + + err = s.rw.Close() + if err != nil { + return err + } + + return io.EOF +} + +// OpenServerStream initializes communication session by RPC info, opens server-side stream +// and returns its interface. +// +// All stream reads must be performed before the closing. Close must be called once. +func OpenServerStream(cli *Client, info common.CallMethodInfo, req message.Message, opts ...CallOption) (MessageReader, error) { + rw, err := cli.Init(info, opts...) + if err != nil { + return nil, err + } + + return &serverStreamReaderCloser{ + rw: rw, + req: req, + }, nil +} diff --git a/api/rpc/client/init.go b/api/rpc/client/init.go new file mode 100644 index 0000000..706e6a9 --- /dev/null +++ b/api/rpc/client/init.go @@ -0,0 +1,69 @@ +package client + +import ( + "context" + "io" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/common" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + "google.golang.org/grpc" +) + +// MessageReader is an interface of the Message reader. +type MessageReader interface { + // ReadMessage reads the next Message. + // + // Returns io.EOF if there are no more messages to read. + // ReadMessage should not be called after io.EOF occasion. + ReadMessage(message.Message) error +} + +// MessageWriter is an interface of the Message writer. +type MessageWriter interface { + // WriteMessage writers the next Message. + // + // WriteMessage should not be called after any error. + WriteMessage(message.Message) error +} + +// MessageReadWriter is a component interface +// for transmitting raw Protobuf messages. +type MessageReadWriter interface { + MessageReader + MessageWriter + + // Closes the communication session. + // + // All calls to send/receive messages must be done before closing. + io.Closer +} + +// Init initiates a messaging session and returns the interface for message transmitting. +func (c *Client) Init(info common.CallMethodInfo, opts ...CallOption) (MessageReadWriter, error) { + prm := defaultCallParameters() + + for _, opt := range opts { + opt(prm) + } + + if err := c.openGRPCConn(prm.ctx, prm.dialer); err != nil { + return nil, err + } + + ctx, cancel := context.WithCancel(prm.ctx) + stream, err := c.conn.NewStream(ctx, &grpc.StreamDesc{ + StreamName: info.Name, + ServerStreams: info.ServerStream(), + ClientStreams: info.ClientStream(), + }, toMethodName(info)) + if err != nil { + cancel() + return nil, err + } + + return &streamWrapper{ + ClientStream: stream, + cancel: cancel, + timeout: c.rwTimeout, + }, nil +} diff --git a/api/rpc/client/options.go b/api/rpc/client/options.go new file mode 100644 index 0000000..5711cd4 --- /dev/null +++ b/api/rpc/client/options.go @@ -0,0 +1,129 @@ +package client + +import ( + "crypto/tls" + "time" + + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" +) + +const ( + grpcScheme = "grpc" + grpcTLSScheme = "grpcs" +) + +// Option is a Client's option. +type Option func(*cfg) + +type cfg struct { + addr string + + dialTimeout time.Duration + rwTimeout time.Duration + + tlsCfg *tls.Config + grpcDialOpts []grpc.DialOption + + conn Conn +} + +const ( + defaultDialTimeout = 5 * time.Second + defaultRWTimeout = 1 * time.Minute +) + +func (c *cfg) initDefault() { + c.dialTimeout = defaultDialTimeout + c.rwTimeout = defaultRWTimeout + c.grpcDialOpts = []grpc.DialOption{ + grpc.WithTransportCredentials(insecure.NewCredentials()), + } +} + +// WithNetworkAddress returns option to specify +// network address of the remote server. +// +// Ignored if WithGRPCConn is provided. +func WithNetworkAddress(v string) Option { + return func(c *cfg) { + if v != "" { + c.addr = v + } + } +} + +// WithNetworkURIAddress combines WithNetworkAddress and WithTLSCfg options +// based on arguments. +// +// Do not use along with WithNetworkAddress and WithTLSCfg. +// +// Ignored if WithGRPCConn is provided. +func WithNetworkURIAddress(addr string, tlsCfg *tls.Config) []Option { + host, isTLS, err := ParseURI(addr) + if err != nil { + return nil + } + + opts := make([]Option, 2) + opts[0] = WithNetworkAddress(host) + if isTLS { + if tlsCfg == nil { + tlsCfg = &tls.Config{} + } + opts[1] = WithTLSCfg(tlsCfg) + } else { + opts[1] = WithTLSCfg(nil) + } + + return opts +} + +// WithDialTimeout returns option to specify +// dial timeout of the remote server connection. +// +// Ignored if WithGRPCConn is provided. +func WithDialTimeout(v time.Duration) Option { + return func(c *cfg) { + if v > 0 { + c.dialTimeout = v + } + } +} + +// WithRWTimeout returns option to specify timeout +// for reading and writing single gRPC message. +func WithRWTimeout(v time.Duration) Option { + return func(c *cfg) { + if v > 0 { + c.rwTimeout = v + } + } +} + +// WithTLSCfg returns option to specify +// TLS configuration. +// +// Ignored if WithGRPCConn is provided. +func WithTLSCfg(v *tls.Config) Option { + return func(c *cfg) { + c.tlsCfg = v + } +} + +// WithGRPCConn returns option to specify +// gRPC virtual connection. +func WithGRPCConn(v Conn) Option { + return func(c *cfg) { + if v != nil { + c.conn = v + } + } +} + +// WithGRPCDialOptions returns an option to specify grpc.DialOption. +func WithGRPCDialOptions(opts []grpc.DialOption) Option { + return func(c *cfg) { + c.grpcDialOpts = append(c.grpcDialOpts, opts...) + } +} diff --git a/api/rpc/client/options_test.go b/api/rpc/client/options_test.go new file mode 100644 index 0000000..56704b6 --- /dev/null +++ b/api/rpc/client/options_test.go @@ -0,0 +1,197 @@ +package client + +import ( + "crypto/tls" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestWithNetworkURIAddress(t *testing.T) { + hostPort := "frostfs.example.com:8080" + apiPort := "127.0.0.1:8080" + serverName := "testServer" + + testCases := []struct { + uri string + tlsConfig *tls.Config + + wantHost string + wantTLS bool + }{ + { + uri: grpcScheme + "://" + hostPort, + tlsConfig: nil, + wantHost: "frostfs.example.com:8080", + wantTLS: false, + }, + { + uri: grpcScheme + "://" + hostPort, + tlsConfig: &tls.Config{}, + wantHost: "frostfs.example.com:8080", + wantTLS: false, + }, + { + uri: grpcTLSScheme + "://" + hostPort, + tlsConfig: nil, + wantHost: "frostfs.example.com:8080", + wantTLS: true, + }, + { + uri: grpcTLSScheme + "://" + hostPort, + tlsConfig: &tls.Config{ServerName: serverName}, + wantHost: "frostfs.example.com:8080", + wantTLS: true, + }, + { + uri: "wrongScheme://" + hostPort, + tlsConfig: nil, + wantHost: "", + wantTLS: false, + }, + { + uri: "impossibleToParseIt", + tlsConfig: nil, + wantHost: "impossibleToParseIt", + wantTLS: false, + }, + { + uri: hostPort, + tlsConfig: nil, + wantHost: hostPort, + wantTLS: false, + }, + { + uri: apiPort, + tlsConfig: nil, + wantHost: apiPort, + wantTLS: false, + }, + } + + for _, test := range testCases { + cfg := &cfg{} + opts := WithNetworkURIAddress(test.uri, test.tlsConfig) + + for _, opt := range opts { + opt(cfg) + } + + require.Equal(t, test.wantHost, cfg.addr, test.uri) + require.Equal(t, test.wantTLS, cfg.tlsCfg != nil, test.uri) + // check if custom tlsConfig was applied + if test.tlsConfig != nil && test.wantTLS { + require.Equal(t, test.tlsConfig.ServerName, cfg.tlsCfg.ServerName, test.uri) + } + } +} + +func Test_WithNetworkAddress_WithTLS_WithNetworkURIAddress(t *testing.T) { + addr1, addr2 := "example1.com:8080", "example2.com:8080" + + testCases := []struct { + addr string + withTLS bool + + uri string + + wantHost string + wantTLS bool + }{ + { + addr: addr1, + withTLS: true, + + uri: grpcScheme + "://" + addr2, + + wantHost: addr2, + wantTLS: false, + }, + { + addr: addr1, + withTLS: false, + + uri: grpcTLSScheme + "://" + addr2, + + wantHost: addr2, + wantTLS: true, + }, + } + + for _, test := range testCases { + // order: + // 1. WithNetworkAddress + // 2. WithTLSCfg(if test.withTLS == true) + // 3. WithNetworkURIAddress + config := &cfg{} + opts := []Option{WithNetworkAddress(test.addr)} + + if test.withTLS { + opts = append(opts, WithTLSCfg(&tls.Config{})) + } + + opts = append(opts, WithNetworkURIAddress(test.uri, nil)...) + + for _, opt := range opts { + opt(config) + } + + require.Equal(t, test.wantHost, config.addr, test.addr) + require.Equal(t, test.wantTLS, config.tlsCfg != nil, test.addr) + } +} + +func Test_WithNetworkURIAddress_WithTLS_WithNetworkAddress(t *testing.T) { + addr1, addr2 := "example1.com:8080", "example2.com:8080" + + testCases := []struct { + addr string + withTLS bool + + uri string + + wantHost string + wantTLS bool + }{ + { + uri: grpcScheme + "://" + addr1, + + addr: addr2, + withTLS: true, + + wantHost: addr2, + wantTLS: true, + }, + { + uri: grpcTLSScheme + "://" + addr1, + + addr: addr2, + withTLS: false, + + wantHost: addr2, + wantTLS: true, + }, + } + + for _, test := range testCases { + // order: + // 1. WithNetworkURIAddress + // 2. WithNetworkAddress + // 3. WithTLSCfg(if test.withTLS == true) + config := &cfg{} + opts := WithNetworkURIAddress(test.uri, nil) + + opts = append(opts, WithNetworkAddress(test.addr)) + + if test.withTLS { + opts = append(opts, WithTLSCfg(&tls.Config{})) + } + + for _, opt := range opts { + opt(config) + } + + require.Equal(t, test.wantHost, config.addr, test.uri) + require.Equal(t, test.wantTLS, config.tlsCfg != nil, test.uri) + } +} diff --git a/api/rpc/client/stream_wrapper.go b/api/rpc/client/stream_wrapper.go new file mode 100644 index 0000000..4c7bb1f --- /dev/null +++ b/api/rpc/client/stream_wrapper.go @@ -0,0 +1,58 @@ +package client + +import ( + "context" + "time" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + "google.golang.org/grpc" +) + +type streamWrapper struct { + grpc.ClientStream + timeout time.Duration + cancel context.CancelFunc +} + +func (w streamWrapper) ReadMessage(m message.Message) error { + // Can be optimized: we can create blank message here. + gm := m.ToGRPCMessage() + + err := w.withTimeout(func() error { + return w.ClientStream.RecvMsg(gm) + }) + if err != nil { + return err + } + + return m.FromGRPCMessage(gm) +} + +func (w streamWrapper) WriteMessage(m message.Message) error { + return w.withTimeout(func() error { + return w.ClientStream.SendMsg(m.ToGRPCMessage()) + }) +} + +func (w *streamWrapper) Close() error { + return w.withTimeout(w.ClientStream.CloseSend) +} + +func (w *streamWrapper) withTimeout(closure func() error) error { + ch := make(chan error, 1) + go func() { + ch <- closure() + close(ch) + }() + + tt := time.NewTimer(w.timeout) + + select { + case err := <-ch: + tt.Stop() + return err + case <-tt.C: + w.cancel() + return context.DeadlineExceeded + } +} diff --git a/api/rpc/client/util.go b/api/rpc/client/util.go new file mode 100644 index 0000000..3d68b95 --- /dev/null +++ b/api/rpc/client/util.go @@ -0,0 +1,13 @@ +package client + +import ( + "fmt" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/common" +) + +const methodNameFmt = "/%s/%s" + +func toMethodName(p common.CallMethodInfo) string { + return fmt.Sprintf(methodNameFmt, p.Service, p.Name) +} diff --git a/api/rpc/common.go b/api/rpc/common.go new file mode 100644 index 0000000..8177694 --- /dev/null +++ b/api/rpc/common.go @@ -0,0 +1,10 @@ +package rpc + +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." +) diff --git a/api/rpc/common/call.go b/api/rpc/common/call.go new file mode 100644 index 0000000..bc3410a --- /dev/null +++ b/api/rpc/common/call.go @@ -0,0 +1,75 @@ +package common + +type callType uint8 + +const ( + _ callType = iota + callUnary + callClientStream + callServerStream + callBidirStream +) + +// CallMethodInfo is an information about the RPC. +type CallMethodInfo struct { + // Name of the service. + Service string + + // Name of the RPC. + Name string + + t callType +} + +// ServerStream checks if CallMethodInfo contains +// information about the server-side streaming RPC. +func (c CallMethodInfo) ServerStream() bool { + return c.t == callServerStream || c.t == callBidirStream +} + +// ClientStream checks if CallMethodInfo contains +// information about the client-side streaming RPC. +func (c CallMethodInfo) ClientStream() bool { + return c.t == callClientStream || c.t == callBidirStream +} + +func (c *CallMethodInfo) setCommon(service, name string) { + c.Service = service + c.Name = name +} + +// CallMethodInfoUnary returns CallMethodInfo structure +// initialized for the unary RPC. +func CallMethodInfoUnary(service, name string) (info CallMethodInfo) { + info.setCommon(service, name) + info.t = callUnary + + return +} + +// CallMethodInfoClientStream returns CallMethodInfo structure +// initialized for the client-side streaming RPC. +func CallMethodInfoClientStream(service, name string) (info CallMethodInfo) { + info.setCommon(service, name) + info.t = callClientStream + + return +} + +// CallMethodInfoServerStream returns CallMethodInfo structure +// initialized for the server-side streaming RPC. +func CallMethodInfoServerStream(service, name string) (info CallMethodInfo) { + info.setCommon(service, name) + info.t = callServerStream + + return +} + +// CallMethodInfoBidirectionalStream returns CallMethodInfo structure +// initialized for the bidirectional streaming RPC. +func CallMethodInfoBidirectionalStream(service, name string) (info CallMethodInfo) { + info.setCommon(service, name) + info.t = callBidirStream + + return +} diff --git a/api/rpc/common/call_test.go b/api/rpc/common/call_test.go new file mode 100644 index 0000000..eb88b69 --- /dev/null +++ b/api/rpc/common/call_test.go @@ -0,0 +1,49 @@ +package common_test + +import ( + "testing" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/common" + "github.com/stretchr/testify/require" +) + +const ( + testServiceName = "test service" + testRPCName = "test RPC" +) + +func TestCallMethodInfoUnary(t *testing.T) { + i := common.CallMethodInfoUnary(testServiceName, testRPCName) + + require.Equal(t, testServiceName, i.Service) + require.Equal(t, testRPCName, i.Name) + require.False(t, i.ClientStream()) + require.False(t, i.ServerStream()) +} + +func TestCallMethodInfoServerStream(t *testing.T) { + i := common.CallMethodInfoServerStream(testServiceName, testRPCName) + + require.Equal(t, testServiceName, i.Service) + require.Equal(t, testRPCName, i.Name) + require.False(t, i.ClientStream()) + require.True(t, i.ServerStream()) +} + +func TestCallMethodInfoClientStream(t *testing.T) { + i := common.CallMethodInfoClientStream(testServiceName, testRPCName) + + require.Equal(t, testServiceName, i.Service) + require.Equal(t, testRPCName, i.Name) + require.True(t, i.ClientStream()) + require.False(t, i.ServerStream()) +} + +func TestCallMethodInfoBidirectionalStream(t *testing.T) { + i := common.CallMethodInfoBidirectionalStream(testServiceName, testRPCName) + + require.Equal(t, testServiceName, i.Service) + require.Equal(t, testRPCName, i.Name) + require.True(t, i.ClientStream()) + require.True(t, i.ServerStream()) +} diff --git a/api/rpc/container.go b/api/rpc/container.go new file mode 100644 index 0000000..9ba5c99 --- /dev/null +++ b/api/rpc/container.go @@ -0,0 +1,82 @@ +package rpc + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/common" +) + +const serviceContainer = serviceNamePrefix + "container.ContainerService" + +const ( + rpcContainerPut = "Put" + rpcContainerGet = "Get" + rpcContainerDel = "Delete" + rpcContainerList = "List" + rpcContainerGetEACL = "GetExtendedACL" + rpcContainerUsedSpace = "AnnounceUsedSpace" +) + +// PutContainer executes ContainerService.Put RPC. +func PutContainer( + cli *client.Client, + req *container.PutRequest, + opts ...client.CallOption, +) (*container.PutResponse, error) { + resp := new(container.PutResponse) + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceContainer, rpcContainerPut), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} + +// GetContainer executes ContainerService.Get RPC. +func GetContainer( + cli *client.Client, + req *container.GetRequest, + opts ...client.CallOption, +) (*container.GetResponse, error) { + resp := new(container.GetResponse) + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceContainer, rpcContainerGet), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} + +// DeleteContainer executes ContainerService.Delete RPC. +func DeleteContainer( + cli *client.Client, + req *container.DeleteRequest, + opts ...client.CallOption, +) (*container.PutResponse, error) { + resp := new(container.PutResponse) + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceContainer, rpcContainerDel), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} + +// ListContainers executes ContainerService.List RPC. +func ListContainers( + cli *client.Client, + req *container.ListRequest, + opts ...client.CallOption, +) (*container.ListResponse, error) { + resp := new(container.ListResponse) + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceContainer, rpcContainerList), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} diff --git a/api/rpc/grpc/init.go b/api/rpc/grpc/init.go new file mode 100644 index 0000000..0092d39 --- /dev/null +++ b/api/rpc/grpc/init.go @@ -0,0 +1,4 @@ +package grpc + +// Message represents raw gRPC message. +type Message any diff --git a/api/rpc/message/encoding.go b/api/rpc/message/encoding.go new file mode 100644 index 0000000..d656acd --- /dev/null +++ b/api/rpc/message/encoding.go @@ -0,0 +1,40 @@ +package message + +import ( + "encoding/json" +) + +// GRPCConvertedMessage is an interface +// of the gRPC message that is used +// for Message encoding/decoding. +type GRPCConvertedMessage interface { + UnmarshalProtobuf([]byte) error +} + +// Unmarshal decodes m from its Protobuf binary representation +// via related gRPC message. +// +// gm should be tof the same type as the m.ToGRPCMessage() return. +func Unmarshal(m Message, data []byte, gm GRPCConvertedMessage) error { + if err := gm.UnmarshalProtobuf(data); err != nil { + return err + } + + return m.FromGRPCMessage(gm) +} + +// MarshalJSON encodes m to Protobuf JSON representation. +func MarshalJSON(m Message) ([]byte, error) { + 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 any) error { + if err := json.Unmarshal(data, gm); err != nil { + return err + } + return m.FromGRPCMessage(gm) +} diff --git a/api/rpc/message/message.go b/api/rpc/message/message.go new file mode 100644 index 0000000..793351f --- /dev/null +++ b/api/rpc/message/message.go @@ -0,0 +1,43 @@ +package message + +import ( + "fmt" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/grpc" +) + +// Message represents raw Protobuf message +// that can be transmitted via several +// transport protocols. +type Message interface { + // Must return gRPC message that can + // be used for gRPC protocol transmission. + ToGRPCMessage() grpc.Message + + // Must restore the message from related + // gRPC message. + // + // If gRPC message is not a related one, + // ErrUnexpectedMessageType can be returned + // to indicate this. + FromGRPCMessage(grpc.Message) error +} + +// ErrUnexpectedMessageType is an error that +// is used to indicate message mismatch. +type ErrUnexpectedMessageType struct { + exp, act any +} + +// NewUnexpectedMessageType initializes an error about message mismatch +// between act and exp. +func NewUnexpectedMessageType(act, exp any) ErrUnexpectedMessageType { + return ErrUnexpectedMessageType{ + exp: exp, + act: act, + } +} + +func (e ErrUnexpectedMessageType) Error() string { + return fmt.Sprintf("unexpected message type %T: expected %T", e.act, e.exp) +} diff --git a/api/rpc/message/test/message.go b/api/rpc/message/test/message.go new file mode 100644 index 0000000..a402756 --- /dev/null +++ b/api/rpc/message/test/message.go @@ -0,0 +1,126 @@ +package messagetest + +import ( + "encoding/json" + "errors" + "fmt" + "testing" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" + "github.com/stretchr/testify/require" +) + +type jsonMessage interface { + json.Marshaler + json.Unmarshaler +} + +type binaryMessage interface { + StableMarshal([]byte) []byte + StableSize() int + Unmarshal([]byte) error +} + +func TestRPCMessage(t *testing.T, msgGens ...func(empty bool) message.Message) { + for _, msgGen := range msgGens { + msg := msgGen(false) + + t.Run(fmt.Sprintf("convert_%T", msg), func(t *testing.T) { + msg := msgGen(false) + + err := msg.FromGRPCMessage(100) + + require.True(t, errors.As(err, new(message.ErrUnexpectedMessageType))) + + msg2 := msgGen(true) + + err = msg2.FromGRPCMessage(msg.ToGRPCMessage()) + require.NoError(t, err) + + require.Equal(t, msg, msg2) + }) + + t.Run("encoding", func(t *testing.T) { + if jm, ok := msg.(jsonMessage); ok { + t.Run(fmt.Sprintf("JSON_%T", msg), func(t *testing.T) { + data, err := jm.MarshalJSON() + require.NoError(t, err) + + jm2 := msgGen(true).(jsonMessage) + require.NoError(t, jm2.UnmarshalJSON(data)) + + require.Equal(t, jm, jm2) + }) + } + + 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) + + bm2 := msgGen(true).(binaryMessage) + require.NoError(t, bm2.Unmarshal(data)) + + 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)) + } + t.Run("empty", func(t *testing.T) { + 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) + }) + }) +} diff --git a/api/rpc/netmap.go b/api/rpc/netmap.go new file mode 100644 index 0000000..fe52b2e --- /dev/null +++ b/api/rpc/netmap.go @@ -0,0 +1,62 @@ +package rpc + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/common" +) + +const serviceNetmap = serviceNamePrefix + "netmap.NetmapService" + +const ( + rpcNetmapNodeInfo = "LocalNodeInfo" + rpcNetmapNetInfo = "NetworkInfo" + rpcNetmapSnapshot = "NetmapSnapshot" +) + +// LocalNodeInfo executes NetmapService.LocalNodeInfo RPC. +func LocalNodeInfo( + cli *client.Client, + req *netmap.LocalNodeInfoRequest, + opts ...client.CallOption, +) (*netmap.LocalNodeInfoResponse, error) { + resp := new(netmap.LocalNodeInfoResponse) + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceNetmap, rpcNetmapNodeInfo), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} + +// NetworkInfo executes NetmapService.NetworkInfo RPC. +func NetworkInfo( + cli *client.Client, + req *netmap.NetworkInfoRequest, + 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 + } + + return resp, nil +} + +// NetMapSnapshot executes NetmapService.NetmapSnapshot RPC. +func NetMapSnapshot( + cli *client.Client, + req *netmap.SnapshotRequest, + opts ...client.CallOption, +) (*netmap.SnapshotResponse, error) { + resp := new(netmap.SnapshotResponse) + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceNetmap, rpcNetmapSnapshot), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} diff --git a/api/rpc/object.go b/api/rpc/object.go new file mode 100644 index 0000000..b6792f0 --- /dev/null +++ b/api/rpc/object.go @@ -0,0 +1,243 @@ +package rpc + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/common" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" +) + +const serviceObject = serviceNamePrefix + "object.ObjectService" + +const ( + rpcObjectPut = "Put" + rpcObjectGet = "Get" + rpcObjectSearch = "Search" + rpcObjectRange = "GetRange" + rpcObjectHash = "GetRangeHash" + rpcObjectHead = "Head" + rpcObjectDelete = "Delete" + rpcObjectPutSingle = "PutSingle" + rpcObjectPatch = "Patch" +) + +// PutRequestWriter is an object.PutRequest +// message streaming component. +type PutRequestWriter struct { + wc client.MessageWriterCloser + + resp message.Message +} + +// Write writes req to the stream. +func (w *PutRequestWriter) Write(req *object.PutRequest) error { + return w.wc.WriteMessage(req) +} + +// Close closes the stream. +func (w *PutRequestWriter) Close() error { + return w.wc.Close() +} + +// PutObject executes ObjectService.Put RPC. +func PutObject( + cli *client.Client, + resp *object.PutResponse, + opts ...client.CallOption, +) (*PutRequestWriter, error) { + wc, err := client.OpenClientStream(cli, common.CallMethodInfoClientStream(serviceObject, rpcObjectPut), resp, opts...) + if err != nil { + return nil, err + } + + return &PutRequestWriter{ + wc: wc, + resp: resp, + }, nil +} + +// GetResponseReader is an object.GetResponse +// stream reader. +type GetResponseReader struct { + r client.MessageReader +} + +// Read reads response from the stream. +// +// Returns io.EOF of streaming is finished. +func (r *GetResponseReader) Read(resp *object.GetResponse) error { + return r.r.ReadMessage(resp) +} + +// GetObject executes ObjectService.Get RPC. +func GetObject( + cli *client.Client, + req *object.GetRequest, + opts ...client.CallOption, +) (*GetResponseReader, error) { + wc, err := client.OpenServerStream(cli, common.CallMethodInfoServerStream(serviceObject, rpcObjectGet), req, opts...) + if err != nil { + return nil, err + } + + return &GetResponseReader{ + r: wc, + }, nil +} + +// GetResponseReader is an object.SearchResponse +// stream reader. +type SearchResponseReader struct { + r client.MessageReader +} + +// Read reads response from the stream. +// +// Returns io.EOF of streaming is finished. +func (r *SearchResponseReader) Read(resp *object.SearchResponse) error { + return r.r.ReadMessage(resp) +} + +// SearchObjects executes ObjectService.Search RPC. +func SearchObjects( + cli *client.Client, + req *object.SearchRequest, + opts ...client.CallOption, +) (*SearchResponseReader, error) { + wc, err := client.OpenServerStream(cli, common.CallMethodInfoServerStream(serviceObject, rpcObjectSearch), req, opts...) + if err != nil { + return nil, err + } + + return &SearchResponseReader{ + r: wc, + }, nil +} + +// GetResponseReader is an object.GetRangeResponse +// stream reader. +type ObjectRangeResponseReader struct { + r client.MessageReader +} + +// Read reads response from the stream. +// +// Returns io.EOF of streaming is finished. +func (r *ObjectRangeResponseReader) Read(resp *object.GetRangeResponse) error { + return r.r.ReadMessage(resp) +} + +// GetObjectRange executes ObjectService.GetRange RPC. +func GetObjectRange( + cli *client.Client, + req *object.GetRangeRequest, + opts ...client.CallOption, +) (*ObjectRangeResponseReader, error) { + wc, err := client.OpenServerStream(cli, common.CallMethodInfoServerStream(serviceObject, rpcObjectRange), req, opts...) + if err != nil { + return nil, err + } + + return &ObjectRangeResponseReader{ + r: wc, + }, nil +} + +// HeadObject executes ObjectService.Head RPC. +func HeadObject( + cli *client.Client, + req *object.HeadRequest, + opts ...client.CallOption, +) (*object.HeadResponse, error) { + resp := new(object.HeadResponse) + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceObject, rpcObjectHead), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} + +// DeleteObject executes ObjectService.Delete RPC. +func DeleteObject( + cli *client.Client, + req *object.DeleteRequest, + opts ...client.CallOption, +) (*object.DeleteResponse, error) { + resp := new(object.DeleteResponse) + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceObject, rpcObjectDelete), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} + +// HashObjectRange executes ObjectService.GetRangeHash RPC. +func HashObjectRange( + cli *client.Client, + req *object.GetRangeHashRequest, + opts ...client.CallOption, +) (*object.GetRangeHashResponse, error) { + resp := new(object.GetRangeHashResponse) + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceObject, rpcObjectHash), req, resp, opts...) + if err != nil { + return nil, err + } + + 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 +} + +// 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 +} diff --git a/api/rpc/session.go b/api/rpc/session.go new file mode 100644 index 0000000..2477029 --- /dev/null +++ b/api/rpc/session.go @@ -0,0 +1,28 @@ +package rpc + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/common" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" +) + +const serviceSession = serviceNamePrefix + "session.SessionService" + +const ( + rpcSessionCreate = "Create" +) + +func CreateSession( + cli *client.Client, + req *session.CreateRequest, + opts ...client.CallOption, +) (*session.CreateResponse, error) { + resp := new(session.CreateResponse) + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceSession, rpcSessionCreate), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} diff --git a/api/session/convert.go b/api/session/convert.go new file mode 100644 index 0000000..342be4e --- /dev/null +++ b/api/session/convert.go @@ -0,0 +1,898 @@ +package session + +import ( + "fmt" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" + aclGRPC "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status" + statusGRPC "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status/grpc" +) + +func (c *CreateRequestBody) ToGRPCMessage() grpc.Message { + var m *session.CreateRequest_Body + + if c != nil { + m = new(session.CreateRequest_Body) + + m.SetOwnerId(c.ownerID.ToGRPCMessage().(*refsGRPC.OwnerID)) + m.SetExpiration(c.expiration) + } + + return m +} + +func (c *CreateRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*session.CreateRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + ownerID := v.GetOwnerId() + if ownerID == nil { + c.ownerID = nil + } else { + if c.ownerID == nil { + c.ownerID = new(refs.OwnerID) + } + + err = c.ownerID.FromGRPCMessage(ownerID) + if err != nil { + return err + } + } + + c.expiration = v.GetExpiration() + + return nil +} + +func (c *CreateRequest) ToGRPCMessage() grpc.Message { + var m *session.CreateRequest + + if c != nil { + m = new(session.CreateRequest) + + m.SetBody(c.body.ToGRPCMessage().(*session.CreateRequest_Body)) + c.RequestHeaders.ToMessage(m) + } + + return m +} + +func (c *CreateRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*session.CreateRequest) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + body := v.GetBody() + if body == nil { + c.body = nil + } else { + if c.body == nil { + c.body = new(CreateRequestBody) + } + + err = c.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return c.RequestHeaders.FromMessage(v) +} + +func (c *CreateResponseBody) ToGRPCMessage() grpc.Message { + var m *session.CreateResponse_Body + + if c != nil { + m = new(session.CreateResponse_Body) + + m.SetSessionKey(c.sessionKey) + m.SetId(c.id) + } + + return m +} + +func (c *CreateResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*session.CreateResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + c.sessionKey = v.GetSessionKey() + c.id = v.GetId() + + return nil +} + +func (c *CreateResponse) ToGRPCMessage() grpc.Message { + var m *session.CreateResponse + + if c != nil { + m = new(session.CreateResponse) + + m.SetBody(c.body.ToGRPCMessage().(*session.CreateResponse_Body)) + c.ResponseHeaders.ToMessage(m) + } + + return m +} + +func (c *CreateResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*session.CreateResponse) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + body := v.GetBody() + if body == nil { + c.body = nil + } else { + if c.body == nil { + c.body = new(CreateResponseBody) + } + + err = c.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return c.ResponseHeaders.FromMessage(v) +} + +func (l *TokenLifetime) ToGRPCMessage() grpc.Message { + var m *session.SessionToken_Body_TokenLifetime + + if l != nil { + m = new(session.SessionToken_Body_TokenLifetime) + + m.SetExp(l.exp) + m.SetIat(l.iat) + m.SetNbf(l.nbf) + } + + return m +} + +func (l *TokenLifetime) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*session.SessionToken_Body_TokenLifetime) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + l.exp = v.GetExp() + l.iat = v.GetIat() + l.nbf = v.GetNbf() + + return nil +} + +func (x *XHeader) ToGRPCMessage() grpc.Message { + var m *session.XHeader + + if x != nil { + m = new(session.XHeader) + + m.SetKey(x.key) + m.SetValue(x.val) + } + + return m +} + +func (x *XHeader) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*session.XHeader) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + x.key = v.GetKey() + x.val = v.GetValue() + + return nil +} + +func XHeadersToGRPC(xs []XHeader) (res []session.XHeader) { + if xs != nil { + res = make([]session.XHeader, 0, len(xs)) + + for i := range xs { + res = append(res, *xs[i].ToGRPCMessage().(*session.XHeader)) + } + } + + return +} + +func XHeadersFromGRPC(xs []session.XHeader) (res []XHeader, err error) { + if xs != nil { + res = make([]XHeader, len(xs)) + + for i := range xs { + err = res[i].FromGRPCMessage(&xs[i]) + if err != nil { + return + } + } + } + + return +} + +func (t *Token) ToGRPCMessage() grpc.Message { + var m *session.SessionToken + + if t != nil { + m = new(session.SessionToken) + + m.SetBody(t.body.ToGRPCMessage().(*session.SessionToken_Body)) + m.SetSignature(t.sig.ToGRPCMessage().(*refsGRPC.Signature)) + } + + return m +} + +func (t *Token) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*session.SessionToken) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + body := v.GetBody() + if body == nil { + t.body = nil + } else { + if t.body == nil { + t.body = new(TokenBody) + } + + err = t.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + sig := v.GetSignature() + if sig == nil { + t.sig = nil + } else { + if t.sig == nil { + t.sig = new(refs.Signature) + } + + err = t.sig.FromGRPCMessage(sig) + if err != nil { + return err + } + } + + return nil +} + +func (r *RequestVerificationHeader) ToGRPCMessage() grpc.Message { + var m *session.RequestVerificationHeader + + if r != nil { + m = new(session.RequestVerificationHeader) + + m.SetBodySignature(r.bodySig.ToGRPCMessage().(*refsGRPC.Signature)) + m.SetMetaSignature(r.metaSig.ToGRPCMessage().(*refsGRPC.Signature)) + m.SetOriginSignature(r.originSig.ToGRPCMessage().(*refsGRPC.Signature)) + m.SetOrigin(r.origin.ToGRPCMessage().(*session.RequestVerificationHeader)) + } + + return m +} + +func (r *RequestVerificationHeader) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*session.RequestVerificationHeader) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + originSig := v.GetOriginSignature() + if originSig == nil { + r.originSig = nil + } else { + if r.originSig == nil { + r.originSig = new(refs.Signature) + } + + err = r.originSig.FromGRPCMessage(originSig) + if err != nil { + return err + } + } + + metaSig := v.GetMetaSignature() + if metaSig == nil { + r.metaSig = nil + } else { + if r.metaSig == nil { + r.metaSig = new(refs.Signature) + } + + err = r.metaSig.FromGRPCMessage(metaSig) + if err != nil { + return err + } + } + + bodySig := v.GetBodySignature() + if bodySig == nil { + r.bodySig = nil + } else { + if r.bodySig == nil { + r.bodySig = new(refs.Signature) + } + + err = r.bodySig.FromGRPCMessage(bodySig) + if err != nil { + return err + } + } + + origin := v.GetOrigin() + if origin == nil { + r.origin = nil + } else { + if r.origin == nil { + r.origin = new(RequestVerificationHeader) + } + + err = r.origin.FromGRPCMessage(origin) + if err != nil { + return err + } + } + + return nil +} + +func (r *RequestMetaHeader) ToGRPCMessage() grpc.Message { + var m *session.RequestMetaHeader + + if r != nil { + m = new(session.RequestMetaHeader) + + m.SetVersion(r.version.ToGRPCMessage().(*refsGRPC.Version)) + m.SetSessionToken(r.sessionToken.ToGRPCMessage().(*session.SessionToken)) + m.SetBearerToken(r.bearerToken.ToGRPCMessage().(*aclGRPC.BearerToken)) + m.SetXHeaders(XHeadersToGRPC(r.xHeaders)) + m.SetEpoch(r.epoch) + m.SetTtl(r.ttl) + m.SetOrigin(r.origin.ToGRPCMessage().(*session.RequestMetaHeader)) + m.SetMagicNumber(r.netMagic) + } + + return m +} + +func (r *RequestMetaHeader) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*session.RequestMetaHeader) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + version := v.GetVersion() + if version == nil { + r.version = nil + } else { + if r.version == nil { + r.version = new(refs.Version) + } + + err = r.version.FromGRPCMessage(version) + if err != nil { + return err + } + } + + sessionToken := v.GetSessionToken() + if sessionToken == nil { + r.sessionToken = nil + } else { + if r.sessionToken == nil { + r.sessionToken = new(Token) + } + + err = r.sessionToken.FromGRPCMessage(sessionToken) + if err != nil { + return err + } + } + + bearerToken := v.GetBearerToken() + if bearerToken == nil { + r.bearerToken = nil + } else { + if r.bearerToken == nil { + r.bearerToken = new(acl.BearerToken) + } + + err = r.bearerToken.FromGRPCMessage(bearerToken) + if err != nil { + return err + } + } + + origin := v.GetOrigin() + if origin == nil { + r.origin = nil + } else { + if r.origin == nil { + r.origin = new(RequestMetaHeader) + } + + err = r.origin.FromGRPCMessage(origin) + if err != nil { + return err + } + } + + r.xHeaders, err = XHeadersFromGRPC(v.GetXHeaders()) + if err != nil { + return err + } + + r.epoch = v.GetEpoch() + r.ttl = v.GetTtl() + r.netMagic = v.GetMagicNumber() + + return nil +} + +func (r *ResponseVerificationHeader) ToGRPCMessage() grpc.Message { + var m *session.ResponseVerificationHeader + + if r != nil { + m = new(session.ResponseVerificationHeader) + + m.SetBodySignature(r.bodySig.ToGRPCMessage().(*refsGRPC.Signature)) + m.SetMetaSignature(r.metaSig.ToGRPCMessage().(*refsGRPC.Signature)) + m.SetOriginSignature(r.originSig.ToGRPCMessage().(*refsGRPC.Signature)) + m.SetOrigin(r.origin.ToGRPCMessage().(*session.ResponseVerificationHeader)) + } + + return m +} + +func (r *ResponseVerificationHeader) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*session.ResponseVerificationHeader) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + originSig := v.GetOriginSignature() + if originSig == nil { + r.originSig = nil + } else { + if r.originSig == nil { + r.originSig = new(refs.Signature) + } + + err = r.originSig.FromGRPCMessage(originSig) + if err != nil { + return err + } + } + + metaSig := v.GetMetaSignature() + if metaSig == nil { + r.metaSig = nil + } else { + if r.metaSig == nil { + r.metaSig = new(refs.Signature) + } + + err = r.metaSig.FromGRPCMessage(metaSig) + if err != nil { + return err + } + } + + bodySig := v.GetBodySignature() + if bodySig == nil { + r.bodySig = nil + } else { + if r.bodySig == nil { + r.bodySig = new(refs.Signature) + } + + err = r.bodySig.FromGRPCMessage(bodySig) + if err != nil { + return err + } + } + + origin := v.GetOrigin() + if origin == nil { + r.origin = nil + } else { + if r.origin == nil { + r.origin = new(ResponseVerificationHeader) + } + + err = r.origin.FromGRPCMessage(origin) + if err != nil { + return err + } + } + + return nil +} + +func (r *ResponseMetaHeader) ToGRPCMessage() grpc.Message { + var m *session.ResponseMetaHeader + + if r != nil { + m = new(session.ResponseMetaHeader) + + m.SetVersion(r.version.ToGRPCMessage().(*refsGRPC.Version)) + m.SetXHeaders(XHeadersToGRPC(r.xHeaders)) + m.SetEpoch(r.epoch) + m.SetTtl(r.ttl) + m.SetOrigin(r.origin.ToGRPCMessage().(*session.ResponseMetaHeader)) + m.SetStatus(r.status.ToGRPCMessage().(*statusGRPC.Status)) + } + + return m +} + +func (r *ResponseMetaHeader) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*session.ResponseMetaHeader) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + version := v.GetVersion() + if version == nil { + r.version = nil + } else { + if r.version == nil { + r.version = new(refs.Version) + } + + err = r.version.FromGRPCMessage(version) + if err != nil { + return err + } + } + + origin := v.GetOrigin() + if origin == nil { + r.origin = nil + } else { + if r.origin == nil { + r.origin = new(ResponseMetaHeader) + } + + err = r.origin.FromGRPCMessage(origin) + if err != nil { + return err + } + } + + st := v.GetStatus() + if st == nil { + r.status = nil + } else { + if r.status == nil { + r.status = new(status.Status) + } + + err = r.status.FromGRPCMessage(st) + if err != nil { + return err + } + } + + r.xHeaders, err = XHeadersFromGRPC(v.GetXHeaders()) + if err != nil { + return err + } + + r.epoch = v.GetEpoch() + r.ttl = v.GetTtl() + + return nil +} + +func ObjectSessionVerbToGRPCField(v ObjectSessionVerb) session.ObjectSessionContext_Verb { + switch v { + case ObjectVerbPut: + return session.ObjectSessionContext_PUT + case ObjectVerbGet: + return session.ObjectSessionContext_GET + case ObjectVerbHead: + return session.ObjectSessionContext_HEAD + case ObjectVerbSearch: + return session.ObjectSessionContext_SEARCH + case ObjectVerbDelete: + return session.ObjectSessionContext_DELETE + case ObjectVerbRange: + return session.ObjectSessionContext_RANGE + case ObjectVerbRangeHash: + return session.ObjectSessionContext_RANGEHASH + case ObjectVerbPatch: + return session.ObjectSessionContext_PATCH + default: + return session.ObjectSessionContext_VERB_UNSPECIFIED + } +} + +func ObjectSessionVerbFromGRPCField(v session.ObjectSessionContext_Verb) ObjectSessionVerb { + switch v { + case session.ObjectSessionContext_PUT: + return ObjectVerbPut + case session.ObjectSessionContext_GET: + return ObjectVerbGet + case session.ObjectSessionContext_HEAD: + return ObjectVerbHead + case session.ObjectSessionContext_SEARCH: + return ObjectVerbSearch + case session.ObjectSessionContext_DELETE: + return ObjectVerbDelete + case session.ObjectSessionContext_RANGE: + return ObjectVerbRange + case session.ObjectSessionContext_RANGEHASH: + return ObjectVerbRangeHash + case session.ObjectSessionContext_PATCH: + return ObjectVerbPatch + default: + return ObjectVerbUnknown + } +} + +func (c *ObjectSessionContext) ToGRPCMessage() grpc.Message { + var m *session.ObjectSessionContext + + if c != nil { + m = new(session.ObjectSessionContext) + + m.SetVerb(ObjectSessionVerbToGRPCField(c.verb)) + m.SetTarget(&session.ObjectSessionContext_Target{ + Container: c.cnr.ToGRPCMessage().(*refsGRPC.ContainerID), + Objects: refs.ObjectIDListToGRPCMessage(c.objs), + }) + } + + return m +} + +func (c *ObjectSessionContext) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*session.ObjectSessionContext) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + cnr := v.GetTarget().GetContainer() + if cnr == nil { + c.cnr = nil + } else { + if c.cnr == nil { + c.cnr = new(refs.ContainerID) + } + + err = c.cnr.FromGRPCMessage(cnr) + if err != nil { + return err + } + } + + c.objs, err = refs.ObjectIDListFromGRPCMessage(v.GetTarget().GetObjects()) + if err != nil { + return err + } + + c.verb = ObjectSessionVerbFromGRPCField(v.GetVerb()) + + return nil +} + +func (t *TokenBody) ToGRPCMessage() grpc.Message { + var m *session.SessionToken_Body + + if t != nil { + m = new(session.SessionToken_Body) + + switch typ := t.ctx.(type) { + default: + panic(fmt.Sprintf("unknown session context %T", typ)) + case nil: + m.Context = nil + case *ObjectSessionContext: + m.SetObject(typ.ToGRPCMessage().(*session.ObjectSessionContext)) + case *ContainerSessionContext: + m.SetContainer(typ.ToGRPCMessage().(*session.ContainerSessionContext)) + } + + m.SetOwnerId(t.ownerID.ToGRPCMessage().(*refsGRPC.OwnerID)) + m.SetId(t.id) + m.SetSessionKey(t.sessionKey) + m.SetLifetime(t.lifetime.ToGRPCMessage().(*session.SessionToken_Body_TokenLifetime)) + } + + return m +} + +func (t *TokenBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*session.SessionToken_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + t.ctx = nil + + switch val := v.GetContext().(type) { + default: + err = fmt.Errorf("unknown session context %T", val) + case nil: + case *session.SessionToken_Body_Object: + ctx, ok := t.ctx.(*ObjectSessionContext) + if !ok { + ctx = new(ObjectSessionContext) + t.ctx = ctx + } + + err = ctx.FromGRPCMessage(val.Object) + case *session.SessionToken_Body_Container: + ctx, ok := t.ctx.(*ContainerSessionContext) + if !ok { + ctx = new(ContainerSessionContext) + t.ctx = ctx + } + + err = ctx.FromGRPCMessage(val.Container) + } + + if err != nil { + return err + } + + ownerID := v.GetOwnerId() + if ownerID == nil { + t.ownerID = nil + } else { + if t.ownerID == nil { + t.ownerID = new(refs.OwnerID) + } + + err = t.ownerID.FromGRPCMessage(ownerID) + if err != nil { + return err + } + } + + lifetime := v.GetLifetime() + if lifetime == nil { + t.lifetime = nil + } else { + if t.lifetime == nil { + t.lifetime = new(TokenLifetime) + } + + err = t.lifetime.FromGRPCMessage(lifetime) + if err != nil { + return err + } + } + + t.id = v.GetId() + t.sessionKey = v.GetSessionKey() + + return nil +} + +// ContainerSessionVerbToGRPCField converts ContainerSessionVerb +// to gRPC-generated session.ContainerSessionContext_Verb. +// +// If v is outside of the ContainerSessionVerb enum, +// session.ContainerSessionContext_VERB_UNSPECIFIED is returned. +func ContainerSessionVerbToGRPCField(v ContainerSessionVerb) session.ContainerSessionContext_Verb { + switch v { + default: + return session.ContainerSessionContext_VERB_UNSPECIFIED + case ContainerVerbPut: + return session.ContainerSessionContext_PUT + case ContainerVerbDelete: + return session.ContainerSessionContext_DELETE + case ContainerVerbSetEACL: + return session.ContainerSessionContext_SETEACL + } +} + +// ContainerSessionVerbFromGRPCField converts gRPC-generated +// session.ContainerSessionContext_Verb to ContainerSessionVerb. +// +// If v is outside of the session.ContainerSessionContext_Verb enum, +// ContainerVerbUnknown is returned. +func ContainerSessionVerbFromGRPCField(v session.ContainerSessionContext_Verb) ContainerSessionVerb { + switch v { + default: + return ContainerVerbUnknown + case session.ContainerSessionContext_PUT: + return ContainerVerbPut + case session.ContainerSessionContext_DELETE: + return ContainerVerbDelete + case session.ContainerSessionContext_SETEACL: + return ContainerVerbSetEACL + } +} + +// ToGRPCMessage converts ContainerSessionContext to gRPC-generated +// session.ContainerSessionContext message. +func (x *ContainerSessionContext) ToGRPCMessage() grpc.Message { + var m *session.ContainerSessionContext + + if x != nil { + m = new(session.ContainerSessionContext) + + m.SetVerb(ContainerSessionVerbToGRPCField(x.verb)) + m.SetWildcard(x.wildcard) + m.SetContainerId(x.cid.ToGRPCMessage().(*refsGRPC.ContainerID)) + } + + return m +} + +// FromGRPCMessage tries to restore ContainerSessionContext from grpc.Message. +// +// Returns message.ErrUnexpectedMessageType if m is not +// a gRPC-generated session.ContainerSessionContext message. +func (x *ContainerSessionContext) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*session.ContainerSessionContext) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + cid := v.GetContainerId() + if cid == nil { + x.cid = nil + } else { + if x.cid == nil { + x.cid = new(refs.ContainerID) + } + + err = x.cid.FromGRPCMessage(cid) + if err != nil { + return err + } + } + + x.verb = ContainerSessionVerbFromGRPCField(v.GetVerb()) + x.wildcard = v.GetWildcard() + + return nil +} diff --git a/api/session/grpc/service_frostfs.pb.go b/api/session/grpc/service_frostfs.pb.go new file mode 100644 index 0000000..1c8e02b --- /dev/null +++ b/api/session/grpc/service_frostfs.pb.go @@ -0,0 +1,866 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package session + +import ( + json "encoding/json" + fmt "fmt" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" +) + +type CreateRequest_Body struct { + OwnerId *grpc.OwnerID `json:"ownerId"` + Expiration uint64 `json:"expiration"` +} + +var ( + _ encoding.ProtoMarshaler = (*CreateRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*CreateRequest_Body)(nil) + _ json.Marshaler = (*CreateRequest_Body)(nil) + _ json.Unmarshaler = (*CreateRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *CreateRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.OwnerId) + size += proto.UInt64Size(2, x.Expiration) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *CreateRequest_Body) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *CreateRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.OwnerId != nil { + x.OwnerId.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Expiration != 0 { + mm.AppendUint64(2, x.Expiration) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *CreateRequest_Body) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "CreateRequest_Body") + } + switch fc.FieldNum { + case 1: // OwnerId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "OwnerId") + } + x.OwnerId = new(grpc.OwnerID) + if err := x.OwnerId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Expiration + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Expiration") + } + x.Expiration = data + } + } + return nil +} +func (x *CreateRequest_Body) GetOwnerId() *grpc.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} +func (x *CreateRequest_Body) SetOwnerId(v *grpc.OwnerID) { + x.OwnerId = v +} +func (x *CreateRequest_Body) GetExpiration() uint64 { + if x != nil { + return x.Expiration + } + return 0 +} +func (x *CreateRequest_Body) SetExpiration(v uint64) { + x.Expiration = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *CreateRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *CreateRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ownerId\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"expiration\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Expiration, 10) + out.RawByte('"') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *CreateRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *CreateRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "ownerId": + { + var f *grpc.OwnerID + f = new(grpc.OwnerID) + f.UnmarshalEasyJSON(in) + x.OwnerId = f + } + case "expiration": + { + var f uint64 + r := in.JsonNumber() + n := r.String() + v, err := strconv.ParseUint(n, 10, 64) + if err != nil { + in.AddError(err) + return + } + pv := uint64(v) + f = pv + x.Expiration = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type CreateRequest struct { + Body *CreateRequest_Body `json:"body"` + MetaHeader *RequestMetaHeader `json:"metaHeader"` + VerifyHeader *RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*CreateRequest)(nil) + _ encoding.ProtoUnmarshaler = (*CreateRequest)(nil) + _ json.Marshaler = (*CreateRequest)(nil) + _ json.Unmarshaler = (*CreateRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *CreateRequest) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.MetaHeader) + size += proto.NestedStructureSize(3, x.VerifyHeader) + return size +} + +// ReadSignedData fills buf with signed data of x. +// If buffer length is less than x.SignedDataSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same signed data. +func (x *CreateRequest) SignedDataSize() int { + return x.GetBody().StableSize() +} + +// SignedDataSize returns size of the request signed data in bytes. +// +// Structures with the same field values have the same signed data size. +func (x *CreateRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *CreateRequest) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *CreateRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *CreateRequest) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "CreateRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(CreateRequest_Body) + if err := x.Body.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // MetaHeader + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "MetaHeader") + } + x.MetaHeader = new(RequestMetaHeader) + if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // VerifyHeader + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader") + } + x.VerifyHeader = new(RequestVerificationHeader) + if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *CreateRequest) GetBody() *CreateRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *CreateRequest) SetBody(v *CreateRequest_Body) { + x.Body = v +} +func (x *CreateRequest) GetMetaHeader() *RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *CreateRequest) SetMetaHeader(v *RequestMetaHeader) { + x.MetaHeader = v +} +func (x *CreateRequest) GetVerifyHeader() *RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *CreateRequest) SetVerifyHeader(v *RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *CreateRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *CreateRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *CreateRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *CreateRequest) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "body": + { + var f *CreateRequest_Body + f = new(CreateRequest_Body) + f.UnmarshalEasyJSON(in) + x.Body = f + } + case "metaHeader": + { + var f *RequestMetaHeader + f = new(RequestMetaHeader) + f.UnmarshalEasyJSON(in) + x.MetaHeader = f + } + case "verifyHeader": + { + var f *RequestVerificationHeader + f = new(RequestVerificationHeader) + f.UnmarshalEasyJSON(in) + x.VerifyHeader = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type CreateResponse_Body struct { + Id []byte `json:"id"` + SessionKey []byte `json:"sessionKey"` +} + +var ( + _ encoding.ProtoMarshaler = (*CreateResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*CreateResponse_Body)(nil) + _ json.Marshaler = (*CreateResponse_Body)(nil) + _ json.Unmarshaler = (*CreateResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *CreateResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.Id) + size += proto.BytesSize(2, x.SessionKey) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *CreateResponse_Body) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *CreateResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if len(x.Id) != 0 { + mm.AppendBytes(1, x.Id) + } + if len(x.SessionKey) != 0 { + mm.AppendBytes(2, x.SessionKey) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *CreateResponse_Body) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "CreateResponse_Body") + } + switch fc.FieldNum { + case 1: // Id + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Id") + } + x.Id = data + case 2: // SessionKey + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "SessionKey") + } + x.SessionKey = data + } + } + return nil +} +func (x *CreateResponse_Body) GetId() []byte { + if x != nil { + return x.Id + } + return nil +} +func (x *CreateResponse_Body) SetId(v []byte) { + x.Id = v +} +func (x *CreateResponse_Body) GetSessionKey() []byte { + if x != nil { + return x.SessionKey + } + return nil +} +func (x *CreateResponse_Body) SetSessionKey(v []byte) { + x.SessionKey = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *CreateResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *CreateResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"id\":" + out.RawString(prefix) + if x.Id != nil { + out.Base64Bytes(x.Id) + } else { + out.String("") + } + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"sessionKey\":" + out.RawString(prefix) + if x.SessionKey != nil { + out.Base64Bytes(x.SessionKey) + } else { + out.String("") + } + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *CreateResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *CreateResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "id": + { + var f []byte + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + x.Id = f + } + case "sessionKey": + { + var f []byte + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + x.SessionKey = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type CreateResponse struct { + Body *CreateResponse_Body `json:"body"` + MetaHeader *ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*CreateResponse)(nil) + _ encoding.ProtoUnmarshaler = (*CreateResponse)(nil) + _ json.Marshaler = (*CreateResponse)(nil) + _ json.Unmarshaler = (*CreateResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *CreateResponse) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.MetaHeader) + size += proto.NestedStructureSize(3, x.VerifyHeader) + return size +} + +// ReadSignedData fills buf with signed data of x. +// If buffer length is less than x.SignedDataSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same signed data. +func (x *CreateResponse) SignedDataSize() int { + return x.GetBody().StableSize() +} + +// SignedDataSize returns size of the request signed data in bytes. +// +// Structures with the same field values have the same signed data size. +func (x *CreateResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *CreateResponse) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *CreateResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *CreateResponse) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "CreateResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(CreateResponse_Body) + if err := x.Body.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // MetaHeader + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "MetaHeader") + } + x.MetaHeader = new(ResponseMetaHeader) + if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // VerifyHeader + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader") + } + x.VerifyHeader = new(ResponseVerificationHeader) + if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *CreateResponse) GetBody() *CreateResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *CreateResponse) SetBody(v *CreateResponse_Body) { + x.Body = v +} +func (x *CreateResponse) GetMetaHeader() *ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *CreateResponse) SetMetaHeader(v *ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *CreateResponse) GetVerifyHeader() *ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *CreateResponse) SetVerifyHeader(v *ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *CreateResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *CreateResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *CreateResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *CreateResponse) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "body": + { + var f *CreateResponse_Body + f = new(CreateResponse_Body) + f.UnmarshalEasyJSON(in) + x.Body = f + } + case "metaHeader": + { + var f *ResponseMetaHeader + f = new(ResponseMetaHeader) + f.UnmarshalEasyJSON(in) + x.MetaHeader = f + } + case "verifyHeader": + { + var f *ResponseVerificationHeader + f = new(ResponseVerificationHeader) + f.UnmarshalEasyJSON(in) + x.VerifyHeader = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/api/session/grpc/service_frostfs_fuzz.go b/api/session/grpc/service_frostfs_fuzz.go new file mode 100644 index 0000000..759361c --- /dev/null +++ b/api/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/api/session/grpc/service_frostfs_test.go b/api/session/grpc/service_frostfs_test.go new file mode 100644 index 0000000..fc8664e --- /dev/null +++ b/api/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/api/session/grpc/service_grpc.pb.go b/api/session/grpc/service_grpc.pb.go new file mode 100644 index 0000000..6073111 --- /dev/null +++ b/api/session/grpc/service_grpc.pb.go @@ -0,0 +1,119 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v5.27.2 +// source: api/session/grpc/service.proto + +package session + +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 ( + 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. +type SessionServiceClient interface { + // Open a new session between two peers. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // session has been successfully opened; + // - Common failures (SECTION_FAILURE_COMMON). + Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) +} + +type sessionServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewSessionServiceClient(cc grpc.ClientConnInterface) SessionServiceClient { + return &sessionServiceClient{cc} +} + +func (c *sessionServiceClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) { + out := new(CreateResponse) + err := c.cc.Invoke(ctx, SessionService_Create_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// SessionServiceServer is the server API for SessionService service. +// All implementations should embed UnimplementedSessionServiceServer +// for forward compatibility +type SessionServiceServer interface { + // Open a new session between two peers. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // session has been successfully opened; + // - Common failures (SECTION_FAILURE_COMMON). + Create(context.Context, *CreateRequest) (*CreateResponse, error) +} + +// UnimplementedSessionServiceServer should be embedded to have forward compatible implementations. +type UnimplementedSessionServiceServer struct { +} + +func (UnimplementedSessionServiceServer) Create(context.Context, *CreateRequest) (*CreateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") +} + +// UnsafeSessionServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to SessionServiceServer will +// result in compilation errors. +type UnsafeSessionServiceServer interface { + mustEmbedUnimplementedSessionServiceServer() +} + +func RegisterSessionServiceServer(s grpc.ServiceRegistrar, srv SessionServiceServer) { + s.RegisterService(&SessionService_ServiceDesc, srv) +} + +func _SessionService_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SessionServiceServer).Create(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SessionService_Create_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SessionServiceServer).Create(ctx, req.(*CreateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// SessionService_ServiceDesc is the grpc.ServiceDesc for SessionService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var SessionService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "neo.fs.v2.session.SessionService", + HandlerType: (*SessionServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Create", + Handler: _SessionService_Create_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/session/grpc/service.proto", +} diff --git a/api/session/grpc/types_frostfs.pb.go b/api/session/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..c62c1ff --- /dev/null +++ b/api/session/grpc/types_frostfs.pb.go @@ -0,0 +1,3049 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package session + +import ( + json "encoding/json" + fmt "fmt" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + grpc2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" +) + +type 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.NestedStructureSizeUnchecked(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.EmitProtobuf(mm.AppendMessage(1)) + } + for i := range x.Objects { + 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, 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 + } + first := true + out.RawByte('{') + { + 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 = "\"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 = 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.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 + } + first := true + out.RawByte('{') + { + 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 = "\"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.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 + } + first := true + out.RawByte('{') + { + 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 = "\"wildcard\":" + out.RawString(prefix) + out.Bool(x.Wildcard) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + 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 + } + first := true + 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 !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 = "\"iat\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Iat, 10) + out.RawByte('"') + } + 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 + 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 + 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 + 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 + } + } + 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.EmitProtobuf(mm.AppendMessage(2)) + } + 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.EmitProtobuf(mm.AppendMessage(5)) + } + } + if inner, ok := x.Context.(*SessionToken_Body_Container); ok { + if inner.Container != nil { + 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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"id\":" + out.RawString(prefix) + if x.Id != nil { + out.Base64Bytes(x.Id) + } else { + out.String("") + } + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ownerID\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) + } + { + 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 = "\"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 !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"object\":" + out.RawString(prefix) + xx.Object.MarshalEasyJSON(out) + } + case *SessionToken_Body_Container: + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"container\":" + out.RawString(prefix) + xx.Container.MarshalEasyJSON(out) + } + } + 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 + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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 + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Signature != nil { + 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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"key\":" + out.RawString(prefix) + out.String(x.Key) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + out.String(x.Value) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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.NestedStructureSizeUnchecked(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.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 { + x.XHeaders[i].EmitProtobuf(mm.AppendMessage(4)) + } + if x.SessionToken != nil { + x.SessionToken.EmitProtobuf(mm.AppendMessage(5)) + } + if x.BearerToken != nil { + x.BearerToken.EmitProtobuf(mm.AppendMessage(6)) + } + if x.Origin != nil { + 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, 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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"version\":" + out.RawString(prefix) + x.Version.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"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 = "\"ttl\":" + out.RawString(prefix) + out.Uint32(x.Ttl) + } + { + 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 = "\"sessionToken\":" + out.RawString(prefix) + x.SessionToken.MarshalEasyJSON(out) + } + { + 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 = "\"origin\":" + out.RawString(prefix) + x.Origin.MarshalEasyJSON(out) + } + { + 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('}') +} + +// 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 + 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 + 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": + { + var f XHeader + var list []XHeader + in.Delim('[') + for !in.IsDelim(']') { + f = 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 + 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 + } + } + 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.NestedStructureSizeUnchecked(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.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 { + x.XHeaders[i].EmitProtobuf(mm.AppendMessage(4)) + } + if x.Origin != nil { + x.Origin.EmitProtobuf(mm.AppendMessage(5)) + } + if x.Status != nil { + 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, 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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"version\":" + out.RawString(prefix) + x.Version.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"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 = "\"ttl\":" + out.RawString(prefix) + out.Uint32(x.Ttl) + } + { + 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 = "\"origin\":" + out.RawString(prefix) + x.Origin.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + 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 + 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 + 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": + { + var f XHeader + var list []XHeader + in.Delim('[') + for !in.IsDelim(']') { + f = 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.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaSignature != nil { + x.MetaSignature.EmitProtobuf(mm.AppendMessage(2)) + } + if x.OriginSignature != nil { + x.OriginSignature.EmitProtobuf(mm.AppendMessage(3)) + } + if x.Origin != nil { + 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 + } + first := true + out.RawByte('{') + { + 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 = "\"metaSignature\":" + out.RawString(prefix) + x.MetaSignature.MarshalEasyJSON(out) + } + { + 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 = "\"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.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaSignature != nil { + x.MetaSignature.EmitProtobuf(mm.AppendMessage(2)) + } + if x.OriginSignature != nil { + x.OriginSignature.EmitProtobuf(mm.AppendMessage(3)) + } + if x.Origin != nil { + 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 + } + first := true + out.RawByte('{') + { + 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 = "\"metaSignature\":" + out.RawString(prefix) + x.MetaSignature.MarshalEasyJSON(out) + } + { + 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 = "\"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/api/session/grpc/types_frostfs_fuzz.go b/api/session/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..fae4a05 --- /dev/null +++ b/api/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/api/session/grpc/types_frostfs_test.go b/api/session/grpc/types_frostfs_test.go new file mode 100644 index 0000000..5c9b6c2 --- /dev/null +++ b/api/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/api/session/json.go b/api/session/json.go new file mode 100644 index 0000000..92602ea --- /dev/null +++ b/api/session/json.go @@ -0,0 +1,86 @@ +package session + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" +) + +func (c *ObjectSessionContext) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(c) +} + +func (c *ObjectSessionContext) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(c, data, new(session.ObjectSessionContext)) +} + +func (l *TokenLifetime) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(l) +} + +func (l *TokenLifetime) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(l, data, new(session.SessionToken_Body_TokenLifetime)) +} + +func (t *TokenBody) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(t) +} + +func (t *TokenBody) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(t, data, new(session.SessionToken_Body)) +} + +func (t *Token) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(t) +} + +func (t *Token) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(t, data, new(session.SessionToken)) +} + +func (x *XHeader) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(x) +} + +func (x *XHeader) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(x, data, new(session.XHeader)) +} + +func (r *RequestMetaHeader) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(r) +} + +func (r *RequestMetaHeader) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(r, data, new(session.RequestMetaHeader)) +} + +func (r *RequestVerificationHeader) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(r) +} + +func (r *RequestVerificationHeader) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(r, data, new(session.RequestVerificationHeader)) +} + +func (r *ResponseMetaHeader) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(r) +} + +func (r *ResponseMetaHeader) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(r, data, new(session.ResponseMetaHeader)) +} + +func (r *ResponseVerificationHeader) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(r) +} + +func (r *ResponseVerificationHeader) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(r, data, new(session.ResponseVerificationHeader)) +} + +func (x *ContainerSessionContext) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(x) +} + +func (x *ContainerSessionContext) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(x, data, new(session.ContainerSessionContext)) +} diff --git a/api/session/marshal.go b/api/session/marshal.go new file mode 100644 index 0000000..d4838b2 --- /dev/null +++ b/api/session/marshal.go @@ -0,0 +1,536 @@ +package session + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" +) + +const ( + createReqBodyOwnerField = 1 + createReqBodyExpirationField = 2 + + createRespBodyIDField = 1 + createRespBodyKeyField = 2 + + xheaderKeyField = 1 + xheaderValueField = 2 + + lifetimeExpirationField = 1 + lifetimeNotValidBeforeField = 2 + lifetimeIssuedAtField = 3 + + objectCtxVerbField = 1 + objectCtxTargetField = 2 + + sessionTokenBodyIDField = 1 + sessionTokenBodyOwnerField = 2 + sessionTokenBodyLifetimeField = 3 + sessionTokenBodyKeyField = 4 + sessionTokenBodyObjectCtxField = 5 + sessionTokenBodyCnrCtxField = 6 + + sessionTokenBodyField = 1 + sessionTokenSignatureField = 2 + + reqMetaHeaderVersionField = 1 + reqMetaHeaderEpochField = 2 + reqMetaHeaderTTLField = 3 + reqMetaHeaderXHeadersField = 4 + reqMetaHeaderSessionTokenField = 5 + reqMetaHeaderBearerTokenField = 6 + reqMetaHeaderOriginField = 7 + reqMetaHeaderNetMagicField = 8 + + reqVerifHeaderBodySignatureField = 1 + reqVerifHeaderMetaSignatureField = 2 + reqVerifHeaderOriginSignatureField = 3 + reqVerifHeaderOriginField = 4 + + respMetaHeaderVersionField = 1 + respMetaHeaderEpochField = 2 + respMetaHeaderTTLField = 3 + respMetaHeaderXHeadersField = 4 + respMetaHeaderOriginField = 5 + respMetaHeaderStatusField = 6 + + respVerifHeaderBodySignatureField = 1 + respVerifHeaderMetaSignatureField = 2 + respVerifHeaderOriginSignatureField = 3 + respVerifHeaderOriginField = 4 +) + +func (c *CreateRequestBody) StableMarshal(buf []byte) []byte { + if c == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, c.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(createReqBodyOwnerField, buf[offset:], c.ownerID) + proto.UInt64Marshal(createReqBodyExpirationField, buf[offset:], c.expiration) + + return buf +} + +func (c *CreateRequestBody) StableSize() (size int) { + if c == nil { + return 0 + } + + size += proto.NestedStructureSize(createReqBodyOwnerField, c.ownerID) + size += proto.UInt64Size(createReqBodyExpirationField, c.expiration) + + return size +} + +func (c *CreateRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(c, data, new(session.CreateRequest_Body)) +} + +func (c *CreateResponseBody) StableMarshal(buf []byte) []byte { + if c == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, c.StableSize()) + } + + var offset int + + offset += proto.BytesMarshal(createRespBodyIDField, buf[offset:], c.id) + proto.BytesMarshal(createRespBodyKeyField, buf[offset:], c.sessionKey) + + return buf +} + +func (c *CreateResponseBody) StableSize() (size int) { + if c == nil { + return 0 + } + + size += proto.BytesSize(createRespBodyIDField, c.id) + size += proto.BytesSize(createRespBodyKeyField, c.sessionKey) + + return size +} + +func (c *CreateResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(c, data, new(session.CreateResponse_Body)) +} + +func (x *XHeader) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, x.StableSize()) + } + + var offset int + + offset += proto.StringMarshal(xheaderKeyField, buf[offset:], x.key) + proto.StringMarshal(xheaderValueField, buf[offset:], x.val) + + return buf +} + +func (x *XHeader) StableSize() (size int) { + if x == nil { + return 0 + } + + size += proto.StringSize(xheaderKeyField, x.key) + size += proto.StringSize(xheaderValueField, x.val) + + return size +} + +func (x *XHeader) Unmarshal(data []byte) error { + return message.Unmarshal(x, data, new(session.XHeader)) +} + +func (l *TokenLifetime) StableMarshal(buf []byte) []byte { + if l == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, l.StableSize()) + } + + var offset int + + offset += proto.UInt64Marshal(lifetimeExpirationField, buf[offset:], l.exp) + offset += proto.UInt64Marshal(lifetimeNotValidBeforeField, buf[offset:], l.nbf) + proto.UInt64Marshal(lifetimeIssuedAtField, buf[offset:], l.iat) + + return buf +} + +func (l *TokenLifetime) StableSize() (size int) { + if l == nil { + return 0 + } + + size += proto.UInt64Size(lifetimeExpirationField, l.exp) + size += proto.UInt64Size(lifetimeNotValidBeforeField, l.nbf) + size += proto.UInt64Size(lifetimeIssuedAtField, l.iat) + + return size +} + +func (l *TokenLifetime) Unmarshal(data []byte) error { + return message.Unmarshal(l, data, new(session.SessionToken_Body_TokenLifetime)) +} + +func (c *ObjectSessionContext) StableMarshal(buf []byte) []byte { + if c == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, c.StableSize()) + } + + offset := proto.EnumMarshal(objectCtxVerbField, buf, int32(c.verb)) + proto.NestedStructureMarshalUnchecked(objectCtxTargetField, buf[offset:], objectSessionContextTarget{ + cnr: c.cnr, + objs: c.objs, + }) + + return buf +} + +func (c *ObjectSessionContext) StableSize() (size int) { + if c == nil { + return 0 + } + + size += proto.EnumSize(objectCtxVerbField, int32(c.verb)) + size += proto.NestedStructureSizeUnchecked(objectCtxTargetField, objectSessionContextTarget{ + cnr: c.cnr, + objs: c.objs, + }) + + return size +} + +func (c *ObjectSessionContext) Unmarshal(data []byte) error { + return message.Unmarshal(c, data, new(session.ObjectSessionContext)) +} + +const ( + _ = iota + cnrCtxVerbFNum + cnrCtxWildcardFNum + cnrCtxCidFNum +) + +func (x *ContainerSessionContext) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, x.StableSize()) + } + + var offset int + + offset += proto.EnumMarshal(cnrCtxVerbFNum, buf[offset:], int32(ContainerSessionVerbToGRPCField(x.verb))) + offset += proto.BoolMarshal(cnrCtxWildcardFNum, buf[offset:], x.wildcard) + proto.NestedStructureMarshal(cnrCtxCidFNum, buf[offset:], x.cid) + + return buf +} + +func (x *ContainerSessionContext) StableSize() (size int) { + if x == nil { + return 0 + } + + size += proto.EnumSize(cnrCtxVerbFNum, int32(ContainerSessionVerbToGRPCField(x.verb))) + size += proto.BoolSize(cnrCtxWildcardFNum, x.wildcard) + size += proto.NestedStructureSize(cnrCtxCidFNum, x.cid) + + return size +} + +func (x *ContainerSessionContext) Unmarshal(data []byte) error { + return message.Unmarshal(x, data, new(session.ContainerSessionContext)) +} + +func (t *TokenBody) StableMarshal(buf []byte) []byte { + if t == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, t.StableSize()) + } + + var offset int + + offset += proto.BytesMarshal(sessionTokenBodyIDField, buf[offset:], t.id) + offset += proto.NestedStructureMarshal(sessionTokenBodyOwnerField, buf[offset:], t.ownerID) + offset += proto.NestedStructureMarshal(sessionTokenBodyLifetimeField, buf[offset:], t.lifetime) + offset += proto.BytesMarshal(sessionTokenBodyKeyField, buf[offset:], t.sessionKey) + + if t.ctx != nil { + switch v := t.ctx.(type) { + case *ObjectSessionContext: + proto.NestedStructureMarshal(sessionTokenBodyObjectCtxField, buf[offset:], v) + case *ContainerSessionContext: + proto.NestedStructureMarshal(sessionTokenBodyCnrCtxField, buf[offset:], v) + default: + panic("cannot marshal unknown session token context") + } + } + + return buf +} + +func (t *TokenBody) StableSize() (size int) { + if t == nil { + return 0 + } + + size += proto.BytesSize(sessionTokenBodyIDField, t.id) + size += proto.NestedStructureSize(sessionTokenBodyOwnerField, t.ownerID) + size += proto.NestedStructureSize(sessionTokenBodyLifetimeField, t.lifetime) + size += proto.BytesSize(sessionTokenBodyKeyField, t.sessionKey) + + if t.ctx != nil { + switch v := t.ctx.(type) { + case *ObjectSessionContext: + size += proto.NestedStructureSize(sessionTokenBodyObjectCtxField, v) + case *ContainerSessionContext: + size += proto.NestedStructureSize(sessionTokenBodyCnrCtxField, v) + default: + panic("cannot marshal unknown session token context") + } + } + + return size +} + +func (t *TokenBody) Unmarshal(data []byte) error { + return message.Unmarshal(t, data, new(session.SessionToken_Body)) +} + +func (t *Token) StableMarshal(buf []byte) []byte { + if t == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, t.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(sessionTokenBodyField, buf[offset:], t.body) + proto.NestedStructureMarshal(sessionTokenSignatureField, buf[offset:], t.sig) + + return buf +} + +func (t *Token) StableSize() (size int) { + if t == nil { + return 0 + } + + size += proto.NestedStructureSize(sessionTokenBodyField, t.body) + size += proto.NestedStructureSize(sessionTokenSignatureField, t.sig) + + return size +} + +func (t *Token) Unmarshal(data []byte) error { + return message.Unmarshal(t, data, new(session.SessionToken)) +} + +func (r *RequestMetaHeader) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(reqMetaHeaderVersionField, buf[offset:], r.version) + offset += proto.UInt64Marshal(reqMetaHeaderEpochField, buf[offset:], r.epoch) + offset += proto.UInt32Marshal(reqMetaHeaderTTLField, buf[offset:], r.ttl) + + for i := range r.xHeaders { + offset += proto.NestedStructureMarshal(reqMetaHeaderXHeadersField, buf[offset:], &r.xHeaders[i]) + } + + offset += proto.NestedStructureMarshal(reqMetaHeaderSessionTokenField, buf[offset:], r.sessionToken) + offset += proto.NestedStructureMarshal(reqMetaHeaderBearerTokenField, buf[offset:], r.bearerToken) + offset += proto.NestedStructureMarshal(reqMetaHeaderOriginField, buf[offset:], r.origin) + proto.UInt64Marshal(reqMetaHeaderNetMagicField, buf[offset:], r.netMagic) + + return buf +} + +func (r *RequestMetaHeader) StableSize() (size int) { + if r == nil { + return 0 + } + + if r.version != nil { + size += proto.NestedStructureSize(reqMetaHeaderVersionField, r.version) + } + + size += proto.UInt64Size(reqMetaHeaderEpochField, r.epoch) + size += proto.UInt32Size(reqMetaHeaderTTLField, r.ttl) + + for i := range r.xHeaders { + size += proto.NestedStructureSize(reqMetaHeaderXHeadersField, &r.xHeaders[i]) + } + + size += proto.NestedStructureSize(reqMetaHeaderSessionTokenField, r.sessionToken) + size += proto.NestedStructureSize(reqMetaHeaderBearerTokenField, r.bearerToken) + size += proto.NestedStructureSize(reqMetaHeaderOriginField, r.origin) + size += proto.UInt64Size(reqMetaHeaderNetMagicField, r.netMagic) + + return size +} + +func (r *RequestMetaHeader) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(session.RequestMetaHeader)) +} + +func (r *RequestVerificationHeader) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(reqVerifHeaderBodySignatureField, buf[offset:], r.bodySig) + offset += proto.NestedStructureMarshal(reqVerifHeaderMetaSignatureField, buf[offset:], r.metaSig) + offset += proto.NestedStructureMarshal(reqVerifHeaderOriginSignatureField, buf[offset:], r.originSig) + proto.NestedStructureMarshal(reqVerifHeaderOriginField, buf[offset:], r.origin) + + return buf +} + +func (r *RequestVerificationHeader) StableSize() (size int) { + if r == nil { + return 0 + } + + size += proto.NestedStructureSize(reqVerifHeaderBodySignatureField, r.bodySig) + size += proto.NestedStructureSize(reqVerifHeaderMetaSignatureField, r.metaSig) + size += proto.NestedStructureSize(reqVerifHeaderOriginSignatureField, r.originSig) + size += proto.NestedStructureSize(reqVerifHeaderOriginField, r.origin) + + return size +} + +func (r *RequestVerificationHeader) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(session.RequestVerificationHeader)) +} + +func (r *ResponseMetaHeader) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(respMetaHeaderVersionField, buf[offset:], r.version) + offset += proto.UInt64Marshal(respMetaHeaderEpochField, buf[offset:], r.epoch) + offset += proto.UInt32Marshal(respMetaHeaderTTLField, buf[offset:], r.ttl) + + for i := range r.xHeaders { + offset += proto.NestedStructureMarshal(respMetaHeaderXHeadersField, buf[offset:], &r.xHeaders[i]) + } + + offset += proto.NestedStructureMarshal(respMetaHeaderOriginField, buf[offset:], r.origin) + proto.NestedStructureMarshal(respMetaHeaderStatusField, buf[offset:], r.status) + + return buf +} + +func (r *ResponseMetaHeader) StableSize() (size int) { + if r == nil { + return 0 + } + + if r.version != nil { + size += proto.NestedStructureSize(respMetaHeaderVersionField, r.version) + } + + size += proto.UInt64Size(respMetaHeaderEpochField, r.epoch) + size += proto.UInt32Size(respMetaHeaderTTLField, r.ttl) + + for i := range r.xHeaders { + size += proto.NestedStructureSize(respMetaHeaderXHeadersField, &r.xHeaders[i]) + } + + size += proto.NestedStructureSize(respMetaHeaderOriginField, r.origin) + size += proto.NestedStructureSize(respMetaHeaderStatusField, r.status) + + return size +} + +func (r *ResponseMetaHeader) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(session.ResponseMetaHeader)) +} + +func (r *ResponseVerificationHeader) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(respVerifHeaderBodySignatureField, buf[offset:], r.bodySig) + offset += proto.NestedStructureMarshal(respVerifHeaderMetaSignatureField, buf[offset:], r.metaSig) + offset += proto.NestedStructureMarshal(respVerifHeaderOriginSignatureField, buf[offset:], r.originSig) + proto.NestedStructureMarshal(respVerifHeaderOriginField, buf[offset:], r.origin) + + return buf +} + +func (r *ResponseVerificationHeader) StableSize() (size int) { + if r == nil { + return 0 + } + + size += proto.NestedStructureSize(respVerifHeaderBodySignatureField, r.bodySig) + size += proto.NestedStructureSize(respVerifHeaderMetaSignatureField, r.metaSig) + size += proto.NestedStructureSize(respVerifHeaderOriginSignatureField, r.originSig) + size += proto.NestedStructureSize(respVerifHeaderOriginField, r.origin) + + return size +} + +func (r *ResponseVerificationHeader) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(session.ResponseVerificationHeader)) +} diff --git a/api/session/message_test.go b/api/session/message_test.go new file mode 100644 index 0000000..7e5844a --- /dev/null +++ b/api/session/message_test.go @@ -0,0 +1,27 @@ +package session_test + +import ( + "testing" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + rpctest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message/test" + sessiontest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/test" +) + +func TestMessageConvert(t *testing.T) { + rpctest.TestRPCMessage(t, + func(empty bool) message.Message { return sessiontest.GenerateCreateRequestBody(empty) }, + func(empty bool) message.Message { return sessiontest.GenerateCreateRequest(empty) }, + func(empty bool) message.Message { return sessiontest.GenerateCreateResponseBody(empty) }, + func(empty bool) message.Message { return sessiontest.GenerateCreateResponse(empty) }, + func(empty bool) message.Message { return sessiontest.GenerateTokenLifetime(empty) }, + func(empty bool) message.Message { return sessiontest.GenerateXHeader(empty) }, + func(empty bool) message.Message { return sessiontest.GenerateSessionTokenBody(empty) }, + func(empty bool) message.Message { return sessiontest.GenerateSessionToken(empty) }, + func(empty bool) message.Message { return sessiontest.GenerateRequestMetaHeader(empty) }, + func(empty bool) message.Message { return sessiontest.GenerateRequestVerificationHeader(empty) }, + func(empty bool) message.Message { return sessiontest.GenerateResponseMetaHeader(empty) }, + func(empty bool) message.Message { return sessiontest.GenerateResponseVerificationHeader(empty) }, + func(empty bool) message.Message { return sessiontest.GenerateContainerSessionContext(empty) }, + ) +} diff --git a/api/session/status.go b/api/session/status.go new file mode 100644 index 0000000..229a459 --- /dev/null +++ b/api/session/status.go @@ -0,0 +1,32 @@ +package session + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status" + statusgrpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status/grpc" +) + +// LocalizeFailStatus checks if passed global status.Code is related to session failure and: +// +// then localizes the code and returns true, +// else leaves the code unchanged and returns false. +// +// Arg must not be nil. +func LocalizeFailStatus(c *status.Code) bool { + return status.LocalizeIfInSection(c, uint32(statusgrpc.Section_SECTION_SESSION)) +} + +// GlobalizeFail globalizes local code of session failure. +// +// Arg must not be nil. +func GlobalizeFail(c *status.Code) { + c.GlobalizeSection(uint32(statusgrpc.Section_SECTION_SESSION)) +} + +const ( + // StatusTokenNotFound is a local status.Code value for + // TOKEN_NOT_FOUND session failure. + StatusTokenNotFound status.Code = iota + // StatusTokenExpired is a local status.Code value for + // TOKEN_EXPIRED session failure. + StatusTokenExpired +) diff --git a/api/session/status_test.go b/api/session/status_test.go new file mode 100644 index 0000000..c984e6f --- /dev/null +++ b/api/session/status_test.go @@ -0,0 +1,15 @@ +package session_test + +import ( + "testing" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + statustest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status/test" +) + +func TestStatusCodes(t *testing.T) { + statustest.TestCodes(t, session.LocalizeFailStatus, session.GlobalizeFail, + session.StatusTokenNotFound, 4096, + session.StatusTokenExpired, 4097, + ) +} diff --git a/api/session/string.go b/api/session/string.go new file mode 100644 index 0000000..fd2d425 --- /dev/null +++ b/api/session/string.go @@ -0,0 +1,47 @@ +package session + +import ( + session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" +) + +// String returns string representation of ObjectSessionVerb. +func (x ObjectSessionVerb) String() string { + return ObjectSessionVerbToGRPCField(x).String() +} + +// FromString parses ObjectSessionVerb from a string representation. +// It is a reverse action to String(). +// +// Returns true if s was parsed successfully. +func (x *ObjectSessionVerb) FromString(s string) bool { + var g session.ObjectSessionContext_Verb + + ok := g.FromString(s) + + if ok { + *x = ObjectSessionVerbFromGRPCField(g) + } + + return ok +} + +// String returns string representation of ContainerSessionVerb. +func (x ContainerSessionVerb) String() string { + return ContainerSessionVerbToGRPCField(x).String() +} + +// FromString parses ContainerSessionVerb from a string representation. +// It is a reverse action to String(). +// +// Returns true if s was parsed successfully. +func (x *ContainerSessionVerb) FromString(s string) bool { + var g session.ContainerSessionContext_Verb + + ok := g.FromString(s) + + if ok { + *x = ContainerSessionVerbFromGRPCField(g) + } + + return ok +} diff --git a/api/session/test/generate.go b/api/session/test/generate.go new file mode 100644 index 0000000..b35fe07 --- /dev/null +++ b/api/session/test/generate.go @@ -0,0 +1,251 @@ +package sessiontest + +import ( + crand "crypto/rand" + "math/rand" + "time" + + acltest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl/test" + refstest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/test" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + statustest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status/test" +) + +func GenerateCreateRequestBody(empty bool) *session.CreateRequestBody { + m := new(session.CreateRequestBody) + + if !empty { + m.SetExpiration(555) + m.SetOwnerID(refstest.GenerateOwnerID(false)) + } + + return m +} + +func GenerateCreateRequest(empty bool) *session.CreateRequest { + m := new(session.CreateRequest) + + if !empty { + m.SetBody(GenerateCreateRequestBody(false)) + } + + m.SetMetaHeader(GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(GenerateRequestVerificationHeader(empty)) + + return m +} + +func GenerateCreateResponseBody(empty bool) *session.CreateResponseBody { + m := new(session.CreateResponseBody) + + if !empty { + id := make([]byte, 16) + _, _ = crand.Read(id) + + m.SetID(id) + m.SetSessionKey([]byte{4, 5, 6}) + } + + return m +} + +func GenerateCreateResponse(empty bool) *session.CreateResponse { + m := new(session.CreateResponse) + + if !empty { + m.SetBody(GenerateCreateResponseBody(false)) + } + + m.SetMetaHeader(GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(GenerateResponseVerificationHeader(empty)) + + return m +} + +func GenerateResponseVerificationHeader(empty bool) *session.ResponseVerificationHeader { + return generateResponseVerificationHeader(empty, true) +} + +func generateResponseVerificationHeader(empty, withOrigin bool) *session.ResponseVerificationHeader { + m := new(session.ResponseVerificationHeader) + + if !empty { + m.SetBodySignature(refstest.GenerateSignature(false)) + } + + m.SetMetaSignature(refstest.GenerateSignature(empty)) + m.SetOriginSignature(refstest.GenerateSignature(empty)) + + if withOrigin { + m.SetOrigin(generateResponseVerificationHeader(empty, false)) + } + + return m +} + +func GenerateResponseMetaHeader(empty bool) *session.ResponseMetaHeader { + return generateResponseMetaHeader(empty, true) +} + +func generateResponseMetaHeader(empty, withOrigin bool) *session.ResponseMetaHeader { + m := new(session.ResponseMetaHeader) + + if !empty { + m.SetEpoch(13) + m.SetTTL(100) + } + + m.SetXHeaders(GenerateXHeaders(empty)) + m.SetVersion(refstest.GenerateVersion(empty)) + m.SetStatus(statustest.Status(empty)) + + if withOrigin { + m.SetOrigin(generateResponseMetaHeader(empty, false)) + } + + return m +} + +func GenerateRequestVerificationHeader(empty bool) *session.RequestVerificationHeader { + return generateRequestVerificationHeader(empty, true) +} + +func generateRequestVerificationHeader(empty, withOrigin bool) *session.RequestVerificationHeader { + m := new(session.RequestVerificationHeader) + + if !empty { + m.SetBodySignature(refstest.GenerateSignature(false)) + } + + m.SetMetaSignature(refstest.GenerateSignature(empty)) + m.SetOriginSignature(refstest.GenerateSignature(empty)) + + if withOrigin { + m.SetOrigin(generateRequestVerificationHeader(empty, false)) + } + + return m +} + +func GenerateRequestMetaHeader(empty bool) *session.RequestMetaHeader { + return generateRequestMetaHeader(empty, true) +} + +func generateRequestMetaHeader(empty, withOrigin bool) *session.RequestMetaHeader { + m := new(session.RequestMetaHeader) + + if !empty { + m.SetEpoch(13) + m.SetTTL(100) + m.SetNetworkMagic(1337) + } + + m.SetXHeaders(GenerateXHeaders(empty)) + m.SetVersion(refstest.GenerateVersion(empty)) + m.SetSessionToken(GenerateSessionToken(empty)) + m.SetBearerToken(acltest.GenerateBearerToken(empty)) + + if withOrigin { + m.SetOrigin(generateRequestMetaHeader(empty, false)) + } + + return m +} + +func GenerateSessionToken(empty bool) *session.Token { + m := new(session.Token) + + if !empty { + m.SetBody(GenerateSessionTokenBody(false)) + } + + m.SetSignature(refstest.GenerateSignature(empty)) + + return m +} + +func GenerateSessionTokenBody(empty bool) *session.TokenBody { + m := new(session.TokenBody) + + if !empty { + id := make([]byte, 16) + _, _ = crand.Read(id) + + m.SetID(id) + m.SetSessionKey([]byte{2}) + m.SetOwnerID(refstest.GenerateOwnerID(false)) + m.SetLifetime(GenerateTokenLifetime(false)) + + switch randomInt(2) { + case 0: + m.SetContext(GenerateObjectSessionContext(false)) + case 1: + m.SetContext(GenerateContainerSessionContext(false)) + } + } + + return m +} + +func GenerateTokenLifetime(empty bool) *session.TokenLifetime { + m := new(session.TokenLifetime) + + if !empty { + m.SetExp(1) + m.SetIat(2) + m.SetExp(3) + } + + return m +} + +func GenerateObjectSessionContext(empty bool) *session.ObjectSessionContext { + m := new(session.ObjectSessionContext) + + if !empty { + m.SetVerb(session.ObjectVerbHead) + m.SetTarget(refstest.GenerateContainerID(false), refstest.GenerateObjectIDs(false)...) + } + + return m +} + +func GenerateContainerSessionContext(empty bool) *session.ContainerSessionContext { + m := new(session.ContainerSessionContext) + + if !empty { + m.SetVerb(session.ContainerVerbDelete) + m.SetWildcard(true) + m.SetContainerID(refstest.GenerateContainerID(false)) + } + + return m +} + +func GenerateXHeader(empty bool) *session.XHeader { + m := new(session.XHeader) + + if !empty { + m.SetKey("key") + m.SetValue("val") + } + + return m +} + +func GenerateXHeaders(empty bool) []session.XHeader { + var xs []session.XHeader + + if !empty { + xs = append(xs, + *GenerateXHeader(false), + *GenerateXHeader(false), + ) + } + + return xs +} + +func randomInt(n int) int { + return rand.New(rand.NewSource(time.Now().UnixNano())).Intn(n) +} diff --git a/api/session/types.go b/api/session/types.go new file mode 100644 index 0000000..838024f --- /dev/null +++ b/api/session/types.go @@ -0,0 +1,836 @@ +package session + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" +) + +type CreateRequestBody struct { + ownerID *refs.OwnerID + + expiration uint64 +} + +type CreateRequest struct { + body *CreateRequestBody + + RequestHeaders +} + +type CreateResponseBody struct { + id []byte + + sessionKey []byte +} + +type CreateResponse struct { + body *CreateResponseBody + + ResponseHeaders +} + +type XHeader struct { + key, val string +} + +type TokenLifetime struct { + exp, nbf, iat uint64 +} + +type ObjectSessionVerb uint32 + +type objectSessionContextTarget struct { + cnr *refs.ContainerID + + objs []refs.ObjectID +} + +const ( + _ = iota + fNumObjectTargetContainer + fNumObjectTargetObjects +) + +func (x objectSessionContextTarget) StableMarshal(buf []byte) []byte { + if buf == nil { + buf = make([]byte, x.StableSize()) + } + + offset := proto.NestedStructureMarshal(fNumObjectTargetContainer, buf, x.cnr) + + for i := range x.objs { + offset += proto.NestedStructureMarshal(fNumObjectTargetObjects, buf[offset:], &x.objs[i]) + } + + return buf +} + +func (x objectSessionContextTarget) StableSize() (size int) { + size += proto.NestedStructureSize(fNumObjectTargetContainer, x.cnr) + + for i := range x.objs { + size += proto.NestedStructureSize(fNumObjectTargetObjects, &x.objs[i]) + } + + return size +} + +type ObjectSessionContext struct { + verb ObjectSessionVerb + + cnr *refs.ContainerID + + objs []refs.ObjectID +} + +type TokenContext interface { + sessionTokenContext() +} + +// Deprecated: use TokenContext instead. +// +//nolint:revive +type SessionTokenContext = TokenContext + +type TokenBody struct { + id []byte + + ownerID *refs.OwnerID + + lifetime *TokenLifetime + + sessionKey []byte + + ctx TokenContext +} + +// Deprecated: use TokenBody instead. +// +//nolint:revive +type SessionTokenBody = TokenBody + +type Token struct { + body *TokenBody + + sig *refs.Signature +} + +// Deprecated: use Token instead. +// +//nolint:revive +type SessionToken = Token + +type RequestVerificationHeader struct { + bodySig, metaSig, originSig *refs.Signature + + origin *RequestVerificationHeader +} + +type RequestMetaHeader struct { + version *refs.Version + + ttl uint32 + + epoch uint64 + + xHeaders []XHeader + + sessionToken *Token + + bearerToken *acl.BearerToken + + origin *RequestMetaHeader + + netMagic uint64 +} + +type ResponseVerificationHeader struct { + bodySig, metaSig, originSig *refs.Signature + + origin *ResponseVerificationHeader +} + +type ResponseMetaHeader struct { + version *refs.Version + + ttl uint32 + + epoch uint64 + + xHeaders []XHeader + + origin *ResponseMetaHeader + + status *status.Status +} + +const ( + ObjectVerbUnknown ObjectSessionVerb = iota + ObjectVerbPut + ObjectVerbGet + ObjectVerbHead + ObjectVerbSearch + ObjectVerbDelete + ObjectVerbRange + ObjectVerbRangeHash + ObjectVerbPatch +) + +func (c *CreateRequestBody) GetOwnerID() *refs.OwnerID { + if c != nil { + return c.ownerID + } + + return nil +} + +func (c *CreateRequestBody) SetOwnerID(v *refs.OwnerID) { + c.ownerID = v +} + +func (c *CreateRequestBody) GetExpiration() uint64 { + if c != nil { + return c.expiration + } + + return 0 +} + +func (c *CreateRequestBody) SetExpiration(v uint64) { + c.expiration = v +} + +func (c *CreateRequest) GetBody() *CreateRequestBody { + if c != nil { + return c.body + } + + return nil +} + +func (c *CreateRequest) SetBody(v *CreateRequestBody) { + c.body = v +} + +func (c *CreateRequest) GetMetaHeader() *RequestMetaHeader { + if c != nil { + return c.metaHeader + } + + return nil +} + +func (c *CreateRequest) SetMetaHeader(v *RequestMetaHeader) { + c.metaHeader = v +} + +func (c *CreateRequest) GetVerificationHeader() *RequestVerificationHeader { + if c != nil { + return c.verifyHeader + } + + return nil +} + +func (c *CreateRequest) SetVerificationHeader(v *RequestVerificationHeader) { + c.verifyHeader = v +} + +func (c *CreateResponseBody) GetID() []byte { + if c != nil { + return c.id + } + + return nil +} + +func (c *CreateResponseBody) SetID(v []byte) { + c.id = v +} + +func (c *CreateResponseBody) GetSessionKey() []byte { + if c != nil { + return c.sessionKey + } + + return nil +} + +func (c *CreateResponseBody) SetSessionKey(v []byte) { + c.sessionKey = v +} + +func (c *CreateResponse) GetBody() *CreateResponseBody { + if c != nil { + return c.body + } + + return nil +} + +func (c *CreateResponse) SetBody(v *CreateResponseBody) { + c.body = v +} + +func (c *CreateResponse) GetMetaHeader() *ResponseMetaHeader { + if c != nil { + return c.metaHeader + } + + return nil +} + +func (c *CreateResponse) SetMetaHeader(v *ResponseMetaHeader) { + c.metaHeader = v +} + +func (c *CreateResponse) GetVerificationHeader() *ResponseVerificationHeader { + if c != nil { + return c.verifyHeader + } + + return nil +} + +func (c *CreateResponse) SetVerificationHeader(v *ResponseVerificationHeader) { + c.verifyHeader = v +} + +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.val + } + + return "" +} + +func (x *XHeader) SetValue(v string) { + x.val = v +} + +func (r *RequestVerificationHeader) GetBodySignature() *refs.Signature { + if r != nil { + return r.bodySig + } + + return nil +} + +func (r *RequestVerificationHeader) SetBodySignature(v *refs.Signature) { + r.bodySig = v +} + +func (r *RequestVerificationHeader) GetMetaSignature() *refs.Signature { + if r != nil { + return r.metaSig + } + + return nil +} + +func (r *RequestVerificationHeader) SetMetaSignature(v *refs.Signature) { + r.metaSig = v +} + +func (r *RequestVerificationHeader) GetOriginSignature() *refs.Signature { + if r != nil { + return r.originSig + } + + return nil +} + +func (r *RequestVerificationHeader) SetOriginSignature(v *refs.Signature) { + r.originSig = v +} + +func (r *RequestVerificationHeader) GetOrigin() *RequestVerificationHeader { + if r != nil { + return r.origin + } + + return nil +} + +func (r *RequestVerificationHeader) SetOrigin(v *RequestVerificationHeader) { + r.origin = v +} + +func (r *RequestMetaHeader) GetVersion() *refs.Version { + if r != nil { + return r.version + } + + return nil +} + +func (r *RequestMetaHeader) SetVersion(v *refs.Version) { + r.version = v +} + +func (r *RequestMetaHeader) GetTTL() uint32 { + if r != nil { + return r.ttl + } + + return 0 +} + +func (r *RequestMetaHeader) SetTTL(v uint32) { + r.ttl = v +} + +func (r *RequestMetaHeader) GetEpoch() uint64 { + if r != nil { + return r.epoch + } + + return 0 +} + +func (r *RequestMetaHeader) SetEpoch(v uint64) { + r.epoch = v +} + +func (r *RequestMetaHeader) GetXHeaders() []XHeader { + if r != nil { + return r.xHeaders + } + + return nil +} + +func (r *RequestMetaHeader) SetXHeaders(v []XHeader) { + r.xHeaders = v +} + +func (r *RequestMetaHeader) GetSessionToken() *Token { + if r != nil { + return r.sessionToken + } + + return nil +} + +func (r *RequestMetaHeader) SetSessionToken(v *Token) { + r.sessionToken = v +} + +func (r *RequestMetaHeader) GetBearerToken() *acl.BearerToken { + if r != nil { + return r.bearerToken + } + + return nil +} + +func (r *RequestMetaHeader) SetBearerToken(v *acl.BearerToken) { + r.bearerToken = v +} + +func (r *RequestMetaHeader) GetOrigin() *RequestMetaHeader { + if r != nil { + return r.origin + } + + return nil +} + +func (r *RequestMetaHeader) SetOrigin(v *RequestMetaHeader) { + r.origin = v +} + +// GetNetworkMagic returns NeoFS network magic. +func (r *RequestMetaHeader) GetNetworkMagic() uint64 { + if r != nil { + return r.netMagic + } + + return 0 +} + +// SetNetworkMagic sets NeoFS network magic. +func (r *RequestMetaHeader) SetNetworkMagic(v uint64) { + r.netMagic = v +} + +func (l *TokenLifetime) GetExp() uint64 { + if l != nil { + return l.exp + } + + return 0 +} + +func (l *TokenLifetime) SetExp(v uint64) { + l.exp = v +} + +func (l *TokenLifetime) GetNbf() uint64 { + if l != nil { + return l.nbf + } + + return 0 +} + +func (l *TokenLifetime) SetNbf(v uint64) { + l.nbf = v +} + +func (l *TokenLifetime) GetIat() uint64 { + if l != nil { + return l.iat + } + + return 0 +} + +func (l *TokenLifetime) SetIat(v uint64) { + l.iat = v +} + +func (r *ResponseVerificationHeader) GetBodySignature() *refs.Signature { + if r != nil { + return r.bodySig + } + + return nil +} + +func (r *ResponseVerificationHeader) SetBodySignature(v *refs.Signature) { + r.bodySig = v +} + +func (r *ResponseVerificationHeader) GetMetaSignature() *refs.Signature { + if r != nil { + return r.metaSig + } + + return nil +} + +func (r *ResponseVerificationHeader) SetMetaSignature(v *refs.Signature) { + r.metaSig = v +} + +func (r *ResponseVerificationHeader) GetOriginSignature() *refs.Signature { + if r != nil { + return r.originSig + } + + return nil +} + +func (r *ResponseVerificationHeader) SetOriginSignature(v *refs.Signature) { + r.originSig = v +} + +func (r *ResponseVerificationHeader) GetOrigin() *ResponseVerificationHeader { + if r != nil { + return r.origin + } + + return nil +} + +func (r *ResponseVerificationHeader) SetOrigin(v *ResponseVerificationHeader) { + r.origin = v +} + +func (r *ResponseMetaHeader) GetVersion() *refs.Version { + if r != nil { + return r.version + } + + return nil +} + +func (r *ResponseMetaHeader) SetVersion(v *refs.Version) { + r.version = v +} + +func (r *ResponseMetaHeader) GetTTL() uint32 { + if r != nil { + return r.ttl + } + + return 0 +} + +func (r *ResponseMetaHeader) SetTTL(v uint32) { + r.ttl = v +} + +func (r *ResponseMetaHeader) GetEpoch() uint64 { + if r != nil { + return r.epoch + } + + return 0 +} + +func (r *ResponseMetaHeader) SetEpoch(v uint64) { + r.epoch = v +} + +func (r *ResponseMetaHeader) GetXHeaders() []XHeader { + if r != nil { + return r.xHeaders + } + + return nil +} + +func (r *ResponseMetaHeader) SetXHeaders(v []XHeader) { + r.xHeaders = v +} + +func (r *ResponseMetaHeader) GetOrigin() *ResponseMetaHeader { + if r != nil { + return r.origin + } + + return nil +} + +func (r *ResponseMetaHeader) SetOrigin(v *ResponseMetaHeader) { + r.origin = v +} + +// GetStatus returns response status. +func (r *ResponseMetaHeader) GetStatus() *status.Status { + if r != nil { + return r.status + } + + return nil +} + +// SetStatus sets response status. +func (r *ResponseMetaHeader) SetStatus(v *status.Status) { + r.status = v +} + +// SetStatus sets status of the message which can carry ResponseMetaHeader. +// +// Sets status field on the "highest" level of meta headers. +// If meta header is missing in message, it is allocated. +func SetStatus(msg interface { + GetMetaHeader() *ResponseMetaHeader + SetMetaHeader(*ResponseMetaHeader) +}, st *status.Status, +) { + meta := msg.GetMetaHeader() + if meta == nil { + meta = new(ResponseMetaHeader) + msg.SetMetaHeader(meta) + } + + meta.SetStatus(st) +} + +func (c *ObjectSessionContext) sessionTokenContext() {} + +func (c *ObjectSessionContext) GetVerb() ObjectSessionVerb { + if c != nil { + return c.verb + } + + return ObjectVerbUnknown +} + +func (c *ObjectSessionContext) SetVerb(v ObjectSessionVerb) { + c.verb = v +} + +func (c *ObjectSessionContext) GetContainer() *refs.ContainerID { + if c != nil { + return c.cnr + } + + return nil +} + +func (c *ObjectSessionContext) GetObjects() []refs.ObjectID { + if c != nil { + return c.objs + } + + return nil +} + +func (c *ObjectSessionContext) SetTarget(cnr *refs.ContainerID, objs ...refs.ObjectID) { + c.cnr = cnr + c.objs = objs +} + +func (t *TokenBody) GetID() []byte { + if t != nil { + return t.id + } + + return nil +} + +func (t *TokenBody) SetID(v []byte) { + t.id = v +} + +func (t *TokenBody) GetOwnerID() *refs.OwnerID { + if t != nil { + return t.ownerID + } + + return nil +} + +func (t *TokenBody) SetOwnerID(v *refs.OwnerID) { + t.ownerID = v +} + +func (t *TokenBody) GetLifetime() *TokenLifetime { + if t != nil { + return t.lifetime + } + + return nil +} + +func (t *TokenBody) SetLifetime(v *TokenLifetime) { + t.lifetime = v +} + +func (t *TokenBody) GetSessionKey() []byte { + if t != nil { + return t.sessionKey + } + + return nil +} + +func (t *TokenBody) SetSessionKey(v []byte) { + t.sessionKey = v +} + +func (t *TokenBody) GetContext() TokenContext { + if t != nil { + return t.ctx + } + + return nil +} + +func (t *TokenBody) SetContext(v TokenContext) { + t.ctx = v +} + +func (t *Token) GetBody() *TokenBody { + if t != nil { + return t.body + } + + return nil +} + +func (t *Token) SetBody(v *TokenBody) { + t.body = v +} + +func (t *Token) GetSignature() *refs.Signature { + if t != nil { + return t.sig + } + + return nil +} + +func (t *Token) SetSignature(v *refs.Signature) { + t.sig = v +} + +// ContainerSessionVerb represents NeoFS API v2 +// session.ContainerSessionContext.Verb enumeration. +type ContainerSessionVerb uint32 + +const ( + // ContainerVerbUnknown corresponds to VERB_UNSPECIFIED enum value. + ContainerVerbUnknown ContainerSessionVerb = iota + + // ContainerVerbPut corresponds to PUT enum value. + ContainerVerbPut + + // ContainerVerbDelete corresponds to DELETE enum value. + ContainerVerbDelete + + // ContainerVerbSetEACL corresponds to SETEACL enum value. + ContainerVerbSetEACL +) + +// ContainerSessionContext represents structure of the +// NeoFS API v2 session.ContainerSessionContext message. +type ContainerSessionContext struct { + verb ContainerSessionVerb + + wildcard bool + + cid *refs.ContainerID +} + +func (x *ContainerSessionContext) sessionTokenContext() {} + +// Verb returns type of request for which the token is issued. +func (x *ContainerSessionContext) Verb() ContainerSessionVerb { + if x != nil { + return x.verb + } + + return ContainerVerbUnknown +} + +// SetVerb sets type of request for which the token is issued. +func (x *ContainerSessionContext) SetVerb(v ContainerSessionVerb) { + x.verb = v +} + +// Wildcard returns wildcard flag of the container session. +func (x *ContainerSessionContext) Wildcard() bool { + if x != nil { + return x.wildcard + } + + return false +} + +// SetWildcard sets wildcard flag of the container session. +func (x *ContainerSessionContext) SetWildcard(v bool) { + x.wildcard = v +} + +// ContainerID returns identifier of the container related to the session. +func (x *ContainerSessionContext) ContainerID() *refs.ContainerID { + if x != nil { + return x.cid + } + + return nil +} + +// SetContainerID sets identifier of the container related to the session. +func (x *ContainerSessionContext) SetContainerID(v *refs.ContainerID) { + x.cid = v +} diff --git a/api/session/util.go b/api/session/util.go new file mode 100644 index 0000000..ea5aff0 --- /dev/null +++ b/api/session/util.go @@ -0,0 +1,167 @@ +package session + +import ( + session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" +) + +// RequestHeaders represents common part of +// all NeoFS requests including headers. +type RequestHeaders struct { + metaHeader *RequestMetaHeader + + verifyHeader *RequestVerificationHeader +} + +// GetMetaHeader returns meta header of the request. +func (c *RequestHeaders) GetMetaHeader() *RequestMetaHeader { + if c != nil { + return c.metaHeader + } + + return nil +} + +// SetMetaHeader sets meta header of the request. +func (c *RequestHeaders) SetMetaHeader(v *RequestMetaHeader) { + c.metaHeader = v +} + +// GetVerificationHeader returns verification header of the request. +func (c *RequestHeaders) GetVerificationHeader() *RequestVerificationHeader { + if c != nil { + return c.verifyHeader + } + + return nil +} + +// SetVerificationHeader sets verification header of the request. +func (c *RequestHeaders) SetVerificationHeader(v *RequestVerificationHeader) { + c.verifyHeader = v +} + +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)) +} + +func (c *RequestHeaders) FromMessage(m interface { + GetMetaHeader() *session.RequestMetaHeader + GetVerifyHeader() *session.RequestVerificationHeader +}, +) error { + metaHdr := m.GetMetaHeader() + if metaHdr == nil { + c.metaHeader = nil + } else { + if c.metaHeader == nil { + c.metaHeader = new(RequestMetaHeader) + } + + err := c.metaHeader.FromGRPCMessage(metaHdr) + if err != nil { + return err + } + } + + verifyHdr := m.GetVerifyHeader() + if verifyHdr == nil { + c.verifyHeader = nil + } else { + if c.verifyHeader == nil { + c.verifyHeader = new(RequestVerificationHeader) + } + + err := c.verifyHeader.FromGRPCMessage(verifyHdr) + if err != nil { + return err + } + } + + return nil +} + +// ResponseHeaders represents common part of +// all NeoFS responses including headers. +type ResponseHeaders struct { + metaHeader *ResponseMetaHeader + + verifyHeader *ResponseVerificationHeader +} + +// GetMetaHeader returns meta header of the response. +func (c *ResponseHeaders) GetMetaHeader() *ResponseMetaHeader { + if c != nil { + return c.metaHeader + } + + return nil +} + +// SetMetaHeader sets meta header of the response. +func (c *ResponseHeaders) SetMetaHeader(v *ResponseMetaHeader) { + c.metaHeader = v +} + +// GetVerificationHeader returns verification header of the response. +func (c *ResponseHeaders) GetVerificationHeader() *ResponseVerificationHeader { + if c != nil { + return c.verifyHeader + } + + return nil +} + +// SetVerificationHeader sets verification header of the response. +func (c *ResponseHeaders) SetVerificationHeader(v *ResponseVerificationHeader) { + c.verifyHeader = v +} + +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)) +} + +func (c *ResponseHeaders) FromMessage(m interface { + GetMetaHeader() *session.ResponseMetaHeader + GetVerifyHeader() *session.ResponseVerificationHeader +}, +) error { + metaHdr := m.GetMetaHeader() + if metaHdr == nil { + c.metaHeader = nil + } else { + if c.metaHeader == nil { + c.metaHeader = new(ResponseMetaHeader) + } + + err := c.metaHeader.FromGRPCMessage(metaHdr) + if err != nil { + return err + } + } + + verifyHdr := m.GetVerifyHeader() + if verifyHdr == nil { + c.verifyHeader = nil + } else { + if c.verifyHeader == nil { + c.verifyHeader = new(ResponseVerificationHeader) + } + + err := c.verifyHeader.FromGRPCMessage(verifyHdr) + if err != nil { + return err + } + } + + return nil +} diff --git a/api/session/xheaders.go b/api/session/xheaders.go new file mode 100644 index 0000000..c575d5f --- /dev/null +++ b/api/session/xheaders.go @@ -0,0 +1,34 @@ +package session + +// ReservedXHeaderPrefix is a prefix of keys to "well-known" X-headers. +const ReservedXHeaderPrefix = "__SYSTEM__" + +const ( + // XHeaderNetmapEpoch 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. + XHeaderNetmapEpoch = ReservedXHeaderPrefix + "NETMAP_EPOCH" + + // XHeaderNetmapLookupDepth 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. + XHeaderNetmapLookupDepth = ReservedXHeaderPrefix + "NETMAP_LOOKUP_DEPTH" +) + +// 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" +) diff --git a/api/signature/body.go b/api/signature/body.go new file mode 100644 index 0000000..50a09e9 --- /dev/null +++ b/api/signature/body.go @@ -0,0 +1,116 @@ +package signature + +import ( + "fmt" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/accounting" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/apemanager" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" +) + +// nolint:funlen +func serviceMessageBody(req any) 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() + + /* 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() + case *object.PutSingleRequest: + 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: + 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() + + /* 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/api/signature/marshaller.go b/api/signature/marshaller.go new file mode 100644 index 0000000..ff9beb3 --- /dev/null +++ b/api/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/api/signature/sign.go b/api/signature/sign.go new file mode 100644 index 0000000..04b8d36 --- /dev/null +++ b/api/signature/sign.go @@ -0,0 +1,122 @@ +package signature + +import ( + "crypto/ecdsa" + "fmt" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/signature" + "golang.org/x/sync/errgroup" +) + +type serviceRequest interface { + GetMetaHeader() *session.RequestMetaHeader + GetVerificationHeader() *session.RequestVerificationHeader + SetVerificationHeader(*session.RequestVerificationHeader) +} + +type serviceResponse interface { + GetMetaHeader() *session.ResponseMetaHeader + GetVerificationHeader() *session.ResponseVerificationHeader + SetVerificationHeader(*session.ResponseVerificationHeader) +} + +type signatureReceiver interface { + SetBodySignature(*refs.Signature) + SetMetaSignature(*refs.Signature) + SetOriginSignature(*refs.Signature) +} + +// SignServiceMessage signes service message with key. +func SignServiceMessage(key *ecdsa.PrivateKey, msg any) error { + switch v := msg.(type) { + case nil: + return nil + case serviceRequest: + return signServiceRequest(key, v) + case serviceResponse: + return signServiceResponse(key, v) + default: + panic(fmt.Sprintf("unsupported session message %T", v)) + } +} + +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 { + eg := &errgroup.Group{} + if !hasHeader { + // sign session message body + 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 + 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 + 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 { + var sig *refs.Signature + + wrapper := StableMarshalerWrapper{ + SM: part, + } + // sign part + if err := signature.SignDataWithHandler( + key, + wrapper, + func(s *refs.Signature) { + sig = s + }, + ); err != nil { + return err + } + + // write part signature + sigWrite(sig) + + return nil +} diff --git a/api/signature/sign_test.go b/api/signature/sign_test.go new file mode 100644 index 0000000..23779c4 --- /dev/null +++ b/api/signature/sign_test.go @@ -0,0 +1,125 @@ +package signature + +import ( + "testing" + + crypto "git.frostfs.info/TrueCloudLab/frostfs-crypto" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/accounting" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "github.com/stretchr/testify/require" +) + +func TestBalanceResponse(t *testing.T) { + dec := new(accounting.Decimal) + dec.SetValue(100) + + body := new(accounting.BalanceResponseBody) + body.SetBalance(dec) + + meta := new(session.ResponseMetaHeader) + meta.SetTTL(1) + + req := new(accounting.BalanceResponse) + req.SetBody(body) + req.SetMetaHeader(meta) + + // verify unsigned request + require.Error(t, VerifyServiceMessage(req)) + + key, err := crypto.LoadPrivateKey("Kwk6k2eC3L3QuPvD8aiaNyoSXgQ2YL1bwS5CP1oKoA9waeAze97s") + require.NoError(t, err) + + // sign request + require.NoError(t, SignServiceMessage(key, req)) + + // verification must pass + require.NoError(t, VerifyServiceMessage(req)) + + // add level to meta header matryoshka + meta = new(session.ResponseMetaHeader) + meta.SetOrigin(req.GetMetaHeader()) + req.SetMetaHeader(meta) + + // sign request + require.NoError(t, SignServiceMessage(key, req)) + + // verification must pass + require.NoError(t, VerifyServiceMessage(req)) + + // corrupt body + dec.SetValue(dec.GetValue() + 1) + + // verification must fail + require.Error(t, VerifyServiceMessage(req)) + + // restore body + dec.SetValue(dec.GetValue() - 1) + + // corrupt meta header + meta.SetTTL(meta.GetTTL() + 1) + + // verification must fail + require.Error(t, VerifyServiceMessage(req)) + + // restore meta header + meta.SetTTL(meta.GetTTL() - 1) + + // corrupt origin verification header + req.GetVerificationHeader().SetOrigin(nil) + + // verification must fail + require.Error(t, VerifyServiceMessage(req)) +} + +func BenchmarkSignRequest(b *testing.B) { + key, _ := crypto.LoadPrivateKey("Kwk6k2eC3L3QuPvD8aiaNyoSXgQ2YL1bwS5CP1oKoA9waeAze97s") + + b.ResetTimer() + b.ReportAllocs() + + for range b.N { + 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 range b.N { + 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) + } +} diff --git a/api/signature/verify.go b/api/signature/verify.go new file mode 100644 index 0000000..26dda83 --- /dev/null +++ b/api/signature/verify.go @@ -0,0 +1,127 @@ +package signature + +import ( + "errors" + "fmt" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/signature" + "golang.org/x/sync/errgroup" +) + +type signatureProvider interface { + GetBodySignature() *refs.Signature + GetMetaSignature() *refs.Signature + GetOriginSignature() *refs.Signature +} + +// VerifyServiceMessage verifies service message. +func VerifyServiceMessage(msg any) 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) + return verifyServiceRequestRecursive(body, meta, verificationHeader) +} + +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) + if err != nil { + return err + } + if stop { + return nil + } + + return verifyServiceRequestRecursive(body, metaOrigin, verificationHeaderOrigin) +} + +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); err != nil { + return fmt.Errorf("could not verify meta header: %w", err) + } + return nil + }) + + eg.Go(func() error { + if err := verifyServiceMessagePart(originHeader, sigProvider.GetOriginSignature); 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); err != nil { + return fmt.Errorf("could not verify body: %w", err) + } + return nil + }) + } + + if err := eg.Wait(); err != nil { + return false, err + } + + if !hasOriginHeader { + 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) + return verifyServiceResponseRecursive(body, meta, verificationHeader) +} + +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) + if err != nil { + return err + } + if stop { + return nil + } + + return verifyServiceResponseRecursive(body, metaOrigin, verificationHeaderOrigin) +} + +func verifyServiceMessagePart(part stableMarshaler, sigRdr func() *refs.Signature) error { + wrapper := StableMarshalerWrapper{ + SM: part, + } + + return signature.VerifyDataWithSource( + wrapper, + sigRdr, + ) +} diff --git a/api/status/convert.go b/api/status/convert.go new file mode 100644 index 0000000..2612c52 --- /dev/null +++ b/api/status/convert.go @@ -0,0 +1,95 @@ +package status + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + status "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status/grpc" +) + +func (x *Detail) ToGRPCMessage() grpc.Message { + var m *status.Status_Detail + + if x != nil { + m = new(status.Status_Detail) + + m.SetId(x.id) + m.SetValue(x.val) + } + + return m +} + +func (x *Detail) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*status.Status_Detail) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + x.id = v.GetId() + x.val = v.GetValue() + + return nil +} + +func CodeFromGRPC(v uint32) Code { + return Code(v) +} + +func CodeToGRPC(v Code) uint32 { + return uint32(v) +} + +func (x *Status) ToGRPCMessage() grpc.Message { + var m *status.Status + + if x != nil { + m = new(status.Status) + + m.SetCode(CodeToGRPC(x.code)) + m.SetMessage(x.msg) + + var ds []status.Status_Detail + + if ln := len(x.details); ln > 0 { + ds = make([]status.Status_Detail, 0, ln) + + for i := range ln { + ds = append(ds, *x.details[i].ToGRPCMessage().(*status.Status_Detail)) + } + } + + m.SetDetails(ds) + } + + return m +} + +func (x *Status) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*status.Status) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var ( + ds []Detail + dsV2 = v.GetDetails() + ) + + if dsV2 != nil { + ln := len(dsV2) + + ds = make([]Detail, ln) + + for i := range ln { + if err := ds[i].FromGRPCMessage(&dsV2[i]); err != nil { + return err + } + } + } + + x.details = ds + x.msg = v.GetMessage() + x.code = CodeFromGRPC(v.GetCode()) + + return nil +} diff --git a/api/status/details.go b/api/status/details.go new file mode 100644 index 0000000..5b8f460 --- /dev/null +++ b/api/status/details.go @@ -0,0 +1,8 @@ +package status + +// details for WrongMagicNumber code. +const ( + // DetailIDCorrectMagic is an identifier of details with correct network magic + // which can be attached to WrongMagicNumber code. + DetailIDCorrectMagic = iota +) diff --git a/api/status/grpc/types_frostfs.pb.go b/api/status/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..35dec11 --- /dev/null +++ b/api/status/grpc/types_frostfs.pb.go @@ -0,0 +1,694 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package status + +import ( + json "encoding/json" + fmt "fmt" + pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" +) + +type 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 + } + first := true + out.RawByte('{') + { + 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 = "\"value\":" + out.RawString(prefix) + if x.Value != nil { + out.Base64Bytes(x.Value) + } else { + out.String("") + } + } + 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 + 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": + { + var f []byte + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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.NestedStructureSizeUnchecked(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 { + 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, 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 + } + first := true + out.RawByte('{') + { + 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 = "\"message\":" + out.RawString(prefix) + out.String(x.Message) + } + { + 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('}') +} + +// 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 + 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": + { + 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 = 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/api/status/grpc/types_frostfs_fuzz.go b/api/status/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..ce9d84e --- /dev/null +++ b/api/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/api/status/grpc/types_frostfs_test.go b/api/status/grpc/types_frostfs_test.go new file mode 100644 index 0000000..dfc5631 --- /dev/null +++ b/api/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/api/status/marshal.go b/api/status/marshal.go new file mode 100644 index 0000000..663ead7 --- /dev/null +++ b/api/status/marshal.go @@ -0,0 +1,92 @@ +package status + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + status "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status/grpc" + protoutil "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" +) + +const ( + _ = iota + detailIDFNum + detailValueFNum +) + +func (x *Detail) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, x.StableSize()) + } + + var offset int + + offset += protoutil.UInt32Marshal(detailIDFNum, buf[offset:], x.id) + protoutil.BytesMarshal(detailValueFNum, buf[offset:], x.val) + + return buf +} + +func (x *Detail) StableSize() (size int) { + if x == nil { + return 0 + } + + size += protoutil.UInt32Size(detailIDFNum, x.id) + size += protoutil.BytesSize(detailValueFNum, x.val) + + return size +} + +func (x *Detail) Unmarshal(data []byte) error { + return message.Unmarshal(x, data, new(status.Status_Detail)) +} + +const ( + _ = iota + statusCodeFNum + statusMsgFNum + statusDetailsFNum +) + +func (x *Status) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, x.StableSize()) + } + + var offset int + + offset += protoutil.UInt32Marshal(statusCodeFNum, buf[offset:], CodeToGRPC(x.code)) + offset += protoutil.StringMarshal(statusMsgFNum, buf[offset:], x.msg) + + for i := range x.details { + offset += protoutil.NestedStructureMarshal(statusDetailsFNum, buf[offset:], &x.details[i]) + } + + return buf +} + +func (x *Status) StableSize() (size int) { + if x == nil { + return 0 + } + + size += protoutil.UInt32Size(statusCodeFNum, CodeToGRPC(x.code)) + size += protoutil.StringSize(statusMsgFNum, x.msg) + + for i := range x.details { + size += protoutil.NestedStructureSize(statusDetailsFNum, &x.details[i]) + } + + return size +} + +func (x *Status) Unmarshal(data []byte) error { + return message.Unmarshal(x, data, new(status.Status)) +} diff --git a/api/status/message_test.go b/api/status/message_test.go new file mode 100644 index 0000000..0185032 --- /dev/null +++ b/api/status/message_test.go @@ -0,0 +1,16 @@ +package status_test + +import ( + "testing" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message/test" + statustest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status/test" +) + +func TestMessageConvert(t *testing.T) { + messagetest.TestRPCMessage(t, + func(empty bool) message.Message { return statustest.Detail(empty) }, + func(empty bool) message.Message { return statustest.Status(empty) }, + ) +} diff --git a/api/status/status.go b/api/status/status.go new file mode 100644 index 0000000..53d361e --- /dev/null +++ b/api/status/status.go @@ -0,0 +1,103 @@ +package status + +const sectionBitSize = 10 + +// InSections checks if the Code is in [i,j] section list. +func (x Code) InSections(i, j uint32) bool { + return uint32(x) >= i< 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, 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 + } + first := true + 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 !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 !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"members\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Members { + if i != 0 { + out.RawByte(',') + } + x.Members[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *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 + 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": + { + var f []byte + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + x.SplitId = f + } + case "members": + { + var f grpc.ObjectID + var list []grpc.ObjectID + in.Delim('[') + for !in.IsDelim(']') { + f = grpc.ObjectID{} + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Members = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/api/tombstone/grpc/types_frostfs_fuzz.go b/api/tombstone/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..57cfb58 --- /dev/null +++ b/api/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/api/tombstone/grpc/types_frostfs_test.go b/api/tombstone/grpc/types_frostfs_test.go new file mode 100644 index 0000000..8264824 --- /dev/null +++ b/api/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/api/tombstone/json.go b/api/tombstone/json.go new file mode 100644 index 0000000..9b816fe --- /dev/null +++ b/api/tombstone/json.go @@ -0,0 +1,14 @@ +package tombstone + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + tombstone "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/tombstone/grpc" +) + +func (s *Tombstone) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(s) +} + +func (s *Tombstone) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(s, data, new(tombstone.Tombstone)) +} diff --git a/api/tombstone/marshal.go b/api/tombstone/marshal.go new file mode 100644 index 0000000..dda9469 --- /dev/null +++ b/api/tombstone/marshal.go @@ -0,0 +1,56 @@ +package tombstone + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + tombstone "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/tombstone/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" +) + +const ( + expFNum = 1 + splitIDFNum = 2 + membersFNum = 3 +) + +// StableMarshal marshals unified tombstone message in a protobuf +// compatible way without field order shuffle. +func (s *Tombstone) StableMarshal(buf []byte) []byte { + if s == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, s.StableSize()) + } + + var offset int + + offset += proto.UInt64Marshal(expFNum, buf[offset:], s.exp) + offset += proto.BytesMarshal(splitIDFNum, buf[offset:], s.splitID) + + for i := range s.members { + offset += proto.NestedStructureMarshal(membersFNum, buf[offset:], &s.members[i]) + } + + return buf +} + +// StableSize returns size of tombstone message marshalled by StableMarshal function. +func (s *Tombstone) StableSize() (size int) { + if s == nil { + return 0 + } + + size += proto.UInt64Size(expFNum, s.exp) + size += proto.BytesSize(splitIDFNum, s.splitID) + for i := range s.members { + size += proto.NestedStructureSize(membersFNum, &s.members[i]) + } + + return size +} + +// Unmarshal unmarshal tombstone message from its binary representation. +func (s *Tombstone) Unmarshal(data []byte) error { + return message.Unmarshal(s, data, new(tombstone.Tombstone)) +} diff --git a/api/tombstone/message_test.go b/api/tombstone/message_test.go new file mode 100644 index 0000000..dec17cc --- /dev/null +++ b/api/tombstone/message_test.go @@ -0,0 +1,15 @@ +package tombstone_test + +import ( + "testing" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message/test" + tombstonetest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/tombstone/test" +) + +func TestMessageConvert(t *testing.T) { + messagetest.TestRPCMessage(t, + func(empty bool) message.Message { return tombstonetest.GenerateTombstone(empty) }, + ) +} diff --git a/api/tombstone/test/generate.go b/api/tombstone/test/generate.go new file mode 100644 index 0000000..c71bd81 --- /dev/null +++ b/api/tombstone/test/generate.go @@ -0,0 +1,23 @@ +package tombstonetest + +import ( + "crypto/rand" + + refstest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/test" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/tombstone" +) + +func GenerateTombstone(empty bool) *tombstone.Tombstone { + m := new(tombstone.Tombstone) + + if !empty { + id := make([]byte, 16) + _, _ = rand.Read(id) + + m.SetExpirationEpoch(89) + m.SetSplitID(id) + m.SetMembers(refstest.GenerateObjectIDs(false)) + } + + return m +} diff --git a/api/tombstone/types.go b/api/tombstone/types.go new file mode 100644 index 0000000..f28c69d --- /dev/null +++ b/api/tombstone/types.go @@ -0,0 +1,57 @@ +package tombstone + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" +) + +// Tombstone is a unified structure of Tombstone +// message from proto definition. +type Tombstone struct { + exp uint64 + + splitID []byte + + members []refs.ObjectID +} + +// GetExpirationEpoch returns number of tombstone expiration epoch. +func (s *Tombstone) GetExpirationEpoch() uint64 { + if s != nil { + return s.exp + } + + return 0 +} + +// SetExpirationEpoch sets number of tombstone expiration epoch. +func (s *Tombstone) SetExpirationEpoch(v uint64) { + s.exp = v +} + +// GetSplitID returns identifier of split object hierarchy. +func (s *Tombstone) GetSplitID() []byte { + if s != nil { + return s.splitID + } + + return nil +} + +// SetSplitID sets identifier of split object hierarchy. +func (s *Tombstone) SetSplitID(v []byte) { + s.splitID = v +} + +// GetMembers returns list of objects to be deleted. +func (s *Tombstone) GetMembers() []refs.ObjectID { + if s != nil { + return s.members + } + + return nil +} + +// SetMembers sets list of objects to be deleted. +func (s *Tombstone) SetMembers(v []refs.ObjectID) { + s.members = v +} diff --git a/api/util/pool/buffer.go b/api/util/pool/buffer.go new file mode 100644 index 0000000..e0a7185 --- /dev/null +++ b/api/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/api/util/pool/marshal.go b/api/util/pool/marshal.go new file mode 100644 index 0000000..107df28 --- /dev/null +++ b/api/util/pool/marshal.go @@ -0,0 +1,7 @@ +package pool + +import ( + "github.com/VictoriaMetrics/easyproto" +) + +var MarshalerPool easyproto.MarshalerPool diff --git a/api/util/proto/encoding/compat.go b/api/util/proto/encoding/compat.go new file mode 100644 index 0000000..09d45e6 --- /dev/null +++ b/api/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/api/util/proto/encoding/json.go b/api/util/proto/encoding/json.go new file mode 100644 index 0000000..3456a40 --- /dev/null +++ b/api/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/api/util/proto/encoding/proto.go b/api/util/proto/encoding/proto.go new file mode 100644 index 0000000..5f3c556 --- /dev/null +++ b/api/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/api/util/proto/marshal.go b/api/util/proto/marshal.go new file mode 100644 index 0000000..5016255 --- /dev/null +++ b/api/util/proto/marshal.go @@ -0,0 +1,413 @@ +/* +This package contains help functions for stable marshaller. Their usage is +totally optional. One can implement fast stable marshaller without these +runtime function calls. +*/ + +package proto + +import ( + "encoding/binary" + "math" + "math/bits" + + "google.golang.org/protobuf/encoding/protowire" +) + +type ( + stableMarshaler interface { + StableMarshal([]byte) []byte + stableSizer + } + + stableSizer interface { + StableSize() int + } + + setMarshalData[T any] interface { + SetMarshalData([]byte) + StableSize() int + ~*T + } +) + +func BytesMarshal(field int, buf, v []byte) int { + return bytesMarshal(field, buf, v) +} + +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 := protowire.EncodeTag(protowire.Number(field), protowire.BytesType) + + // buf length check can prevent panic at PutUvarint, but it will make + // marshaller a bit slower. + i := binary.PutUvarint(buf, uint64(prefix)) + i += binary.PutUvarint(buf[i:], uint64(len(v))) + i += copy(buf[i:], v) + + return i +} + +func bytesSize[T ~[]byte | ~string](field int, v T) int { + if len(v) == 0 { + return 0 + } + return bytesSizeNoCheck(field, v) +} + +func bytesSizeNoCheck[T ~[]byte | ~string](field int, v T) int { + return protowire.SizeGroup(protowire.Number(field), protowire.SizeBytes(len(v))) +} + +func StringMarshal(field int, buf []byte, v string) int { + return bytesMarshal(field, buf, v) +} + +func StringSize(field int, v string) int { + return bytesSize(field, v) +} + +func BoolMarshal(field int, buf []byte, v bool) int { + if !v { + return 0 + } + + 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)) + const boolTrueValue = 0x1 + buf[i] = boolTrueValue + + return i + 1 +} + +func BoolSize(field int, v bool) int { + if !v { + return 0 + } + const boolLength = 1 + return protowire.SizeGroup(protowire.Number(field), boolLength) +} + +func UInt64Marshal(field int, buf []byte, v uint64) int { + if v == 0 { + return 0 + } + + 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)) + i += binary.PutUvarint(buf[i:], v) + + return i +} + +func UInt64Size(field int, v uint64) int { + if v == 0 { + return 0 + } + return protowire.SizeGroup(protowire.Number(field), protowire.SizeVarint(v)) +} + +func Int64Marshal(field int, buf []byte, v int64) int { + return UInt64Marshal(field, buf, uint64(v)) +} + +func Int64Size(field int, v int64) int { + return UInt64Size(field, uint64(v)) +} + +func UInt32Marshal(field int, buf []byte, v uint32) int { + return UInt64Marshal(field, buf, uint64(v)) +} + +func UInt32Size(field int, v uint32) int { + return UInt64Size(field, uint64(v)) +} + +func Int32Marshal(field int, buf []byte, v int32) int { + return UInt64Marshal(field, buf, uint64(uint32(v))) +} + +func Int32Size(field int, v int32) int { + return UInt64Size(field, uint64(uint32(v))) +} + +func EnumMarshal(field int, buf []byte, v int32) int { + return UInt64Marshal(field, buf, uint64(uint32(v))) +} + +func EnumSize(field int, v int32) int { + return UInt64Size(field, uint64(uint32(v))) +} + +func RepeatedBytesMarshal(field int, buf []byte, v [][]byte) int { + var offset int + + for i := range v { + offset += bytesMarshalNoCheck(field, buf[offset:], v[i]) + } + + return offset +} + +func RepeatedBytesSize(field int, v [][]byte) (size int) { + for i := range v { + size += bytesSizeNoCheck(field, v[i]) + } + + return size +} + +func RepeatedStringMarshal(field int, buf []byte, v []string) int { + var offset int + + for i := range v { + offset += bytesMarshalNoCheck(field, buf[offset:], v[i]) + } + + return offset +} + +func RepeatedStringSize(field int, v []string) (size int) { + for i := range v { + size += bytesSizeNoCheck(field, v[i]) + } + + return size +} + +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 { + arraySize += protowire.SizeVarint(uint64(v[i])) + } + + size = protowire.SizeGroup(protowire.Number(field), protowire.SizeBytes(arraySize)) + + return +} + +func repeatedUIntMarshal[T ~uint64 | ~int64 | ~uint32 | ~int32](field int, buf []byte, v []T) int { + if len(v) == 0 { + return 0 + } + + prefix := protowire.EncodeTag(protowire.Number(field), protowire.BytesType) + offset := binary.PutUvarint(buf, uint64(prefix)) + + _, arrSize := repeatedUIntSize(field, v) + offset += binary.PutUvarint(buf[offset:], uint64(arrSize)) + for i := range v { + offset += binary.PutUvarint(buf[offset:], uint64(v[i])) + } + + 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) { + return repeatedUIntSize(field, v) +} + +func RepeatedUInt32Marshal(field int, buf []byte, v []uint32) int { + return repeatedUIntMarshal(field, buf, v) +} + +func RepeatedUInt32Size(field int, v []uint32) (size, arraySize int) { + return repeatedUIntSize(field, v) +} + +func RepeatedInt32Marshal(field int, buf []byte, v []int32) int { + 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) { + 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'. +func VarUIntSize(x uint64) int { + return (bits.Len64(x|1) + 6) / 7 +} + +type ptrStableMarshaler[T any] interface { + stableMarshaler + ~*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 + } + + return NestedStructureMarshalUnchecked(field, buf, v) +} + +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) + offset += binary.PutUvarint(buf[offset:], uint64(n)) + v.StableMarshal(buf[offset:]) + + 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[T any, M setMarshalData[T]](field int64, parentData []byte, v M) int { + if v == nil { + 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) + offset := binary.PutUvarint(buf, prefix) + offset += binary.PutUvarint(buf, uint64(n)) + + v.SetMarshalData(parentData[offset : offset+n]) + + return offset + n +} + +func NestedStructureSize[T any, M ptrStableSizer[T]](field int64, v M) (size int) { + if v == nil { + return 0 + } + + return NestedStructureSizeUnchecked(field, v) +} + +func NestedStructureSizeUnchecked[T stableSizer](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 { + if v == 0 { + return 0 + } + + prefix := protowire.EncodeTag(protowire.Number(field), protowire.Fixed64Type) + + // buf length check can prevent panic at PutUvarint, but it will make + // marshaller a bit slower. + i := binary.PutUvarint(buf, uint64(prefix)) + binary.LittleEndian.PutUint64(buf[i:], v) + + return i + 8 +} + +func Fixed64Size(fNum int, v uint64) int { + if v == 0 { + return 0 + } + return protowire.SizeGroup(protowire.Number(fNum), protowire.SizeFixed64()) +} + +func Float64Marshal(field int, buf []byte, v float64) int { + if v == 0 { + return 0 + } + + prefix := protowire.EncodeTag(protowire.Number(field), protowire.Fixed64Type) + + i := binary.PutUvarint(buf, uint64(prefix)) + binary.LittleEndian.PutUint64(buf[i:], math.Float64bits(v)) + + return i + 8 +} + +func Float64Size(fNum int, v float64) int { + if v == 0 { + return 0 + } + return protowire.SizeGroup(protowire.Number(fNum), protowire.SizeFixed64()) +} + +// Fixed32Marshal encodes uint32 value to Protocol Buffers fixed32 field with specified number, +// and writes it to specified buffer. Returns number of bytes written. +// +// Panics if the buffer is undersized. +func Fixed32Marshal(field int, buf []byte, v uint32) int { + if v == 0 { + return 0 + } + + prefix := protowire.EncodeTag(protowire.Number(field), protowire.Fixed32Type) + + // buf length check can prevent panic at PutUvarint, but it will make + // marshaller a bit slower. + i := binary.PutUvarint(buf, uint64(prefix)) + binary.LittleEndian.PutUint32(buf[i:], v) + + return i + 4 +} + +// Fixed32Size returns number of bytes required to encode uint32 value to Protocol Buffers fixed32 field +// with specified number. +func Fixed32Size(fNum int, v uint32) int { + if v == 0 { + return 0 + } + return protowire.SizeGroup(protowire.Number(fNum), protowire.SizeFixed32()) +} diff --git a/api/util/proto/marshal_test.go b/api/util/proto/marshal_test.go new file mode 100644 index 0000000..a635bb6 --- /dev/null +++ b/api/util/proto/marshal_test.go @@ -0,0 +1,247 @@ +package proto_test + +import ( + "math" + "math/rand" + "testing" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/test" + generated "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/test/custom" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/encoding/protojson" + goproto "google.golang.org/protobuf/proto" +) + +type protoInt interface { + ~int32 | ~uint32 | ~int64 | ~uint64 +} + +func nonZero[T protoInt]() T { + var r T + for r == 0 { + r = T(rand.Uint64()) + } + return r +} + +func TestStableMarshalSingle(t *testing.T) { + t.Run("empty", func(t *testing.T) { + t.Run("proto", func(t *testing.T) { + input := &generated.Primitives{} + require.Zero(t, input.StableSize()) + + 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)) + require.Equal(t, input, &actualFrostfs) + + primitivesEqual(t, input, &actual) + }) + }) + + marshalCases := []struct { + name string + input *generated.Primitives + }{ + {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}}, + {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) { + 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 actualFrostfs generated.Primitives + require.NoError(t, actualFrostfs.UnmarshalProtobuf(r)) + require.Equal(t, tc.input, &actualFrostfs) + + 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)) + + 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)) + 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, len(a.FieldA), len(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) + 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) + 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) { + // 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) + 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 { + 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 uint32SliceToAux(s []uint32) []generated.RepPrimitives_Aux { + r := make([]generated.RepPrimitives_Aux, len(s)) + for i := range s { + r[i] = generated.RepPrimitives_Aux{InnerField: s[i]} + } + return r +} + +func TestStableMarshalRep(t *testing.T) { + t.Run("empty", func(t *testing.T) { + marshalCases := []struct { + name string + input *generated.RepPrimitives + }{ + {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 { + t.Run(tc.name, func(t *testing.T) { + require.Zero(t, tc.input.StableSize()) + + r := tc.input.MarshalProtobuf(nil) + require.Empty(t, r) + }) + } + }) + + marshalCases := []struct { + name string + input *generated.RepPrimitives + }{ + {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)}}, + {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) { + 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)) + 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) + + var actual test.RepPrimitives + require.NoError(t, protojson.Unmarshal(r, &actual)) + repPrimitivesEqual(t, tc.input, &actual) + }) + }) + } +} diff --git a/api/util/proto/test/custom/test_frostfs.pb.go b/api/util/proto/test/custom/test_frostfs.pb.go new file mode 100644 index 0000000..c9b2699 --- /dev/null +++ b/api/util/proto/test/custom/test_frostfs.pb.go @@ -0,0 +1,1687 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package test + +import ( + json "encoding/json" + fmt "fmt" + pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + protowire "google.golang.org/protobuf/encoding/protowire" + strconv "strconv" +) + +type Primitives_SomeEnum int32 + +const ( + Primitives_UNKNOWN Primitives_SomeEnum = 0 + Primitives_POSITIVE Primitives_SomeEnum = 1 + Primitives_NEGATIVE Primitives_SomeEnum = -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_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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"innerField\":" + out.RawString(prefix) + 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 + 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 + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +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"` + FieldM isPrimitives_FieldM +} + +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)) + 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 +} + +// 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)) + } + 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.EmitProtobuf(mm.AppendMessage(403)) + } + } +} + +// 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) + 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 +} +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 +} +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) { + 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 + } + first := true + out.RawByte('{') + { + 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 !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 = "\"fieldC\":" + out.RawString(prefix) + out.Bool(x.FieldC) + } + { + 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 = "\"fieldE\":" + out.RawString(prefix) + out.Uint32(x.FieldE) + } + { + 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 = "\"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 = "\"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 = "\"fieldJ\":" + out.RawString(prefix) + out.Float64(x.FieldJ) + } + { + 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 = "\"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 !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 !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"fieldMe\":" + out.RawString(prefix) + out.Uint32(xx.FieldMe) + } + case *Primitives_FieldAux: + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"fieldAux\":" + out.RawString(prefix) + xx.FieldAux.MarshalEasyJSON(out) + } + } + 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 + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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 + 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 + 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 + 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 + 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 + 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": + { + var f float64 + f = in.Float64() + x.FieldJ = f + } + case "fieldK": + { + var f uint32 + r := in.JsonNumber() + n := r.String() + v, err := strconv.ParseUint(n, 10, 32) + if err != nil { + in.AddError(err) + return + } + pv := uint32(v) + f = pv + x.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 + } + case "fieldMa": + xx := new(Primitives_FieldMa) + x.FieldM = xx + { + var f []byte + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + xx.FieldMa = f + } + case "fieldMe": + xx := new(Primitives_FieldMe) + x.FieldM = xx + { + var f uint32 + r := in.JsonNumber() + n := r.String() + v, err := strconv.ParseUint(n, 10, 32) + if err != nil { + in.AddError(err) + return + } + pv := uint32(v) + f = pv + 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() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +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_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 + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"innerField\":" + out.RawString(prefix) + 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 + 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 + } + } + 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"` + FieldAux []RepPrimitives_Aux `json:"fieldAux"` +} + +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])) + } + for i := range x.FieldAux { + size += proto.NestedStructureSizeUnchecked(8, &x.FieldAux[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]) + } + for i := range x.FieldAux { + x.FieldAux[i].EmitProtobuf(mm.AppendMessage(8)) + } +} + +// 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) + case 8: // FieldAux + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldAux") + } + 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) + } + } + } + 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 +} +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) { + 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 + } + first := true + out.RawByte('{') + { + 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(',') + } + if x.FieldA[i] != nil { + out.Base64Bytes(x.FieldA[i]) + } else { + out.String("") + } + } + 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 !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 = "\"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 = "\"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 = "\"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 = "\"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 = "\"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('}') +} + +// 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(']') { + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } + 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(']') { + 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() + } + x.FieldC = list + in.Delim(']') + } + case "fieldD": + { + var f uint32 + var list []uint32 + in.Delim('[') + for !in.IsDelim(']') { + 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() + } + x.FieldD = list + in.Delim(']') + } + case "fieldE": + { + var f int64 + var list []int64 + in.Delim('[') + for !in.IsDelim(']') { + 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() + } + x.FieldE = list + in.Delim(']') + } + case "fieldF": + { + var f uint64 + var list []uint64 + in.Delim('[') + for !in.IsDelim(']') { + 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() + } + x.FieldF = list + in.Delim(']') + } + case "fieldFu": + { + var f uint64 + var list []uint64 + in.Delim('[') + for !in.IsDelim(']') { + 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() + } + x.FieldFu = list + in.Delim(']') + } + case "fieldAux": + { + var f RepPrimitives_Aux + var list []RepPrimitives_Aux + in.Delim('[') + for !in.IsDelim(']') { + f = RepPrimitives_Aux{} + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.FieldAux = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/api/util/proto/test/test.pb.go b/api/util/proto/test/test.pb.go new file mode 100644 index 0000000..e7d5699 --- /dev/null +++ b/api/util/proto/test/test.pb.go @@ -0,0 +1,625 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v5.27.2 +// source: util/proto/test/test.proto + +package test + +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) +) + +type Primitives_SomeEnum int32 + +const ( + Primitives_UNKNOWN Primitives_SomeEnum = 0 + Primitives_POSITIVE Primitives_SomeEnum = 1 + Primitives_NEGATIVE Primitives_SomeEnum = -1 +) + +// Enum value maps for Primitives_SomeEnum. +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) Enum() *Primitives_SomeEnum { + p := new(Primitives_SomeEnum) + *p = x + return p +} + +func (x Primitives_SomeEnum) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Primitives_SomeEnum) Descriptor() protoreflect.EnumDescriptor { + return file_util_proto_test_test_proto_enumTypes[0].Descriptor() +} + +func (Primitives_SomeEnum) Type() protoreflect.EnumType { + return &file_util_proto_test_test_proto_enumTypes[0] +} + +func (x Primitives_SomeEnum) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Primitives_SomeEnum.Descriptor instead. +func (Primitives_SomeEnum) EnumDescriptor() ([]byte, []int) { + return file_util_proto_test_test_proto_rawDescGZIP(), []int{0, 0} +} + +type Primitives struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FieldA []byte `protobuf:"bytes,1,opt,name=field_a,json=fieldA,proto3" json:"field_a,omitempty"` + FieldB string `protobuf:"bytes,2,opt,name=field_b,json=fieldB,proto3" json:"field_b,omitempty"` + FieldC bool `protobuf:"varint,200,opt,name=field_c,json=fieldC,proto3" json:"field_c,omitempty"` + FieldD int32 `protobuf:"varint,201,opt,name=field_d,json=fieldD,proto3" json:"field_d,omitempty"` + FieldE uint32 `protobuf:"varint,202,opt,name=field_e,json=fieldE,proto3" json:"field_e,omitempty"` + FieldF int64 `protobuf:"varint,203,opt,name=field_f,json=fieldF,proto3" json:"field_f,omitempty"` + FieldG uint64 `protobuf:"varint,204,opt,name=field_g,json=fieldG,proto3" json:"field_g,omitempty"` + FieldI uint64 `protobuf:"fixed64,205,opt,name=field_i,json=fieldI,proto3" json:"field_i,omitempty"` + 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() { + *x = Primitives{} + if protoimpl.UnsafeEnabled { + mi := &file_util_proto_test_test_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Primitives) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Primitives) ProtoMessage() {} + +func (x *Primitives) ProtoReflect() protoreflect.Message { + mi := &file_util_proto_test_test_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 Primitives.ProtoReflect.Descriptor instead. +func (*Primitives) Descriptor() ([]byte, []int) { + return file_util_proto_test_test_proto_rawDescGZIP(), []int{0} +} + +func (x *Primitives) GetFieldA() []byte { + if x != nil { + return x.FieldA + } + return nil +} + +func (x *Primitives) GetFieldB() string { + if x != nil { + return x.FieldB + } + return "" +} + +func (x *Primitives) GetFieldC() bool { + if x != nil { + return x.FieldC + } + return false +} + +func (x *Primitives) GetFieldD() int32 { + if x != nil { + return x.FieldD + } + return 0 +} + +func (x *Primitives) GetFieldE() uint32 { + if x != nil { + return x.FieldE + } + return 0 +} + +func (x *Primitives) GetFieldF() int64 { + if x != nil { + return x.FieldF + } + return 0 +} + +func (x *Primitives) GetFieldG() uint64 { + if x != nil { + return x.FieldG + } + return 0 +} + +func (x *Primitives) GetFieldI() uint64 { + if x != nil { + return x.FieldI + } + return 0 +} + +func (x *Primitives) GetFieldJ() float64 { + if x != nil { + return x.FieldJ + } + return 0 +} + +func (x *Primitives) GetFieldK() uint32 { + if x != nil { + return x.FieldK + } + return 0 +} + +func (x *Primitives) GetFieldH() Primitives_SomeEnum { + if x != nil { + return x.FieldH + } + 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 + 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"` + FieldAux []*RepPrimitives_Aux `protobuf:"bytes,8,rep,name=field_aux,json=fieldAux,proto3" json:"field_aux,omitempty"` +} + +func (x *RepPrimitives) Reset() { + *x = RepPrimitives{} + if protoimpl.UnsafeEnabled { + mi := &file_util_proto_test_test_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RepPrimitives) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RepPrimitives) ProtoMessage() {} + +func (x *RepPrimitives) ProtoReflect() protoreflect.Message { + mi := &file_util_proto_test_test_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 RepPrimitives.ProtoReflect.Descriptor instead. +func (*RepPrimitives) Descriptor() ([]byte, []int) { + return file_util_proto_test_test_proto_rawDescGZIP(), []int{1} +} + +func (x *RepPrimitives) GetFieldA() [][]byte { + if x != nil { + return x.FieldA + } + return nil +} + +func (x *RepPrimitives) GetFieldB() []string { + if x != nil { + return x.FieldB + } + return nil +} + +func (x *RepPrimitives) GetFieldC() []int32 { + if x != nil { + return x.FieldC + } + return nil +} + +func (x *RepPrimitives) GetFieldD() []uint32 { + if x != nil { + return x.FieldD + } + return nil +} + +func (x *RepPrimitives) GetFieldE() []int64 { + if x != nil { + return x.FieldE + } + return nil +} + +func (x *RepPrimitives) GetFieldF() []uint64 { + if x != nil { + return x.FieldF + } + return nil +} + +func (x *RepPrimitives) GetFieldFu() []uint64 { + if x != nil { + return x.FieldFu + } + 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 + 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 +} + +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{ + 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, 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, + 0x6c, 0x64, 0x42, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x63, 0x18, 0xc8, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x43, 0x12, 0x18, 0x0a, + 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x64, 0x18, 0xc9, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x5f, 0x65, 0x18, 0xca, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x45, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x66, 0x18, 0xcb, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x46, 0x12, 0x18, 0x0a, 0x07, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x67, 0x18, 0xcc, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x47, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x69, + 0x18, 0xcd, 0x01, 0x20, 0x01, 0x28, 0x06, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x12, + 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6a, 0x18, 0xce, 0x01, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4a, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x5f, 0x6b, 0x18, 0xcf, 0x01, 0x20, 0x01, 0x28, 0x07, 0x52, 0x06, 0x66, 0x69, 0x65, + 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, 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, 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, + 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, 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 ( + file_util_proto_test_test_proto_rawDescOnce sync.Once + file_util_proto_test_test_proto_rawDescData = file_util_proto_test_test_proto_rawDesc +) + +func file_util_proto_test_test_proto_rawDescGZIP() []byte { + file_util_proto_test_test_proto_rawDescOnce.Do(func() { + file_util_proto_test_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_util_proto_test_test_proto_rawDescData) + }) + return file_util_proto_test_test_proto_rawDescData +} + +var file_util_proto_test_test_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +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 + (*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 + 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() } +func file_util_proto_test_test_proto_init() { + if File_util_proto_test_test_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_util_proto_test_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Primitives); 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[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RepPrimitives); 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[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[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), + (*Primitives_FieldMe)(nil), + (*Primitives_FieldAux)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_util_proto_test_test_proto_rawDesc, + NumEnums: 1, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_util_proto_test_test_proto_goTypes, + DependencyIndexes: file_util_proto_test_test_proto_depIdxs, + EnumInfos: file_util_proto_test_test_proto_enumTypes, + MessageInfos: file_util_proto_test_test_proto_msgTypes, + }.Build() + File_util_proto_test_test_proto = out.File + file_util_proto_test_test_proto_rawDesc = nil + file_util_proto_test_test_proto_goTypes = nil + file_util_proto_test_test_proto_depIdxs = nil +} diff --git a/api/util/protogen/internalgengo/file.go b/api/util/protogen/internalgengo/file.go new file mode 100644 index 0000000..d3dd19e --- /dev/null +++ b/api/util/protogen/internalgengo/file.go @@ -0,0 +1,245 @@ +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-sdk-go/api/util/pool") + protoPackage = protogen.GoImportPath("git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto") + encodingPackage = protogen.GoImportPath("git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/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. + 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 { + 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, ") 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(), fieldDefaultValue(ff)) + } +} + +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/api/util/protogen/internalgengo/fuzz.go b/api/util/protogen/internalgengo/fuzz.go new file mode 100644 index 0000000..ec99692 --- /dev/null +++ b/api/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/api/util/protogen/internalgengo/getter.go b/api/util/protogen/internalgengo/getter.go new file mode 100644 index 0000000..78deef7 --- /dev/null +++ b/api/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/api/util/protogen/internalgengo/json.go b/api/util/protogen/internalgengo/json.go new file mode 100644 index 0000000..20730a6 --- /dev/null +++ b/api/util/protogen/internalgengo/json.go @@ -0,0 +1,284 @@ +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 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 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("}") + + 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) + emitJSONReadEnum(g, "parsedValue", enumType) + template = "%s = parsedValue" + case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: + emitJSONParseInteger(g, "pv", "ParseInt", 32, "int32") + template = "%s = pv" + case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: + emitJSONParseInteger(g, "pv", "ParseUint", 32, "uint32") + template = "%s = pv" + case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: + emitJSONParseInteger(g, "pv", "ParseInt", 64, "int64") + template = "%s = pv" + case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: + emitJSONParseInteger(g, "pv", "ParseUint", 64, "uint64") + template = "%s = pv" + case protoreflect.FloatKind: + template = "%s = in.Float32()" + case protoreflect.DoubleKind: + template = "%s = in.Float64()" + case protoreflect.StringKind: + template = "%s = in.String()" + case protoreflect.BytesKind: + // 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:], "{}") + } 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 }`) + + if len(msg.Fields) != 0 { + g.P("first := true") + } + g.P("out.RawByte('{')") + for _, 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") + } + g.P("}") + continue + } + emitJSONFieldWrite(g, f, "x") + } + g.P("out.RawByte('}')") + g.P("}") +} + +func emitJSONFieldWrite(g *protogen.GeneratedFile, f *protogen.Field, name string) { + g.P("{") + defer g.P("}") + + selector := name + "." + f.GoName + + // 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), `\":"`) + g.P("out.RawString(prefix)") + 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: + 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: + template = "out.Uint32(%s)" + case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: + 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: + 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: + template = "out.Float64(%s)" + case protoreflect.StringKind: + template = "out.String(%s)" + case protoreflect.BytesKind: + 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: + 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/api/util/protogen/internalgengo/options.go b/api/util/protogen/internalgengo/options.go new file mode 100644 index 0000000..8aab8f0 --- /dev/null +++ b/api/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/api/util/protogen/internalgengo/proto.go b/api/util/protogen/internalgengo/proto.go new file mode 100644 index 0000000..1467541 --- /dev/null +++ b/api/util/protogen/internalgengo/proto.go @@ -0,0 +1,202 @@ +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, ", ", fieldType(g, f)[2:], "{})") + 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]" + } else { + g.P("if ", notNil(name), " {") + defer g.P("}") + } + + g.P(name, ".EmitProtobuf(mm.AppendMessage(", f.Desc.Number(), "))") + 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/api/util/protogen/internalgengo/proto_field_type.go b/api/util/protogen/internalgengo/proto_field_type.go new file mode 100644 index 0000000..0096751 --- /dev/null +++ b/api/util/protogen/internalgengo/proto_field_type.go @@ -0,0 +1,59 @@ +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)) + if !field.Desc.IsList() { + typ = typ.PointerTo() + } + case protoreflect.GroupKind: + panic("unimplemented") + } + + if field.Desc.IsList() { + typ = "[]" + typ + } + + return typ +} diff --git a/api/util/protogen/internalgengo/proto_stable_compat.go b/api/util/protogen/internalgengo/proto_stable_compat.go new file mode 100644 index 0000000..3c4670c --- /dev/null +++ b/api/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("NestedStructureSizeUnchecked"), "(", 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/api/util/protogen/internalgengo/writer.go b/api/util/protogen/internalgengo/writer.go new file mode 100644 index 0000000..7b0d4f1 --- /dev/null +++ b/api/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/api/util/protogen/main.go b/api/util/protogen/main.go new file mode 100644 index 0000000..3ebc1dd --- /dev/null +++ b/api/util/protogen/main.go @@ -0,0 +1,27 @@ +package main + +import ( + "flag" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/protogen/internalgengo" + "google.golang.org/protobuf/compiler/protogen" +) + +func main() { + var flags flag.FlagSet + genFuzz := flags.Bool("fuzz", false, "generate fuzz tests") + + protogen.Options{ + ParamFunc: flags.Set, + }.Run(func(gen *protogen.Plugin) error { + for _, f := range gen.Files { + if f.Generate { + internalgengo.GenerateFile(gen, f) + if *genFuzz { + internalgengo.GenerateFuzzTests(gen, f) + } + } + } + return nil + }) +} diff --git a/api/util/signature/data.go b/api/util/signature/data.go new file mode 100644 index 0000000..e444a73 --- /dev/null +++ b/api/util/signature/data.go @@ -0,0 +1,93 @@ +package signature + +import ( + "crypto/ecdsa" + + crypto "git.frostfs.info/TrueCloudLab/frostfs-crypto" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" +) + +const poolSliceMaxSize = 128 * 1024 + +var buffersPool = pool.NewBufferPool(poolSliceMaxSize) + +type DataSource interface { + ReadSignedData([]byte) ([]byte, error) + SignedDataSize() int +} + +type DataWithSignature interface { + DataSource + GetSignature() *refs.Signature + SetSignature(*refs.Signature) +} + +type SignOption func(*cfg) + +type KeySignatureHandler func(*refs.Signature) + +type KeySignatureSource func() *refs.Signature + +func SignDataWithHandler(key *ecdsa.PrivateKey, src DataSource, handler KeySignatureHandler, opts ...SignOption) error { + if key == nil { + return crypto.ErrEmptyPrivateKey + } + + cfg := defaultCfg() + + for i := range opts { + opts[i](cfg) + } + + buffer := buffersPool.Get(uint32(src.SignedDataSize())) + defer buffersPool.Put(buffer) + + data, err := src.ReadSignedData(buffer.Data) + if err != nil { + return err + } + + sigData, err := sign(cfg, key, data) + if err != nil { + return err + } + + sig := new(refs.Signature) + sig.SetScheme(cfg.scheme) + sig.SetKey(crypto.MarshalPublicKey(&key.PublicKey)) + sig.SetSign(sigData) + handler(sig) + + return nil +} + +func VerifyDataWithSource(dataSrc DataSource, sigSrc KeySignatureSource, opts ...SignOption) error { + buffer := buffersPool.Get(uint32(dataSrc.SignedDataSize())) + defer buffersPool.Put(buffer) + + data, err := dataSrc.ReadSignedData(buffer.Data) + if err != nil { + return err + } + + return VerifyDataSlice(data, sigSrc, opts...) +} + +func SignData(key *ecdsa.PrivateKey, v DataWithSignature, opts ...SignOption) error { + return SignDataWithHandler(key, v, v.SetSignature, opts...) +} + +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()) +} diff --git a/api/util/signature/options.go b/api/util/signature/options.go new file mode 100644 index 0000000..d27eff2 --- /dev/null +++ b/api/util/signature/options.go @@ -0,0 +1,77 @@ +package signature + +import ( + "crypto/ecdsa" + "encoding/base64" + "fmt" + + crypto "git.frostfs.info/TrueCloudLab/frostfs-crypto" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/signature/walletconnect" +) + +type cfg struct { + schemeFixed bool + scheme refs.SignatureScheme +} + +func defaultCfg() *cfg { + return new(cfg) +} + +func verify(cfg *cfg, data []byte, sig *refs.Signature) error { + if !cfg.schemeFixed { + cfg.scheme = sig.GetScheme() + } + + pub := crypto.UnmarshalPublicKey(sig.GetKey()) + if pub == nil { + return crypto.ErrEmptyPublicKey + } + + switch cfg.scheme { + case refs.ECDSA_SHA512: + return crypto.Verify(pub, data, sig.GetSign()) + case refs.ECDSA_RFC6979_SHA256: + return crypto.VerifyRFC6979(pub, data, sig.GetSign()) + case refs.ECDSA_RFC6979_SHA256_WALLET_CONNECT: + 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 + default: + return fmt.Errorf("unsupported signature scheme %s", cfg.scheme) + } +} + +func sign(cfg *cfg, key *ecdsa.PrivateKey, data []byte) ([]byte, error) { + switch cfg.scheme { + case refs.ECDSA_SHA512: + return crypto.Sign(key, data) + case refs.ECDSA_RFC6979_SHA256: + return crypto.SignRFC6979(key, data) + case refs.ECDSA_RFC6979_SHA256_WALLET_CONNECT: + 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)) + } +} + +func SignWithRFC6979() SignOption { + return func(c *cfg) { + c.schemeFixed = true + c.scheme = refs.ECDSA_RFC6979_SHA256 + } +} + +func SignWithWalletConnect() SignOption { + return func(c *cfg) { + c.scheme = refs.ECDSA_RFC6979_SHA256_WALLET_CONNECT + } +} diff --git a/api/util/signature/sign_test.go b/api/util/signature/sign_test.go new file mode 100644 index 0000000..222f9be --- /dev/null +++ b/api/util/signature/sign_test.go @@ -0,0 +1,44 @@ +package signature + +import ( + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rand" + "testing" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + "github.com/stretchr/testify/require" +) + +type testData struct { + data []byte + sig *refs.Signature +} + +func (t testData) SignedDataSize() int { return len(t.data) } +func (t testData) ReadSignedData(data []byte) ([]byte, error) { + n := copy(data, t.data) + return data[:n], nil +} +func (t testData) GetSignature() *refs.Signature { return t.sig } +func (t *testData) SetSignature(s *refs.Signature) { t.sig = s } + +func TestWalletConnect(t *testing.T) { + testCases := [...][]byte{ + {}, + {0}, + {1, 2}, + {3, 4, 5}, + {6, 7, 8, 9, 10, 11, 12}, + } + + pk, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + require.NoError(t, err) + + for _, tc := range testCases { + td := &testData{data: tc} + require.NoError(t, SignData(pk, td, SignWithWalletConnect())) + require.Equal(t, refs.ECDSA_RFC6979_SHA256_WALLET_CONNECT, td.sig.GetScheme()) + require.NoError(t, VerifyData(td)) + } +} diff --git a/api/util/signature/walletconnect/sign.go b/api/util/signature/walletconnect/sign.go new file mode 100644 index 0000000..b96a842 --- /dev/null +++ b/api/util/signature/walletconnect/sign.go @@ -0,0 +1,142 @@ +package walletconnect + +import ( + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rand" + "encoding/binary" + "encoding/hex" + + crypto "git.frostfs.info/TrueCloudLab/frostfs-crypto" +) + +const ( + // saltSize is the salt size added to signed message. + saltSize = 16 + // signatureLen is the length of RFC6979 signature. + signatureLen = 64 +) + +// SignedMessage contains mirrors `SignedMessage` struct from the WalletConnect API. +// https://neon.coz.io/wksdk/core/modules.html#SignedMessage +type SignedMessage struct { + Data []byte + Message []byte + PublicKey []byte + Salt []byte +} + +// Sign signs message using WalletConnect API. The returned signature +// contains RFC6979 signature and 16-byte salt. +func Sign(p *ecdsa.PrivateKey, msg []byte) ([]byte, error) { + sm, err := SignMessage(p, msg) + if err != nil { + return nil, err + } + return append(sm.Data, sm.Salt...), nil +} + +// Verify verifies message using WalletConnect API. +func Verify(p *ecdsa.PublicKey, data, sign []byte) bool { + if len(sign) != signatureLen+saltSize { + return false + } + + salt := sign[signatureLen:] + return VerifyMessage(p, SignedMessage{ + Data: sign[:signatureLen], + Message: createMessageWithSalt(data, salt), + Salt: salt, + }) +} + +// SignMessage signs message with a private key and returns structure similar to +// `signMessage` of the WalletConnect API. +// https://github.com/CityOfZion/wallet-connect-sdk/blob/89c236b/packages/wallet-connect-sdk-core/src/index.ts#L496 +// https://github.com/CityOfZion/neon-wallet/blob/1174a9388480e6bbc4f79eb13183c2a573f67ca8/app/context/WalletConnect/helpers.js#L133 +func SignMessage(p *ecdsa.PrivateKey, msg []byte) (SignedMessage, error) { + var salt [saltSize]byte + _, _ = rand.Read(salt[:]) + + msg = createMessageWithSalt(msg, salt[:]) + sign, err := crypto.SignRFC6979(p, msg) + if err != nil { + return SignedMessage{}, err + } + + return SignedMessage{ + Data: sign, + Message: msg, + PublicKey: elliptic.MarshalCompressed(p.Curve, p.X, p.Y), + Salt: salt[:], + }, nil +} + +// VerifyMessage verifies message with a private key and returns structure similar to +// `verifyMessage` of WalletConnect API. +// https://github.com/CityOfZion/wallet-connect-sdk/blob/89c236b/packages/wallet-connect-sdk-core/src/index.ts#L515 +// https://github.com/CityOfZion/neon-wallet/blob/1174a9388480e6bbc4f79eb13183c2a573f67ca8/app/context/WalletConnect/helpers.js#L147 +func VerifyMessage(p *ecdsa.PublicKey, m SignedMessage) bool { + if p == nil { + x, y := elliptic.UnmarshalCompressed(elliptic.P256(), m.PublicKey) + if x == nil || y == nil { + return false + } + p = &ecdsa.PublicKey{ + Curve: elliptic.P256(), + X: x, + Y: y, + } + } + return crypto.VerifyRFC6979(p, m.Message, m.Data) == nil +} + +func createMessageWithSalt(msg, salt []byte) []byte { + // 4 byte prefix + length of the message with salt in bytes + + // + salt + message + 2 byte postfix. + saltedLen := hex.EncodedLen(len(salt)) + len(msg) + data := make([]byte, 4+getVarIntSize(saltedLen)+saltedLen+2) + + n := copy(data, []byte{0x01, 0x00, 0x01, 0xf0}) // fixed prefix + n += putVarUint(data[n:], uint64(saltedLen)) // salt is hex encoded, double its size + n += hex.Encode(data[n:], salt[:]) // for some reason we encode salt in hex + n += copy(data[n:], msg) + copy(data[n:], []byte{0x00, 0x00}) + + return data +} + +// Following functions are copied from github.com/nspcc-dev/neo-go/pkg/io package +// to avoid having another dependency. + +// getVarIntSize returns the size in number of bytes of a variable integer. +// Reference: https://github.com/neo-project/neo/blob/26d04a642ac5a1dd1827dabf5602767e0acba25c/src/neo/IO/Helper.cs#L131 +func getVarIntSize(value int) int { + var size uintptr + + if value < 0xFD { + size = 1 // unit8 + } else if value <= 0xFFFF { + size = 3 // byte + uint16 + } else { + size = 5 // byte + uint32 + } + return int(size) +} + +// putVarUint puts val in varint form to the pre-allocated buffer. +func putVarUint(data []byte, val uint64) int { + if val < 0xfd { + data[0] = byte(val) + return 1 + } + if val <= 0xFFFF { + data[0] = byte(0xfd) + binary.LittleEndian.PutUint16(data[1:], uint16(val)) + return 3 + } + + data[0] = byte(0xfe) + binary.LittleEndian.PutUint32(data[1:], uint32(val)) + return 5 +} diff --git a/api/util/signature/walletconnect/sign_test.go b/api/util/signature/walletconnect/sign_test.go new file mode 100644 index 0000000..1b4fe18 --- /dev/null +++ b/api/util/signature/walletconnect/sign_test.go @@ -0,0 +1,112 @@ +package walletconnect + +import ( + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rand" + "encoding/hex" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestSignMessage(t *testing.T) { + p1, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + require.NoError(t, err) + + msg := []byte("NEO") + result, err := SignMessage(p1, msg) + require.NoError(t, err) + require.Equal(t, elliptic.MarshalCompressed(elliptic.P256(), p1.PublicKey.X, p1.PublicKey.Y), result.PublicKey) + require.Equal(t, saltSize, len(result.Salt)) + require.Equal(t, 64, len(result.Data)) + require.Equal(t, 4+1+16*2+3+2, len(result.Message)) + + require.True(t, VerifyMessage(&p1.PublicKey, result)) + + t.Run("invalid public key", func(t *testing.T) { + p2, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + require.NoError(t, err) + require.False(t, VerifyMessage(&p2.PublicKey, result)) + }) + t.Run("invalid signature", func(t *testing.T) { + result := result + result.Data[0] ^= 0xFF + require.False(t, VerifyMessage(&p1.PublicKey, result)) + }) +} + +func TestSign(t *testing.T) { + p1, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + require.NoError(t, err) + + msg := []byte("NEO") + sign, err := Sign(p1, msg) + require.NoError(t, err) + require.True(t, Verify(&p1.PublicKey, msg, sign)) + + t.Run("invalid public key", func(t *testing.T) { + p2, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + require.NoError(t, err) + require.False(t, Verify(&p2.PublicKey, msg, sign)) + }) + t.Run("invalid signature", func(t *testing.T) { + sign[0] ^= 0xFF + require.False(t, Verify(&p1.PublicKey, msg, sign)) + }) +} + +func TestVerifyNeonWallet(t *testing.T) { + testCases := [...]struct { + publicKey string + data string + salt string + messageHex string + messageOriginal string + }{ + { // Test values from this GIF https://github.com/CityOfZion/neon-wallet/pull/2390 . + publicKey: "02ce6228ba2cb2fc235be93aff9cd5fc0851702eb9791552f60db062f01e3d83f6", + data: "90ab1886ca0bece59b982d9ade8f5598065d651362fb9ce45ad66d0474b89c0b80913c8f0118a282acbdf200a429ba2d81bc52534a53ab41a2c6dfe2f0b4fb1b", + salt: "d41e348afccc2f3ee45cd9f5128b16dc", + messageHex: "010001f05c6434316533343861666363633266336565343563643966353132386231366463436172616c686f2c206d756c65712c206f2062616775697520656820697373756d65726d6f2074616978206c696761646f206e61206d697373e36f3f0000", + messageOriginal: "436172616c686f2c206d756c65712c206f2062616775697520656820697373756d65726d6f2074616978206c696761646f206e61206d697373e36f3f", + }, + { // Test value from wallet connect integration test + publicKey: "03bd9108c0b49f657e9eee50d1399022bd1e436118e5b7529a1b7cd606652f578f", + data: "510caa8cb6db5dedf04d215a064208d64be7496916d890df59aee132db8f2b07532e06f7ea664c4a99e3bcb74b43a35eb9653891b5f8701d2aef9e7526703eaa", + salt: "2c5b189569e92cce12e1c640f23e83ba", + messageHex: "010001f02632633562313839353639653932636365313265316336343066323365383362613132333435360000", + messageOriginal: "313233343536", // ascii string "123456" + }, + { // Test value from wallet connect integration test + publicKey: "03bd9108c0b49f657e9eee50d1399022bd1e436118e5b7529a1b7cd606652f578f", + data: "1e13f248962d8b3b60708b55ddf448d6d6a28c6b43887212a38b00bf6bab695e61261e54451c6e3d5f1f000e5534d166c7ca30f662a296d3a9aafa6d8c173c01", + salt: "58c86b2e74215b4f36b47d731236be3b", + messageHex: "010001f02035386338366232653734323135623466333662343764373331323336626533620000", + messageOriginal: "", // empty string + }, + } + + for _, testCase := range testCases { + rawPub, err := hex.DecodeString(testCase.publicKey) + require.NoError(t, err) + data, err := hex.DecodeString(testCase.data) + require.NoError(t, err) + salt, err := hex.DecodeString(testCase.salt) + require.NoError(t, err) + msg, err := hex.DecodeString(testCase.messageHex) + require.NoError(t, err) + orig, err := hex.DecodeString(testCase.messageOriginal) + require.NoError(t, err) + + require.Equal(t, msg, createMessageWithSalt(orig, salt)) + + sm := SignedMessage{ + Data: data, + Message: msg, + PublicKey: rawPub, + Salt: salt, + } + require.True(t, VerifyMessage(nil, sm)) + } +} diff --git a/bearer/bearer.go b/bearer/bearer.go index e419d54..d1b77ed 100644 --- a/bearer/bearer.go +++ b/bearer/bearer.go @@ -5,10 +5,10 @@ import ( "errors" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" - apeV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" apeSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ape" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" + apeV2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto" frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa" @@ -18,7 +18,7 @@ import ( // Token represents bearer token for object service operations. // -// Token is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl.BearerToken +// Token is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl.BearerToken // message. See ReadFromV2 / WriteToV2 methods. // // Instances can be created using built-in var declaration. diff --git a/bearer/bearer_test.go b/bearer/bearer_test.go index 341c4f2..650dc82 100644 --- a/bearer/bearer_test.go +++ b/bearer/bearer_test.go @@ -6,8 +6,8 @@ import ( "reflect" "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" bearertest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer/test" cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test" diff --git a/checksum/checksum.go b/checksum/checksum.go index 9d227ad..76887f6 100644 --- a/checksum/checksum.go +++ b/checksum/checksum.go @@ -6,13 +6,13 @@ import ( "errors" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" "git.frostfs.info/TrueCloudLab/tzhash/tz" ) // Checksum represents checksum of some digital data. // -// Checksum is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs.Checksum +// Checksum is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs.Checksum // message. See ReadFromV2 / WriteToV2 methods. // // Instances can be created using built-in var declaration. diff --git a/checksum/checksum_test.go b/checksum/checksum_test.go index 9da857d..1e1c07c 100644 --- a/checksum/checksum_test.go +++ b/checksum/checksum_test.go @@ -5,7 +5,7 @@ import ( "crypto/sha256" "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" "git.frostfs.info/TrueCloudLab/tzhash/tz" "github.com/stretchr/testify/require" ) diff --git a/checksum/example_test.go b/checksum/example_test.go index 337767a..72d4a05 100644 --- a/checksum/example_test.go +++ b/checksum/example_test.go @@ -6,7 +6,7 @@ import ( "crypto/sha256" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" ) func ExampleCalculate() { diff --git a/client/accounting.go b/client/accounting.go index faf7ddc..707ec3d 100644 --- a/client/accounting.go +++ b/client/accounting.go @@ -4,13 +4,13 @@ import ( "context" "fmt" - v2accounting "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/accounting" + v2accounting "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/accounting" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + v2session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user" ) diff --git a/client/apemanager_add_chain.go b/client/apemanager_add_chain.go index 2581e2a..a8d53a7 100644 --- a/client/apemanager_add_chain.go +++ b/client/apemanager_add_chain.go @@ -4,12 +4,12 @@ import ( "context" "fmt" - apemanagerV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" - rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - sessionV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" apeSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ape" + apemanagerV2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/apemanager" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + sessionV2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" ) diff --git a/client/apemanager_list_chains.go b/client/apemanager_list_chains.go index a8a3e8a..56cc4ef 100644 --- a/client/apemanager_list_chains.go +++ b/client/apemanager_list_chains.go @@ -4,12 +4,12 @@ import ( "context" "fmt" - apemanagerV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" - rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - sessionV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" apeSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ape" + apemanagerV2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/apemanager" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + sessionV2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" ) diff --git a/client/apemanager_remove_chain.go b/client/apemanager_remove_chain.go index a297716..39ccdeb 100644 --- a/client/apemanager_remove_chain.go +++ b/client/apemanager_remove_chain.go @@ -4,12 +4,12 @@ import ( "context" "fmt" - apemanagerV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" - rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - sessionV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" apeSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ape" + apemanagerV2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/apemanager" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + sessionV2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" ) diff --git a/client/api.go b/client/api.go index dd18c42..c86dde2 100644 --- a/client/api.go +++ b/client/api.go @@ -4,9 +4,9 @@ import ( "context" "fmt" - v2netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" - rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" + v2netmap "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" ) // interface of FrostFS API server. Exists for test purposes only. diff --git a/client/client.go b/client/client.go index 0894f0e..98d4275 100644 --- a/client/client.go +++ b/client/client.go @@ -7,9 +7,9 @@ import ( "errors" "time" - v2accounting "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" + v2accounting "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/accounting" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -129,7 +129,7 @@ func (c *Client) Dial(ctx context.Context, prm PrmDial) error { // sets underlying provider of frostFSAPIServer. The method is used for testing as an approach // to skip Dial stage and override FrostFS API server. MUST NOT be used outside test code. -// In real applications wrapper over git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client +// In real applications wrapper over git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client // is statically used. func (c *Client) setFrostFSAPIServer(server frostFSAPIServer) { c.server = server diff --git a/client/common.go b/client/common.go index 65abae5..ba8281d 100644 --- a/client/common.go +++ b/client/common.go @@ -4,10 +4,10 @@ import ( "errors" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + v2session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/version" ) @@ -104,7 +104,7 @@ func (c *Client) processResponse(resp responseV2) (apistatus.Status, error) { return st, nil } -// ExecRaw executes f with underlying git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client.Client +// ExecRaw executes f with underlying sdk-go/api/rpc/client.Client // instance. Communicate over the Protocol Buffers protocol in a more flexible way: // most often used to transmit data over a fixed version of the FrostFS protocol, as well // as to support custom services. @@ -115,7 +115,7 @@ func (c *Client) processResponse(resp responseV2) (apistatus.Status, error) { // before closing the connection. // // See also Dial and Close. -// See also git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client package docs. +// See also git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client package docs. func (c *Client) ExecRaw(f func(client *client.Client) error) error { return f(&c.c) } diff --git a/client/container_delete.go b/client/container_delete.go index 6d4b345..cf5adf4 100644 --- a/client/container_delete.go +++ b/client/container_delete.go @@ -4,12 +4,12 @@ import ( "context" "fmt" - v2container "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" + v2container "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + v2session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto" frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa" diff --git a/client/container_get.go b/client/container_get.go index da8166f..fd34090 100644 --- a/client/container_get.go +++ b/client/container_get.go @@ -5,12 +5,12 @@ import ( "errors" "fmt" - v2container "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" + v2container "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + v2session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" diff --git a/client/container_list.go b/client/container_list.go index 6d2efb6..d094cdb 100644 --- a/client/container_list.go +++ b/client/container_list.go @@ -4,12 +4,12 @@ import ( "context" "fmt" - v2container "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" + v2container "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + v2session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session" diff --git a/client/container_put.go b/client/container_put.go index e5b8f18..30ebf7a 100644 --- a/client/container_put.go +++ b/client/container_put.go @@ -4,12 +4,12 @@ import ( "context" "fmt" - v2container "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" + v2container "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + v2session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" diff --git a/client/doc.go b/client/doc.go index 7f6ec42..2a1d607 100644 --- a/client/doc.go +++ b/client/doc.go @@ -47,8 +47,8 @@ Consume custom service of the server: rpc CustomRPC(CustomRPCRequest) returns (CustomRPCResponse); } - import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/common" + import "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + import "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/common" req := new(CustomRPCRequest) // ... diff --git a/client/netmap.go b/client/netmap.go index a870ab2..f87d3b0 100644 --- a/client/netmap.go +++ b/client/netmap.go @@ -4,11 +4,11 @@ import ( "context" "fmt" - v2netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" - rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" + v2netmap "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + v2session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/version" diff --git a/client/netmap_test.go b/client/netmap_test.go index bce6b3a..d6ff0fb 100644 --- a/client/netmap_test.go +++ b/client/netmap_test.go @@ -6,9 +6,9 @@ import ( "fmt" "testing" - v2netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" + v2netmap "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" "github.com/stretchr/testify/require" diff --git a/client/object_delete.go b/client/object_delete.go index 3214cff..048398c 100644 --- a/client/object_delete.go +++ b/client/object_delete.go @@ -5,13 +5,13 @@ import ( "crypto/ecdsa" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" - v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - v2refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" + v2object "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + v2refs "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + v2session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" diff --git a/client/object_get.go b/client/object_get.go index ba4f72d..b84844e 100644 --- a/client/object_get.go +++ b/client/object_get.go @@ -7,13 +7,13 @@ import ( "fmt" "io" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" - v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - v2refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" + v2object "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + v2refs "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + v2session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" diff --git a/client/object_hash.go b/client/object_hash.go index b1b9ffc..83f2360 100644 --- a/client/object_hash.go +++ b/client/object_hash.go @@ -5,13 +5,13 @@ import ( "crypto/ecdsa" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" - v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - v2refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" + v2object "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + v2refs "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + v2session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/checksum" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" diff --git a/client/object_patch.go b/client/object_patch.go index 7b054db..6930644 100644 --- a/client/object_patch.go +++ b/client/object_patch.go @@ -7,12 +7,12 @@ import ( "fmt" "io" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" - v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" + v2object "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + v2session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" diff --git a/client/object_patch_test.go b/client/object_patch_test.go index 839c453..63996b6 100644 --- a/client/object_patch_test.go +++ b/client/object_patch_test.go @@ -8,7 +8,7 @@ import ( "crypto/rand" "testing" - v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + v2object "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" oidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id/test" "github.com/stretchr/testify/require" diff --git a/client/object_put.go b/client/object_put.go index 07ca840..9a01f34 100644 --- a/client/object_put.go +++ b/client/object_put.go @@ -4,7 +4,7 @@ import ( "context" "crypto/ecdsa" - buffPool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" + buffPool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" diff --git a/client/object_put_raw.go b/client/object_put_raw.go index e47c6a2..b682102 100644 --- a/client/object_put_raw.go +++ b/client/object_put_raw.go @@ -7,12 +7,12 @@ import ( "fmt" "io" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" - v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" + v2object "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + v2session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" ) diff --git a/client/object_put_single.go b/client/object_put_single.go index a2ff8a0..ffce126 100644 --- a/client/object_put_single.go +++ b/client/object_put_single.go @@ -5,12 +5,12 @@ import ( "crypto/ecdsa" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" - v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" + v2object "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + v2session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session" diff --git a/client/object_put_transformer.go b/client/object_put_transformer.go index 5314a12..7e30be1 100644 --- a/client/object_put_transformer.go +++ b/client/object_put_transformer.go @@ -3,7 +3,7 @@ package client import ( "context" - buffPool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" + buffPool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/transformer" diff --git a/client/object_search.go b/client/object_search.go index 42018e5..781d872 100644 --- a/client/object_search.go +++ b/client/object_search.go @@ -7,13 +7,13 @@ import ( "fmt" "io" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" - v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - v2refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" + v2object "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + v2refs "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + v2session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" diff --git a/client/object_search_test.go b/client/object_search_test.go index f449d61..f385f48 100644 --- a/client/object_search_test.go +++ b/client/object_search_test.go @@ -7,9 +7,9 @@ import ( "io" "testing" - v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - signatureV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" + v2object "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + signatureV2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" oidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id/test" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" diff --git a/client/response.go b/client/response.go index e1a702e..69972b9 100644 --- a/client/response.go +++ b/client/response.go @@ -1,6 +1,6 @@ package client -import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" +import "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" // ResponseMetaInfo groups meta information about any FrostFS API response. type ResponseMetaInfo struct { diff --git a/client/session.go b/client/session.go index b49c67b..9f806f0 100644 --- a/client/session.go +++ b/client/session.go @@ -5,11 +5,11 @@ import ( "crypto/ecdsa" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + v2session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user" ) diff --git a/client/status/apemanager.go b/client/status/apemanager.go index f68fd48..b4d49cb 100644 --- a/client/status/apemanager.go +++ b/client/status/apemanager.go @@ -1,8 +1,8 @@ package apistatus import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/apemanager" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status" ) // APEManagerAccessDenied describes status of the failure because of the access control violation. diff --git a/client/status/common.go b/client/status/common.go index 598631b..486bc72 100644 --- a/client/status/common.go +++ b/client/status/common.go @@ -3,7 +3,7 @@ package apistatus import ( "encoding/binary" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status" ) // ServerInternal describes failure statuses related to internal server errors. @@ -53,7 +53,7 @@ func (x ServerInternal) Message() string { // WriteInternalServerErr writes err message to ServerInternal instance. func WriteInternalServerErr(x *ServerInternal, err error) { - x.SetMessage(err.Error()) + x.v2.SetMessage(err.Error()) } // WrongMagicNumber describes failure status related to incorrect network magic. @@ -192,7 +192,7 @@ const defaultNodeUnderMaintenanceMsg = "node is under maintenance" // Error implements the error interface. func (x *NodeUnderMaintenance) Error() string { - msg := x.Message() + msg := x.v2.Message() if msg == "" { msg = defaultNodeUnderMaintenanceMsg } diff --git a/client/status/common_test.go b/client/status/common_test.go index 5a7a2b7..e55883e 100644 --- a/client/status/common_test.go +++ b/client/status/common_test.go @@ -3,7 +3,7 @@ package apistatus_test import ( "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" "github.com/stretchr/testify/require" ) diff --git a/client/status/container.go b/client/status/container.go index 9f06b27..594d984 100644 --- a/client/status/container.go +++ b/client/status/container.go @@ -1,8 +1,8 @@ package apistatus import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status" ) // ContainerNotFound describes status of the failure because of the missing container. diff --git a/client/status/object.go b/client/status/object.go index 27ea86c..ae2e8e0 100644 --- a/client/status/object.go +++ b/client/status/object.go @@ -1,8 +1,8 @@ package apistatus import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status" ) // ObjectLocked describes status of the failure because of the locked object. diff --git a/client/status/session.go b/client/status/session.go index 6f60758..f87ce61 100644 --- a/client/status/session.go +++ b/client/status/session.go @@ -1,8 +1,8 @@ package apistatus import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status" ) // SessionTokenNotFound describes status of the failure because of the missing session token. diff --git a/client/status/success.go b/client/status/success.go index a68983d..3975b92 100644 --- a/client/status/success.go +++ b/client/status/success.go @@ -1,7 +1,7 @@ package apistatus import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status" ) // SuccessDefaultV2 represents Status instance of default success. Implements StatusV2. diff --git a/client/status/unrecognized.go b/client/status/unrecognized.go index 19e481e..e4b4a81 100644 --- a/client/status/unrecognized.go +++ b/client/status/unrecognized.go @@ -1,7 +1,7 @@ package apistatus import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status" ) type unrecognizedStatusV2 struct { diff --git a/client/status/v2.go b/client/status/v2.go index 5cee3be..95dfb8a 100644 --- a/client/status/v2.go +++ b/client/status/v2.go @@ -3,11 +3,11 @@ package apistatus import ( "fmt" - "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/object" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/apemanager" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status" ) // StatusV2 defines a variety of Status instances compatible with FrostFS API V2 protocol. @@ -16,7 +16,7 @@ import ( type StatusV2 interface { Status - // ToStatusV2 returns the status as git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status.Status message structure. + // ToStatusV2 returns the status as git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status.Status message structure. ToStatusV2() *status.Status } diff --git a/container/container.go b/container/container.go index 39c6259..ff63adb 100644 --- a/container/container.go +++ b/container/container.go @@ -9,9 +9,9 @@ import ( "strings" "time" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" - v2netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container" + v2netmap "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/acl" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto" @@ -37,7 +37,7 @@ import ( // Instances for existing containers can be initialized using decoding methods // (e.g Unmarshal). // -// Container is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container.Container +// Container is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container.Container // message. See ReadFromV2 / WriteToV2 methods. type Container struct { v2 container.Container diff --git a/container/container_test.go b/container/container_test.go index c5f1b7e..a66a866 100644 --- a/container/container_test.go +++ b/container/container_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - v2container "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" - v2netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + v2container "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container" + v2netmap "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test" diff --git a/container/doc.go b/container/doc.go index 34b044d..85e2082 100644 --- a/container/doc.go +++ b/container/doc.go @@ -27,7 +27,7 @@ Instances can be also used to process FrostFS API V2 protocol messages On client side: - import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" + import "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container" var msg container.Container cnr.WriteToV2(&msg) diff --git a/container/id/id.go b/container/id/id.go index bde739c..569968a 100644 --- a/container/id/id.go +++ b/container/id/id.go @@ -4,13 +4,13 @@ import ( "crypto/sha256" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" "github.com/mr-tron/base58" ) // ID represents FrostFS container identifier. // -// ID is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs.ContainerID +// ID is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs.ContainerID // message. See ReadFromV2 / WriteToV2 methods. // // Instances can be created using built-in var declaration. diff --git a/container/id/id_test.go b/container/id/id_test.go index ded7457..6f60d92 100644 --- a/container/id/id_test.go +++ b/container/id/id_test.go @@ -5,7 +5,7 @@ import ( "crypto/sha256" "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test" "github.com/mr-tron/base58" diff --git a/crypto/crypto_test.go b/crypto/crypto_test.go index 7d1ad52..da33d88 100644 --- a/crypto/crypto_test.go +++ b/crypto/crypto_test.go @@ -4,7 +4,7 @@ import ( "crypto/rand" "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto" frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" diff --git a/crypto/doc.go b/crypto/doc.go index 8b568f5..7fc66c1 100644 --- a/crypto/doc.go +++ b/crypto/doc.go @@ -29,7 +29,7 @@ Signature can be also used to process FrostFS API V2 protocol messages On client side: - import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + import "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" var msg refs.Signature sig.WriteToV2(&msg) diff --git a/crypto/ecdsa/wallet_connect.go b/crypto/ecdsa/wallet_connect.go index 34cbcae..0fe8651 100644 --- a/crypto/ecdsa/wallet_connect.go +++ b/crypto/ecdsa/wallet_connect.go @@ -6,7 +6,7 @@ import ( "encoding/base64" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/signature/walletconnect" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/signature/walletconnect" frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" ) diff --git a/crypto/signature.go b/crypto/signature.go index 33c6132..f8a668e 100644 --- a/crypto/signature.go +++ b/crypto/signature.go @@ -4,13 +4,13 @@ import ( "errors" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" ) // Signature represents a confirmation of data integrity received by the // digital signature mechanism. // -// Signature is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs.Signature +// Signature is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs.Signature // message. See ReadFromV2 / WriteToV2 methods. // // Note that direct typecast is not safe and may result in loss of compatibility: diff --git a/crypto/signer.go b/crypto/signer.go index 9f99e3d..be96973 100644 --- a/crypto/signer.go +++ b/crypto/signer.go @@ -3,7 +3,7 @@ package frostfscrypto import ( "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" ) // Scheme represents digital signature algorithm with fixed cryptographic hash function. diff --git a/eacl/enums.go b/eacl/enums.go index b2b5353..8f693ec 100644 --- a/eacl/enums.go +++ b/eacl/enums.go @@ -1,7 +1,7 @@ package eacl import ( - v2acl "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" + v2acl "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" ) // Action taken if ContainerEACL record matched request. diff --git a/eacl/enums_test.go b/eacl/enums_test.go index 29f2518..e283b09 100644 --- a/eacl/enums_test.go +++ b/eacl/enums_test.go @@ -3,7 +3,7 @@ package eacl_test import ( "testing" - v2acl "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" + v2acl "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/eacl" "github.com/stretchr/testify/require" ) diff --git a/eacl/filter.go b/eacl/filter.go index 4403e5a..af32eae 100644 --- a/eacl/filter.go +++ b/eacl/filter.go @@ -3,7 +3,7 @@ package eacl import ( "strconv" - v2acl "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" + v2acl "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" ) // Filter defines check conditions if request header is matched or not. Matched diff --git a/eacl/filter_test.go b/eacl/filter_test.go index 74b9a10..3a01a32 100644 --- a/eacl/filter_test.go +++ b/eacl/filter_test.go @@ -4,7 +4,7 @@ import ( "strconv" "testing" - v2acl "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" + v2acl "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" "github.com/stretchr/testify/require" ) diff --git a/eacl/record.go b/eacl/record.go index 3c0d44a..c808387 100644 --- a/eacl/record.go +++ b/eacl/record.go @@ -3,7 +3,7 @@ package eacl import ( "crypto/ecdsa" - v2acl "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" + v2acl "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/checksum" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" diff --git a/eacl/record_test.go b/eacl/record_test.go index a1738fc..02301da 100644 --- a/eacl/record_test.go +++ b/eacl/record_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - v2acl "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" + v2acl "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" checksumtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/checksum/test" cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" diff --git a/eacl/table.go b/eacl/table.go index 6982b85..3fc9e60 100644 --- a/eacl/table.go +++ b/eacl/table.go @@ -4,8 +4,8 @@ import ( "crypto/sha256" "fmt" - v2acl "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + v2acl "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/version" ) diff --git a/eacl/table_test.go b/eacl/table_test.go index 4ec110f..630d3ed 100644 --- a/eacl/table_test.go +++ b/eacl/table_test.go @@ -4,7 +4,7 @@ import ( "crypto/sha256" "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/eacl" eacltest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/eacl/test" diff --git a/eacl/target.go b/eacl/target.go index 2b8b709..a2f9c36 100644 --- a/eacl/target.go +++ b/eacl/target.go @@ -4,7 +4,7 @@ import ( "bytes" "crypto/ecdsa" - v2acl "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" + v2acl "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" ) diff --git a/eacl/target_test.go b/eacl/target_test.go index e226194..9da4f82 100644 --- a/eacl/target_test.go +++ b/eacl/target_test.go @@ -4,7 +4,7 @@ import ( "crypto/ecdsa" "testing" - v2acl "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" + v2acl "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "github.com/stretchr/testify/require" ) diff --git a/go.mod b/go.mod index 7c46916..ed14604 100644 --- a/go.mod +++ b/go.mod @@ -3,34 +3,35 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.22 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20241011114054-f0fc40e116d1 git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e + git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 + github.com/VictoriaMetrics/easyproto v0.1.4 github.com/antlr4-go/antlr/v4 v4.13.1 github.com/google/uuid v1.6.0 github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/klauspost/reedsolomon v1.12.1 + github.com/mailru/easyjson v0.7.7 github.com/mr-tron/base58 v1.2.0 github.com/nspcc-dev/neo-go v0.106.2 github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.27.0 + golang.org/x/sync v0.7.0 google.golang.org/grpc v1.66.2 google.golang.org/protobuf v1.34.1 gopkg.in/yaml.v3 v3.0.1 ) require ( - git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 // indirect git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 // indirect - github.com/VictoriaMetrics/easyproto v0.1.4 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/golang/snappy v0.0.1 // indirect github.com/gorilla/websocket v1.5.1 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/klauspost/cpuid/v2 v2.2.6 // indirect - github.com/mailru/easyjson v0.7.7 // indirect + github.com/kr/pretty v0.1.0 // indirect github.com/nspcc-dev/go-ordered-json v0.0.0-20240301084351-0246b013f8b2 // indirect github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20240521091047-78685785716d // indirect github.com/nspcc-dev/rfc6979 v0.2.1 // indirect @@ -42,8 +43,8 @@ require ( golang.org/x/crypto v0.24.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect golang.org/x/net v0.26.0 // indirect - golang.org/x/sync v0.7.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 ) diff --git a/go.sum b/go.sum index 7451104..56930c7 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,3 @@ -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20241011114054-f0fc40e116d1 h1:ivcdxQeQDnx4srF2ezoaeVlF0FAycSAztwfIUJnUI4s= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20241011114054-f0fc40e116d1/go.mod h1:F5GS7hRb62PUy5sTYDC4ajVdeffoAfjHSSHTKUJEaYU= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e h1:kcBqZBiFIUBATUqEuvVigtkJJWQ2Gug/eYXn967o3M4= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e/go.mod h1:F/fe1OoIDKr5Bz99q4sriuHDuf3aZefZy9ZsCqEtgxc= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= @@ -65,6 +63,8 @@ github.com/klauspost/reedsolomon v1.12.1 h1:NhWgum1efX1x58daOBGCFWcxtEhOhXKKl1HA github.com/klauspost/reedsolomon v1.12.1/go.mod h1:nEi5Kjb6QqtbofI6s+cbG/j1da11c96IBYBSnVGtuBs= 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/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= diff --git a/netmap/context.go b/netmap/context.go index ca791e8..2772725 100644 --- a/netmap/context.go +++ b/netmap/context.go @@ -3,7 +3,7 @@ package netmap import ( "errors" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" "git.frostfs.info/TrueCloudLab/hrw" ) diff --git a/netmap/doc.go b/netmap/doc.go index cea3f48..39122f7 100644 --- a/netmap/doc.go +++ b/netmap/doc.go @@ -19,7 +19,7 @@ Instances can be also used to process FrostFS API V2 protocol messages On client side: - import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + import "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" var msg netmap.NodeInfo info.WriteToV2(&msg) diff --git a/netmap/filter.go b/netmap/filter.go index 76d8545..38230b7 100644 --- a/netmap/filter.go +++ b/netmap/filter.go @@ -5,7 +5,7 @@ import ( "strconv" "strings" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" ) // mainFilterName is a name of the filter diff --git a/netmap/filter_test.go b/netmap/filter_test.go index 2b88b3c..5748959 100644 --- a/netmap/filter_test.go +++ b/netmap/filter_test.go @@ -4,7 +4,7 @@ import ( "errors" "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" "github.com/stretchr/testify/require" ) diff --git a/netmap/helper_test.go b/netmap/helper_test.go index 3775f18..de98c96 100644 --- a/netmap/helper_test.go +++ b/netmap/helper_test.go @@ -1,7 +1,7 @@ package netmap import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" ) func newFilter(name string, k, v string, op netmap.Operation, fs ...Filter) (f Filter) { diff --git a/netmap/netmap.go b/netmap/netmap.go index 85e2a84..0d3b668 100644 --- a/netmap/netmap.go +++ b/netmap/netmap.go @@ -3,14 +3,14 @@ package netmap import ( "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" "git.frostfs.info/TrueCloudLab/hrw" ) // NetMap represents FrostFS network map. It includes information about all // storage nodes registered in FrostFS the network. // -// NetMap is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap.NetMap +// NetMap is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap.NetMap // message. See ReadFromV2 / WriteToV2 methods. // // Instances can be created using built-in var declaration. diff --git a/netmap/netmap_test.go b/netmap/netmap_test.go index 7c286a4..2aab542 100644 --- a/netmap/netmap_test.go +++ b/netmap/netmap_test.go @@ -3,7 +3,7 @@ package netmap_test import ( "testing" - v2netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + v2netmap "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" netmaptest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap/test" "github.com/stretchr/testify/require" diff --git a/netmap/network_info.go b/netmap/network_info.go index 1e553f4..11b0f14 100644 --- a/netmap/network_info.go +++ b/netmap/network_info.go @@ -6,14 +6,14 @@ import ( "errors" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" "github.com/nspcc-dev/neo-go/pkg/vm/stackitem" ) // NetworkInfo groups information about the FrostFS network state. Mainly used to // describe the current state of the network. // -// NetworkInfo is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap.NetworkInfo +// NetworkInfo is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap.NetworkInfo // message. See ReadFromV2 / WriteToV2 methods. // // Instances can be created using built-in var declaration. diff --git a/netmap/network_info_test.go b/netmap/network_info_test.go index 161d152..7e6dc12 100644 --- a/netmap/network_info_test.go +++ b/netmap/network_info_test.go @@ -4,7 +4,7 @@ import ( "encoding/binary" "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" . "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" "github.com/stretchr/testify/require" ) diff --git a/netmap/node_info.go b/netmap/node_info.go index 4be4b70..0d250ce 100644 --- a/netmap/node_info.go +++ b/netmap/node_info.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto" "git.frostfs.info/TrueCloudLab/hrw" ) @@ -18,7 +18,7 @@ import ( // about the nodes is available to all network participants to work with the network // map (mainly to comply with container storage policies). // -// NodeInfo is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap.NodeInfo +// NodeInfo is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap.NodeInfo // message. See ReadFromV2 / WriteToV2 methods. // // Instances can be created using built-in var declaration. diff --git a/netmap/node_info_test.go b/netmap/node_info_test.go index de61a21..54c78b2 100644 --- a/netmap/node_info_test.go +++ b/netmap/node_info_test.go @@ -3,7 +3,7 @@ package netmap import ( "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" "github.com/stretchr/testify/require" ) diff --git a/netmap/policy.go b/netmap/policy.go index 48ca364..735e4f1 100644 --- a/netmap/policy.go +++ b/netmap/policy.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap/parser" "github.com/antlr4-go/antlr/v4" ) @@ -16,7 +16,7 @@ import ( // Within itself, PlacementPolicy represents a set of rules to select a subset // of nodes from FrostFS network map - node-candidates for object storage. // -// PlacementPolicy is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap.PlacementPolicy +// PlacementPolicy is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap.PlacementPolicy // message. See ReadFromV2 / WriteToV2 methods. // // Instances can be created using built-in var declaration. diff --git a/netmap/selector.go b/netmap/selector.go index ab73cec..3e8adad 100644 --- a/netmap/selector.go +++ b/netmap/selector.go @@ -5,7 +5,7 @@ import ( "fmt" "slices" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" "git.frostfs.info/TrueCloudLab/hrw" ) diff --git a/netmap/selector_test.go b/netmap/selector_test.go index 6ef5883..538b845 100644 --- a/netmap/selector_test.go +++ b/netmap/selector_test.go @@ -12,7 +12,7 @@ import ( "strings" "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" "git.frostfs.info/TrueCloudLab/hrw" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/netmap/yml_unmarshal.go b/netmap/yml_unmarshal.go index 7c38b2c..239bf28 100644 --- a/netmap/yml_unmarshal.go +++ b/netmap/yml_unmarshal.go @@ -3,7 +3,7 @@ package netmap import ( "strings" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" ) type tempPlacementPolicy struct { diff --git a/object/attribute.go b/object/attribute.go index e4c7f60..8e5bc49 100644 --- a/object/attribute.go +++ b/object/attribute.go @@ -1,7 +1,7 @@ package object import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" ) // Attribute represents v2-compatible object attribute. diff --git a/object/attribute_test.go b/object/attribute_test.go index eafc312..5bca44a 100644 --- a/object/attribute_test.go +++ b/object/attribute_test.go @@ -3,7 +3,7 @@ package object import ( "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" "github.com/stretchr/testify/require" ) diff --git a/object/ecinfo.go b/object/ecinfo.go index 85345a7..f108b25 100644 --- a/object/ecinfo.go +++ b/object/ecinfo.go @@ -1,8 +1,8 @@ package object import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" ) diff --git a/object/erasure_code.go b/object/erasure_code.go index bb55fe4..d5fbb97 100644 --- a/object/erasure_code.go +++ b/object/erasure_code.go @@ -3,8 +3,8 @@ package object import ( "errors" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" ) diff --git a/object/error_test.go b/object/error_test.go index 0e52b39..0e4ab4e 100644 --- a/object/error_test.go +++ b/object/error_test.go @@ -5,8 +5,8 @@ import ( "errors" "testing" - objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + objectV2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" "github.com/stretchr/testify/require" ) diff --git a/object/fmt.go b/object/fmt.go index 5e6386d..3380a7c 100644 --- a/object/fmt.go +++ b/object/fmt.go @@ -7,7 +7,7 @@ import ( "errors" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/checksum" frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" diff --git a/object/id/address.go b/object/id/address.go index 6d5f12a..4c7b597 100644 --- a/object/id/address.go +++ b/object/id/address.go @@ -5,14 +5,14 @@ import ( "fmt" "strings" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" ) // Address represents global object identifier in FrostFS network. Each object // belongs to exactly one container and is uniquely addressed within the container. // -// Address is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs.Address +// Address is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs.Address // message. See ReadFromV2 / WriteToV2 methods. // // Instances can be created using built-in var declaration. diff --git a/object/id/address_test.go b/object/id/address_test.go index 5ae91ca..4b4a2f2 100644 --- a/object/id/address_test.go +++ b/object/id/address_test.go @@ -3,7 +3,7 @@ package oid_test import ( "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" oidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id/test" diff --git a/object/id/id.go b/object/id/id.go index 5ba0c6d..d1dfe80 100644 --- a/object/id/id.go +++ b/object/id/id.go @@ -5,7 +5,7 @@ import ( "crypto/sha256" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto" frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa" "github.com/mr-tron/base58" @@ -13,7 +13,7 @@ import ( // ID represents FrostFS object identifier in a container. // -// ID is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs.ObjectID +// ID is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs.ObjectID // message. See ReadFromV2 / WriteToV2 methods. // // Instances can be created using built-in var declaration. diff --git a/object/id/id_test.go b/object/id/id_test.go index 3f35a3b..e1a2e26 100644 --- a/object/id/id_test.go +++ b/object/id/id_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" "github.com/mr-tron/base58" "github.com/stretchr/testify/require" ) diff --git a/object/lock.go b/object/lock.go index dd08eba..4a2063b 100644 --- a/object/lock.go +++ b/object/lock.go @@ -1,8 +1,8 @@ package object import ( - v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + v2object "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" ) diff --git a/object/object.go b/object/object.go index 718a382..b98685d 100644 --- a/object/object.go +++ b/object/object.go @@ -6,10 +6,10 @@ import ( "slices" "strings" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + v2session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/checksum" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto" diff --git a/object/object_test.go b/object/object_test.go index c082173..4348105 100644 --- a/object/object_test.go +++ b/object/object_test.go @@ -3,7 +3,7 @@ package object_test import ( "testing" - v2container "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" + v2container "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container" cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" objecttest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/test" diff --git a/object/patch.go b/object/patch.go index 1cc30fc..2a06674 100644 --- a/object/patch.go +++ b/object/patch.go @@ -1,8 +1,8 @@ package object import ( - v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + v2object "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" ) diff --git a/object/patch_test.go b/object/patch_test.go index f66fd29..84ef481 100644 --- a/object/patch_test.go +++ b/object/patch_test.go @@ -3,8 +3,8 @@ package object import ( "testing" - v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + v2object "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" oidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id/test" "github.com/stretchr/testify/require" diff --git a/object/range.go b/object/range.go index 87ad3b7..b929a73 100644 --- a/object/range.go +++ b/object/range.go @@ -1,7 +1,7 @@ package object import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" ) // Range represents v2-compatible object payload range. diff --git a/object/range_test.go b/object/range_test.go index c8208d8..14500db 100644 --- a/object/range_test.go +++ b/object/range_test.go @@ -3,7 +3,7 @@ package object import ( "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" "github.com/stretchr/testify/require" ) diff --git a/object/raw.go b/object/raw.go index 5c91f1d..c30836a 100644 --- a/object/raw.go +++ b/object/raw.go @@ -1,7 +1,7 @@ package object import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" ) // RawObject represents v2-compatible FrostFS object that provides diff --git a/object/raw_test.go b/object/raw_test.go index 52ac9de..56bbe86 100644 --- a/object/raw_test.go +++ b/object/raw_test.go @@ -5,7 +5,7 @@ import ( "crypto/sha256" "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/checksum" cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" diff --git a/object/search.go b/object/search.go index 818099d..9f61ccf 100644 --- a/object/search.go +++ b/object/search.go @@ -4,7 +4,7 @@ import ( "encoding/json" "strconv" - v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + v2object "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user" diff --git a/object/search_test.go b/object/search_test.go index 4241f7d..f113b3c 100644 --- a/object/search_test.go +++ b/object/search_test.go @@ -5,7 +5,7 @@ import ( "crypto/sha256" "testing" - v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + v2object "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" "github.com/stretchr/testify/require" diff --git a/object/splitinfo.go b/object/splitinfo.go index c38b2a4..fc3adcc 100644 --- a/object/splitinfo.go +++ b/object/splitinfo.go @@ -4,8 +4,8 @@ import ( "errors" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" ) diff --git a/object/splitinfo_test.go b/object/splitinfo_test.go index ba3a54f..9a4b370 100644 --- a/object/splitinfo_test.go +++ b/object/splitinfo_test.go @@ -5,7 +5,7 @@ import ( "encoding/json" "testing" - objv2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + objv2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" "github.com/stretchr/testify/require" diff --git a/object/tombstone.go b/object/tombstone.go index e332630..cea0b94 100644 --- a/object/tombstone.go +++ b/object/tombstone.go @@ -1,8 +1,8 @@ package object import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/tombstone" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/tombstone" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" ) diff --git a/object/tombstone_test.go b/object/tombstone_test.go index e819b22..024258e 100644 --- a/object/tombstone_test.go +++ b/object/tombstone_test.go @@ -5,7 +5,7 @@ import ( "crypto/sha256" "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/tombstone" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/tombstone" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" "github.com/stretchr/testify/require" ) diff --git a/object/transformer/transformer.go b/object/transformer/transformer.go index 4cf8c30..16c4066 100644 --- a/object/transformer/transformer.go +++ b/object/transformer/transformer.go @@ -6,7 +6,7 @@ import ( "crypto/sha256" "fmt" - buffPool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" + buffPool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/checksum" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" diff --git a/object/type.go b/object/type.go index 29328d3..5e247ab 100644 --- a/object/type.go +++ b/object/type.go @@ -1,7 +1,7 @@ package object import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" ) type Type object.Type diff --git a/object/type_test.go b/object/type_test.go index 5faa936..7c3360b 100644 --- a/object/type_test.go +++ b/object/type_test.go @@ -3,7 +3,7 @@ package object_test import ( "testing" - v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + v2object "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" "github.com/stretchr/testify/require" ) diff --git a/pool/mock_test.go b/pool/mock_test.go index 583b1a0..ad9fd94 100644 --- a/pool/mock_test.go +++ b/pool/mock_test.go @@ -7,9 +7,9 @@ import ( "go.uber.org/zap" - sessionv2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/accounting" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ape" + sessionv2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" diff --git a/pool/tree/client.go b/pool/tree/client.go index c6562c7..78a1610 100644 --- a/pool/tree/client.go +++ b/pool/tree/client.go @@ -7,7 +7,7 @@ import ( "fmt" "sync" - apiClient "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" + apiClient "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" grpcService "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool/tree/service" "google.golang.org/grpc" "google.golang.org/grpc/credentials" diff --git a/pool/tree/service/service_frostfs.pb.go b/pool/tree/service/service_frostfs.pb.go index 1a49c5c..a9a48b9 100644 --- a/pool/tree/service/service_frostfs.pb.go +++ b/pool/tree/service/service_frostfs.pb.go @@ -7,7 +7,7 @@ import ( protowire "google.golang.org/protobuf/encoding/protowire" ) -import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" +import "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" // StableSize returns the size of x in protobuf format. // diff --git a/pool/tree/service/types_frostfs.pb.go b/pool/tree/service/types_frostfs.pb.go index 707fcc3..a8dfba3 100644 --- a/pool/tree/service/types_frostfs.pb.go +++ b/pool/tree/service/types_frostfs.pb.go @@ -2,7 +2,7 @@ package tree -import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" +import "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" // StableSize returns the size of x in protobuf format. // diff --git a/prepare.sh b/prepare.sh new file mode 100755 index 0000000..a7b6100 --- /dev/null +++ b/prepare.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +if [ -z "$1" ]; then + echo "usage: ./prepare.sh path/to/frostfs-api" + exit 1 +fi + +API_GO_PATH=$(pwd)/api +API_PATH=$1 + +# MOVE FILES FROM API REPO +cd "$API_PATH" || exit 1 +ARGS=$(find ./ -name '*.proto' -not -path './bin/*') +for file in $ARGS; do + dir=$(dirname "$file") + mkdir -p "$API_GO_PATH/$dir/grpc" + cp -r "$dir"/* "$API_GO_PATH/$dir/grpc" +done + +# MODIFY FILES +cd "$API_GO_PATH" || exit 1 +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 + sed -i "s/api-go\\/v2/sdk-go\\/api/" $file + sed -i "s/import \"/import \"api\//" $file +done + + +cd "$API_GO_PATH/.." || exit 1 +# COMPILE +make protoc + +# REMOVE PROTO DEFINITIONS +ARGS=$(find ./$prefix -name '*.proto' -not -path './util/*' -not -path './bin/*') +for file in $ARGS; do + rm "$file" +done diff --git a/session/common.go b/session/common.go index b103b59..3d7308f 100644 --- a/session/common.go +++ b/session/common.go @@ -6,8 +6,8 @@ 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-sdk-go/api/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto" frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user" diff --git a/session/container.go b/session/container.go index 45c5ff8..463523b 100644 --- a/session/container.go +++ b/session/container.go @@ -5,8 +5,8 @@ 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-sdk-go/api/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user" @@ -18,7 +18,7 @@ import ( // limited validity period, and applies to a strictly defined set of operations. // See methods for details. // -// Container is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session.Token +// Container is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session.Token // message. See ReadFromV2 / WriteToV2 methods. // // Instances can be created using built-in var declaration. diff --git a/session/container_test.go b/session/container_test.go index 73fd815..fcf152d 100644 --- a/session/container_test.go +++ b/session/container_test.go @@ -8,8 +8,8 @@ import ( mrand "math/rand" "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + v2session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test" frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto" frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa" diff --git a/session/doc.go b/session/doc.go index 12ec0c4..98858f7 100644 --- a/session/doc.go +++ b/session/doc.go @@ -28,7 +28,7 @@ Instances can be also used to process FrostFS API V2 protocol messages On client side: - import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + import "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" var msg session.Token tok.WriteToV2(&msg) diff --git a/session/object.go b/session/object.go index 3641bd1..385ca03 100644 --- a/session/object.go +++ b/session/object.go @@ -5,8 +5,8 @@ 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-sdk-go/api/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" ) @@ -17,7 +17,7 @@ import ( // limited validity period, and applies to a strictly defined set of operations. // See methods for details. // -// Object is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session.Token +// Object is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session.Token // message. See ReadFromV2 / WriteToV2 methods. // // Instances can be created using built-in var declaration. diff --git a/session/object_test.go b/session/object_test.go index 59ff8d6..4d20773 100644 --- a/session/object_test.go +++ b/session/object_test.go @@ -8,8 +8,8 @@ import ( "math/rand" "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + v2session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test" frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto" frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa" diff --git a/user/doc.go b/user/doc.go index 4809e4a..d4e0b4b 100644 --- a/user/doc.go +++ b/user/doc.go @@ -39,7 +39,7 @@ Instances can be also used to process FrostFS API protocol messages On client side: - import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + import "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" var msg refs.OwnerID id.WriteToV2(&msg) diff --git a/user/id.go b/user/id.go index 31ff9b6..2d64d43 100644 --- a/user/id.go +++ b/user/id.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" "github.com/mr-tron/base58" "github.com/nspcc-dev/neo-go/pkg/crypto/hash" "github.com/nspcc-dev/neo-go/pkg/encoding/address" @@ -18,7 +18,7 @@ var zeroSlice = bytes.Repeat([]byte{0}, idSize) // ID identifies users of the FrostFS system. // -// ID is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs.OwnerID +// ID is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs.OwnerID // message. See ReadFromV2 / WriteToV2 methods. // // Instances can be created using built-in var declaration. Zero ID is not valid, diff --git a/user/id_test.go b/user/id_test.go index 9867472..afeb746 100644 --- a/user/id_test.go +++ b/user/id_test.go @@ -5,7 +5,7 @@ import ( "crypto/rand" "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" . "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user" usertest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user/test" "github.com/mr-tron/base58" diff --git a/version/version.go b/version/version.go index 47e61c8..2411966 100644 --- a/version/version.go +++ b/version/version.go @@ -3,12 +3,12 @@ package version import ( "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" ) // Version represents revision number in SemVer scheme. // -// Version is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs.Version +// Version is mutually compatible with git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs.Version // message. See ReadFromV2 / WriteToV2 methods. // // Instances can be created using built-in var declaration. diff --git a/version/version_test.go b/version/version_test.go index fdf2b6a..97cec9a 100644 --- a/version/version_test.go +++ b/version/version_test.go @@ -3,7 +3,7 @@ package version import ( "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" "github.com/stretchr/testify/require" ) From 5e926df3ab1bcffd0c1eeb5f067b92a3cf37f1b5 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 31 Oct 2024 09:34:57 +0300 Subject: [PATCH 115/197] [#292] .golangci.yml: Replace exportloopref with 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 b6c6d67..d3638fe 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -52,7 +52,7 @@ linters: - bidichk - durationcheck - exhaustive - - exportloopref + - copyloopvar - gofmt - goimports - misspell From 56c357d52086d128f668555b62431009aa3b2294 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 31 Oct 2024 09:35:27 +0300 Subject: [PATCH 116/197] [#292] Makefile: Update truecloudlab lint to v0.0.7 Signed-off-by: Evgenii Stratonikov --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6f62f6d..ee9e746 100755 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ ANTLR_VERSION=4.13.1 TMP_DIR := .cache LINT_VERSION ?= 1.60.1 -TRUECLOUDLAB_LINT_VERSION ?= 0.0.6 +TRUECLOUDLAB_LINT_VERSION ?= 0.0.7 OUTPUT_LINT_DIR ?= $(shell pwd)/bin LINT_DIR = $(OUTPUT_LINT_DIR)/golangci-lint-$(LINT_VERSION)-v$(TRUECLOUDLAB_LINT_VERSION) From afbe15086fa230bc732e1fa4009fd50f4404ca2d Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 31 Oct 2024 09:36:11 +0300 Subject: [PATCH 117/197] [#292] Makefile: Update golangci-lint to v1.61.0 Signed-off-by: Evgenii Stratonikov --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ee9e746..a3552b3 100755 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ ANTLR_VERSION=4.13.1 TMP_DIR := .cache -LINT_VERSION ?= 1.60.1 +LINT_VERSION ?= 1.61.0 TRUECLOUDLAB_LINT_VERSION ?= 0.0.7 OUTPUT_LINT_DIR ?= $(shell pwd)/bin LINT_DIR = $(OUTPUT_LINT_DIR)/golangci-lint-$(LINT_VERSION)-v$(TRUECLOUDLAB_LINT_VERSION) From 56c4aaaaca2a124dc1e5002a1684867886b373a3 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 31 Oct 2024 09:38:45 +0300 Subject: [PATCH 118/197] [#292] .golangci.yml: Add intrange linter, fix warnings Signed-off-by: Evgenii Stratonikov --- .golangci.yml | 1 + eacl/record.go | 4 ++-- eacl/table.go | 2 +- eacl/target.go | 2 +- pool/tree/pool.go | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index d3638fe..95a6fdc 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -64,5 +64,6 @@ linters: - gocognit - contextcheck - protogetter + - intrange disable-all: true fast: false diff --git a/eacl/record.go b/eacl/record.go index c808387..0165992 100644 --- a/eacl/record.go +++ b/eacl/record.go @@ -286,13 +286,13 @@ func equalRecords(r1, r2 Record) bool { return false } - for i := range len(fs1) { + for i := range fs1 { if !equalFilters(fs1[i], fs2[i]) { return false } } - for i := range len(ts1) { + for i := range ts1 { if !equalTargets(ts1[i], ts2[i]) { return false } diff --git a/eacl/table.go b/eacl/table.go index 3fc9e60..6d491e9 100644 --- a/eacl/table.go +++ b/eacl/table.go @@ -212,7 +212,7 @@ func EqualTables(t1, t2 Table) bool { return false } - for i := range len(rs1) { + for i := range rs1 { if !equalRecords(rs1[i], rs2[i]) { return false } diff --git a/eacl/target.go b/eacl/target.go index a2f9c36..dc6fdc2 100644 --- a/eacl/target.go +++ b/eacl/target.go @@ -169,7 +169,7 @@ func equalTargets(t1, t2 Target) bool { return false } - for i := range len(keys1) { + for i := range keys1 { if !bytes.Equal(keys1[i], keys2[i]) { return false } diff --git a/pool/tree/pool.go b/pool/tree/pool.go index 0d7c117..b04ab2c 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -382,7 +382,7 @@ type SubTreeReader struct { // Read reads another list of the subtree nodes. func (x *SubTreeReader) Read(buf []*grpcService.GetSubTreeResponse_Body) (int, error) { - for i := range len(buf) { + for i := range buf { resp, err := x.cli.Recv() if err == io.EOF { return i, io.EOF From 43d5c8dbac3daae651fd883eef390e6d01366d77 Mon Sep 17 00:00:00 2001 From: Nikita Zinkevich Date: Wed, 23 Oct 2024 17:36:08 +0300 Subject: [PATCH 119/197] [#185] tree/pool: Control timeout of tree service operations Implemented context timeout for all tree service operations except those that return a GRPC stream Signed-off-by: Nikita Zinkevich --- pool/tree/pool.go | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/pool/tree/pool.go b/pool/tree/pool.go index b04ab2c..15d4c68 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -91,6 +91,7 @@ type Pool struct { methods []*pool.MethodStatus maxRequestAttempts int + streamTimeout time.Duration startIndicesMtx sync.RWMutex // startIndices points to the client from which the next request will be executed. @@ -231,6 +232,7 @@ func NewPool(options InitParameters) (*Pool, error) { clientRebalanceInterval: options.clientRebalanceInterval, }, maxRequestAttempts: options.maxRequestAttempts, + streamTimeout: options.nodeStreamTimeout, methods: methods, } @@ -355,7 +357,9 @@ func (p *Pool) GetNodes(ctx context.Context, prm GetNodesParams) ([]*grpcService var resp *grpcService.GetNodeByPathResponse err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) (inErr error) { - resp, inErr = client.GetNodeByPath(ctx, request) + reqCtx, cancel := context.WithTimeout(ctx, p.streamTimeout) + defer cancel() + resp, inErr = client.GetNodeByPath(reqCtx, request) // Pool wants to do retry 'GetNodeByPath' request if result is empty. // Empty result is expected due to delayed tree service sync. // Return an error there to trigger retry and ignore it after, @@ -489,7 +493,9 @@ func (p *Pool) AddNode(ctx context.Context, prm AddNodeParams) (uint64, error) { var resp *grpcService.AddResponse err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) (inErr error) { - resp, inErr = client.Add(ctx, request) + reqCtx, cancel := context.WithTimeout(ctx, p.streamTimeout) + defer cancel() + resp, inErr = client.Add(reqCtx, request) return handleError("failed to add node", inErr) }) p.methods[methodAddNode].IncRequests(time.Since(start)) @@ -524,7 +530,9 @@ func (p *Pool) AddNodeByPath(ctx context.Context, prm AddNodeByPathParams) (uint var resp *grpcService.AddByPathResponse err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) (inErr error) { - resp, inErr = client.AddByPath(ctx, request) + reqCtx, cancel := context.WithTimeout(ctx, p.streamTimeout) + defer cancel() + resp, inErr = client.AddByPath(reqCtx, request) return handleError("failed to add node by path", inErr) }) p.methods[methodAddNodeByPath].IncRequests(time.Since(start)) @@ -566,7 +574,9 @@ func (p *Pool) MoveNode(ctx context.Context, prm MoveNodeParams) error { } err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) error { - if _, err := client.Move(ctx, request); err != nil { + reqCtx, cancel := context.WithTimeout(ctx, p.streamTimeout) + defer cancel() + if _, err := client.Move(reqCtx, request); err != nil { return handleError("failed to move node", err) } return nil @@ -597,7 +607,9 @@ func (p *Pool) RemoveNode(ctx context.Context, prm RemoveNodeParams) error { } err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) error { - if _, err := client.Remove(ctx, request); err != nil { + reqCtx, cancel := context.WithTimeout(ctx, p.streamTimeout) + defer cancel() + if _, err := client.Remove(reqCtx, request); err != nil { return handleError("failed to remove node", err) } return nil From 6980651785d7801ea88b516eac17fbd55a6b07c0 Mon Sep 17 00:00:00 2001 From: Vitaliy Potyarkin Date: Wed, 6 Nov 2024 12:21:55 +0300 Subject: [PATCH 120/197] [#296] 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 --- {.github => .forgejo}/ISSUE_TEMPLATE/bug_report.md | 0 {.github => .forgejo}/ISSUE_TEMPLATE/config.yml | 0 {.github => .forgejo}/ISSUE_TEMPLATE/feature_request.md | 0 .github/CODEOWNERS | 1 - CODEOWNERS | 1 + 5 files changed, 1 insertion(+), 1 deletion(-) 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%) 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/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index c934445..0000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @TrueCloudLab/storage-core @TrueCloudLab/storage-services diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..c764212 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +.* @TrueCloudLab/storage-core @TrueCloudLab/storage-services From cb813e27a8236a5baffc83bf869be2f4e4be05cc Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 5 Nov 2024 16:07:40 +0300 Subject: [PATCH 121/197] [#293] object: Fix payload size limiter * Sending empty chunks by `writeChunk` should not release new objects as this doesn't change `payloadSizeLimiter` internal state. * This also fixes the bug with patcher when an offset of a patch equals to `MaxSize` - `payloadSizeLimiter` releases object again although state is the same. This led to error because EC-encoder receieved empty payload and couldn't not process it. Signed-off-by: Airat Arifullin --- object/transformer/transformer.go | 2 +- object/transformer/transformer_test.go | 72 ++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) diff --git a/object/transformer/transformer.go b/object/transformer/transformer.go index 16c4066..f7e5cd3 100644 --- a/object/transformer/transformer.go +++ b/object/transformer/transformer.go @@ -261,7 +261,7 @@ func (s *payloadSizeLimiter) initializeLinking(parHdr *object.Object) { func (s *payloadSizeLimiter) writeChunk(ctx context.Context, chunk []byte) error { for { // statement is true if the previous write of bytes reached exactly the boundary. - if s.written > 0 && s.written%s.MaxSize == 0 { + if len(chunk) > 0 && s.written > 0 && s.written%s.MaxSize == 0 { if s.written == s.MaxSize { s.prepareFirstChild() } diff --git a/object/transformer/transformer_test.go b/object/transformer/transformer_test.go index a170835..319bf37 100644 --- a/object/transformer/transformer_test.go +++ b/object/transformer/transformer_test.go @@ -15,6 +15,78 @@ import ( "github.com/stretchr/testify/require" ) +func TestTransformerNonMonotonicWrites(t *testing.T) { + const maxSize = 16 + + tt := new(testTarget) + target, pk := newPayloadSizeLimiter(maxSize, 0, func() ObjectWriter { return tt }) + cnr := cidtest.ID() + hdr := newObject(cnr) + var owner user.ID + user.IDFromKey(&owner, pk.PrivateKey.PublicKey) + hdr.SetOwnerID(owner) + payload := make([]byte, 3*maxSize) + _, _ = rand.Read(payload) + + ctx := context.Background() + require.NoError(t, target.WriteHeader(ctx, hdr)) + + lessThanMaxSizePayload := make([]byte, maxSize/2) + _, _ = rand.Read(lessThanMaxSizePayload) + + _, err := target.Write(ctx, lessThanMaxSizePayload) + require.NoError(t, err) + + moreThanMaxSizePayload := make([]byte, maxSize*1.5) + _, _ = rand.Read(moreThanMaxSizePayload) + + _, err = target.Write(ctx, moreThanMaxSizePayload) + require.NoError(t, err) + + _, err = target.Close(ctx) + require.NoError(t, err) + + require.Equal(t, 3, len(tt.objects)) + require.Equal(t, append(lessThanMaxSizePayload, moreThanMaxSizePayload[:maxSize-len(lessThanMaxSizePayload)]...), tt.objects[0].Payload()) + require.Equal(t, moreThanMaxSizePayload[maxSize-len(lessThanMaxSizePayload):], tt.objects[1].Payload()) + require.Equal(t, 2, len(tt.objects[2].Children())) +} + +func TestTransformerNonEffectiveWrites(t *testing.T) { + const maxSize = 16 + + tt := new(testTarget) + target, pk := newPayloadSizeLimiter(maxSize, 0, func() ObjectWriter { return tt }) + cnr := cidtest.ID() + hdr := newObject(cnr) + var owner user.ID + user.IDFromKey(&owner, pk.PrivateKey.PublicKey) + hdr.SetOwnerID(owner) + payload := make([]byte, 3*maxSize) + _, _ = rand.Read(payload) + + ctx := context.Background() + require.NoError(t, target.WriteHeader(ctx, hdr)) + + _, err := target.Write(ctx, payload) + require.NoError(t, err) + + for range 5 { + // run onto unchanged target state + _, err = target.Write(ctx, []byte{}) + require.NoError(t, err) + } + + _, err = target.Close(ctx) + require.NoError(t, err) + + require.Equal(t, 4, len(tt.objects)) + require.Equal(t, payload[:maxSize], tt.objects[0].Payload()) + require.Equal(t, payload[maxSize:2*maxSize], tt.objects[1].Payload()) + require.Equal(t, payload[2*maxSize:], tt.objects[2].Payload()) + require.Equal(t, 3, len(tt.objects[3].Children())) +} + func TestTransformer(t *testing.T) { const maxSize = 100 From afdc2d8340bbe9e38ff36b6185187a15400b3c23 Mon Sep 17 00:00:00 2001 From: Vitaliy Potyarkin Date: Wed, 13 Nov 2024 10:41:25 +0300 Subject: [PATCH 122/197] [#297] bearer: Update module docstring Module top level docstring was referencing outdated APIs which do not exist anymore. Signed-off-by: Vitaliy Potyarkin --- bearer/doc.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/bearer/doc.go b/bearer/doc.go index c97ab48..256fae2 100644 --- a/bearer/doc.go +++ b/bearer/doc.go @@ -1,19 +1,19 @@ /* Package bearer provides bearer token definition. -Bearer token is attached to the object service requests, and it overwrites -extended ACL of the container. Mainly it is used to provide access of private +Bearer token is attached to the object service requests, and it can override +APE policy set on the container. Mainly it is used to provide access to private data for specific user. Therefore, it must be signed by owner of the container. -Define bearer token by setting correct lifetime, extended ACL and owner ID of +Define bearer token by setting correct lifetime, APE policy and owner ID of the user that will attach token to its requests. var bearerToken bearer.Token - bearerToken.SetExpiration(500) - bearerToken.SetIssuedAt(10) - bearerToken.SetNotBefore(10) - bearerToken.SetEACL(eaclTable) - bearerToken.SetOwner(ownerID) + bearerToken.SetExp(500) + bearerToken.SetIat(10) + bearerToken.SetNbf(10) + bearerToken.SetAPEOverride(apeOverride) + bearerToken.ForUser(ownerID) Bearer token must be signed by owner of the container. @@ -24,8 +24,6 @@ sender can attach this bearer token to the object service requests: import sdkClient "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client" - var headParams sdkClient.PrmObjectHead - headParams.WithBearerToken(bearerToken) - response, err := client.ObjectHead(ctx, headParams) + response, err := client.ObjectHead(ctx, sdkClient.PrmObjectHead{BearerToken: bearerToken}) */ package bearer From 0352b5b191ad110070043ada4f8d1f0a998bb74c Mon Sep 17 00:00:00 2001 From: Nikita Zinkevich Date: Thu, 7 Nov 2024 14:29:55 +0300 Subject: [PATCH 123/197] [#185] Implement rpc/client for tree service Signed-off-by: Nikita Zinkevich --- api/rpc/tree.go | 178 ++++ api/tree/convert.go | 1591 +++++++++++++++++++++++++++++++++++ api/tree/types.go | 953 +++++++++++++++++++++ pool/tree/client.go | 81 +- pool/tree/pool.go | 218 ++--- pool/tree/pool_signature.go | 6 +- pool/tree/pool_test.go | 12 +- 7 files changed, 2875 insertions(+), 164 deletions(-) create mode 100644 api/rpc/tree.go create mode 100644 api/tree/convert.go create mode 100644 api/tree/types.go diff --git a/api/rpc/tree.go b/api/rpc/tree.go new file mode 100644 index 0000000..8f5bf0a --- /dev/null +++ b/api/rpc/tree.go @@ -0,0 +1,178 @@ +package rpc + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/common" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/tree" +) + +const serviceTree = "tree.TreeService" + +const ( + rpcTreeAdd = "Add" + rpcTreeAddByPath = "AddByPath" + rpcTreeRemove = "Remove" + rpcTreeMove = "Move" + rpcTreeGetNodeByPath = "GetNodeByPath" + rpcTreeGetSubTree = "GetSubTree" + rpcTreeList = "TreeList" + rpcTreeApply = "Apply" + rpcTreeGetOpLog = "GetOpLog" + rpcTreeHealthcheck = "Healthcheck" +) + +func Add( + cli *client.Client, + req *tree.AddRequest, + opts ...client.CallOption, +) (*tree.AddResponse, error) { + resp := new(tree.AddResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceTree, rpcTreeAdd), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} + +func AddByPath( + cli *client.Client, + req *tree.AddByPathRequest, + opts ...client.CallOption, +) (*tree.AddByPathResponse, error) { + resp := new(tree.AddByPathResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceTree, rpcTreeAddByPath), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} + +func Remove(cli *client.Client, + req *tree.RemoveRequest, + opts ...client.CallOption, +) (*tree.RemoveResponse, error) { + resp := new(tree.RemoveResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceTree, rpcTreeRemove), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} + +func Move(cli *client.Client, + req *tree.MoveRequest, + opts ...client.CallOption, +) (*tree.MoveResponse, error) { + resp := new(tree.MoveResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceTree, rpcTreeMove), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} + +func GetNodeByPath(cli *client.Client, + req *tree.GetNodeByPathRequest, + opts ...client.CallOption, +) (*tree.GetNodeByPathResponse, error) { + resp := new(tree.GetNodeByPathResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceTree, rpcTreeGetNodeByPath), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} + +type GetSubTreeResponseReader struct { + r client.MessageReader +} + +// Read reads response from the stream. +// +// Returns io.EOF of streaming is finished. +func (r *GetSubTreeResponseReader) Read(resp *tree.GetSubTreeResponse) error { + return r.r.ReadMessage(resp) +} + +func GetSubTree(cli *client.Client, + req *tree.GetSubTreeRequest, + opts ...client.CallOption, +) (*GetSubTreeResponseReader, error) { + wc, err := client.OpenServerStream(cli, common.CallMethodInfoServerStream(serviceTree, rpcTreeGetSubTree), req, opts...) + if err != nil { + return nil, err + } + + return &GetSubTreeResponseReader{ + r: wc, + }, nil +} + +func TreeList(cli *client.Client, + req *tree.ListRequest, + opts ...client.CallOption, +) (*tree.ListResponse, error) { + resp := new(tree.ListResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceTree, rpcTreeList), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} + +func Apply(cli *client.Client, + req *tree.ApplyRequest, + opts ...client.CallOption, +) (*tree.ApplyResponse, error) { + resp := new(tree.ApplyResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceTree, rpcTreeApply), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} + +type TreeServiceGetOpLogResponseReader struct { + r client.MessageReader +} + +// Read reads response from the stream. +// +// Returns io.EOF of streaming is finished. +func (r *TreeServiceGetOpLogResponseReader) Read(resp *tree.GetOpLogResponse) error { + return r.r.ReadMessage(resp) +} + +func GetOpLog(cli *client.Client, + req *tree.GetOpLogRequest, + opts ...client.CallOption, +) (*TreeServiceGetOpLogResponseReader, error) { + wc, err := client.OpenServerStream(cli, common.CallMethodInfoServerStream(serviceTree, rpcTreeGetOpLog), req, opts...) + if err != nil { + return nil, err + } + + return &TreeServiceGetOpLogResponseReader{ + r: wc, + }, nil +} + +func Healthcheck(cli *client.Client, + req *tree.HealthcheckRequest, + opts ...client.CallOption, +) (*tree.HealthcheckResponse, error) { + resp := new(tree.HealthcheckResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceTree, rpcTreeHealthcheck), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} diff --git a/api/tree/convert.go b/api/tree/convert.go new file mode 100644 index 0000000..1611504 --- /dev/null +++ b/api/tree/convert.go @@ -0,0 +1,1591 @@ +package tree + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" + tree "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool/tree/service" +) + +func metaToGRPC(m []*KeyValue) (res []*tree.KeyValue) { + if m != nil { + res = make([]*tree.KeyValue, 0, len(m)) + + for i := range m { + res = append(res, m[i].ToGRPCMessage().(*tree.KeyValue)) + } + } + + return +} + +func metaFromGRPC(m []*tree.KeyValue) (res []*KeyValue, err error) { + if m != nil { + res = make([]*KeyValue, len(m)) + + for i := range m { + res[i] = new(KeyValue) + err = res[i].FromGRPCMessage(m[i]) + if err != nil { + return + } + } + } + + return +} + +func (r *AddResponse) ToGRPCMessage() grpc.Message { + var m *tree.AddResponse + + if r != nil { + m = new(tree.AddResponse) + + m.Body = r.body.ToGRPCMessage().(*tree.AddResponse_Body) + m.SetSignature(r.signature.ToGRPCMessage().(*tree.Signature)) + } + + return m +} + +func (r *AddResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.AddResponse) + 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(AddResponseBody) + } + + err = r.body.FromGRPCMessage(body) + } + + return err +} + +func (r *AddResponseBody) ToGRPCMessage() grpc.Message { + var m *tree.AddResponse_Body + + if r != nil { + m = new(tree.AddResponse_Body) + m.NodeId = r.nodeID + } + + return m +} + +func (r *AddResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.AddResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + r.nodeID = v.GetNodeId() + + return nil +} + +func (r *AddByPathRequest) ToGRPCMessage() grpc.Message { + var m *tree.AddByPathRequest + + if r != nil { + m = new(tree.AddByPathRequest) + + m.Body = r.body.ToGRPCMessage().(*tree.AddByPathRequest_Body) + m.SetSignature(r.signature.ToGRPCMessage().(*tree.Signature)) + } + + return m +} + +func (r *AddByPathRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.AddByPathRequest) + 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(AddByPathRequestBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + sig := v.GetSignature() + if sig == nil { + r.signature = nil + } else { + if r.signature == nil { + r.signature = new(Signature) + } + err = r.signature.FromGRPCMessage(sig) + } + + return err +} + +func (r *AddByPathRequestBody) ToGRPCMessage() grpc.Message { + var m *tree.AddByPathRequest_Body + + if r != nil { + m = new(tree.AddByPathRequest_Body) + m.ContainerId = r.containerID + m.Path = r.path + m.BearerToken = r.bearerToken + m.PathAttribute = r.pathAttribute + m.TreeId = r.treeID + m.Meta = metaToGRPC(r.meta) + } + + return m +} + +func (r *AddByPathRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.AddByPathRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + meta := v.GetMeta() + if meta == nil { + r.meta = nil + } else { + r.meta, err = metaFromGRPC(meta) + if err != nil { + return err + } + } + + r.containerID = v.GetContainerId() + r.bearerToken = v.GetBearerToken() + r.path = v.GetPath() + r.pathAttribute = v.GetPathAttribute() + r.treeID = v.GetTreeId() + + return err +} + +func (r *MoveResponse) ToGRPCMessage() grpc.Message { + var m *tree.MoveResponse + + if r != nil { + m = new(tree.MoveResponse) + + m.Body = r.body.ToGRPCMessage().(*tree.MoveResponse_Body) + m.SetSignature(r.signature.ToGRPCMessage().(*tree.Signature)) + } + + return m +} + +func (r *MoveResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.MoveResponse) + 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(MoveResponseBody) + } + + err = r.body.FromGRPCMessage(body) + } + + return err +} + +func (r *MoveResponseBody) ToGRPCMessage() grpc.Message { + return new(tree.MoveResponse_Body) +} + +func (r *MoveResponseBody) FromGRPCMessage(grpc.Message) error { + return nil +} + +func (r *MoveRequest) ToGRPCMessage() grpc.Message { + var m *tree.MoveRequest + + if r != nil { + m = new(tree.MoveRequest) + m.Body = r.body.ToGRPCMessage().(*tree.MoveRequest_Body) + m.SetSignature(r.signature.ToGRPCMessage().(*tree.Signature)) + } + + return m +} + +func (r *MoveRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.MoveRequest) + 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(MoveRequestBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + sig := v.GetSignature() + if sig == nil { + r.signature = nil + } else { + if r.signature == nil { + r.signature = new(Signature) + } + + err = r.signature.FromGRPCMessage(sig) + if err != nil { + return err + } + } + + return nil +} + +func (r *MoveRequestBody) ToGRPCMessage() grpc.Message { + var m *tree.MoveRequest_Body + + if r != nil { + m = new(tree.MoveRequest_Body) + + m.ContainerId = r.containerID + m.Meta = metaToGRPC(r.meta) + m.TreeId = r.treeID + m.ParentId = r.parentID + m.BearerToken = r.bearerToken + m.NodeId = r.nodeID + } + + return m +} + +func (r *MoveRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.MoveRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + r.meta, err = metaFromGRPC(v.GetMeta()) + if err != nil { + return err + } + r.treeID = v.GetTreeId() + r.nodeID = v.GetNodeId() + r.containerID = v.GetContainerId() + r.parentID = v.GetParentId() + r.bearerToken = v.GetBearerToken() + + return nil +} + +func (r *RemoveRequest) ToGRPCMessage() grpc.Message { + var m *tree.RemoveRequest + + if r != nil { + m = new(tree.RemoveRequest) + m.Body = r.body.ToGRPCMessage().(*tree.RemoveRequest_Body) + m.SetSignature(r.signature.ToGRPCMessage().(*tree.Signature)) + } + + return m +} + +func (r *RemoveRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.RemoveRequest) + 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(RemoveRequestBody) + } + + err = r.body.FromGRPCMessage(body) + } + + return err +} + +func (r *RemoveRequestBody) ToGRPCMessage() grpc.Message { + var m *tree.RemoveRequest_Body + + if r != nil { + m = new(tree.RemoveRequest_Body) + m.NodeId = r.nodeID + m.TreeId = r.treeID + m.BearerToken = r.bearerToken + m.ContainerId = r.containerID + } + + return m +} + +func (r *RemoveRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.RemoveRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + r.nodeID = v.GetNodeId() + r.treeID = v.GetTreeId() + r.containerID = v.GetContainerId() + r.bearerToken = v.GetBearerToken() + + return nil +} + +func (r *AddByPathResponse) ToGRPCMessage() grpc.Message { + var m *tree.AddByPathResponse + + if r != nil { + m = new(tree.AddByPathResponse) + m.Body = r.body.ToGRPCMessage().(*tree.AddByPathResponse_Body) + m.SetSignature(r.signature.ToGRPCMessage().(*tree.Signature)) + } + + return m +} + +func (r *AddByPathResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.AddByPathResponse) + 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(AddByPathResponseBody) + } + + err = r.body.FromGRPCMessage(body) + } + + return err +} + +func (r *AddByPathResponseBody) ToGRPCMessage() grpc.Message { + var m *tree.AddByPathResponse_Body + + if r != nil { + m = new(tree.AddByPathResponse_Body) + + m.ParentId = r.parentID + m.Nodes = r.nodes + } + + return m +} + +func (r *AddByPathResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.AddByPathResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + r.nodes = v.GetNodes() + r.parentID = v.GetParentId() + + return nil +} + +func (r *AddRequest) ToGRPCMessage() grpc.Message { + var m *tree.AddRequest + + if r != nil { + m = new(tree.AddRequest) + + m.Body = r.body.ToGRPCMessage().(*tree.AddRequest_Body) + m.SetSignature(r.signature.ToGRPCMessage().(*tree.Signature)) + } + + return m +} + +func (r *AddRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.AddRequest) + 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(AddRequestBody) + } + + err = r.body.FromGRPCMessage(body) + } + + sig := v.GetSignature() + if sig == nil { + r.signature = nil + } else { + if r.signature == nil { + r.signature = new(Signature) + } + err = r.signature.FromGRPCMessage(sig) + } + + return err +} + +func (r *AddRequestBody) ToGRPCMessage() grpc.Message { + var m *tree.AddRequest_Body + + if r != nil { + m = new(tree.AddRequest_Body) + + m.Meta = metaToGRPC(r.meta) + m.TreeId = r.treeID + m.ParentId = r.parentID + m.ContainerId = r.containerID + m.BearerToken = r.bearerToken + } + + return m +} + +func (r *AddRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.AddRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + r.meta, err = metaFromGRPC(v.GetMeta()) + if err != nil { + return err + } + r.bearerToken = v.GetBearerToken() + r.treeID = v.GetTreeId() + r.containerID = v.GetContainerId() + r.parentID = v.GetParentId() + + return err +} + +func (r *RemoveResponse) ToGRPCMessage() grpc.Message { + var m *tree.RemoveResponse + + if r != nil { + m = new(tree.RemoveResponse) + m.Body = r.body.ToGRPCMessage().(*tree.RemoveResponse_Body) + } + + return m +} + +func (r *RemoveResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.RemoveResponse) + 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(RemoveResponseBody) + } + + err = r.body.FromGRPCMessage(body) + } + + sig := v.GetSignature() + if sig == nil { + r.signature = nil + } else { + if r.signature == nil { + r.signature = new(Signature) + } + err = r.signature.FromGRPCMessage(sig) + } + + return err +} + +func (r *RemoveResponseBody) ToGRPCMessage() grpc.Message { + return new(tree.RemoveResponse_Body) +} + +func (r *RemoveResponseBody) FromGRPCMessage(grpc.Message) error { + return nil +} + +func (r *GetNodeByPathRequest) ToGRPCMessage() grpc.Message { + var m *tree.GetNodeByPathRequest + + if r != nil { + m = new(tree.GetNodeByPathRequest) + + m.Body = r.body.ToGRPCMessage().(*tree.GetNodeByPathRequest_Body) + m.Signature = r.signature.ToGRPCMessage().(*tree.Signature) + } + + return m +} + +func (r *GetNodeByPathRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.GetNodeByPathRequest) + 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(GetNodeByPathRequestBody) + } + + err = r.body.FromGRPCMessage(body) + } + + return err +} + +func (r *GetNodeByPathRequestBody) ToGRPCMessage() grpc.Message { + var m *tree.GetNodeByPathRequest_Body + + if r != nil { + m = new(tree.GetNodeByPathRequest_Body) + + m.TreeId = r.treeID + m.Path = r.path + m.BearerToken = r.bearerToken + m.ContainerId = r.containerID + m.Attributes = r.attributes + m.PathAttribute = r.pathAttribute + m.AllAttributes = r.allAttributes + m.LatestOnly = r.latestOnly + } + + return m +} + +func (r *GetNodeByPathRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.GetNodeByPathRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + r.treeID = v.GetTreeId() + r.path = v.GetPath() + r.attributes = v.GetAttributes() + r.latestOnly = v.GetLatestOnly() + r.allAttributes = v.GetAllAttributes() + r.pathAttribute = v.GetPathAttribute() + r.containerID = v.GetContainerId() + r.bearerToken = v.GetBearerToken() + + return nil +} + +func (r *GetNodeByPathResponse) ToGRPCMessage() grpc.Message { + var m *tree.GetNodeByPathResponse + + if r != nil { + m = new(tree.GetNodeByPathResponse) + + m.Body = r.body.ToGRPCMessage().(*tree.GetNodeByPathResponse_Body) + m.SetSignature(r.signature.ToGRPCMessage().(*tree.Signature)) + } + + return m +} + +func (r *GetNodeByPathResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.GetNodeByPathResponse) + 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(GetNodeByPathResponseBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + sig := v.GetSignature() + if sig == nil { + r.signature = nil + } else { + if r.signature == nil { + r.signature = new(Signature) + } + err = r.signature.FromGRPCMessage(sig) + } + + return err +} + +func (r *GetNodeByPathResponseBody) ToGRPCMessage() grpc.Message { + var m *tree.GetNodeByPathResponse_Body + + if r != nil { + m = new(tree.GetNodeByPathResponse_Body) + m.Nodes = GetNodeByPathInfoToGRPC(r.nodes) + } + + return m +} + +func (r *GetNodeByPathResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.GetNodeByPathResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + r.nodes, err = GetNodeByPathInfoFromGRPC(v.GetNodes()) + + return err +} + +func GetNodeByPathInfoToGRPC(m []*GetNodeByPathResponseInfo) (res []*tree.GetNodeByPathResponse_Info) { + if m != nil { + res = make([]*tree.GetNodeByPathResponse_Info, 0, len(m)) + + for i := range m { + res = append(res, m[i].ToGRPCMessage().(*tree.GetNodeByPathResponse_Info)) + } + } + + return +} + +func GetNodeByPathInfoFromGRPC(m []*tree.GetNodeByPathResponse_Info) (res []*GetNodeByPathResponseInfo, err error) { + if m != nil { + res = make([]*GetNodeByPathResponseInfo, len(m)) + + for i := range m { + res[i] = new(GetNodeByPathResponseInfo) + err = res[i].FromGRPCMessage(m[i]) + if err != nil { + return + } + } + } + + return +} + +func (r *GetNodeByPathResponseInfo) ToGRPCMessage() grpc.Message { + var m *tree.GetNodeByPathResponse_Info + + if r != nil { + m = new(tree.GetNodeByPathResponse_Info) + + m.Meta = metaToGRPC(r.meta) + m.NodeId = r.nodeID + m.Timestamp = r.timestamp + m.ParentId = r.parentID + } + + return m +} + +func (r *GetNodeByPathResponseInfo) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.GetNodeByPathResponse_Info) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + r.meta, err = metaFromGRPC(v.GetMeta()) + if err != nil { + return err + } + r.timestamp = v.GetTimestamp() + r.nodeID = v.GetNodeId() + r.parentID = v.GetParentId() + + return err +} + +func (r *ListRequest) ToGRPCMessage() grpc.Message { + var m *tree.TreeListRequest + + if r != nil { + m = new(tree.TreeListRequest) + + m.Body = r.body.ToGRPCMessage().(*tree.TreeListRequest_Body) + m.SetSignature(r.signature.ToGRPCMessage().(*tree.Signature)) + } + + return m +} + +func (r *ListRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.TreeListRequest) + 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(ListRequestBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + sig := v.GetSignature() + if sig == nil { + r.signature = nil + } else { + if r.signature == nil { + r.signature = new(Signature) + } + err = r.signature.FromGRPCMessage(sig) + } + + return err +} + +func (r *ListRequestBody) ToGRPCMessage() grpc.Message { + var m *tree.TreeListRequest_Body + + if r != nil { + m = new(tree.TreeListRequest_Body) + + m.ContainerId = r.containerID + } + + return m +} + +func (r *ListRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.TreeListRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + r.containerID = v.GetContainerId() + + return nil +} + +func (r *ListResponse) ToGRPCMessage() grpc.Message { + var m *tree.TreeListResponse + + if r != nil { + m = new(tree.TreeListResponse) + + m.Body = r.body.ToGRPCMessage().(*tree.TreeListResponse_Body) + m.Signature = r.signature.ToGRPCMessage().(*tree.Signature) + } + + return m +} + +func (r *ListResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.TreeListResponse) + 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(ListResponseBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + sig := v.GetSignature() + if sig == nil { + r.signature = nil + } else { + if r.signature == nil { + r.signature = new(Signature) + } + err = r.signature.FromGRPCMessage(sig) + } + + return err +} + +func (r *ListResponseBody) ToGRPCMessage() grpc.Message { + var m *tree.TreeListResponse_Body + + if r != nil { + m = new(tree.TreeListResponse_Body) + m.Ids = r.ids + } + + return m +} + +func (r *ListResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.TreeListResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + r.ids = v.GetIds() + + return nil +} + +func (r *ApplyRequest) ToGRPCMessage() grpc.Message { + var m *tree.ApplyRequest + + if r != nil { + m = new(tree.ApplyRequest) + + m.Body = r.body.ToGRPCMessage().(*tree.ApplyRequest_Body) + m.SetSignature(r.signature.ToGRPCMessage().(*tree.Signature)) + } + + return m +} + +func (r *ApplyRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.ApplyRequest) + 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(ApplyRequestBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + sig := v.GetSignature() + if sig == nil { + r.signature = nil + } else { + if r.signature == nil { + r.signature = new(Signature) + } + err = r.signature.FromGRPCMessage(sig) + } + + return err +} + +func (r *ApplyRequestBody) ToGRPCMessage() grpc.Message { + var m *tree.ApplyRequest_Body + + if r != nil { + m = new(tree.ApplyRequest_Body) + + m.TreeId = r.treeID + m.ContainerId = r.containerID + m.Operation = r.operation.ToGRPCMessage().(*tree.LogMove) + } + + return m +} + +func (r *ApplyRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.ApplyRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + r.treeID = v.GetTreeId() + r.containerID = v.GetContainerId() + op := v.GetOperation() + if op == nil { + r.operation = nil + } else { + if r.operation == nil { + r.operation = new(LogMove) + } + err = r.operation.FromGRPCMessage(op) + } + + return err +} + +func (r *ApplyResponse) ToGRPCMessage() grpc.Message { + var m *tree.ApplyResponse + + if r != nil { + m = new(tree.ApplyResponse) + + m.Body = r.body.ToGRPCMessage().(*tree.ApplyResponse_Body) + m.SetSignature(r.signature.ToGRPCMessage().(*tree.Signature)) + } + + return m +} + +func (r *ApplyResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.ApplyResponse) + 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(ApplyResponseBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + sig := v.GetSignature() + if sig == nil { + r.signature = nil + } else { + if r.signature == nil { + r.signature = new(Signature) + } + err = r.signature.FromGRPCMessage(sig) + } + + return err +} + +func (r *ApplyResponseBody) ToGRPCMessage() grpc.Message { + return new(tree.ApplyResponse_Body) +} + +func (r *ApplyResponseBody) FromGRPCMessage(grpc.Message) error { + return nil +} + +func (r *HealthcheckRequest) ToGRPCMessage() grpc.Message { + var m *tree.HealthcheckRequest + + if r != nil { + m = new(tree.HealthcheckRequest) + + m.Body = r.body.ToGRPCMessage().(*tree.HealthcheckRequest_Body) + m.SetSignature(r.signature.ToGRPCMessage().(*tree.Signature)) + } + + return m +} + +func (r *HealthcheckRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.HealthcheckRequest) + 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(HealthcheckRequestBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + sig := v.GetSignature() + if sig == nil { + r.signature = nil + } else { + if r.signature == nil { + r.signature = new(Signature) + } + err = r.signature.FromGRPCMessage(sig) + } + + return err +} + +func (r *HealthcheckRequestBody) ToGRPCMessage() grpc.Message { + return new(tree.HealthcheckRequest_Body) +} + +func (r *HealthcheckRequestBody) FromGRPCMessage(grpc.Message) error { + return nil +} + +func (r *HealthcheckResponse) ToGRPCMessage() grpc.Message { + var m *tree.HealthcheckResponse + + if r != nil { + m = new(tree.HealthcheckResponse) + + m.Body = r.body.ToGRPCMessage().(*tree.HealthcheckResponse_Body) + m.SetSignature(r.signature.ToGRPCMessage().(*tree.Signature)) + } + + return m +} + +func (r *HealthcheckResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.HealthcheckResponse) + 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(HealthcheckResponseBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + sig := v.GetSignature() + if sig == nil { + r.signature = nil + } else { + if r.signature == nil { + r.signature = new(Signature) + } + err = r.signature.FromGRPCMessage(sig) + } + + return err +} + +func (r *HealthcheckResponseBody) ToGRPCMessage() grpc.Message { + return new(tree.HealthcheckResponse_Body) +} + +func (r *HealthcheckResponseBody) FromGRPCMessage(grpc.Message) error { + return nil +} + +func (r *GetSubTreeResponse) ToGRPCMessage() grpc.Message { + var m *tree.GetSubTreeResponse + + if r != nil { + m = new(tree.GetSubTreeResponse) + + m.Body = r.body.ToGRPCMessage().(*tree.GetSubTreeResponse_Body) + m.SetSignature(r.signature.ToGRPCMessage().(*tree.Signature)) + } + + return m +} + +func (r *GetSubTreeResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.GetSubTreeResponse) + 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(GetSubTreeResponseBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + sig := v.GetSignature() + if sig == nil { + r.signature = nil + } else { + if r.signature == nil { + r.signature = new(Signature) + } + err = r.signature.FromGRPCMessage(sig) + } + + return err +} + +func (r *GetOpLogRequest) ToGRPCMessage() grpc.Message { + var m *tree.GetOpLogRequest + + if r != nil { + m = new(tree.GetOpLogRequest) + + m.Body = r.body.ToGRPCMessage().(*tree.GetOpLogRequest_Body) + m.SetSignature(r.signature.ToGRPCMessage().(*tree.Signature)) + } + + return m +} + +func (r *GetOpLogRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.GetOpLogRequest) + 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(GetOpLogRequestBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + sig := v.GetSignature() + if sig == nil { + r.signature = nil + } else { + if r.signature == nil { + r.signature = new(Signature) + } + err = r.signature.FromGRPCMessage(sig) + } + + return err +} + +func (r *GetOpLogRequestBody) ToGRPCMessage() grpc.Message { + var m *tree.GetOpLogRequest_Body + + if r != nil { + m = new(tree.GetOpLogRequest_Body) + + m.TreeId = r.treeID + m.Count = r.count + m.ContainerId = r.containerID + m.Height = r.height + } + + return m +} + +func (r *GetOpLogRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.GetOpLogRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + r.count = v.GetCount() + r.containerID = v.GetContainerId() + r.height = v.GetHeight() + r.treeID = v.GetTreeId() + + return err +} + +func (r *GetOpLogResponse) ToGRPCMessage() grpc.Message { + var m *tree.GetOpLogResponse + + if r != nil { + m = new(tree.GetOpLogResponse) + + m.Body = r.body.ToGRPCMessage().(*tree.GetOpLogResponse_Body) + m.SetSignature(r.signature.ToGRPCMessage().(*tree.Signature)) + } + + return m +} + +func (r *GetOpLogResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.GetOpLogResponse) + 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(GetOpLogResponseBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + sig := v.GetSignature() + if sig == nil { + r.signature = nil + } else { + if r.signature == nil { + r.signature = new(Signature) + } + err = r.signature.FromGRPCMessage(sig) + } + + return err +} + +func (r *GetOpLogResponseBody) ToGRPCMessage() grpc.Message { + var m *tree.GetOpLogResponse_Body + + if r != nil { + m = new(tree.GetOpLogResponse_Body) + + m.Operation = r.operation.ToGRPCMessage().(*tree.LogMove) + } + + return m +} + +func (r *GetOpLogResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.GetOpLogResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + oper := v.GetOperation() + if oper == nil { + r.operation = nil + } else { + if r.operation == nil { + r.operation = new(LogMove) + } + + err = r.operation.FromGRPCMessage(oper) + } + + return err +} + +func (s *Signature) ToGRPCMessage() grpc.Message { + var m *tree.Signature + + if s != nil { + m = new(tree.Signature) + + m.Sign = s.sign + m.Key = s.key + } + + return m +} + +func (s *Signature) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.Signature) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + s.sign = v.GetSign() + s.key = v.GetKey() + + return nil +} + +func (k *KeyValue) ToGRPCMessage() grpc.Message { + var m *tree.KeyValue + + if k != nil { + m = new(tree.KeyValue) + + m.Key = k.key + m.Value = k.value + } + + return m +} + +func (k *KeyValue) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.KeyValue) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + k.key = v.GetKey() + k.value = v.GetValue() + + return nil +} + +func (g *LogMove) ToGRPCMessage() grpc.Message { + var m *tree.LogMove + + if g != nil { + m = new(tree.LogMove) + + m.Meta = g.meta + m.ParentId = g.parentID + m.ChildId = g.childID + } + + return m +} + +func (g *LogMove) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.LogMove) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + g.meta = v.GetMeta() + g.parentID = v.GetParentId() + g.childID = v.GetChildId() + + return nil +} + +func (r *GetSubTreeRequest) ToGRPCMessage() grpc.Message { + var m *tree.GetSubTreeRequest + + if r != nil { + m = new(tree.GetSubTreeRequest) + + m.Body = r.body.ToGRPCMessage().(*tree.GetSubTreeRequest_Body) + m.SetSignature(r.signature.ToGRPCMessage().(*tree.Signature)) + } + + return m +} + +func (r *GetSubTreeRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.GetSubTreeRequest) + 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(GetSubTreeRequestBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + sig := v.GetSignature() + if sig == nil { + r.signature = nil + } else { + if r.signature == nil { + r.signature = new(Signature) + } + err = r.signature.FromGRPCMessage(sig) + } + + return err +} + +func (r *GetSubTreeRequestBody) ToGRPCMessage() grpc.Message { + var m *tree.GetSubTreeRequest_Body + + if r != nil { + m = new(tree.GetSubTreeRequest_Body) + + m.TreeId = r.treeID + m.BearerToken = r.bearerToken + m.Depth = r.depth + m.RootId = r.rootID + m.ContainerId = r.containerID + m.OrderBy = r.orderBy.ToGRPCMessage().(*tree.GetSubTreeRequest_Body_Order) + } + + return m +} + +func (r *GetSubTreeRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.GetSubTreeRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + r.rootID = v.GetRootId() + r.depth = v.GetDepth() + r.containerID = v.GetContainerId() + r.bearerToken = v.GetBearerToken() + r.treeID = v.GetTreeId() + + var err error + order := v.GetOrderBy() + if order == nil { + r.orderBy = nil + } else { + if r.orderBy == nil { + r.orderBy = new(GetSubTreeRequestBodyOrder) + } + + err = r.orderBy.FromGRPCMessage(order) + if err != nil { + return err + } + } + + return err +} +func (r *GetSubTreeRequestBodyOrder) ToGRPCMessage() grpc.Message { + var m *tree.GetSubTreeRequest_Body_Order + + if r != nil { + m = new(tree.GetSubTreeRequest_Body_Order) + + m.Direction = tree.GetSubTreeRequest_Body_Order_Direction(r.direction) + } + + return m +} + +func (r *GetSubTreeRequestBodyOrder) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.GetSubTreeRequest_Body_Order) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + r.direction = GetSubTreeRequestBodyOrderDirection(v.GetDirection()) + + return nil +} + +func (r *GetSubTreeResponseBody) ToGRPCMessage() grpc.Message { + var m *tree.GetSubTreeResponse_Body + + if r != nil { + m = new(tree.GetSubTreeResponse_Body) + + m.Meta = metaToGRPC(r.meta) + m.ParentId = r.parentID + m.NodeId = r.nodeID + m.Timestamp = r.timestamp + } + + return m +} + +func (r *GetSubTreeResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*tree.GetSubTreeResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + var err error + + r.nodeID = v.GetNodeId() + r.timestamp = v.GetTimestamp() + r.parentID = v.GetParentId() + r.meta, err = metaFromGRPC(v.GetMeta()) + + return err +} diff --git a/api/tree/types.go b/api/tree/types.go new file mode 100644 index 0000000..d20f946 --- /dev/null +++ b/api/tree/types.go @@ -0,0 +1,953 @@ +package tree + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + tree "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool/tree/service" +) + +type AddRequest struct { + body *AddRequestBody + signature *Signature +} + +func (r *AddRequest) GetBody() *AddRequestBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *AddRequest) SetBody(v *AddRequestBody) { + r.body = v +} + +func (r *AddRequest) GetSignature() *tree.Signature { + return r.signature.ToGRPCMessage().(*tree.Signature) +} + +func (r *AddRequest) SetSignature(signature *tree.Signature) error { + if r.signature == nil { + r.signature = new(Signature) + } + + return r.signature.FromGRPCMessage(signature) +} + +func (r *AddRequest) SignedDataSize() int { + return r.body.ToGRPCMessage().(*tree.AddRequest_Body).StableSize() +} + +func (r *AddRequest) ReadSignedData(buf []byte) ([]byte, error) { + return r.body.ToGRPCMessage().(*tree.AddRequest_Body).StableMarshal(buf), nil +} + +type AddRequestBody struct { + containerID []byte + bearerToken []byte + treeID string + parentID uint64 + meta []*KeyValue +} + +func (r *AddRequestBody) SetContainerID(v []byte) { + r.containerID = v +} + +func (r *AddRequestBody) SetBearerToken(v []byte) { + r.bearerToken = v +} + +func (r *AddRequestBody) SetTreeID(v string) { + r.treeID = v +} + +func (r *AddRequestBody) SetParentID(v uint64) { + r.parentID = v +} + +func (r *AddRequestBody) SetMeta(v []*KeyValue) { + r.meta = v +} + +type AddResponse struct { + body *AddResponseBody + signature *Signature +} + +func (r *AddResponse) GetBody() *AddResponseBody { + if r != nil { + return r.body + } + + return nil +} + +type AddResponseBody struct { + nodeID uint64 +} + +func (r *AddResponseBody) GetNodeID() uint64 { + if r != nil { + return r.nodeID + } + + return 0 +} + +type AddByPathRequest struct { + body *AddByPathRequestBody + signature *Signature +} + +func (r *AddByPathRequest) SetBody(v *AddByPathRequestBody) { + r.body = v +} + +func (r *AddByPathRequest) GetSignature() *tree.Signature { + return r.signature.ToGRPCMessage().(*tree.Signature) +} + +func (r *AddByPathRequest) SetSignature(signature *tree.Signature) error { + if r.signature == nil { + r.signature = new(Signature) + } + + return r.signature.FromGRPCMessage(signature) +} + +func (r *AddByPathRequest) SignedDataSize() int { + return r.body.ToGRPCMessage().(*tree.AddByPathRequest_Body).StableSize() +} + +func (r *AddByPathRequest) ReadSignedData(bytes []byte) ([]byte, error) { + return r.body.ToGRPCMessage().(*tree.AddByPathRequest_Body).StableMarshal(bytes), nil +} + +type AddByPathRequestBody struct { + containerID []byte + treeID string + pathAttribute string + path []string + meta []*KeyValue + bearerToken []byte +} + +func (r *AddByPathRequestBody) SetContainerID(v []byte) { + r.containerID = v +} + +func (r *AddByPathRequestBody) SetBearerToken(v []byte) { + r.bearerToken = v +} + +func (r *AddByPathRequestBody) SetTreeID(v string) { + r.treeID = v +} + +func (r *AddByPathRequestBody) SetPathAttribute(v string) { + r.pathAttribute = v +} + +func (r *AddByPathRequestBody) SetPath(v []string) { + r.path = v +} + +func (r *AddByPathRequestBody) SetMeta(v []*KeyValue) { + r.meta = v +} + +type AddByPathResponse struct { + body *AddByPathResponseBody + signature *Signature +} + +func (r *AddByPathResponse) GetBody() *AddByPathResponseBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *AddByPathResponse) GetSignature() *Signature { + if r != nil { + return r.signature + } + + return nil +} + +type AddByPathResponseBody struct { + nodes []uint64 + parentID uint64 +} + +func (r *AddByPathResponseBody) GetNodes() []uint64 { + if r != nil { + return r.nodes + } + + return nil +} + +func (r *AddByPathResponseBody) GetParentID() uint64 { + if r != nil { + return r.parentID + } + + return 0 +} + +type RemoveRequest struct { + body *RemoveRequestBody + signature *Signature +} + +func (r *RemoveRequest) SetBody(v *RemoveRequestBody) { + r.body = v +} + +func (r *RemoveRequest) GetSignature() *tree.Signature { + return r.signature.ToGRPCMessage().(*tree.Signature) +} + +func (r *RemoveRequest) SetSignature(signature *tree.Signature) error { + if r.signature == nil { + r.signature = new(Signature) + } + + return r.signature.FromGRPCMessage(signature) +} + +func (r *RemoveRequest) SignedDataSize() int { + return r.body.ToGRPCMessage().(*tree.RemoveRequest_Body).StableSize() +} + +func (r *RemoveRequest) ReadSignedData(bytes []byte) ([]byte, error) { + return r.body.ToGRPCMessage().(*tree.RemoveRequest_Body).StableMarshal(bytes), nil +} + +type RemoveRequestBody struct { + containerID []byte + treeID string + nodeID uint64 + bearerToken []byte +} + +func (r *RemoveRequestBody) SetContainerID(v []byte) { + r.containerID = v +} + +func (r *RemoveRequestBody) SetBearerToken(v []byte) { + r.bearerToken = v +} + +func (r *RemoveRequestBody) SetTreeID(v string) { + r.treeID = v +} + +func (r *RemoveRequestBody) SetNodeID(v uint64) { + r.nodeID = v +} + +type RemoveResponse struct { + body *RemoveResponseBody + signature *Signature +} + +func (r *RemoveResponse) GetBody() *RemoveResponseBody { + if r != nil { + return r.body + } + return nil +} + +func (r *RemoveResponse) GetSignature() *Signature { + if r != nil { + return r.signature + } + return nil +} + +type RemoveResponseBody struct{} + +type MoveRequest struct { + body *MoveRequestBody + signature *Signature +} + +func (r *MoveRequest) SetBody(v *MoveRequestBody) { + r.body = v +} + +func (r *MoveRequest) GetSignature() *tree.Signature { + return r.signature.ToGRPCMessage().(*tree.Signature) +} + +func (r *MoveRequest) SetSignature(signature *tree.Signature) error { + if r.signature == nil { + r.signature = new(Signature) + } + + return r.signature.FromGRPCMessage(signature) +} + +func (r *MoveRequest) SignedDataSize() int { + return r.body.ToGRPCMessage().(*tree.MoveRequest_Body).StableSize() +} + +func (r *MoveRequest) ReadSignedData(buf []byte) ([]byte, error) { + return r.body.ToGRPCMessage().(*tree.MoveRequest_Body).StableMarshal(buf), nil +} + +type MoveRequestBody struct { + containerID []byte + treeID string + parentID uint64 + nodeID uint64 + meta []*KeyValue + bearerToken []byte +} + +func (r *MoveRequestBody) SetContainerID(v []byte) { + r.containerID = v +} + +func (r *MoveRequestBody) SetBearerToken(v []byte) { + r.bearerToken = v +} + +func (r *MoveRequestBody) SetTreeID(v string) { + r.treeID = v +} + +func (r *MoveRequestBody) SetNodeID(v uint64) { + r.nodeID = v +} + +func (r *MoveRequestBody) SetMeta(v []*KeyValue) { + r.meta = v +} + +func (r *MoveRequestBody) SetParentID(v uint64) { + r.parentID = v +} + +type MoveResponse struct { + body *MoveResponseBody + signature *Signature +} + +func (r *MoveResponse) GetBody() *MoveResponseBody { + if r != nil { + return r.body + } + return nil +} + +func (r *MoveResponse) GetSignature() *Signature { + if r != nil { + return r.signature + } + + return nil +} + +type MoveResponseBody struct{} + +type GetNodeByPathRequest struct { + body *GetNodeByPathRequestBody + signature *Signature +} + +func (r *GetNodeByPathRequest) SetBody(v *GetNodeByPathRequestBody) { + r.body = v +} + +func (r *GetNodeByPathRequest) GetSignature() *tree.Signature { + return r.signature.ToGRPCMessage().(*tree.Signature) +} + +func (r *GetNodeByPathRequest) SetSignature(signature *tree.Signature) error { + if r.signature == nil { + r.signature = new(Signature) + } + return r.signature.FromGRPCMessage(signature) +} + +func (r *GetNodeByPathRequest) SignedDataSize() int { + return r.body.ToGRPCMessage().(*tree.GetNodeByPathRequest_Body).StableSize() +} + +func (r *GetNodeByPathRequest) ReadSignedData(buf []byte) ([]byte, error) { + return r.body.ToGRPCMessage().(*tree.GetNodeByPathRequest_Body).StableMarshal(buf), nil +} + +type GetNodeByPathRequestBody struct { + containerID []byte + treeID string + pathAttribute string + path []string + attributes []string + latestOnly bool + allAttributes bool + bearerToken []byte +} + +func (r *GetNodeByPathRequestBody) SetContainerID(v [32]byte) { + r.containerID = v[:] +} + +func (r *GetNodeByPathRequestBody) SetBearerToken(v []byte) { + r.bearerToken = v +} + +func (r *GetNodeByPathRequestBody) SetTreeID(v string) { + r.treeID = v +} + +func (r *GetNodeByPathRequestBody) SetPathAttribute(v string) { + r.pathAttribute = v +} + +func (r *GetNodeByPathRequestBody) SetParentID(v string) { + r.pathAttribute = v +} + +func (r *GetNodeByPathRequestBody) SetPath(v []string) { + r.path = v +} + +func (r *GetNodeByPathRequestBody) SetAttributes(v []string) { + r.attributes = v +} + +func (r *GetNodeByPathRequestBody) SetAllAttributes(v bool) { + r.allAttributes = v +} + +func (r *GetNodeByPathRequestBody) SetLatestOnly(v bool) { + r.latestOnly = v +} + +type GetNodeByPathResponse struct { + body *GetNodeByPathResponseBody + signature *Signature +} + +func (r *GetNodeByPathResponse) GetBody() *GetNodeByPathResponseBody { + if r != nil { + return r.body + } + return nil +} + +func (r *GetNodeByPathResponse) GetSignature() *Signature { + if r != nil { + return r.signature + } + + return nil +} + +type GetNodeByPathResponseBody struct { + nodes []*GetNodeByPathResponseInfo +} + +func (r *GetNodeByPathResponseBody) GetNodes() []*GetNodeByPathResponseInfo { + if r != nil { + return r.nodes + } + return nil +} + +type GetNodeByPathResponseInfo struct { + nodeID uint64 + timestamp uint64 + meta []*KeyValue + parentID uint64 +} + +func (r *GetNodeByPathResponseInfo) GetNodeID() uint64 { + if r != nil { + return r.nodeID + } + + return 0 +} + +func (r *GetNodeByPathResponseInfo) GetTimestamp() uint64 { + if r != nil { + return r.timestamp + } + + return 0 +} + +func (r *GetNodeByPathResponseInfo) GetParentID() uint64 { + if r != nil { + return r.parentID + } + + return 0 +} + +func (r *GetNodeByPathResponseInfo) GetMeta() []*KeyValue { + if r != nil { + return r.meta + } + + return nil +} + +type ListRequest struct { + body *ListRequestBody + signature *Signature +} + +func (r *ListRequest) SetBody(v *ListRequestBody) { + r.body = v +} + +type ListRequestBody struct { + containerID []byte +} + +func (r *ListRequestBody) SetContainerID(v []byte) { + r.containerID = v +} + +type ListResponse struct { + body *ListResponseBody + signature *Signature +} + +func (r *ListResponse) GetBody() *ListResponseBody { + if r != nil { + return r.body + } + return nil +} + +func (r *ListResponse) GetSignature() *Signature { + if r != nil { + return r.signature + } + + return nil +} + +type ListResponseBody struct { + ids []string +} + +func (r *ListResponseBody) GetIDs() []string { + if r != nil { + return r.ids + } + return nil +} + +type GetSubTreeRequest struct { + body *GetSubTreeRequestBody + signature *Signature +} + +func (r *GetSubTreeRequest) SetBody(v *GetSubTreeRequestBody) { + r.body = v +} + +func (r *GetSubTreeRequest) GetSignature() *tree.Signature { + return r.signature.ToGRPCMessage().(*tree.Signature) +} + +func (r *GetSubTreeRequest) SetSignature(signature *tree.Signature) error { + if r.signature == nil { + r.signature = new(Signature) + } + + return r.signature.FromGRPCMessage(signature) +} + +func (r *GetSubTreeRequest) SignedDataSize() int { + return r.body.ToGRPCMessage().(*tree.GetSubTreeRequest_Body).StableSize() +} + +func (r *GetSubTreeRequest) ReadSignedData(buf []byte) ([]byte, error) { + return r.body.ToGRPCMessage().(*tree.GetSubTreeRequest_Body).StableMarshal(buf), nil +} + +type GetSubTreeRequestBody struct { + containerID []byte + treeID string + rootID []uint64 + depth uint32 + bearerToken []byte + orderBy *GetSubTreeRequestBodyOrder +} + +func (r *GetSubTreeRequestBody) SetContainerID(v []byte) { + r.containerID = v +} + +func (r *GetSubTreeRequestBody) SetBearerToken(v []byte) { + r.bearerToken = v +} + +func (r *GetSubTreeRequestBody) SetTreeID(v string) { + r.treeID = v +} + +func (r *GetSubTreeRequestBody) SetRootID(v []uint64) { + r.rootID = v +} + +func (r *GetSubTreeRequestBody) SetDepth(v uint32) { + r.depth = v +} + +func (r *GetSubTreeRequestBody) SetOrderBy(v *GetSubTreeRequestBodyOrder) { + r.orderBy = v +} + +type GetSubTreeRequestBodyOrder struct { + direction GetSubTreeRequestBodyOrderDirection +} + +func (r *GetSubTreeRequestBodyOrder) SetDirection(v GetSubTreeRequestBodyOrderDirection) { + r.direction = v +} + +const ( + GetSubTreeRequestBodyOrderNone = GetSubTreeRequestBodyOrderDirection(tree.GetSubTreeRequest_Body_Order_None) + GetSubTreeRequestBodyOrderAsc = GetSubTreeRequestBodyOrderDirection(tree.GetSubTreeRequest_Body_Order_Asc) +) + +type GetSubTreeRequestBodyOrderDirection int32 + +type GetSubTreeResponse struct { + body *GetSubTreeResponseBody + signature *Signature +} + +func (r *GetSubTreeResponse) GetBody() *GetSubTreeResponseBody { + if r != nil { + return r.body + } + return nil +} + +func (r *GetSubTreeResponse) GetSignature() *Signature { + if r != nil { + return r.signature + } + + return nil +} + +type GetSubTreeResponseBody struct { + nodeID []uint64 + parentID []uint64 + timestamp []uint64 + meta []*KeyValue +} + +func (r *GetSubTreeResponseBody) GetNodeID() []uint64 { + if r != nil { + return r.nodeID + } + + return nil +} + +func (r *GetSubTreeResponseBody) GetParentID() []uint64 { + if r != nil { + return r.parentID + } + + return nil +} + +func (r *GetSubTreeResponseBody) GetTimestamp() []uint64 { + if r != nil { + return r.timestamp + } + + return nil +} + +func (r *GetSubTreeResponseBody) GetMeta() []*KeyValue { + if r != nil { + return r.meta + } + + return nil +} + +type ApplyRequest struct { + body *ApplyRequestBody + signature *Signature +} + +func (r *ApplyRequest) SetBody(v *ApplyRequestBody) { + r.body = v +} + +type ApplyRequestBody struct { + containerID []byte + treeID string + operation *LogMove +} + +func (r *ApplyRequestBody) SetContainerID(v []byte) { + r.containerID = v +} + +func (r *ApplyRequestBody) SetTreeID(v string) { + r.treeID = v +} + +func (r *ApplyRequestBody) SetOperation(v *LogMove) { + r.operation = v +} + +type ApplyResponse struct { + body *ApplyResponseBody + signature *Signature +} + +func (r *ApplyResponse) GetBody() *ApplyResponseBody { + if r != nil { + return r.body + } + return nil +} + +func (r *ApplyResponse) GetSignature() *Signature { + if r != nil { + return r.signature + } + + return nil +} + +type ApplyResponseBody struct{} + +type GetOpLogRequest struct { + body *GetOpLogRequestBody + signature *Signature +} + +func (r *GetOpLogRequest) SetBody(v *GetOpLogRequestBody) { + r.body = v +} + +func (r *GetOpLogRequest) GetSignature() *tree.Signature { + return r.signature.ToGRPCMessage().(*tree.Signature) +} + +func (r *GetOpLogRequest) SetSignature(signature *tree.Signature) error { + if r.signature == nil { + r.signature = new(Signature) + } + + return r.signature.FromGRPCMessage(signature) +} + +func (r *GetOpLogRequest) SignedDataSize() int { + return r.body.ToGRPCMessage().(*tree.GetSubTreeRequest_Body).StableSize() +} + +func (r *GetOpLogRequest) ReadSignedData(buf []byte) ([]byte, error) { + return r.body.ToGRPCMessage().(*tree.GetSubTreeRequest_Body).StableMarshal(buf), nil +} + +type GetOpLogRequestBody struct { + containerID []byte + treeID string + height uint64 + count uint64 +} + +func (r *GetOpLogRequestBody) SetTreeID(v string) { + r.treeID = v +} + +func (r *GetOpLogRequestBody) SetContainerID(v []byte) { + r.containerID = v +} + +func (r *GetOpLogRequestBody) SetHeight(v uint64) { + r.height = v +} + +func (r *GetOpLogRequestBody) SetCount(v uint64) { + r.count = v +} + +type GetOpLogResponse struct { + body *GetOpLogResponseBody + signature *Signature +} + +func (r *GetOpLogResponse) GetBody() *GetOpLogResponseBody { + if r != nil { + return r.body + } + return nil +} + +func (r *GetOpLogResponse) GetSignature() *Signature { + if r != nil { + return r.signature + } + + return nil +} + +type GetOpLogResponseBody struct { + operation *LogMove +} + +func (r *GetOpLogResponseBody) GetOperation() *LogMove { + if r != nil { + return r.operation + } + + return nil +} + +type HealthcheckRequest struct { + body *HealthcheckRequestBody + signature *Signature + + session.RequestHeaders +} + +func (r *HealthcheckRequest) SetBody(v *HealthcheckRequestBody) { + r.body = v +} + +type HealthcheckRequestBody struct{} + +type HealthcheckResponse struct { + body *HealthcheckResponseBody + signature *Signature +} + +func (r *HealthcheckResponse) GetBody() *HealthcheckResponseBody { + if r != nil { + return r.body + } + return nil +} + +func (r *HealthcheckResponse) GetSignature() *Signature { + if r != nil { + return r.signature + } + + return nil +} + +type HealthcheckResponseBody struct{} + +type LogMove struct { + parentID uint64 + meta []byte + childID uint64 +} + +func (g *LogMove) GetParentID() uint64 { + if g != nil { + return g.parentID + } + + return 0 +} + +func (g *LogMove) SetParentID(v uint64) { + g.parentID = v +} + +func (g *LogMove) GetMeta() []byte { + if g != nil { + return g.meta + } + + return nil +} + +func (g *LogMove) SetMeta(v []byte) { + g.meta = v +} + +func (g *LogMove) GetChildID() []byte { + if g != nil { + return g.meta + } + + return nil +} + +func (g *LogMove) SetChildID(v []byte) { + g.meta = v +} + +type Signature struct { + key []byte + sign []byte +} + +func (s *Signature) GetKey() []byte { + if s != nil { + return s.key + } + + return nil +} + +func (s *Signature) SetKey(v []byte) { + s.key = v +} + +func (s *Signature) GetSign() []byte { + if s != nil { + return s.sign + } + + return nil +} + +func (s *Signature) SetSign(v []byte) { + s.sign = v +} + +type KeyValue struct { + key string + value []byte +} + +func (k *KeyValue) GetKey() string { + if k != nil { + return k.key + } + + return "" +} + +func (k *KeyValue) SetKey(v string) { + k.key = v +} + +func (k *KeyValue) GetValue() []byte { + if k != nil { + return k.value + } + return nil +} + +func (k *KeyValue) SetValue(v []byte) { + k.value = v +} diff --git a/pool/tree/client.go b/pool/tree/client.go index 78a1610..b93b5e6 100644 --- a/pool/tree/client.go +++ b/pool/tree/client.go @@ -6,20 +6,22 @@ import ( "errors" "fmt" "sync" + "time" - apiClient "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" - grpcService "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool/tree/service" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + rpcclient "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/tree" "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/credentials/insecure" ) type treeClient struct { - mu sync.RWMutex - address string - opts []grpc.DialOption - conn *grpc.ClientConn - service grpcService.TreeServiceClient + mu sync.RWMutex + address string + opts []grpc.DialOption + client *rpcclient.Client + nodeDialTimeout time.Duration + streamTimeout time.Duration + healthy bool } @@ -27,10 +29,12 @@ type treeClient struct { var ErrUnhealthyEndpoint = errors.New("unhealthy endpoint") // newTreeClient creates new tree client with auto dial. -func newTreeClient(addr string, opts ...grpc.DialOption) *treeClient { +func newTreeClient(addr string, opts []grpc.DialOption, dialTimeout time.Duration, streamTimeout time.Duration) *treeClient { return &treeClient{ - address: addr, - opts: opts, + address: addr, + opts: opts, + nodeDialTimeout: dialTimeout, + streamTimeout: streamTimeout, } } @@ -38,16 +42,17 @@ func (c *treeClient) dial(ctx context.Context) error { c.mu.Lock() defer c.mu.Unlock() - if c.conn != nil { + if c.client != nil { return fmt.Errorf("couldn't dial '%s': connection already established", c.address) } var err error - if c.conn, c.service, err = createClient(c.address, c.opts...); err != nil { + c.client, err = c.createClient() + if err != nil { return err } - if _, err = c.service.Healthcheck(ctx, &grpcService.HealthcheckRequest{}); err != nil { + if _, err = rpcapi.Healthcheck(c.client, &tree.HealthcheckRequest{}, rpcclient.WithContext(ctx)); err != nil { return fmt.Errorf("healthcheck tree service: %w", err) } @@ -60,14 +65,14 @@ func (c *treeClient) redialIfNecessary(ctx context.Context) (healthHasChanged bo c.mu.Lock() defer c.mu.Unlock() - if c.conn == nil { - if c.conn, c.service, err = createClient(c.address, c.opts...); err != nil { + if c.client == nil { + if c.client, err = c.createClient(); err != nil { return false, err } } wasHealthy := c.healthy - if _, err = c.service.Healthcheck(ctx, &grpcService.HealthcheckRequest{}); err != nil { + if _, err = rpcapi.Healthcheck(c.client, &tree.HealthcheckRequest{}, rpcclient.WithContext(ctx)); err != nil { c.healthy = false return wasHealthy, fmt.Errorf("healthcheck tree service: %w", err) } @@ -77,39 +82,26 @@ func (c *treeClient) redialIfNecessary(ctx context.Context) (healthHasChanged bo return !wasHealthy, nil } -func createClient(addr string, clientOptions ...grpc.DialOption) (*grpc.ClientConn, grpcService.TreeServiceClient, error) { - host, tlsEnable, err := apiClient.ParseURI(addr) - if err != nil { - return nil, nil, fmt.Errorf("parse address: %w", err) - } +func (c *treeClient) createClient() (*rpcclient.Client, error) { + cli := rpcclient.New(append( + rpcclient.WithNetworkURIAddress(c.address, &tls.Config{}), + rpcclient.WithDialTimeout(c.nodeDialTimeout), + rpcclient.WithRWTimeout(c.streamTimeout), + rpcclient.WithGRPCDialOptions(c.opts), + )...) - creds := insecure.NewCredentials() - if tlsEnable { - creds = credentials.NewTLS(&tls.Config{}) - } - - options := []grpc.DialOption{grpc.WithTransportCredentials(creds)} - - // the order is matter, we want client to be able to overwrite options. - opts := append(options, clientOptions...) - - conn, err := grpc.NewClient(host, opts...) - if err != nil { - return nil, nil, fmt.Errorf("grpc create node tree service: %w", err) - } - - return conn, grpcService.NewTreeServiceClient(conn), nil + return cli, nil } -func (c *treeClient) serviceClient() (grpcService.TreeServiceClient, error) { +func (c *treeClient) serviceClient() (*rpcclient.Client, error) { c.mu.RLock() defer c.mu.RUnlock() - if c.conn == nil || !c.healthy { + if c.client == nil || !c.healthy { return nil, fmt.Errorf("%w: '%s'", ErrUnhealthyEndpoint, c.address) } - return c.service, nil + return c.client, nil } func (c *treeClient) endpoint() string { @@ -132,9 +124,8 @@ func (c *treeClient) close() error { c.mu.Lock() defer c.mu.Unlock() - if c.conn == nil { + if c.client == nil || c.client.Conn() == nil { return nil } - - return c.conn.Close() + return c.client.Conn().Close() } diff --git a/pool/tree/pool.go b/pool/tree/pool.go index 15d4c68..f4f9bf8 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -10,9 +10,11 @@ import ( "sync" "time" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + rpcclient "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/tree" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool" - grpcService "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool/tree/service" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "go.uber.org/zap" "go.uber.org/zap/zapcore" @@ -51,7 +53,7 @@ var ( // This interface is expected to have exactly one production implementation - treeClient. // Others are expected to be for test purposes only. type client interface { - serviceClient() (grpcService.TreeServiceClient, error) + serviceClient() (*rpcclient.Client, error) endpoint() string isHealthy() bool setHealthy(bool) @@ -92,6 +94,7 @@ type Pool struct { maxRequestAttempts int streamTimeout time.Duration + nodeDialTimeout time.Duration startIndicesMtx sync.RWMutex // startIndices points to the client from which the next request will be executed. @@ -254,7 +257,7 @@ func (p *Pool) Dial(ctx context.Context) error { for i, nodes := range p.rebalanceParams.nodesGroup { clients := make([]client, len(nodes)) for j, node := range nodes { - clients[j] = newTreeClient(node.Address(), p.dialOptions...) + clients[j] = newTreeClient(node.Address(), p.dialOptions, p.nodeDialTimeout, p.streamTimeout) if err := clients[j].dial(ctx); err != nil { p.log(zap.WarnLevel, "failed to dial tree client", zap.String("address", node.Address()), zap.Error(err)) continue @@ -336,30 +339,28 @@ func (x *InitParameters) SetMaxRequestAttempts(maxAttempts int) { // Can return predefined errors: // * ErrNodeNotFound // * ErrNodeAccessDenied. -func (p *Pool) GetNodes(ctx context.Context, prm GetNodesParams) ([]*grpcService.GetNodeByPathResponse_Info, error) { - request := &grpcService.GetNodeByPathRequest{ - Body: &grpcService.GetNodeByPathRequest_Body{ - ContainerId: prm.CID[:], - TreeId: prm.TreeID, - Path: prm.Path, - Attributes: prm.Meta, - PathAttribute: prm.PathAttribute, - LatestOnly: prm.LatestOnly, - AllAttributes: prm.AllAttrs, - BearerToken: prm.BearerToken, - }, - } +func (p *Pool) GetNodes(ctx context.Context, prm GetNodesParams) ([]*tree.GetNodeByPathResponseInfo, error) { + body := new(tree.GetNodeByPathRequestBody) + body.SetContainerID(prm.CID) + body.SetTreeID(prm.TreeID) + body.SetPath(prm.Path) + body.SetAttributes(prm.Meta) + body.SetPathAttribute(prm.PathAttribute) + body.SetAllAttributes(prm.AllAttrs) + body.SetLatestOnly(prm.LatestOnly) + body.SetBearerToken(prm.BearerToken) + + request := new(tree.GetNodeByPathRequest) + request.SetBody(body) start := time.Now() if err := p.signRequest(request); err != nil { return nil, err } - var resp *grpcService.GetNodeByPathResponse - err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) (inErr error) { - reqCtx, cancel := context.WithTimeout(ctx, p.streamTimeout) - defer cancel() - resp, inErr = client.GetNodeByPath(reqCtx, request) + var resp *tree.GetNodeByPathResponse + err := p.requestWithRetry(ctx, func(client *rpcclient.Client) (inErr error) { + resp, inErr = rpcapi.GetNodeByPath(client, request, rpcclient.WithContext(ctx)) // Pool wants to do retry 'GetNodeByPath' request if result is empty. // Empty result is expected due to delayed tree service sync. // Return an error there to trigger retry and ignore it after, @@ -381,13 +382,14 @@ func (p *Pool) GetNodes(ctx context.Context, prm GetNodesParams) ([]*grpcService // // Must be initialized using Pool.GetSubTree, any other usage is unsafe. type SubTreeReader struct { - cli grpcService.TreeService_GetSubTreeClient + cli *rpcapi.GetSubTreeResponseReader } // Read reads another list of the subtree nodes. -func (x *SubTreeReader) Read(buf []*grpcService.GetSubTreeResponse_Body) (int, error) { +func (x *SubTreeReader) Read(buf []*tree.GetSubTreeResponseBody) (int, error) { for i := range buf { - resp, err := x.cli.Recv() + var resp tree.GetSubTreeResponse + err := x.cli.Read(&resp) if err == io.EOF { return i, io.EOF } else if err != nil { @@ -400,10 +402,11 @@ func (x *SubTreeReader) Read(buf []*grpcService.GetSubTreeResponse_Body) (int, e } // ReadAll reads all nodes subtree nodes. -func (x *SubTreeReader) ReadAll() ([]*grpcService.GetSubTreeResponse_Body, error) { - var res []*grpcService.GetSubTreeResponse_Body +func (x *SubTreeReader) ReadAll() ([]*tree.GetSubTreeResponseBody, error) { + var res []*tree.GetSubTreeResponseBody for { - resp, err := x.cli.Recv() + var resp tree.GetSubTreeResponse + err := x.cli.Read(&resp) if err == io.EOF { break } else if err != nil { @@ -416,8 +419,9 @@ func (x *SubTreeReader) ReadAll() ([]*grpcService.GetSubTreeResponse_Body, error } // Next gets the next node from subtree. -func (x *SubTreeReader) Next() (*grpcService.GetSubTreeResponse_Body, error) { - resp, err := x.cli.Recv() +func (x *SubTreeReader) Next() (*tree.GetSubTreeResponseBody, error) { + var resp tree.GetSubTreeResponse + err := x.cli.Read(&resp) if err == io.EOF { return nil, io.EOF } @@ -434,32 +438,33 @@ func (x *SubTreeReader) Next() (*grpcService.GetSubTreeResponse_Body, error) { // * ErrNodeNotFound // * ErrNodeAccessDenied. func (p *Pool) GetSubTree(ctx context.Context, prm GetSubTreeParams) (*SubTreeReader, error) { - request := &grpcService.GetSubTreeRequest{ - Body: &grpcService.GetSubTreeRequest_Body{ - ContainerId: prm.CID[:], - TreeId: prm.TreeID, - RootId: prm.RootID, - Depth: prm.Depth, - BearerToken: prm.BearerToken, - OrderBy: new(grpcService.GetSubTreeRequest_Body_Order), - }, - } + body := new(tree.GetSubTreeRequestBody) + body.SetContainerID(prm.CID[:]) + body.SetTreeID(prm.TreeID) + body.SetBearerToken(prm.BearerToken) + body.SetDepth(prm.Depth) + body.SetRootID(prm.RootID) + orderBy := new(tree.GetSubTreeRequestBodyOrder) switch prm.Order { case AscendingOrder: - request.Body.OrderBy.Direction = grpcService.GetSubTreeRequest_Body_Order_Asc + orderBy.SetDirection(tree.GetSubTreeRequestBodyOrderAsc) default: - request.Body.OrderBy.Direction = grpcService.GetSubTreeRequest_Body_Order_None + orderBy.SetDirection(tree.GetSubTreeRequestBodyOrderNone) } + body.SetOrderBy(orderBy) + + request := new(tree.GetSubTreeRequest) + request.SetBody(body) start := time.Now() if err := p.signRequest(request); err != nil { return nil, err } - var cli grpcService.TreeService_GetSubTreeClient - err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) (inErr error) { - cli, inErr = client.GetSubTree(ctx, request) + var cli *rpcapi.GetSubTreeResponseReader + err := p.requestWithRetry(ctx, func(client *rpcclient.Client) (inErr error) { + cli, inErr = rpcapi.GetSubTree(client, request, rpcclient.WithContext(ctx)) return handleError("failed to get sub tree client", inErr) }) p.methods[methodGetSubTree].IncRequests(time.Since(start)) @@ -476,26 +481,24 @@ func (p *Pool) GetSubTree(ctx context.Context, prm GetSubTreeParams) (*SubTreeRe // * ErrNodeNotFound // * ErrNodeAccessDenied. func (p *Pool) AddNode(ctx context.Context, prm AddNodeParams) (uint64, error) { - request := &grpcService.AddRequest{ - Body: &grpcService.AddRequest_Body{ - ContainerId: prm.CID[:], - TreeId: prm.TreeID, - ParentId: prm.Parent, - Meta: metaToKV(prm.Meta), - BearerToken: prm.BearerToken, - }, - } + body := new(tree.AddRequestBody) + body.SetTreeID(prm.TreeID) + body.SetBearerToken(prm.BearerToken) + body.SetContainerID(prm.CID[:]) + body.SetMeta(metaToKV(prm.Meta)) + body.SetParentID(prm.Parent) + + request := new(tree.AddRequest) + request.SetBody(body) start := time.Now() if err := p.signRequest(request); err != nil { return 0, err } - var resp *grpcService.AddResponse - err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) (inErr error) { - reqCtx, cancel := context.WithTimeout(ctx, p.streamTimeout) - defer cancel() - resp, inErr = client.Add(reqCtx, request) + var resp *tree.AddResponse + err := p.requestWithRetry(ctx, func(client *rpcclient.Client) (inErr error) { + resp, inErr = rpcapi.Add(client, request, rpcclient.WithContext(ctx)) return handleError("failed to add node", inErr) }) p.methods[methodAddNode].IncRequests(time.Since(start)) @@ -503,7 +506,7 @@ func (p *Pool) AddNode(ctx context.Context, prm AddNodeParams) (uint64, error) { return 0, err } - return resp.GetBody().GetNodeId(), nil + return resp.GetBody().GetNodeID(), nil } // AddNodeByPath invokes eponymous method from TreeServiceClient. @@ -512,27 +515,25 @@ func (p *Pool) AddNode(ctx context.Context, prm AddNodeParams) (uint64, error) { // * ErrNodeNotFound // * ErrNodeAccessDenied. func (p *Pool) AddNodeByPath(ctx context.Context, prm AddNodeByPathParams) (uint64, error) { - request := &grpcService.AddByPathRequest{ - Body: &grpcService.AddByPathRequest_Body{ - ContainerId: prm.CID[:], - TreeId: prm.TreeID, - Path: prm.Path, - Meta: metaToKV(prm.Meta), - PathAttribute: prm.PathAttribute, - BearerToken: prm.BearerToken, - }, - } + body := new(tree.AddByPathRequestBody) + body.SetTreeID(prm.TreeID) + body.SetBearerToken(prm.BearerToken) + body.SetContainerID(prm.CID[:]) + body.SetMeta(metaToKV(prm.Meta)) + body.SetPathAttribute(prm.PathAttribute) + body.SetPath(prm.Path) + + request := new(tree.AddByPathRequest) + request.SetBody(body) start := time.Now() if err := p.signRequest(request); err != nil { return 0, err } - var resp *grpcService.AddByPathResponse - err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) (inErr error) { - reqCtx, cancel := context.WithTimeout(ctx, p.streamTimeout) - defer cancel() - resp, inErr = client.AddByPath(reqCtx, request) + var resp *tree.AddByPathResponse + err := p.requestWithRetry(ctx, func(client *rpcclient.Client) (inErr error) { + resp, inErr = rpcapi.AddByPath(client, request, rpcclient.WithContext(ctx)) return handleError("failed to add node by path", inErr) }) p.methods[methodAddNodeByPath].IncRequests(time.Since(start)) @@ -540,15 +541,15 @@ func (p *Pool) AddNodeByPath(ctx context.Context, prm AddNodeByPathParams) (uint return 0, err } - body := resp.GetBody() - if body == nil { + respBody := resp.GetBody() + if respBody == nil { return 0, errors.New("nil body in tree service response") - } else if len(body.GetNodes()) == 0 { + } else if len(respBody.GetNodes()) == 0 { return 0, errors.New("empty list of added nodes in tree service response") } // The first node is the leaf that we add, according to tree service docs. - return body.GetNodes()[0], nil + return respBody.GetNodes()[0], nil } // MoveNode invokes eponymous method from TreeServiceClient. @@ -557,26 +558,24 @@ func (p *Pool) AddNodeByPath(ctx context.Context, prm AddNodeByPathParams) (uint // * ErrNodeNotFound // * ErrNodeAccessDenied. func (p *Pool) MoveNode(ctx context.Context, prm MoveNodeParams) error { - request := &grpcService.MoveRequest{ - Body: &grpcService.MoveRequest_Body{ - ContainerId: prm.CID[:], - TreeId: prm.TreeID, - NodeId: prm.NodeID, - ParentId: prm.ParentID, - Meta: metaToKV(prm.Meta), - BearerToken: prm.BearerToken, - }, - } + body := new(tree.MoveRequestBody) + body.SetTreeID(prm.TreeID) + body.SetBearerToken(prm.BearerToken) + body.SetContainerID(prm.CID[:]) + body.SetMeta(metaToKV(prm.Meta)) + body.SetNodeID(prm.NodeID) + body.SetParentID(prm.ParentID) + + request := new(tree.MoveRequest) + request.SetBody(body) start := time.Now() if err := p.signRequest(request); err != nil { return err } - err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) error { - reqCtx, cancel := context.WithTimeout(ctx, p.streamTimeout) - defer cancel() - if _, err := client.Move(reqCtx, request); err != nil { + err := p.requestWithRetry(ctx, func(client *rpcclient.Client) error { + if _, err := rpcapi.Move(client, request, rpcclient.WithContext(ctx)); err != nil { return handleError("failed to move node", err) } return nil @@ -592,24 +591,22 @@ func (p *Pool) MoveNode(ctx context.Context, prm MoveNodeParams) error { // * ErrNodeNotFound // * ErrNodeAccessDenied. func (p *Pool) RemoveNode(ctx context.Context, prm RemoveNodeParams) error { - request := &grpcService.RemoveRequest{ - Body: &grpcService.RemoveRequest_Body{ - ContainerId: prm.CID[:], - TreeId: prm.TreeID, - NodeId: prm.NodeID, - BearerToken: prm.BearerToken, - }, - } + body := new(tree.RemoveRequestBody) + body.SetTreeID(prm.TreeID) + body.SetBearerToken(prm.BearerToken) + body.SetContainerID(prm.CID[:]) + body.SetNodeID(prm.NodeID) + + request := new(tree.RemoveRequest) + request.SetBody(body) start := time.Now() if err := p.signRequest(request); err != nil { return err } - err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) error { - reqCtx, cancel := context.WithTimeout(ctx, p.streamTimeout) - defer cancel() - if _, err := client.Remove(reqCtx, request); err != nil { + err := p.requestWithRetry(ctx, func(client *rpcclient.Client) error { + if _, err := rpcapi.Remove(client, request, rpcclient.WithContext(ctx)); err != nil { return handleError("failed to remove node", err) } return nil @@ -661,11 +658,14 @@ func handleError(msg string, err error) error { return fmt.Errorf("%s: %w", msg, err) } -func metaToKV(meta map[string]string) []*grpcService.KeyValue { - result := make([]*grpcService.KeyValue, 0, len(meta)) +func metaToKV(meta map[string]string) []*tree.KeyValue { + result := make([]*tree.KeyValue, 0, len(meta)) for key, value := range meta { - result = append(result, &grpcService.KeyValue{Key: key, Value: []byte(value)}) + kv := new(tree.KeyValue) + kv.SetKey(key) + kv.SetValue([]byte(value)) + result = append(result, kv) } return result @@ -814,10 +814,10 @@ func (p *Pool) setStartIndices(i, j int) { p.startIndicesMtx.Unlock() } -func (p *Pool) requestWithRetry(ctx context.Context, fn func(client grpcService.TreeServiceClient) error) error { +func (p *Pool) requestWithRetry(ctx context.Context, fn func(client *rpcclient.Client) error) error { var ( err, finErr error - cl grpcService.TreeServiceClient + cl *rpcclient.Client ) reqID := GetRequestID(ctx) diff --git a/pool/tree/pool_signature.go b/pool/tree/pool_signature.go index 5a8def1..f0d890a 100644 --- a/pool/tree/pool_signature.go +++ b/pool/tree/pool_signature.go @@ -9,7 +9,7 @@ type message interface { SignedDataSize() int ReadSignedData([]byte) ([]byte, error) GetSignature() *tree.Signature - SetSignature(*tree.Signature) + SetSignature(*tree.Signature) error } // signMessage uses the pool key and signs any protobuf @@ -29,10 +29,8 @@ func (p *Pool) signRequest(m message) error { rawPub := make([]byte, keySDK.Public().MaxEncodedSize()) rawPub = rawPub[:keySDK.Public().Encode(rawPub)] - m.SetSignature(&tree.Signature{ + return m.SetSignature(&tree.Signature{ Key: rawPub, Sign: data, }) - - return nil } diff --git a/pool/tree/pool_test.go b/pool/tree/pool_test.go index c2e50eb..f9f4142 100644 --- a/pool/tree/pool_test.go +++ b/pool/tree/pool_test.go @@ -5,9 +5,9 @@ import ( "errors" "testing" + rpcClient "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool" - grpcService "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool/tree/service" "github.com/stretchr/testify/require" "go.uber.org/zap/zaptest" ) @@ -17,7 +17,7 @@ type treeClientMock struct { err bool } -func (t *treeClientMock) serviceClient() (grpcService.TreeServiceClient, error) { +func (t *treeClientMock) serviceClient() (*rpcClient.Client, error) { if t.err { return nil, errors.New("serviceClient() mock error") } @@ -99,7 +99,7 @@ func TestRetry(t *testing.T) { maxRequestAttempts: lenNodes, } - makeFn := func(client grpcService.TreeServiceClient) error { + makeFn := func(client *rpcClient.Client) error { return nil } @@ -171,7 +171,7 @@ func TestRetry(t *testing.T) { t.Run("error empty result", func(t *testing.T) { errNodes, index := 2, 0 - err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) error { + err := p.requestWithRetry(ctx, func(client *rpcClient.Client) error { if index < errNodes { index++ return errNodeEmptyResult @@ -184,7 +184,7 @@ func TestRetry(t *testing.T) { t.Run("error not found", func(t *testing.T) { errNodes, index := 2, 0 - err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) error { + err := p.requestWithRetry(ctx, func(client *rpcClient.Client) error { if index < errNodes { index++ return ErrNodeNotFound @@ -197,7 +197,7 @@ func TestRetry(t *testing.T) { t.Run("error access denied", func(t *testing.T) { var index int - err := p.requestWithRetry(ctx, func(client grpcService.TreeServiceClient) error { + err := p.requestWithRetry(ctx, func(client *rpcClient.Client) error { index++ return ErrNodeAccessDenied }) From f7da6ba99cc2c1d49f5082980ca236f51a8b126b Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 5 Dec 2024 15:30:53 +0300 Subject: [PATCH 124/197] [#306] netmap: Allow to select empty set of nodes Signed-off-by: Evgenii Stratonikov --- netmap/selector.go | 2 +- netmap/selector_test.go | 33 +++++++++++++++++++++ netmap/yml_test.go | 11 +++++-- netmap/yml_tests/filter_complex.yml | 3 -- netmap/yml_tests/filter_invalid_integer.yml | 2 -- netmap/yml_tests/filter_simple.yml | 6 ---- netmap/yml_tests/selector_invalid.yml | 1 - 7 files changed, 43 insertions(+), 15 deletions(-) diff --git a/netmap/selector.go b/netmap/selector.go index 3e8adad..d6ea4cd 100644 --- a/netmap/selector.go +++ b/netmap/selector.go @@ -114,7 +114,7 @@ func (c *context) getSelection(s netmap.Selector) ([]nodes, error) { } if len(res) < bucketCount { - if len(res) == 0 { + if c.strict && len(res) == 0 { return nil, errNotEnoughNodes } bucketCount = len(res) diff --git a/netmap/selector_test.go b/netmap/selector_test.go index 538b845..ae996dd 100644 --- a/netmap/selector_test.go +++ b/netmap/selector_test.go @@ -254,6 +254,39 @@ func TestPlacementPolicy_ProcessSelectors(t *testing.T) { } } +func TestPlacementPolicy_PartiallyMissingContainer(t *testing.T) { + s := `REP 2 IN D1OBJ +REP 2 IN D2OBJ +CBF 2 +SELECT 2 FROM PRIMARY AS D1OBJ +SELECT 2 FROM SECONDARY AS D2OBJ +FILTER ClusterName EQ D1OBJ AS PRIMARY +FILTER ClusterName EQ D2OBJ AS SECONDARY` + + var p PlacementPolicy + require.NoError(t, p.DecodeString(s)) + + nodes := []NodeInfo{ + nodeInfoFromAttributes("ClusterName", "D1OBJ", "ID", "1"), + nodeInfoFromAttributes("ClusterName", "D1OBJ", "ID", "2"), + nodeInfoFromAttributes("ClusterName", "D1OBJ", "ID", "3"), + nodeInfoFromAttributes("ClusterName", "D1OBJ", "ID", "4"), + nodeInfoFromAttributes("ClusterName", "D1OBJ", "ID", "5"), + nodeInfoFromAttributes("ClusterName", "D1OBJ", "ID", "6"), + nodeInfoFromAttributes("ClusterName", "D1OBJ", "ID", "7"), + nodeInfoFromAttributes("ClusterName", "D1OBJ", "ID", "8"), + } + + var nm NetMap + nm.SetNodes(nodes) + + res, err := nm.ContainerNodes(p, nil) + require.NoError(t, err) + require.Len(t, res, 2) + require.Len(t, res[0], 4) + require.Len(t, res[1], 0) +} + func TestPlacementPolicy_Like(t *testing.T) { nodes := []NodeInfo{ nodeInfoFromAttributes("Country", "Russia"), diff --git a/netmap/yml_test.go b/netmap/yml_test.go index 4df6e0a..1f83462 100644 --- a/netmap/yml_test.go +++ b/netmap/yml_test.go @@ -84,8 +84,15 @@ func TestPlacementPolicy_Interopability(t *testing.T) { t.Run(name, func(t *testing.T) { v, err := nm.ContainerNodes(tt.Policy, tt.Pivot) if tt.Result == nil { - require.Error(t, err) - require.Contains(t, err.Error(), tt.Error) + if tt.Error != "" { + require.Error(t, err) + require.Contains(t, err.Error(), tt.Error) + } else { + require.Len(t, v, tt.Policy.NumberOfReplicas()) + for i := range v { + require.Len(t, v[i], 0) + } + } } else { require.NoError(t, err) require.Equal(t, srcNodes, tc.Nodes) diff --git a/netmap/yml_tests/filter_complex.yml b/netmap/yml_tests/filter_complex.yml index a65fa17..1abc46a 100644 --- a/netmap/yml_tests/filter_complex.yml +++ b/netmap/yml_tests/filter_complex.yml @@ -107,7 +107,6 @@ tests: op: EQ value: Value2 filters: [] - error: not enough nodes bad rating: policy: replicas: @@ -157,7 +156,6 @@ tests: op: EQ value: Value2 filters: [] - error: not enough nodes bad param: policy: replicas: @@ -207,4 +205,3 @@ tests: op: EQ value: Value2 filters: [] - error: not enough nodes diff --git a/netmap/yml_tests/filter_invalid_integer.yml b/netmap/yml_tests/filter_invalid_integer.yml index e65ab24..6674246 100644 --- a/netmap/yml_tests/filter_invalid_integer.yml +++ b/netmap/yml_tests/filter_invalid_integer.yml @@ -24,7 +24,6 @@ tests: op: LE value: '8' filters: [] - error: not enough nodes non-empty string is not casted to a number: policy: replicas: @@ -42,4 +41,3 @@ tests: op: GE value: '0' filters: [] - error: not enough nodes diff --git a/netmap/yml_tests/filter_simple.yml b/netmap/yml_tests/filter_simple.yml index a24814a..7fdd84a 100644 --- a/netmap/yml_tests/filter_simple.yml +++ b/netmap/yml_tests/filter_simple.yml @@ -42,7 +42,6 @@ tests: op: GE value: '5' filters: [] - error: not enough nodes GT true: policy: replicas: @@ -79,7 +78,6 @@ tests: op: GT value: '4' filters: [] - error: not enough nodes LE true: policy: replicas: @@ -116,7 +114,6 @@ tests: op: LE value: '3' filters: [] - error: not enough nodes LT true: policy: replicas: @@ -153,7 +150,6 @@ tests: op: LT value: '4' filters: [] - error: not enough nodes EQ true: policy: replicas: @@ -190,7 +186,6 @@ tests: op: EQ value: China filters: [] - error: not enough nodes NE true: policy: replicas: @@ -227,4 +222,3 @@ tests: op: NE value: Germany filters: [] - error: not enough nodes diff --git a/netmap/yml_tests/selector_invalid.yml b/netmap/yml_tests/selector_invalid.yml index d6e3b4e..9b0a539 100644 --- a/netmap/yml_tests/selector_invalid.yml +++ b/netmap/yml_tests/selector_invalid.yml @@ -45,4 +45,3 @@ tests: op: EQ value: Moon filters: [] - error: not enough nodes From 81c423e7094d870f7e38e5ccca8e4690dfe89699 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Wed, 4 Dec 2024 18:02:48 +0300 Subject: [PATCH 125/197] [#301] rpc: Make client stream initialization get cancelled by dial timeout * `c.conn` may be already invalidated but the rpc client can't detect this. `NewStream` may hang trying to open a stream with invalidated connection. Using timer with `dialTimeout` for `NewStream` fixes this problem. Signed-off-by: Airat Arifullin --- api/rpc/client/init.go | 55 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 8 deletions(-) diff --git a/api/rpc/client/init.go b/api/rpc/client/init.go index 706e6a9..95e9301 100644 --- a/api/rpc/client/init.go +++ b/api/rpc/client/init.go @@ -3,6 +3,7 @@ package client import ( "context" "io" + "time" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/common" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/message" @@ -51,18 +52,56 @@ func (c *Client) Init(info common.CallMethodInfo, opts ...CallOption) (MessageRe } ctx, cancel := context.WithCancel(prm.ctx) - stream, err := c.conn.NewStream(ctx, &grpc.StreamDesc{ - StreamName: info.Name, - ServerStreams: info.ServerStream(), - ClientStreams: info.ClientStream(), - }, toMethodName(info)) - if err != nil { + + // `conn.NewStream` doesn't check if `conn` may turn up invalidated right before this invocation. + // In such cases, the operation can hang indefinitely, with the context timeout being the only + // mechanism to cancel it. + // + // We use a separate timer instead of context timeout because the latter + // would propagate to all subsequent read/write operations on the opened stream, + // which is not desired for the stream's lifecycle management. + dialTimeoutTimer := time.NewTimer(c.dialTimeout) + defer dialTimeoutTimer.Stop() + + type newStreamRes struct { + stream grpc.ClientStream + err error + } + newStreamCh := make(chan newStreamRes) + + go func() { + stream, err := c.conn.NewStream(ctx, &grpc.StreamDesc{ + StreamName: info.Name, + ServerStreams: info.ServerStream(), + ClientStreams: info.ClientStream(), + }, toMethodName(info)) + + newStreamCh <- newStreamRes{ + stream: stream, + err: err, + } + }() + + var res newStreamRes + + select { + case <-dialTimeoutTimer.C: cancel() - return nil, err + res = <-newStreamCh + if res.stream != nil && res.err == nil { + _ = res.stream.CloseSend() + } + return nil, context.Canceled + case res = <-newStreamCh: + } + + if res.err != nil { + cancel() + return nil, res.err } return &streamWrapper{ - ClientStream: stream, + ClientStream: res.stream, cancel: cancel, timeout: c.rwTimeout, }, nil From e3026d3f4c2cf6652ed8364773d5b0d0192588fe Mon Sep 17 00:00:00 2001 From: Ekaterina Lebedeva Date: Fri, 15 Nov 2024 16:25:38 +0300 Subject: [PATCH 126/197] [#291] container: Add ListStream to api Since api was moved from `TrueCloudLab/frostfs-api-go` to sdk, moving changes from TrueCloudLab/frostfs-api-go#125 here. Signed-off-by: Ekaterina Lebedeva --- api/apemanager/grpc/service_grpc.pb.go | 84 +-- api/container/convert.go | 135 ++++ api/container/grpc/service_frostfs.pb.go | 769 ++++++++++++++++++++ api/container/grpc/service_frostfs_fuzz.go | 38 + api/container/grpc/service_frostfs_test.go | 20 + api/container/grpc/service_grpc.pb.go | 185 +++-- api/container/marshal.go | 62 ++ api/container/types.go | 68 ++ api/object/grpc/service_grpc.pb.go | 800 +++++++++++---------- api/rpc/container.go | 25 + api/signature/body.go | 4 + 11 files changed, 1699 insertions(+), 491 deletions(-) diff --git a/api/apemanager/grpc/service_grpc.pb.go b/api/apemanager/grpc/service_grpc.pb.go index eb11f3f..bf76cc4 100644 --- a/api/apemanager/grpc/service_grpc.pb.go +++ b/api/apemanager/grpc/service_grpc.pb.go @@ -31,37 +31,37 @@ 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. + // - **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. + // - **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. + // - **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) } @@ -107,37 +107,37 @@ 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. + // - **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. + // - **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. + // - **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) } diff --git a/api/container/convert.go b/api/container/convert.go index c91bdfd..5a9a805 100644 --- a/api/container/convert.go +++ b/api/container/convert.go @@ -762,3 +762,138 @@ func (r *ListResponse) FromGRPCMessage(m grpc.Message) error { return r.ResponseHeaders.FromMessage(v) } + +func (r *ListStreamRequestBody) ToGRPCMessage() grpc.Message { + var m *container.ListStreamRequest_Body + + if r != nil { + m = new(container.ListStreamRequest_Body) + + m.SetOwnerId(r.ownerID.ToGRPCMessage().(*refsGRPC.OwnerID)) + } + + return m +} + +func (r *ListStreamRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.ListStreamRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + ownerID := v.GetOwnerId() + if ownerID == nil { + r.ownerID = nil + } else { + if r.ownerID == nil { + r.ownerID = new(refs.OwnerID) + } + + err = r.ownerID.FromGRPCMessage(ownerID) + } + + return err +} + +func (r *ListStreamRequest) ToGRPCMessage() grpc.Message { + var m *container.ListStreamRequest + + if r != nil { + m = new(container.ListStreamRequest) + + m.SetBody(r.body.ToGRPCMessage().(*container.ListStreamRequest_Body)) + r.RequestHeaders.ToMessage(m) + } + + return m +} + +func (r *ListStreamRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.ListStreamRequest) + 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(ListStreamRequestBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.RequestHeaders.FromMessage(v) +} + +func (r *ListStreamResponseBody) ToGRPCMessage() grpc.Message { + var m *container.ListStreamResponse_Body + + if r != nil { + m = new(container.ListStreamResponse_Body) + + m.SetContainerIds(refs.ContainerIDsToGRPCMessage(r.cidList)) + } + + return m +} + +func (r *ListStreamResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.ListStreamResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + r.cidList, err = refs.ContainerIDsFromGRPCMessage(v.GetContainerIds()) + + return err +} + +func (r *ListStreamResponse) ToGRPCMessage() grpc.Message { + var m *container.ListStreamResponse + + if r != nil { + m = new(container.ListStreamResponse) + + m.SetBody(r.body.ToGRPCMessage().(*container.ListStreamResponse_Body)) + r.ResponseHeaders.ToMessage(m) + } + + return m +} + +func (r *ListStreamResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*container.ListStreamResponse) + 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(ListStreamResponseBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.ResponseHeaders.FromMessage(v) +} diff --git a/api/container/grpc/service_frostfs.pb.go b/api/container/grpc/service_frostfs.pb.go index 0743824..0388293 100644 --- a/api/container/grpc/service_frostfs.pb.go +++ b/api/container/grpc/service_frostfs.pb.go @@ -3155,3 +3155,772 @@ func (x *ListResponse) UnmarshalEasyJSON(in *jlexer.Lexer) { in.Consumed() } } + +type ListStreamRequest_Body struct { + OwnerId *grpc.OwnerID `json:"ownerId"` +} + +var ( + _ encoding.ProtoMarshaler = (*ListStreamRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*ListStreamRequest_Body)(nil) + _ json.Marshaler = (*ListStreamRequest_Body)(nil) + _ json.Unmarshaler = (*ListStreamRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ListStreamRequest_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 *ListStreamRequest_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 *ListStreamRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.OwnerId != nil { + x.OwnerId.EmitProtobuf(mm.AppendMessage(1)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ListStreamRequest_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", "ListStreamRequest_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 *ListStreamRequest_Body) GetOwnerId() *grpc.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} +func (x *ListStreamRequest_Body) SetOwnerId(v *grpc.OwnerID) { + x.OwnerId = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ListStreamRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ListStreamRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ownerId\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ListStreamRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ListStreamRequest_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 ListStreamRequest struct { + Body *ListStreamRequest_Body `json:"body"` + MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*ListStreamRequest)(nil) + _ encoding.ProtoUnmarshaler = (*ListStreamRequest)(nil) + _ json.Marshaler = (*ListStreamRequest)(nil) + _ json.Unmarshaler = (*ListStreamRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ListStreamRequest) 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 *ListStreamRequest) 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 *ListStreamRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ListStreamRequest) 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 *ListStreamRequest) 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 *ListStreamRequest) 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", "ListStreamRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(ListStreamRequest_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 *ListStreamRequest) GetBody() *ListStreamRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *ListStreamRequest) SetBody(v *ListStreamRequest_Body) { + x.Body = v +} +func (x *ListStreamRequest) GetMetaHeader() *grpc1.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *ListStreamRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *ListStreamRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *ListStreamRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ListStreamRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ListStreamRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ListStreamRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ListStreamRequest) 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 *ListStreamRequest_Body + f = new(ListStreamRequest_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 ListStreamResponse_Body struct { + ContainerIds []grpc.ContainerID `json:"containerIds"` +} + +var ( + _ encoding.ProtoMarshaler = (*ListStreamResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*ListStreamResponse_Body)(nil) + _ json.Marshaler = (*ListStreamResponse_Body)(nil) + _ json.Unmarshaler = (*ListStreamResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ListStreamResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + for i := range x.ContainerIds { + size += proto.NestedStructureSizeUnchecked(1, &x.ContainerIds[i]) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ListStreamResponse_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 *ListStreamResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + for i := range x.ContainerIds { + x.ContainerIds[i].EmitProtobuf(mm.AppendMessage(1)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ListStreamResponse_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", "ListStreamResponse_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, 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 *ListStreamResponse_Body) GetContainerIds() []grpc.ContainerID { + if x != nil { + return x.ContainerIds + } + return nil +} +func (x *ListStreamResponse_Body) SetContainerIds(v []grpc.ContainerID) { + x.ContainerIds = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ListStreamResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ListStreamResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"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('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ListStreamResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ListStreamResponse_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 = 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 ListStreamResponse struct { + Body *ListStreamResponse_Body `json:"body"` + MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*ListStreamResponse)(nil) + _ encoding.ProtoUnmarshaler = (*ListStreamResponse)(nil) + _ json.Marshaler = (*ListStreamResponse)(nil) + _ json.Unmarshaler = (*ListStreamResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ListStreamResponse) 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 *ListStreamResponse) 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 *ListStreamResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ListStreamResponse) 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 *ListStreamResponse) 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 *ListStreamResponse) 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", "ListStreamResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(ListStreamResponse_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 *ListStreamResponse) GetBody() *ListStreamResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *ListStreamResponse) SetBody(v *ListStreamResponse_Body) { + x.Body = v +} +func (x *ListStreamResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *ListStreamResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *ListStreamResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *ListStreamResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ListStreamResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ListStreamResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + first := true + out.RawByte('{') + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ListStreamResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ListStreamResponse) 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 *ListStreamResponse_Body + f = new(ListStreamResponse_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/api/container/grpc/service_frostfs_fuzz.go b/api/container/grpc/service_frostfs_fuzz.go index 7e6d6e6..024b237 100644 --- a/api/container/grpc/service_frostfs_fuzz.go +++ b/api/container/grpc/service_frostfs_fuzz.go @@ -157,3 +157,41 @@ func DoFuzzJSONListResponse(data []byte) int { } return 1 } +func DoFuzzProtoListStreamRequest(data []byte) int { + msg := new(ListStreamRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONListStreamRequest(data []byte) int { + msg := new(ListStreamRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoListStreamResponse(data []byte) int { + msg := new(ListStreamResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONListStreamResponse(data []byte) int { + msg := new(ListStreamResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} diff --git a/api/container/grpc/service_frostfs_test.go b/api/container/grpc/service_frostfs_test.go index 804b89c..2844996 100644 --- a/api/container/grpc/service_frostfs_test.go +++ b/api/container/grpc/service_frostfs_test.go @@ -89,3 +89,23 @@ func FuzzJSONListResponse(f *testing.F) { DoFuzzJSONListResponse(data) }) } +func FuzzProtoListStreamRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoListStreamRequest(data) + }) +} +func FuzzJSONListStreamRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONListStreamRequest(data) + }) +} +func FuzzProtoListStreamResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoListStreamResponse(data) + }) +} +func FuzzJSONListStreamResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONListStreamResponse(data) + }) +} diff --git a/api/container/grpc/service_grpc.pb.go b/api/container/grpc/service_grpc.pb.go index ea22604..5991e81 100644 --- a/api/container/grpc/service_grpc.pb.go +++ b/api/container/grpc/service_grpc.pb.go @@ -19,10 +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_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_ListStream_FullMethodName = "/neo.fs.v2.container.ContainerService/ListStream" ) // ContainerServiceClient is the client API for ContainerService service. @@ -35,11 +36,11 @@ type ContainerServiceClient interface { // container 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); - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // container create access denied. + // - **OK** (0, SECTION_SUCCESS): \ + // request to save the container has been sent to the sidechain; + // - 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 @@ -47,32 +48,42 @@ type ContainerServiceClient interface { // container 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); - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // container delete access denied. + // - **OK** (0, SECTION_SUCCESS): \ + // request to remove the container has been sent to the sidechain; + // - 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. // // 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; - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container is denied. + // - **OK** (0, SECTION_SUCCESS): \ + // container has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // 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. + // 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); - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // container list access denied. + // - **OK** (0, SECTION_SUCCESS): \ + // container list has been successfully read; + // - 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) + // Returns all owner's containers from `Container` smart contract storage + // via stream. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // container list has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // container list access denied. + ListStream(ctx context.Context, in *ListStreamRequest, opts ...grpc.CallOption) (ContainerService_ListStreamClient, error) } type containerServiceClient struct { @@ -119,6 +130,38 @@ func (c *containerServiceClient) List(ctx context.Context, in *ListRequest, opts return out, nil } +func (c *containerServiceClient) ListStream(ctx context.Context, in *ListStreamRequest, opts ...grpc.CallOption) (ContainerService_ListStreamClient, error) { + stream, err := c.cc.NewStream(ctx, &ContainerService_ServiceDesc.Streams[0], ContainerService_ListStream_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &containerServiceListStreamClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ContainerService_ListStreamClient interface { + Recv() (*ListStreamResponse, error) + grpc.ClientStream +} + +type containerServiceListStreamClient struct { + grpc.ClientStream +} + +func (x *containerServiceListStreamClient) Recv() (*ListStreamResponse, error) { + m := new(ListStreamResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + // ContainerServiceServer is the server API for ContainerService service. // All implementations should embed UnimplementedContainerServiceServer // for forward compatibility @@ -129,11 +172,11 @@ type ContainerServiceServer interface { // container 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); - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // container create access denied. + // - **OK** (0, SECTION_SUCCESS): \ + // request to save the container has been sent to the sidechain; + // - 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 @@ -141,32 +184,42 @@ type ContainerServiceServer interface { // container 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); - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // container delete access denied. + // - **OK** (0, SECTION_SUCCESS): \ + // request to remove the container has been sent to the sidechain; + // - 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. // // 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; - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container is denied. + // - **OK** (0, SECTION_SUCCESS): \ + // container has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // 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. + // 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); - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // container list access denied. + // - **OK** (0, SECTION_SUCCESS): \ + // container list has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // container list access denied. List(context.Context, *ListRequest) (*ListResponse, error) + // Returns all owner's containers from `Container` smart contract storage + // via stream. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // container list has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // container list access denied. + ListStream(*ListStreamRequest, ContainerService_ListStreamServer) error } // UnimplementedContainerServiceServer should be embedded to have forward compatible implementations. @@ -185,6 +238,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) ListStream(*ListStreamRequest, ContainerService_ListStreamServer) error { + return status.Errorf(codes.Unimplemented, "method ListStream 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 @@ -269,6 +325,27 @@ func _ContainerService_List_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _ContainerService_ListStream_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ListStreamRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ContainerServiceServer).ListStream(m, &containerServiceListStreamServer{stream}) +} + +type ContainerService_ListStreamServer interface { + Send(*ListStreamResponse) error + grpc.ServerStream +} + +type containerServiceListStreamServer struct { + grpc.ServerStream +} + +func (x *containerServiceListStreamServer) Send(m *ListStreamResponse) error { + return x.ServerStream.SendMsg(m) +} + // 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) @@ -293,6 +370,12 @@ var ContainerService_ServiceDesc = grpc.ServiceDesc{ Handler: _ContainerService_List_Handler, }, }, - Streams: []grpc.StreamDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "ListStream", + Handler: _ContainerService_ListStream_Handler, + ServerStreams: true, + }, + }, Metadata: "api/container/grpc/service.proto", } diff --git a/api/container/marshal.go b/api/container/marshal.go index 2b16669..89a6661 100644 --- a/api/container/marshal.go +++ b/api/container/marshal.go @@ -343,3 +343,65 @@ func (r *ListResponseBody) StableSize() (size int) { func (r *ListResponseBody) Unmarshal(data []byte) error { return message.Unmarshal(r, data, new(container.ListResponse_Body)) } + +func (r *ListStreamRequestBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + protoutil.NestedStructureMarshal(listReqBodyOwnerField, buf, r.ownerID) + + return buf +} + +func (r *ListStreamRequestBody) StableSize() (size int) { + if r == nil { + return 0 + } + + size += protoutil.NestedStructureSize(listReqBodyOwnerField, r.ownerID) + + return size +} + +func (r *ListStreamRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(container.ListStreamRequest_Body)) +} + +func (r *ListStreamResponseBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + + for i := range r.cidList { + offset += protoutil.NestedStructureMarshal(listRespBodyIDsField, buf[offset:], &r.cidList[i]) + } + + return buf +} + +func (r *ListStreamResponseBody) StableSize() (size int) { + if r == nil { + return 0 + } + + for i := range r.cidList { + size += protoutil.NestedStructureSize(listRespBodyIDsField, &r.cidList[i]) + } + + return size +} + +func (r *ListStreamResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(container.ListStreamResponse_Body)) +} diff --git a/api/container/types.go b/api/container/types.go index 92c4706..4da3f87 100644 --- a/api/container/types.go +++ b/api/container/types.go @@ -109,6 +109,26 @@ type ListResponse struct { session.ResponseHeaders } +type ListStreamRequestBody struct { + ownerID *refs.OwnerID +} + +type ListStreamRequest struct { + body *ListStreamRequestBody + + session.RequestHeaders +} + +type ListStreamResponseBody struct { + cidList []refs.ContainerID +} + +type ListStreamResponse struct { + body *ListStreamResponseBody + + session.ResponseHeaders +} + func (a *Attribute) GetKey() string { if a != nil { return a.key @@ -444,3 +464,51 @@ func (r *ListResponse) GetBody() *ListResponseBody { func (r *ListResponse) SetBody(v *ListResponseBody) { r.body = v } + +func (r *ListStreamRequestBody) GetOwnerID() *refs.OwnerID { + if r != nil { + return r.ownerID + } + + return nil +} + +func (r *ListStreamRequestBody) SetOwnerID(v *refs.OwnerID) { + r.ownerID = v +} + +func (r *ListStreamRequest) GetBody() *ListStreamRequestBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *ListStreamRequest) SetBody(v *ListStreamRequestBody) { + r.body = v +} + +func (r *ListStreamResponseBody) GetContainerIDs() []refs.ContainerID { + if r != nil { + return r.cidList + } + + return nil +} + +func (r *ListStreamResponseBody) SetContainerIDs(v []refs.ContainerID) { + r.cidList = v +} + +func (r *ListStreamResponse) GetBody() *ListStreamResponseBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *ListStreamResponse) SetBody(v *ListStreamResponseBody) { + r.body = v +} diff --git a/api/object/grpc/service_grpc.pb.go b/api/object/grpc/service_grpc.pb.go index eb53afe..2054f89 100644 --- a/api/object/grpc/service_grpc.pb.go +++ b/api/object/grpc/service_grpc.pb.go @@ -42,35 +42,35 @@ type ObjectServiceClient interface { // chunks 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; - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container is denied; - // - **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; + // - **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) // Put the object into container. Request uses gRPC stream. First message // SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object @@ -80,118 +80,119 @@ 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; - // - **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 + // - **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; + // - **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. + // - **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; - // - **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): \ - // 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. + // - **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; + // - **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): \ + // 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) // 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; - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container is denied; - // - **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; + // - **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) // Search objects in container. Search query allows to match by Object // Header's filed values. Please see the corresponding FrostFS 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; - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container is denied; - // - **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; + // - **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) // 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 @@ -199,35 +200,35 @@ type ObjectServiceClient interface { // receiving 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; - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container is denied; - // - **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; + // - **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) // Returns homomorphic or regular hash of object's payload range after // applying XOR operation with the provided `salt`. Ranges are set of (offset, @@ -235,68 +236,69 @@ 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; - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container is denied; - // - **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; + // - **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) // Put the prepared object into container. // `ContainerID`, `ObjectID`, `OwnerID`, `PayloadHash` and `PayloadLength` of // an object MUST be set. // // 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. + // - [ __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; - // - **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 + // - **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; + // - **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. + // - **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 @@ -317,34 +319,34 @@ type ObjectServiceClient interface { // 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. + // - [ __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. + // - **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) } @@ -568,35 +570,35 @@ type ObjectServiceServer interface { // chunks 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; - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container is denied; - // - **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; + // - **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 // Put the object into container. Request uses gRPC stream. First message // SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object @@ -606,118 +608,119 @@ 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; - // - **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 + // - **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; + // - **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. + // - **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; - // - **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): \ - // 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. + // - **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; + // - **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): \ + // 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) // 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; - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container is denied; - // - **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; + // - **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) // Search objects in container. Search query allows to match by Object // Header's filed values. Please see the corresponding FrostFS 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; - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container is denied; - // - **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; + // - **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 // 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 @@ -725,35 +728,35 @@ type ObjectServiceServer interface { // receiving 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; - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container is denied; - // - **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; + // - **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 // Returns homomorphic or regular hash of object's payload range after // applying XOR operation with the provided `salt`. Ranges are set of (offset, @@ -761,68 +764,69 @@ 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; - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container is denied; - // - **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; + // - **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) // Put the prepared object into container. // `ContainerID`, `ObjectID`, `OwnerID`, `PayloadHash` and `PayloadLength` of // an object MUST be set. // // 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. + // - [ __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; - // - **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 + // - **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; + // - **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. + // - **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 @@ -843,34 +847,34 @@ type ObjectServiceServer interface { // 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. + // - [ __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. + // - **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 } diff --git a/api/rpc/container.go b/api/rpc/container.go index 9ba5c99..a759bd5 100644 --- a/api/rpc/container.go +++ b/api/rpc/container.go @@ -13,6 +13,7 @@ const ( rpcContainerGet = "Get" rpcContainerDel = "Delete" rpcContainerList = "List" + rpcContainerStream = "ListStream" rpcContainerGetEACL = "GetExtendedACL" rpcContainerUsedSpace = "AnnounceUsedSpace" ) @@ -80,3 +81,27 @@ func ListContainers( return resp, nil } + +type ListStreamResponseReader struct { + r client.MessageReader +} + +func (r *ListStreamResponseReader) Read(resp *container.ListStreamResponse) error { + return r.r.ReadMessage(resp) +} + +// ListContainersStream executes ContainerService.ListStream RPC. +func ListContainersStream( + cli *client.Client, + req *container.ListStreamRequest, + opts ...client.CallOption, +) (*ListStreamResponseReader, error) { + wc, err := client.OpenServerStream(cli, common.CallMethodInfoServerStream(serviceContainer, rpcContainerStream), req, opts...) + if err != nil { + return nil, err + } + + return &ListStreamResponseReader{ + r: wc, + }, nil +} diff --git a/api/signature/body.go b/api/signature/body.go index 50a09e9..2467dc0 100644 --- a/api/signature/body.go +++ b/api/signature/body.go @@ -46,6 +46,10 @@ func serviceMessageBody(req any) stableMarshaler { return v.GetBody() case *container.ListResponse: return v.GetBody() + case *container.ListStreamRequest: + return v.GetBody() + case *container.ListStreamResponse: + return v.GetBody() /* Object */ case *object.PutRequest: From 852dac14766257f5e296b252e90deb173946074e Mon Sep 17 00:00:00 2001 From: Ekaterina Lebedeva Date: Mon, 28 Oct 2024 18:06:01 +0300 Subject: [PATCH 127/197] [#291] container: Add ListStream method Signed-off-by: Ekaterina Lebedeva --- client/container_list_stream.go | 203 ++++++++++++++++++++++++++++++++ pool/mock_test.go | 4 + pool/pool.go | 88 ++++++++++++++ 3 files changed, 295 insertions(+) create mode 100644 client/container_list_stream.go diff --git a/client/container_list_stream.go b/client/container_list_stream.go new file mode 100644 index 0000000..5ae282a --- /dev/null +++ b/client/container_list_stream.go @@ -0,0 +1,203 @@ +package client + +import ( + "context" + "errors" + "fmt" + "io" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + rpcapi "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + v2session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/signature" + apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" + cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user" +) + +// PrmContainerListStream groups parameters of ContainerListStream operation. +type PrmContainerListStream struct { + XHeaders []string + + OwnerID user.ID + + Session *session.Container +} + +func (x *PrmContainerListStream) buildRequest(c *Client) (*container.ListStreamRequest, error) { + if x.OwnerID.IsEmpty() { + return nil, errorAccountNotSet + } + + var ownerV2 refs.OwnerID + x.OwnerID.WriteToV2(&ownerV2) + + reqBody := new(container.ListStreamRequestBody) + reqBody.SetOwnerID(&ownerV2) + + var meta v2session.RequestMetaHeader + writeXHeadersToMeta(x.XHeaders, &meta) + + if x.Session != nil { + var tokv2 v2session.Token + x.Session.WriteToV2(&tokv2) + + meta.SetSessionToken(&tokv2) + } + + var req container.ListStreamRequest + req.SetBody(reqBody) + c.prepareRequest(&req, &meta) + return &req, nil +} + +// ResContainerListStream groups the final result values of ContainerListStream operation. +type ResContainerListStream struct { + statusRes +} + +// ContainerListReader is designed to read list of container identifiers from FrostFS system. +// +// Must be initialized using Client.ContainerListInit, any other usage is unsafe. +type ContainerListReader struct { + client *Client + cancelCtxStream context.CancelFunc + err error + res ResContainerListStream + stream interface { + Read(resp *container.ListStreamResponse) error + } + tail []refs.ContainerID +} + +// Read reads another list of the container identifiers. Works similar to +// io.Reader.Read but copies cid.ID and returns success flag instead of error. +// +// Failure reason can be received via Close. +// +// Panics if buf has zero length. +func (x *ContainerListReader) Read(buf []cid.ID) (int, bool) { + // if len(buf) == 0 { + // panic("empty buffer in ContainerListReader.ReadList") + // } + + read := copyCnrIDBuffers(buf, x.tail) + x.tail = x.tail[read:] + + if len(buf) == read { + return read, true + } + + for { + var resp container.ListStreamResponse + x.err = x.stream.Read(&resp) + if x.err != nil { + return read, false + } + + x.res.st, x.err = x.client.processResponse(&resp) + if x.err != nil || !apistatus.IsSuccessful(x.res.st) { + return read, false + } + + // read new chunk of containers + ids := resp.GetBody().GetContainerIDs() + if len(ids) == 0 { + // just skip empty lists since they are not prohibited by protocol + continue + } + + ln := copyCnrIDBuffers(buf[read:], ids) + read += ln + + if read == len(buf) { + // save the tail + x.tail = append(x.tail, ids[ln:]...) + + return read, true + } + } +} + +func copyCnrIDBuffers(dst []cid.ID, src []refs.ContainerID) int { + var i int + for ; i < len(dst) && i < len(src); i++ { + _ = dst[i].ReadFromV2(src[i]) + } + return i +} + +// Iterate iterates over the list of found container identifiers. +// f can return true to stop iteration earlier. +// +// Returns an error if container can't be read. +func (x *ContainerListReader) Iterate(f func(cid.ID) bool) error { + buf := make([]cid.ID, 1) + + for { + // Do not check first return value because `len(buf) == 1`, + // so false means nothing was read. + _, ok := x.Read(buf) + if !ok { + res, err := x.Close() + if err != nil { + return err + } + return apistatus.ErrFromStatus(res.Status()) + } + if f(buf[0]) { + return nil + } + } +} + +// Close ends reading list of the matched containers and returns the result of the operation +// along with the final results. Must be called after using the ContainerListReader. +// +// Exactly one return value is non-nil. By default, server status is returned in res structure. +// Any client's internal or transport errors are returned as Go built-in error. +// If Client is tuned to resolve FrostFS API statuses, then FrostFS failures +// codes are returned as error. +func (x *ContainerListReader) Close() (*ResContainerListStream, error) { + defer x.cancelCtxStream() + + if x.err != nil && !errors.Is(x.err, io.EOF) { + return nil, x.err + } + + return &x.res, nil +} + +// ContainerListInit initiates container selection through a remote server using FrostFS API protocol. +// +// The call only opens the transmission channel, explicit fetching of identifiers of the account-owned +// containers is done using the ContainerListReader. Exactly one return value is non-nil. +// Resulting reader must be finally closed. +// +// Returns an error if parameters are set incorrectly (see PrmContainerListStream docs). +// Context is required and must not be nil. It is used for network communication. +func (c *Client) ContainerListInit(ctx context.Context, prm PrmContainerListStream) (*ContainerListReader, error) { + req, err := prm.buildRequest(c) + if err != nil { + return nil, err + } + + err = signature.SignServiceMessage(&c.prm.Key, req) + if err != nil { + return nil, fmt.Errorf("sign request: %w", err) + } + + var r ContainerListReader + ctx, r.cancelCtxStream = context.WithCancel(ctx) + + r.stream, err = rpcapi.ListContainersStream(&c.c, req, client.WithContext(ctx)) + if err != nil { + return nil, fmt.Errorf("open stream: %w", err) + } + r.client = c + + return &r, nil +} diff --git a/pool/mock_test.go b/pool/mock_test.go index ad9fd94..4731108 100644 --- a/pool/mock_test.go +++ b/pool/mock_test.go @@ -104,6 +104,10 @@ func (m *mockClient) containerList(context.Context, PrmContainerList) ([]cid.ID, return nil, nil } +func (m *mockClient) containerListStream(context.Context, PrmListStream) (ResListStream, error) { + return ResListStream{}, nil +} + func (m *mockClient) containerDelete(context.Context, PrmContainerDelete) error { return nil } diff --git a/pool/pool.go b/pool/pool.go index d795af8..6ca136b 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -47,6 +47,8 @@ type client interface { containerGet(context.Context, PrmContainerGet) (container.Container, error) // see clientWrapper.containerList. containerList(context.Context, PrmContainerList) ([]cid.ID, error) + // see clientWrapper.containerListStream. + containerListStream(context.Context, PrmListStream) (ResListStream, error) // see clientWrapper.containerDelete. containerDelete(context.Context, PrmContainerDelete) error // see clientWrapper.apeManagerAddChain. @@ -145,6 +147,7 @@ const ( methodContainerPut methodContainerGet methodContainerList + methodContainerListStream methodContainerDelete methodEndpointInfo methodNetworkInfo @@ -529,6 +532,75 @@ func (c *clientWrapper) containerList(ctx context.Context, prm PrmContainerList) return res.Containers(), nil } +// PrmListStream groups parameters of ListContainersStream operation. +type PrmListStream struct { + OwnerID user.ID + + Session *session.Container +} + +// ResListStream is designed to read list of object identifiers from FrostFS system. +// +// Must be initialized using Pool.ListContainersStream, any other usage is unsafe. +type ResListStream struct { + r *sdkClient.ContainerListReader + handleError func(context.Context, apistatus.Status, error) error +} + +// Read reads another list of the container identifiers. +func (x *ResListStream) Read(buf []cid.ID) (int, error) { + n, ok := x.r.Read(buf) + if !ok { + res, err := x.r.Close() + if err == nil { + return n, io.EOF + } + + var status apistatus.Status + if res != nil { + status = res.Status() + } + err = x.handleError(nil, status, err) + + return n, err + } + + return n, nil +} + +// Iterate iterates over the list of found container identifiers. +// f can return true to stop iteration earlier. +// +// Returns an error if container can't be read. +func (x *ResListStream) Iterate(f func(cid.ID) bool) error { + return x.r.Iterate(f) +} + +// Close ends reading list of the matched containers and returns the result of the operation +// along with the final results. Must be called after using the ResListStream. +func (x *ResListStream) Close() { + _, _ = x.r.Close() +} + +// containerList invokes sdkClient.ContainerList parse response status to error and return result as is. +func (c *clientWrapper) containerListStream(ctx context.Context, prm PrmListStream) (ResListStream, error) { + cl, err := c.getClient() + if err != nil { + return ResListStream{}, err + } + + cliPrm := sdkClient.PrmContainerListStream{ + OwnerID: prm.OwnerID, + Session: prm.Session, + } + + res, err := cl.ContainerListInit(ctx, cliPrm) + if err = c.handleError(ctx, nil, err); err != nil { + return ResListStream{}, fmt.Errorf("init container listing on client: %w", err) + } + return ResListStream{r: res, handleError: c.handleError}, nil +} + // containerDelete invokes sdkClient.ContainerDelete parse response status to error. // It also waits for the container to be removed from the network. func (c *clientWrapper) containerDelete(ctx context.Context, prm PrmContainerDelete) error { @@ -2887,6 +2959,22 @@ func (p *Pool) ListContainers(ctx context.Context, prm PrmContainerList) ([]cid. return cnrIDs, nil } +// ListContainersStream requests identifiers of the account-owned containers. +func (p *Pool) ListContainersStream(ctx context.Context, prm PrmListStream) (ResListStream, error) { + var res ResListStream + cp, err := p.connection() + if err != nil { + return res, err + } + + res, err = cp.containerListStream(ctx, prm) + if err != nil { + return res, fmt.Errorf("list containers stream via client '%s': %w", cp.address(), err) + } + + return res, nil +} + // DeleteContainer sends request to remove the FrostFS container and waits for the operation to complete. // // Waiting parameters can be specified using SetWaitParams. If not called, defaults are used: From c4463df8d467a49d496ebd9816bcae57ecbf1fbd Mon Sep 17 00:00:00 2001 From: Ekaterina Lebedeva Date: Tue, 10 Dec 2024 12:18:06 +0300 Subject: [PATCH 128/197] [#291] container: Rename field Account to OwnerID in PrmContainerList Renaming this field so that it matches PrmContainerListStream. Signed-off-by: Ekaterina Lebedeva --- client/container_list.go | 10 +++++----- pool/pool.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/container_list.go b/client/container_list.go index d094cdb..5c768cc 100644 --- a/client/container_list.go +++ b/client/container_list.go @@ -20,7 +20,7 @@ import ( type PrmContainerList struct { XHeaders []string - Account user.ID + OwnerID user.ID Session *session.Container } @@ -28,18 +28,18 @@ type PrmContainerList struct { // SetAccount sets identifier of the FrostFS account to list the containers. // Required parameter. // -// Deprecated: Use PrmContainerList.Account instead. +// Deprecated: Use PrmContainerList.OwnerID instead. func (x *PrmContainerList) SetAccount(id user.ID) { - x.Account = id + x.OwnerID = id } func (x *PrmContainerList) buildRequest(c *Client) (*v2container.ListRequest, error) { - if x.Account.IsEmpty() { + if x.OwnerID.IsEmpty() { return nil, errorAccountNotSet } var ownerV2 refs.OwnerID - x.Account.WriteToV2(&ownerV2) + x.OwnerID.WriteToV2(&ownerV2) reqBody := new(v2container.ListRequestBody) reqBody.SetOwnerID(&ownerV2) diff --git a/pool/pool.go b/pool/pool.go index 6ca136b..8013832 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -515,7 +515,7 @@ func (c *clientWrapper) containerList(ctx context.Context, prm PrmContainerList) } cliPrm := sdkClient.PrmContainerList{ - Account: prm.OwnerID, + OwnerID: prm.OwnerID, Session: prm.Session, } From 3dbae11efa01344aaa79c7be12cbc5a4e3dda6d8 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 11 Dec 2024 14:19:40 +0300 Subject: [PATCH 129/197] [#310] client/container: Remove commented code Refs #291. Signed-off-by: Evgenii Stratonikov --- client/container_list_stream.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/client/container_list_stream.go b/client/container_list_stream.go index 5ae282a..79dd0b4 100644 --- a/client/container_list_stream.go +++ b/client/container_list_stream.go @@ -80,10 +80,6 @@ type ContainerListReader struct { // // Panics if buf has zero length. func (x *ContainerListReader) Read(buf []cid.ID) (int, bool) { - // if len(buf) == 0 { - // panic("empty buffer in ContainerListReader.ReadList") - // } - read := copyCnrIDBuffers(buf, x.tail) x.tail = x.tail[read:] From d86cf85b391ecfbcaffba2eba1c92c94f494795d Mon Sep 17 00:00:00 2001 From: Ekaterina Lebedeva Date: Wed, 11 Dec 2024 15:53:53 +0300 Subject: [PATCH 130/197] [#311] client/container: Remove outdated comment Signed-off-by: Ekaterina Lebedeva --- client/container_list_stream.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/client/container_list_stream.go b/client/container_list_stream.go index 79dd0b4..9aecd22 100644 --- a/client/container_list_stream.go +++ b/client/container_list_stream.go @@ -77,8 +77,6 @@ type ContainerListReader struct { // io.Reader.Read but copies cid.ID and returns success flag instead of error. // // Failure reason can be received via Close. -// -// Panics if buf has zero length. func (x *ContainerListReader) Read(buf []cid.ID) (int, bool) { read := copyCnrIDBuffers(buf, x.tail) x.tail = x.tail[read:] From 902f32eeabcfa99571d8668f314f23c5feb8d467 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Wed, 11 Dec 2024 18:23:37 +0300 Subject: [PATCH 131/197] [#312] pool: Ignore `ECInfoErr` errors in `GetSplitInfo` * Ignore `ECInfoError` errors after raw `HeadObject` request Signed-off-by: Airat Arifullin --- pool/pool.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pool/pool.go b/pool/pool.go index 8013832..1f69577 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -3211,11 +3211,12 @@ func (p *Pool) GetSplitInfo(ctx context.Context, cnrID cid.ID, objID oid.ID, tok _, err := p.HeadObject(ctx, prm) var errSplit *object.SplitInfoError + var errECInfo *object.ECInfoError switch { case errors.As(err, &errSplit): return errSplit.SplitInfo(), nil - case err == nil: + case err == nil || errors.As(err, &errECInfo): return nil, relations.ErrNoSplitInfo default: return nil, fmt.Errorf("failed to get raw object header: %w", err) From c7573657524465afcfac5d5575bb504aaecf9562 Mon Sep 17 00:00:00 2001 From: Vitaliy Potyarkin Date: Tue, 10 Dec 2024 15:42:13 +0300 Subject: [PATCH 132/197] [#309] Refine CODEOWNERS settings Signed-off-by: Vitaliy Potyarkin --- CODEOWNERS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index c764212..f164173 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1 +1,3 @@ -.* @TrueCloudLab/storage-core @TrueCloudLab/storage-services +.* @TrueCloudLab/storage-core-committers @TrueCloudLab/storage-core-developers @TrueCloudLab/storage-services-committers @TrueCloudLab/storage-services-developers +.forgejo/.* @potyarkin +Makefile @potyarkin From dcd4ea334e068afbdb103f49a8e59afd16238c32 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 16 Dec 2024 10:37:37 +0300 Subject: [PATCH 133/197] [#315] api: Restore test.proto file Introduced in #281. Signed-off-by: Evgenii Stratonikov --- api/util/proto/test/test.pb.go | 202 ++++++++++++++++----------------- api/util/proto/test/test.proto | 46 ++++++++ 2 files changed, 147 insertions(+), 101 deletions(-) create mode 100644 api/util/proto/test/test.proto diff --git a/api/util/proto/test/test.pb.go b/api/util/proto/test/test.pb.go index e7d5699..ba190d6 100644 --- a/api/util/proto/test/test.pb.go +++ b/api/util/proto/test/test.pb.go @@ -2,7 +2,7 @@ // versions: // protoc-gen-go v1.33.0 // protoc v5.27.2 -// source: util/proto/test/test.proto +// source: api/util/proto/test/test.proto package test @@ -53,11 +53,11 @@ func (x Primitives_SomeEnum) String() string { } func (Primitives_SomeEnum) Descriptor() protoreflect.EnumDescriptor { - return file_util_proto_test_test_proto_enumTypes[0].Descriptor() + return file_api_util_proto_test_test_proto_enumTypes[0].Descriptor() } func (Primitives_SomeEnum) Type() protoreflect.EnumType { - return &file_util_proto_test_test_proto_enumTypes[0] + return &file_api_util_proto_test_test_proto_enumTypes[0] } func (x Primitives_SomeEnum) Number() protoreflect.EnumNumber { @@ -66,7 +66,7 @@ func (x Primitives_SomeEnum) Number() protoreflect.EnumNumber { // Deprecated: Use Primitives_SomeEnum.Descriptor instead. func (Primitives_SomeEnum) EnumDescriptor() ([]byte, []int) { - return file_util_proto_test_test_proto_rawDescGZIP(), []int{0, 0} + return file_api_util_proto_test_test_proto_rawDescGZIP(), []int{0, 0} } type Primitives struct { @@ -96,7 +96,7 @@ type Primitives struct { func (x *Primitives) Reset() { *x = Primitives{} if protoimpl.UnsafeEnabled { - mi := &file_util_proto_test_test_proto_msgTypes[0] + mi := &file_api_util_proto_test_test_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -109,7 +109,7 @@ func (x *Primitives) String() string { func (*Primitives) ProtoMessage() {} func (x *Primitives) ProtoReflect() protoreflect.Message { - mi := &file_util_proto_test_test_proto_msgTypes[0] + mi := &file_api_util_proto_test_test_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -122,7 +122,7 @@ func (x *Primitives) ProtoReflect() protoreflect.Message { // Deprecated: Use Primitives.ProtoReflect.Descriptor instead. func (*Primitives) Descriptor() ([]byte, []int) { - return file_util_proto_test_test_proto_rawDescGZIP(), []int{0} + return file_api_util_proto_test_test_proto_rawDescGZIP(), []int{0} } func (x *Primitives) GetFieldA() []byte { @@ -270,7 +270,7 @@ type RepPrimitives struct { func (x *RepPrimitives) Reset() { *x = RepPrimitives{} if protoimpl.UnsafeEnabled { - mi := &file_util_proto_test_test_proto_msgTypes[1] + mi := &file_api_util_proto_test_test_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -283,7 +283,7 @@ func (x *RepPrimitives) String() string { func (*RepPrimitives) ProtoMessage() {} func (x *RepPrimitives) ProtoReflect() protoreflect.Message { - mi := &file_util_proto_test_test_proto_msgTypes[1] + mi := &file_api_util_proto_test_test_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -296,7 +296,7 @@ func (x *RepPrimitives) ProtoReflect() protoreflect.Message { // Deprecated: Use RepPrimitives.ProtoReflect.Descriptor instead. func (*RepPrimitives) Descriptor() ([]byte, []int) { - return file_util_proto_test_test_proto_rawDescGZIP(), []int{1} + return file_api_util_proto_test_test_proto_rawDescGZIP(), []int{1} } func (x *RepPrimitives) GetFieldA() [][]byte { @@ -366,7 +366,7 @@ type Primitives_Aux struct { func (x *Primitives_Aux) Reset() { *x = Primitives_Aux{} if protoimpl.UnsafeEnabled { - mi := &file_util_proto_test_test_proto_msgTypes[2] + mi := &file_api_util_proto_test_test_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -379,7 +379,7 @@ func (x *Primitives_Aux) String() string { func (*Primitives_Aux) ProtoMessage() {} func (x *Primitives_Aux) ProtoReflect() protoreflect.Message { - mi := &file_util_proto_test_test_proto_msgTypes[2] + mi := &file_api_util_proto_test_test_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -392,7 +392,7 @@ func (x *Primitives_Aux) ProtoReflect() protoreflect.Message { // Deprecated: Use Primitives_Aux.ProtoReflect.Descriptor instead. func (*Primitives_Aux) Descriptor() ([]byte, []int) { - return file_util_proto_test_test_proto_rawDescGZIP(), []int{0, 0} + return file_api_util_proto_test_test_proto_rawDescGZIP(), []int{0, 0} } func (x *Primitives_Aux) GetInnerField() uint32 { @@ -413,7 +413,7 @@ type RepPrimitives_Aux struct { func (x *RepPrimitives_Aux) Reset() { *x = RepPrimitives_Aux{} if protoimpl.UnsafeEnabled { - mi := &file_util_proto_test_test_proto_msgTypes[3] + mi := &file_api_util_proto_test_test_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -426,7 +426,7 @@ func (x *RepPrimitives_Aux) String() string { func (*RepPrimitives_Aux) ProtoMessage() {} func (x *RepPrimitives_Aux) ProtoReflect() protoreflect.Message { - mi := &file_util_proto_test_test_proto_msgTypes[3] + mi := &file_api_util_proto_test_test_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -439,7 +439,7 @@ func (x *RepPrimitives_Aux) ProtoReflect() protoreflect.Message { // Deprecated: Use RepPrimitives_Aux.ProtoReflect.Descriptor instead. func (*RepPrimitives_Aux) Descriptor() ([]byte, []int) { - return file_util_proto_test_test_proto_rawDescGZIP(), []int{1, 0} + return file_api_util_proto_test_test_proto_rawDescGZIP(), []int{1, 0} } func (x *RepPrimitives_Aux) GetInnerField() uint32 { @@ -449,90 +449,90 @@ func (x *RepPrimitives_Aux) GetInnerField() uint32 { return 0 } -var File_util_proto_test_test_proto protoreflect.FileDescriptor +var File_api_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, 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, +var file_api_util_proto_test_test_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x61, 0x70, 0x69, 0x2f, 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, 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, 0x6c, 0x64, 0x42, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x5f, 0x63, 0x18, 0xc8, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x43, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x64, 0x18, 0xc9, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x65, 0x18, 0xca, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x45, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x66, + 0x18, 0xcb, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x46, 0x12, + 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x67, 0x18, 0xcc, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x47, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x5f, 0x69, 0x18, 0xcd, 0x01, 0x20, 0x01, 0x28, 0x06, 0x52, 0x06, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x49, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6a, 0x18, 0xce, + 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4a, 0x12, 0x18, 0x0a, + 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6b, 0x18, 0xcf, 0x01, 0x20, 0x01, 0x28, 0x07, 0x52, + 0x06, 0x66, 0x69, 0x65, 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, 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, + 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, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x65, - 0x6c, 0x64, 0x42, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x63, 0x18, 0xc8, - 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x43, 0x12, 0x18, 0x0a, - 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x64, 0x18, 0xc9, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, - 0x5f, 0x65, 0x18, 0xca, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, - 0x45, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x66, 0x18, 0xcb, 0x01, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x46, 0x12, 0x18, 0x0a, 0x07, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x67, 0x18, 0xcc, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x47, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x69, - 0x18, 0xcd, 0x01, 0x20, 0x01, 0x28, 0x06, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x12, - 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6a, 0x18, 0xce, 0x01, 0x20, 0x01, 0x28, - 0x01, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4a, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, - 0x6c, 0x64, 0x5f, 0x6b, 0x18, 0xcf, 0x01, 0x20, 0x01, 0x28, 0x07, 0x52, 0x06, 0x66, 0x69, 0x65, - 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, 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, 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, - 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, 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, + 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, 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 ( - file_util_proto_test_test_proto_rawDescOnce sync.Once - file_util_proto_test_test_proto_rawDescData = file_util_proto_test_test_proto_rawDesc + file_api_util_proto_test_test_proto_rawDescOnce sync.Once + file_api_util_proto_test_test_proto_rawDescData = file_api_util_proto_test_test_proto_rawDesc ) -func file_util_proto_test_test_proto_rawDescGZIP() []byte { - file_util_proto_test_test_proto_rawDescOnce.Do(func() { - file_util_proto_test_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_util_proto_test_test_proto_rawDescData) +func file_api_util_proto_test_test_proto_rawDescGZIP() []byte { + file_api_util_proto_test_test_proto_rawDescOnce.Do(func() { + file_api_util_proto_test_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_util_proto_test_test_proto_rawDescData) }) - return file_util_proto_test_test_proto_rawDescData + return file_api_util_proto_test_test_proto_rawDescData } -var file_util_proto_test_test_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_util_proto_test_test_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_util_proto_test_test_proto_goTypes = []interface{}{ +var file_api_util_proto_test_test_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_api_util_proto_test_test_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_api_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 (*RepPrimitives_Aux)(nil), // 4: test.RepPrimitives.Aux } -var file_util_proto_test_test_proto_depIdxs = []int32{ +var file_api_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 4, // 2: test.RepPrimitives.field_aux:type_name -> test.RepPrimitives.Aux @@ -543,13 +543,13 @@ var file_util_proto_test_test_proto_depIdxs = []int32{ 0, // [0:3] is the sub-list for field type_name } -func init() { file_util_proto_test_test_proto_init() } -func file_util_proto_test_test_proto_init() { - if File_util_proto_test_test_proto != nil { +func init() { file_api_util_proto_test_test_proto_init() } +func file_api_util_proto_test_test_proto_init() { + if File_api_util_proto_test_test_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_util_proto_test_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_api_util_proto_test_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Primitives); i { case 0: return &v.state @@ -561,7 +561,7 @@ func file_util_proto_test_test_proto_init() { return nil } } - file_util_proto_test_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_api_util_proto_test_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RepPrimitives); i { case 0: return &v.state @@ -573,7 +573,7 @@ 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{} { + file_api_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 @@ -585,7 +585,7 @@ 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{} { + file_api_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 @@ -598,7 +598,7 @@ func file_util_proto_test_test_proto_init() { } } } - file_util_proto_test_test_proto_msgTypes[0].OneofWrappers = []interface{}{ + file_api_util_proto_test_test_proto_msgTypes[0].OneofWrappers = []interface{}{ (*Primitives_FieldMa)(nil), (*Primitives_FieldMe)(nil), (*Primitives_FieldAux)(nil), @@ -607,19 +607,19 @@ func file_util_proto_test_test_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_util_proto_test_test_proto_rawDesc, + RawDescriptor: file_api_util_proto_test_test_proto_rawDesc, NumEnums: 1, NumMessages: 4, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_util_proto_test_test_proto_goTypes, - DependencyIndexes: file_util_proto_test_test_proto_depIdxs, - EnumInfos: file_util_proto_test_test_proto_enumTypes, - MessageInfos: file_util_proto_test_test_proto_msgTypes, + GoTypes: file_api_util_proto_test_test_proto_goTypes, + DependencyIndexes: file_api_util_proto_test_test_proto_depIdxs, + EnumInfos: file_api_util_proto_test_test_proto_enumTypes, + MessageInfos: file_api_util_proto_test_test_proto_msgTypes, }.Build() - File_util_proto_test_test_proto = out.File - file_util_proto_test_test_proto_rawDesc = nil - file_util_proto_test_test_proto_goTypes = nil - file_util_proto_test_test_proto_depIdxs = nil + File_api_util_proto_test_test_proto = out.File + file_api_util_proto_test_test_proto_rawDesc = nil + file_api_util_proto_test_test_proto_goTypes = nil + file_api_util_proto_test_test_proto_depIdxs = nil } diff --git a/api/util/proto/test/test.proto b/api/util/proto/test/test.proto new file mode 100644 index 0000000..58cee2f --- /dev/null +++ b/api/util/proto/test/test.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; + +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; + + enum SomeEnum { + UNKNOWN = 0; + POSITIVE = 1; + 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 { + 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 uint64 field_fu = 7 [ packed = false ]; + + message Aux { uint32 inner_field = 1; } + repeated Aux field_aux = 8; +} From 42a0fc8c13aefb79bcc273be2fb2a8ae9eaf17b1 Mon Sep 17 00:00:00 2001 From: Marina Biryukova Date: Thu, 12 Dec 2024 12:00:11 +0300 Subject: [PATCH 134/197] [#305] tree/pool: Add flag to use net map to prioritize tree services New version of tree/pool selects tree service connection to make request based on the current net map and container placement policy Signed-off-by: Marina Biryukova --- go.mod | 12 +- go.sum | 39 +++++-- pkg/network/address.go | 112 ++++++++++++++++++ pkg/network/address_test.go | 83 +++++++++++++ pkg/network/tls.go | 18 +++ pkg/network/tls_test.go | 46 ++++++++ pool/tree/pool.go | 227 ++++++++++++++++++++++++++++++++---- pool/tree/pool_test.go | 225 ++++++++++++++++++++++++++++++++--- 8 files changed, 718 insertions(+), 44 deletions(-) create mode 100644 pkg/network/address.go create mode 100644 pkg/network/address_test.go create mode 100644 pkg/network/tls.go create mode 100644 pkg/network/tls_test.go diff --git a/go.mod b/go.mod index ed14604..9e459f2 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,7 @@ require ( github.com/klauspost/reedsolomon v1.12.1 github.com/mailru/easyjson v0.7.7 github.com/mr-tron/base58 v1.2.0 + github.com/multiformats/go-multiaddr v0.14.0 github.com/nspcc-dev/neo-go v0.106.2 github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.27.0 @@ -29,13 +30,20 @@ require ( github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/golang/snappy v0.0.1 // indirect github.com/gorilla/websocket v1.5.1 // indirect + github.com/ipfs/go-cid v0.0.7 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/klauspost/cpuid/v2 v2.2.6 // indirect - github.com/kr/pretty v0.1.0 // indirect + github.com/minio/sha256-simd v1.0.1 // indirect + github.com/multiformats/go-base32 v0.1.0 // indirect + github.com/multiformats/go-base36 v0.2.0 // indirect + github.com/multiformats/go-multibase v0.2.0 // indirect + github.com/multiformats/go-multihash v0.2.3 // indirect + github.com/multiformats/go-varint v0.0.7 // indirect github.com/nspcc-dev/go-ordered-json v0.0.0-20240301084351-0246b013f8b2 // indirect github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20240521091047-78685785716d // indirect github.com/nspcc-dev/rfc6979 v0.2.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954 // indirect github.com/twmb/murmur3 v1.1.8 // indirect go.etcd.io/bbolt v1.3.9 // indirect @@ -46,5 +54,5 @@ require ( 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 + lukechampine.com/blake3 v1.2.1 // indirect ) diff --git a/go.sum b/go.sum index 56930c7..9cf5673 100644 --- a/go.sum +++ b/go.sum @@ -55,24 +55,43 @@ github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyf github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ipfs/go-cid v0.0.7 h1:ysQJVJA3fNDF1qigJbsSQOdjhVLsOEoPdh0+R97k3jY= +github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= 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/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/klauspost/reedsolomon v1.12.1 h1:NhWgum1efX1x58daOBGCFWcxtEhOhXKKl1HAPQUp03Q= github.com/klauspost/reedsolomon v1.12.1/go.mod h1:nEi5Kjb6QqtbofI6s+cbG/j1da11c96IBYBSnVGtuBs= -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/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= +github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= +github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= +github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= +github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= +github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= 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/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= +github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE= +github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI= +github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= +github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0= +github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= +github.com/multiformats/go-multiaddr v0.14.0 h1:bfrHrJhrRuh/NXH5mCnemjpbGjzRw/b+tJFOD41g2tU= +github.com/multiformats/go-multiaddr v0.14.0/go.mod h1:6EkVAxtznq2yC3QT5CM1UTAwG0GTP3EWAIcjHuzQ+r4= +github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= +github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= +github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk= +github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= +github.com/multiformats/go-multihash v0.2.3 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U= +github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM= +github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= +github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= +github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= github.com/nspcc-dev/go-ordered-json v0.0.0-20240301084351-0246b013f8b2 h1:mD9hU3v+zJcnHAVmHnZKt3I++tvn30gBj2rP2PocZMk= github.com/nspcc-dev/go-ordered-json v0.0.0-20240301084351-0246b013f8b2/go.mod h1:U5VfmPNM88P4RORFb6KSUVBdJBDhlqggJZYGXGPxOcc= github.com/nspcc-dev/neo-go v0.106.2 h1:KXSJ2J5Oacc7LrX3r4jvnC8ihKqHs5NB21q4f2S3r9o= @@ -102,6 +121,8 @@ github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= +github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= @@ -121,6 +142,7 @@ go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN8 go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= @@ -175,9 +197,8 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 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 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= 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= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -188,5 +209,7 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/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= +lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI= +lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= diff --git a/pkg/network/address.go b/pkg/network/address.go new file mode 100644 index 0000000..45d5939 --- /dev/null +++ b/pkg/network/address.go @@ -0,0 +1,112 @@ +// NOTE: code is taken from https://git.frostfs.info/TrueCloudLab/frostfs-node/src/commit/df05057ed46632e7746fcaa26731987a9070b2e5/pkg/network/address.go + +package network + +import ( + "errors" + "fmt" + "net" + "net/url" + "strings" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" + "github.com/multiformats/go-multiaddr" + manet "github.com/multiformats/go-multiaddr/net" +) + +var errHostIsEmpty = errors.New("host is empty") + +// Address represents the FrostFS node +// network address. +type Address struct { + ma multiaddr.Multiaddr +} + +// URIAddr returns Address as a URI. +// +// Panics if host address cannot be fetched from Address. +// +// See also FromString. +func (a Address) URIAddr() string { + _, host, err := manet.DialArgs(a.ma) + if err != nil { + // the only correct way to construct Address is AddressFromString + // which makes this error appear unexpected + panic(fmt.Errorf("could not get host addr: %w", err)) + } + + if !a.IsTLSEnabled() { + return host + } + + return (&url.URL{ + Scheme: "grpcs", + Host: host, + }).String() +} + +// FromString restores Address from a string representation. +// +// Supports URIAddr, MultiAddr and HostAddr strings. +func (a *Address) FromString(s string) error { + var err error + + a.ma, err = multiaddr.NewMultiaddr(s) + if err != nil { + var ( + host string + hasTLS bool + ) + host, hasTLS, err = client.ParseURI(s) + if err != nil { + host = s + } + + s, err = multiaddrStringFromHostAddr(host) + if err == nil { + a.ma, err = multiaddr.NewMultiaddr(s) + if err == nil && hasTLS { + a.ma = a.ma.Encapsulate(tls) + } + } + } + + return err +} + +// multiaddrStringFromHostAddr converts "localhost:8080" to "/dns4/localhost/tcp/8080". +func multiaddrStringFromHostAddr(host string) (string, error) { + if len(host) == 0 { + return "", errHostIsEmpty + } + + endpoint, port, err := net.SplitHostPort(host) + if err != nil { + return "", err + } + + // Empty address in host `:8080` generates `/dns4//tcp/8080` multiaddr + // which is invalid. It could be `/tcp/8080` but this breaks + // `manet.DialArgs`. The solution is to manually parse it as 0.0.0.0 + if endpoint == "" { + return "/ip4/0.0.0.0/tcp/" + port, nil + } + + var ( + prefix = "/dns4" + addr = endpoint + ) + + if ip := net.ParseIP(endpoint); ip != nil { + addr = ip.String() + if ip.To4() == nil { + prefix = "/ip6" + } else { + prefix = "/ip4" + } + } + + const l4Protocol = "tcp" + + return strings.Join([]string{prefix, addr, l4Protocol, port}, "/"), nil +} diff --git a/pkg/network/address_test.go b/pkg/network/address_test.go new file mode 100644 index 0000000..c6558eb --- /dev/null +++ b/pkg/network/address_test.go @@ -0,0 +1,83 @@ +// NOTE: code is taken from https://git.frostfs.info/TrueCloudLab/frostfs-node/src/commit/df05057ed46632e7746fcaa26731987a9070b2e5/pkg/network/address_test.go + +package network + +import ( + "testing" + + "github.com/multiformats/go-multiaddr" + "github.com/stretchr/testify/require" +) + +func TestAddressFromString(t *testing.T) { + t.Run("valid addresses", func(t *testing.T) { + testcases := []struct { + inp string + exp multiaddr.Multiaddr + }{ + {":8080", buildMultiaddr("/ip4/0.0.0.0/tcp/8080", t)}, + {"example.com:7070", buildMultiaddr("/dns4/example.com/tcp/7070", t)}, + {"213.44.87.1:32512", buildMultiaddr("/ip4/213.44.87.1/tcp/32512", t)}, + {"[2004:eb1::1]:8080", buildMultiaddr("/ip6/2004:eb1::1/tcp/8080", t)}, + {"grpc://example.com:7070", buildMultiaddr("/dns4/example.com/tcp/7070", t)}, + {"grpcs://example.com:7070", buildMultiaddr("/dns4/example.com/tcp/7070/"+tlsProtocolName, t)}, + } + + var addr Address + + for _, testcase := range testcases { + err := addr.FromString(testcase.inp) + require.NoError(t, err) + require.Equal(t, testcase.exp, addr.ma, testcase.inp) + } + }) + t.Run("invalid addresses", func(t *testing.T) { + testCases := []string{ + "wtf://example.com:123", // wrong scheme + "grpc://example.com", // missing port + } + + var addr Address + for _, tc := range testCases { + require.Error(t, addr.FromString(tc)) + } + }) +} + +func TestAddress_HostAddrString(t *testing.T) { + t.Run("valid addresses", func(t *testing.T) { + testcases := []struct { + ma multiaddr.Multiaddr + exp string + }{ + {buildMultiaddr("/dns4/frostfs.bigcorp.com/tcp/8080", t), "frostfs.bigcorp.com:8080"}, + {buildMultiaddr("/ip4/172.16.14.1/tcp/8080", t), "172.16.14.1:8080"}, + {buildMultiaddr("/ip4/192.168.0.1/tcp/8888/tls", t), "grpcs://192.168.0.1:8888"}, + } + + for _, testcase := range testcases { + addr := Address{testcase.ma} + + got := addr.URIAddr() + + require.Equal(t, testcase.exp, got) + } + }) + + t.Run("invalid addresses", func(t *testing.T) { + testcases := []multiaddr.Multiaddr{ + buildMultiaddr("/tcp/8080", t), + } + + for _, testcase := range testcases { + addr := Address{testcase} + require.Panics(t, func() { addr.URIAddr() }) + } + }) +} + +func buildMultiaddr(s string, t *testing.T) multiaddr.Multiaddr { + ma, err := multiaddr.NewMultiaddr(s) + require.NoError(t, err) + return ma +} diff --git a/pkg/network/tls.go b/pkg/network/tls.go new file mode 100644 index 0000000..b3e9663 --- /dev/null +++ b/pkg/network/tls.go @@ -0,0 +1,18 @@ +// NOTE: code is taken from https://git.frostfs.info/TrueCloudLab/frostfs-node/src/commit/df05057ed46632e7746fcaa26731987a9070b2e5/pkg/network/tls.go + +package network + +import "github.com/multiformats/go-multiaddr" + +const ( + tlsProtocolName = "tls" +) + +// tls var is used for (un)wrapping other multiaddrs around TLS multiaddr. +var tls, _ = multiaddr.NewMultiaddr("/" + tlsProtocolName) + +// IsTLSEnabled searches for wrapped TLS protocol in multiaddr. +func (a Address) IsTLSEnabled() bool { + _, err := a.ma.ValueForProtocol(multiaddr.P_TLS) + return err == nil +} diff --git a/pkg/network/tls_test.go b/pkg/network/tls_test.go new file mode 100644 index 0000000..bfa18b8 --- /dev/null +++ b/pkg/network/tls_test.go @@ -0,0 +1,46 @@ +// NOTE: code is taken from https://git.frostfs.info/TrueCloudLab/frostfs-node/src/commit/df05057ed46632e7746fcaa26731987a9070b2e5/pkg/network/tls_test.go + +package network + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestAddress_TLSEnabled(t *testing.T) { + testCases := [...]struct { + input string + wantTLS bool + }{ + {"/dns4/localhost/tcp/8080", false}, + {"/dns4/localhost/tcp/8080/tls", true}, + {"/tls/dns4/localhost/tcp/8080", true}, + {"grpc://localhost:8080", false}, + {"grpcs://localhost:8080", true}, + } + + var addr Address + + for _, test := range testCases { + err := addr.FromString(test.input) + require.NoError(t, err) + + require.Equal(t, test.wantTLS, addr.IsTLSEnabled(), test.input) + } +} + +func BenchmarkAddressTLSEnabled(b *testing.B) { + var addr Address + err := addr.FromString("/dns4/localhost/tcp/8080/tls") + require.NoError(b, err) + + b.ResetTimer() + b.ReportAllocs() + + var enabled bool + for range b.N { + enabled = addr.IsTLSEnabled() + } + require.True(b, enabled) +} diff --git a/pool/tree/pool.go b/pool/tree/pool.go index f4f9bf8..ddfdc0e 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -14,6 +14,8 @@ import ( rpcclient "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/tree" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pkg/network" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "go.uber.org/zap" @@ -73,6 +75,12 @@ type InitParameters struct { nodeParams []pool.NodeParam dialOptions []grpc.DialOption maxRequestAttempts int + netMapInfoSource NetMapInfoSource +} + +type NetMapInfoSource interface { + NetMapSnapshot(ctx context.Context) (netmap.NetMap, error) + PlacementPolicy(ctx context.Context, cnrID cid.ID) (netmap.PlacementPolicy, error) } // Pool represents virtual connection to the FrostFS tree services network to communicate @@ -80,7 +88,7 @@ type InitParameters struct { // due to their unavailability. // // Pool can be created and initialized using NewPool function. -// Before executing the FrostFS tree operations using the Pool, connection to the +// Before executing the FrostFS tree operations using the Pool without netMapInfoSource, connection to the // servers MUST BE correctly established (see Dial method). type Pool struct { innerPools []*innerPool @@ -96,12 +104,18 @@ type Pool struct { streamTimeout time.Duration nodeDialTimeout time.Duration - startIndicesMtx sync.RWMutex + netMapInfoSource NetMapInfoSource + + // mutex protects clientMap and startIndices + mutex sync.RWMutex + // clientMap will be used if netMapInfoSource is set + clientMap map[uint64]client // startIndices points to the client from which the next request will be executed. // Since clients are stored in innerPool field we have to use two indices. // These indices being changed during: // * rebalance procedure (see Pool.startRebalance) // * retry in case of request failure (see Pool.requestWithRetry) + // startIndices will be used if netMapInfoSource is not set startIndices [2]int } @@ -213,11 +227,6 @@ func NewPool(options InitParameters) (*Pool, error) { return nil, fmt.Errorf("missed required parameter 'Key'") } - nodesParams, err := adjustNodeParams(options.nodeParams) - if err != nil { - return nil, err - } - fillDefaultInitParams(&options) methods := make([]*pool.MethodStatus, methodLast) @@ -230,27 +239,44 @@ func NewPool(options InitParameters) (*Pool, error) { logger: options.logger, dialOptions: options.dialOptions, rebalanceParams: rebalanceParameters{ - nodesGroup: nodesParams, nodeRequestTimeout: options.healthcheckTimeout, clientRebalanceInterval: options.clientRebalanceInterval, }, maxRequestAttempts: options.maxRequestAttempts, streamTimeout: options.nodeStreamTimeout, + nodeDialTimeout: options.nodeDialTimeout, methods: methods, + netMapInfoSource: options.netMapInfoSource, + clientMap: make(map[uint64]client), + } + + if options.netMapInfoSource == nil { + nodesParams, err := adjustNodeParams(options.nodeParams) + if err != nil { + return nil, err + } + p.rebalanceParams.nodesGroup = nodesParams } return p, nil } -// Dial establishes a connection to the tree servers from the FrostFS network. +// Dial may not be called and will have no effect if netMapInfoSource is set. +// See also InitParameters.SetNetMapInfoSource +// +// Otherwise, Dial establishes a connection to the tree servers from the FrostFS network. // It also starts a routine that checks the health of the nodes and // updates the weights of the nodes for balancing. // Returns an error describing failure reason. // -// If failed, the Pool SHOULD NOT be used. +// If failed and netMapInfoSource is not set, the Pool SHOULD NOT be used. // // See also InitParameters.SetClientRebalanceInterval. func (p *Pool) Dial(ctx context.Context) error { + if p.netMapInfoSource != nil { + return nil + } + inner := make([]*innerPool, len(p.rebalanceParams.nodesGroup)) var atLeastOneHealthy bool @@ -334,6 +360,12 @@ func (x *InitParameters) SetMaxRequestAttempts(maxAttempts int) { x.maxRequestAttempts = maxAttempts } +// SetNetMapInfoSource sets implementation of interface to get current net map and container placement policy. +// If set, AddNode will have no effect. +func (x *InitParameters) SetNetMapInfoSource(netMapInfoSource NetMapInfoSource) { + x.netMapInfoSource = netMapInfoSource +} + // GetNodes invokes eponymous method from TreeServiceClient. // // Can return predefined errors: @@ -359,7 +391,7 @@ func (p *Pool) GetNodes(ctx context.Context, prm GetNodesParams) ([]*tree.GetNod } var resp *tree.GetNodeByPathResponse - err := p.requestWithRetry(ctx, func(client *rpcclient.Client) (inErr error) { + err := p.requestWithRetry(ctx, prm.CID, func(client *rpcclient.Client) (inErr error) { resp, inErr = rpcapi.GetNodeByPath(client, request, rpcclient.WithContext(ctx)) // Pool wants to do retry 'GetNodeByPath' request if result is empty. // Empty result is expected due to delayed tree service sync. @@ -463,7 +495,7 @@ func (p *Pool) GetSubTree(ctx context.Context, prm GetSubTreeParams) (*SubTreeRe } var cli *rpcapi.GetSubTreeResponseReader - err := p.requestWithRetry(ctx, func(client *rpcclient.Client) (inErr error) { + err := p.requestWithRetry(ctx, prm.CID, func(client *rpcclient.Client) (inErr error) { cli, inErr = rpcapi.GetSubTree(client, request, rpcclient.WithContext(ctx)) return handleError("failed to get sub tree client", inErr) }) @@ -497,7 +529,7 @@ func (p *Pool) AddNode(ctx context.Context, prm AddNodeParams) (uint64, error) { } var resp *tree.AddResponse - err := p.requestWithRetry(ctx, func(client *rpcclient.Client) (inErr error) { + err := p.requestWithRetry(ctx, prm.CID, func(client *rpcclient.Client) (inErr error) { resp, inErr = rpcapi.Add(client, request, rpcclient.WithContext(ctx)) return handleError("failed to add node", inErr) }) @@ -532,7 +564,7 @@ func (p *Pool) AddNodeByPath(ctx context.Context, prm AddNodeByPathParams) (uint } var resp *tree.AddByPathResponse - err := p.requestWithRetry(ctx, func(client *rpcclient.Client) (inErr error) { + err := p.requestWithRetry(ctx, prm.CID, func(client *rpcclient.Client) (inErr error) { resp, inErr = rpcapi.AddByPath(client, request, rpcclient.WithContext(ctx)) return handleError("failed to add node by path", inErr) }) @@ -574,7 +606,7 @@ func (p *Pool) MoveNode(ctx context.Context, prm MoveNodeParams) error { return err } - err := p.requestWithRetry(ctx, func(client *rpcclient.Client) error { + err := p.requestWithRetry(ctx, prm.CID, func(client *rpcclient.Client) error { if _, err := rpcapi.Move(client, request, rpcclient.WithContext(ctx)); err != nil { return handleError("failed to move node", err) } @@ -605,7 +637,7 @@ func (p *Pool) RemoveNode(ctx context.Context, prm RemoveNodeParams) error { return err } - err := p.requestWithRetry(ctx, func(client *rpcclient.Client) error { + err := p.requestWithRetry(ctx, prm.CID, func(client *rpcclient.Client) error { if _, err := rpcapi.Remove(client, request, rpcclient.WithContext(ctx)); err != nil { return handleError("failed to remove node", err) } @@ -631,6 +663,24 @@ func (p *Pool) Close() error { } } + if closeErr := p.closeClientMapConnections(); closeErr != nil { + err = closeErr + } + + return err +} + +func (p *Pool) closeClientMapConnections() (err error) { + p.mutex.Lock() + defer p.mutex.Unlock() + + for _, cl := range p.clientMap { + if closeErr := cl.close(); closeErr != nil { + p.log(zapcore.ErrorLevel, "close client connection", zap.Error(closeErr)) + err = closeErr + } + } + return err } @@ -801,20 +851,24 @@ func (p *Pool) updateInnerNodesHealth(ctx context.Context, i int, buffer []bool) } func (p *Pool) getStartIndices() (int, int) { - p.startIndicesMtx.RLock() - defer p.startIndicesMtx.RUnlock() + p.mutex.RLock() + defer p.mutex.RUnlock() return p.startIndices[0], p.startIndices[1] } func (p *Pool) setStartIndices(i, j int) { - p.startIndicesMtx.Lock() + p.mutex.Lock() p.startIndices[0] = i p.startIndices[1] = j - p.startIndicesMtx.Unlock() + p.mutex.Unlock() } -func (p *Pool) requestWithRetry(ctx context.Context, fn func(client *rpcclient.Client) error) error { +func (p *Pool) requestWithRetry(ctx context.Context, cnrID cid.ID, fn func(client *rpcclient.Client) error) error { + if p.netMapInfoSource != nil { + return p.requestWithRetryContainerNodes(ctx, cnrID, fn) + } + var ( err, finErr error cl *rpcclient.Client @@ -866,10 +920,141 @@ LOOP: return finErr } +func (p *Pool) requestWithRetryContainerNodes(ctx context.Context, cnrID cid.ID, fn func(client *rpcclient.Client) error) error { + var ( + err, finErr error + cl *rpcclient.Client + ) + + reqID := GetRequestID(ctx) + + netMap, err := p.netMapInfoSource.NetMapSnapshot(ctx) + if err != nil { + return fmt.Errorf("get net map: %w", err) + } + + policy, err := p.netMapInfoSource.PlacementPolicy(ctx, cnrID) + if err != nil { + return fmt.Errorf("get container placement policy: %w", err) + } + + cnrNodes, err := netMap.ContainerNodes(policy, cnrID[:]) + if err != nil { + return fmt.Errorf("get container nodes: %w", err) + } + + cnrNodes, err = netMap.PlacementVectors(cnrNodes, cnrID[:]) + if err != nil { + return fmt.Errorf("get placement vectors: %w", err) + } + + attempts := p.maxRequestAttempts + +LOOP: + for _, cnrNodeGroup := range cnrNodes { + for _, cnrNode := range cnrNodeGroup { + if attempts == 0 { + break LOOP + } + + treeCl, ok := p.getClientFromMap(cnrNode.Hash()) + if !ok { + treeCl, err = p.getNewTreeClient(ctx, cnrNode) + if err != nil { + finErr = finalError(finErr, err) + p.log(zap.DebugLevel, "failed to create tree client", zap.String("request_id", reqID), zap.Int("remaining attempts", attempts)) + continue + } + + p.addClientToMap(cnrNode.Hash(), treeCl) + } + attempts-- + + if cl, err = treeCl.serviceClient(); err == nil { + err = fn(cl) + } + if shouldRedial(ctx, err) { + p.deleteClientFromMap(cnrNode.Hash()) + } + if !shouldTryAgain(err) { + if err != nil { + err = fmt.Errorf("address %s: %w", treeCl.endpoint(), err) + } + + return err + } + + finErr = finalError(finErr, err) + p.log(zap.DebugLevel, "tree request error", zap.String("request_id", reqID), zap.Int("remaining attempts", attempts), + zap.String("address", treeCl.endpoint()), zap.Error(err)) + } + } + + return finErr +} + +func (p *Pool) getClientFromMap(hash uint64) (client, bool) { + p.mutex.RLock() + defer p.mutex.RUnlock() + + cl, ok := p.clientMap[hash] + return cl, ok +} + +func (p *Pool) addClientToMap(hash uint64, cl client) { + p.mutex.Lock() + p.clientMap[hash] = cl + p.mutex.Unlock() +} + +func (p *Pool) deleteClientFromMap(hash uint64) { + p.mutex.Lock() + _ = p.clientMap[hash].close() + delete(p.clientMap, hash) + p.mutex.Unlock() +} + +func (p *Pool) getNewTreeClient(ctx context.Context, node netmap.NodeInfo) (*treeClient, error) { + var ( + treeCl *treeClient + err error + ) + + node.IterateNetworkEndpoints(func(endpoint string) bool { + var addr network.Address + if err = addr.FromString(endpoint); err != nil { + p.log(zap.WarnLevel, "can't parse endpoint", zap.String("endpoint", endpoint), zap.Error(err)) + return false + } + + newTreeCl := newTreeClient(addr.URIAddr(), p.dialOptions, p.nodeDialTimeout, p.streamTimeout) + if err = newTreeCl.dial(ctx); err != nil { + p.log(zap.WarnLevel, "failed to dial tree client", zap.String("address", addr.URIAddr()), zap.Error(err)) + return false + } + + treeCl = newTreeCl + return true + }) + + if treeCl == nil { + return nil, fmt.Errorf("tree client wasn't initialized") + } + + return treeCl, nil +} + func shouldTryAgain(err error) bool { return !(err == nil || errors.Is(err, ErrNodeAccessDenied)) } +func shouldRedial(ctx context.Context, err error) bool { + if err == nil || errors.Is(err, ErrNodeAccessDenied) || errors.Is(err, ErrNodeNotFound) || errors.Is(err, errNodeEmptyResult) || errors.Is(ctx.Err(), context.Canceled) { + return false + } + return true +} + func prioErr(err error) int { switch { case err == nil: diff --git a/pool/tree/pool_test.go b/pool/tree/pool_test.go index f9f4142..607e037 100644 --- a/pool/tree/pool_test.go +++ b/pool/tree/pool_test.go @@ -7,7 +7,12 @@ import ( rpcClient "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" + cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" + cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool" + "git.frostfs.info/TrueCloudLab/hrw" + "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "github.com/stretchr/testify/require" "go.uber.org/zap/zaptest" ) @@ -15,12 +20,14 @@ import ( type treeClientMock struct { address string err bool + used bool } func (t *treeClientMock) serviceClient() (*rpcClient.Client, error) { if t.err { return nil, errors.New("serviceClient() mock error") } + t.used = true return nil, nil } @@ -51,6 +58,23 @@ func (t *treeClientMock) close() error { return nil } +type netMapInfoMock struct { + netMap netmap.NetMap + policy netmap.PlacementPolicy + err error +} + +func (n *netMapInfoMock) NetMapSnapshot(context.Context) (netmap.NetMap, error) { + if n.err != nil { + return netmap.NetMap{}, n.err + } + return n.netMap, nil +} + +func (n *netMapInfoMock) PlacementPolicy(context.Context, cid.ID) (netmap.PlacementPolicy, error) { + return n.policy, nil +} + func TestHandleError(t *testing.T) { defaultError := errors.New("default error") for _, tc := range []struct { @@ -104,14 +128,14 @@ func TestRetry(t *testing.T) { } t.Run("first ok", func(t *testing.T) { - err := p.requestWithRetry(ctx, makeFn) + err := p.requestWithRetry(ctx, cidtest.ID(), makeFn) require.NoError(t, err) checkIndicesAndReset(t, p, 0, 0) }) t.Run("first failed", func(t *testing.T) { setErrors(p, "node00") - err := p.requestWithRetry(ctx, makeFn) + err := p.requestWithRetry(ctx, cidtest.ID(), makeFn) require.NoError(t, err) checkIndicesAndReset(t, p, 0, 1) }) @@ -119,7 +143,7 @@ func TestRetry(t *testing.T) { t.Run("all failed", func(t *testing.T) { setErrors(p, nodes[0]...) setErrors(p, nodes[1]...) - err := p.requestWithRetry(ctx, makeFn) + err := p.requestWithRetry(ctx, cidtest.ID(), makeFn) require.Error(t, err) checkIndicesAndReset(t, p, 0, 0) }) @@ -127,13 +151,13 @@ func TestRetry(t *testing.T) { t.Run("round", func(t *testing.T) { setErrors(p, nodes[0][0], nodes[0][1]) setErrors(p, nodes[1]...) - err := p.requestWithRetry(ctx, makeFn) + err := p.requestWithRetry(ctx, cidtest.ID(), makeFn) require.NoError(t, err) checkIndices(t, p, 0, 2) resetClientsErrors(p) setErrors(p, nodes[0][2], nodes[0][3]) - err = p.requestWithRetry(ctx, makeFn) + err = p.requestWithRetry(ctx, cidtest.ID(), makeFn) require.NoError(t, err) checkIndicesAndReset(t, p, 0, 0) }) @@ -141,14 +165,14 @@ func TestRetry(t *testing.T) { t.Run("group switch", func(t *testing.T) { setErrors(p, nodes[0]...) setErrors(p, nodes[1][0]) - err := p.requestWithRetry(ctx, makeFn) + err := p.requestWithRetry(ctx, cidtest.ID(), makeFn) require.NoError(t, err) checkIndicesAndReset(t, p, 1, 1) }) t.Run("group round", func(t *testing.T) { setErrors(p, nodes[0][1:]...) - err := p.requestWithRetry(ctx, makeFn) + err := p.requestWithRetry(ctx, cidtest.ID(), makeFn) require.NoError(t, err) checkIndicesAndReset(t, p, 0, 0) }) @@ -156,7 +180,7 @@ func TestRetry(t *testing.T) { t.Run("group round switch", func(t *testing.T) { setErrors(p, nodes[0]...) p.setStartIndices(0, 1) - err := p.requestWithRetry(ctx, makeFn) + err := p.requestWithRetry(ctx, cidtest.ID(), makeFn) require.NoError(t, err) checkIndicesAndReset(t, p, 1, 0) }) @@ -164,14 +188,14 @@ func TestRetry(t *testing.T) { t.Run("no panic group switch", func(t *testing.T) { setErrors(p, nodes[1]...) p.setStartIndices(1, 0) - err := p.requestWithRetry(ctx, makeFn) + err := p.requestWithRetry(ctx, cidtest.ID(), makeFn) require.NoError(t, err) checkIndicesAndReset(t, p, 0, 0) }) t.Run("error empty result", func(t *testing.T) { errNodes, index := 2, 0 - err := p.requestWithRetry(ctx, func(client *rpcClient.Client) error { + err := p.requestWithRetry(ctx, cidtest.ID(), func(client *rpcClient.Client) error { if index < errNodes { index++ return errNodeEmptyResult @@ -184,7 +208,7 @@ func TestRetry(t *testing.T) { t.Run("error not found", func(t *testing.T) { errNodes, index := 2, 0 - err := p.requestWithRetry(ctx, func(client *rpcClient.Client) error { + err := p.requestWithRetry(ctx, cidtest.ID(), func(client *rpcClient.Client) error { if index < errNodes { index++ return ErrNodeNotFound @@ -197,7 +221,7 @@ func TestRetry(t *testing.T) { t.Run("error access denied", func(t *testing.T) { var index int - err := p.requestWithRetry(ctx, func(client *rpcClient.Client) error { + err := p.requestWithRetry(ctx, cidtest.ID(), func(client *rpcClient.Client) error { index++ return ErrNodeAccessDenied }) @@ -211,7 +235,7 @@ func TestRetry(t *testing.T) { p.maxRequestAttempts = 2 setErrors(p, nodes[0]...) setErrors(p, nodes[1]...) - err := p.requestWithRetry(ctx, makeFn) + err := p.requestWithRetry(ctx, cidtest.ID(), makeFn) require.Error(t, err) checkIndicesAndReset(t, p, 0, 2) p.maxRequestAttempts = oldVal @@ -273,6 +297,125 @@ func TestRebalance(t *testing.T) { }) } +func TestRetryContainerNodes(t *testing.T) { + ctx := context.Background() + nodesCount := 3 + policy := getPlacementPolicy(uint32(nodesCount)) + p := &Pool{ + logger: zaptest.NewLogger(t), + maxRequestAttempts: nodesCount, + } + + var nm netmap.NetMap + for i := 0; i < nodesCount; i++ { + key, err := keys.NewPrivateKey() + require.NoError(t, err) + nm.SetNodes(append(nm.Nodes(), getNodeInfo(key.Bytes()))) + } + p.netMapInfoSource = &netMapInfoMock{netMap: nm, policy: policy} + + cnrID := cidtest.ID() + cnrNodes, err := nm.ContainerNodes(policy, cnrID[:]) + require.NoError(t, err) + cnrNodes, err = nm.PlacementVectors(cnrNodes, cnrID[:]) + require.NoError(t, err) + require.Len(t, cnrNodes, 1) + require.Len(t, cnrNodes[0], nodesCount) + + makeFn := func(client *rpcClient.Client) error { + return nil + } + + t.Run("first ok", func(t *testing.T) { + p.clientMap = makeClientMap(cnrNodes[0]) + err = p.requestWithRetry(ctx, cnrID, makeFn) + require.NoError(t, err) + checkClientsUsage(t, p, cnrNodes[0][0]) + checkClientsPresence(t, p, cnrNodes[0]...) + }) + + t.Run("first failed", func(t *testing.T) { + p.clientMap = makeClientMap(cnrNodes[0]) + setClientMapErrors(p, cnrNodes[0][0]) + err = p.requestWithRetry(ctx, cnrID, makeFn) + require.NoError(t, err) + checkClientsUsage(t, p, cnrNodes[0][1]) + checkClientsPresence(t, p, cnrNodes[0][1:]...) + }) + + t.Run("first two failed", func(t *testing.T) { + p.clientMap = makeClientMap(cnrNodes[0]) + setClientMapErrors(p, cnrNodes[0][0], cnrNodes[0][1]) + err = p.requestWithRetry(ctx, cnrID, makeFn) + require.NoError(t, err) + checkClientsUsage(t, p, cnrNodes[0][2]) + checkClientsPresence(t, p, cnrNodes[0][2]) + }) + + t.Run("all failed", func(t *testing.T) { + p.clientMap = makeClientMap(cnrNodes[0]) + setClientMapErrors(p, cnrNodes[0][0], cnrNodes[0][1], cnrNodes[0][2]) + err = p.requestWithRetry(ctx, cnrID, makeFn) + require.Error(t, err) + checkClientsUsage(t, p) + checkClientsPresence(t, p) + }) + + t.Run("error empty result", func(t *testing.T) { + p.clientMap = makeClientMap(cnrNodes[0]) + errNodes, index := 2, 0 + err = p.requestWithRetry(ctx, cnrID, func(client *rpcClient.Client) error { + if index < errNodes { + index++ + return errNodeEmptyResult + } + return nil + }) + require.NoError(t, err) + checkClientsUsage(t, p, cnrNodes[0][:errNodes+1]...) + checkClientsPresence(t, p, cnrNodes[0]...) + }) + + t.Run("error not found", func(t *testing.T) { + p.clientMap = makeClientMap(cnrNodes[0]) + errNodes, index := 2, 0 + err = p.requestWithRetry(ctx, cnrID, func(client *rpcClient.Client) error { + if index < errNodes { + index++ + return ErrNodeNotFound + } + return nil + }) + require.NoError(t, err) + checkClientsUsage(t, p, cnrNodes[0][:errNodes+1]...) + checkClientsPresence(t, p, cnrNodes[0]...) + }) + + t.Run("error access denied", func(t *testing.T) { + p.clientMap = makeClientMap(cnrNodes[0]) + var index int + err = p.requestWithRetry(ctx, cnrID, func(client *rpcClient.Client) error { + index++ + return ErrNodeAccessDenied + }) + require.ErrorIs(t, err, ErrNodeAccessDenied) + require.Equal(t, 1, index) + checkClientsUsage(t, p, cnrNodes[0][0]) + checkClientsPresence(t, p, cnrNodes[0]...) + }) + + t.Run("limit attempts", func(t *testing.T) { + p.clientMap = makeClientMap(cnrNodes[0]) + p.maxRequestAttempts = 2 + setClientMapErrors(p, cnrNodes[0][0], cnrNodes[0][1]) + err = p.requestWithRetry(ctx, cnrID, makeFn) + require.Error(t, err) + checkClientsUsage(t, p) + checkClientsPresence(t, p, cnrNodes[0][2]) + p.maxRequestAttempts = nodesCount + }) +} + func makeInnerPool(nodes [][]string) []*innerPool { res := make([]*innerPool, len(nodes)) @@ -359,3 +502,59 @@ func containsStr(list []string, item string) bool { return false } + +func makeClientMap(nodes []netmap.NodeInfo) map[uint64]client { + res := make(map[uint64]client, len(nodes)) + for _, node := range nodes { + res[hrw.Hash(node.PublicKey())] = &treeClientMock{} + } + return res +} + +func checkClientsPresence(t *testing.T, p *Pool, nodes ...netmap.NodeInfo) { + require.Len(t, p.clientMap, len(nodes)) + for _, node := range nodes { + require.NotNil(t, p.clientMap[hrw.Hash(node.PublicKey())]) + } +} + +func checkClientsUsage(t *testing.T, p *Pool, nodes ...netmap.NodeInfo) { + for hash, cl := range p.clientMap { + if containsHash(nodes, hash) { + require.True(t, cl.(*treeClientMock).used) + } else { + require.False(t, cl.(*treeClientMock).used) + } + } +} + +func setClientMapErrors(p *Pool, nodes ...netmap.NodeInfo) { + for hash, cl := range p.clientMap { + if containsHash(nodes, hash) { + cl.(*treeClientMock).err = true + } + } +} + +func containsHash(list []netmap.NodeInfo, hash uint64) bool { + for i := range list { + if hrw.Hash(list[i].PublicKey()) == hash { + return true + } + } + + return false +} + +func getPlacementPolicy(replicas uint32) (p netmap.PlacementPolicy) { + var r netmap.ReplicaDescriptor + r.SetNumberOfObjects(replicas) + p.AddReplicas([]netmap.ReplicaDescriptor{r}...) + return p +} + +func getNodeInfo(key []byte) netmap.NodeInfo { + var node netmap.NodeInfo + node.SetPublicKey(key) + return node +} From bab4d5a692935543fa9ce9a7666c8e3e8e3a3ecb Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 26 Dec 2024 10:05:58 +0300 Subject: [PATCH 135/197] [#317] go.mod: Update protobuf version Signed-off-by: Evgenii Stratonikov --- Makefile | 2 +- go.mod | 18 +++++++++------- go.sum | 64 +++++++++++++++++++++++++++++++++++++++----------------- 3 files changed, 56 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index a3552b3..1830380 100755 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ TRUECLOUDLAB_LINT_VERSION ?= 0.0.7 OUTPUT_LINT_DIR ?= $(shell pwd)/bin LINT_DIR = $(OUTPUT_LINT_DIR)/golangci-lint-$(LINT_VERSION)-v$(TRUECLOUDLAB_LINT_VERSION) -PROTOC_VERSION ?= 27.2 +PROTOC_VERSION ?= 29.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) diff --git a/go.mod b/go.mod index 9e459f2..1cca977 100644 --- a/go.mod +++ b/go.mod @@ -18,9 +18,9 @@ require ( github.com/nspcc-dev/neo-go v0.106.2 github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.27.0 - golang.org/x/sync v0.7.0 - google.golang.org/grpc v1.66.2 - google.golang.org/protobuf v1.34.1 + golang.org/x/sync v0.10.0 + google.golang.org/grpc v1.69.2 + google.golang.org/protobuf v1.36.1 gopkg.in/yaml.v3 v3.0.1 ) @@ -33,6 +33,7 @@ require ( github.com/ipfs/go-cid v0.0.7 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/klauspost/cpuid/v2 v2.2.6 // indirect + github.com/kr/pretty v0.3.1 // indirect github.com/minio/sha256-simd v1.0.1 // indirect github.com/multiformats/go-base32 v0.1.0 // indirect github.com/multiformats/go-base36 v0.2.0 // indirect @@ -48,11 +49,12 @@ require ( github.com/twmb/murmur3 v1.1.8 // indirect go.etcd.io/bbolt v1.3.9 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.24.0 // indirect + golang.org/x/crypto v0.31.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // 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 + golang.org/x/net v0.30.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect + gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect lukechampine.com/blake3 v1.2.1 // indirect ) diff --git a/go.sum b/go.sum index 9cf5673..0d898c1 100644 --- a/go.sum +++ b/go.sum @@ -24,6 +24,7 @@ github.com/consensys/gnark-crypto v0.12.2-0.20231013160410-1f65e75b6dfb h1:f0BMg github.com/consensys/gnark-crypto v0.12.2-0.20231013160410-1f65e75b6dfb/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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= @@ -32,6 +33,10 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +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/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 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= @@ -39,6 +44,8 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU 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.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -63,6 +70,10 @@ github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/4 github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/klauspost/reedsolomon v1.12.1 h1:NhWgum1efX1x58daOBGCFWcxtEhOhXKKl1HAPQUp03Q= github.com/klauspost/reedsolomon v1.12.1/go.mod h1:nEi5Kjb6QqtbofI6s+cbG/j1da11c96IBYBSnVGtuBs= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= @@ -109,6 +120,7 @@ github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9k github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= 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_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= @@ -119,6 +131,9 @@ github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSz github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= @@ -135,6 +150,16 @@ github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU= github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -144,8 +169,8 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= @@ -154,11 +179,11 @@ golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -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/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/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= @@ -170,35 +195,36 @@ golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -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/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.3.0/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.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= 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/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/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= +google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= 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.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -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 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= +google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= 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= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= From 328d214d2d76f42f42d95c040fe60ae6ebaaac1f Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 26 Dec 2024 10:03:55 +0300 Subject: [PATCH 136/197] [#317] api: Revert easyproto marshaler usage It has caused a noticeable degradation in node. Signed-off-by: Evgenii Stratonikov --- Makefile | 9 +- api/accounting/grpc/service.pb.go | 559 + api/accounting/grpc/service_frostfs.pb.go | 768 -- api/accounting/grpc/service_frostfs_fuzz.go | 45 - api/accounting/grpc/service_frostfs_test.go | 31 - api/accounting/grpc/service_grpc.pb.go | 42 +- api/accounting/grpc/service_protoopaque.pb.go | 544 + api/accounting/grpc/types.pb.go | 186 + api/accounting/grpc/types_frostfs.pb.go | 204 - api/accounting/grpc/types_frostfs_fuzz.go | 26 - api/accounting/grpc/types_frostfs_test.go | 21 - api/accounting/grpc/types_protoopaque.pb.go | 195 + api/acl/convert.go | 36 +- api/acl/grpc/types.pb.go | 1534 +++ api/acl/grpc/types_frostfs.pb.go | 2184 ---- api/acl/grpc/types_frostfs_fuzz.go | 64 - api/acl/grpc/types_frostfs_test.go | 41 - api/acl/grpc/types_protoopaque.pb.go | 1589 +++ api/acl/string.go | 32 +- api/ape/convert.go | 7 +- api/ape/grpc/types.pb.go | 376 + api/ape/grpc/types_frostfs.pb.go | 430 - api/ape/grpc/types_frostfs_fuzz.go | 45 - api/ape/grpc/types_frostfs_test.go | 31 - api/ape/grpc/types_protoopaque.pb.go | 383 + api/apemanager/convert.go | 6 +- api/apemanager/grpc/service.pb.go | 1487 +++ api/apemanager/grpc/service_frostfs.pb.go | 2337 ---- api/apemanager/grpc/service_frostfs_fuzz.go | 121 - api/apemanager/grpc/service_frostfs_test.go | 71 - api/apemanager/grpc/service_grpc.pb.go | 42 +- api/apemanager/grpc/service_protoopaque.pb.go | 1458 +++ api/container/convert.go | 10 +- api/container/grpc/service.pb.go | 2487 +++++ api/container/grpc/service_frostfs.pb.go | 3926 ------- api/container/grpc/service_frostfs_fuzz.go | 197 - api/container/grpc/service_frostfs_test.go | 111 - api/container/grpc/service_grpc.pb.go | 96 +- api/container/grpc/service_protoopaque.pb.go | 2417 +++++ api/container/grpc/types.pb.go | 447 + api/container/grpc/types_frostfs.pb.go | 554 - api/container/grpc/types_frostfs_fuzz.go | 26 - api/container/grpc/types_frostfs_test.go | 21 - api/container/grpc/types_protoopaque.pb.go | 469 + api/lock/grpc/types.pb.go | 148 + api/lock/grpc/types_frostfs.pb.go | 171 - api/lock/grpc/types_frostfs_fuzz.go | 26 - api/lock/grpc/types_frostfs_test.go | 21 - api/lock/grpc/types_protoopaque.pb.go | 148 + api/netmap/convert.go | 58 +- api/netmap/grpc/service.pb.go | 1417 +++ api/netmap/grpc/service_frostfs.pb.go | 2180 ---- api/netmap/grpc/service_frostfs_fuzz.go | 121 - api/netmap/grpc/service_frostfs_test.go | 71 - api/netmap/grpc/service_grpc.pb.go | 46 +- api/netmap/grpc/service_protoopaque.pb.go | 1377 +++ api/netmap/grpc/types.pb.go | 1857 ++++ api/netmap/grpc/types_frostfs.pb.go | 2749 ----- api/netmap/grpc/types_frostfs_fuzz.go | 159 - api/netmap/grpc/types_frostfs_test.go | 91 - api/netmap/grpc/types_protoopaque.pb.go | 2001 ++++ api/netmap/string.go | 18 +- api/object/convert.go | 81 +- api/object/grpc/service.pb.go | 6239 +++++++++++ api/object/grpc/service_frostfs.pb.go | 9389 ----------------- api/object/grpc/service_frostfs_fuzz.go | 387 - api/object/grpc/service_frostfs_test.go | 211 - api/object/grpc/service_grpc.pb.go | 314 +- api/object/grpc/service_protoopaque.pb.go | 6116 +++++++++++ api/object/grpc/types.pb.go | 2093 ++++ api/object/grpc/types_frostfs.pb.go | 2992 ------ api/object/grpc/types_frostfs_fuzz.go | 102 - api/object/grpc/types_frostfs_test.go | 61 - api/object/grpc/types_protoopaque.pb.go | 2156 ++++ api/object/lock.go | 8 +- api/object/string.go | 12 +- api/refs/convert.go | 20 +- api/refs/grpc/types.pb.go | 1043 ++ api/refs/grpc/types_frostfs.pb.go | 1527 --- api/refs/grpc/types_frostfs_fuzz.go | 159 - api/refs/grpc/types_frostfs_test.go | 91 - api/refs/grpc/types_protoopaque.pb.go | 1107 ++ api/refs/string.go | 12 +- api/rpc/message/encoding.go | 20 +- api/rpc/message/test/message.go | 1 + api/session/convert.go | 10 +- api/session/grpc/service.pb.go | 606 ++ api/session/grpc/service_frostfs.pb.go | 866 -- api/session/grpc/service_frostfs_fuzz.go | 45 - api/session/grpc/service_frostfs_test.go | 31 - api/session/grpc/service_grpc.pb.go | 40 +- api/session/grpc/service_protoopaque.pb.go | 609 ++ api/session/grpc/types.pb.go | 2145 ++++ api/session/grpc/types_frostfs.pb.go | 3049 ------ api/session/grpc/types_frostfs_fuzz.go | 159 - api/session/grpc/types_frostfs_test.go | 91 - api/session/grpc/types_protoopaque.pb.go | 2187 ++++ api/session/string.go | 12 +- api/status/convert.go | 8 +- api/status/grpc/types.pb.go | 742 ++ api/status/grpc/types_frostfs.pb.go | 694 -- api/status/grpc/types_frostfs_fuzz.go | 26 - api/status/grpc/types_frostfs_test.go | 21 - api/status/grpc/types_protoopaque.pb.go | 764 ++ api/tombstone/grpc/types.pb.go | 219 + api/tombstone/grpc/types_frostfs.pb.go | 264 - api/tombstone/grpc/types_frostfs_fuzz.go | 26 - api/tombstone/grpc/types_frostfs_test.go | 21 - api/tombstone/grpc/types_protoopaque.pb.go | 224 + object/raw_test.go | 4 + 110 files changed, 47773 insertions(+), 37555 deletions(-) create mode 100644 api/accounting/grpc/service.pb.go delete mode 100644 api/accounting/grpc/service_frostfs.pb.go delete mode 100644 api/accounting/grpc/service_frostfs_fuzz.go delete mode 100644 api/accounting/grpc/service_frostfs_test.go create mode 100644 api/accounting/grpc/service_protoopaque.pb.go create mode 100644 api/accounting/grpc/types.pb.go delete mode 100644 api/accounting/grpc/types_frostfs.pb.go delete mode 100644 api/accounting/grpc/types_frostfs_fuzz.go delete mode 100644 api/accounting/grpc/types_frostfs_test.go create mode 100644 api/accounting/grpc/types_protoopaque.pb.go create mode 100644 api/acl/grpc/types.pb.go delete mode 100644 api/acl/grpc/types_frostfs.pb.go delete mode 100644 api/acl/grpc/types_frostfs_fuzz.go delete mode 100644 api/acl/grpc/types_frostfs_test.go create mode 100644 api/acl/grpc/types_protoopaque.pb.go create mode 100644 api/ape/grpc/types.pb.go delete mode 100644 api/ape/grpc/types_frostfs.pb.go delete mode 100644 api/ape/grpc/types_frostfs_fuzz.go delete mode 100644 api/ape/grpc/types_frostfs_test.go create mode 100644 api/ape/grpc/types_protoopaque.pb.go create mode 100644 api/apemanager/grpc/service.pb.go delete mode 100644 api/apemanager/grpc/service_frostfs.pb.go delete mode 100644 api/apemanager/grpc/service_frostfs_fuzz.go delete mode 100644 api/apemanager/grpc/service_frostfs_test.go create mode 100644 api/apemanager/grpc/service_protoopaque.pb.go create mode 100644 api/container/grpc/service.pb.go delete mode 100644 api/container/grpc/service_frostfs.pb.go delete mode 100644 api/container/grpc/service_frostfs_fuzz.go delete mode 100644 api/container/grpc/service_frostfs_test.go create mode 100644 api/container/grpc/service_protoopaque.pb.go create mode 100644 api/container/grpc/types.pb.go delete mode 100644 api/container/grpc/types_frostfs.pb.go delete mode 100644 api/container/grpc/types_frostfs_fuzz.go delete mode 100644 api/container/grpc/types_frostfs_test.go create mode 100644 api/container/grpc/types_protoopaque.pb.go create mode 100644 api/lock/grpc/types.pb.go delete mode 100644 api/lock/grpc/types_frostfs.pb.go delete mode 100644 api/lock/grpc/types_frostfs_fuzz.go delete mode 100644 api/lock/grpc/types_frostfs_test.go create mode 100644 api/lock/grpc/types_protoopaque.pb.go create mode 100644 api/netmap/grpc/service.pb.go delete mode 100644 api/netmap/grpc/service_frostfs.pb.go delete mode 100644 api/netmap/grpc/service_frostfs_fuzz.go delete mode 100644 api/netmap/grpc/service_frostfs_test.go create mode 100644 api/netmap/grpc/service_protoopaque.pb.go create mode 100644 api/netmap/grpc/types.pb.go delete mode 100644 api/netmap/grpc/types_frostfs.pb.go delete mode 100644 api/netmap/grpc/types_frostfs_fuzz.go delete mode 100644 api/netmap/grpc/types_frostfs_test.go create mode 100644 api/netmap/grpc/types_protoopaque.pb.go create mode 100644 api/object/grpc/service.pb.go delete mode 100644 api/object/grpc/service_frostfs.pb.go delete mode 100644 api/object/grpc/service_frostfs_fuzz.go delete mode 100644 api/object/grpc/service_frostfs_test.go create mode 100644 api/object/grpc/service_protoopaque.pb.go create mode 100644 api/object/grpc/types.pb.go delete mode 100644 api/object/grpc/types_frostfs.pb.go delete mode 100644 api/object/grpc/types_frostfs_fuzz.go delete mode 100644 api/object/grpc/types_frostfs_test.go create mode 100644 api/object/grpc/types_protoopaque.pb.go create mode 100644 api/refs/grpc/types.pb.go delete mode 100644 api/refs/grpc/types_frostfs.pb.go delete mode 100644 api/refs/grpc/types_frostfs_fuzz.go delete mode 100644 api/refs/grpc/types_frostfs_test.go create mode 100644 api/refs/grpc/types_protoopaque.pb.go create mode 100644 api/session/grpc/service.pb.go delete mode 100644 api/session/grpc/service_frostfs.pb.go delete mode 100644 api/session/grpc/service_frostfs_fuzz.go delete mode 100644 api/session/grpc/service_frostfs_test.go create mode 100644 api/session/grpc/service_protoopaque.pb.go create mode 100644 api/session/grpc/types.pb.go delete mode 100644 api/session/grpc/types_frostfs.pb.go delete mode 100644 api/session/grpc/types_frostfs_fuzz.go delete mode 100644 api/session/grpc/types_frostfs_test.go create mode 100644 api/session/grpc/types_protoopaque.pb.go create mode 100644 api/status/grpc/types.pb.go delete mode 100644 api/status/grpc/types_frostfs.pb.go delete mode 100644 api/status/grpc/types_frostfs_fuzz.go delete mode 100644 api/status/grpc/types_frostfs_test.go create mode 100644 api/status/grpc/types_protoopaque.pb.go create mode 100644 api/tombstone/grpc/types.pb.go delete mode 100644 api/tombstone/grpc/types_frostfs.pb.go delete mode 100644 api/tombstone/grpc/types_frostfs_fuzz.go delete mode 100644 api/tombstone/grpc/types_frostfs_test.go create mode 100644 api/tombstone/grpc/types_protoopaque.pb.go diff --git a/Makefile b/Makefile index 1830380..eab6ec1 100755 --- a/Makefile +++ b/Makefile @@ -52,13 +52,12 @@ protoc: make protoc-install; \ fi # Protoc generate - @for f in `find . -type f -name '*.proto' -not -path './bin/*' -not -path './api/util/proto/test/*'`; do \ + @for f in `find . -type f -name '*.proto' -not -path './bin/*'`; do \ echo "⇒ Processing $$f "; \ $(PROTOC_DIR)/bin/protoc \ - --proto_path=.:$(PROTOC_DIR)/include:/usr/local/include \ - --plugin=protoc-gen-go-frostfs=$(abspath ./bin/protogen) \ - --go-frostfs_out=fuzz=true:. \ - --go-frostfs_opt=paths=source_relative \ + --plugin=protoc-gen-go=$(PROTOC_GEN_GO_DIR)/protoc-gen-go \ + --go_out=. --go_opt=paths=source_relative \ + --go_opt=default_api_level=API_HYBRID \ --go-grpc_opt=require_unimplemented_servers=false \ --go-grpc_out=. --go-grpc_opt=paths=source_relative $$f; \ done diff --git a/api/accounting/grpc/service.pb.go b/api/accounting/grpc/service.pb.go new file mode 100644 index 0000000..96cc7b1 --- /dev/null +++ b/api/accounting/grpc/service.pb.go @@ -0,0 +1,559 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/accounting/grpc/service.proto + +//go:build !protoopaque + +package accounting + +import ( + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// BalanceRequest message +type BalanceRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of the balance request message. + Body *BalanceRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BalanceRequest) Reset() { + *x = BalanceRequest{} + mi := &file_api_accounting_grpc_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BalanceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BalanceRequest) ProtoMessage() {} + +func (x *BalanceRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_accounting_grpc_service_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *BalanceRequest) GetBody() *BalanceRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *BalanceRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *BalanceRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +func (x *BalanceRequest) SetBody(v *BalanceRequest_Body) { + x.Body = v +} + +func (x *BalanceRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *BalanceRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *BalanceRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *BalanceRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *BalanceRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *BalanceRequest) ClearBody() { + x.Body = nil +} + +func (x *BalanceRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *BalanceRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type BalanceRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of the balance request message. + Body *BalanceRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 BalanceRequest_builder) Build() *BalanceRequest { + m0 := &BalanceRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// BalanceResponse message +type BalanceResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of the balance response message. + Body *BalanceResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BalanceResponse) Reset() { + *x = BalanceResponse{} + mi := &file_api_accounting_grpc_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BalanceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BalanceResponse) ProtoMessage() {} + +func (x *BalanceResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_accounting_grpc_service_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *BalanceResponse) GetBody() *BalanceResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *BalanceResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *BalanceResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +func (x *BalanceResponse) SetBody(v *BalanceResponse_Body) { + x.Body = v +} + +func (x *BalanceResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *BalanceResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *BalanceResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *BalanceResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *BalanceResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *BalanceResponse) ClearBody() { + x.Body = nil +} + +func (x *BalanceResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *BalanceResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type BalanceResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of the balance response message. + Body *BalanceResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 BalanceResponse_builder) Build() *BalanceResponse { + m0 := &BalanceResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// To indicate the account for which the balance is requested, its identifier +// is used. It can be any existing account in FrostFS sidechain `Balance` +// smart contract. If omitted, client implementation MUST set it to the +// request's signer `OwnerID`. +type BalanceRequest_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Valid user identifier in `OwnerID` format for which the balance is + // requested. Required field. + OwnerId *grpc1.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId" json:"owner_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BalanceRequest_Body) Reset() { + *x = BalanceRequest_Body{} + mi := &file_api_accounting_grpc_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BalanceRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BalanceRequest_Body) ProtoMessage() {} + +func (x *BalanceRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_api_accounting_grpc_service_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *BalanceRequest_Body) GetOwnerId() *grpc1.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} + +func (x *BalanceRequest_Body) SetOwnerId(v *grpc1.OwnerID) { + x.OwnerId = v +} + +func (x *BalanceRequest_Body) HasOwnerId() bool { + if x == nil { + return false + } + return x.OwnerId != nil +} + +func (x *BalanceRequest_Body) ClearOwnerId() { + x.OwnerId = nil +} + +type BalanceRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Valid user identifier in `OwnerID` format for which the balance is + // requested. Required field. + OwnerId *grpc1.OwnerID +} + +func (b0 BalanceRequest_Body_builder) Build() *BalanceRequest_Body { + m0 := &BalanceRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.OwnerId = b.OwnerId + return m0 +} + +// The amount of funds in GAS token for the `OwnerID`'s account requested. +// Balance is given in the `Decimal` format to avoid precision issues with +// rounding. +type BalanceResponse_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Amount of funds in GAS token for the requested account. + Balance *Decimal `protobuf:"bytes,1,opt,name=balance" json:"balance,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BalanceResponse_Body) Reset() { + *x = BalanceResponse_Body{} + mi := &file_api_accounting_grpc_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BalanceResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BalanceResponse_Body) ProtoMessage() {} + +func (x *BalanceResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_api_accounting_grpc_service_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *BalanceResponse_Body) GetBalance() *Decimal { + if x != nil { + return x.Balance + } + return nil +} + +func (x *BalanceResponse_Body) SetBalance(v *Decimal) { + x.Balance = v +} + +func (x *BalanceResponse_Body) HasBalance() bool { + if x == nil { + return false + } + return x.Balance != nil +} + +func (x *BalanceResponse_Body) ClearBalance() { + x.Balance = nil +} + +type BalanceResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Amount of funds in GAS token for the requested account. + Balance *Decimal +} + +func (b0 BalanceResponse_Body_builder) Build() *BalanceResponse_Body { + m0 := &BalanceResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.Balance = b.Balance + return m0 +} + +var File_api_accounting_grpc_service_proto protoreflect.FileDescriptor + +var file_api_accounting_grpc_service_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, + 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x1f, 0x61, 0x70, 0x69, 0x2f, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x61, 0x70, 0x69, 0x2f, + 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xa5, 0x02, 0x0a, 0x0e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d, + 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, + 0x3a, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, + 0x49, 0x44, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x22, 0xae, 0x02, 0x0a, 0x0f, + 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x3e, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, + 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, + 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x3f, 0x0a, 0x04, 0x42, + 0x6f, 0x64, 0x79, 0x12, 0x37, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x44, 0x65, 0x63, 0x69, + 0x6d, 0x61, 0x6c, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x32, 0x6b, 0x0a, 0x11, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x56, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x24, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6e, 0x5a, 0x4b, 0x67, 0x69, 0x74, + 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, + 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0xaa, 0x02, 0x1e, 0x4e, 0x65, 0x6f, 0x2e, 0x46, + 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x62, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_accounting_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_api_accounting_grpc_service_proto_goTypes = []any{ + (*BalanceRequest)(nil), // 0: neo.fs.v2.accounting.BalanceRequest + (*BalanceResponse)(nil), // 1: neo.fs.v2.accounting.BalanceResponse + (*BalanceRequest_Body)(nil), // 2: neo.fs.v2.accounting.BalanceRequest.Body + (*BalanceResponse_Body)(nil), // 3: neo.fs.v2.accounting.BalanceResponse.Body + (*grpc.RequestMetaHeader)(nil), // 4: neo.fs.v2.session.RequestMetaHeader + (*grpc.RequestVerificationHeader)(nil), // 5: neo.fs.v2.session.RequestVerificationHeader + (*grpc.ResponseMetaHeader)(nil), // 6: neo.fs.v2.session.ResponseMetaHeader + (*grpc.ResponseVerificationHeader)(nil), // 7: neo.fs.v2.session.ResponseVerificationHeader + (*grpc1.OwnerID)(nil), // 8: neo.fs.v2.refs.OwnerID + (*Decimal)(nil), // 9: neo.fs.v2.accounting.Decimal +} +var file_api_accounting_grpc_service_proto_depIdxs = []int32{ + 2, // 0: neo.fs.v2.accounting.BalanceRequest.body:type_name -> neo.fs.v2.accounting.BalanceRequest.Body + 4, // 1: neo.fs.v2.accounting.BalanceRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 5, // 2: neo.fs.v2.accounting.BalanceRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 3, // 3: neo.fs.v2.accounting.BalanceResponse.body:type_name -> neo.fs.v2.accounting.BalanceResponse.Body + 6, // 4: neo.fs.v2.accounting.BalanceResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 7, // 5: neo.fs.v2.accounting.BalanceResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 8, // 6: neo.fs.v2.accounting.BalanceRequest.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID + 9, // 7: neo.fs.v2.accounting.BalanceResponse.Body.balance:type_name -> neo.fs.v2.accounting.Decimal + 0, // 8: neo.fs.v2.accounting.AccountingService.Balance:input_type -> neo.fs.v2.accounting.BalanceRequest + 1, // 9: neo.fs.v2.accounting.AccountingService.Balance:output_type -> neo.fs.v2.accounting.BalanceResponse + 9, // [9:10] is the sub-list for method output_type + 8, // [8:9] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_api_accounting_grpc_service_proto_init() } +func file_api_accounting_grpc_service_proto_init() { + if File_api_accounting_grpc_service_proto != nil { + return + } + file_api_accounting_grpc_types_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_accounting_grpc_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_api_accounting_grpc_service_proto_goTypes, + DependencyIndexes: file_api_accounting_grpc_service_proto_depIdxs, + MessageInfos: file_api_accounting_grpc_service_proto_msgTypes, + }.Build() + File_api_accounting_grpc_service_proto = out.File + file_api_accounting_grpc_service_proto_rawDesc = nil + file_api_accounting_grpc_service_proto_goTypes = nil + file_api_accounting_grpc_service_proto_depIdxs = nil +} diff --git a/api/accounting/grpc/service_frostfs.pb.go b/api/accounting/grpc/service_frostfs.pb.go deleted file mode 100644 index 86502ef..0000000 --- a/api/accounting/grpc/service_frostfs.pb.go +++ /dev/null @@ -1,768 +0,0 @@ -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package accounting - -import ( - json "encoding/json" - fmt "fmt" - grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" - grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" - pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" - proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" - encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" - easyproto "github.com/VictoriaMetrics/easyproto" - jlexer "github.com/mailru/easyjson/jlexer" - jwriter "github.com/mailru/easyjson/jwriter" -) - -type BalanceRequest_Body struct { - OwnerId *grpc.OwnerID `json:"ownerId"` -} - -var ( - _ encoding.ProtoMarshaler = (*BalanceRequest_Body)(nil) - _ encoding.ProtoUnmarshaler = (*BalanceRequest_Body)(nil) - _ json.Marshaler = (*BalanceRequest_Body)(nil) - _ json.Unmarshaler = (*BalanceRequest_Body)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *BalanceRequest_Body) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.NestedStructureSize(1, x.OwnerId) - return size -} - -// MarshalProtobuf implements the encoding.ProtoMarshaler interface. -func (x *BalanceRequest_Body) MarshalProtobuf(dst []byte) []byte { - m := pool.MarshalerPool.Get() - defer pool.MarshalerPool.Put(m) - x.EmitProtobuf(m.MessageMarshaler()) - dst = m.Marshal(dst) - return dst -} - -func (x *BalanceRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { - if x == nil { - return - } - if x.OwnerId != nil { - x.OwnerId.EmitProtobuf(mm.AppendMessage(1)) - } -} - -// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. -func (x *BalanceRequest_Body) UnmarshalProtobuf(src []byte) (err error) { - var fc easyproto.FieldContext - for len(src) > 0 { - src, err = fc.NextField(src) - if err != nil { - return fmt.Errorf("cannot read next field in %s", "BalanceRequest_Body") - } - switch fc.FieldNum { - case 1: // OwnerId - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "OwnerId") - } - x.OwnerId = new(grpc.OwnerID) - if err := x.OwnerId.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - } - } - return nil -} -func (x *BalanceRequest_Body) GetOwnerId() *grpc.OwnerID { - if x != nil { - return x.OwnerId - } - return nil -} -func (x *BalanceRequest_Body) SetOwnerId(v *grpc.OwnerID) { - x.OwnerId = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *BalanceRequest_Body) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *BalanceRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"ownerId\":" - out.RawString(prefix) - x.OwnerId.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *BalanceRequest_Body) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *BalanceRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "ownerId": - { - var f *grpc.OwnerID - f = new(grpc.OwnerID) - f.UnmarshalEasyJSON(in) - x.OwnerId = f - } - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} - -type BalanceRequest struct { - Body *BalanceRequest_Body `json:"body"` - MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` - VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` -} - -var ( - _ encoding.ProtoMarshaler = (*BalanceRequest)(nil) - _ encoding.ProtoUnmarshaler = (*BalanceRequest)(nil) - _ json.Marshaler = (*BalanceRequest)(nil) - _ json.Unmarshaler = (*BalanceRequest)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *BalanceRequest) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.NestedStructureSize(1, x.Body) - size += proto.NestedStructureSize(2, x.MetaHeader) - size += proto.NestedStructureSize(3, x.VerifyHeader) - return size -} - -// ReadSignedData fills buf with signed data of x. -// If buffer length is less than x.SignedDataSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same signed data. -func (x *BalanceRequest) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// SignedDataSize returns size of the request signed data in bytes. -// -// Structures with the same field values have the same signed data size. -func (x *BalanceRequest) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().MarshalProtobuf(buf), nil -} - -// MarshalProtobuf implements the encoding.ProtoMarshaler interface. -func (x *BalanceRequest) MarshalProtobuf(dst []byte) []byte { - m := pool.MarshalerPool.Get() - defer pool.MarshalerPool.Put(m) - x.EmitProtobuf(m.MessageMarshaler()) - dst = m.Marshal(dst) - return dst -} - -func (x *BalanceRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { - if x == nil { - return - } - if x.Body != nil { - x.Body.EmitProtobuf(mm.AppendMessage(1)) - } - if x.MetaHeader != nil { - x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) - } - if x.VerifyHeader != nil { - x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) - } -} - -// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. -func (x *BalanceRequest) UnmarshalProtobuf(src []byte) (err error) { - var fc easyproto.FieldContext - for len(src) > 0 { - src, err = fc.NextField(src) - if err != nil { - return fmt.Errorf("cannot read next field in %s", "BalanceRequest") - } - switch fc.FieldNum { - case 1: // Body - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Body") - } - x.Body = new(BalanceRequest_Body) - if err := x.Body.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - case 2: // MetaHeader - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "MetaHeader") - } - x.MetaHeader = new(grpc1.RequestMetaHeader) - if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - case 3: // VerifyHeader - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader") - } - x.VerifyHeader = new(grpc1.RequestVerificationHeader) - if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - } - } - return nil -} -func (x *BalanceRequest) GetBody() *BalanceRequest_Body { - if x != nil { - return x.Body - } - return nil -} -func (x *BalanceRequest) SetBody(v *BalanceRequest_Body) { - x.Body = v -} -func (x *BalanceRequest) GetMetaHeader() *grpc1.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} -func (x *BalanceRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { - x.MetaHeader = v -} -func (x *BalanceRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} -func (x *BalanceRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { - x.VerifyHeader = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *BalanceRequest) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *BalanceRequest) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *BalanceRequest) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *BalanceRequest) UnmarshalEasyJSON(in *jlexer.Lexer) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "body": - { - var f *BalanceRequest_Body - f = new(BalanceRequest_Body) - f.UnmarshalEasyJSON(in) - x.Body = f - } - case "metaHeader": - { - var f *grpc1.RequestMetaHeader - f = new(grpc1.RequestMetaHeader) - f.UnmarshalEasyJSON(in) - x.MetaHeader = f - } - case "verifyHeader": - { - var f *grpc1.RequestVerificationHeader - f = new(grpc1.RequestVerificationHeader) - f.UnmarshalEasyJSON(in) - x.VerifyHeader = f - } - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} - -type BalanceResponse_Body struct { - Balance *Decimal `json:"balance"` -} - -var ( - _ encoding.ProtoMarshaler = (*BalanceResponse_Body)(nil) - _ encoding.ProtoUnmarshaler = (*BalanceResponse_Body)(nil) - _ json.Marshaler = (*BalanceResponse_Body)(nil) - _ json.Unmarshaler = (*BalanceResponse_Body)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *BalanceResponse_Body) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.NestedStructureSize(1, x.Balance) - return size -} - -// MarshalProtobuf implements the encoding.ProtoMarshaler interface. -func (x *BalanceResponse_Body) MarshalProtobuf(dst []byte) []byte { - m := pool.MarshalerPool.Get() - defer pool.MarshalerPool.Put(m) - x.EmitProtobuf(m.MessageMarshaler()) - dst = m.Marshal(dst) - return dst -} - -func (x *BalanceResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { - if x == nil { - return - } - if x.Balance != nil { - x.Balance.EmitProtobuf(mm.AppendMessage(1)) - } -} - -// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. -func (x *BalanceResponse_Body) UnmarshalProtobuf(src []byte) (err error) { - var fc easyproto.FieldContext - for len(src) > 0 { - src, err = fc.NextField(src) - if err != nil { - return fmt.Errorf("cannot read next field in %s", "BalanceResponse_Body") - } - switch fc.FieldNum { - case 1: // Balance - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Balance") - } - x.Balance = new(Decimal) - if err := x.Balance.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - } - } - return nil -} -func (x *BalanceResponse_Body) GetBalance() *Decimal { - if x != nil { - return x.Balance - } - return nil -} -func (x *BalanceResponse_Body) SetBalance(v *Decimal) { - x.Balance = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *BalanceResponse_Body) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *BalanceResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"balance\":" - out.RawString(prefix) - x.Balance.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *BalanceResponse_Body) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *BalanceResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "balance": - { - var f *Decimal - f = new(Decimal) - f.UnmarshalEasyJSON(in) - x.Balance = f - } - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} - -type BalanceResponse struct { - Body *BalanceResponse_Body `json:"body"` - MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` - VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` -} - -var ( - _ encoding.ProtoMarshaler = (*BalanceResponse)(nil) - _ encoding.ProtoUnmarshaler = (*BalanceResponse)(nil) - _ json.Marshaler = (*BalanceResponse)(nil) - _ json.Unmarshaler = (*BalanceResponse)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *BalanceResponse) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.NestedStructureSize(1, x.Body) - size += proto.NestedStructureSize(2, x.MetaHeader) - size += proto.NestedStructureSize(3, x.VerifyHeader) - return size -} - -// ReadSignedData fills buf with signed data of x. -// If buffer length is less than x.SignedDataSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same signed data. -func (x *BalanceResponse) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// SignedDataSize returns size of the request signed data in bytes. -// -// Structures with the same field values have the same signed data size. -func (x *BalanceResponse) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().MarshalProtobuf(buf), nil -} - -// MarshalProtobuf implements the encoding.ProtoMarshaler interface. -func (x *BalanceResponse) MarshalProtobuf(dst []byte) []byte { - m := pool.MarshalerPool.Get() - defer pool.MarshalerPool.Put(m) - x.EmitProtobuf(m.MessageMarshaler()) - dst = m.Marshal(dst) - return dst -} - -func (x *BalanceResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { - if x == nil { - return - } - if x.Body != nil { - x.Body.EmitProtobuf(mm.AppendMessage(1)) - } - if x.MetaHeader != nil { - x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) - } - if x.VerifyHeader != nil { - x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) - } -} - -// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. -func (x *BalanceResponse) UnmarshalProtobuf(src []byte) (err error) { - var fc easyproto.FieldContext - for len(src) > 0 { - src, err = fc.NextField(src) - if err != nil { - return fmt.Errorf("cannot read next field in %s", "BalanceResponse") - } - switch fc.FieldNum { - case 1: // Body - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Body") - } - x.Body = new(BalanceResponse_Body) - if err := x.Body.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - case 2: // MetaHeader - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "MetaHeader") - } - x.MetaHeader = new(grpc1.ResponseMetaHeader) - if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - case 3: // VerifyHeader - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader") - } - x.VerifyHeader = new(grpc1.ResponseVerificationHeader) - if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - } - } - return nil -} -func (x *BalanceResponse) GetBody() *BalanceResponse_Body { - if x != nil { - return x.Body - } - return nil -} -func (x *BalanceResponse) SetBody(v *BalanceResponse_Body) { - x.Body = v -} -func (x *BalanceResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} -func (x *BalanceResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { - x.MetaHeader = v -} -func (x *BalanceResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} -func (x *BalanceResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { - x.VerifyHeader = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *BalanceResponse) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *BalanceResponse) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *BalanceResponse) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *BalanceResponse) UnmarshalEasyJSON(in *jlexer.Lexer) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "body": - { - var f *BalanceResponse_Body - f = new(BalanceResponse_Body) - f.UnmarshalEasyJSON(in) - x.Body = f - } - case "metaHeader": - { - var f *grpc1.ResponseMetaHeader - f = new(grpc1.ResponseMetaHeader) - f.UnmarshalEasyJSON(in) - x.MetaHeader = f - } - case "verifyHeader": - { - var f *grpc1.ResponseVerificationHeader - f = new(grpc1.ResponseVerificationHeader) - f.UnmarshalEasyJSON(in) - x.VerifyHeader = f - } - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} diff --git a/api/accounting/grpc/service_frostfs_fuzz.go b/api/accounting/grpc/service_frostfs_fuzz.go deleted file mode 100644 index 69e7174..0000000 --- a/api/accounting/grpc/service_frostfs_fuzz.go +++ /dev/null @@ -1,45 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package accounting - -func DoFuzzProtoBalanceRequest(data []byte) int { - msg := new(BalanceRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONBalanceRequest(data []byte) int { - msg := new(BalanceRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoBalanceResponse(data []byte) int { - msg := new(BalanceResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONBalanceResponse(data []byte) int { - msg := new(BalanceResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} diff --git a/api/accounting/grpc/service_frostfs_test.go b/api/accounting/grpc/service_frostfs_test.go deleted file mode 100644 index b97a13e..0000000 --- a/api/accounting/grpc/service_frostfs_test.go +++ /dev/null @@ -1,31 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package accounting - -import ( - testing "testing" -) - -func FuzzProtoBalanceRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoBalanceRequest(data) - }) -} -func FuzzJSONBalanceRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONBalanceRequest(data) - }) -} -func FuzzProtoBalanceResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoBalanceResponse(data) - }) -} -func FuzzJSONBalanceResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONBalanceResponse(data) - }) -} diff --git a/api/accounting/grpc/service_grpc.pb.go b/api/accounting/grpc/service_grpc.pb.go index c3a2c61..92e2ced 100644 --- a/api/accounting/grpc/service_grpc.pb.go +++ b/api/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 v5.27.2 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.29.2 // source: api/accounting/grpc/service.proto package accounting @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( AccountingService_Balance_FullMethodName = "/neo.fs.v2.accounting.AccountingService/Balance" @@ -25,6 +25,12 @@ const ( // AccountingServiceClient is the client API for AccountingService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Accounting service provides methods for interaction with FrostFS sidechain +// via other FrostFS nodes to get information about the account balance. Deposit +// and Withdraw operations can't be implemented here, as they require Mainnet +// FrostFS smart contract invocation. Transfer operations between internal +// FrostFS accounts are possible if both use the same token type. type AccountingServiceClient interface { // Returns the amount of funds in GAS token for the requested FrostFS account. // @@ -44,8 +50,9 @@ func NewAccountingServiceClient(cc grpc.ClientConnInterface) AccountingServiceCl } func (c *accountingServiceClient) Balance(ctx context.Context, in *BalanceRequest, opts ...grpc.CallOption) (*BalanceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(BalanceResponse) - err := c.cc.Invoke(ctx, AccountingService_Balance_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, AccountingService_Balance_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -54,7 +61,13 @@ func (c *accountingServiceClient) Balance(ctx context.Context, in *BalanceReques // AccountingServiceServer is the server API for AccountingService service. // All implementations should embed UnimplementedAccountingServiceServer -// for forward compatibility +// for forward compatibility. +// +// Accounting service provides methods for interaction with FrostFS sidechain +// via other FrostFS nodes to get information about the account balance. Deposit +// and Withdraw operations can't be implemented here, as they require Mainnet +// FrostFS smart contract invocation. Transfer operations between internal +// FrostFS accounts are possible if both use the same token type. type AccountingServiceServer interface { // Returns the amount of funds in GAS token for the requested FrostFS account. // @@ -65,13 +78,17 @@ type AccountingServiceServer interface { Balance(context.Context, *BalanceRequest) (*BalanceResponse, error) } -// UnimplementedAccountingServiceServer should be embedded to have forward compatible implementations. -type UnimplementedAccountingServiceServer struct { -} +// UnimplementedAccountingServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedAccountingServiceServer struct{} func (UnimplementedAccountingServiceServer) Balance(context.Context, *BalanceRequest) (*BalanceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Balance not implemented") } +func (UnimplementedAccountingServiceServer) testEmbeddedByValue() {} // UnsafeAccountingServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to AccountingServiceServer will @@ -81,6 +98,13 @@ type UnsafeAccountingServiceServer interface { } func RegisterAccountingServiceServer(s grpc.ServiceRegistrar, srv AccountingServiceServer) { + // If the following call pancis, it indicates UnimplementedAccountingServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&AccountingService_ServiceDesc, srv) } diff --git a/api/accounting/grpc/service_protoopaque.pb.go b/api/accounting/grpc/service_protoopaque.pb.go new file mode 100644 index 0000000..c5d62ec --- /dev/null +++ b/api/accounting/grpc/service_protoopaque.pb.go @@ -0,0 +1,544 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/accounting/grpc/service.proto + +//go:build protoopaque + +package accounting + +import ( + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// BalanceRequest message +type BalanceRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *BalanceRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BalanceRequest) Reset() { + *x = BalanceRequest{} + mi := &file_api_accounting_grpc_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BalanceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BalanceRequest) ProtoMessage() {} + +func (x *BalanceRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_accounting_grpc_service_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *BalanceRequest) GetBody() *BalanceRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *BalanceRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *BalanceRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *BalanceRequest) SetBody(v *BalanceRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *BalanceRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *BalanceRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *BalanceRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *BalanceRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *BalanceRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *BalanceRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *BalanceRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *BalanceRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type BalanceRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of the balance request message. + Body *BalanceRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 BalanceRequest_builder) Build() *BalanceRequest { + m0 := &BalanceRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// BalanceResponse message +type BalanceResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *BalanceResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BalanceResponse) Reset() { + *x = BalanceResponse{} + mi := &file_api_accounting_grpc_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BalanceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BalanceResponse) ProtoMessage() {} + +func (x *BalanceResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_accounting_grpc_service_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *BalanceResponse) GetBody() *BalanceResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *BalanceResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *BalanceResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *BalanceResponse) SetBody(v *BalanceResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *BalanceResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *BalanceResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *BalanceResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *BalanceResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *BalanceResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *BalanceResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *BalanceResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *BalanceResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type BalanceResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of the balance response message. + Body *BalanceResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 BalanceResponse_builder) Build() *BalanceResponse { + m0 := &BalanceResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// To indicate the account for which the balance is requested, its identifier +// is used. It can be any existing account in FrostFS sidechain `Balance` +// smart contract. If omitted, client implementation MUST set it to the +// request's signer `OwnerID`. +type BalanceRequest_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_OwnerId *grpc1.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId" json:"owner_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BalanceRequest_Body) Reset() { + *x = BalanceRequest_Body{} + mi := &file_api_accounting_grpc_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BalanceRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BalanceRequest_Body) ProtoMessage() {} + +func (x *BalanceRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_api_accounting_grpc_service_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *BalanceRequest_Body) GetOwnerId() *grpc1.OwnerID { + if x != nil { + return x.xxx_hidden_OwnerId + } + return nil +} + +func (x *BalanceRequest_Body) SetOwnerId(v *grpc1.OwnerID) { + x.xxx_hidden_OwnerId = v +} + +func (x *BalanceRequest_Body) HasOwnerId() bool { + if x == nil { + return false + } + return x.xxx_hidden_OwnerId != nil +} + +func (x *BalanceRequest_Body) ClearOwnerId() { + x.xxx_hidden_OwnerId = nil +} + +type BalanceRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Valid user identifier in `OwnerID` format for which the balance is + // requested. Required field. + OwnerId *grpc1.OwnerID +} + +func (b0 BalanceRequest_Body_builder) Build() *BalanceRequest_Body { + m0 := &BalanceRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_OwnerId = b.OwnerId + return m0 +} + +// The amount of funds in GAS token for the `OwnerID`'s account requested. +// Balance is given in the `Decimal` format to avoid precision issues with +// rounding. +type BalanceResponse_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Balance *Decimal `protobuf:"bytes,1,opt,name=balance" json:"balance,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BalanceResponse_Body) Reset() { + *x = BalanceResponse_Body{} + mi := &file_api_accounting_grpc_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BalanceResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BalanceResponse_Body) ProtoMessage() {} + +func (x *BalanceResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_api_accounting_grpc_service_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *BalanceResponse_Body) GetBalance() *Decimal { + if x != nil { + return x.xxx_hidden_Balance + } + return nil +} + +func (x *BalanceResponse_Body) SetBalance(v *Decimal) { + x.xxx_hidden_Balance = v +} + +func (x *BalanceResponse_Body) HasBalance() bool { + if x == nil { + return false + } + return x.xxx_hidden_Balance != nil +} + +func (x *BalanceResponse_Body) ClearBalance() { + x.xxx_hidden_Balance = nil +} + +type BalanceResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Amount of funds in GAS token for the requested account. + Balance *Decimal +} + +func (b0 BalanceResponse_Body_builder) Build() *BalanceResponse_Body { + m0 := &BalanceResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Balance = b.Balance + return m0 +} + +var File_api_accounting_grpc_service_proto protoreflect.FileDescriptor + +var file_api_accounting_grpc_service_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, + 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x1f, 0x61, 0x70, 0x69, 0x2f, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x61, 0x70, 0x69, 0x2f, + 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xa5, 0x02, 0x0a, 0x0e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d, + 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, + 0x3a, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, + 0x49, 0x44, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x22, 0xae, 0x02, 0x0a, 0x0f, + 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x3e, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, + 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, + 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x3f, 0x0a, 0x04, 0x42, + 0x6f, 0x64, 0x79, 0x12, 0x37, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x44, 0x65, 0x63, 0x69, + 0x6d, 0x61, 0x6c, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x32, 0x6b, 0x0a, 0x11, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x56, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x24, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6e, 0x5a, 0x4b, 0x67, 0x69, 0x74, + 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, + 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0xaa, 0x02, 0x1e, 0x4e, 0x65, 0x6f, 0x2e, 0x46, + 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x62, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_accounting_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_api_accounting_grpc_service_proto_goTypes = []any{ + (*BalanceRequest)(nil), // 0: neo.fs.v2.accounting.BalanceRequest + (*BalanceResponse)(nil), // 1: neo.fs.v2.accounting.BalanceResponse + (*BalanceRequest_Body)(nil), // 2: neo.fs.v2.accounting.BalanceRequest.Body + (*BalanceResponse_Body)(nil), // 3: neo.fs.v2.accounting.BalanceResponse.Body + (*grpc.RequestMetaHeader)(nil), // 4: neo.fs.v2.session.RequestMetaHeader + (*grpc.RequestVerificationHeader)(nil), // 5: neo.fs.v2.session.RequestVerificationHeader + (*grpc.ResponseMetaHeader)(nil), // 6: neo.fs.v2.session.ResponseMetaHeader + (*grpc.ResponseVerificationHeader)(nil), // 7: neo.fs.v2.session.ResponseVerificationHeader + (*grpc1.OwnerID)(nil), // 8: neo.fs.v2.refs.OwnerID + (*Decimal)(nil), // 9: neo.fs.v2.accounting.Decimal +} +var file_api_accounting_grpc_service_proto_depIdxs = []int32{ + 2, // 0: neo.fs.v2.accounting.BalanceRequest.body:type_name -> neo.fs.v2.accounting.BalanceRequest.Body + 4, // 1: neo.fs.v2.accounting.BalanceRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 5, // 2: neo.fs.v2.accounting.BalanceRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 3, // 3: neo.fs.v2.accounting.BalanceResponse.body:type_name -> neo.fs.v2.accounting.BalanceResponse.Body + 6, // 4: neo.fs.v2.accounting.BalanceResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 7, // 5: neo.fs.v2.accounting.BalanceResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 8, // 6: neo.fs.v2.accounting.BalanceRequest.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID + 9, // 7: neo.fs.v2.accounting.BalanceResponse.Body.balance:type_name -> neo.fs.v2.accounting.Decimal + 0, // 8: neo.fs.v2.accounting.AccountingService.Balance:input_type -> neo.fs.v2.accounting.BalanceRequest + 1, // 9: neo.fs.v2.accounting.AccountingService.Balance:output_type -> neo.fs.v2.accounting.BalanceResponse + 9, // [9:10] is the sub-list for method output_type + 8, // [8:9] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_api_accounting_grpc_service_proto_init() } +func file_api_accounting_grpc_service_proto_init() { + if File_api_accounting_grpc_service_proto != nil { + return + } + file_api_accounting_grpc_types_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_accounting_grpc_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_api_accounting_grpc_service_proto_goTypes, + DependencyIndexes: file_api_accounting_grpc_service_proto_depIdxs, + MessageInfos: file_api_accounting_grpc_service_proto_msgTypes, + }.Build() + File_api_accounting_grpc_service_proto = out.File + file_api_accounting_grpc_service_proto_rawDesc = nil + file_api_accounting_grpc_service_proto_goTypes = nil + file_api_accounting_grpc_service_proto_depIdxs = nil +} diff --git a/api/accounting/grpc/types.pb.go b/api/accounting/grpc/types.pb.go new file mode 100644 index 0000000..760deed --- /dev/null +++ b/api/accounting/grpc/types.pb.go @@ -0,0 +1,186 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/accounting/grpc/types.proto + +//go:build !protoopaque + +package accounting + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Standard floating point data type can't be used in FrostFS due to inexactness +// of the result when doing lots of small number operations. To solve the lost +// precision issue, special `Decimal` format is used for monetary computations. +// +// Please see [The General Decimal Arithmetic +// Specification](http://speleotrove.com/decimal/) for detailed problem +// description. +type Decimal struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Number in the smallest Token fractions. + Value *int64 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"` + // Precision value indicating how many smallest fractions can be in one + // integer. + Precision *uint32 `protobuf:"varint,2,opt,name=precision" json:"precision,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Decimal) Reset() { + *x = Decimal{} + mi := &file_api_accounting_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Decimal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Decimal) ProtoMessage() {} + +func (x *Decimal) ProtoReflect() protoreflect.Message { + mi := &file_api_accounting_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Decimal) GetValue() int64 { + if x != nil && x.Value != nil { + return *x.Value + } + return 0 +} + +func (x *Decimal) GetPrecision() uint32 { + if x != nil && x.Precision != nil { + return *x.Precision + } + return 0 +} + +func (x *Decimal) SetValue(v int64) { + x.Value = &v +} + +func (x *Decimal) SetPrecision(v uint32) { + x.Precision = &v +} + +func (x *Decimal) HasValue() bool { + if x == nil { + return false + } + return x.Value != nil +} + +func (x *Decimal) HasPrecision() bool { + if x == nil { + return false + } + return x.Precision != nil +} + +func (x *Decimal) ClearValue() { + x.Value = nil +} + +func (x *Decimal) ClearPrecision() { + x.Precision = nil +} + +type Decimal_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Number in the smallest Token fractions. + Value *int64 + // Precision value indicating how many smallest fractions can be in one + // integer. + Precision *uint32 +} + +func (b0 Decimal_builder) Build() *Decimal { + m0 := &Decimal{} + b, x := &b0, m0 + _, _ = b, x + x.Value = b.Value + x.Precision = b.Precision + return m0 +} + +var File_api_accounting_grpc_types_proto protoreflect.FileDescriptor + +var file_api_accounting_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, + 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x14, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x0a, 0x07, 0x44, 0x65, 0x63, 0x69, 0x6d, + 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x63, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x70, 0x72, 0x65, + 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x6e, 0x5a, 0x4b, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, + 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, + 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, + 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x69, 0x6e, 0x67, 0xaa, 0x02, 0x1e, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x62, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x70, 0xe8, 0x07, +} + +var file_api_accounting_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_api_accounting_grpc_types_proto_goTypes = []any{ + (*Decimal)(nil), // 0: neo.fs.v2.accounting.Decimal +} +var file_api_accounting_grpc_types_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_api_accounting_grpc_types_proto_init() } +func file_api_accounting_grpc_types_proto_init() { + if File_api_accounting_grpc_types_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_accounting_grpc_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_accounting_grpc_types_proto_goTypes, + DependencyIndexes: file_api_accounting_grpc_types_proto_depIdxs, + MessageInfos: file_api_accounting_grpc_types_proto_msgTypes, + }.Build() + File_api_accounting_grpc_types_proto = out.File + file_api_accounting_grpc_types_proto_rawDesc = nil + file_api_accounting_grpc_types_proto_goTypes = nil + file_api_accounting_grpc_types_proto_depIdxs = nil +} diff --git a/api/accounting/grpc/types_frostfs.pb.go b/api/accounting/grpc/types_frostfs.pb.go deleted file mode 100644 index 9d0e9ea..0000000 --- a/api/accounting/grpc/types_frostfs.pb.go +++ /dev/null @@ -1,204 +0,0 @@ -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package accounting - -import ( - json "encoding/json" - fmt "fmt" - pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" - proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" - encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" - easyproto "github.com/VictoriaMetrics/easyproto" - jlexer "github.com/mailru/easyjson/jlexer" - jwriter "github.com/mailru/easyjson/jwriter" - strconv "strconv" -) - -type Decimal struct { - Value int64 `json:"value"` - Precision uint32 `json:"precision"` -} - -var ( - _ encoding.ProtoMarshaler = (*Decimal)(nil) - _ encoding.ProtoUnmarshaler = (*Decimal)(nil) - _ json.Marshaler = (*Decimal)(nil) - _ json.Unmarshaler = (*Decimal)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *Decimal) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.Int64Size(1, x.Value) - size += proto.UInt32Size(2, x.Precision) - return size -} - -// MarshalProtobuf implements the encoding.ProtoMarshaler interface. -func (x *Decimal) MarshalProtobuf(dst []byte) []byte { - m := pool.MarshalerPool.Get() - defer pool.MarshalerPool.Put(m) - x.EmitProtobuf(m.MessageMarshaler()) - dst = m.Marshal(dst) - return dst -} - -func (x *Decimal) EmitProtobuf(mm *easyproto.MessageMarshaler) { - if x == nil { - return - } - if x.Value != 0 { - mm.AppendInt64(1, x.Value) - } - if x.Precision != 0 { - mm.AppendUint32(2, x.Precision) - } -} - -// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. -func (x *Decimal) UnmarshalProtobuf(src []byte) (err error) { - var fc easyproto.FieldContext - for len(src) > 0 { - src, err = fc.NextField(src) - if err != nil { - return fmt.Errorf("cannot read next field in %s", "Decimal") - } - switch fc.FieldNum { - case 1: // Value - data, ok := fc.Int64() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Value") - } - x.Value = data - case 2: // Precision - data, ok := fc.Uint32() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Precision") - } - x.Precision = data - } - } - return nil -} -func (x *Decimal) GetValue() int64 { - if x != nil { - return x.Value - } - return 0 -} -func (x *Decimal) SetValue(v int64) { - x.Value = v -} -func (x *Decimal) GetPrecision() uint32 { - if x != nil { - return x.Precision - } - return 0 -} -func (x *Decimal) SetPrecision(v uint32) { - x.Precision = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *Decimal) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *Decimal) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"value\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.Value, 10) - out.RawByte('"') - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"precision\":" - out.RawString(prefix) - out.Uint32(x.Precision) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *Decimal) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *Decimal) UnmarshalEasyJSON(in *jlexer.Lexer) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "value": - { - var f int64 - r := in.JsonNumber() - n := r.String() - v, err := strconv.ParseInt(n, 10, 64) - if err != nil { - in.AddError(err) - return - } - pv := int64(v) - f = pv - x.Value = f - } - case "precision": - { - var f uint32 - r := in.JsonNumber() - n := r.String() - v, err := strconv.ParseUint(n, 10, 32) - if err != nil { - in.AddError(err) - return - } - pv := uint32(v) - f = pv - x.Precision = f - } - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} diff --git a/api/accounting/grpc/types_frostfs_fuzz.go b/api/accounting/grpc/types_frostfs_fuzz.go deleted file mode 100644 index 5eb5e97..0000000 --- a/api/accounting/grpc/types_frostfs_fuzz.go +++ /dev/null @@ -1,26 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package accounting - -func DoFuzzProtoDecimal(data []byte) int { - msg := new(Decimal) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONDecimal(data []byte) int { - msg := new(Decimal) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} diff --git a/api/accounting/grpc/types_frostfs_test.go b/api/accounting/grpc/types_frostfs_test.go deleted file mode 100644 index 404b75e..0000000 --- a/api/accounting/grpc/types_frostfs_test.go +++ /dev/null @@ -1,21 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package accounting - -import ( - testing "testing" -) - -func FuzzProtoDecimal(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoDecimal(data) - }) -} -func FuzzJSONDecimal(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONDecimal(data) - }) -} diff --git a/api/accounting/grpc/types_protoopaque.pb.go b/api/accounting/grpc/types_protoopaque.pb.go new file mode 100644 index 0000000..49a80ca --- /dev/null +++ b/api/accounting/grpc/types_protoopaque.pb.go @@ -0,0 +1,195 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/accounting/grpc/types.proto + +//go:build protoopaque + +package accounting + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Standard floating point data type can't be used in FrostFS due to inexactness +// of the result when doing lots of small number operations. To solve the lost +// precision issue, special `Decimal` format is used for monetary computations. +// +// Please see [The General Decimal Arithmetic +// Specification](http://speleotrove.com/decimal/) for detailed problem +// description. +type Decimal struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Value int64 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"` + xxx_hidden_Precision uint32 `protobuf:"varint,2,opt,name=precision" json:"precision,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Decimal) Reset() { + *x = Decimal{} + mi := &file_api_accounting_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Decimal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Decimal) ProtoMessage() {} + +func (x *Decimal) ProtoReflect() protoreflect.Message { + mi := &file_api_accounting_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Decimal) GetValue() int64 { + if x != nil { + return x.xxx_hidden_Value + } + return 0 +} + +func (x *Decimal) GetPrecision() uint32 { + if x != nil { + return x.xxx_hidden_Precision + } + return 0 +} + +func (x *Decimal) SetValue(v int64) { + x.xxx_hidden_Value = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2) +} + +func (x *Decimal) SetPrecision(v uint32) { + x.xxx_hidden_Precision = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2) +} + +func (x *Decimal) HasValue() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *Decimal) HasPrecision() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *Decimal) ClearValue() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Value = 0 +} + +func (x *Decimal) ClearPrecision() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Precision = 0 +} + +type Decimal_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Number in the smallest Token fractions. + Value *int64 + // Precision value indicating how many smallest fractions can be in one + // integer. + Precision *uint32 +} + +func (b0 Decimal_builder) Build() *Decimal { + m0 := &Decimal{} + b, x := &b0, m0 + _, _ = b, x + if b.Value != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2) + x.xxx_hidden_Value = *b.Value + } + if b.Precision != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2) + x.xxx_hidden_Precision = *b.Precision + } + return m0 +} + +var File_api_accounting_grpc_types_proto protoreflect.FileDescriptor + +var file_api_accounting_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, + 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x14, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x0a, 0x07, 0x44, 0x65, 0x63, 0x69, 0x6d, + 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x63, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x70, 0x72, 0x65, + 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x6e, 0x5a, 0x4b, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, + 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, + 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, + 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x69, 0x6e, 0x67, 0xaa, 0x02, 0x1e, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x62, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x70, 0xe8, 0x07, +} + +var file_api_accounting_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_api_accounting_grpc_types_proto_goTypes = []any{ + (*Decimal)(nil), // 0: neo.fs.v2.accounting.Decimal +} +var file_api_accounting_grpc_types_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_api_accounting_grpc_types_proto_init() } +func file_api_accounting_grpc_types_proto_init() { + if File_api_accounting_grpc_types_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_accounting_grpc_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_accounting_grpc_types_proto_goTypes, + DependencyIndexes: file_api_accounting_grpc_types_proto_depIdxs, + MessageInfos: file_api_accounting_grpc_types_proto_msgTypes, + }.Build() + File_api_accounting_grpc_types_proto = out.File + file_api_accounting_grpc_types_proto_rawDesc = nil + file_api_accounting_grpc_types_proto_goTypes = nil + file_api_accounting_grpc_types_proto_depIdxs = nil +} diff --git a/api/acl/convert.go b/api/acl/convert.go index 3f389e3..a72260e 100644 --- a/api/acl/convert.go +++ b/api/acl/convert.go @@ -187,24 +187,24 @@ func (f *HeaderFilter) FromGRPCMessage(m grpc.Message) error { return nil } -func HeaderFiltersToGRPC(fs []HeaderFilter) (res []acl.EACLRecord_Filter) { +func HeaderFiltersToGRPC(fs []HeaderFilter) (res []*acl.EACLRecord_Filter) { if fs != nil { - res = make([]acl.EACLRecord_Filter, 0, len(fs)) + res = make([]*acl.EACLRecord_Filter, 0, len(fs)) for i := range fs { - res = append(res, *fs[i].ToGRPCMessage().(*acl.EACLRecord_Filter)) + res = append(res, fs[i].ToGRPCMessage().(*acl.EACLRecord_Filter)) } } return } -func HeaderFiltersFromGRPC(fs []acl.EACLRecord_Filter) (res []HeaderFilter, err error) { +func HeaderFiltersFromGRPC(fs []*acl.EACLRecord_Filter) (res []HeaderFilter, err error) { if fs != nil { res = make([]HeaderFilter, len(fs)) for i := range fs { - err = res[i].FromGRPCMessage(&fs[i]) + err = res[i].FromGRPCMessage(fs[i]) if err != nil { return } @@ -239,24 +239,24 @@ func (t *Target) FromGRPCMessage(m grpc.Message) error { return nil } -func TargetsToGRPC(ts []Target) (res []acl.EACLRecord_Target) { +func TargetsToGRPC(ts []Target) (res []*acl.EACLRecord_Target) { if ts != nil { - res = make([]acl.EACLRecord_Target, 0, len(ts)) + res = make([]*acl.EACLRecord_Target, 0, len(ts)) for i := range ts { - res = append(res, *ts[i].ToGRPCMessage().(*acl.EACLRecord_Target)) + res = append(res, ts[i].ToGRPCMessage().(*acl.EACLRecord_Target)) } } return } -func TargetsFromGRPC(fs []acl.EACLRecord_Target) (res []Target, err error) { +func TargetsFromGRPC(fs []*acl.EACLRecord_Target) (res []Target, err error) { if fs != nil { res = make([]Target, len(fs)) for i := range fs { - err = res[i].FromGRPCMessage(&fs[i]) + err = res[i].FromGRPCMessage(fs[i]) if err != nil { return } @@ -305,24 +305,24 @@ func (r *Record) FromGRPCMessage(m grpc.Message) error { return nil } -func RecordsToGRPC(ts []Record) (res []acl.EACLRecord) { +func RecordsToGRPC(ts []Record) (res []*acl.EACLRecord) { if ts != nil { - res = make([]acl.EACLRecord, 0, len(ts)) + res = make([]*acl.EACLRecord, 0, len(ts)) for i := range ts { - res = append(res, *ts[i].ToGRPCMessage().(*acl.EACLRecord)) + res = append(res, ts[i].ToGRPCMessage().(*acl.EACLRecord)) } } return } -func RecordsFromGRPC(fs []acl.EACLRecord) (res []Record, err error) { +func RecordsFromGRPC(fs []*acl.EACLRecord) (res []Record, err error) { if fs != nil { res = make([]Record, len(fs)) for i := range fs { - err = res[i].FromGRPCMessage(&fs[i]) + err = res[i].FromGRPCMessage(fs[i]) if err != nil { return } @@ -423,9 +423,9 @@ func (c *APEOverride) ToGRPCMessage() grpc.Message { m.SetTarget(c.target.ToGRPCMessage().(*apeGRPC.ChainTarget)) if len(c.chains) > 0 { - apeChains := make([]apeGRPC.Chain, len(c.chains)) + apeChains := make([]*apeGRPC.Chain, len(c.chains)) for i := range c.chains { - apeChains[i] = *c.chains[i].ToGRPCMessage().(*apeGRPC.Chain) + apeChains[i] = c.chains[i].ToGRPCMessage().(*apeGRPC.Chain) } m.SetChains(apeChains) } @@ -453,7 +453,7 @@ func (c *APEOverride) FromGRPCMessage(m grpc.Message) error { c.chains = make([]*ape.Chain, len(apeChains)) for i := range apeChains { c.chains[i] = new(ape.Chain) - if err := c.chains[i].FromGRPCMessage(&apeChains[i]); err != nil { + if err := c.chains[i].FromGRPCMessage(apeChains[i]); err != nil { return err } } diff --git a/api/acl/grpc/types.pb.go b/api/acl/grpc/types.pb.go new file mode 100644 index 0000000..93fd047 --- /dev/null +++ b/api/acl/grpc/types.pb.go @@ -0,0 +1,1534 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/acl/grpc/types.proto + +//go:build !protoopaque + +package acl + +import ( + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 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_api_acl_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (Role) Type() protoreflect.EnumType { + return &file_api_acl_grpc_types_proto_enumTypes[0] +} + +func (x Role) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// 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_api_acl_grpc_types_proto_enumTypes[1].Descriptor() +} + +func (MatchType) Type() protoreflect.EnumType { + return &file_api_acl_grpc_types_proto_enumTypes[1] +} + +func (x MatchType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// 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_api_acl_grpc_types_proto_enumTypes[2].Descriptor() +} + +func (Operation) Type() protoreflect.EnumType { + return &file_api_acl_grpc_types_proto_enumTypes[2] +} + +func (x Operation) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// 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_api_acl_grpc_types_proto_enumTypes[3].Descriptor() +} + +func (Action) Type() protoreflect.EnumType { + return &file_api_acl_grpc_types_proto_enumTypes[3] +} + +func (x Action) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// 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 FrostFS 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_api_acl_grpc_types_proto_enumTypes[4].Descriptor() +} + +func (HeaderType) Type() protoreflect.EnumType { + return &file_api_acl_grpc_types_proto_enumTypes[4] +} + +func (x HeaderType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Describes a single eACL rule. +type EACLRecord struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // FrostFS request Verb to match + Operation *Operation `protobuf:"varint,1,opt,name=operation,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,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" json:"filters,omitempty"` + // List of target subjects to apply ACL rule to + Targets []*EACLRecord_Target `protobuf:"bytes,4,rep,name=targets" json:"targets,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EACLRecord) Reset() { + *x = EACLRecord{} + mi := &file_api_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_api_acl_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *EACLRecord) GetOperation() Operation { + if x != nil && x.Operation != nil { + return *x.Operation + } + return Operation_OPERATION_UNSPECIFIED +} + +func (x *EACLRecord) GetAction() Action { + if x != nil && x.Action != 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 +} + +func (x *EACLRecord) SetOperation(v Operation) { + x.Operation = &v +} + +func (x *EACLRecord) SetAction(v Action) { + x.Action = &v +} + +func (x *EACLRecord) SetFilters(v []*EACLRecord_Filter) { + x.Filters = v +} + +func (x *EACLRecord) SetTargets(v []*EACLRecord_Target) { + x.Targets = v +} + +func (x *EACLRecord) HasOperation() bool { + if x == nil { + return false + } + return x.Operation != nil +} + +func (x *EACLRecord) HasAction() bool { + if x == nil { + return false + } + return x.Action != nil +} + +func (x *EACLRecord) ClearOperation() { + x.Operation = nil +} + +func (x *EACLRecord) ClearAction() { + x.Action = nil +} + +type EACLRecord_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // FrostFS request Verb to match + Operation *Operation + // Rule execution result. Either allows or denies access if filters match. + Action *Action + // List of filters to match and see if rule is applicable + Filters []*EACLRecord_Filter + // List of target subjects to apply ACL rule to + Targets []*EACLRecord_Target +} + +func (b0 EACLRecord_builder) Build() *EACLRecord { + m0 := &EACLRecord{} + b, x := &b0, m0 + _, _ = b, x + x.Operation = b.Operation + x.Action = b.Action + x.Filters = b.Filters + x.Targets = b.Targets + return m0 +} + +// 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 +// FrostFS Technical Specification section for detailed description. +type EACLTable struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // eACL format version. Effectively, the version of API library used to create + // eACL Table. + Version *grpc.Version `protobuf:"bytes,1,opt,name=version" 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" json:"container_id,omitempty"` + // List of Extended ACL rules + Records []*EACLRecord `protobuf:"bytes,3,rep,name=records" json:"records,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EACLTable) Reset() { + *x = EACLTable{} + mi := &file_api_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_api_acl_grpc_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *EACLTable) SetVersion(v *grpc.Version) { + x.Version = v +} + +func (x *EACLTable) SetContainerId(v *grpc.ContainerID) { + x.ContainerId = v +} + +func (x *EACLTable) SetRecords(v []*EACLRecord) { + x.Records = v +} + +func (x *EACLTable) HasVersion() bool { + if x == nil { + return false + } + return x.Version != nil +} + +func (x *EACLTable) HasContainerId() bool { + if x == nil { + return false + } + return x.ContainerId != nil +} + +func (x *EACLTable) ClearVersion() { + x.Version = nil +} + +func (x *EACLTable) ClearContainerId() { + x.ContainerId = nil +} + +type EACLTable_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // eACL format version. Effectively, the version of API library used to create + // eACL Table. + Version *grpc.Version + // Identifier of the container that should use given access control rules + ContainerId *grpc.ContainerID + // List of Extended ACL rules + Records []*EACLRecord +} + +func (b0 EACLTable_builder) Build() *EACLTable { + m0 := &EACLTable{} + b, x := &b0, m0 + _, _ = b, x + x.Version = b.Version + x.ContainerId = b.ContainerId + x.Records = b.Records + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // Bearer Token body + Body *BearerToken_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Signature of BearerToken body + Signature *grpc.Signature `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BearerToken) Reset() { + *x = BearerToken{} + mi := &file_api_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_api_acl_grpc_types_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *BearerToken) SetBody(v *BearerToken_Body) { + x.Body = v +} + +func (x *BearerToken) SetSignature(v *grpc.Signature) { + x.Signature = v +} + +func (x *BearerToken) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *BearerToken) HasSignature() bool { + if x == nil { + return false + } + return x.Signature != nil +} + +func (x *BearerToken) ClearBody() { + x.Body = nil +} + +func (x *BearerToken) ClearSignature() { + x.Signature = nil +} + +type BearerToken_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Bearer Token body + Body *BearerToken_Body + // Signature of BearerToken body + Signature *grpc.Signature +} + +func (b0 BearerToken_builder) Build() *BearerToken { + m0 := &BearerToken{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.Signature = b.Signature + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // Define if Object or Request header will be used + HeaderType *HeaderType `protobuf:"varint,1,opt,name=header_type,json=headerType,enum=neo.fs.v2.acl.HeaderType" json:"header_type,omitempty"` + // Match operation type + MatchType *MatchType `protobuf:"varint,2,opt,name=match_type,json=matchType,enum=neo.fs.v2.acl.MatchType" json:"match_type,omitempty"` + // Name of the Header to use + Key *string `protobuf:"bytes,3,opt,name=key" json:"key,omitempty"` + // Expected Header Value or pattern to match + Value *string `protobuf:"bytes,4,opt,name=value" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EACLRecord_Filter) Reset() { + *x = EACLRecord_Filter{} + mi := &file_api_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_api_acl_grpc_types_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *EACLRecord_Filter) GetHeaderType() HeaderType { + if x != nil && x.HeaderType != nil { + return *x.HeaderType + } + return HeaderType_HEADER_UNSPECIFIED +} + +func (x *EACLRecord_Filter) GetMatchType() MatchType { + if x != nil && x.MatchType != nil { + return *x.MatchType + } + return MatchType_MATCH_TYPE_UNSPECIFIED +} + +func (x *EACLRecord_Filter) GetKey() string { + if x != nil && x.Key != nil { + return *x.Key + } + return "" +} + +func (x *EACLRecord_Filter) GetValue() string { + if x != nil && x.Value != nil { + return *x.Value + } + return "" +} + +func (x *EACLRecord_Filter) SetHeaderType(v HeaderType) { + x.HeaderType = &v +} + +func (x *EACLRecord_Filter) SetMatchType(v MatchType) { + x.MatchType = &v +} + +func (x *EACLRecord_Filter) SetKey(v string) { + x.Key = &v +} + +func (x *EACLRecord_Filter) SetValue(v string) { + x.Value = &v +} + +func (x *EACLRecord_Filter) HasHeaderType() bool { + if x == nil { + return false + } + return x.HeaderType != nil +} + +func (x *EACLRecord_Filter) HasMatchType() bool { + if x == nil { + return false + } + return x.MatchType != nil +} + +func (x *EACLRecord_Filter) HasKey() bool { + if x == nil { + return false + } + return x.Key != nil +} + +func (x *EACLRecord_Filter) HasValue() bool { + if x == nil { + return false + } + return x.Value != nil +} + +func (x *EACLRecord_Filter) ClearHeaderType() { + x.HeaderType = nil +} + +func (x *EACLRecord_Filter) ClearMatchType() { + x.MatchType = nil +} + +func (x *EACLRecord_Filter) ClearKey() { + x.Key = nil +} + +func (x *EACLRecord_Filter) ClearValue() { + x.Value = nil +} + +type EACLRecord_Filter_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Define if Object or Request header will be used + HeaderType *HeaderType + // Match operation type + MatchType *MatchType + // Name of the Header to use + Key *string + // Expected Header Value or pattern to match + Value *string +} + +func (b0 EACLRecord_Filter_builder) Build() *EACLRecord_Filter { + m0 := &EACLRecord_Filter{} + b, x := &b0, m0 + _, _ = b, x + x.HeaderType = b.HeaderType + x.MatchType = b.MatchType + x.Key = b.Key + x.Value = b.Value + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // Target subject's role class + Role *Role `protobuf:"varint,1,opt,name=role,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" json:"keys,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EACLRecord_Target) Reset() { + *x = EACLRecord_Target{} + mi := &file_api_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_api_acl_grpc_types_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *EACLRecord_Target) GetRole() Role { + if x != nil && x.Role != nil { + return *x.Role + } + return Role_ROLE_UNSPECIFIED +} + +func (x *EACLRecord_Target) GetKeys() [][]byte { + if x != nil { + return x.Keys + } + return nil +} + +func (x *EACLRecord_Target) SetRole(v Role) { + x.Role = &v +} + +func (x *EACLRecord_Target) SetKeys(v [][]byte) { + x.Keys = v +} + +func (x *EACLRecord_Target) HasRole() bool { + if x == nil { + return false + } + return x.Role != nil +} + +func (x *EACLRecord_Target) ClearRole() { + x.Role = nil +} + +type EACLRecord_Target_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Target subject's role class + Role *Role + // List of public keys to identify target subject + Keys [][]byte +} + +func (b0 EACLRecord_Target_builder) Build() *EACLRecord_Target { + m0 := &EACLRecord_Target{} + b, x := &b0, m0 + _, _ = b, x + x.Role = b.Role + x.Keys = b.Keys + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // 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" 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" json:"owner_id,omitempty"` + // Token expiration and valid time period parameters + Lifetime *BearerToken_Body_TokenLifetime `protobuf:"bytes,3,opt,name=lifetime" 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" json:"allow_impersonate,omitempty"` + // APE override for the target. + ApeOverride *BearerToken_Body_APEOverride `protobuf:"bytes,5,opt,name=ape_override,json=apeOverride" json:"ape_override,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BearerToken_Body) Reset() { + *x = BearerToken_Body{} + mi := &file_api_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_api_acl_grpc_types_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 && x.AllowImpersonate != nil { + return *x.AllowImpersonate + } + return false +} + +func (x *BearerToken_Body) GetApeOverride() *BearerToken_Body_APEOverride { + if x != nil { + return x.ApeOverride + } + return nil +} + +func (x *BearerToken_Body) SetEaclTable(v *EACLTable) { + x.EaclTable = v +} + +func (x *BearerToken_Body) SetOwnerId(v *grpc.OwnerID) { + x.OwnerId = v +} + +func (x *BearerToken_Body) SetLifetime(v *BearerToken_Body_TokenLifetime) { + x.Lifetime = v +} + +func (x *BearerToken_Body) SetAllowImpersonate(v bool) { + x.AllowImpersonate = &v +} + +func (x *BearerToken_Body) SetApeOverride(v *BearerToken_Body_APEOverride) { + x.ApeOverride = v +} + +func (x *BearerToken_Body) HasEaclTable() bool { + if x == nil { + return false + } + return x.EaclTable != nil +} + +func (x *BearerToken_Body) HasOwnerId() bool { + if x == nil { + return false + } + return x.OwnerId != nil +} + +func (x *BearerToken_Body) HasLifetime() bool { + if x == nil { + return false + } + return x.Lifetime != nil +} + +func (x *BearerToken_Body) HasAllowImpersonate() bool { + if x == nil { + return false + } + return x.AllowImpersonate != nil +} + +func (x *BearerToken_Body) HasApeOverride() bool { + if x == nil { + return false + } + return x.ApeOverride != nil +} + +func (x *BearerToken_Body) ClearEaclTable() { + x.EaclTable = nil +} + +func (x *BearerToken_Body) ClearOwnerId() { + x.OwnerId = nil +} + +func (x *BearerToken_Body) ClearLifetime() { + x.Lifetime = nil +} + +func (x *BearerToken_Body) ClearAllowImpersonate() { + x.AllowImpersonate = nil +} + +func (x *BearerToken_Body) ClearApeOverride() { + x.ApeOverride = nil +} + +type BearerToken_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // 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 + // `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 + // Token expiration and valid time period parameters + Lifetime *BearerToken_Body_TokenLifetime + // 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 + // APE override for the target. + ApeOverride *BearerToken_Body_APEOverride +} + +func (b0 BearerToken_Body_builder) Build() *BearerToken_Body { + m0 := &BearerToken_Body{} + b, x := &b0, m0 + _, _ = b, x + x.EaclTable = b.EaclTable + x.OwnerId = b.OwnerId + x.Lifetime = b.Lifetime + x.AllowImpersonate = b.AllowImpersonate + x.ApeOverride = b.ApeOverride + return m0 +} + +// Lifetime parameters of the token. Field names taken from +// [rfc7519](https://tools.ietf.org/html/rfc7519). +type BearerToken_Body_TokenLifetime struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Expiration Epoch + Exp *uint64 `protobuf:"varint,1,opt,name=exp" json:"exp,omitempty"` + // Not valid before Epoch + Nbf *uint64 `protobuf:"varint,2,opt,name=nbf" json:"nbf,omitempty"` + // Issued at Epoch + Iat *uint64 `protobuf:"varint,3,opt,name=iat" json:"iat,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BearerToken_Body_TokenLifetime) Reset() { + *x = BearerToken_Body_TokenLifetime{} + mi := &file_api_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_api_acl_grpc_types_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *BearerToken_Body_TokenLifetime) GetExp() uint64 { + if x != nil && x.Exp != nil { + return *x.Exp + } + return 0 +} + +func (x *BearerToken_Body_TokenLifetime) GetNbf() uint64 { + if x != nil && x.Nbf != nil { + return *x.Nbf + } + return 0 +} + +func (x *BearerToken_Body_TokenLifetime) GetIat() uint64 { + if x != nil && x.Iat != nil { + return *x.Iat + } + return 0 +} + +func (x *BearerToken_Body_TokenLifetime) SetExp(v uint64) { + x.Exp = &v +} + +func (x *BearerToken_Body_TokenLifetime) SetNbf(v uint64) { + x.Nbf = &v +} + +func (x *BearerToken_Body_TokenLifetime) SetIat(v uint64) { + x.Iat = &v +} + +func (x *BearerToken_Body_TokenLifetime) HasExp() bool { + if x == nil { + return false + } + return x.Exp != nil +} + +func (x *BearerToken_Body_TokenLifetime) HasNbf() bool { + if x == nil { + return false + } + return x.Nbf != nil +} + +func (x *BearerToken_Body_TokenLifetime) HasIat() bool { + if x == nil { + return false + } + return x.Iat != nil +} + +func (x *BearerToken_Body_TokenLifetime) ClearExp() { + x.Exp = nil +} + +func (x *BearerToken_Body_TokenLifetime) ClearNbf() { + x.Nbf = nil +} + +func (x *BearerToken_Body_TokenLifetime) ClearIat() { + x.Iat = nil +} + +type BearerToken_Body_TokenLifetime_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Expiration Epoch + Exp *uint64 + // Not valid before Epoch + Nbf *uint64 + // Issued at Epoch + Iat *uint64 +} + +func (b0 BearerToken_Body_TokenLifetime_builder) Build() *BearerToken_Body_TokenLifetime { + m0 := &BearerToken_Body_TokenLifetime{} + b, x := &b0, m0 + _, _ = b, x + x.Exp = b.Exp + x.Nbf = b.Nbf + x.Iat = b.Iat + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // Target for which chains are applied. + Target *grpc1.ChainTarget `protobuf:"bytes,1,opt,name=target" json:"target,omitempty"` + // The list of APE chains. + Chains []*grpc1.Chain `protobuf:"bytes,2,rep,name=chains" json:"chains,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BearerToken_Body_APEOverride) Reset() { + *x = BearerToken_Body_APEOverride{} + mi := &file_api_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_api_acl_grpc_types_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *BearerToken_Body_APEOverride) SetTarget(v *grpc1.ChainTarget) { + x.Target = v +} + +func (x *BearerToken_Body_APEOverride) SetChains(v []*grpc1.Chain) { + x.Chains = v +} + +func (x *BearerToken_Body_APEOverride) HasTarget() bool { + if x == nil { + return false + } + return x.Target != nil +} + +func (x *BearerToken_Body_APEOverride) ClearTarget() { + x.Target = nil +} + +type BearerToken_Body_APEOverride_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Target for which chains are applied. + Target *grpc1.ChainTarget + // The list of APE chains. + Chains []*grpc1.Chain +} + +func (b0 BearerToken_Body_APEOverride_builder) Build() *BearerToken_Body_APEOverride { + m0 := &BearerToken_Body_APEOverride{} + b, x := &b0, m0 + _, _ = b, x + x.Target = b.Target + x.Chains = b.Chains + return m0 +} + +var File_api_acl_grpc_types_proto protoreflect.FileDescriptor + +var file_api_acl_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x61, 0x70, 0x69, 0x2f, 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, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x72, + 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x70, 0x65, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 0x59, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x2e, 0x66, + 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, + 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, + 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_acl_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 5) +var file_api_acl_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_api_acl_grpc_types_proto_goTypes = []any{ + (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_api_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_api_acl_grpc_types_proto_init() } +func file_api_acl_grpc_types_proto_init() { + if File_api_acl_grpc_types_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_acl_grpc_types_proto_rawDesc, + NumEnums: 5, + NumMessages: 8, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_acl_grpc_types_proto_goTypes, + DependencyIndexes: file_api_acl_grpc_types_proto_depIdxs, + EnumInfos: file_api_acl_grpc_types_proto_enumTypes, + MessageInfos: file_api_acl_grpc_types_proto_msgTypes, + }.Build() + File_api_acl_grpc_types_proto = out.File + file_api_acl_grpc_types_proto_rawDesc = nil + file_api_acl_grpc_types_proto_goTypes = nil + file_api_acl_grpc_types_proto_depIdxs = nil +} diff --git a/api/acl/grpc/types_frostfs.pb.go b/api/acl/grpc/types_frostfs.pb.go deleted file mode 100644 index eed28d6..0000000 --- a/api/acl/grpc/types_frostfs.pb.go +++ /dev/null @@ -1,2184 +0,0 @@ -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package acl - -import ( - json "encoding/json" - fmt "fmt" - grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape/grpc" - grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" - pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" - proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" - encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" - easyproto "github.com/VictoriaMetrics/easyproto" - jlexer "github.com/mailru/easyjson/jlexer" - jwriter "github.com/mailru/easyjson/jwriter" - strconv "strconv" -) - -type 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 - } - first := true - out.RawByte('{') - { - 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 = "\"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 = "\"key\":" - out.RawString(prefix) - out.String(x.Key) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"value\":" - out.RawString(prefix) - out.String(x.Value) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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 - } - first := true - out.RawByte('{') - { - 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 = "\"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('}') -} - -// 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(']') { - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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.NestedStructureSizeUnchecked(3, &x.Filters[i]) - } - for i := range x.Targets { - size += proto.NestedStructureSizeUnchecked(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 { - x.Filters[i].EmitProtobuf(mm.AppendMessage(3)) - } - for i := range x.Targets { - 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, 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, 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 - } - first := true - out.RawByte('{') - { - 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 = "\"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 = "\"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 = "\"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 = 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 = 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.NestedStructureSizeUnchecked(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.EmitProtobuf(mm.AppendMessage(1)) - } - if x.ContainerId != nil { - x.ContainerId.EmitProtobuf(mm.AppendMessage(2)) - } - for i := range x.Records { - 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, 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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"version\":" - out.RawString(prefix) - x.Version.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"containerID\":" - out.RawString(prefix) - x.ContainerId.MarshalEasyJSON(out) - } - { - 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('}') -} - -// 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 = 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 - } - first := true - 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 !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 = "\"iat\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Iat, 10) - out.RawByte('"') - } - 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 - 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 - 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 - 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 - } - } - 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.NestedStructureSizeUnchecked(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.EmitProtobuf(mm.AppendMessage(1)) - } - for i := range x.Chains { - 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, 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 - } - first := true - out.RawByte('{') - { - 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 = "\"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 = 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.EmitProtobuf(mm.AppendMessage(1)) - } - if x.OwnerId != nil { - x.OwnerId.EmitProtobuf(mm.AppendMessage(2)) - } - if x.Lifetime != nil { - x.Lifetime.EmitProtobuf(mm.AppendMessage(3)) - } - if x.AllowImpersonate { - mm.AppendBool(4, x.AllowImpersonate) - } - if x.ApeOverride != nil { - 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 - } - first := true - out.RawByte('{') - { - 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 = "\"ownerID\":" - out.RawString(prefix) - x.OwnerId.MarshalEasyJSON(out) - } - { - 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 = "\"allowImpersonate\":" - out.RawString(prefix) - out.Bool(x.AllowImpersonate) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - 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.EmitProtobuf(mm.AppendMessage(1)) - } - if x.Signature != nil { - 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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"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/api/acl/grpc/types_frostfs_fuzz.go b/api/acl/grpc/types_frostfs_fuzz.go deleted file mode 100644 index 5d5b763..0000000 --- a/api/acl/grpc/types_frostfs_fuzz.go +++ /dev/null @@ -1,64 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package acl - -func DoFuzzProtoEACLRecord(data []byte) int { - msg := new(EACLRecord) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONEACLRecord(data []byte) int { - msg := new(EACLRecord) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoEACLTable(data []byte) int { - msg := new(EACLTable) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONEACLTable(data []byte) int { - msg := new(EACLTable) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoBearerToken(data []byte) int { - msg := new(BearerToken) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONBearerToken(data []byte) int { - msg := new(BearerToken) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} diff --git a/api/acl/grpc/types_frostfs_test.go b/api/acl/grpc/types_frostfs_test.go deleted file mode 100644 index c6d1c43..0000000 --- a/api/acl/grpc/types_frostfs_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package acl - -import ( - testing "testing" -) - -func FuzzProtoEACLRecord(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoEACLRecord(data) - }) -} -func FuzzJSONEACLRecord(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONEACLRecord(data) - }) -} -func FuzzProtoEACLTable(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoEACLTable(data) - }) -} -func FuzzJSONEACLTable(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONEACLTable(data) - }) -} -func FuzzProtoBearerToken(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoBearerToken(data) - }) -} -func FuzzJSONBearerToken(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONBearerToken(data) - }) -} diff --git a/api/acl/grpc/types_protoopaque.pb.go b/api/acl/grpc/types_protoopaque.pb.go new file mode 100644 index 0000000..a0001bf --- /dev/null +++ b/api/acl/grpc/types_protoopaque.pb.go @@ -0,0 +1,1589 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/acl/grpc/types.proto + +//go:build protoopaque + +package acl + +import ( + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 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_api_acl_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (Role) Type() protoreflect.EnumType { + return &file_api_acl_grpc_types_proto_enumTypes[0] +} + +func (x Role) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// 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_api_acl_grpc_types_proto_enumTypes[1].Descriptor() +} + +func (MatchType) Type() protoreflect.EnumType { + return &file_api_acl_grpc_types_proto_enumTypes[1] +} + +func (x MatchType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// 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_api_acl_grpc_types_proto_enumTypes[2].Descriptor() +} + +func (Operation) Type() protoreflect.EnumType { + return &file_api_acl_grpc_types_proto_enumTypes[2] +} + +func (x Operation) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// 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_api_acl_grpc_types_proto_enumTypes[3].Descriptor() +} + +func (Action) Type() protoreflect.EnumType { + return &file_api_acl_grpc_types_proto_enumTypes[3] +} + +func (x Action) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// 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 FrostFS 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_api_acl_grpc_types_proto_enumTypes[4].Descriptor() +} + +func (HeaderType) Type() protoreflect.EnumType { + return &file_api_acl_grpc_types_proto_enumTypes[4] +} + +func (x HeaderType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Describes a single eACL rule. +type EACLRecord struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Operation Operation `protobuf:"varint,1,opt,name=operation,enum=neo.fs.v2.acl.Operation" json:"operation,omitempty"` + xxx_hidden_Action Action `protobuf:"varint,2,opt,name=action,enum=neo.fs.v2.acl.Action" json:"action,omitempty"` + xxx_hidden_Filters *[]*EACLRecord_Filter `protobuf:"bytes,3,rep,name=filters" json:"filters,omitempty"` + xxx_hidden_Targets *[]*EACLRecord_Target `protobuf:"bytes,4,rep,name=targets" json:"targets,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EACLRecord) Reset() { + *x = EACLRecord{} + mi := &file_api_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_api_acl_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *EACLRecord) GetOperation() Operation { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 0) { + return x.xxx_hidden_Operation + } + } + return Operation_OPERATION_UNSPECIFIED +} + +func (x *EACLRecord) GetAction() Action { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 1) { + return x.xxx_hidden_Action + } + } + return Action_ACTION_UNSPECIFIED +} + +func (x *EACLRecord) GetFilters() []*EACLRecord_Filter { + if x != nil { + if x.xxx_hidden_Filters != nil { + return *x.xxx_hidden_Filters + } + } + return nil +} + +func (x *EACLRecord) GetTargets() []*EACLRecord_Target { + if x != nil { + if x.xxx_hidden_Targets != nil { + return *x.xxx_hidden_Targets + } + } + return nil +} + +func (x *EACLRecord) SetOperation(v Operation) { + x.xxx_hidden_Operation = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 4) +} + +func (x *EACLRecord) SetAction(v Action) { + x.xxx_hidden_Action = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 4) +} + +func (x *EACLRecord) SetFilters(v []*EACLRecord_Filter) { + x.xxx_hidden_Filters = &v +} + +func (x *EACLRecord) SetTargets(v []*EACLRecord_Target) { + x.xxx_hidden_Targets = &v +} + +func (x *EACLRecord) HasOperation() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *EACLRecord) HasAction() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *EACLRecord) ClearOperation() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Operation = Operation_OPERATION_UNSPECIFIED +} + +func (x *EACLRecord) ClearAction() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Action = Action_ACTION_UNSPECIFIED +} + +type EACLRecord_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // FrostFS request Verb to match + Operation *Operation + // Rule execution result. Either allows or denies access if filters match. + Action *Action + // List of filters to match and see if rule is applicable + Filters []*EACLRecord_Filter + // List of target subjects to apply ACL rule to + Targets []*EACLRecord_Target +} + +func (b0 EACLRecord_builder) Build() *EACLRecord { + m0 := &EACLRecord{} + b, x := &b0, m0 + _, _ = b, x + if b.Operation != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 4) + x.xxx_hidden_Operation = *b.Operation + } + if b.Action != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 4) + x.xxx_hidden_Action = *b.Action + } + x.xxx_hidden_Filters = &b.Filters + x.xxx_hidden_Targets = &b.Targets + return m0 +} + +// 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 +// FrostFS Technical Specification section for detailed description. +type EACLTable struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Version *grpc.Version `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"` + xxx_hidden_ContainerId *grpc.ContainerID `protobuf:"bytes,2,opt,name=container_id,json=containerID" json:"container_id,omitempty"` + xxx_hidden_Records *[]*EACLRecord `protobuf:"bytes,3,rep,name=records" json:"records,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EACLTable) Reset() { + *x = EACLTable{} + mi := &file_api_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_api_acl_grpc_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *EACLTable) GetVersion() *grpc.Version { + if x != nil { + return x.xxx_hidden_Version + } + return nil +} + +func (x *EACLTable) GetContainerId() *grpc.ContainerID { + if x != nil { + return x.xxx_hidden_ContainerId + } + return nil +} + +func (x *EACLTable) GetRecords() []*EACLRecord { + if x != nil { + if x.xxx_hidden_Records != nil { + return *x.xxx_hidden_Records + } + } + return nil +} + +func (x *EACLTable) SetVersion(v *grpc.Version) { + x.xxx_hidden_Version = v +} + +func (x *EACLTable) SetContainerId(v *grpc.ContainerID) { + x.xxx_hidden_ContainerId = v +} + +func (x *EACLTable) SetRecords(v []*EACLRecord) { + x.xxx_hidden_Records = &v +} + +func (x *EACLTable) HasVersion() bool { + if x == nil { + return false + } + return x.xxx_hidden_Version != nil +} + +func (x *EACLTable) HasContainerId() bool { + if x == nil { + return false + } + return x.xxx_hidden_ContainerId != nil +} + +func (x *EACLTable) ClearVersion() { + x.xxx_hidden_Version = nil +} + +func (x *EACLTable) ClearContainerId() { + x.xxx_hidden_ContainerId = nil +} + +type EACLTable_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // eACL format version. Effectively, the version of API library used to create + // eACL Table. + Version *grpc.Version + // Identifier of the container that should use given access control rules + ContainerId *grpc.ContainerID + // List of Extended ACL rules + Records []*EACLRecord +} + +func (b0 EACLTable_builder) Build() *EACLTable { + m0 := &EACLTable{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Version = b.Version + x.xxx_hidden_ContainerId = b.ContainerId + x.xxx_hidden_Records = &b.Records + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_Body *BearerToken_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_Signature *grpc.Signature `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BearerToken) Reset() { + *x = BearerToken{} + mi := &file_api_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_api_acl_grpc_types_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *BearerToken) GetBody() *BearerToken_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *BearerToken) GetSignature() *grpc.Signature { + if x != nil { + return x.xxx_hidden_Signature + } + return nil +} + +func (x *BearerToken) SetBody(v *BearerToken_Body) { + x.xxx_hidden_Body = v +} + +func (x *BearerToken) SetSignature(v *grpc.Signature) { + x.xxx_hidden_Signature = v +} + +func (x *BearerToken) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *BearerToken) HasSignature() bool { + if x == nil { + return false + } + return x.xxx_hidden_Signature != nil +} + +func (x *BearerToken) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *BearerToken) ClearSignature() { + x.xxx_hidden_Signature = nil +} + +type BearerToken_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Bearer Token body + Body *BearerToken_Body + // Signature of BearerToken body + Signature *grpc.Signature +} + +func (b0 BearerToken_builder) Build() *BearerToken { + m0 := &BearerToken{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_Signature = b.Signature + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_HeaderType HeaderType `protobuf:"varint,1,opt,name=header_type,json=headerType,enum=neo.fs.v2.acl.HeaderType" json:"header_type,omitempty"` + xxx_hidden_MatchType MatchType `protobuf:"varint,2,opt,name=match_type,json=matchType,enum=neo.fs.v2.acl.MatchType" json:"match_type,omitempty"` + xxx_hidden_Key *string `protobuf:"bytes,3,opt,name=key" json:"key,omitempty"` + xxx_hidden_Value *string `protobuf:"bytes,4,opt,name=value" json:"value,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EACLRecord_Filter) Reset() { + *x = EACLRecord_Filter{} + mi := &file_api_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_api_acl_grpc_types_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *EACLRecord_Filter) GetHeaderType() HeaderType { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 0) { + return x.xxx_hidden_HeaderType + } + } + return HeaderType_HEADER_UNSPECIFIED +} + +func (x *EACLRecord_Filter) GetMatchType() MatchType { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 1) { + return x.xxx_hidden_MatchType + } + } + return MatchType_MATCH_TYPE_UNSPECIFIED +} + +func (x *EACLRecord_Filter) GetKey() string { + if x != nil { + if x.xxx_hidden_Key != nil { + return *x.xxx_hidden_Key + } + return "" + } + return "" +} + +func (x *EACLRecord_Filter) GetValue() string { + if x != nil { + if x.xxx_hidden_Value != nil { + return *x.xxx_hidden_Value + } + return "" + } + return "" +} + +func (x *EACLRecord_Filter) SetHeaderType(v HeaderType) { + x.xxx_hidden_HeaderType = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 4) +} + +func (x *EACLRecord_Filter) SetMatchType(v MatchType) { + x.xxx_hidden_MatchType = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 4) +} + +func (x *EACLRecord_Filter) SetKey(v string) { + x.xxx_hidden_Key = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 4) +} + +func (x *EACLRecord_Filter) SetValue(v string) { + x.xxx_hidden_Value = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 4) +} + +func (x *EACLRecord_Filter) HasHeaderType() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *EACLRecord_Filter) HasMatchType() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *EACLRecord_Filter) HasKey() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *EACLRecord_Filter) HasValue() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *EACLRecord_Filter) ClearHeaderType() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_HeaderType = HeaderType_HEADER_UNSPECIFIED +} + +func (x *EACLRecord_Filter) ClearMatchType() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_MatchType = MatchType_MATCH_TYPE_UNSPECIFIED +} + +func (x *EACLRecord_Filter) ClearKey() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Key = nil +} + +func (x *EACLRecord_Filter) ClearValue() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_Value = nil +} + +type EACLRecord_Filter_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Define if Object or Request header will be used + HeaderType *HeaderType + // Match operation type + MatchType *MatchType + // Name of the Header to use + Key *string + // Expected Header Value or pattern to match + Value *string +} + +func (b0 EACLRecord_Filter_builder) Build() *EACLRecord_Filter { + m0 := &EACLRecord_Filter{} + b, x := &b0, m0 + _, _ = b, x + if b.HeaderType != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 4) + x.xxx_hidden_HeaderType = *b.HeaderType + } + if b.MatchType != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 4) + x.xxx_hidden_MatchType = *b.MatchType + } + if b.Key != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 4) + x.xxx_hidden_Key = b.Key + } + if b.Value != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 4) + x.xxx_hidden_Value = b.Value + } + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_Role Role `protobuf:"varint,1,opt,name=role,enum=neo.fs.v2.acl.Role" json:"role,omitempty"` + xxx_hidden_Keys [][]byte `protobuf:"bytes,2,rep,name=keys" json:"keys,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EACLRecord_Target) Reset() { + *x = EACLRecord_Target{} + mi := &file_api_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_api_acl_grpc_types_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *EACLRecord_Target) GetRole() Role { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 0) { + return x.xxx_hidden_Role + } + } + return Role_ROLE_UNSPECIFIED +} + +func (x *EACLRecord_Target) GetKeys() [][]byte { + if x != nil { + return x.xxx_hidden_Keys + } + return nil +} + +func (x *EACLRecord_Target) SetRole(v Role) { + x.xxx_hidden_Role = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2) +} + +func (x *EACLRecord_Target) SetKeys(v [][]byte) { + x.xxx_hidden_Keys = v +} + +func (x *EACLRecord_Target) HasRole() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *EACLRecord_Target) ClearRole() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Role = Role_ROLE_UNSPECIFIED +} + +type EACLRecord_Target_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Target subject's role class + Role *Role + // List of public keys to identify target subject + Keys [][]byte +} + +func (b0 EACLRecord_Target_builder) Build() *EACLRecord_Target { + m0 := &EACLRecord_Target{} + b, x := &b0, m0 + _, _ = b, x + if b.Role != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2) + x.xxx_hidden_Role = *b.Role + } + x.xxx_hidden_Keys = b.Keys + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_EaclTable *EACLTable `protobuf:"bytes,1,opt,name=eacl_table,json=eaclTable" json:"eacl_table,omitempty"` + xxx_hidden_OwnerId *grpc.OwnerID `protobuf:"bytes,2,opt,name=owner_id,json=ownerID" json:"owner_id,omitempty"` + xxx_hidden_Lifetime *BearerToken_Body_TokenLifetime `protobuf:"bytes,3,opt,name=lifetime" json:"lifetime,omitempty"` + xxx_hidden_AllowImpersonate bool `protobuf:"varint,4,opt,name=allow_impersonate,json=allowImpersonate" json:"allow_impersonate,omitempty"` + xxx_hidden_ApeOverride *BearerToken_Body_APEOverride `protobuf:"bytes,5,opt,name=ape_override,json=apeOverride" json:"ape_override,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BearerToken_Body) Reset() { + *x = BearerToken_Body{} + mi := &file_api_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_api_acl_grpc_types_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *BearerToken_Body) GetEaclTable() *EACLTable { + if x != nil { + return x.xxx_hidden_EaclTable + } + return nil +} + +func (x *BearerToken_Body) GetOwnerId() *grpc.OwnerID { + if x != nil { + return x.xxx_hidden_OwnerId + } + return nil +} + +func (x *BearerToken_Body) GetLifetime() *BearerToken_Body_TokenLifetime { + if x != nil { + return x.xxx_hidden_Lifetime + } + return nil +} + +func (x *BearerToken_Body) GetAllowImpersonate() bool { + if x != nil { + return x.xxx_hidden_AllowImpersonate + } + return false +} + +func (x *BearerToken_Body) GetApeOverride() *BearerToken_Body_APEOverride { + if x != nil { + return x.xxx_hidden_ApeOverride + } + return nil +} + +func (x *BearerToken_Body) SetEaclTable(v *EACLTable) { + x.xxx_hidden_EaclTable = v +} + +func (x *BearerToken_Body) SetOwnerId(v *grpc.OwnerID) { + x.xxx_hidden_OwnerId = v +} + +func (x *BearerToken_Body) SetLifetime(v *BearerToken_Body_TokenLifetime) { + x.xxx_hidden_Lifetime = v +} + +func (x *BearerToken_Body) SetAllowImpersonate(v bool) { + x.xxx_hidden_AllowImpersonate = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 5) +} + +func (x *BearerToken_Body) SetApeOverride(v *BearerToken_Body_APEOverride) { + x.xxx_hidden_ApeOverride = v +} + +func (x *BearerToken_Body) HasEaclTable() bool { + if x == nil { + return false + } + return x.xxx_hidden_EaclTable != nil +} + +func (x *BearerToken_Body) HasOwnerId() bool { + if x == nil { + return false + } + return x.xxx_hidden_OwnerId != nil +} + +func (x *BearerToken_Body) HasLifetime() bool { + if x == nil { + return false + } + return x.xxx_hidden_Lifetime != nil +} + +func (x *BearerToken_Body) HasAllowImpersonate() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *BearerToken_Body) HasApeOverride() bool { + if x == nil { + return false + } + return x.xxx_hidden_ApeOverride != nil +} + +func (x *BearerToken_Body) ClearEaclTable() { + x.xxx_hidden_EaclTable = nil +} + +func (x *BearerToken_Body) ClearOwnerId() { + x.xxx_hidden_OwnerId = nil +} + +func (x *BearerToken_Body) ClearLifetime() { + x.xxx_hidden_Lifetime = nil +} + +func (x *BearerToken_Body) ClearAllowImpersonate() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_AllowImpersonate = false +} + +func (x *BearerToken_Body) ClearApeOverride() { + x.xxx_hidden_ApeOverride = nil +} + +type BearerToken_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // 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 + // `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 + // Token expiration and valid time period parameters + Lifetime *BearerToken_Body_TokenLifetime + // 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 + // APE override for the target. + ApeOverride *BearerToken_Body_APEOverride +} + +func (b0 BearerToken_Body_builder) Build() *BearerToken_Body { + m0 := &BearerToken_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_EaclTable = b.EaclTable + x.xxx_hidden_OwnerId = b.OwnerId + x.xxx_hidden_Lifetime = b.Lifetime + if b.AllowImpersonate != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 5) + x.xxx_hidden_AllowImpersonate = *b.AllowImpersonate + } + x.xxx_hidden_ApeOverride = b.ApeOverride + return m0 +} + +// Lifetime parameters of the token. Field names taken from +// [rfc7519](https://tools.ietf.org/html/rfc7519). +type BearerToken_Body_TokenLifetime struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Exp uint64 `protobuf:"varint,1,opt,name=exp" json:"exp,omitempty"` + xxx_hidden_Nbf uint64 `protobuf:"varint,2,opt,name=nbf" json:"nbf,omitempty"` + xxx_hidden_Iat uint64 `protobuf:"varint,3,opt,name=iat" json:"iat,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BearerToken_Body_TokenLifetime) Reset() { + *x = BearerToken_Body_TokenLifetime{} + mi := &file_api_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_api_acl_grpc_types_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *BearerToken_Body_TokenLifetime) GetExp() uint64 { + if x != nil { + return x.xxx_hidden_Exp + } + return 0 +} + +func (x *BearerToken_Body_TokenLifetime) GetNbf() uint64 { + if x != nil { + return x.xxx_hidden_Nbf + } + return 0 +} + +func (x *BearerToken_Body_TokenLifetime) GetIat() uint64 { + if x != nil { + return x.xxx_hidden_Iat + } + return 0 +} + +func (x *BearerToken_Body_TokenLifetime) SetExp(v uint64) { + x.xxx_hidden_Exp = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 3) +} + +func (x *BearerToken_Body_TokenLifetime) SetNbf(v uint64) { + x.xxx_hidden_Nbf = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 3) +} + +func (x *BearerToken_Body_TokenLifetime) SetIat(v uint64) { + x.xxx_hidden_Iat = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 3) +} + +func (x *BearerToken_Body_TokenLifetime) HasExp() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *BearerToken_Body_TokenLifetime) HasNbf() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *BearerToken_Body_TokenLifetime) HasIat() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *BearerToken_Body_TokenLifetime) ClearExp() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Exp = 0 +} + +func (x *BearerToken_Body_TokenLifetime) ClearNbf() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Nbf = 0 +} + +func (x *BearerToken_Body_TokenLifetime) ClearIat() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Iat = 0 +} + +type BearerToken_Body_TokenLifetime_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Expiration Epoch + Exp *uint64 + // Not valid before Epoch + Nbf *uint64 + // Issued at Epoch + Iat *uint64 +} + +func (b0 BearerToken_Body_TokenLifetime_builder) Build() *BearerToken_Body_TokenLifetime { + m0 := &BearerToken_Body_TokenLifetime{} + b, x := &b0, m0 + _, _ = b, x + if b.Exp != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 3) + x.xxx_hidden_Exp = *b.Exp + } + if b.Nbf != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 3) + x.xxx_hidden_Nbf = *b.Nbf + } + if b.Iat != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 3) + x.xxx_hidden_Iat = *b.Iat + } + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_Target *grpc1.ChainTarget `protobuf:"bytes,1,opt,name=target" json:"target,omitempty"` + xxx_hidden_Chains *[]*grpc1.Chain `protobuf:"bytes,2,rep,name=chains" json:"chains,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BearerToken_Body_APEOverride) Reset() { + *x = BearerToken_Body_APEOverride{} + mi := &file_api_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_api_acl_grpc_types_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *BearerToken_Body_APEOverride) GetTarget() *grpc1.ChainTarget { + if x != nil { + return x.xxx_hidden_Target + } + return nil +} + +func (x *BearerToken_Body_APEOverride) GetChains() []*grpc1.Chain { + if x != nil { + if x.xxx_hidden_Chains != nil { + return *x.xxx_hidden_Chains + } + } + return nil +} + +func (x *BearerToken_Body_APEOverride) SetTarget(v *grpc1.ChainTarget) { + x.xxx_hidden_Target = v +} + +func (x *BearerToken_Body_APEOverride) SetChains(v []*grpc1.Chain) { + x.xxx_hidden_Chains = &v +} + +func (x *BearerToken_Body_APEOverride) HasTarget() bool { + if x == nil { + return false + } + return x.xxx_hidden_Target != nil +} + +func (x *BearerToken_Body_APEOverride) ClearTarget() { + x.xxx_hidden_Target = nil +} + +type BearerToken_Body_APEOverride_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Target for which chains are applied. + Target *grpc1.ChainTarget + // The list of APE chains. + Chains []*grpc1.Chain +} + +func (b0 BearerToken_Body_APEOverride_builder) Build() *BearerToken_Body_APEOverride { + m0 := &BearerToken_Body_APEOverride{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Target = b.Target + x.xxx_hidden_Chains = &b.Chains + return m0 +} + +var File_api_acl_grpc_types_proto protoreflect.FileDescriptor + +var file_api_acl_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x61, 0x70, 0x69, 0x2f, 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, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x72, + 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x70, 0x65, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 0x59, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x2e, 0x66, + 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, + 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, + 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_acl_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 5) +var file_api_acl_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_api_acl_grpc_types_proto_goTypes = []any{ + (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_api_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_api_acl_grpc_types_proto_init() } +func file_api_acl_grpc_types_proto_init() { + if File_api_acl_grpc_types_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_acl_grpc_types_proto_rawDesc, + NumEnums: 5, + NumMessages: 8, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_acl_grpc_types_proto_goTypes, + DependencyIndexes: file_api_acl_grpc_types_proto_depIdxs, + EnumInfos: file_api_acl_grpc_types_proto_enumTypes, + MessageInfos: file_api_acl_grpc_types_proto_msgTypes, + }.Build() + File_api_acl_grpc_types_proto = out.File + file_api_acl_grpc_types_proto_rawDesc = nil + file_api_acl_grpc_types_proto_goTypes = nil + file_api_acl_grpc_types_proto_depIdxs = nil +} diff --git a/api/acl/string.go b/api/acl/string.go index e5a4462..6874e3a 100644 --- a/api/acl/string.go +++ b/api/acl/string.go @@ -14,12 +14,9 @@ func (x Action) String() string { // // Returns true if s was parsed successfully. func (x *Action) FromString(s string) bool { - var g acl.Action - - ok := g.FromString(s) - + g, ok := acl.Action_value[s] if ok { - *x = ActionFromGRPCField(g) + *x = ActionFromGRPCField(acl.Action(g)) } return ok @@ -35,12 +32,10 @@ func (x Role) String() string { // // Returns true if s was parsed successfully. func (x *Role) FromString(s string) bool { - var g acl.Role - - ok := g.FromString(s) + g, ok := acl.Role_value[s] if ok { - *x = RoleFromGRPCField(g) + *x = RoleFromGRPCField(acl.Role(g)) } return ok @@ -56,12 +51,9 @@ func (x Operation) String() string { // // Returns true if s was parsed successfully. func (x *Operation) FromString(s string) bool { - var g acl.Operation - - ok := g.FromString(s) - + g, ok := acl.Operation_value[s] if ok { - *x = OperationFromGRPCField(g) + *x = OperationFromGRPCField(acl.Operation(g)) } return ok @@ -77,12 +69,10 @@ func (x MatchType) String() string { // // Returns true if s was parsed successfully. func (x *MatchType) FromString(s string) bool { - var g acl.MatchType - - ok := g.FromString(s) + g, ok := acl.MatchType_value[s] if ok { - *x = MatchTypeFromGRPCField(g) + *x = MatchTypeFromGRPCField(acl.MatchType(g)) } return ok @@ -98,12 +88,10 @@ func (x HeaderType) String() string { // // Returns true if s was parsed successfully. func (x *HeaderType) FromString(s string) bool { - var g acl.HeaderType - - ok := g.FromString(s) + g, ok := acl.HeaderType_value[s] if ok { - *x = HeaderTypeFromGRPCField(g) + *x = HeaderTypeFromGRPCField(acl.HeaderType(g)) } return ok diff --git a/api/ape/convert.go b/api/ape/convert.go index 7bb0bde..7ca60c3 100644 --- a/api/ape/convert.go +++ b/api/ape/convert.go @@ -76,8 +76,7 @@ func (v2 *ChainRaw) ToGRPCMessage() grpc.Message { if v2 != nil { mgrpc = new(ape.Chain_Raw) - - mgrpc.SetRaw(v2.GetRaw()) + mgrpc.Raw = v2.GetRaw() } return mgrpc @@ -89,7 +88,7 @@ func (v2 *ChainRaw) FromGRPCMessage(m grpc.Message) error { return message.NewUnexpectedMessageType(m, mgrpc) } - v2.SetRaw(mgrpc.GetRaw()) + v2.SetRaw(mgrpc.Raw) return nil } @@ -104,7 +103,7 @@ func (v2 *Chain) ToGRPCMessage() grpc.Message { default: panic(fmt.Sprintf("unsupported chain kind: %T", chainKind)) case *ChainRaw: - mgrpc.SetKind(chainKind.ToGRPCMessage().(*ape.Chain_Raw)) + mgrpc.SetRaw(chainKind.GetRaw()) } } diff --git a/api/ape/grpc/types.pb.go b/api/ape/grpc/types.pb.go new file mode 100644 index 0000000..12bcaa7 --- /dev/null +++ b/api/ape/grpc/types.pb.go @@ -0,0 +1,376 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/ape/grpc/types.proto + +//go:build !protoopaque + +package ape + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// TargetType is a type target to which a rule chain is defined. +type TargetType int32 + +const ( + TargetType_UNDEFINED TargetType = 0 + TargetType_NAMESPACE TargetType = 1 + TargetType_CONTAINER TargetType = 2 + TargetType_USER TargetType = 3 + TargetType_GROUP TargetType = 4 +) + +// Enum value maps for TargetType. +var ( + TargetType_name = map[int32]string{ + 0: "UNDEFINED", + 1: "NAMESPACE", + 2: "CONTAINER", + 3: "USER", + 4: "GROUP", + } + TargetType_value = map[string]int32{ + "UNDEFINED": 0, + "NAMESPACE": 1, + "CONTAINER": 2, + "USER": 3, + "GROUP": 4, + } +) + +func (x TargetType) Enum() *TargetType { + p := new(TargetType) + *p = x + return p +} + +func (x TargetType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TargetType) Descriptor() protoreflect.EnumDescriptor { + return file_api_ape_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (TargetType) Type() protoreflect.EnumType { + return &file_api_ape_grpc_types_proto_enumTypes[0] +} + +func (x TargetType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// ChainTarget is an object to which a rule chain is defined. +type ChainTarget struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + Type *TargetType `protobuf:"varint,1,opt,name=type,enum=frostfs.v2.ape.TargetType" json:"type,omitempty"` + Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ChainTarget) Reset() { + *x = ChainTarget{} + mi := &file_api_ape_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ChainTarget) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChainTarget) ProtoMessage() {} + +func (x *ChainTarget) ProtoReflect() protoreflect.Message { + mi := &file_api_ape_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ChainTarget) GetType() TargetType { + if x != nil && x.Type != nil { + return *x.Type + } + return TargetType_UNDEFINED +} + +func (x *ChainTarget) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *ChainTarget) SetType(v TargetType) { + x.Type = &v +} + +func (x *ChainTarget) SetName(v string) { + x.Name = &v +} + +func (x *ChainTarget) HasType() bool { + if x == nil { + return false + } + return x.Type != nil +} + +func (x *ChainTarget) HasName() bool { + if x == nil { + return false + } + return x.Name != nil +} + +func (x *ChainTarget) ClearType() { + x.Type = nil +} + +func (x *ChainTarget) ClearName() { + x.Name = nil +} + +type ChainTarget_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Type *TargetType + Name *string +} + +func (b0 ChainTarget_builder) Build() *ChainTarget { + m0 := &ChainTarget{} + b, x := &b0, m0 + _, _ = b, x + x.Type = b.Type + x.Name = b.Name + return m0 +} + +// Chain is a chain of rules defined for a specific target. +type Chain struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Types that are valid to be assigned to Kind: + // + // *Chain_Raw + Kind isChain_Kind `protobuf_oneof:"kind"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Chain) Reset() { + *x = Chain{} + mi := &file_api_ape_grpc_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Chain) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Chain) ProtoMessage() {} + +func (x *Chain) ProtoReflect() protoreflect.Message { + mi := &file_api_ape_grpc_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Chain) GetKind() isChain_Kind { + if x != nil { + return x.Kind + } + return nil +} + +func (x *Chain) GetRaw() []byte { + if x != nil { + if x, ok := x.Kind.(*Chain_Raw); ok { + return x.Raw + } + } + return nil +} + +func (x *Chain) SetRaw(v []byte) { + if v == nil { + v = []byte{} + } + x.Kind = &Chain_Raw{v} +} + +func (x *Chain) HasKind() bool { + if x == nil { + return false + } + return x.Kind != nil +} + +func (x *Chain) HasRaw() bool { + if x == nil { + return false + } + _, ok := x.Kind.(*Chain_Raw) + return ok +} + +func (x *Chain) ClearKind() { + x.Kind = nil +} + +func (x *Chain) ClearRaw() { + if _, ok := x.Kind.(*Chain_Raw); ok { + x.Kind = nil + } +} + +const Chain_Kind_not_set_case case_Chain_Kind = 0 +const Chain_Raw_case case_Chain_Kind = 1 + +func (x *Chain) WhichKind() case_Chain_Kind { + if x == nil { + return Chain_Kind_not_set_case + } + switch x.Kind.(type) { + case *Chain_Raw: + return Chain_Raw_case + default: + return Chain_Kind_not_set_case + } +} + +type Chain_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Fields of oneof Kind: + // Raw representation of a serizalized rule chain. + Raw []byte + // -- end of Kind +} + +func (b0 Chain_builder) Build() *Chain { + m0 := &Chain{} + b, x := &b0, m0 + _, _ = b, x + if b.Raw != nil { + x.Kind = &Chain_Raw{b.Raw} + } + return m0 +} + +type case_Chain_Kind protoreflect.FieldNumber + +func (x case_Chain_Kind) String() string { + md := file_api_ape_grpc_types_proto_msgTypes[1].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isChain_Kind interface { + isChain_Kind() +} + +type Chain_Raw struct { + // Raw representation of a serizalized rule chain. + Raw []byte `protobuf:"bytes,1,opt,name=raw,oneof"` +} + +func (*Chain_Raw) isChain_Kind() {} + +var File_api_ape_grpc_types_proto protoreflect.FileDescriptor + +var file_api_ape_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x70, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x66, 0x72, 0x6f, 0x73, + 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x22, 0x51, 0x0a, 0x0b, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x23, 0x0a, + 0x05, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x03, 0x72, 0x61, 0x77, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, + 0x6e, 0x64, 0x2a, 0x4e, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x0d, 0x0a, 0x09, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0d, + 0x0a, 0x09, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x02, 0x12, 0x08, 0x0a, + 0x04, 0x55, 0x53, 0x45, 0x52, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x52, 0x4f, 0x55, 0x50, + 0x10, 0x04, 0x42, 0x3f, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, + 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, + 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x70, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, + 0x61, 0x70, 0x65, 0x62, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_ape_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_api_ape_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_api_ape_grpc_types_proto_goTypes = []any{ + (TargetType)(0), // 0: frostfs.v2.ape.TargetType + (*ChainTarget)(nil), // 1: frostfs.v2.ape.ChainTarget + (*Chain)(nil), // 2: frostfs.v2.ape.Chain +} +var file_api_ape_grpc_types_proto_depIdxs = []int32{ + 0, // 0: frostfs.v2.ape.ChainTarget.type:type_name -> frostfs.v2.ape.TargetType + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_api_ape_grpc_types_proto_init() } +func file_api_ape_grpc_types_proto_init() { + if File_api_ape_grpc_types_proto != nil { + return + } + file_api_ape_grpc_types_proto_msgTypes[1].OneofWrappers = []any{ + (*Chain_Raw)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_ape_grpc_types_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_ape_grpc_types_proto_goTypes, + DependencyIndexes: file_api_ape_grpc_types_proto_depIdxs, + EnumInfos: file_api_ape_grpc_types_proto_enumTypes, + MessageInfos: file_api_ape_grpc_types_proto_msgTypes, + }.Build() + File_api_ape_grpc_types_proto = out.File + file_api_ape_grpc_types_proto_rawDesc = nil + file_api_ape_grpc_types_proto_goTypes = nil + file_api_ape_grpc_types_proto_depIdxs = nil +} diff --git a/api/ape/grpc/types_frostfs.pb.go b/api/ape/grpc/types_frostfs.pb.go deleted file mode 100644 index 0e204bd..0000000 --- a/api/ape/grpc/types_frostfs.pb.go +++ /dev/null @@ -1,430 +0,0 @@ -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package ape - -import ( - json "encoding/json" - fmt "fmt" - pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" - proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" - encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" - easyproto "github.com/VictoriaMetrics/easyproto" - jlexer "github.com/mailru/easyjson/jlexer" - jwriter "github.com/mailru/easyjson/jwriter" - strconv "strconv" -) - -type TargetType int32 - -const ( - TargetType_UNDEFINED TargetType = 0 - TargetType_NAMESPACE TargetType = 1 - TargetType_CONTAINER TargetType = 2 - TargetType_USER TargetType = 3 - TargetType_GROUP TargetType = 4 -) - -var ( - TargetType_name = map[int32]string{ - 0: "UNDEFINED", - 1: "NAMESPACE", - 2: "CONTAINER", - 3: "USER", - 4: "GROUP", - } - TargetType_value = map[string]int32{ - "UNDEFINED": 0, - "NAMESPACE": 1, - "CONTAINER": 2, - "USER": 3, - "GROUP": 4, - } -) - -func (x TargetType) String() string { - if v, ok := TargetType_name[int32(x)]; ok { - return v - } - return strconv.FormatInt(int64(x), 10) -} -func (x *TargetType) FromString(s string) bool { - if v, ok := TargetType_value[s]; ok { - *x = TargetType(v) - return true - } - return false -} - -type ChainTarget struct { - Type TargetType `json:"type"` - Name string `json:"name"` -} - -var ( - _ encoding.ProtoMarshaler = (*ChainTarget)(nil) - _ encoding.ProtoUnmarshaler = (*ChainTarget)(nil) - _ json.Marshaler = (*ChainTarget)(nil) - _ json.Unmarshaler = (*ChainTarget)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *ChainTarget) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.EnumSize(1, int32(x.Type)) - size += proto.StringSize(2, x.Name) - return size -} - -// MarshalProtobuf implements the encoding.ProtoMarshaler interface. -func (x *ChainTarget) MarshalProtobuf(dst []byte) []byte { - m := pool.MarshalerPool.Get() - defer pool.MarshalerPool.Put(m) - x.EmitProtobuf(m.MessageMarshaler()) - dst = m.Marshal(dst) - return dst -} - -func (x *ChainTarget) EmitProtobuf(mm *easyproto.MessageMarshaler) { - if x == nil { - return - } - if int32(x.Type) != 0 { - mm.AppendInt32(1, int32(x.Type)) - } - if len(x.Name) != 0 { - mm.AppendString(2, x.Name) - } -} - -// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. -func (x *ChainTarget) UnmarshalProtobuf(src []byte) (err error) { - var fc easyproto.FieldContext - for len(src) > 0 { - src, err = fc.NextField(src) - if err != nil { - return fmt.Errorf("cannot read next field in %s", "ChainTarget") - } - switch fc.FieldNum { - case 1: // Type - data, ok := fc.Int32() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Type") - } - x.Type = TargetType(data) - case 2: // Name - data, ok := fc.String() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Name") - } - x.Name = data - } - } - return nil -} -func (x *ChainTarget) GetType() TargetType { - if x != nil { - return x.Type - } - return 0 -} -func (x *ChainTarget) SetType(v TargetType) { - x.Type = v -} -func (x *ChainTarget) GetName() string { - if x != nil { - return x.Name - } - return "" -} -func (x *ChainTarget) SetName(v string) { - x.Name = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *ChainTarget) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *ChainTarget) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"type\":" - out.RawString(prefix) - v := int32(x.Type) - if vv, ok := TargetType_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"name\":" - out.RawString(prefix) - out.String(x.Name) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *ChainTarget) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *ChainTarget) UnmarshalEasyJSON(in *jlexer.Lexer) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "type": - { - var f TargetType - var parsedValue TargetType - switch v := in.Interface().(type) { - case string: - if vv, ok := TargetType_value[v]; ok { - parsedValue = TargetType(vv) - break - } - vv, err := strconv.ParseInt(v, 10, 32) - if err != nil { - in.AddError(err) - return - } - parsedValue = TargetType(vv) - case float64: - parsedValue = TargetType(v) - } - f = parsedValue - x.Type = f - } - case "name": - { - var f string - f = in.String() - x.Name = f - } - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} - -type Chain struct { - Kind isChain_Kind -} - -var ( - _ encoding.ProtoMarshaler = (*Chain)(nil) - _ encoding.ProtoUnmarshaler = (*Chain)(nil) - _ json.Marshaler = (*Chain)(nil) - _ json.Unmarshaler = (*Chain)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *Chain) StableSize() (size int) { - if x == nil { - return 0 - } - if inner, ok := x.Kind.(*Chain_Raw); ok { - size += proto.BytesSize(1, inner.Raw) - } - return size -} - -// MarshalProtobuf implements the encoding.ProtoMarshaler interface. -func (x *Chain) MarshalProtobuf(dst []byte) []byte { - m := pool.MarshalerPool.Get() - defer pool.MarshalerPool.Put(m) - x.EmitProtobuf(m.MessageMarshaler()) - dst = m.Marshal(dst) - return dst -} - -func (x *Chain) EmitProtobuf(mm *easyproto.MessageMarshaler) { - if x == nil { - return - } - if inner, ok := x.Kind.(*Chain_Raw); ok { - if len(inner.Raw) != 0 { - mm.AppendBytes(1, inner.Raw) - } - } -} - -// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. -func (x *Chain) UnmarshalProtobuf(src []byte) (err error) { - var fc easyproto.FieldContext - for len(src) > 0 { - src, err = fc.NextField(src) - if err != nil { - return fmt.Errorf("cannot read next field in %s", "Chain") - } - switch fc.FieldNum { - case 1: // Raw - data, ok := fc.Bytes() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Raw") - } - x.Kind = &Chain_Raw{Raw: data} - } - } - return nil -} -func (x *Chain) GetKind() isChain_Kind { - if x != nil { - return x.Kind - } - return nil -} -func (x *Chain) SetKind(v isChain_Kind) { - x.Kind = v -} -func (x *Chain) GetRaw() []byte { - if xx, ok := x.GetKind().(*Chain_Raw); ok { - return xx.Raw - } - return nil -} -func (x *Chain) SetRaw(v *Chain_Raw) { - x.Kind = v -} -func (x *Chain_Raw) GetRaw() []byte { - if x != nil { - return x.Raw - } - return nil -} -func (x *Chain_Raw) SetRaw(v []byte) { - x.Raw = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *Chain) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *Chain) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - first := true - out.RawByte('{') - switch xx := x.Kind.(type) { - case *Chain_Raw: - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"raw\":" - out.RawString(prefix) - if xx.Raw != nil { - out.Base64Bytes(xx.Raw) - } else { - out.String("") - } - } - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *Chain) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *Chain) UnmarshalEasyJSON(in *jlexer.Lexer) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "raw": - xx := new(Chain_Raw) - x.Kind = xx - { - var f []byte - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - xx.Raw = f - } - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} - -type isChain_Kind interface { - isChain_Kind() -} - -type Chain_Raw struct { - Raw []byte -} - -func (*Chain_Raw) isChain_Kind() {} diff --git a/api/ape/grpc/types_frostfs_fuzz.go b/api/ape/grpc/types_frostfs_fuzz.go deleted file mode 100644 index b7bf367..0000000 --- a/api/ape/grpc/types_frostfs_fuzz.go +++ /dev/null @@ -1,45 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package ape - -func DoFuzzProtoChainTarget(data []byte) int { - msg := new(ChainTarget) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONChainTarget(data []byte) int { - msg := new(ChainTarget) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoChain(data []byte) int { - msg := new(Chain) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONChain(data []byte) int { - msg := new(Chain) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} diff --git a/api/ape/grpc/types_frostfs_test.go b/api/ape/grpc/types_frostfs_test.go deleted file mode 100644 index 93d7eea..0000000 --- a/api/ape/grpc/types_frostfs_test.go +++ /dev/null @@ -1,31 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package ape - -import ( - testing "testing" -) - -func FuzzProtoChainTarget(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoChainTarget(data) - }) -} -func FuzzJSONChainTarget(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONChainTarget(data) - }) -} -func FuzzProtoChain(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoChain(data) - }) -} -func FuzzJSONChain(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONChain(data) - }) -} diff --git a/api/ape/grpc/types_protoopaque.pb.go b/api/ape/grpc/types_protoopaque.pb.go new file mode 100644 index 0000000..100ea61 --- /dev/null +++ b/api/ape/grpc/types_protoopaque.pb.go @@ -0,0 +1,383 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/ape/grpc/types.proto + +//go:build protoopaque + +package ape + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// TargetType is a type target to which a rule chain is defined. +type TargetType int32 + +const ( + TargetType_UNDEFINED TargetType = 0 + TargetType_NAMESPACE TargetType = 1 + TargetType_CONTAINER TargetType = 2 + TargetType_USER TargetType = 3 + TargetType_GROUP TargetType = 4 +) + +// Enum value maps for TargetType. +var ( + TargetType_name = map[int32]string{ + 0: "UNDEFINED", + 1: "NAMESPACE", + 2: "CONTAINER", + 3: "USER", + 4: "GROUP", + } + TargetType_value = map[string]int32{ + "UNDEFINED": 0, + "NAMESPACE": 1, + "CONTAINER": 2, + "USER": 3, + "GROUP": 4, + } +) + +func (x TargetType) Enum() *TargetType { + p := new(TargetType) + *p = x + return p +} + +func (x TargetType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TargetType) Descriptor() protoreflect.EnumDescriptor { + return file_api_ape_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (TargetType) Type() protoreflect.EnumType { + return &file_api_ape_grpc_types_proto_enumTypes[0] +} + +func (x TargetType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// ChainTarget is an object to which a rule chain is defined. +type ChainTarget struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Type TargetType `protobuf:"varint,1,opt,name=type,enum=frostfs.v2.ape.TargetType" json:"type,omitempty"` + xxx_hidden_Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ChainTarget) Reset() { + *x = ChainTarget{} + mi := &file_api_ape_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ChainTarget) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChainTarget) ProtoMessage() {} + +func (x *ChainTarget) ProtoReflect() protoreflect.Message { + mi := &file_api_ape_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ChainTarget) GetType() TargetType { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 0) { + return x.xxx_hidden_Type + } + } + return TargetType_UNDEFINED +} + +func (x *ChainTarget) GetName() string { + if x != nil { + if x.xxx_hidden_Name != nil { + return *x.xxx_hidden_Name + } + return "" + } + return "" +} + +func (x *ChainTarget) SetType(v TargetType) { + x.xxx_hidden_Type = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2) +} + +func (x *ChainTarget) SetName(v string) { + x.xxx_hidden_Name = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2) +} + +func (x *ChainTarget) HasType() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *ChainTarget) HasName() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *ChainTarget) ClearType() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Type = TargetType_UNDEFINED +} + +func (x *ChainTarget) ClearName() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Name = nil +} + +type ChainTarget_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Type *TargetType + Name *string +} + +func (b0 ChainTarget_builder) Build() *ChainTarget { + m0 := &ChainTarget{} + b, x := &b0, m0 + _, _ = b, x + if b.Type != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2) + x.xxx_hidden_Type = *b.Type + } + if b.Name != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2) + x.xxx_hidden_Name = b.Name + } + return m0 +} + +// Chain is a chain of rules defined for a specific target. +type Chain struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Kind isChain_Kind `protobuf_oneof:"kind"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Chain) Reset() { + *x = Chain{} + mi := &file_api_ape_grpc_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Chain) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Chain) ProtoMessage() {} + +func (x *Chain) ProtoReflect() protoreflect.Message { + mi := &file_api_ape_grpc_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Chain) GetRaw() []byte { + if x != nil { + if x, ok := x.xxx_hidden_Kind.(*chain_Raw); ok { + return x.Raw + } + } + return nil +} + +func (x *Chain) SetRaw(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Kind = &chain_Raw{v} +} + +func (x *Chain) HasKind() bool { + if x == nil { + return false + } + return x.xxx_hidden_Kind != nil +} + +func (x *Chain) HasRaw() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Kind.(*chain_Raw) + return ok +} + +func (x *Chain) ClearKind() { + x.xxx_hidden_Kind = nil +} + +func (x *Chain) ClearRaw() { + if _, ok := x.xxx_hidden_Kind.(*chain_Raw); ok { + x.xxx_hidden_Kind = nil + } +} + +const Chain_Kind_not_set_case case_Chain_Kind = 0 +const Chain_Raw_case case_Chain_Kind = 1 + +func (x *Chain) WhichKind() case_Chain_Kind { + if x == nil { + return Chain_Kind_not_set_case + } + switch x.xxx_hidden_Kind.(type) { + case *chain_Raw: + return Chain_Raw_case + default: + return Chain_Kind_not_set_case + } +} + +type Chain_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Fields of oneof xxx_hidden_Kind: + // Raw representation of a serizalized rule chain. + Raw []byte + // -- end of xxx_hidden_Kind +} + +func (b0 Chain_builder) Build() *Chain { + m0 := &Chain{} + b, x := &b0, m0 + _, _ = b, x + if b.Raw != nil { + x.xxx_hidden_Kind = &chain_Raw{b.Raw} + } + return m0 +} + +type case_Chain_Kind protoreflect.FieldNumber + +func (x case_Chain_Kind) String() string { + md := file_api_ape_grpc_types_proto_msgTypes[1].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isChain_Kind interface { + isChain_Kind() +} + +type chain_Raw struct { + // Raw representation of a serizalized rule chain. + Raw []byte `protobuf:"bytes,1,opt,name=raw,oneof"` +} + +func (*chain_Raw) isChain_Kind() {} + +var File_api_ape_grpc_types_proto protoreflect.FileDescriptor + +var file_api_ape_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x70, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x66, 0x72, 0x6f, 0x73, + 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x22, 0x51, 0x0a, 0x0b, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x23, 0x0a, + 0x05, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x03, 0x72, 0x61, 0x77, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, + 0x6e, 0x64, 0x2a, 0x4e, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x0d, 0x0a, 0x09, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0d, + 0x0a, 0x09, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x02, 0x12, 0x08, 0x0a, + 0x04, 0x55, 0x53, 0x45, 0x52, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x52, 0x4f, 0x55, 0x50, + 0x10, 0x04, 0x42, 0x3f, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, + 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, + 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x70, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, + 0x61, 0x70, 0x65, 0x62, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_ape_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_api_ape_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_api_ape_grpc_types_proto_goTypes = []any{ + (TargetType)(0), // 0: frostfs.v2.ape.TargetType + (*ChainTarget)(nil), // 1: frostfs.v2.ape.ChainTarget + (*Chain)(nil), // 2: frostfs.v2.ape.Chain +} +var file_api_ape_grpc_types_proto_depIdxs = []int32{ + 0, // 0: frostfs.v2.ape.ChainTarget.type:type_name -> frostfs.v2.ape.TargetType + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_api_ape_grpc_types_proto_init() } +func file_api_ape_grpc_types_proto_init() { + if File_api_ape_grpc_types_proto != nil { + return + } + file_api_ape_grpc_types_proto_msgTypes[1].OneofWrappers = []any{ + (*chain_Raw)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_ape_grpc_types_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_ape_grpc_types_proto_goTypes, + DependencyIndexes: file_api_ape_grpc_types_proto_depIdxs, + EnumInfos: file_api_ape_grpc_types_proto_enumTypes, + MessageInfos: file_api_ape_grpc_types_proto_msgTypes, + }.Build() + File_api_ape_grpc_types_proto = out.File + file_api_ape_grpc_types_proto_rawDesc = nil + file_api_ape_grpc_types_proto_goTypes = nil + file_api_ape_grpc_types_proto_depIdxs = nil +} diff --git a/api/apemanager/convert.go b/api/apemanager/convert.go index 5591791..b24a500 100644 --- a/api/apemanager/convert.go +++ b/api/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/api/apemanager/grpc/service.pb.go b/api/apemanager/grpc/service.pb.go new file mode 100644 index 0000000..7321ef1 --- /dev/null +++ b/api/apemanager/grpc/service.pb.go @@ -0,0 +1,1487 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/apemanager/grpc/service.proto + +//go:build !protoopaque + +package apemanager + +import ( + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type AddChainRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // The request's body. + Body *AddChainRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddChainRequest) Reset() { + *x = AddChainRequest{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *AddChainRequest) SetBody(v *AddChainRequest_Body) { + x.Body = v +} + +func (x *AddChainRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *AddChainRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *AddChainRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *AddChainRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *AddChainRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *AddChainRequest) ClearBody() { + x.Body = nil +} + +func (x *AddChainRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *AddChainRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type AddChainRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The request's body. + Body *AddChainRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 AddChainRequest_builder) Build() *AddChainRequest { + m0 := &AddChainRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +type AddChainResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // The response's body. + Body *AddChainResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddChainResponse) Reset() { + *x = AddChainResponse{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *AddChainResponse) SetBody(v *AddChainResponse_Body) { + x.Body = v +} + +func (x *AddChainResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *AddChainResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *AddChainResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *AddChainResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *AddChainResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *AddChainResponse) ClearBody() { + x.Body = nil +} + +func (x *AddChainResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *AddChainResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type AddChainResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The response's body. + Body *AddChainResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 AddChainResponse_builder) Build() *AddChainResponse { + m0 := &AddChainResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +type RemoveChainRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // The request's body. + Body *RemoveChainRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveChainRequest) Reset() { + *x = RemoveChainRequest{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *RemoveChainRequest) SetBody(v *RemoveChainRequest_Body) { + x.Body = v +} + +func (x *RemoveChainRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *RemoveChainRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *RemoveChainRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *RemoveChainRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *RemoveChainRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *RemoveChainRequest) ClearBody() { + x.Body = nil +} + +func (x *RemoveChainRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *RemoveChainRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type RemoveChainRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The request's body. + Body *RemoveChainRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 RemoveChainRequest_builder) Build() *RemoveChainRequest { + m0 := &RemoveChainRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +type RemoveChainResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // The response's body. + Body *RemoveChainResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveChainResponse) Reset() { + *x = RemoveChainResponse{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *RemoveChainResponse) SetBody(v *RemoveChainResponse_Body) { + x.Body = v +} + +func (x *RemoveChainResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *RemoveChainResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *RemoveChainResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *RemoveChainResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *RemoveChainResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *RemoveChainResponse) ClearBody() { + x.Body = nil +} + +func (x *RemoveChainResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *RemoveChainResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type RemoveChainResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The response's body. + Body *RemoveChainResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 RemoveChainResponse_builder) Build() *RemoveChainResponse { + m0 := &RemoveChainResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +type ListChainsRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // The request's body. + Body *ListChainsRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListChainsRequest) Reset() { + *x = ListChainsRequest{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *ListChainsRequest) SetBody(v *ListChainsRequest_Body) { + x.Body = v +} + +func (x *ListChainsRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *ListChainsRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *ListChainsRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *ListChainsRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *ListChainsRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *ListChainsRequest) ClearBody() { + x.Body = nil +} + +func (x *ListChainsRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *ListChainsRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type ListChainsRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The request's body. + Body *ListChainsRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 ListChainsRequest_builder) Build() *ListChainsRequest { + m0 := &ListChainsRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +type ListChainsResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // The response's body. + Body *ListChainsResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListChainsResponse) Reset() { + *x = ListChainsResponse{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *ListChainsResponse) SetBody(v *ListChainsResponse_Body) { + x.Body = v +} + +func (x *ListChainsResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *ListChainsResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *ListChainsResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *ListChainsResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *ListChainsResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *ListChainsResponse) ClearBody() { + x.Body = nil +} + +func (x *ListChainsResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *ListChainsResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type ListChainsResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The response's body. + Body *ListChainsResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 ListChainsResponse_builder) Build() *ListChainsResponse { + m0 := &ListChainsResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +type AddChainRequest_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // A target for which a rule chain is added. + Target *grpc1.ChainTarget `protobuf:"bytes,1,opt,name=target" json:"target,omitempty"` + // The chain to set for the target. + Chain *grpc1.Chain `protobuf:"bytes,2,opt,name=chain" json:"chain,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddChainRequest_Body) Reset() { + *x = AddChainRequest_Body{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *AddChainRequest_Body) SetTarget(v *grpc1.ChainTarget) { + x.Target = v +} + +func (x *AddChainRequest_Body) SetChain(v *grpc1.Chain) { + x.Chain = v +} + +func (x *AddChainRequest_Body) HasTarget() bool { + if x == nil { + return false + } + return x.Target != nil +} + +func (x *AddChainRequest_Body) HasChain() bool { + if x == nil { + return false + } + return x.Chain != nil +} + +func (x *AddChainRequest_Body) ClearTarget() { + x.Target = nil +} + +func (x *AddChainRequest_Body) ClearChain() { + x.Chain = nil +} + +type AddChainRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // A target for which a rule chain is added. + Target *grpc1.ChainTarget + // The chain to set for the target. + Chain *grpc1.Chain +} + +func (b0 AddChainRequest_Body_builder) Build() *AddChainRequest_Body { + m0 := &AddChainRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.Target = b.Target + x.Chain = b.Chain + return m0 +} + +type AddChainResponse_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // 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" json:"chain_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddChainResponse_Body) Reset() { + *x = AddChainResponse_Body{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *AddChainResponse_Body) GetChainId() []byte { + if x != nil { + return x.ChainId + } + return nil +} + +func (x *AddChainResponse_Body) SetChainId(v []byte) { + if v == nil { + v = []byte{} + } + x.ChainId = v +} + +func (x *AddChainResponse_Body) HasChainId() bool { + if x == nil { + return false + } + return x.ChainId != nil +} + +func (x *AddChainResponse_Body) ClearChainId() { + x.ChainId = nil +} + +type AddChainResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Chain ID assigned for the added rule chain. + // If chain ID is left empty in the request, then + // it will be generated. + ChainId []byte +} + +func (b0 AddChainResponse_Body_builder) Build() *AddChainResponse_Body { + m0 := &AddChainResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.ChainId = b.ChainId + return m0 +} + +type RemoveChainRequest_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Target for which a rule chain is removed. + Target *grpc1.ChainTarget `protobuf:"bytes,1,opt,name=target" json:"target,omitempty"` + // Chain ID assigned for the rule chain. + ChainId []byte `protobuf:"bytes,2,opt,name=chain_id,json=chainId" json:"chain_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveChainRequest_Body) Reset() { + *x = RemoveChainRequest_Body{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *RemoveChainRequest_Body) SetTarget(v *grpc1.ChainTarget) { + x.Target = v +} + +func (x *RemoveChainRequest_Body) SetChainId(v []byte) { + if v == nil { + v = []byte{} + } + x.ChainId = v +} + +func (x *RemoveChainRequest_Body) HasTarget() bool { + if x == nil { + return false + } + return x.Target != nil +} + +func (x *RemoveChainRequest_Body) HasChainId() bool { + if x == nil { + return false + } + return x.ChainId != nil +} + +func (x *RemoveChainRequest_Body) ClearTarget() { + x.Target = nil +} + +func (x *RemoveChainRequest_Body) ClearChainId() { + x.ChainId = nil +} + +type RemoveChainRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Target for which a rule chain is removed. + Target *grpc1.ChainTarget + // Chain ID assigned for the rule chain. + ChainId []byte +} + +func (b0 RemoveChainRequest_Body_builder) Build() *RemoveChainRequest_Body { + m0 := &RemoveChainRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.Target = b.Target + x.ChainId = b.ChainId + return m0 +} + +// 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 `protogen:"hybrid.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveChainResponse_Body) Reset() { + *x = RemoveChainResponse_Body{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +type RemoveChainResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + +} + +func (b0 RemoveChainResponse_Body_builder) Build() *RemoveChainResponse_Body { + m0 := &RemoveChainResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + return m0 +} + +type ListChainsRequest_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Target for which rule chains are listed. + Target *grpc1.ChainTarget `protobuf:"bytes,1,opt,name=target" json:"target,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListChainsRequest_Body) Reset() { + *x = ListChainsRequest_Body{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListChainsRequest_Body) GetTarget() *grpc1.ChainTarget { + if x != nil { + return x.Target + } + return nil +} + +func (x *ListChainsRequest_Body) SetTarget(v *grpc1.ChainTarget) { + x.Target = v +} + +func (x *ListChainsRequest_Body) HasTarget() bool { + if x == nil { + return false + } + return x.Target != nil +} + +func (x *ListChainsRequest_Body) ClearTarget() { + x.Target = nil +} + +type ListChainsRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Target for which rule chains are listed. + Target *grpc1.ChainTarget +} + +func (b0 ListChainsRequest_Body_builder) Build() *ListChainsRequest_Body { + m0 := &ListChainsRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.Target = b.Target + return m0 +} + +type ListChainsResponse_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // The list of chains defined for the reqeusted target. + Chains []*grpc1.Chain `protobuf:"bytes,1,rep,name=chains" json:"chains,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListChainsResponse_Body) Reset() { + *x = ListChainsResponse_Body{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListChainsResponse_Body) GetChains() []*grpc1.Chain { + if x != nil { + return x.Chains + } + return nil +} + +func (x *ListChainsResponse_Body) SetChains(v []*grpc1.Chain) { + x.Chains = v +} + +type ListChainsResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The list of chains defined for the reqeusted target. + Chains []*grpc1.Chain +} + +func (b0 ListChainsResponse_Body_builder) Build() *ListChainsResponse_Body { + m0 := &ListChainsResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.Chains = b.Chains + return m0 +} + +var File_api_apemanager_grpc_service_proto protoreflect.FileDescriptor + +var file_api_apemanager_grpc_service_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x61, 0x70, 0x69, 0x2f, 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, 0x18, 0x61, 0x70, 0x69, 0x2f, + 0x61, 0x70, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 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, 0x4d, 0x5a, 0x4b, 0x67, 0x69, 0x74, + 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, + 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_apemanager_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_api_apemanager_grpc_service_proto_goTypes = []any{ + (*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_api_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_api_apemanager_grpc_service_proto_init() } +func file_api_apemanager_grpc_service_proto_init() { + if File_api_apemanager_grpc_service_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_apemanager_grpc_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 12, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_api_apemanager_grpc_service_proto_goTypes, + DependencyIndexes: file_api_apemanager_grpc_service_proto_depIdxs, + MessageInfos: file_api_apemanager_grpc_service_proto_msgTypes, + }.Build() + File_api_apemanager_grpc_service_proto = out.File + file_api_apemanager_grpc_service_proto_rawDesc = nil + file_api_apemanager_grpc_service_proto_goTypes = nil + file_api_apemanager_grpc_service_proto_depIdxs = nil +} diff --git a/api/apemanager/grpc/service_frostfs.pb.go b/api/apemanager/grpc/service_frostfs.pb.go deleted file mode 100644 index 402c908..0000000 --- a/api/apemanager/grpc/service_frostfs.pb.go +++ /dev/null @@ -1,2337 +0,0 @@ -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package apemanager - -import ( - json "encoding/json" - fmt "fmt" - grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape/grpc" - grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" - pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" - proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" - encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" - easyproto "github.com/VictoriaMetrics/easyproto" - jlexer "github.com/mailru/easyjson/jlexer" - jwriter "github.com/mailru/easyjson/jwriter" -) - -type 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.EmitProtobuf(mm.AppendMessage(1)) - } - if x.Chain != nil { - 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 - } - first := true - out.RawByte('{') - { - 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 = "\"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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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 - } - first := true - out.RawByte('{') - { - 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('}') -} - -// 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 - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.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 - } - first := true - out.RawByte('{') - { - 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 = "\"chainId\":" - out.RawString(prefix) - if x.ChainId != nil { - out.Base64Bytes(x.ChainId) - } else { - out.String("") - } - } - 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 - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"target\":" - out.RawString(prefix) - 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.NestedStructureSizeUnchecked(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 { - 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, 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 - } - first := true - 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('}') -} - -// 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 = 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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/api/apemanager/grpc/service_frostfs_fuzz.go b/api/apemanager/grpc/service_frostfs_fuzz.go deleted file mode 100644 index 08af63e..0000000 --- a/api/apemanager/grpc/service_frostfs_fuzz.go +++ /dev/null @@ -1,121 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package apemanager - -func DoFuzzProtoAddChainRequest(data []byte) int { - msg := new(AddChainRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONAddChainRequest(data []byte) int { - msg := new(AddChainRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoAddChainResponse(data []byte) int { - msg := new(AddChainResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONAddChainResponse(data []byte) int { - msg := new(AddChainResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoRemoveChainRequest(data []byte) int { - msg := new(RemoveChainRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONRemoveChainRequest(data []byte) int { - msg := new(RemoveChainRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoRemoveChainResponse(data []byte) int { - msg := new(RemoveChainResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONRemoveChainResponse(data []byte) int { - msg := new(RemoveChainResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoListChainsRequest(data []byte) int { - msg := new(ListChainsRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONListChainsRequest(data []byte) int { - msg := new(ListChainsRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoListChainsResponse(data []byte) int { - msg := new(ListChainsResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONListChainsResponse(data []byte) int { - msg := new(ListChainsResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} diff --git a/api/apemanager/grpc/service_frostfs_test.go b/api/apemanager/grpc/service_frostfs_test.go deleted file mode 100644 index 5c4653c..0000000 --- a/api/apemanager/grpc/service_frostfs_test.go +++ /dev/null @@ -1,71 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package apemanager - -import ( - testing "testing" -) - -func FuzzProtoAddChainRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoAddChainRequest(data) - }) -} -func FuzzJSONAddChainRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONAddChainRequest(data) - }) -} -func FuzzProtoAddChainResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoAddChainResponse(data) - }) -} -func FuzzJSONAddChainResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONAddChainResponse(data) - }) -} -func FuzzProtoRemoveChainRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoRemoveChainRequest(data) - }) -} -func FuzzJSONRemoveChainRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONRemoveChainRequest(data) - }) -} -func FuzzProtoRemoveChainResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoRemoveChainResponse(data) - }) -} -func FuzzJSONRemoveChainResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONRemoveChainResponse(data) - }) -} -func FuzzProtoListChainsRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoListChainsRequest(data) - }) -} -func FuzzJSONListChainsRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONListChainsRequest(data) - }) -} -func FuzzProtoListChainsResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoListChainsResponse(data) - }) -} -func FuzzJSONListChainsResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONListChainsResponse(data) - }) -} diff --git a/api/apemanager/grpc/service_grpc.pb.go b/api/apemanager/grpc/service_grpc.pb.go index bf76cc4..8dd61e0 100644 --- a/api/apemanager/grpc/service_grpc.pb.go +++ b/api/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 v5.27.2 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.29.2 // source: api/apemanager/grpc/service.proto package apemanager @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( APEManagerService_AddChain_FullMethodName = "/frostfs.v2.apemanager.APEManagerService/AddChain" @@ -27,6 +27,9 @@ const ( // APEManagerServiceClient is the client API for APEManagerService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// `APEManagerService` provides API to manage rule chains within sidechain's +// `Policy` smart contract. type APEManagerServiceClient interface { // Add a rule chain for a specific target to `Policy` smart contract. // @@ -74,8 +77,9 @@ func NewAPEManagerServiceClient(cc grpc.ClientConnInterface) APEManagerServiceCl } func (c *aPEManagerServiceClient) AddChain(ctx context.Context, in *AddChainRequest, opts ...grpc.CallOption) (*AddChainResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AddChainResponse) - err := c.cc.Invoke(ctx, APEManagerService_AddChain_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, APEManagerService_AddChain_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -83,8 +87,9 @@ func (c *aPEManagerServiceClient) AddChain(ctx context.Context, in *AddChainRequ } func (c *aPEManagerServiceClient) RemoveChain(ctx context.Context, in *RemoveChainRequest, opts ...grpc.CallOption) (*RemoveChainResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(RemoveChainResponse) - err := c.cc.Invoke(ctx, APEManagerService_RemoveChain_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, APEManagerService_RemoveChain_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -92,8 +97,9 @@ func (c *aPEManagerServiceClient) RemoveChain(ctx context.Context, in *RemoveCha } func (c *aPEManagerServiceClient) ListChains(ctx context.Context, in *ListChainsRequest, opts ...grpc.CallOption) (*ListChainsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListChainsResponse) - err := c.cc.Invoke(ctx, APEManagerService_ListChains_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, APEManagerService_ListChains_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -102,7 +108,10 @@ func (c *aPEManagerServiceClient) ListChains(ctx context.Context, in *ListChains // APEManagerServiceServer is the server API for APEManagerService service. // All implementations should embed UnimplementedAPEManagerServiceServer -// for forward compatibility +// for forward compatibility. +// +// `APEManagerService` provides API to manage rule chains within sidechain's +// `Policy` smart contract. type APEManagerServiceServer interface { // Add a rule chain for a specific target to `Policy` smart contract. // @@ -141,9 +150,12 @@ type APEManagerServiceServer interface { ListChains(context.Context, *ListChainsRequest) (*ListChainsResponse, error) } -// UnimplementedAPEManagerServiceServer should be embedded to have forward compatible implementations. -type UnimplementedAPEManagerServiceServer struct { -} +// UnimplementedAPEManagerServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedAPEManagerServiceServer struct{} func (UnimplementedAPEManagerServiceServer) AddChain(context.Context, *AddChainRequest) (*AddChainResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddChain not implemented") @@ -154,6 +166,7 @@ func (UnimplementedAPEManagerServiceServer) RemoveChain(context.Context, *Remove func (UnimplementedAPEManagerServiceServer) ListChains(context.Context, *ListChainsRequest) (*ListChainsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListChains not implemented") } +func (UnimplementedAPEManagerServiceServer) testEmbeddedByValue() {} // UnsafeAPEManagerServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to APEManagerServiceServer will @@ -163,6 +176,13 @@ type UnsafeAPEManagerServiceServer interface { } func RegisterAPEManagerServiceServer(s grpc.ServiceRegistrar, srv APEManagerServiceServer) { + // If the following call pancis, it indicates UnimplementedAPEManagerServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&APEManagerService_ServiceDesc, srv) } diff --git a/api/apemanager/grpc/service_protoopaque.pb.go b/api/apemanager/grpc/service_protoopaque.pb.go new file mode 100644 index 0000000..5ccadc0 --- /dev/null +++ b/api/apemanager/grpc/service_protoopaque.pb.go @@ -0,0 +1,1458 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/apemanager/grpc/service.proto + +//go:build protoopaque + +package apemanager + +import ( + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/ape/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type AddChainRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *AddChainRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddChainRequest) Reset() { + *x = AddChainRequest{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *AddChainRequest) GetBody() *AddChainRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *AddChainRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *AddChainRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *AddChainRequest) SetBody(v *AddChainRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *AddChainRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *AddChainRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *AddChainRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *AddChainRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *AddChainRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *AddChainRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *AddChainRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *AddChainRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type AddChainRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The request's body. + Body *AddChainRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 AddChainRequest_builder) Build() *AddChainRequest { + m0 := &AddChainRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +type AddChainResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *AddChainResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddChainResponse) Reset() { + *x = AddChainResponse{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *AddChainResponse) GetBody() *AddChainResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *AddChainResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *AddChainResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *AddChainResponse) SetBody(v *AddChainResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *AddChainResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *AddChainResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *AddChainResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *AddChainResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *AddChainResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *AddChainResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *AddChainResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *AddChainResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type AddChainResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The response's body. + Body *AddChainResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 AddChainResponse_builder) Build() *AddChainResponse { + m0 := &AddChainResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +type RemoveChainRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *RemoveChainRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveChainRequest) Reset() { + *x = RemoveChainRequest{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *RemoveChainRequest) GetBody() *RemoveChainRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *RemoveChainRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *RemoveChainRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *RemoveChainRequest) SetBody(v *RemoveChainRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *RemoveChainRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *RemoveChainRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *RemoveChainRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *RemoveChainRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *RemoveChainRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *RemoveChainRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *RemoveChainRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *RemoveChainRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type RemoveChainRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The request's body. + Body *RemoveChainRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 RemoveChainRequest_builder) Build() *RemoveChainRequest { + m0 := &RemoveChainRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +type RemoveChainResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *RemoveChainResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveChainResponse) Reset() { + *x = RemoveChainResponse{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *RemoveChainResponse) GetBody() *RemoveChainResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *RemoveChainResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *RemoveChainResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *RemoveChainResponse) SetBody(v *RemoveChainResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *RemoveChainResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *RemoveChainResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *RemoveChainResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *RemoveChainResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *RemoveChainResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *RemoveChainResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *RemoveChainResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *RemoveChainResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type RemoveChainResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The response's body. + Body *RemoveChainResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 RemoveChainResponse_builder) Build() *RemoveChainResponse { + m0 := &RemoveChainResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +type ListChainsRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *ListChainsRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListChainsRequest) Reset() { + *x = ListChainsRequest{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListChainsRequest) GetBody() *ListChainsRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *ListChainsRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *ListChainsRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *ListChainsRequest) SetBody(v *ListChainsRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *ListChainsRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *ListChainsRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *ListChainsRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *ListChainsRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *ListChainsRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *ListChainsRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *ListChainsRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *ListChainsRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type ListChainsRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The request's body. + Body *ListChainsRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 ListChainsRequest_builder) Build() *ListChainsRequest { + m0 := &ListChainsRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +type ListChainsResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *ListChainsResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListChainsResponse) Reset() { + *x = ListChainsResponse{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListChainsResponse) GetBody() *ListChainsResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *ListChainsResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *ListChainsResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *ListChainsResponse) SetBody(v *ListChainsResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *ListChainsResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *ListChainsResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *ListChainsResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *ListChainsResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *ListChainsResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *ListChainsResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *ListChainsResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *ListChainsResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type ListChainsResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The response's body. + Body *ListChainsResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 ListChainsResponse_builder) Build() *ListChainsResponse { + m0 := &ListChainsResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +type AddChainRequest_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Target *grpc1.ChainTarget `protobuf:"bytes,1,opt,name=target" json:"target,omitempty"` + xxx_hidden_Chain *grpc1.Chain `protobuf:"bytes,2,opt,name=chain" json:"chain,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddChainRequest_Body) Reset() { + *x = AddChainRequest_Body{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *AddChainRequest_Body) GetTarget() *grpc1.ChainTarget { + if x != nil { + return x.xxx_hidden_Target + } + return nil +} + +func (x *AddChainRequest_Body) GetChain() *grpc1.Chain { + if x != nil { + return x.xxx_hidden_Chain + } + return nil +} + +func (x *AddChainRequest_Body) SetTarget(v *grpc1.ChainTarget) { + x.xxx_hidden_Target = v +} + +func (x *AddChainRequest_Body) SetChain(v *grpc1.Chain) { + x.xxx_hidden_Chain = v +} + +func (x *AddChainRequest_Body) HasTarget() bool { + if x == nil { + return false + } + return x.xxx_hidden_Target != nil +} + +func (x *AddChainRequest_Body) HasChain() bool { + if x == nil { + return false + } + return x.xxx_hidden_Chain != nil +} + +func (x *AddChainRequest_Body) ClearTarget() { + x.xxx_hidden_Target = nil +} + +func (x *AddChainRequest_Body) ClearChain() { + x.xxx_hidden_Chain = nil +} + +type AddChainRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // A target for which a rule chain is added. + Target *grpc1.ChainTarget + // The chain to set for the target. + Chain *grpc1.Chain +} + +func (b0 AddChainRequest_Body_builder) Build() *AddChainRequest_Body { + m0 := &AddChainRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Target = b.Target + x.xxx_hidden_Chain = b.Chain + return m0 +} + +type AddChainResponse_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_ChainId []byte `protobuf:"bytes,1,opt,name=chain_id,json=chainId" json:"chain_id,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddChainResponse_Body) Reset() { + *x = AddChainResponse_Body{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *AddChainResponse_Body) GetChainId() []byte { + if x != nil { + return x.xxx_hidden_ChainId + } + return nil +} + +func (x *AddChainResponse_Body) SetChainId(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_ChainId = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 1) +} + +func (x *AddChainResponse_Body) HasChainId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *AddChainResponse_Body) ClearChainId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_ChainId = nil +} + +type AddChainResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Chain ID assigned for the added rule chain. + // If chain ID is left empty in the request, then + // it will be generated. + ChainId []byte +} + +func (b0 AddChainResponse_Body_builder) Build() *AddChainResponse_Body { + m0 := &AddChainResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + if b.ChainId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 1) + x.xxx_hidden_ChainId = b.ChainId + } + return m0 +} + +type RemoveChainRequest_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Target *grpc1.ChainTarget `protobuf:"bytes,1,opt,name=target" json:"target,omitempty"` + xxx_hidden_ChainId []byte `protobuf:"bytes,2,opt,name=chain_id,json=chainId" json:"chain_id,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveChainRequest_Body) Reset() { + *x = RemoveChainRequest_Body{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *RemoveChainRequest_Body) GetTarget() *grpc1.ChainTarget { + if x != nil { + return x.xxx_hidden_Target + } + return nil +} + +func (x *RemoveChainRequest_Body) GetChainId() []byte { + if x != nil { + return x.xxx_hidden_ChainId + } + return nil +} + +func (x *RemoveChainRequest_Body) SetTarget(v *grpc1.ChainTarget) { + x.xxx_hidden_Target = v +} + +func (x *RemoveChainRequest_Body) SetChainId(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_ChainId = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2) +} + +func (x *RemoveChainRequest_Body) HasTarget() bool { + if x == nil { + return false + } + return x.xxx_hidden_Target != nil +} + +func (x *RemoveChainRequest_Body) HasChainId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *RemoveChainRequest_Body) ClearTarget() { + x.xxx_hidden_Target = nil +} + +func (x *RemoveChainRequest_Body) ClearChainId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_ChainId = nil +} + +type RemoveChainRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Target for which a rule chain is removed. + Target *grpc1.ChainTarget + // Chain ID assigned for the rule chain. + ChainId []byte +} + +func (b0 RemoveChainRequest_Body_builder) Build() *RemoveChainRequest_Body { + m0 := &RemoveChainRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Target = b.Target + if b.ChainId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2) + x.xxx_hidden_ChainId = b.ChainId + } + return m0 +} + +// 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 `protogen:"opaque.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveChainResponse_Body) Reset() { + *x = RemoveChainResponse_Body{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +type RemoveChainResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + +} + +func (b0 RemoveChainResponse_Body_builder) Build() *RemoveChainResponse_Body { + m0 := &RemoveChainResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + return m0 +} + +type ListChainsRequest_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Target *grpc1.ChainTarget `protobuf:"bytes,1,opt,name=target" json:"target,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListChainsRequest_Body) Reset() { + *x = ListChainsRequest_Body{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListChainsRequest_Body) GetTarget() *grpc1.ChainTarget { + if x != nil { + return x.xxx_hidden_Target + } + return nil +} + +func (x *ListChainsRequest_Body) SetTarget(v *grpc1.ChainTarget) { + x.xxx_hidden_Target = v +} + +func (x *ListChainsRequest_Body) HasTarget() bool { + if x == nil { + return false + } + return x.xxx_hidden_Target != nil +} + +func (x *ListChainsRequest_Body) ClearTarget() { + x.xxx_hidden_Target = nil +} + +type ListChainsRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Target for which rule chains are listed. + Target *grpc1.ChainTarget +} + +func (b0 ListChainsRequest_Body_builder) Build() *ListChainsRequest_Body { + m0 := &ListChainsRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Target = b.Target + return m0 +} + +type ListChainsResponse_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Chains *[]*grpc1.Chain `protobuf:"bytes,1,rep,name=chains" json:"chains,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListChainsResponse_Body) Reset() { + *x = ListChainsResponse_Body{} + mi := &file_api_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_api_apemanager_grpc_service_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListChainsResponse_Body) GetChains() []*grpc1.Chain { + if x != nil { + if x.xxx_hidden_Chains != nil { + return *x.xxx_hidden_Chains + } + } + return nil +} + +func (x *ListChainsResponse_Body) SetChains(v []*grpc1.Chain) { + x.xxx_hidden_Chains = &v +} + +type ListChainsResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The list of chains defined for the reqeusted target. + Chains []*grpc1.Chain +} + +func (b0 ListChainsResponse_Body_builder) Build() *ListChainsResponse_Body { + m0 := &ListChainsResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Chains = &b.Chains + return m0 +} + +var File_api_apemanager_grpc_service_proto protoreflect.FileDescriptor + +var file_api_apemanager_grpc_service_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x61, 0x70, 0x69, 0x2f, 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, 0x18, 0x61, 0x70, 0x69, 0x2f, + 0x61, 0x70, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 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, 0x4d, 0x5a, 0x4b, 0x67, 0x69, 0x74, + 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, + 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_apemanager_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_api_apemanager_grpc_service_proto_goTypes = []any{ + (*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_api_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_api_apemanager_grpc_service_proto_init() } +func file_api_apemanager_grpc_service_proto_init() { + if File_api_apemanager_grpc_service_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_apemanager_grpc_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 12, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_api_apemanager_grpc_service_proto_goTypes, + DependencyIndexes: file_api_apemanager_grpc_service_proto_depIdxs, + MessageInfos: file_api_apemanager_grpc_service_proto_msgTypes, + }.Build() + File_api_apemanager_grpc_service_proto = out.File + file_api_apemanager_grpc_service_proto_rawDesc = nil + file_api_apemanager_grpc_service_proto_goTypes = nil + file_api_apemanager_grpc_service_proto_depIdxs = nil +} diff --git a/api/container/convert.go b/api/container/convert.go index 5a9a805..a7245d4 100644 --- a/api/container/convert.go +++ b/api/container/convert.go @@ -37,24 +37,24 @@ func (a *Attribute) FromGRPCMessage(m grpc.Message) error { return nil } -func AttributesToGRPC(xs []Attribute) (res []container.Container_Attribute) { +func AttributesToGRPC(xs []Attribute) (res []*container.Container_Attribute) { if xs != nil { - res = make([]container.Container_Attribute, 0, len(xs)) + res = make([]*container.Container_Attribute, 0, len(xs)) for i := range xs { - res = append(res, *xs[i].ToGRPCMessage().(*container.Container_Attribute)) + res = append(res, xs[i].ToGRPCMessage().(*container.Container_Attribute)) } } return } -func AttributesFromGRPC(xs []container.Container_Attribute) (res []Attribute, err error) { +func AttributesFromGRPC(xs []*container.Container_Attribute) (res []Attribute, err error) { if xs != nil { res = make([]Attribute, len(xs)) for i := range xs { - err = res[i].FromGRPCMessage(&xs[i]) + err = res[i].FromGRPCMessage(xs[i]) if err != nil { return } diff --git a/api/container/grpc/service.pb.go b/api/container/grpc/service.pb.go new file mode 100644 index 0000000..280aa20 --- /dev/null +++ b/api/container/grpc/service.pb.go @@ -0,0 +1,2487 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/container/grpc/service.proto + +//go:build !protoopaque + +package container + +import ( + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// New FrostFS Container creation request +type PutRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of container put request message. + Body *PutRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutRequest) Reset() { + *x = PutRequest{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *PutRequest) SetBody(v *PutRequest_Body) { + x.Body = v +} + +func (x *PutRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *PutRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *PutRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *PutRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *PutRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *PutRequest) ClearBody() { + x.Body = nil +} + +func (x *PutRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *PutRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type PutRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of container put request message. + Body *PutRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 PutRequest_builder) Build() *PutRequest { + m0 := &PutRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// New FrostFS Container creation response +type PutResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of container put response message. + Body *PutResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutResponse) Reset() { + *x = PutResponse{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *PutResponse) SetBody(v *PutResponse_Body) { + x.Body = v +} + +func (x *PutResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *PutResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *PutResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *PutResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *PutResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *PutResponse) ClearBody() { + x.Body = nil +} + +func (x *PutResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *PutResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type PutResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of container put response message. + Body *PutResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 PutResponse_builder) Build() *PutResponse { + m0 := &PutResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Container removal request +type DeleteRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of container delete request message. + Body *DeleteRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteRequest) Reset() { + *x = DeleteRequest{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *DeleteRequest) SetBody(v *DeleteRequest_Body) { + x.Body = v +} + +func (x *DeleteRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *DeleteRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *DeleteRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *DeleteRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *DeleteRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *DeleteRequest) ClearBody() { + x.Body = nil +} + +func (x *DeleteRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *DeleteRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type DeleteRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of container delete request message. + Body *DeleteRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 DeleteRequest_builder) Build() *DeleteRequest { + m0 := &DeleteRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// `DeleteResponse` has an empty body because delete operation is asynchronous +// and done via consensus in Inner Ring nodes. +type DeleteResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of container delete response message. + Body *DeleteResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteResponse) Reset() { + *x = DeleteResponse{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *DeleteResponse) SetBody(v *DeleteResponse_Body) { + x.Body = v +} + +func (x *DeleteResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *DeleteResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *DeleteResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *DeleteResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *DeleteResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *DeleteResponse) ClearBody() { + x.Body = nil +} + +func (x *DeleteResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *DeleteResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type DeleteResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of container delete response message. + Body *DeleteResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 DeleteResponse_builder) Build() *DeleteResponse { + m0 := &DeleteResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Get container structure +type GetRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of container get request message. + Body *GetRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRequest) Reset() { + *x = GetRequest{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *GetRequest) SetBody(v *GetRequest_Body) { + x.Body = v +} + +func (x *GetRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *GetRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *GetRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *GetRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *GetRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *GetRequest) ClearBody() { + x.Body = nil +} + +func (x *GetRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *GetRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type GetRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of container get request message. + Body *GetRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 GetRequest_builder) Build() *GetRequest { + m0 := &GetRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Get container structure +type GetResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of container get response message. + Body *GetResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetResponse) Reset() { + *x = GetResponse{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *GetResponse) SetBody(v *GetResponse_Body) { + x.Body = v +} + +func (x *GetResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *GetResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *GetResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *GetResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *GetResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *GetResponse) ClearBody() { + x.Body = nil +} + +func (x *GetResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *GetResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type GetResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of container get response message. + Body *GetResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 GetResponse_builder) Build() *GetResponse { + m0 := &GetResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// List containers +type ListRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of list containers request message + Body *ListRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListRequest) Reset() { + *x = ListRequest{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *ListRequest) SetBody(v *ListRequest_Body) { + x.Body = v +} + +func (x *ListRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *ListRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *ListRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *ListRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *ListRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *ListRequest) ClearBody() { + x.Body = nil +} + +func (x *ListRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *ListRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type ListRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of list containers request message + Body *ListRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 ListRequest_builder) Build() *ListRequest { + m0 := &ListRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// List containers +type ListResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of list containers response message. + Body *ListResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListResponse) Reset() { + *x = ListResponse{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *ListResponse) SetBody(v *ListResponse_Body) { + x.Body = v +} + +func (x *ListResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *ListResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *ListResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *ListResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *ListResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *ListResponse) ClearBody() { + x.Body = nil +} + +func (x *ListResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *ListResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type ListResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of list containers response message. + Body *ListResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 ListResponse_builder) Build() *ListResponse { + m0 := &ListResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// List containers stream +type ListStreamRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of list containers stream request message. + Body *ListStreamRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListStreamRequest) Reset() { + *x = ListStreamRequest{} + mi := &file_api_container_grpc_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListStreamRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListStreamRequest) ProtoMessage() {} + +func (x *ListStreamRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_container_grpc_service_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListStreamRequest) GetBody() *ListStreamRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *ListStreamRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *ListStreamRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +func (x *ListStreamRequest) SetBody(v *ListStreamRequest_Body) { + x.Body = v +} + +func (x *ListStreamRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *ListStreamRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *ListStreamRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *ListStreamRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *ListStreamRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *ListStreamRequest) ClearBody() { + x.Body = nil +} + +func (x *ListStreamRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *ListStreamRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type ListStreamRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of list containers stream request message. + Body *ListStreamRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 ListStreamRequest_builder) Build() *ListStreamRequest { + m0 := &ListStreamRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// List containers stream +type ListStreamResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of list containers stream response message. + Body *ListStreamResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListStreamResponse) Reset() { + *x = ListStreamResponse{} + mi := &file_api_container_grpc_service_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListStreamResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListStreamResponse) ProtoMessage() {} + +func (x *ListStreamResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_container_grpc_service_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListStreamResponse) GetBody() *ListStreamResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *ListStreamResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *ListStreamResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +func (x *ListStreamResponse) SetBody(v *ListStreamResponse_Body) { + x.Body = v +} + +func (x *ListStreamResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *ListStreamResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *ListStreamResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *ListStreamResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *ListStreamResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *ListStreamResponse) ClearBody() { + x.Body = nil +} + +func (x *ListStreamResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *ListStreamResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type ListStreamResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of list containers stream response message. + Body *ListStreamResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 ListStreamResponse_builder) Build() *ListStreamResponse { + m0 := &ListStreamResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // Container structure to register in FrostFS + Container *Container `protobuf:"bytes,1,opt,name=container" json:"container,omitempty"` + // Signature of a stable-marshalled container according to RFC-6979. + Signature *grpc1.SignatureRFC6979 `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutRequest_Body) Reset() { + *x = PutRequest_Body{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *PutRequest_Body) SetContainer(v *Container) { + x.Container = v +} + +func (x *PutRequest_Body) SetSignature(v *grpc1.SignatureRFC6979) { + x.Signature = v +} + +func (x *PutRequest_Body) HasContainer() bool { + if x == nil { + return false + } + return x.Container != nil +} + +func (x *PutRequest_Body) HasSignature() bool { + if x == nil { + return false + } + return x.Signature != nil +} + +func (x *PutRequest_Body) ClearContainer() { + x.Container = nil +} + +func (x *PutRequest_Body) ClearSignature() { + x.Signature = nil +} + +type PutRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Container structure to register in FrostFS + Container *Container + // Signature of a stable-marshalled container according to RFC-6979. + Signature *grpc1.SignatureRFC6979 +} + +func (b0 PutRequest_Body_builder) Build() *PutRequest_Body { + m0 := &PutRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.Container = b.Container + x.Signature = b.Signature + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // Unique identifier of the newly created container + ContainerId *grpc1.ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerId" json:"container_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutResponse_Body) Reset() { + *x = PutResponse_Body{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PutResponse_Body) GetContainerId() *grpc1.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} + +func (x *PutResponse_Body) SetContainerId(v *grpc1.ContainerID) { + x.ContainerId = v +} + +func (x *PutResponse_Body) HasContainerId() bool { + if x == nil { + return false + } + return x.ContainerId != nil +} + +func (x *PutResponse_Body) ClearContainerId() { + x.ContainerId = nil +} + +type PutResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Unique identifier of the newly created container + ContainerId *grpc1.ContainerID +} + +func (b0 PutResponse_Body_builder) Build() *PutResponse_Body { + m0 := &PutResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.ContainerId = b.ContainerId + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // Identifier of the container to delete from FrostFS + ContainerId *grpc1.ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerId" 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" json:"signature,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteRequest_Body) Reset() { + *x = DeleteRequest_Body{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *DeleteRequest_Body) SetContainerId(v *grpc1.ContainerID) { + x.ContainerId = v +} + +func (x *DeleteRequest_Body) SetSignature(v *grpc1.SignatureRFC6979) { + x.Signature = v +} + +func (x *DeleteRequest_Body) HasContainerId() bool { + if x == nil { + return false + } + return x.ContainerId != nil +} + +func (x *DeleteRequest_Body) HasSignature() bool { + if x == nil { + return false + } + return x.Signature != nil +} + +func (x *DeleteRequest_Body) ClearContainerId() { + x.ContainerId = nil +} + +func (x *DeleteRequest_Body) ClearSignature() { + x.Signature = nil +} + +type DeleteRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Identifier of the container to delete from FrostFS + ContainerId *grpc1.ContainerID + // `ContainerID` signed with the container owner's key according to + // RFC-6979. + Signature *grpc1.SignatureRFC6979 +} + +func (b0 DeleteRequest_Body_builder) Build() *DeleteRequest_Body { + m0 := &DeleteRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.ContainerId = b.ContainerId + x.Signature = b.Signature + return m0 +} + +// `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 `protogen:"hybrid.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteResponse_Body) Reset() { + *x = DeleteResponse_Body{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +type DeleteResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + +} + +func (b0 DeleteResponse_Body_builder) Build() *DeleteResponse_Body { + m0 := &DeleteResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + return m0 +} + +// Get container structure request body. +type GetRequest_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Identifier of the container to get + ContainerId *grpc1.ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerId" json:"container_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRequest_Body) Reset() { + *x = GetRequest_Body{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetRequest_Body) GetContainerId() *grpc1.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} + +func (x *GetRequest_Body) SetContainerId(v *grpc1.ContainerID) { + x.ContainerId = v +} + +func (x *GetRequest_Body) HasContainerId() bool { + if x == nil { + return false + } + return x.ContainerId != nil +} + +func (x *GetRequest_Body) ClearContainerId() { + x.ContainerId = nil +} + +type GetRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Identifier of the container to get + ContainerId *grpc1.ContainerID +} + +func (b0 GetRequest_Body_builder) Build() *GetRequest_Body { + m0 := &GetRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.ContainerId = b.ContainerId + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // Requested container structure + Container *Container `protobuf:"bytes,1,opt,name=container" json:"container,omitempty"` + // Signature of a stable-marshalled container according to RFC-6979. + Signature *grpc1.SignatureRFC6979 `protobuf:"bytes,2,opt,name=signature" 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" json:"session_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetResponse_Body) Reset() { + *x = GetResponse_Body{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *GetResponse_Body) SetContainer(v *Container) { + x.Container = v +} + +func (x *GetResponse_Body) SetSignature(v *grpc1.SignatureRFC6979) { + x.Signature = v +} + +func (x *GetResponse_Body) SetSessionToken(v *grpc.SessionToken) { + x.SessionToken = v +} + +func (x *GetResponse_Body) HasContainer() bool { + if x == nil { + return false + } + return x.Container != nil +} + +func (x *GetResponse_Body) HasSignature() bool { + if x == nil { + return false + } + return x.Signature != nil +} + +func (x *GetResponse_Body) HasSessionToken() bool { + if x == nil { + return false + } + return x.SessionToken != nil +} + +func (x *GetResponse_Body) ClearContainer() { + x.Container = nil +} + +func (x *GetResponse_Body) ClearSignature() { + x.Signature = nil +} + +func (x *GetResponse_Body) ClearSessionToken() { + x.SessionToken = nil +} + +type GetResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Requested container structure + Container *Container + // Signature of a stable-marshalled container according to RFC-6979. + Signature *grpc1.SignatureRFC6979 + // Session token if the container has been created within the session + SessionToken *grpc.SessionToken +} + +func (b0 GetResponse_Body_builder) Build() *GetResponse_Body { + m0 := &GetResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.Container = b.Container + x.Signature = b.Signature + x.SessionToken = b.SessionToken + return m0 +} + +// List containers request body. +type ListRequest_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Identifier of the container owner + OwnerId *grpc1.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId" json:"owner_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListRequest_Body) Reset() { + *x = ListRequest_Body{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListRequest_Body) GetOwnerId() *grpc1.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} + +func (x *ListRequest_Body) SetOwnerId(v *grpc1.OwnerID) { + x.OwnerId = v +} + +func (x *ListRequest_Body) HasOwnerId() bool { + if x == nil { + return false + } + return x.OwnerId != nil +} + +func (x *ListRequest_Body) ClearOwnerId() { + x.OwnerId = nil +} + +type ListRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Identifier of the container owner + OwnerId *grpc1.OwnerID +} + +func (b0 ListRequest_Body_builder) Build() *ListRequest_Body { + m0 := &ListRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.OwnerId = b.OwnerId + return m0 +} + +// List containers response body. +type ListResponse_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // List of `ContainerID`s belonging to the requested `OwnerID` + ContainerIds []*grpc1.ContainerID `protobuf:"bytes,1,rep,name=container_ids,json=containerIds" json:"container_ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListResponse_Body) Reset() { + *x = ListResponse_Body{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListResponse_Body) GetContainerIds() []*grpc1.ContainerID { + if x != nil { + return x.ContainerIds + } + return nil +} + +func (x *ListResponse_Body) SetContainerIds(v []*grpc1.ContainerID) { + x.ContainerIds = v +} + +type ListResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // List of `ContainerID`s belonging to the requested `OwnerID` + ContainerIds []*grpc1.ContainerID +} + +func (b0 ListResponse_Body_builder) Build() *ListResponse_Body { + m0 := &ListResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.ContainerIds = b.ContainerIds + return m0 +} + +// List containers stream request body. +type ListStreamRequest_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Identifier of the container owner. + OwnerId *grpc1.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId" json:"owner_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListStreamRequest_Body) Reset() { + *x = ListStreamRequest_Body{} + mi := &file_api_container_grpc_service_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListStreamRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListStreamRequest_Body) ProtoMessage() {} + +func (x *ListStreamRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_api_container_grpc_service_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListStreamRequest_Body) GetOwnerId() *grpc1.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} + +func (x *ListStreamRequest_Body) SetOwnerId(v *grpc1.OwnerID) { + x.OwnerId = v +} + +func (x *ListStreamRequest_Body) HasOwnerId() bool { + if x == nil { + return false + } + return x.OwnerId != nil +} + +func (x *ListStreamRequest_Body) ClearOwnerId() { + x.OwnerId = nil +} + +type ListStreamRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Identifier of the container owner. + OwnerId *grpc1.OwnerID +} + +func (b0 ListStreamRequest_Body_builder) Build() *ListStreamRequest_Body { + m0 := &ListStreamRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.OwnerId = b.OwnerId + return m0 +} + +// List containers stream response body. +type ListStreamResponse_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // List of `ContainerID`s belonging to the requested `OwnerID` + ContainerIds []*grpc1.ContainerID `protobuf:"bytes,1,rep,name=container_ids,json=containerIds" json:"container_ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListStreamResponse_Body) Reset() { + *x = ListStreamResponse_Body{} + mi := &file_api_container_grpc_service_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListStreamResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListStreamResponse_Body) ProtoMessage() {} + +func (x *ListStreamResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_api_container_grpc_service_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListStreamResponse_Body) GetContainerIds() []*grpc1.ContainerID { + if x != nil { + return x.ContainerIds + } + return nil +} + +func (x *ListStreamResponse_Body) SetContainerIds(v []*grpc1.ContainerID) { + x.ContainerIds = v +} + +type ListStreamResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // List of `ContainerID`s belonging to the requested `OwnerID` + ContainerIds []*grpc1.ContainerID +} + +func (b0 ListStreamResponse_Body_builder) Build() *ListStreamResponse_Body { + m0 := &ListStreamResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.ContainerIds = b.ContainerIds + return m0 +} + +var File_api_container_grpc_service_proto protoreflect.FileDescriptor + +var file_api_container_grpc_service_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x61, 0x70, 0x69, 0x2f, 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, 0x1e, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x66, + 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1c, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, + 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 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, 0xaa, 0x02, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 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, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 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, 0xbc, 0x02, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 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, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 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, 0x32, + 0xa7, 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, 0x5f, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 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, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, + 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, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x42, 0x6b, 0x5a, 0x49, 0x67, 0x69, 0x74, + 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, + 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0xaa, 0x02, 0x1d, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, + 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x62, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x70, 0xe8, 0x07, +} + +var file_api_container_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_api_container_grpc_service_proto_goTypes = []any{ + (*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 + (*ListStreamRequest)(nil), // 8: neo.fs.v2.container.ListStreamRequest + (*ListStreamResponse)(nil), // 9: neo.fs.v2.container.ListStreamResponse + (*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 + (*ListStreamRequest_Body)(nil), // 18: neo.fs.v2.container.ListStreamRequest.Body + (*ListStreamResponse_Body)(nil), // 19: neo.fs.v2.container.ListStreamResponse.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 +} +var file_api_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.ListStreamRequest.body:type_name -> neo.fs.v2.container.ListStreamRequest.Body + 20, // 25: neo.fs.v2.container.ListStreamRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 21, // 26: neo.fs.v2.container.ListStreamRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 19, // 27: neo.fs.v2.container.ListStreamResponse.body:type_name -> neo.fs.v2.container.ListStreamResponse.Body + 22, // 28: neo.fs.v2.container.ListStreamResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 23, // 29: neo.fs.v2.container.ListStreamResponse.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 + 28, // 41: neo.fs.v2.container.ListStreamRequest.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID + 26, // 42: neo.fs.v2.container.ListStreamResponse.Body.container_ids:type_name -> neo.fs.v2.refs.ContainerID + 0, // 43: neo.fs.v2.container.ContainerService.Put:input_type -> neo.fs.v2.container.PutRequest + 2, // 44: neo.fs.v2.container.ContainerService.Delete:input_type -> neo.fs.v2.container.DeleteRequest + 4, // 45: neo.fs.v2.container.ContainerService.Get:input_type -> neo.fs.v2.container.GetRequest + 6, // 46: neo.fs.v2.container.ContainerService.List:input_type -> neo.fs.v2.container.ListRequest + 8, // 47: neo.fs.v2.container.ContainerService.ListStream:input_type -> neo.fs.v2.container.ListStreamRequest + 1, // 48: neo.fs.v2.container.ContainerService.Put:output_type -> neo.fs.v2.container.PutResponse + 3, // 49: neo.fs.v2.container.ContainerService.Delete:output_type -> neo.fs.v2.container.DeleteResponse + 5, // 50: neo.fs.v2.container.ContainerService.Get:output_type -> neo.fs.v2.container.GetResponse + 7, // 51: neo.fs.v2.container.ContainerService.List:output_type -> neo.fs.v2.container.ListResponse + 9, // 52: neo.fs.v2.container.ContainerService.ListStream:output_type -> neo.fs.v2.container.ListStreamResponse + 48, // [48:53] is the sub-list for method output_type + 43, // [43:48] is the sub-list for method input_type + 43, // [43:43] is the sub-list for extension type_name + 43, // [43:43] is the sub-list for extension extendee + 0, // [0:43] is the sub-list for field type_name +} + +func init() { file_api_container_grpc_service_proto_init() } +func file_api_container_grpc_service_proto_init() { + if File_api_container_grpc_service_proto != nil { + return + } + file_api_container_grpc_types_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_container_grpc_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 20, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_api_container_grpc_service_proto_goTypes, + DependencyIndexes: file_api_container_grpc_service_proto_depIdxs, + MessageInfos: file_api_container_grpc_service_proto_msgTypes, + }.Build() + File_api_container_grpc_service_proto = out.File + file_api_container_grpc_service_proto_rawDesc = nil + file_api_container_grpc_service_proto_goTypes = nil + file_api_container_grpc_service_proto_depIdxs = nil +} diff --git a/api/container/grpc/service_frostfs.pb.go b/api/container/grpc/service_frostfs.pb.go deleted file mode 100644 index 0388293..0000000 --- a/api/container/grpc/service_frostfs.pb.go +++ /dev/null @@ -1,3926 +0,0 @@ -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package container - -import ( - json "encoding/json" - fmt "fmt" - grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" - grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" - pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" - proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" - encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" - easyproto "github.com/VictoriaMetrics/easyproto" - jlexer "github.com/mailru/easyjson/jlexer" - jwriter "github.com/mailru/easyjson/jwriter" -) - -type 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.EmitProtobuf(mm.AppendMessage(1)) - } - if x.Signature != nil { - 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 - } - first := true - out.RawByte('{') - { - 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 = "\"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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"containerId\":" - out.RawString(prefix) - 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.EmitProtobuf(mm.AppendMessage(1)) - } - if x.Signature != nil { - 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 - } - first := true - out.RawByte('{') - { - 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 = "\"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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"containerId\":" - out.RawString(prefix) - 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.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 *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 - } - first := true - out.RawByte('{') - { - 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 = "\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"ownerId\":" - out.RawString(prefix) - x.OwnerId.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.NestedStructureSizeUnchecked(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 { - 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, 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 - } - first := true - 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('}') -} - -// 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 = 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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 ListStreamRequest_Body struct { - OwnerId *grpc.OwnerID `json:"ownerId"` -} - -var ( - _ encoding.ProtoMarshaler = (*ListStreamRequest_Body)(nil) - _ encoding.ProtoUnmarshaler = (*ListStreamRequest_Body)(nil) - _ json.Marshaler = (*ListStreamRequest_Body)(nil) - _ json.Unmarshaler = (*ListStreamRequest_Body)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *ListStreamRequest_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 *ListStreamRequest_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 *ListStreamRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { - if x == nil { - return - } - if x.OwnerId != nil { - x.OwnerId.EmitProtobuf(mm.AppendMessage(1)) - } -} - -// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. -func (x *ListStreamRequest_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", "ListStreamRequest_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 *ListStreamRequest_Body) GetOwnerId() *grpc.OwnerID { - if x != nil { - return x.OwnerId - } - return nil -} -func (x *ListStreamRequest_Body) SetOwnerId(v *grpc.OwnerID) { - x.OwnerId = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *ListStreamRequest_Body) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *ListStreamRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"ownerId\":" - out.RawString(prefix) - x.OwnerId.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *ListStreamRequest_Body) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *ListStreamRequest_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 ListStreamRequest struct { - Body *ListStreamRequest_Body `json:"body"` - MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` - VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` -} - -var ( - _ encoding.ProtoMarshaler = (*ListStreamRequest)(nil) - _ encoding.ProtoUnmarshaler = (*ListStreamRequest)(nil) - _ json.Marshaler = (*ListStreamRequest)(nil) - _ json.Unmarshaler = (*ListStreamRequest)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *ListStreamRequest) 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 *ListStreamRequest) 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 *ListStreamRequest) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().MarshalProtobuf(buf), nil -} - -// MarshalProtobuf implements the encoding.ProtoMarshaler interface. -func (x *ListStreamRequest) 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 *ListStreamRequest) 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 *ListStreamRequest) 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", "ListStreamRequest") - } - switch fc.FieldNum { - case 1: // Body - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Body") - } - x.Body = new(ListStreamRequest_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 *ListStreamRequest) GetBody() *ListStreamRequest_Body { - if x != nil { - return x.Body - } - return nil -} -func (x *ListStreamRequest) SetBody(v *ListStreamRequest_Body) { - x.Body = v -} -func (x *ListStreamRequest) GetMetaHeader() *grpc1.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} -func (x *ListStreamRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { - x.MetaHeader = v -} -func (x *ListStreamRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} -func (x *ListStreamRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { - x.VerifyHeader = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *ListStreamRequest) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *ListStreamRequest) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *ListStreamRequest) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *ListStreamRequest) 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 *ListStreamRequest_Body - f = new(ListStreamRequest_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 ListStreamResponse_Body struct { - ContainerIds []grpc.ContainerID `json:"containerIds"` -} - -var ( - _ encoding.ProtoMarshaler = (*ListStreamResponse_Body)(nil) - _ encoding.ProtoUnmarshaler = (*ListStreamResponse_Body)(nil) - _ json.Marshaler = (*ListStreamResponse_Body)(nil) - _ json.Unmarshaler = (*ListStreamResponse_Body)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *ListStreamResponse_Body) StableSize() (size int) { - if x == nil { - return 0 - } - for i := range x.ContainerIds { - size += proto.NestedStructureSizeUnchecked(1, &x.ContainerIds[i]) - } - return size -} - -// MarshalProtobuf implements the encoding.ProtoMarshaler interface. -func (x *ListStreamResponse_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 *ListStreamResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { - if x == nil { - return - } - for i := range x.ContainerIds { - x.ContainerIds[i].EmitProtobuf(mm.AppendMessage(1)) - } -} - -// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. -func (x *ListStreamResponse_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", "ListStreamResponse_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, 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 *ListStreamResponse_Body) GetContainerIds() []grpc.ContainerID { - if x != nil { - return x.ContainerIds - } - return nil -} -func (x *ListStreamResponse_Body) SetContainerIds(v []grpc.ContainerID) { - x.ContainerIds = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *ListStreamResponse_Body) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *ListStreamResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"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('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *ListStreamResponse_Body) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *ListStreamResponse_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 = 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 ListStreamResponse struct { - Body *ListStreamResponse_Body `json:"body"` - MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` - VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` -} - -var ( - _ encoding.ProtoMarshaler = (*ListStreamResponse)(nil) - _ encoding.ProtoUnmarshaler = (*ListStreamResponse)(nil) - _ json.Marshaler = (*ListStreamResponse)(nil) - _ json.Unmarshaler = (*ListStreamResponse)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *ListStreamResponse) 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 *ListStreamResponse) 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 *ListStreamResponse) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().MarshalProtobuf(buf), nil -} - -// MarshalProtobuf implements the encoding.ProtoMarshaler interface. -func (x *ListStreamResponse) 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 *ListStreamResponse) 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 *ListStreamResponse) 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", "ListStreamResponse") - } - switch fc.FieldNum { - case 1: // Body - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Body") - } - x.Body = new(ListStreamResponse_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 *ListStreamResponse) GetBody() *ListStreamResponse_Body { - if x != nil { - return x.Body - } - return nil -} -func (x *ListStreamResponse) SetBody(v *ListStreamResponse_Body) { - x.Body = v -} -func (x *ListStreamResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} -func (x *ListStreamResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { - x.MetaHeader = v -} -func (x *ListStreamResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} -func (x *ListStreamResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { - x.VerifyHeader = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *ListStreamResponse) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *ListStreamResponse) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *ListStreamResponse) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *ListStreamResponse) 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 *ListStreamResponse_Body - f = new(ListStreamResponse_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/api/container/grpc/service_frostfs_fuzz.go b/api/container/grpc/service_frostfs_fuzz.go deleted file mode 100644 index 024b237..0000000 --- a/api/container/grpc/service_frostfs_fuzz.go +++ /dev/null @@ -1,197 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package container - -func DoFuzzProtoPutRequest(data []byte) int { - msg := new(PutRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONPutRequest(data []byte) int { - msg := new(PutRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoPutResponse(data []byte) int { - msg := new(PutResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONPutResponse(data []byte) int { - msg := new(PutResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoDeleteRequest(data []byte) int { - msg := new(DeleteRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONDeleteRequest(data []byte) int { - msg := new(DeleteRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoDeleteResponse(data []byte) int { - msg := new(DeleteResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONDeleteResponse(data []byte) int { - msg := new(DeleteResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoGetRequest(data []byte) int { - msg := new(GetRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONGetRequest(data []byte) int { - msg := new(GetRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoGetResponse(data []byte) int { - msg := new(GetResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONGetResponse(data []byte) int { - msg := new(GetResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoListRequest(data []byte) int { - msg := new(ListRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONListRequest(data []byte) int { - msg := new(ListRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoListResponse(data []byte) int { - msg := new(ListResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONListResponse(data []byte) int { - msg := new(ListResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoListStreamRequest(data []byte) int { - msg := new(ListStreamRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONListStreamRequest(data []byte) int { - msg := new(ListStreamRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoListStreamResponse(data []byte) int { - msg := new(ListStreamResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONListStreamResponse(data []byte) int { - msg := new(ListStreamResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} diff --git a/api/container/grpc/service_frostfs_test.go b/api/container/grpc/service_frostfs_test.go deleted file mode 100644 index 2844996..0000000 --- a/api/container/grpc/service_frostfs_test.go +++ /dev/null @@ -1,111 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package container - -import ( - testing "testing" -) - -func FuzzProtoPutRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoPutRequest(data) - }) -} -func FuzzJSONPutRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONPutRequest(data) - }) -} -func FuzzProtoPutResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoPutResponse(data) - }) -} -func FuzzJSONPutResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONPutResponse(data) - }) -} -func FuzzProtoDeleteRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoDeleteRequest(data) - }) -} -func FuzzJSONDeleteRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONDeleteRequest(data) - }) -} -func FuzzProtoDeleteResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoDeleteResponse(data) - }) -} -func FuzzJSONDeleteResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONDeleteResponse(data) - }) -} -func FuzzProtoGetRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoGetRequest(data) - }) -} -func FuzzJSONGetRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONGetRequest(data) - }) -} -func FuzzProtoGetResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoGetResponse(data) - }) -} -func FuzzJSONGetResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONGetResponse(data) - }) -} -func FuzzProtoListRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoListRequest(data) - }) -} -func FuzzJSONListRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONListRequest(data) - }) -} -func FuzzProtoListResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoListResponse(data) - }) -} -func FuzzJSONListResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONListResponse(data) - }) -} -func FuzzProtoListStreamRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoListStreamRequest(data) - }) -} -func FuzzJSONListStreamRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONListStreamRequest(data) - }) -} -func FuzzProtoListStreamResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoListStreamResponse(data) - }) -} -func FuzzJSONListStreamResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONListStreamResponse(data) - }) -} diff --git a/api/container/grpc/service_grpc.pb.go b/api/container/grpc/service_grpc.pb.go index 5991e81..d818251 100644 --- a/api/container/grpc/service_grpc.pb.go +++ b/api/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 v5.27.2 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.29.2 // source: api/container/grpc/service.proto package container @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( ContainerService_Put_FullMethodName = "/neo.fs.v2.container.ContainerService/Put" @@ -29,6 +29,11 @@ const ( // ContainerServiceClient is the client API for ContainerService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// `ContainerService` provides API to interact with `Container` smart contract +// in FrostFS sidechain via other FrostFS nodes. All of those actions can be +// done equivalently by directly issuing transactions and RPC calls to sidechain +// nodes. type ContainerServiceClient interface { // `Put` invokes `Container` smart contract's `Put` method and returns // response immediately. After a new block is issued in sidechain, request is @@ -83,7 +88,7 @@ type ContainerServiceClient interface { // - Common failures (SECTION_FAILURE_COMMON); // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ // container list access denied. - ListStream(ctx context.Context, in *ListStreamRequest, opts ...grpc.CallOption) (ContainerService_ListStreamClient, error) + ListStream(ctx context.Context, in *ListStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ListStreamResponse], error) } type containerServiceClient struct { @@ -95,8 +100,9 @@ func NewContainerServiceClient(cc grpc.ClientConnInterface) ContainerServiceClie } func (c *containerServiceClient) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(PutResponse) - err := c.cc.Invoke(ctx, ContainerService_Put_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ContainerService_Put_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -104,8 +110,9 @@ func (c *containerServiceClient) Put(ctx context.Context, in *PutRequest, opts . } func (c *containerServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(DeleteResponse) - err := c.cc.Invoke(ctx, ContainerService_Delete_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ContainerService_Delete_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -113,8 +120,9 @@ func (c *containerServiceClient) Delete(ctx context.Context, in *DeleteRequest, } func (c *containerServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetResponse) - err := c.cc.Invoke(ctx, ContainerService_Get_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ContainerService_Get_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -122,20 +130,22 @@ func (c *containerServiceClient) Get(ctx context.Context, in *GetRequest, opts . } func (c *containerServiceClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListResponse) - err := c.cc.Invoke(ctx, ContainerService_List_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ContainerService_List_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *containerServiceClient) ListStream(ctx context.Context, in *ListStreamRequest, opts ...grpc.CallOption) (ContainerService_ListStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &ContainerService_ServiceDesc.Streams[0], ContainerService_ListStream_FullMethodName, opts...) +func (c *containerServiceClient) ListStream(ctx context.Context, in *ListStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ListStreamResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &ContainerService_ServiceDesc.Streams[0], ContainerService_ListStream_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &containerServiceListStreamClient{stream} + x := &grpc.GenericClientStream[ListStreamRequest, ListStreamResponse]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -145,26 +155,17 @@ func (c *containerServiceClient) ListStream(ctx context.Context, in *ListStreamR return x, nil } -type ContainerService_ListStreamClient interface { - Recv() (*ListStreamResponse, error) - grpc.ClientStream -} - -type containerServiceListStreamClient struct { - grpc.ClientStream -} - -func (x *containerServiceListStreamClient) Recv() (*ListStreamResponse, error) { - m := new(ListStreamResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ContainerService_ListStreamClient = grpc.ServerStreamingClient[ListStreamResponse] // ContainerServiceServer is the server API for ContainerService service. // All implementations should embed UnimplementedContainerServiceServer -// for forward compatibility +// for forward compatibility. +// +// `ContainerService` provides API to interact with `Container` smart contract +// in FrostFS sidechain via other FrostFS nodes. All of those actions can be +// done equivalently by directly issuing transactions and RPC calls to sidechain +// nodes. type ContainerServiceServer interface { // `Put` invokes `Container` smart contract's `Put` method and returns // response immediately. After a new block is issued in sidechain, request is @@ -219,12 +220,15 @@ type ContainerServiceServer interface { // - Common failures (SECTION_FAILURE_COMMON); // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ // container list access denied. - ListStream(*ListStreamRequest, ContainerService_ListStreamServer) error + ListStream(*ListStreamRequest, grpc.ServerStreamingServer[ListStreamResponse]) error } -// UnimplementedContainerServiceServer should be embedded to have forward compatible implementations. -type UnimplementedContainerServiceServer struct { -} +// UnimplementedContainerServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedContainerServiceServer struct{} func (UnimplementedContainerServiceServer) Put(context.Context, *PutRequest) (*PutResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Put not implemented") @@ -238,9 +242,10 @@ func (UnimplementedContainerServiceServer) Get(context.Context, *GetRequest) (*G func (UnimplementedContainerServiceServer) List(context.Context, *ListRequest) (*ListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method List not implemented") } -func (UnimplementedContainerServiceServer) ListStream(*ListStreamRequest, ContainerService_ListStreamServer) error { +func (UnimplementedContainerServiceServer) ListStream(*ListStreamRequest, grpc.ServerStreamingServer[ListStreamResponse]) error { return status.Errorf(codes.Unimplemented, "method ListStream not implemented") } +func (UnimplementedContainerServiceServer) testEmbeddedByValue() {} // UnsafeContainerServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ContainerServiceServer will @@ -250,6 +255,13 @@ type UnsafeContainerServiceServer interface { } func RegisterContainerServiceServer(s grpc.ServiceRegistrar, srv ContainerServiceServer) { + // If the following call pancis, it indicates UnimplementedContainerServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&ContainerService_ServiceDesc, srv) } @@ -330,21 +342,11 @@ func _ContainerService_ListStream_Handler(srv interface{}, stream grpc.ServerStr if err := stream.RecvMsg(m); err != nil { return err } - return srv.(ContainerServiceServer).ListStream(m, &containerServiceListStreamServer{stream}) + return srv.(ContainerServiceServer).ListStream(m, &grpc.GenericServerStream[ListStreamRequest, ListStreamResponse]{ServerStream: stream}) } -type ContainerService_ListStreamServer interface { - Send(*ListStreamResponse) error - grpc.ServerStream -} - -type containerServiceListStreamServer struct { - grpc.ServerStream -} - -func (x *containerServiceListStreamServer) Send(m *ListStreamResponse) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ContainerService_ListStreamServer = grpc.ServerStreamingServer[ListStreamResponse] // ContainerService_ServiceDesc is the grpc.ServiceDesc for ContainerService service. // It's only intended for direct use with grpc.RegisterService, diff --git a/api/container/grpc/service_protoopaque.pb.go b/api/container/grpc/service_protoopaque.pb.go new file mode 100644 index 0000000..b54484c --- /dev/null +++ b/api/container/grpc/service_protoopaque.pb.go @@ -0,0 +1,2417 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/container/grpc/service.proto + +//go:build protoopaque + +package container + +import ( + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// New FrostFS Container creation request +type PutRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *PutRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutRequest) Reset() { + *x = PutRequest{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PutRequest) GetBody() *PutRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *PutRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *PutRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *PutRequest) SetBody(v *PutRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *PutRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *PutRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *PutRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *PutRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *PutRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *PutRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *PutRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *PutRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type PutRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of container put request message. + Body *PutRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 PutRequest_builder) Build() *PutRequest { + m0 := &PutRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// New FrostFS Container creation response +type PutResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *PutResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutResponse) Reset() { + *x = PutResponse{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PutResponse) GetBody() *PutResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *PutResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *PutResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *PutResponse) SetBody(v *PutResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *PutResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *PutResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *PutResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *PutResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *PutResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *PutResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *PutResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *PutResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type PutResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of container put response message. + Body *PutResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 PutResponse_builder) Build() *PutResponse { + m0 := &PutResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Container removal request +type DeleteRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *DeleteRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteRequest) Reset() { + *x = DeleteRequest{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *DeleteRequest) GetBody() *DeleteRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *DeleteRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *DeleteRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *DeleteRequest) SetBody(v *DeleteRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *DeleteRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *DeleteRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *DeleteRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *DeleteRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *DeleteRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *DeleteRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *DeleteRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *DeleteRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type DeleteRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of container delete request message. + Body *DeleteRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 DeleteRequest_builder) Build() *DeleteRequest { + m0 := &DeleteRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// `DeleteResponse` has an empty body because delete operation is asynchronous +// and done via consensus in Inner Ring nodes. +type DeleteResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *DeleteResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteResponse) Reset() { + *x = DeleteResponse{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *DeleteResponse) GetBody() *DeleteResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *DeleteResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *DeleteResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *DeleteResponse) SetBody(v *DeleteResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *DeleteResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *DeleteResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *DeleteResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *DeleteResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *DeleteResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *DeleteResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *DeleteResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *DeleteResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type DeleteResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of container delete response message. + Body *DeleteResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 DeleteResponse_builder) Build() *DeleteResponse { + m0 := &DeleteResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Get container structure +type GetRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *GetRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRequest) Reset() { + *x = GetRequest{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetRequest) GetBody() *GetRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *GetRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *GetRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *GetRequest) SetBody(v *GetRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *GetRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *GetRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *GetRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *GetRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *GetRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *GetRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *GetRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *GetRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type GetRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of container get request message. + Body *GetRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 GetRequest_builder) Build() *GetRequest { + m0 := &GetRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Get container structure +type GetResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *GetResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetResponse) Reset() { + *x = GetResponse{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetResponse) GetBody() *GetResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *GetResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *GetResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *GetResponse) SetBody(v *GetResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *GetResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *GetResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *GetResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *GetResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *GetResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *GetResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *GetResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *GetResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type GetResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of container get response message. + Body *GetResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 GetResponse_builder) Build() *GetResponse { + m0 := &GetResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// List containers +type ListRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *ListRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListRequest) Reset() { + *x = ListRequest{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListRequest) GetBody() *ListRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *ListRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *ListRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *ListRequest) SetBody(v *ListRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *ListRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *ListRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *ListRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *ListRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *ListRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *ListRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *ListRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *ListRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type ListRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of list containers request message + Body *ListRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 ListRequest_builder) Build() *ListRequest { + m0 := &ListRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// List containers +type ListResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *ListResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListResponse) Reset() { + *x = ListResponse{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListResponse) GetBody() *ListResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *ListResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *ListResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *ListResponse) SetBody(v *ListResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *ListResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *ListResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *ListResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *ListResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *ListResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *ListResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *ListResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *ListResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type ListResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of list containers response message. + Body *ListResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 ListResponse_builder) Build() *ListResponse { + m0 := &ListResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// List containers stream +type ListStreamRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *ListStreamRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListStreamRequest) Reset() { + *x = ListStreamRequest{} + mi := &file_api_container_grpc_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListStreamRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListStreamRequest) ProtoMessage() {} + +func (x *ListStreamRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_container_grpc_service_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListStreamRequest) GetBody() *ListStreamRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *ListStreamRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *ListStreamRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *ListStreamRequest) SetBody(v *ListStreamRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *ListStreamRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *ListStreamRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *ListStreamRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *ListStreamRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *ListStreamRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *ListStreamRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *ListStreamRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *ListStreamRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type ListStreamRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of list containers stream request message. + Body *ListStreamRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 ListStreamRequest_builder) Build() *ListStreamRequest { + m0 := &ListStreamRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// List containers stream +type ListStreamResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *ListStreamResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListStreamResponse) Reset() { + *x = ListStreamResponse{} + mi := &file_api_container_grpc_service_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListStreamResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListStreamResponse) ProtoMessage() {} + +func (x *ListStreamResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_container_grpc_service_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListStreamResponse) GetBody() *ListStreamResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *ListStreamResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *ListStreamResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *ListStreamResponse) SetBody(v *ListStreamResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *ListStreamResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *ListStreamResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *ListStreamResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *ListStreamResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *ListStreamResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *ListStreamResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *ListStreamResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *ListStreamResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type ListStreamResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of list containers stream response message. + Body *ListStreamResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 ListStreamResponse_builder) Build() *ListStreamResponse { + m0 := &ListStreamResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_Container *Container `protobuf:"bytes,1,opt,name=container" json:"container,omitempty"` + xxx_hidden_Signature *grpc1.SignatureRFC6979 `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutRequest_Body) Reset() { + *x = PutRequest_Body{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PutRequest_Body) GetContainer() *Container { + if x != nil { + return x.xxx_hidden_Container + } + return nil +} + +func (x *PutRequest_Body) GetSignature() *grpc1.SignatureRFC6979 { + if x != nil { + return x.xxx_hidden_Signature + } + return nil +} + +func (x *PutRequest_Body) SetContainer(v *Container) { + x.xxx_hidden_Container = v +} + +func (x *PutRequest_Body) SetSignature(v *grpc1.SignatureRFC6979) { + x.xxx_hidden_Signature = v +} + +func (x *PutRequest_Body) HasContainer() bool { + if x == nil { + return false + } + return x.xxx_hidden_Container != nil +} + +func (x *PutRequest_Body) HasSignature() bool { + if x == nil { + return false + } + return x.xxx_hidden_Signature != nil +} + +func (x *PutRequest_Body) ClearContainer() { + x.xxx_hidden_Container = nil +} + +func (x *PutRequest_Body) ClearSignature() { + x.xxx_hidden_Signature = nil +} + +type PutRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Container structure to register in FrostFS + Container *Container + // Signature of a stable-marshalled container according to RFC-6979. + Signature *grpc1.SignatureRFC6979 +} + +func (b0 PutRequest_Body_builder) Build() *PutRequest_Body { + m0 := &PutRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Container = b.Container + x.xxx_hidden_Signature = b.Signature + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_ContainerId *grpc1.ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerId" json:"container_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutResponse_Body) Reset() { + *x = PutResponse_Body{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PutResponse_Body) GetContainerId() *grpc1.ContainerID { + if x != nil { + return x.xxx_hidden_ContainerId + } + return nil +} + +func (x *PutResponse_Body) SetContainerId(v *grpc1.ContainerID) { + x.xxx_hidden_ContainerId = v +} + +func (x *PutResponse_Body) HasContainerId() bool { + if x == nil { + return false + } + return x.xxx_hidden_ContainerId != nil +} + +func (x *PutResponse_Body) ClearContainerId() { + x.xxx_hidden_ContainerId = nil +} + +type PutResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Unique identifier of the newly created container + ContainerId *grpc1.ContainerID +} + +func (b0 PutResponse_Body_builder) Build() *PutResponse_Body { + m0 := &PutResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_ContainerId = b.ContainerId + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_ContainerId *grpc1.ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerId" json:"container_id,omitempty"` + xxx_hidden_Signature *grpc1.SignatureRFC6979 `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteRequest_Body) Reset() { + *x = DeleteRequest_Body{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *DeleteRequest_Body) GetContainerId() *grpc1.ContainerID { + if x != nil { + return x.xxx_hidden_ContainerId + } + return nil +} + +func (x *DeleteRequest_Body) GetSignature() *grpc1.SignatureRFC6979 { + if x != nil { + return x.xxx_hidden_Signature + } + return nil +} + +func (x *DeleteRequest_Body) SetContainerId(v *grpc1.ContainerID) { + x.xxx_hidden_ContainerId = v +} + +func (x *DeleteRequest_Body) SetSignature(v *grpc1.SignatureRFC6979) { + x.xxx_hidden_Signature = v +} + +func (x *DeleteRequest_Body) HasContainerId() bool { + if x == nil { + return false + } + return x.xxx_hidden_ContainerId != nil +} + +func (x *DeleteRequest_Body) HasSignature() bool { + if x == nil { + return false + } + return x.xxx_hidden_Signature != nil +} + +func (x *DeleteRequest_Body) ClearContainerId() { + x.xxx_hidden_ContainerId = nil +} + +func (x *DeleteRequest_Body) ClearSignature() { + x.xxx_hidden_Signature = nil +} + +type DeleteRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Identifier of the container to delete from FrostFS + ContainerId *grpc1.ContainerID + // `ContainerID` signed with the container owner's key according to + // RFC-6979. + Signature *grpc1.SignatureRFC6979 +} + +func (b0 DeleteRequest_Body_builder) Build() *DeleteRequest_Body { + m0 := &DeleteRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_ContainerId = b.ContainerId + x.xxx_hidden_Signature = b.Signature + return m0 +} + +// `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 `protogen:"opaque.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteResponse_Body) Reset() { + *x = DeleteResponse_Body{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +type DeleteResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + +} + +func (b0 DeleteResponse_Body_builder) Build() *DeleteResponse_Body { + m0 := &DeleteResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + return m0 +} + +// Get container structure request body. +type GetRequest_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_ContainerId *grpc1.ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerId" json:"container_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRequest_Body) Reset() { + *x = GetRequest_Body{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetRequest_Body) GetContainerId() *grpc1.ContainerID { + if x != nil { + return x.xxx_hidden_ContainerId + } + return nil +} + +func (x *GetRequest_Body) SetContainerId(v *grpc1.ContainerID) { + x.xxx_hidden_ContainerId = v +} + +func (x *GetRequest_Body) HasContainerId() bool { + if x == nil { + return false + } + return x.xxx_hidden_ContainerId != nil +} + +func (x *GetRequest_Body) ClearContainerId() { + x.xxx_hidden_ContainerId = nil +} + +type GetRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Identifier of the container to get + ContainerId *grpc1.ContainerID +} + +func (b0 GetRequest_Body_builder) Build() *GetRequest_Body { + m0 := &GetRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_ContainerId = b.ContainerId + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_Container *Container `protobuf:"bytes,1,opt,name=container" json:"container,omitempty"` + xxx_hidden_Signature *grpc1.SignatureRFC6979 `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` + xxx_hidden_SessionToken *grpc.SessionToken `protobuf:"bytes,3,opt,name=session_token,json=sessionToken" json:"session_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetResponse_Body) Reset() { + *x = GetResponse_Body{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetResponse_Body) GetContainer() *Container { + if x != nil { + return x.xxx_hidden_Container + } + return nil +} + +func (x *GetResponse_Body) GetSignature() *grpc1.SignatureRFC6979 { + if x != nil { + return x.xxx_hidden_Signature + } + return nil +} + +func (x *GetResponse_Body) GetSessionToken() *grpc.SessionToken { + if x != nil { + return x.xxx_hidden_SessionToken + } + return nil +} + +func (x *GetResponse_Body) SetContainer(v *Container) { + x.xxx_hidden_Container = v +} + +func (x *GetResponse_Body) SetSignature(v *grpc1.SignatureRFC6979) { + x.xxx_hidden_Signature = v +} + +func (x *GetResponse_Body) SetSessionToken(v *grpc.SessionToken) { + x.xxx_hidden_SessionToken = v +} + +func (x *GetResponse_Body) HasContainer() bool { + if x == nil { + return false + } + return x.xxx_hidden_Container != nil +} + +func (x *GetResponse_Body) HasSignature() bool { + if x == nil { + return false + } + return x.xxx_hidden_Signature != nil +} + +func (x *GetResponse_Body) HasSessionToken() bool { + if x == nil { + return false + } + return x.xxx_hidden_SessionToken != nil +} + +func (x *GetResponse_Body) ClearContainer() { + x.xxx_hidden_Container = nil +} + +func (x *GetResponse_Body) ClearSignature() { + x.xxx_hidden_Signature = nil +} + +func (x *GetResponse_Body) ClearSessionToken() { + x.xxx_hidden_SessionToken = nil +} + +type GetResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Requested container structure + Container *Container + // Signature of a stable-marshalled container according to RFC-6979. + Signature *grpc1.SignatureRFC6979 + // Session token if the container has been created within the session + SessionToken *grpc.SessionToken +} + +func (b0 GetResponse_Body_builder) Build() *GetResponse_Body { + m0 := &GetResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Container = b.Container + x.xxx_hidden_Signature = b.Signature + x.xxx_hidden_SessionToken = b.SessionToken + return m0 +} + +// List containers request body. +type ListRequest_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_OwnerId *grpc1.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId" json:"owner_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListRequest_Body) Reset() { + *x = ListRequest_Body{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListRequest_Body) GetOwnerId() *grpc1.OwnerID { + if x != nil { + return x.xxx_hidden_OwnerId + } + return nil +} + +func (x *ListRequest_Body) SetOwnerId(v *grpc1.OwnerID) { + x.xxx_hidden_OwnerId = v +} + +func (x *ListRequest_Body) HasOwnerId() bool { + if x == nil { + return false + } + return x.xxx_hidden_OwnerId != nil +} + +func (x *ListRequest_Body) ClearOwnerId() { + x.xxx_hidden_OwnerId = nil +} + +type ListRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Identifier of the container owner + OwnerId *grpc1.OwnerID +} + +func (b0 ListRequest_Body_builder) Build() *ListRequest_Body { + m0 := &ListRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_OwnerId = b.OwnerId + return m0 +} + +// List containers response body. +type ListResponse_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_ContainerIds *[]*grpc1.ContainerID `protobuf:"bytes,1,rep,name=container_ids,json=containerIds" json:"container_ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListResponse_Body) Reset() { + *x = ListResponse_Body{} + mi := &file_api_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_api_container_grpc_service_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListResponse_Body) GetContainerIds() []*grpc1.ContainerID { + if x != nil { + if x.xxx_hidden_ContainerIds != nil { + return *x.xxx_hidden_ContainerIds + } + } + return nil +} + +func (x *ListResponse_Body) SetContainerIds(v []*grpc1.ContainerID) { + x.xxx_hidden_ContainerIds = &v +} + +type ListResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // List of `ContainerID`s belonging to the requested `OwnerID` + ContainerIds []*grpc1.ContainerID +} + +func (b0 ListResponse_Body_builder) Build() *ListResponse_Body { + m0 := &ListResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_ContainerIds = &b.ContainerIds + return m0 +} + +// List containers stream request body. +type ListStreamRequest_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_OwnerId *grpc1.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId" json:"owner_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListStreamRequest_Body) Reset() { + *x = ListStreamRequest_Body{} + mi := &file_api_container_grpc_service_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListStreamRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListStreamRequest_Body) ProtoMessage() {} + +func (x *ListStreamRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_api_container_grpc_service_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListStreamRequest_Body) GetOwnerId() *grpc1.OwnerID { + if x != nil { + return x.xxx_hidden_OwnerId + } + return nil +} + +func (x *ListStreamRequest_Body) SetOwnerId(v *grpc1.OwnerID) { + x.xxx_hidden_OwnerId = v +} + +func (x *ListStreamRequest_Body) HasOwnerId() bool { + if x == nil { + return false + } + return x.xxx_hidden_OwnerId != nil +} + +func (x *ListStreamRequest_Body) ClearOwnerId() { + x.xxx_hidden_OwnerId = nil +} + +type ListStreamRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Identifier of the container owner. + OwnerId *grpc1.OwnerID +} + +func (b0 ListStreamRequest_Body_builder) Build() *ListStreamRequest_Body { + m0 := &ListStreamRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_OwnerId = b.OwnerId + return m0 +} + +// List containers stream response body. +type ListStreamResponse_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_ContainerIds *[]*grpc1.ContainerID `protobuf:"bytes,1,rep,name=container_ids,json=containerIds" json:"container_ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListStreamResponse_Body) Reset() { + *x = ListStreamResponse_Body{} + mi := &file_api_container_grpc_service_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListStreamResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListStreamResponse_Body) ProtoMessage() {} + +func (x *ListStreamResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_api_container_grpc_service_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListStreamResponse_Body) GetContainerIds() []*grpc1.ContainerID { + if x != nil { + if x.xxx_hidden_ContainerIds != nil { + return *x.xxx_hidden_ContainerIds + } + } + return nil +} + +func (x *ListStreamResponse_Body) SetContainerIds(v []*grpc1.ContainerID) { + x.xxx_hidden_ContainerIds = &v +} + +type ListStreamResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // List of `ContainerID`s belonging to the requested `OwnerID` + ContainerIds []*grpc1.ContainerID +} + +func (b0 ListStreamResponse_Body_builder) Build() *ListStreamResponse_Body { + m0 := &ListStreamResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_ContainerIds = &b.ContainerIds + return m0 +} + +var File_api_container_grpc_service_proto protoreflect.FileDescriptor + +var file_api_container_grpc_service_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x61, 0x70, 0x69, 0x2f, 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, 0x1e, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x66, + 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1c, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, + 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 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, 0xaa, 0x02, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 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, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 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, 0xbc, 0x02, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 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, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 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, 0x32, + 0xa7, 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, 0x5f, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 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, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, + 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, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x42, 0x6b, 0x5a, 0x49, 0x67, 0x69, 0x74, + 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, + 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0xaa, 0x02, 0x1d, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, + 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x62, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x70, 0xe8, 0x07, +} + +var file_api_container_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_api_container_grpc_service_proto_goTypes = []any{ + (*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 + (*ListStreamRequest)(nil), // 8: neo.fs.v2.container.ListStreamRequest + (*ListStreamResponse)(nil), // 9: neo.fs.v2.container.ListStreamResponse + (*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 + (*ListStreamRequest_Body)(nil), // 18: neo.fs.v2.container.ListStreamRequest.Body + (*ListStreamResponse_Body)(nil), // 19: neo.fs.v2.container.ListStreamResponse.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 +} +var file_api_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.ListStreamRequest.body:type_name -> neo.fs.v2.container.ListStreamRequest.Body + 20, // 25: neo.fs.v2.container.ListStreamRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 21, // 26: neo.fs.v2.container.ListStreamRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 19, // 27: neo.fs.v2.container.ListStreamResponse.body:type_name -> neo.fs.v2.container.ListStreamResponse.Body + 22, // 28: neo.fs.v2.container.ListStreamResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 23, // 29: neo.fs.v2.container.ListStreamResponse.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 + 28, // 41: neo.fs.v2.container.ListStreamRequest.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID + 26, // 42: neo.fs.v2.container.ListStreamResponse.Body.container_ids:type_name -> neo.fs.v2.refs.ContainerID + 0, // 43: neo.fs.v2.container.ContainerService.Put:input_type -> neo.fs.v2.container.PutRequest + 2, // 44: neo.fs.v2.container.ContainerService.Delete:input_type -> neo.fs.v2.container.DeleteRequest + 4, // 45: neo.fs.v2.container.ContainerService.Get:input_type -> neo.fs.v2.container.GetRequest + 6, // 46: neo.fs.v2.container.ContainerService.List:input_type -> neo.fs.v2.container.ListRequest + 8, // 47: neo.fs.v2.container.ContainerService.ListStream:input_type -> neo.fs.v2.container.ListStreamRequest + 1, // 48: neo.fs.v2.container.ContainerService.Put:output_type -> neo.fs.v2.container.PutResponse + 3, // 49: neo.fs.v2.container.ContainerService.Delete:output_type -> neo.fs.v2.container.DeleteResponse + 5, // 50: neo.fs.v2.container.ContainerService.Get:output_type -> neo.fs.v2.container.GetResponse + 7, // 51: neo.fs.v2.container.ContainerService.List:output_type -> neo.fs.v2.container.ListResponse + 9, // 52: neo.fs.v2.container.ContainerService.ListStream:output_type -> neo.fs.v2.container.ListStreamResponse + 48, // [48:53] is the sub-list for method output_type + 43, // [43:48] is the sub-list for method input_type + 43, // [43:43] is the sub-list for extension type_name + 43, // [43:43] is the sub-list for extension extendee + 0, // [0:43] is the sub-list for field type_name +} + +func init() { file_api_container_grpc_service_proto_init() } +func file_api_container_grpc_service_proto_init() { + if File_api_container_grpc_service_proto != nil { + return + } + file_api_container_grpc_types_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_container_grpc_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 20, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_api_container_grpc_service_proto_goTypes, + DependencyIndexes: file_api_container_grpc_service_proto_depIdxs, + MessageInfos: file_api_container_grpc_service_proto_msgTypes, + }.Build() + File_api_container_grpc_service_proto = out.File + file_api_container_grpc_service_proto_rawDesc = nil + file_api_container_grpc_service_proto_goTypes = nil + file_api_container_grpc_service_proto_depIdxs = nil +} diff --git a/api/container/grpc/types.pb.go b/api/container/grpc/types.pb.go new file mode 100644 index 0000000..b815e15 --- /dev/null +++ b/api/container/grpc/types.pb.go @@ -0,0 +1,447 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/container/grpc/types.proto + +//go:build !protoopaque + +package container + +import ( + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Container is a structure that defines object placement behaviour. Objects can +// be stored only within containers. They define placement rule, attributes and +// access control information. An ID of a container is a 32 byte long SHA256 +// hash of stable-marshalled container message. +type Container struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Container format version. Effectively, the version of API library used to + // create the container. + Version *grpc.Version `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"` + // Identifier of the container owner + OwnerId *grpc.OwnerID `protobuf:"bytes,2,opt,name=owner_id,json=ownerID" json:"owner_id,omitempty"` + // Nonce is a 16 byte UUIDv4, used to avoid collisions of `ContainerID`s + Nonce []byte `protobuf:"bytes,3,opt,name=nonce" json:"nonce,omitempty"` + // `BasicACL` contains access control rules for the owner, system and others + // groups, as well as permission bits for `BearerToken` and `Extended ACL` + BasicAcl *uint32 `protobuf:"varint,4,opt,name=basic_acl,json=basicACL" json:"basic_acl,omitempty"` + // Attributes represent immutable container's meta data + Attributes []*Container_Attribute `protobuf:"bytes,5,rep,name=attributes" json:"attributes,omitempty"` + // Placement policy for the object inside the container + PlacementPolicy *grpc1.PlacementPolicy `protobuf:"bytes,6,opt,name=placement_policy,json=placementPolicy" json:"placement_policy,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Container) Reset() { + *x = Container{} + mi := &file_api_container_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Container) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Container) ProtoMessage() {} + +func (x *Container) ProtoReflect() protoreflect.Message { + mi := &file_api_container_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Container) GetVersion() *grpc.Version { + if x != nil { + return x.Version + } + return nil +} + +func (x *Container) GetOwnerId() *grpc.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} + +func (x *Container) GetNonce() []byte { + if x != nil { + return x.Nonce + } + return nil +} + +func (x *Container) GetBasicAcl() uint32 { + if x != nil && x.BasicAcl != nil { + return *x.BasicAcl + } + return 0 +} + +func (x *Container) GetAttributes() []*Container_Attribute { + if x != nil { + return x.Attributes + } + return nil +} + +func (x *Container) GetPlacementPolicy() *grpc1.PlacementPolicy { + if x != nil { + return x.PlacementPolicy + } + return nil +} + +func (x *Container) SetVersion(v *grpc.Version) { + x.Version = v +} + +func (x *Container) SetOwnerId(v *grpc.OwnerID) { + x.OwnerId = v +} + +func (x *Container) SetNonce(v []byte) { + if v == nil { + v = []byte{} + } + x.Nonce = v +} + +func (x *Container) SetBasicAcl(v uint32) { + x.BasicAcl = &v +} + +func (x *Container) SetAttributes(v []*Container_Attribute) { + x.Attributes = v +} + +func (x *Container) SetPlacementPolicy(v *grpc1.PlacementPolicy) { + x.PlacementPolicy = v +} + +func (x *Container) HasVersion() bool { + if x == nil { + return false + } + return x.Version != nil +} + +func (x *Container) HasOwnerId() bool { + if x == nil { + return false + } + return x.OwnerId != nil +} + +func (x *Container) HasNonce() bool { + if x == nil { + return false + } + return x.Nonce != nil +} + +func (x *Container) HasBasicAcl() bool { + if x == nil { + return false + } + return x.BasicAcl != nil +} + +func (x *Container) HasPlacementPolicy() bool { + if x == nil { + return false + } + return x.PlacementPolicy != nil +} + +func (x *Container) ClearVersion() { + x.Version = nil +} + +func (x *Container) ClearOwnerId() { + x.OwnerId = nil +} + +func (x *Container) ClearNonce() { + x.Nonce = nil +} + +func (x *Container) ClearBasicAcl() { + x.BasicAcl = nil +} + +func (x *Container) ClearPlacementPolicy() { + x.PlacementPolicy = nil +} + +type Container_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Container format version. Effectively, the version of API library used to + // create the container. + Version *grpc.Version + // Identifier of the container owner + OwnerId *grpc.OwnerID + // Nonce is a 16 byte UUIDv4, used to avoid collisions of `ContainerID`s + Nonce []byte + // `BasicACL` contains access control rules for the owner, system and others + // groups, as well as permission bits for `BearerToken` and `Extended ACL` + BasicAcl *uint32 + // Attributes represent immutable container's meta data + Attributes []*Container_Attribute + // Placement policy for the object inside the container + PlacementPolicy *grpc1.PlacementPolicy +} + +func (b0 Container_builder) Build() *Container { + m0 := &Container{} + b, x := &b0, m0 + _, _ = b, x + x.Version = b.Version + x.OwnerId = b.OwnerId + x.Nonce = b.Nonce + x.BasicAcl = b.BasicAcl + x.Attributes = b.Attributes + x.PlacementPolicy = b.PlacementPolicy + return m0 +} + +// `Attribute` is a user-defined Key-Value metadata pair attached to the +// container. Container attributes are immutable. They are set at the moment +// of container creation and can never be added or updated. +// +// Key name must be a container-unique valid UTF-8 string. Value can't be +// empty. Containers with duplicated attribute names or attributes with empty +// values will be considered invalid. +// +// There are some "well-known" attributes affecting system behaviour: +// +// - [ __SYSTEM__NAME ] \ +// (`__NEOFS__NAME` is deprecated) \ +// String of a human-friendly container name registered as a domain in +// NNS contract. +// - [ __SYSTEM__ZONE ] \ +// (`__NEOFS__ZONE` is deprecated) \ +// String of a zone for `__SYSTEM__NAME` (`__NEOFS__NAME` is deprecated). +// Used as a TLD of a domain name in NNS contract. If no zone is specified, +// use default zone: `container`. +// - [ __SYSTEM__DISABLE_HOMOMORPHIC_HASHING ] \ +// (`__NEOFS__DISABLE_HOMOMORPHIC_HASHING` is deprecated) \ +// Disables homomorphic hashing for the container if the value equals "true" +// string. Any other values are interpreted as missing attribute. Container +// could be accepted in a FrostFS network only if the global network hashing +// configuration value corresponds with that attribute's value. After +// container inclusion, network setting is ignored. +// +// And some well-known attributes used by applications only: +// +// - Name \ +// Human-friendly name +// - Timestamp \ +// User-defined local time of container creation in Unix Timestamp format +type Container_Attribute struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Attribute name key + Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + // Attribute value + Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Container_Attribute) Reset() { + *x = Container_Attribute{} + mi := &file_api_container_grpc_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Container_Attribute) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Container_Attribute) ProtoMessage() {} + +func (x *Container_Attribute) ProtoReflect() protoreflect.Message { + mi := &file_api_container_grpc_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Container_Attribute) GetKey() string { + if x != nil && x.Key != nil { + return *x.Key + } + return "" +} + +func (x *Container_Attribute) GetValue() string { + if x != nil && x.Value != nil { + return *x.Value + } + return "" +} + +func (x *Container_Attribute) SetKey(v string) { + x.Key = &v +} + +func (x *Container_Attribute) SetValue(v string) { + x.Value = &v +} + +func (x *Container_Attribute) HasKey() bool { + if x == nil { + return false + } + return x.Key != nil +} + +func (x *Container_Attribute) HasValue() bool { + if x == nil { + return false + } + return x.Value != nil +} + +func (x *Container_Attribute) ClearKey() { + x.Key = nil +} + +func (x *Container_Attribute) ClearValue() { + x.Value = nil +} + +type Container_Attribute_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Attribute name key + Key *string + // Attribute value + Value *string +} + +func (b0 Container_Attribute_builder) Build() *Container_Attribute { + m0 := &Container_Attribute{} + b, x := &b0, m0 + _, _ = b, x + x.Key = b.Key + x.Value = b.Value + return m0 +} + +var File_api_container_grpc_types_proto protoreflect.FileDescriptor + +var file_api_container_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2f, + 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x13, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x1a, 0x1b, 0x61, 0x70, 0x69, 0x2f, 0x6e, 0x65, 0x74, 0x6d, 0x61, + 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf2, 0x02, + 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, + 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, + 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, + 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x61, 0x73, 0x69, + 0x63, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x62, 0x61, 0x73, + 0x69, 0x63, 0x41, 0x43, 0x4c, 0x12, 0x48, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, + 0x4c, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x50, 0x6c, 0x61, + 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0f, 0x70, 0x6c, + 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x1a, 0x33, 0x0a, + 0x09, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x42, 0x6b, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, + 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, + 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0xaa, + 0x02, 0x1d, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x62, + 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_container_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_api_container_grpc_types_proto_goTypes = []any{ + (*Container)(nil), // 0: neo.fs.v2.container.Container + (*Container_Attribute)(nil), // 1: neo.fs.v2.container.Container.Attribute + (*grpc.Version)(nil), // 2: neo.fs.v2.refs.Version + (*grpc.OwnerID)(nil), // 3: neo.fs.v2.refs.OwnerID + (*grpc1.PlacementPolicy)(nil), // 4: neo.fs.v2.netmap.PlacementPolicy +} +var file_api_container_grpc_types_proto_depIdxs = []int32{ + 2, // 0: neo.fs.v2.container.Container.version:type_name -> neo.fs.v2.refs.Version + 3, // 1: neo.fs.v2.container.Container.owner_id:type_name -> neo.fs.v2.refs.OwnerID + 1, // 2: neo.fs.v2.container.Container.attributes:type_name -> neo.fs.v2.container.Container.Attribute + 4, // 3: neo.fs.v2.container.Container.placement_policy:type_name -> neo.fs.v2.netmap.PlacementPolicy + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_api_container_grpc_types_proto_init() } +func file_api_container_grpc_types_proto_init() { + if File_api_container_grpc_types_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_container_grpc_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_container_grpc_types_proto_goTypes, + DependencyIndexes: file_api_container_grpc_types_proto_depIdxs, + MessageInfos: file_api_container_grpc_types_proto_msgTypes, + }.Build() + File_api_container_grpc_types_proto = out.File + file_api_container_grpc_types_proto_rawDesc = nil + file_api_container_grpc_types_proto_goTypes = nil + file_api_container_grpc_types_proto_depIdxs = nil +} diff --git a/api/container/grpc/types_frostfs.pb.go b/api/container/grpc/types_frostfs.pb.go deleted file mode 100644 index fa4aead..0000000 --- a/api/container/grpc/types_frostfs.pb.go +++ /dev/null @@ -1,554 +0,0 @@ -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package container - -import ( - json "encoding/json" - fmt "fmt" - grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap/grpc" - grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" - pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" - proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" - encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" - easyproto "github.com/VictoriaMetrics/easyproto" - jlexer "github.com/mailru/easyjson/jlexer" - jwriter "github.com/mailru/easyjson/jwriter" - strconv "strconv" -) - -type Container_Attribute struct { - Key string `json:"key"` - Value string `json:"value"` -} - -var ( - _ encoding.ProtoMarshaler = (*Container_Attribute)(nil) - _ encoding.ProtoUnmarshaler = (*Container_Attribute)(nil) - _ json.Marshaler = (*Container_Attribute)(nil) - _ json.Unmarshaler = (*Container_Attribute)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *Container_Attribute) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.StringSize(1, x.Key) - size += proto.StringSize(2, x.Value) - return size -} - -// MarshalProtobuf implements the encoding.ProtoMarshaler interface. -func (x *Container_Attribute) MarshalProtobuf(dst []byte) []byte { - m := pool.MarshalerPool.Get() - defer pool.MarshalerPool.Put(m) - x.EmitProtobuf(m.MessageMarshaler()) - dst = m.Marshal(dst) - return dst -} - -func (x *Container_Attribute) EmitProtobuf(mm *easyproto.MessageMarshaler) { - if x == nil { - return - } - if len(x.Key) != 0 { - mm.AppendString(1, x.Key) - } - if len(x.Value) != 0 { - mm.AppendString(2, x.Value) - } -} - -// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. -func (x *Container_Attribute) UnmarshalProtobuf(src []byte) (err error) { - var fc easyproto.FieldContext - for len(src) > 0 { - src, err = fc.NextField(src) - if err != nil { - return fmt.Errorf("cannot read next field in %s", "Container_Attribute") - } - switch fc.FieldNum { - case 1: // Key - data, ok := fc.String() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Key") - } - x.Key = data - case 2: // Value - data, ok := fc.String() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Value") - } - x.Value = data - } - } - return nil -} -func (x *Container_Attribute) GetKey() string { - if x != nil { - return x.Key - } - return "" -} -func (x *Container_Attribute) SetKey(v string) { - x.Key = v -} -func (x *Container_Attribute) GetValue() string { - if x != nil { - return x.Value - } - return "" -} -func (x *Container_Attribute) SetValue(v string) { - x.Value = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *Container_Attribute) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *Container_Attribute) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"key\":" - out.RawString(prefix) - out.String(x.Key) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"value\":" - out.RawString(prefix) - out.String(x.Value) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *Container_Attribute) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *Container_Attribute) UnmarshalEasyJSON(in *jlexer.Lexer) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "key": - { - var f string - f = in.String() - x.Key = f - } - case "value": - { - var f string - f = in.String() - x.Value = f - } - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} - -type Container struct { - Version *grpc.Version `json:"version"` - OwnerId *grpc.OwnerID `json:"ownerID"` - Nonce []byte `json:"nonce"` - BasicAcl uint32 `json:"basicACL"` - Attributes []Container_Attribute `json:"attributes"` - PlacementPolicy *grpc1.PlacementPolicy `json:"placementPolicy"` -} - -var ( - _ encoding.ProtoMarshaler = (*Container)(nil) - _ encoding.ProtoUnmarshaler = (*Container)(nil) - _ json.Marshaler = (*Container)(nil) - _ json.Unmarshaler = (*Container)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *Container) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.NestedStructureSize(1, x.Version) - size += proto.NestedStructureSize(2, x.OwnerId) - size += proto.BytesSize(3, x.Nonce) - size += proto.UInt32Size(4, x.BasicAcl) - for i := range x.Attributes { - size += proto.NestedStructureSizeUnchecked(5, &x.Attributes[i]) - } - size += proto.NestedStructureSize(6, x.PlacementPolicy) - return size -} - -// MarshalProtobuf implements the encoding.ProtoMarshaler interface. -func (x *Container) MarshalProtobuf(dst []byte) []byte { - m := pool.MarshalerPool.Get() - defer pool.MarshalerPool.Put(m) - x.EmitProtobuf(m.MessageMarshaler()) - dst = m.Marshal(dst) - return dst -} - -func (x *Container) EmitProtobuf(mm *easyproto.MessageMarshaler) { - if x == nil { - return - } - if x.Version != nil { - x.Version.EmitProtobuf(mm.AppendMessage(1)) - } - if x.OwnerId != nil { - x.OwnerId.EmitProtobuf(mm.AppendMessage(2)) - } - if len(x.Nonce) != 0 { - mm.AppendBytes(3, x.Nonce) - } - if x.BasicAcl != 0 { - mm.AppendUint32(4, x.BasicAcl) - } - for i := range x.Attributes { - x.Attributes[i].EmitProtobuf(mm.AppendMessage(5)) - } - if x.PlacementPolicy != nil { - x.PlacementPolicy.EmitProtobuf(mm.AppendMessage(6)) - } -} - -// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. -func (x *Container) UnmarshalProtobuf(src []byte) (err error) { - var fc easyproto.FieldContext - for len(src) > 0 { - src, err = fc.NextField(src) - if err != nil { - return fmt.Errorf("cannot read next field in %s", "Container") - } - switch fc.FieldNum { - case 1: // Version - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Version") - } - x.Version = new(grpc.Version) - if err := x.Version.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - case 2: // OwnerId - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "OwnerId") - } - x.OwnerId = new(grpc.OwnerID) - if err := x.OwnerId.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - case 3: // Nonce - data, ok := fc.Bytes() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Nonce") - } - x.Nonce = data - case 4: // BasicAcl - data, ok := fc.Uint32() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "BasicAcl") - } - x.BasicAcl = data - case 5: // Attributes - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Attributes") - } - x.Attributes = append(x.Attributes, Container_Attribute{}) - ff := &x.Attributes[len(x.Attributes)-1] - if err := ff.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - case 6: // PlacementPolicy - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "PlacementPolicy") - } - x.PlacementPolicy = new(grpc1.PlacementPolicy) - if err := x.PlacementPolicy.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - } - } - return nil -} -func (x *Container) GetVersion() *grpc.Version { - if x != nil { - return x.Version - } - return nil -} -func (x *Container) SetVersion(v *grpc.Version) { - x.Version = v -} -func (x *Container) GetOwnerId() *grpc.OwnerID { - if x != nil { - return x.OwnerId - } - return nil -} -func (x *Container) SetOwnerId(v *grpc.OwnerID) { - x.OwnerId = v -} -func (x *Container) GetNonce() []byte { - if x != nil { - return x.Nonce - } - return nil -} -func (x *Container) SetNonce(v []byte) { - x.Nonce = v -} -func (x *Container) GetBasicAcl() uint32 { - if x != nil { - return x.BasicAcl - } - return 0 -} -func (x *Container) SetBasicAcl(v uint32) { - x.BasicAcl = v -} -func (x *Container) GetAttributes() []Container_Attribute { - if x != nil { - return x.Attributes - } - return nil -} -func (x *Container) SetAttributes(v []Container_Attribute) { - x.Attributes = v -} -func (x *Container) GetPlacementPolicy() *grpc1.PlacementPolicy { - if x != nil { - return x.PlacementPolicy - } - return nil -} -func (x *Container) SetPlacementPolicy(v *grpc1.PlacementPolicy) { - x.PlacementPolicy = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *Container) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *Container) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"version\":" - out.RawString(prefix) - x.Version.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"ownerID\":" - out.RawString(prefix) - x.OwnerId.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"nonce\":" - out.RawString(prefix) - if x.Nonce != nil { - out.Base64Bytes(x.Nonce) - } else { - out.String("") - } - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"basicACL\":" - out.RawString(prefix) - out.Uint32(x.BasicAcl) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"attributes\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Attributes { - if i != 0 { - out.RawByte(',') - } - x.Attributes[i].MarshalEasyJSON(out) - } - out.RawByte(']') - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"placementPolicy\":" - out.RawString(prefix) - x.PlacementPolicy.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *Container) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *Container) UnmarshalEasyJSON(in *jlexer.Lexer) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "version": - { - var f *grpc.Version - f = new(grpc.Version) - f.UnmarshalEasyJSON(in) - x.Version = f - } - case "ownerID": - { - var f *grpc.OwnerID - f = new(grpc.OwnerID) - f.UnmarshalEasyJSON(in) - x.OwnerId = f - } - case "nonce": - { - var f []byte - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - x.Nonce = f - } - case "basicACL": - { - var f uint32 - r := in.JsonNumber() - n := r.String() - v, err := strconv.ParseUint(n, 10, 32) - if err != nil { - in.AddError(err) - return - } - pv := uint32(v) - f = pv - x.BasicAcl = f - } - case "attributes": - { - var f Container_Attribute - var list []Container_Attribute - in.Delim('[') - for !in.IsDelim(']') { - f = Container_Attribute{} - f.UnmarshalEasyJSON(in) - list = append(list, f) - in.WantComma() - } - x.Attributes = list - in.Delim(']') - } - case "placementPolicy": - { - var f *grpc1.PlacementPolicy - f = new(grpc1.PlacementPolicy) - f.UnmarshalEasyJSON(in) - x.PlacementPolicy = f - } - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} diff --git a/api/container/grpc/types_frostfs_fuzz.go b/api/container/grpc/types_frostfs_fuzz.go deleted file mode 100644 index 5551978..0000000 --- a/api/container/grpc/types_frostfs_fuzz.go +++ /dev/null @@ -1,26 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package container - -func DoFuzzProtoContainer(data []byte) int { - msg := new(Container) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONContainer(data []byte) int { - msg := new(Container) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} diff --git a/api/container/grpc/types_frostfs_test.go b/api/container/grpc/types_frostfs_test.go deleted file mode 100644 index 64d840e..0000000 --- a/api/container/grpc/types_frostfs_test.go +++ /dev/null @@ -1,21 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package container - -import ( - testing "testing" -) - -func FuzzProtoContainer(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoContainer(data) - }) -} -func FuzzJSONContainer(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONContainer(data) - }) -} diff --git a/api/container/grpc/types_protoopaque.pb.go b/api/container/grpc/types_protoopaque.pb.go new file mode 100644 index 0000000..78ce6e6 --- /dev/null +++ b/api/container/grpc/types_protoopaque.pb.go @@ -0,0 +1,469 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/container/grpc/types.proto + +//go:build protoopaque + +package container + +import ( + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Container is a structure that defines object placement behaviour. Objects can +// be stored only within containers. They define placement rule, attributes and +// access control information. An ID of a container is a 32 byte long SHA256 +// hash of stable-marshalled container message. +type Container struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Version *grpc.Version `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"` + xxx_hidden_OwnerId *grpc.OwnerID `protobuf:"bytes,2,opt,name=owner_id,json=ownerID" json:"owner_id,omitempty"` + xxx_hidden_Nonce []byte `protobuf:"bytes,3,opt,name=nonce" json:"nonce,omitempty"` + xxx_hidden_BasicAcl uint32 `protobuf:"varint,4,opt,name=basic_acl,json=basicACL" json:"basic_acl,omitempty"` + xxx_hidden_Attributes *[]*Container_Attribute `protobuf:"bytes,5,rep,name=attributes" json:"attributes,omitempty"` + xxx_hidden_PlacementPolicy *grpc1.PlacementPolicy `protobuf:"bytes,6,opt,name=placement_policy,json=placementPolicy" json:"placement_policy,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Container) Reset() { + *x = Container{} + mi := &file_api_container_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Container) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Container) ProtoMessage() {} + +func (x *Container) ProtoReflect() protoreflect.Message { + mi := &file_api_container_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Container) GetVersion() *grpc.Version { + if x != nil { + return x.xxx_hidden_Version + } + return nil +} + +func (x *Container) GetOwnerId() *grpc.OwnerID { + if x != nil { + return x.xxx_hidden_OwnerId + } + return nil +} + +func (x *Container) GetNonce() []byte { + if x != nil { + return x.xxx_hidden_Nonce + } + return nil +} + +func (x *Container) GetBasicAcl() uint32 { + if x != nil { + return x.xxx_hidden_BasicAcl + } + return 0 +} + +func (x *Container) GetAttributes() []*Container_Attribute { + if x != nil { + if x.xxx_hidden_Attributes != nil { + return *x.xxx_hidden_Attributes + } + } + return nil +} + +func (x *Container) GetPlacementPolicy() *grpc1.PlacementPolicy { + if x != nil { + return x.xxx_hidden_PlacementPolicy + } + return nil +} + +func (x *Container) SetVersion(v *grpc.Version) { + x.xxx_hidden_Version = v +} + +func (x *Container) SetOwnerId(v *grpc.OwnerID) { + x.xxx_hidden_OwnerId = v +} + +func (x *Container) SetNonce(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Nonce = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 6) +} + +func (x *Container) SetBasicAcl(v uint32) { + x.xxx_hidden_BasicAcl = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 6) +} + +func (x *Container) SetAttributes(v []*Container_Attribute) { + x.xxx_hidden_Attributes = &v +} + +func (x *Container) SetPlacementPolicy(v *grpc1.PlacementPolicy) { + x.xxx_hidden_PlacementPolicy = v +} + +func (x *Container) HasVersion() bool { + if x == nil { + return false + } + return x.xxx_hidden_Version != nil +} + +func (x *Container) HasOwnerId() bool { + if x == nil { + return false + } + return x.xxx_hidden_OwnerId != nil +} + +func (x *Container) HasNonce() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *Container) HasBasicAcl() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *Container) HasPlacementPolicy() bool { + if x == nil { + return false + } + return x.xxx_hidden_PlacementPolicy != nil +} + +func (x *Container) ClearVersion() { + x.xxx_hidden_Version = nil +} + +func (x *Container) ClearOwnerId() { + x.xxx_hidden_OwnerId = nil +} + +func (x *Container) ClearNonce() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Nonce = nil +} + +func (x *Container) ClearBasicAcl() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_BasicAcl = 0 +} + +func (x *Container) ClearPlacementPolicy() { + x.xxx_hidden_PlacementPolicy = nil +} + +type Container_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Container format version. Effectively, the version of API library used to + // create the container. + Version *grpc.Version + // Identifier of the container owner + OwnerId *grpc.OwnerID + // Nonce is a 16 byte UUIDv4, used to avoid collisions of `ContainerID`s + Nonce []byte + // `BasicACL` contains access control rules for the owner, system and others + // groups, as well as permission bits for `BearerToken` and `Extended ACL` + BasicAcl *uint32 + // Attributes represent immutable container's meta data + Attributes []*Container_Attribute + // Placement policy for the object inside the container + PlacementPolicy *grpc1.PlacementPolicy +} + +func (b0 Container_builder) Build() *Container { + m0 := &Container{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Version = b.Version + x.xxx_hidden_OwnerId = b.OwnerId + if b.Nonce != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 6) + x.xxx_hidden_Nonce = b.Nonce + } + if b.BasicAcl != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 6) + x.xxx_hidden_BasicAcl = *b.BasicAcl + } + x.xxx_hidden_Attributes = &b.Attributes + x.xxx_hidden_PlacementPolicy = b.PlacementPolicy + return m0 +} + +// `Attribute` is a user-defined Key-Value metadata pair attached to the +// container. Container attributes are immutable. They are set at the moment +// of container creation and can never be added or updated. +// +// Key name must be a container-unique valid UTF-8 string. Value can't be +// empty. Containers with duplicated attribute names or attributes with empty +// values will be considered invalid. +// +// There are some "well-known" attributes affecting system behaviour: +// +// - [ __SYSTEM__NAME ] \ +// (`__NEOFS__NAME` is deprecated) \ +// String of a human-friendly container name registered as a domain in +// NNS contract. +// - [ __SYSTEM__ZONE ] \ +// (`__NEOFS__ZONE` is deprecated) \ +// String of a zone for `__SYSTEM__NAME` (`__NEOFS__NAME` is deprecated). +// Used as a TLD of a domain name in NNS contract. If no zone is specified, +// use default zone: `container`. +// - [ __SYSTEM__DISABLE_HOMOMORPHIC_HASHING ] \ +// (`__NEOFS__DISABLE_HOMOMORPHIC_HASHING` is deprecated) \ +// Disables homomorphic hashing for the container if the value equals "true" +// string. Any other values are interpreted as missing attribute. Container +// could be accepted in a FrostFS network only if the global network hashing +// configuration value corresponds with that attribute's value. After +// container inclusion, network setting is ignored. +// +// And some well-known attributes used by applications only: +// +// - Name \ +// Human-friendly name +// - Timestamp \ +// User-defined local time of container creation in Unix Timestamp format +type Container_Attribute struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + xxx_hidden_Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Container_Attribute) Reset() { + *x = Container_Attribute{} + mi := &file_api_container_grpc_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Container_Attribute) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Container_Attribute) ProtoMessage() {} + +func (x *Container_Attribute) ProtoReflect() protoreflect.Message { + mi := &file_api_container_grpc_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Container_Attribute) GetKey() string { + if x != nil { + if x.xxx_hidden_Key != nil { + return *x.xxx_hidden_Key + } + return "" + } + return "" +} + +func (x *Container_Attribute) GetValue() string { + if x != nil { + if x.xxx_hidden_Value != nil { + return *x.xxx_hidden_Value + } + return "" + } + return "" +} + +func (x *Container_Attribute) SetKey(v string) { + x.xxx_hidden_Key = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2) +} + +func (x *Container_Attribute) SetValue(v string) { + x.xxx_hidden_Value = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2) +} + +func (x *Container_Attribute) HasKey() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *Container_Attribute) HasValue() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *Container_Attribute) ClearKey() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Key = nil +} + +func (x *Container_Attribute) ClearValue() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Value = nil +} + +type Container_Attribute_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Attribute name key + Key *string + // Attribute value + Value *string +} + +func (b0 Container_Attribute_builder) Build() *Container_Attribute { + m0 := &Container_Attribute{} + b, x := &b0, m0 + _, _ = b, x + if b.Key != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2) + x.xxx_hidden_Key = b.Key + } + if b.Value != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2) + x.xxx_hidden_Value = b.Value + } + return m0 +} + +var File_api_container_grpc_types_proto protoreflect.FileDescriptor + +var file_api_container_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2f, + 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x13, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x1a, 0x1b, 0x61, 0x70, 0x69, 0x2f, 0x6e, 0x65, 0x74, 0x6d, 0x61, + 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf2, 0x02, + 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, + 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, + 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, + 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x61, 0x73, 0x69, + 0x63, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x62, 0x61, 0x73, + 0x69, 0x63, 0x41, 0x43, 0x4c, 0x12, 0x48, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, + 0x4c, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x50, 0x6c, 0x61, + 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0f, 0x70, 0x6c, + 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x1a, 0x33, 0x0a, + 0x09, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x42, 0x6b, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, + 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, + 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0xaa, + 0x02, 0x1d, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x62, + 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_container_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_api_container_grpc_types_proto_goTypes = []any{ + (*Container)(nil), // 0: neo.fs.v2.container.Container + (*Container_Attribute)(nil), // 1: neo.fs.v2.container.Container.Attribute + (*grpc.Version)(nil), // 2: neo.fs.v2.refs.Version + (*grpc.OwnerID)(nil), // 3: neo.fs.v2.refs.OwnerID + (*grpc1.PlacementPolicy)(nil), // 4: neo.fs.v2.netmap.PlacementPolicy +} +var file_api_container_grpc_types_proto_depIdxs = []int32{ + 2, // 0: neo.fs.v2.container.Container.version:type_name -> neo.fs.v2.refs.Version + 3, // 1: neo.fs.v2.container.Container.owner_id:type_name -> neo.fs.v2.refs.OwnerID + 1, // 2: neo.fs.v2.container.Container.attributes:type_name -> neo.fs.v2.container.Container.Attribute + 4, // 3: neo.fs.v2.container.Container.placement_policy:type_name -> neo.fs.v2.netmap.PlacementPolicy + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_api_container_grpc_types_proto_init() } +func file_api_container_grpc_types_proto_init() { + if File_api_container_grpc_types_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_container_grpc_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_container_grpc_types_proto_goTypes, + DependencyIndexes: file_api_container_grpc_types_proto_depIdxs, + MessageInfos: file_api_container_grpc_types_proto_msgTypes, + }.Build() + File_api_container_grpc_types_proto = out.File + file_api_container_grpc_types_proto_rawDesc = nil + file_api_container_grpc_types_proto_goTypes = nil + file_api_container_grpc_types_proto_depIdxs = nil +} diff --git a/api/lock/grpc/types.pb.go b/api/lock/grpc/types.pb.go new file mode 100644 index 0000000..7705522 --- /dev/null +++ b/api/lock/grpc/types.pb.go @@ -0,0 +1,148 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/lock/grpc/types.proto + +//go:build !protoopaque + +package lock + +import ( + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Lock objects protects a list of objects from being deleted. The lifetime of a +// lock object is limited similar to regular objects in +// `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) +// attribute. Lock object MUST have expiration epoch. It is impossible to delete +// a lock object via ObjectService.Delete RPC call. +type Lock struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // List of objects to lock. Must not be empty or carry empty IDs. + // All members must be of the `REGULAR` type. + Members []*grpc.ObjectID `protobuf:"bytes,1,rep,name=members" json:"members,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Lock) Reset() { + *x = Lock{} + mi := &file_api_lock_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Lock) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Lock) ProtoMessage() {} + +func (x *Lock) ProtoReflect() protoreflect.Message { + mi := &file_api_lock_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Lock) GetMembers() []*grpc.ObjectID { + if x != nil { + return x.Members + } + return nil +} + +func (x *Lock) SetMembers(v []*grpc.ObjectID) { + x.Members = v +} + +type Lock_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // List of objects to lock. Must not be empty or carry empty IDs. + // All members must be of the `REGULAR` type. + Members []*grpc.ObjectID +} + +func (b0 Lock_builder) Build() *Lock { + m0 := &Lock{} + b, x := &b0, m0 + _, _ = b, x + x.Members = b.Members + return m0 +} + +var File_api_lock_grpc_types_proto protoreflect.FileDescriptor + +var file_api_lock_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x1a, 0x19, 0x61, 0x70, 0x69, + 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3a, 0x0a, 0x04, 0x4c, 0x6f, 0x63, 0x6b, 0x12, 0x32, + 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, + 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x42, 0x5c, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, + 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, + 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x3b, 0x6c, 0x6f, 0x63, 0x6b, 0xaa, 0x02, 0x18, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, + 0x62, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_lock_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_api_lock_grpc_types_proto_goTypes = []any{ + (*Lock)(nil), // 0: neo.fs.v2.lock.Lock + (*grpc.ObjectID)(nil), // 1: neo.fs.v2.refs.ObjectID +} +var file_api_lock_grpc_types_proto_depIdxs = []int32{ + 1, // 0: neo.fs.v2.lock.Lock.members:type_name -> neo.fs.v2.refs.ObjectID + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_api_lock_grpc_types_proto_init() } +func file_api_lock_grpc_types_proto_init() { + if File_api_lock_grpc_types_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_lock_grpc_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_lock_grpc_types_proto_goTypes, + DependencyIndexes: file_api_lock_grpc_types_proto_depIdxs, + MessageInfos: file_api_lock_grpc_types_proto_msgTypes, + }.Build() + File_api_lock_grpc_types_proto = out.File + file_api_lock_grpc_types_proto_rawDesc = nil + file_api_lock_grpc_types_proto_goTypes = nil + file_api_lock_grpc_types_proto_depIdxs = nil +} diff --git a/api/lock/grpc/types_frostfs.pb.go b/api/lock/grpc/types_frostfs.pb.go deleted file mode 100644 index 19e45b0..0000000 --- a/api/lock/grpc/types_frostfs.pb.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package lock - -import ( - json "encoding/json" - fmt "fmt" - grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" - pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" - proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" - encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" - easyproto "github.com/VictoriaMetrics/easyproto" - jlexer "github.com/mailru/easyjson/jlexer" - jwriter "github.com/mailru/easyjson/jwriter" -) - -type Lock struct { - Members []grpc.ObjectID `json:"members"` -} - -var ( - _ encoding.ProtoMarshaler = (*Lock)(nil) - _ encoding.ProtoUnmarshaler = (*Lock)(nil) - _ json.Marshaler = (*Lock)(nil) - _ json.Unmarshaler = (*Lock)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *Lock) StableSize() (size int) { - if x == nil { - return 0 - } - for i := range x.Members { - size += proto.NestedStructureSizeUnchecked(1, &x.Members[i]) - } - return size -} - -// MarshalProtobuf implements the encoding.ProtoMarshaler interface. -func (x *Lock) MarshalProtobuf(dst []byte) []byte { - m := pool.MarshalerPool.Get() - defer pool.MarshalerPool.Put(m) - x.EmitProtobuf(m.MessageMarshaler()) - dst = m.Marshal(dst) - return dst -} - -func (x *Lock) EmitProtobuf(mm *easyproto.MessageMarshaler) { - if x == nil { - return - } - for i := range x.Members { - x.Members[i].EmitProtobuf(mm.AppendMessage(1)) - } -} - -// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. -func (x *Lock) UnmarshalProtobuf(src []byte) (err error) { - var fc easyproto.FieldContext - for len(src) > 0 { - src, err = fc.NextField(src) - if err != nil { - return fmt.Errorf("cannot read next field in %s", "Lock") - } - switch fc.FieldNum { - case 1: // Members - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Members") - } - x.Members = append(x.Members, grpc.ObjectID{}) - ff := &x.Members[len(x.Members)-1] - if err := ff.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - } - } - return nil -} -func (x *Lock) GetMembers() []grpc.ObjectID { - if x != nil { - return x.Members - } - return nil -} -func (x *Lock) SetMembers(v []grpc.ObjectID) { - x.Members = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *Lock) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *Lock) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"members\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Members { - if i != 0 { - out.RawByte(',') - } - x.Members[i].MarshalEasyJSON(out) - } - out.RawByte(']') - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *Lock) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *Lock) UnmarshalEasyJSON(in *jlexer.Lexer) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "members": - { - var f grpc.ObjectID - var list []grpc.ObjectID - in.Delim('[') - for !in.IsDelim(']') { - f = grpc.ObjectID{} - f.UnmarshalEasyJSON(in) - list = append(list, f) - in.WantComma() - } - x.Members = list - in.Delim(']') - } - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} diff --git a/api/lock/grpc/types_frostfs_fuzz.go b/api/lock/grpc/types_frostfs_fuzz.go deleted file mode 100644 index cb55151..0000000 --- a/api/lock/grpc/types_frostfs_fuzz.go +++ /dev/null @@ -1,26 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package lock - -func DoFuzzProtoLock(data []byte) int { - msg := new(Lock) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONLock(data []byte) int { - msg := new(Lock) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} diff --git a/api/lock/grpc/types_frostfs_test.go b/api/lock/grpc/types_frostfs_test.go deleted file mode 100644 index 7c69064..0000000 --- a/api/lock/grpc/types_frostfs_test.go +++ /dev/null @@ -1,21 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package lock - -import ( - testing "testing" -) - -func FuzzProtoLock(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoLock(data) - }) -} -func FuzzJSONLock(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONLock(data) - }) -} diff --git a/api/lock/grpc/types_protoopaque.pb.go b/api/lock/grpc/types_protoopaque.pb.go new file mode 100644 index 0000000..dd9664d --- /dev/null +++ b/api/lock/grpc/types_protoopaque.pb.go @@ -0,0 +1,148 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/lock/grpc/types.proto + +//go:build protoopaque + +package lock + +import ( + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Lock objects protects a list of objects from being deleted. The lifetime of a +// lock object is limited similar to regular objects in +// `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) +// attribute. Lock object MUST have expiration epoch. It is impossible to delete +// a lock object via ObjectService.Delete RPC call. +type Lock struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Members *[]*grpc.ObjectID `protobuf:"bytes,1,rep,name=members" json:"members,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Lock) Reset() { + *x = Lock{} + mi := &file_api_lock_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Lock) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Lock) ProtoMessage() {} + +func (x *Lock) ProtoReflect() protoreflect.Message { + mi := &file_api_lock_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Lock) GetMembers() []*grpc.ObjectID { + if x != nil { + if x.xxx_hidden_Members != nil { + return *x.xxx_hidden_Members + } + } + return nil +} + +func (x *Lock) SetMembers(v []*grpc.ObjectID) { + x.xxx_hidden_Members = &v +} + +type Lock_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // List of objects to lock. Must not be empty or carry empty IDs. + // All members must be of the `REGULAR` type. + Members []*grpc.ObjectID +} + +func (b0 Lock_builder) Build() *Lock { + m0 := &Lock{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Members = &b.Members + return m0 +} + +var File_api_lock_grpc_types_proto protoreflect.FileDescriptor + +var file_api_lock_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x1a, 0x19, 0x61, 0x70, 0x69, + 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3a, 0x0a, 0x04, 0x4c, 0x6f, 0x63, 0x6b, 0x12, 0x32, + 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, + 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x42, 0x5c, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, + 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, + 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x3b, 0x6c, 0x6f, 0x63, 0x6b, 0xaa, 0x02, 0x18, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, + 0x62, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_lock_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_api_lock_grpc_types_proto_goTypes = []any{ + (*Lock)(nil), // 0: neo.fs.v2.lock.Lock + (*grpc.ObjectID)(nil), // 1: neo.fs.v2.refs.ObjectID +} +var file_api_lock_grpc_types_proto_depIdxs = []int32{ + 1, // 0: neo.fs.v2.lock.Lock.members:type_name -> neo.fs.v2.refs.ObjectID + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_api_lock_grpc_types_proto_init() } +func file_api_lock_grpc_types_proto_init() { + if File_api_lock_grpc_types_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_lock_grpc_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_lock_grpc_types_proto_goTypes, + DependencyIndexes: file_api_lock_grpc_types_proto_depIdxs, + MessageInfos: file_api_lock_grpc_types_proto_msgTypes, + }.Build() + File_api_lock_grpc_types_proto = out.File + file_api_lock_grpc_types_proto_rawDesc = nil + file_api_lock_grpc_types_proto_goTypes = nil + file_api_lock_grpc_types_proto_depIdxs = nil +} diff --git a/api/netmap/convert.go b/api/netmap/convert.go index f8117a5..9bbb303 100644 --- a/api/netmap/convert.go +++ b/api/netmap/convert.go @@ -45,24 +45,24 @@ func (f *Filter) FromGRPCMessage(m grpc.Message) error { return nil } -func FiltersToGRPC(fs []Filter) (res []netmap.Filter) { +func FiltersToGRPC(fs []Filter) (res []*netmap.Filter) { if fs != nil { - res = make([]netmap.Filter, 0, len(fs)) + res = make([]*netmap.Filter, 0, len(fs)) for i := range fs { - res = append(res, *fs[i].ToGRPCMessage().(*netmap.Filter)) + res = append(res, fs[i].ToGRPCMessage().(*netmap.Filter)) } } return } -func FiltersFromGRPC(fs []netmap.Filter) (res []Filter, err error) { +func FiltersFromGRPC(fs []*netmap.Filter) (res []Filter, err error) { if fs != nil { res = make([]Filter, len(fs)) for i := range fs { - err = res[i].FromGRPCMessage(&fs[i]) + err = res[i].FromGRPCMessage(fs[i]) if err != nil { return } @@ -103,24 +103,24 @@ func (s *Selector) FromGRPCMessage(m grpc.Message) error { return nil } -func SelectorsToGRPC(ss []Selector) (res []netmap.Selector) { +func SelectorsToGRPC(ss []Selector) (res []*netmap.Selector) { if ss != nil { - res = make([]netmap.Selector, 0, len(ss)) + res = make([]*netmap.Selector, 0, len(ss)) for i := range ss { - res = append(res, *ss[i].ToGRPCMessage().(*netmap.Selector)) + res = append(res, ss[i].ToGRPCMessage().(*netmap.Selector)) } } return } -func SelectorsFromGRPC(ss []netmap.Selector) (res []Selector, err error) { +func SelectorsFromGRPC(ss []*netmap.Selector) (res []Selector, err error) { if ss != nil { res = make([]Selector, len(ss)) for i := range ss { - err = res[i].FromGRPCMessage(&ss[i]) + err = res[i].FromGRPCMessage(ss[i]) if err != nil { return } @@ -138,8 +138,8 @@ func (r *Replica) ToGRPCMessage() grpc.Message { m.SetSelector(r.selector) m.SetCount(r.count) - m.EcDataCount = r.ecDataCount - m.EcParityCount = r.ecParityCount + m.SetEcDataCount(r.ecDataCount) + m.SetEcParityCount(r.ecParityCount) } return m @@ -159,24 +159,24 @@ func (r *Replica) FromGRPCMessage(m grpc.Message) error { return nil } -func ReplicasToGRPC(rs []Replica) (res []netmap.Replica) { +func ReplicasToGRPC(rs []Replica) (res []*netmap.Replica) { if rs != nil { - res = make([]netmap.Replica, 0, len(rs)) + res = make([]*netmap.Replica, 0, len(rs)) for i := range rs { - res = append(res, *rs[i].ToGRPCMessage().(*netmap.Replica)) + res = append(res, rs[i].ToGRPCMessage().(*netmap.Replica)) } } return } -func ReplicasFromGRPC(rs []netmap.Replica) (res []Replica, err error) { +func ReplicasFromGRPC(rs []*netmap.Replica) (res []Replica, err error) { if rs != nil { res = make([]Replica, len(rs)) for i := range rs { - err = res[i].FromGRPCMessage(&rs[i]) + err = res[i].FromGRPCMessage(rs[i]) if err != nil { return } @@ -283,24 +283,24 @@ func (a *Attribute) FromGRPCMessage(m grpc.Message) error { return nil } -func AttributesToGRPC(as []Attribute) (res []netmap.NodeInfo_Attribute) { +func AttributesToGRPC(as []Attribute) (res []*netmap.NodeInfo_Attribute) { if as != nil { - res = make([]netmap.NodeInfo_Attribute, 0, len(as)) + res = make([]*netmap.NodeInfo_Attribute, 0, len(as)) for i := range as { - res = append(res, *as[i].ToGRPCMessage().(*netmap.NodeInfo_Attribute)) + res = append(res, as[i].ToGRPCMessage().(*netmap.NodeInfo_Attribute)) } } return } -func AttributesFromGRPC(as []netmap.NodeInfo_Attribute) (res []Attribute, err error) { +func AttributesFromGRPC(as []*netmap.NodeInfo_Attribute) (res []Attribute, err error) { if as != nil { res = make([]Attribute, len(as)) for i := range as { - err = res[i].FromGRPCMessage(&as[i]) + err = res[i].FromGRPCMessage(as[i]) if err != nil { return } @@ -520,13 +520,13 @@ func (x *NetworkConfig) ToGRPCMessage() grpc.Message { if x != nil { m = new(netmap.NetworkConfig) - var ps []netmap.NetworkConfig_Parameter + var ps []*netmap.NetworkConfig_Parameter if ln := len(x.ps); ln > 0 { - ps = make([]netmap.NetworkConfig_Parameter, 0, ln) + ps = make([]*netmap.NetworkConfig_Parameter, 0, ln) for i := range ln { - ps = append(ps, *x.ps[i].ToGRPCMessage().(*netmap.NetworkConfig_Parameter)) + ps = append(ps, x.ps[i].ToGRPCMessage().(*netmap.NetworkConfig_Parameter)) } } @@ -553,7 +553,7 @@ func (x *NetworkConfig) FromGRPCMessage(m grpc.Message) error { ps = make([]NetworkParameter, ln) for i := range ln { - if err := ps[i].FromGRPCMessage(&psV2[i]); err != nil { + if err := ps[i].FromGRPCMessage(psV2[i]); err != nil { return err } } @@ -746,10 +746,10 @@ func (x *NetMap) ToGRPCMessage() grpc.Message { m.SetEpoch(x.epoch) if x.nodes != nil { - nodes := make([]netmap.NodeInfo, len(x.nodes)) + nodes := make([]*netmap.NodeInfo, len(x.nodes)) for i := range x.nodes { - nodes[i] = *x.nodes[i].ToGRPCMessage().(*netmap.NodeInfo) + nodes[i] = x.nodes[i].ToGRPCMessage().(*netmap.NodeInfo) } m.SetNodes(nodes) @@ -774,7 +774,7 @@ func (x *NetMap) FromGRPCMessage(m grpc.Message) error { x.nodes = make([]NodeInfo, len(nodes)) for i := range nodes { - err = x.nodes[i].FromGRPCMessage(&nodes[i]) + err = x.nodes[i].FromGRPCMessage(nodes[i]) if err != nil { return err } diff --git a/api/netmap/grpc/service.pb.go b/api/netmap/grpc/service.pb.go new file mode 100644 index 0000000..b3fd8d1 --- /dev/null +++ b/api/netmap/grpc/service.pb.go @@ -0,0 +1,1417 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/netmap/grpc/service.proto + +//go:build !protoopaque + +package netmap + +import ( + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Get NodeInfo structure directly from a particular node +type LocalNodeInfoRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of the LocalNodeInfo request message + Body *LocalNodeInfoRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LocalNodeInfoRequest) Reset() { + *x = LocalNodeInfoRequest{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *LocalNodeInfoRequest) SetBody(v *LocalNodeInfoRequest_Body) { + x.Body = v +} + +func (x *LocalNodeInfoRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *LocalNodeInfoRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *LocalNodeInfoRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *LocalNodeInfoRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *LocalNodeInfoRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *LocalNodeInfoRequest) ClearBody() { + x.Body = nil +} + +func (x *LocalNodeInfoRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *LocalNodeInfoRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type LocalNodeInfoRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of the LocalNodeInfo request message + Body *LocalNodeInfoRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 LocalNodeInfoRequest_builder) Build() *LocalNodeInfoRequest { + m0 := &LocalNodeInfoRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Local Node Info, including API Version in use +type LocalNodeInfoResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of the balance response message. + Body *LocalNodeInfoResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect response execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LocalNodeInfoResponse) Reset() { + *x = LocalNodeInfoResponse{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *LocalNodeInfoResponse) SetBody(v *LocalNodeInfoResponse_Body) { + x.Body = v +} + +func (x *LocalNodeInfoResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *LocalNodeInfoResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *LocalNodeInfoResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *LocalNodeInfoResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *LocalNodeInfoResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *LocalNodeInfoResponse) ClearBody() { + x.Body = nil +} + +func (x *LocalNodeInfoResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *LocalNodeInfoResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type LocalNodeInfoResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of the balance response message. + Body *LocalNodeInfoResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect response execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 LocalNodeInfoResponse_builder) Build() *LocalNodeInfoResponse { + m0 := &LocalNodeInfoResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Get NetworkInfo structure with the network view from a particular node. +type NetworkInfoRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of the NetworkInfo request message + Body *NetworkInfoRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetworkInfoRequest) Reset() { + *x = NetworkInfoRequest{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *NetworkInfoRequest) SetBody(v *NetworkInfoRequest_Body) { + x.Body = v +} + +func (x *NetworkInfoRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *NetworkInfoRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *NetworkInfoRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *NetworkInfoRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *NetworkInfoRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *NetworkInfoRequest) ClearBody() { + x.Body = nil +} + +func (x *NetworkInfoRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *NetworkInfoRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type NetworkInfoRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of the NetworkInfo request message + Body *NetworkInfoRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 NetworkInfoRequest_builder) Build() *NetworkInfoRequest { + m0 := &NetworkInfoRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Response with NetworkInfo structure including current epoch and +// sidechain magic number. +type NetworkInfoResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of the NetworkInfo response message. + Body *NetworkInfoResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect response execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetworkInfoResponse) Reset() { + *x = NetworkInfoResponse{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *NetworkInfoResponse) SetBody(v *NetworkInfoResponse_Body) { + x.Body = v +} + +func (x *NetworkInfoResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *NetworkInfoResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *NetworkInfoResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *NetworkInfoResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *NetworkInfoResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *NetworkInfoResponse) ClearBody() { + x.Body = nil +} + +func (x *NetworkInfoResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *NetworkInfoResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type NetworkInfoResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of the NetworkInfo response message. + Body *NetworkInfoResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect response execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 NetworkInfoResponse_builder) Build() *NetworkInfoResponse { + m0 := &NetworkInfoResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Get netmap snapshot request +type NetmapSnapshotRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of get netmap snapshot request message. + Body *NetmapSnapshotRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetmapSnapshotRequest) Reset() { + *x = NetmapSnapshotRequest{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *NetmapSnapshotRequest) SetBody(v *NetmapSnapshotRequest_Body) { + x.Body = v +} + +func (x *NetmapSnapshotRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *NetmapSnapshotRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *NetmapSnapshotRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *NetmapSnapshotRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *NetmapSnapshotRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *NetmapSnapshotRequest) ClearBody() { + x.Body = nil +} + +func (x *NetmapSnapshotRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *NetmapSnapshotRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type NetmapSnapshotRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of get netmap snapshot request message. + Body *NetmapSnapshotRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 NetmapSnapshotRequest_builder) Build() *NetmapSnapshotRequest { + m0 := &NetmapSnapshotRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Response with current netmap snapshot +type NetmapSnapshotResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of get netmap snapshot response message. + Body *NetmapSnapshotResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect response execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetmapSnapshotResponse) Reset() { + *x = NetmapSnapshotResponse{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *NetmapSnapshotResponse) SetBody(v *NetmapSnapshotResponse_Body) { + x.Body = v +} + +func (x *NetmapSnapshotResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *NetmapSnapshotResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *NetmapSnapshotResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *NetmapSnapshotResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *NetmapSnapshotResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *NetmapSnapshotResponse) ClearBody() { + x.Body = nil +} + +func (x *NetmapSnapshotResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *NetmapSnapshotResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type NetmapSnapshotResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of get netmap snapshot response message. + Body *NetmapSnapshotResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect response execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 NetmapSnapshotResponse_builder) Build() *NetmapSnapshotResponse { + m0 := &NetmapSnapshotResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// LocalNodeInfo request body is empty. +type LocalNodeInfoRequest_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LocalNodeInfoRequest_Body) Reset() { + *x = LocalNodeInfoRequest_Body{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +type LocalNodeInfoRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + +} + +func (b0 LocalNodeInfoRequest_Body_builder) Build() *LocalNodeInfoRequest_Body { + m0 := &LocalNodeInfoRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + return m0 +} + +// Local Node Info, including API Version in use. +type LocalNodeInfoResponse_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Latest FrostFS API version in use + Version *grpc1.Version `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"` + // NodeInfo structure with recent information from node itself + NodeInfo *NodeInfo `protobuf:"bytes,2,opt,name=node_info,json=nodeInfo" json:"node_info,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LocalNodeInfoResponse_Body) Reset() { + *x = LocalNodeInfoResponse_Body{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *LocalNodeInfoResponse_Body) SetVersion(v *grpc1.Version) { + x.Version = v +} + +func (x *LocalNodeInfoResponse_Body) SetNodeInfo(v *NodeInfo) { + x.NodeInfo = v +} + +func (x *LocalNodeInfoResponse_Body) HasVersion() bool { + if x == nil { + return false + } + return x.Version != nil +} + +func (x *LocalNodeInfoResponse_Body) HasNodeInfo() bool { + if x == nil { + return false + } + return x.NodeInfo != nil +} + +func (x *LocalNodeInfoResponse_Body) ClearVersion() { + x.Version = nil +} + +func (x *LocalNodeInfoResponse_Body) ClearNodeInfo() { + x.NodeInfo = nil +} + +type LocalNodeInfoResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Latest FrostFS API version in use + Version *grpc1.Version + // NodeInfo structure with recent information from node itself + NodeInfo *NodeInfo +} + +func (b0 LocalNodeInfoResponse_Body_builder) Build() *LocalNodeInfoResponse_Body { + m0 := &LocalNodeInfoResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.Version = b.Version + x.NodeInfo = b.NodeInfo + return m0 +} + +// NetworkInfo request body is empty. +type NetworkInfoRequest_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetworkInfoRequest_Body) Reset() { + *x = NetworkInfoRequest_Body{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +type NetworkInfoRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + +} + +func (b0 NetworkInfoRequest_Body_builder) Build() *NetworkInfoRequest_Body { + m0 := &NetworkInfoRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + return m0 +} + +// Information about the network. +type NetworkInfoResponse_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // NetworkInfo structure with recent information. + NetworkInfo *NetworkInfo `protobuf:"bytes,1,opt,name=network_info,json=networkInfo" json:"network_info,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetworkInfoResponse_Body) Reset() { + *x = NetworkInfoResponse_Body{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *NetworkInfoResponse_Body) GetNetworkInfo() *NetworkInfo { + if x != nil { + return x.NetworkInfo + } + return nil +} + +func (x *NetworkInfoResponse_Body) SetNetworkInfo(v *NetworkInfo) { + x.NetworkInfo = v +} + +func (x *NetworkInfoResponse_Body) HasNetworkInfo() bool { + if x == nil { + return false + } + return x.NetworkInfo != nil +} + +func (x *NetworkInfoResponse_Body) ClearNetworkInfo() { + x.NetworkInfo = nil +} + +type NetworkInfoResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // NetworkInfo structure with recent information. + NetworkInfo *NetworkInfo +} + +func (b0 NetworkInfoResponse_Body_builder) Build() *NetworkInfoResponse_Body { + m0 := &NetworkInfoResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.NetworkInfo = b.NetworkInfo + return m0 +} + +// Get netmap snapshot request body. +type NetmapSnapshotRequest_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetmapSnapshotRequest_Body) Reset() { + *x = NetmapSnapshotRequest_Body{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +type NetmapSnapshotRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + +} + +func (b0 NetmapSnapshotRequest_Body_builder) Build() *NetmapSnapshotRequest_Body { + m0 := &NetmapSnapshotRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + return m0 +} + +// Get netmap snapshot response body +type NetmapSnapshotResponse_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Structure of the requested network map. + Netmap *Netmap `protobuf:"bytes,1,opt,name=netmap" json:"netmap,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetmapSnapshotResponse_Body) Reset() { + *x = NetmapSnapshotResponse_Body{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *NetmapSnapshotResponse_Body) GetNetmap() *Netmap { + if x != nil { + return x.Netmap + } + return nil +} + +func (x *NetmapSnapshotResponse_Body) SetNetmap(v *Netmap) { + x.Netmap = v +} + +func (x *NetmapSnapshotResponse_Body) HasNetmap() bool { + if x == nil { + return false + } + return x.Netmap != nil +} + +func (x *NetmapSnapshotResponse_Body) ClearNetmap() { + x.Netmap = nil +} + +type NetmapSnapshotResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Structure of the requested network map. + Netmap *Netmap +} + +func (b0 NetmapSnapshotResponse_Body_builder) Build() *NetmapSnapshotResponse_Body { + m0 := &NetmapSnapshotResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.Netmap = b.Netmap + return m0 +} + +var File_api_netmap_grpc_service_proto protoreflect.FileDescriptor + +var file_api_netmap_grpc_service_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x61, 0x70, 0x69, 0x2f, 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, 0x1b, 0x61, 0x70, 0x69, 0x2f, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, + 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x61, 0x70, 0x69, 0x2f, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 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, 0x62, 0x5a, 0x43, + 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, + 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, + 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_netmap_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_api_netmap_grpc_service_proto_goTypes = []any{ + (*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_api_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_api_netmap_grpc_service_proto_init() } +func file_api_netmap_grpc_service_proto_init() { + if File_api_netmap_grpc_service_proto != nil { + return + } + file_api_netmap_grpc_types_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_netmap_grpc_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 12, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_api_netmap_grpc_service_proto_goTypes, + DependencyIndexes: file_api_netmap_grpc_service_proto_depIdxs, + MessageInfos: file_api_netmap_grpc_service_proto_msgTypes, + }.Build() + File_api_netmap_grpc_service_proto = out.File + file_api_netmap_grpc_service_proto_rawDesc = nil + file_api_netmap_grpc_service_proto_goTypes = nil + file_api_netmap_grpc_service_proto_depIdxs = nil +} diff --git a/api/netmap/grpc/service_frostfs.pb.go b/api/netmap/grpc/service_frostfs.pb.go deleted file mode 100644 index 7e2d7a3..0000000 --- a/api/netmap/grpc/service_frostfs.pb.go +++ /dev/null @@ -1,2180 +0,0 @@ -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package netmap - -import ( - json "encoding/json" - fmt "fmt" - grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" - grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" - pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" - proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" - encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" - easyproto "github.com/VictoriaMetrics/easyproto" - jlexer "github.com/mailru/easyjson/jlexer" - jwriter "github.com/mailru/easyjson/jwriter" -) - -type 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.EmitProtobuf(mm.AppendMessage(1)) - } - if x.NodeInfo != nil { - 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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"version\":" - out.RawString(prefix) - x.Version.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"networkInfo\":" - out.RawString(prefix) - 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"netmap\":" - out.RawString(prefix) - 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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/api/netmap/grpc/service_frostfs_fuzz.go b/api/netmap/grpc/service_frostfs_fuzz.go deleted file mode 100644 index ebb59bc..0000000 --- a/api/netmap/grpc/service_frostfs_fuzz.go +++ /dev/null @@ -1,121 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package netmap - -func DoFuzzProtoLocalNodeInfoRequest(data []byte) int { - msg := new(LocalNodeInfoRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONLocalNodeInfoRequest(data []byte) int { - msg := new(LocalNodeInfoRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoLocalNodeInfoResponse(data []byte) int { - msg := new(LocalNodeInfoResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONLocalNodeInfoResponse(data []byte) int { - msg := new(LocalNodeInfoResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoNetworkInfoRequest(data []byte) int { - msg := new(NetworkInfoRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONNetworkInfoRequest(data []byte) int { - msg := new(NetworkInfoRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoNetworkInfoResponse(data []byte) int { - msg := new(NetworkInfoResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONNetworkInfoResponse(data []byte) int { - msg := new(NetworkInfoResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoNetmapSnapshotRequest(data []byte) int { - msg := new(NetmapSnapshotRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONNetmapSnapshotRequest(data []byte) int { - msg := new(NetmapSnapshotRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoNetmapSnapshotResponse(data []byte) int { - msg := new(NetmapSnapshotResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONNetmapSnapshotResponse(data []byte) int { - msg := new(NetmapSnapshotResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} diff --git a/api/netmap/grpc/service_frostfs_test.go b/api/netmap/grpc/service_frostfs_test.go deleted file mode 100644 index 5c9035f..0000000 --- a/api/netmap/grpc/service_frostfs_test.go +++ /dev/null @@ -1,71 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package netmap - -import ( - testing "testing" -) - -func FuzzProtoLocalNodeInfoRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoLocalNodeInfoRequest(data) - }) -} -func FuzzJSONLocalNodeInfoRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONLocalNodeInfoRequest(data) - }) -} -func FuzzProtoLocalNodeInfoResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoLocalNodeInfoResponse(data) - }) -} -func FuzzJSONLocalNodeInfoResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONLocalNodeInfoResponse(data) - }) -} -func FuzzProtoNetworkInfoRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoNetworkInfoRequest(data) - }) -} -func FuzzJSONNetworkInfoRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONNetworkInfoRequest(data) - }) -} -func FuzzProtoNetworkInfoResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoNetworkInfoResponse(data) - }) -} -func FuzzJSONNetworkInfoResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONNetworkInfoResponse(data) - }) -} -func FuzzProtoNetmapSnapshotRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoNetmapSnapshotRequest(data) - }) -} -func FuzzJSONNetmapSnapshotRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONNetmapSnapshotRequest(data) - }) -} -func FuzzProtoNetmapSnapshotResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoNetmapSnapshotResponse(data) - }) -} -func FuzzJSONNetmapSnapshotResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONNetmapSnapshotResponse(data) - }) -} diff --git a/api/netmap/grpc/service_grpc.pb.go b/api/netmap/grpc/service_grpc.pb.go index 7deee56..4bdc977 100644 --- a/api/netmap/grpc/service_grpc.pb.go +++ b/api/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 v5.27.2 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.29.2 // source: api/netmap/grpc/service.proto package netmap @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( NetmapService_LocalNodeInfo_FullMethodName = "/neo.fs.v2.netmap.NetmapService/LocalNodeInfo" @@ -27,6 +27,11 @@ const ( // NetmapServiceClient is the client API for NetmapService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// `NetmapService` provides methods to work with `Network Map` and the +// information required to build it. The resulting `Network Map` is stored in +// sidechain `Netmap` smart contract, while related information can be obtained +// from other FrostFS nodes. type NetmapServiceClient interface { // Get NodeInfo structure from the particular node directly. // Node information can be taken from `Netmap` smart contract. In some cases, @@ -65,8 +70,9 @@ func NewNetmapServiceClient(cc grpc.ClientConnInterface) NetmapServiceClient { } func (c *netmapServiceClient) LocalNodeInfo(ctx context.Context, in *LocalNodeInfoRequest, opts ...grpc.CallOption) (*LocalNodeInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(LocalNodeInfoResponse) - err := c.cc.Invoke(ctx, NetmapService_LocalNodeInfo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, NetmapService_LocalNodeInfo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -74,8 +80,9 @@ func (c *netmapServiceClient) LocalNodeInfo(ctx context.Context, in *LocalNodeIn } func (c *netmapServiceClient) NetworkInfo(ctx context.Context, in *NetworkInfoRequest, opts ...grpc.CallOption) (*NetworkInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(NetworkInfoResponse) - err := c.cc.Invoke(ctx, NetmapService_NetworkInfo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, NetmapService_NetworkInfo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -83,8 +90,9 @@ func (c *netmapServiceClient) NetworkInfo(ctx context.Context, in *NetworkInfoRe } func (c *netmapServiceClient) NetmapSnapshot(ctx context.Context, in *NetmapSnapshotRequest, opts ...grpc.CallOption) (*NetmapSnapshotResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(NetmapSnapshotResponse) - err := c.cc.Invoke(ctx, NetmapService_NetmapSnapshot_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, NetmapService_NetmapSnapshot_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -93,7 +101,12 @@ func (c *netmapServiceClient) NetmapSnapshot(ctx context.Context, in *NetmapSnap // NetmapServiceServer is the server API for NetmapService service. // All implementations should embed UnimplementedNetmapServiceServer -// for forward compatibility +// for forward compatibility. +// +// `NetmapService` provides methods to work with `Network Map` and the +// information required to build it. The resulting `Network Map` is stored in +// sidechain `Netmap` smart contract, while related information can be obtained +// from other FrostFS nodes. type NetmapServiceServer interface { // Get NodeInfo structure from the particular node directly. // Node information can be taken from `Netmap` smart contract. In some cases, @@ -123,9 +136,12 @@ type NetmapServiceServer interface { NetmapSnapshot(context.Context, *NetmapSnapshotRequest) (*NetmapSnapshotResponse, error) } -// UnimplementedNetmapServiceServer should be embedded to have forward compatible implementations. -type UnimplementedNetmapServiceServer struct { -} +// UnimplementedNetmapServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedNetmapServiceServer struct{} func (UnimplementedNetmapServiceServer) LocalNodeInfo(context.Context, *LocalNodeInfoRequest) (*LocalNodeInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LocalNodeInfo not implemented") @@ -136,6 +152,7 @@ func (UnimplementedNetmapServiceServer) NetworkInfo(context.Context, *NetworkInf func (UnimplementedNetmapServiceServer) NetmapSnapshot(context.Context, *NetmapSnapshotRequest) (*NetmapSnapshotResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method NetmapSnapshot not implemented") } +func (UnimplementedNetmapServiceServer) testEmbeddedByValue() {} // UnsafeNetmapServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to NetmapServiceServer will @@ -145,6 +162,13 @@ type UnsafeNetmapServiceServer interface { } func RegisterNetmapServiceServer(s grpc.ServiceRegistrar, srv NetmapServiceServer) { + // If the following call pancis, it indicates UnimplementedNetmapServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&NetmapService_ServiceDesc, srv) } diff --git a/api/netmap/grpc/service_protoopaque.pb.go b/api/netmap/grpc/service_protoopaque.pb.go new file mode 100644 index 0000000..681ed70 --- /dev/null +++ b/api/netmap/grpc/service_protoopaque.pb.go @@ -0,0 +1,1377 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/netmap/grpc/service.proto + +//go:build protoopaque + +package netmap + +import ( + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Get NodeInfo structure directly from a particular node +type LocalNodeInfoRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *LocalNodeInfoRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LocalNodeInfoRequest) Reset() { + *x = LocalNodeInfoRequest{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *LocalNodeInfoRequest) GetBody() *LocalNodeInfoRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *LocalNodeInfoRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *LocalNodeInfoRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *LocalNodeInfoRequest) SetBody(v *LocalNodeInfoRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *LocalNodeInfoRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *LocalNodeInfoRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *LocalNodeInfoRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *LocalNodeInfoRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *LocalNodeInfoRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *LocalNodeInfoRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *LocalNodeInfoRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *LocalNodeInfoRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type LocalNodeInfoRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of the LocalNodeInfo request message + Body *LocalNodeInfoRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 LocalNodeInfoRequest_builder) Build() *LocalNodeInfoRequest { + m0 := &LocalNodeInfoRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Local Node Info, including API Version in use +type LocalNodeInfoResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *LocalNodeInfoResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LocalNodeInfoResponse) Reset() { + *x = LocalNodeInfoResponse{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *LocalNodeInfoResponse) GetBody() *LocalNodeInfoResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *LocalNodeInfoResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *LocalNodeInfoResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *LocalNodeInfoResponse) SetBody(v *LocalNodeInfoResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *LocalNodeInfoResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *LocalNodeInfoResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *LocalNodeInfoResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *LocalNodeInfoResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *LocalNodeInfoResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *LocalNodeInfoResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *LocalNodeInfoResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *LocalNodeInfoResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type LocalNodeInfoResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of the balance response message. + Body *LocalNodeInfoResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect response execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 LocalNodeInfoResponse_builder) Build() *LocalNodeInfoResponse { + m0 := &LocalNodeInfoResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Get NetworkInfo structure with the network view from a particular node. +type NetworkInfoRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *NetworkInfoRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetworkInfoRequest) Reset() { + *x = NetworkInfoRequest{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *NetworkInfoRequest) GetBody() *NetworkInfoRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *NetworkInfoRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *NetworkInfoRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *NetworkInfoRequest) SetBody(v *NetworkInfoRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *NetworkInfoRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *NetworkInfoRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *NetworkInfoRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *NetworkInfoRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *NetworkInfoRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *NetworkInfoRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *NetworkInfoRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *NetworkInfoRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type NetworkInfoRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of the NetworkInfo request message + Body *NetworkInfoRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 NetworkInfoRequest_builder) Build() *NetworkInfoRequest { + m0 := &NetworkInfoRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Response with NetworkInfo structure including current epoch and +// sidechain magic number. +type NetworkInfoResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *NetworkInfoResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetworkInfoResponse) Reset() { + *x = NetworkInfoResponse{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *NetworkInfoResponse) GetBody() *NetworkInfoResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *NetworkInfoResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *NetworkInfoResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *NetworkInfoResponse) SetBody(v *NetworkInfoResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *NetworkInfoResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *NetworkInfoResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *NetworkInfoResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *NetworkInfoResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *NetworkInfoResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *NetworkInfoResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *NetworkInfoResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *NetworkInfoResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type NetworkInfoResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of the NetworkInfo response message. + Body *NetworkInfoResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect response execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 NetworkInfoResponse_builder) Build() *NetworkInfoResponse { + m0 := &NetworkInfoResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Get netmap snapshot request +type NetmapSnapshotRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *NetmapSnapshotRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetmapSnapshotRequest) Reset() { + *x = NetmapSnapshotRequest{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *NetmapSnapshotRequest) GetBody() *NetmapSnapshotRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *NetmapSnapshotRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *NetmapSnapshotRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *NetmapSnapshotRequest) SetBody(v *NetmapSnapshotRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *NetmapSnapshotRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *NetmapSnapshotRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *NetmapSnapshotRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *NetmapSnapshotRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *NetmapSnapshotRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *NetmapSnapshotRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *NetmapSnapshotRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *NetmapSnapshotRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type NetmapSnapshotRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of get netmap snapshot request message. + Body *NetmapSnapshotRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 NetmapSnapshotRequest_builder) Build() *NetmapSnapshotRequest { + m0 := &NetmapSnapshotRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Response with current netmap snapshot +type NetmapSnapshotResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *NetmapSnapshotResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetmapSnapshotResponse) Reset() { + *x = NetmapSnapshotResponse{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *NetmapSnapshotResponse) GetBody() *NetmapSnapshotResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *NetmapSnapshotResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *NetmapSnapshotResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *NetmapSnapshotResponse) SetBody(v *NetmapSnapshotResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *NetmapSnapshotResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *NetmapSnapshotResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *NetmapSnapshotResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *NetmapSnapshotResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *NetmapSnapshotResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *NetmapSnapshotResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *NetmapSnapshotResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *NetmapSnapshotResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type NetmapSnapshotResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of get netmap snapshot response message. + Body *NetmapSnapshotResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect response execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 NetmapSnapshotResponse_builder) Build() *NetmapSnapshotResponse { + m0 := &NetmapSnapshotResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// LocalNodeInfo request body is empty. +type LocalNodeInfoRequest_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LocalNodeInfoRequest_Body) Reset() { + *x = LocalNodeInfoRequest_Body{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +type LocalNodeInfoRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + +} + +func (b0 LocalNodeInfoRequest_Body_builder) Build() *LocalNodeInfoRequest_Body { + m0 := &LocalNodeInfoRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + return m0 +} + +// Local Node Info, including API Version in use. +type LocalNodeInfoResponse_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Version *grpc1.Version `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"` + xxx_hidden_NodeInfo *NodeInfo `protobuf:"bytes,2,opt,name=node_info,json=nodeInfo" json:"node_info,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LocalNodeInfoResponse_Body) Reset() { + *x = LocalNodeInfoResponse_Body{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *LocalNodeInfoResponse_Body) GetVersion() *grpc1.Version { + if x != nil { + return x.xxx_hidden_Version + } + return nil +} + +func (x *LocalNodeInfoResponse_Body) GetNodeInfo() *NodeInfo { + if x != nil { + return x.xxx_hidden_NodeInfo + } + return nil +} + +func (x *LocalNodeInfoResponse_Body) SetVersion(v *grpc1.Version) { + x.xxx_hidden_Version = v +} + +func (x *LocalNodeInfoResponse_Body) SetNodeInfo(v *NodeInfo) { + x.xxx_hidden_NodeInfo = v +} + +func (x *LocalNodeInfoResponse_Body) HasVersion() bool { + if x == nil { + return false + } + return x.xxx_hidden_Version != nil +} + +func (x *LocalNodeInfoResponse_Body) HasNodeInfo() bool { + if x == nil { + return false + } + return x.xxx_hidden_NodeInfo != nil +} + +func (x *LocalNodeInfoResponse_Body) ClearVersion() { + x.xxx_hidden_Version = nil +} + +func (x *LocalNodeInfoResponse_Body) ClearNodeInfo() { + x.xxx_hidden_NodeInfo = nil +} + +type LocalNodeInfoResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Latest FrostFS API version in use + Version *grpc1.Version + // NodeInfo structure with recent information from node itself + NodeInfo *NodeInfo +} + +func (b0 LocalNodeInfoResponse_Body_builder) Build() *LocalNodeInfoResponse_Body { + m0 := &LocalNodeInfoResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Version = b.Version + x.xxx_hidden_NodeInfo = b.NodeInfo + return m0 +} + +// NetworkInfo request body is empty. +type NetworkInfoRequest_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetworkInfoRequest_Body) Reset() { + *x = NetworkInfoRequest_Body{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +type NetworkInfoRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + +} + +func (b0 NetworkInfoRequest_Body_builder) Build() *NetworkInfoRequest_Body { + m0 := &NetworkInfoRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + return m0 +} + +// Information about the network. +type NetworkInfoResponse_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_NetworkInfo *NetworkInfo `protobuf:"bytes,1,opt,name=network_info,json=networkInfo" json:"network_info,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetworkInfoResponse_Body) Reset() { + *x = NetworkInfoResponse_Body{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *NetworkInfoResponse_Body) GetNetworkInfo() *NetworkInfo { + if x != nil { + return x.xxx_hidden_NetworkInfo + } + return nil +} + +func (x *NetworkInfoResponse_Body) SetNetworkInfo(v *NetworkInfo) { + x.xxx_hidden_NetworkInfo = v +} + +func (x *NetworkInfoResponse_Body) HasNetworkInfo() bool { + if x == nil { + return false + } + return x.xxx_hidden_NetworkInfo != nil +} + +func (x *NetworkInfoResponse_Body) ClearNetworkInfo() { + x.xxx_hidden_NetworkInfo = nil +} + +type NetworkInfoResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // NetworkInfo structure with recent information. + NetworkInfo *NetworkInfo +} + +func (b0 NetworkInfoResponse_Body_builder) Build() *NetworkInfoResponse_Body { + m0 := &NetworkInfoResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_NetworkInfo = b.NetworkInfo + return m0 +} + +// Get netmap snapshot request body. +type NetmapSnapshotRequest_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetmapSnapshotRequest_Body) Reset() { + *x = NetmapSnapshotRequest_Body{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +type NetmapSnapshotRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + +} + +func (b0 NetmapSnapshotRequest_Body_builder) Build() *NetmapSnapshotRequest_Body { + m0 := &NetmapSnapshotRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + return m0 +} + +// Get netmap snapshot response body +type NetmapSnapshotResponse_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Netmap *Netmap `protobuf:"bytes,1,opt,name=netmap" json:"netmap,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetmapSnapshotResponse_Body) Reset() { + *x = NetmapSnapshotResponse_Body{} + mi := &file_api_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_api_netmap_grpc_service_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *NetmapSnapshotResponse_Body) GetNetmap() *Netmap { + if x != nil { + return x.xxx_hidden_Netmap + } + return nil +} + +func (x *NetmapSnapshotResponse_Body) SetNetmap(v *Netmap) { + x.xxx_hidden_Netmap = v +} + +func (x *NetmapSnapshotResponse_Body) HasNetmap() bool { + if x == nil { + return false + } + return x.xxx_hidden_Netmap != nil +} + +func (x *NetmapSnapshotResponse_Body) ClearNetmap() { + x.xxx_hidden_Netmap = nil +} + +type NetmapSnapshotResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Structure of the requested network map. + Netmap *Netmap +} + +func (b0 NetmapSnapshotResponse_Body_builder) Build() *NetmapSnapshotResponse_Body { + m0 := &NetmapSnapshotResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Netmap = b.Netmap + return m0 +} + +var File_api_netmap_grpc_service_proto protoreflect.FileDescriptor + +var file_api_netmap_grpc_service_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x61, 0x70, 0x69, 0x2f, 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, 0x1b, 0x61, 0x70, 0x69, 0x2f, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, + 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x61, 0x70, 0x69, 0x2f, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 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, 0x62, 0x5a, 0x43, + 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, + 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, + 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_netmap_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_api_netmap_grpc_service_proto_goTypes = []any{ + (*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_api_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_api_netmap_grpc_service_proto_init() } +func file_api_netmap_grpc_service_proto_init() { + if File_api_netmap_grpc_service_proto != nil { + return + } + file_api_netmap_grpc_types_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_netmap_grpc_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 12, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_api_netmap_grpc_service_proto_goTypes, + DependencyIndexes: file_api_netmap_grpc_service_proto_depIdxs, + MessageInfos: file_api_netmap_grpc_service_proto_msgTypes, + }.Build() + File_api_netmap_grpc_service_proto = out.File + file_api_netmap_grpc_service_proto_rawDesc = nil + file_api_netmap_grpc_service_proto_goTypes = nil + file_api_netmap_grpc_service_proto_depIdxs = nil +} diff --git a/api/netmap/grpc/types.pb.go b/api/netmap/grpc/types.pb.go new file mode 100644 index 0000000..b8a8b3e --- /dev/null +++ b/api/netmap/grpc/types.pb.go @@ -0,0 +1,1857 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/netmap/grpc/types.proto + +//go:build !protoopaque + +package netmap + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 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_api_netmap_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (Operation) Type() protoreflect.EnumType { + return &file_api_netmap_grpc_types_proto_enumTypes[0] +} + +func (x Operation) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// 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_api_netmap_grpc_types_proto_enumTypes[1].Descriptor() +} + +func (Clause) Type() protoreflect.EnumType { + return &file_api_netmap_grpc_types_proto_enumTypes[1] +} + +func (x Clause) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Represents the enumeration of various states of the FrostFS 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_api_netmap_grpc_types_proto_enumTypes[2].Descriptor() +} + +func (NodeInfo_State) Type() protoreflect.EnumType { + return &file_api_netmap_grpc_types_proto_enumTypes[2] +} + +func (x NodeInfo_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// 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 `protogen:"hybrid.v1"` + // 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" json:"name,omitempty"` + // Key to filter + Key *string `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"` + // Filtering operation + Op *Operation `protobuf:"varint,3,opt,name=op,enum=neo.fs.v2.netmap.Operation" json:"op,omitempty"` + // Value to match + Value *string `protobuf:"bytes,4,opt,name=value" 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" json:"filters,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Filter) Reset() { + *x = Filter{} + mi := &file_api_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_api_netmap_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Filter) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *Filter) GetKey() string { + if x != nil && x.Key != nil { + return *x.Key + } + return "" +} + +func (x *Filter) GetOp() Operation { + if x != nil && x.Op != nil { + return *x.Op + } + return Operation_OPERATION_UNSPECIFIED +} + +func (x *Filter) GetValue() string { + if x != nil && x.Value != nil { + return *x.Value + } + return "" +} + +func (x *Filter) GetFilters() []*Filter { + if x != nil { + return x.Filters + } + return nil +} + +func (x *Filter) SetName(v string) { + x.Name = &v +} + +func (x *Filter) SetKey(v string) { + x.Key = &v +} + +func (x *Filter) SetOp(v Operation) { + x.Op = &v +} + +func (x *Filter) SetValue(v string) { + x.Value = &v +} + +func (x *Filter) SetFilters(v []*Filter) { + x.Filters = v +} + +func (x *Filter) HasName() bool { + if x == nil { + return false + } + return x.Name != nil +} + +func (x *Filter) HasKey() bool { + if x == nil { + return false + } + return x.Key != nil +} + +func (x *Filter) HasOp() bool { + if x == nil { + return false + } + return x.Op != nil +} + +func (x *Filter) HasValue() bool { + if x == nil { + return false + } + return x.Value != nil +} + +func (x *Filter) ClearName() { + x.Name = nil +} + +func (x *Filter) ClearKey() { + x.Key = nil +} + +func (x *Filter) ClearOp() { + x.Op = nil +} + +func (x *Filter) ClearValue() { + x.Value = nil +} + +type Filter_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // 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 + // Key to filter + Key *string + // Filtering operation + Op *Operation + // Value to match + Value *string + // List of inner filters. Top level operation will be applied to the whole + // list. + Filters []*Filter +} + +func (b0 Filter_builder) Build() *Filter { + m0 := &Filter{} + b, x := &b0, m0 + _, _ = b, x + x.Name = b.Name + x.Key = b.Key + x.Op = b.Op + x.Value = b.Value + x.Filters = b.Filters + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // Selector name to reference in object placement section + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // How many nodes to select from the bucket + Count *uint32 `protobuf:"varint,2,opt,name=count" json:"count,omitempty"` + // Selector modifier showing how to form a bucket + Clause *Clause `protobuf:"varint,3,opt,name=clause,enum=neo.fs.v2.netmap.Clause" json:"clause,omitempty"` + // Bucket attribute to select from + Attribute *string `protobuf:"bytes,4,opt,name=attribute" json:"attribute,omitempty"` + // Filter reference to select from + Filter *string `protobuf:"bytes,5,opt,name=filter" json:"filter,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Selector) Reset() { + *x = Selector{} + mi := &file_api_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_api_netmap_grpc_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Selector) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *Selector) GetCount() uint32 { + if x != nil && x.Count != nil { + return *x.Count + } + return 0 +} + +func (x *Selector) GetClause() Clause { + if x != nil && x.Clause != nil { + return *x.Clause + } + return Clause_CLAUSE_UNSPECIFIED +} + +func (x *Selector) GetAttribute() string { + if x != nil && x.Attribute != nil { + return *x.Attribute + } + return "" +} + +func (x *Selector) GetFilter() string { + if x != nil && x.Filter != nil { + return *x.Filter + } + return "" +} + +func (x *Selector) SetName(v string) { + x.Name = &v +} + +func (x *Selector) SetCount(v uint32) { + x.Count = &v +} + +func (x *Selector) SetClause(v Clause) { + x.Clause = &v +} + +func (x *Selector) SetAttribute(v string) { + x.Attribute = &v +} + +func (x *Selector) SetFilter(v string) { + x.Filter = &v +} + +func (x *Selector) HasName() bool { + if x == nil { + return false + } + return x.Name != nil +} + +func (x *Selector) HasCount() bool { + if x == nil { + return false + } + return x.Count != nil +} + +func (x *Selector) HasClause() bool { + if x == nil { + return false + } + return x.Clause != nil +} + +func (x *Selector) HasAttribute() bool { + if x == nil { + return false + } + return x.Attribute != nil +} + +func (x *Selector) HasFilter() bool { + if x == nil { + return false + } + return x.Filter != nil +} + +func (x *Selector) ClearName() { + x.Name = nil +} + +func (x *Selector) ClearCount() { + x.Count = nil +} + +func (x *Selector) ClearClause() { + x.Clause = nil +} + +func (x *Selector) ClearAttribute() { + x.Attribute = nil +} + +func (x *Selector) ClearFilter() { + x.Filter = nil +} + +type Selector_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Selector name to reference in object placement section + Name *string + // How many nodes to select from the bucket + Count *uint32 + // Selector modifier showing how to form a bucket + Clause *Clause + // Bucket attribute to select from + Attribute *string + // Filter reference to select from + Filter *string +} + +func (b0 Selector_builder) Build() *Selector { + m0 := &Selector{} + b, x := &b0, m0 + _, _ = b, x + x.Name = b.Name + x.Count = b.Count + x.Clause = b.Clause + x.Attribute = b.Attribute + x.Filter = b.Filter + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // How many object replicas to put + Count *uint32 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"` + // Named selector bucket to put replicas + Selector *string `protobuf:"bytes,2,opt,name=selector" json:"selector,omitempty"` + // Data shards count + EcDataCount *uint32 `protobuf:"varint,3,opt,name=ec_data_count,json=ecDataCount" json:"ec_data_count,omitempty"` + // Parity shards count + EcParityCount *uint32 `protobuf:"varint,4,opt,name=ec_parity_count,json=ecParityCount" json:"ec_parity_count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Replica) Reset() { + *x = Replica{} + mi := &file_api_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_api_netmap_grpc_types_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Replica) GetCount() uint32 { + if x != nil && x.Count != nil { + return *x.Count + } + return 0 +} + +func (x *Replica) GetSelector() string { + if x != nil && x.Selector != nil { + return *x.Selector + } + return "" +} + +func (x *Replica) GetEcDataCount() uint32 { + if x != nil && x.EcDataCount != nil { + return *x.EcDataCount + } + return 0 +} + +func (x *Replica) GetEcParityCount() uint32 { + if x != nil && x.EcParityCount != nil { + return *x.EcParityCount + } + return 0 +} + +func (x *Replica) SetCount(v uint32) { + x.Count = &v +} + +func (x *Replica) SetSelector(v string) { + x.Selector = &v +} + +func (x *Replica) SetEcDataCount(v uint32) { + x.EcDataCount = &v +} + +func (x *Replica) SetEcParityCount(v uint32) { + x.EcParityCount = &v +} + +func (x *Replica) HasCount() bool { + if x == nil { + return false + } + return x.Count != nil +} + +func (x *Replica) HasSelector() bool { + if x == nil { + return false + } + return x.Selector != nil +} + +func (x *Replica) HasEcDataCount() bool { + if x == nil { + return false + } + return x.EcDataCount != nil +} + +func (x *Replica) HasEcParityCount() bool { + if x == nil { + return false + } + return x.EcParityCount != nil +} + +func (x *Replica) ClearCount() { + x.Count = nil +} + +func (x *Replica) ClearSelector() { + x.Selector = nil +} + +func (x *Replica) ClearEcDataCount() { + x.EcDataCount = nil +} + +func (x *Replica) ClearEcParityCount() { + x.EcParityCount = nil +} + +type Replica_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // How many object replicas to put + Count *uint32 + // Named selector bucket to put replicas + Selector *string + // Data shards count + EcDataCount *uint32 + // Parity shards count + EcParityCount *uint32 +} + +func (b0 Replica_builder) Build() *Replica { + m0 := &Replica{} + b, x := &b0, m0 + _, _ = b, x + x.Count = b.Count + x.Selector = b.Selector + x.EcDataCount = b.EcDataCount + x.EcParityCount = b.EcParityCount + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // Rules to set number of object replicas and place each one into a named + // bucket + Replicas []*Replica `protobuf:"bytes,1,rep,name=replicas" json:"replicas,omitempty"` + // Container backup factor controls how deep FrostFS will search for nodes + // alternatives to include into container's nodes subset + ContainerBackupFactor *uint32 `protobuf:"varint,2,opt,name=container_backup_factor,json=containerBackupFactor" json:"container_backup_factor,omitempty"` + // Set of Selectors to form the container's nodes subset + Selectors []*Selector `protobuf:"bytes,3,rep,name=selectors" json:"selectors,omitempty"` + // List of named filters to reference in selectors + Filters []*Filter `protobuf:"bytes,4,rep,name=filters" json:"filters,omitempty"` + // Unique flag defines non-overlapping application for replicas + Unique *bool `protobuf:"varint,5,opt,name=unique" json:"unique,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PlacementPolicy) Reset() { + *x = PlacementPolicy{} + mi := &file_api_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_api_netmap_grpc_types_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PlacementPolicy) GetReplicas() []*Replica { + if x != nil { + return x.Replicas + } + return nil +} + +func (x *PlacementPolicy) GetContainerBackupFactor() uint32 { + if x != nil && x.ContainerBackupFactor != 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 && x.Unique != nil { + return *x.Unique + } + return false +} + +func (x *PlacementPolicy) SetReplicas(v []*Replica) { + x.Replicas = v +} + +func (x *PlacementPolicy) SetContainerBackupFactor(v uint32) { + x.ContainerBackupFactor = &v +} + +func (x *PlacementPolicy) SetSelectors(v []*Selector) { + x.Selectors = v +} + +func (x *PlacementPolicy) SetFilters(v []*Filter) { + x.Filters = v +} + +func (x *PlacementPolicy) SetUnique(v bool) { + x.Unique = &v +} + +func (x *PlacementPolicy) HasContainerBackupFactor() bool { + if x == nil { + return false + } + return x.ContainerBackupFactor != nil +} + +func (x *PlacementPolicy) HasUnique() bool { + if x == nil { + return false + } + return x.Unique != nil +} + +func (x *PlacementPolicy) ClearContainerBackupFactor() { + x.ContainerBackupFactor = nil +} + +func (x *PlacementPolicy) ClearUnique() { + x.Unique = nil +} + +type PlacementPolicy_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Rules to set number of object replicas and place each one into a named + // bucket + Replicas []*Replica + // Container backup factor controls how deep FrostFS will search for nodes + // alternatives to include into container's nodes subset + ContainerBackupFactor *uint32 + // Set of Selectors to form the container's nodes subset + Selectors []*Selector + // List of named filters to reference in selectors + Filters []*Filter + // Unique flag defines non-overlapping application for replicas + Unique *bool +} + +func (b0 PlacementPolicy_builder) Build() *PlacementPolicy { + m0 := &PlacementPolicy{} + b, x := &b0, m0 + _, _ = b, x + x.Replicas = b.Replicas + x.ContainerBackupFactor = b.ContainerBackupFactor + x.Selectors = b.Selectors + x.Filters = b.Filters + x.Unique = b.Unique + return m0 +} + +// FrostFS node description +type NodeInfo struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Public key of the FrostFS node in a binary format + PublicKey []byte `protobuf:"bytes,1,opt,name=public_key,json=publicKey" json:"public_key,omitempty"` + // Ways to connect to a node + Addresses []string `protobuf:"bytes,2,rep,name=addresses" json:"addresses,omitempty"` + // Carries list of the FrostFS 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" json:"attributes,omitempty"` + // Carries state of the FrostFS node + State *NodeInfo_State `protobuf:"varint,4,opt,name=state,enum=neo.fs.v2.netmap.NodeInfo_State" json:"state,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NodeInfo) Reset() { + *x = NodeInfo{} + mi := &file_api_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_api_netmap_grpc_types_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 && x.State != nil { + return *x.State + } + return NodeInfo_UNSPECIFIED +} + +func (x *NodeInfo) SetPublicKey(v []byte) { + if v == nil { + v = []byte{} + } + x.PublicKey = v +} + +func (x *NodeInfo) SetAddresses(v []string) { + x.Addresses = v +} + +func (x *NodeInfo) SetAttributes(v []*NodeInfo_Attribute) { + x.Attributes = v +} + +func (x *NodeInfo) SetState(v NodeInfo_State) { + x.State = &v +} + +func (x *NodeInfo) HasPublicKey() bool { + if x == nil { + return false + } + return x.PublicKey != nil +} + +func (x *NodeInfo) HasState() bool { + if x == nil { + return false + } + return x.State != nil +} + +func (x *NodeInfo) ClearPublicKey() { + x.PublicKey = nil +} + +func (x *NodeInfo) ClearState() { + x.State = nil +} + +type NodeInfo_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Public key of the FrostFS node in a binary format + PublicKey []byte + // Ways to connect to a node + Addresses []string + // Carries list of the FrostFS 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 + // Carries state of the FrostFS node + State *NodeInfo_State +} + +func (b0 NodeInfo_builder) Build() *NodeInfo { + m0 := &NodeInfo{} + b, x := &b0, m0 + _, _ = b, x + x.PublicKey = b.PublicKey + x.Addresses = b.Addresses + x.Attributes = b.Attributes + x.State = b.State + return m0 +} + +// Network map structure +type Netmap struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Network map revision number. + Epoch *uint64 `protobuf:"varint,1,opt,name=epoch" json:"epoch,omitempty"` + // Nodes presented in network. + Nodes []*NodeInfo `protobuf:"bytes,2,rep,name=nodes" json:"nodes,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Netmap) Reset() { + *x = Netmap{} + mi := &file_api_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_api_netmap_grpc_types_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Netmap) GetEpoch() uint64 { + if x != nil && x.Epoch != nil { + return *x.Epoch + } + return 0 +} + +func (x *Netmap) GetNodes() []*NodeInfo { + if x != nil { + return x.Nodes + } + return nil +} + +func (x *Netmap) SetEpoch(v uint64) { + x.Epoch = &v +} + +func (x *Netmap) SetNodes(v []*NodeInfo) { + x.Nodes = v +} + +func (x *Netmap) HasEpoch() bool { + if x == nil { + return false + } + return x.Epoch != nil +} + +func (x *Netmap) ClearEpoch() { + x.Epoch = nil +} + +type Netmap_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Network map revision number. + Epoch *uint64 + // Nodes presented in network. + Nodes []*NodeInfo +} + +func (b0 Netmap_builder) Build() *Netmap { + m0 := &Netmap{} + b, x := &b0, m0 + _, _ = b, x + x.Epoch = b.Epoch + x.Nodes = b.Nodes + return m0 +} + +// FrostFS network configuration +type NetworkConfig struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // List of parameter values + Parameters []*NetworkConfig_Parameter `protobuf:"bytes,1,rep,name=parameters" json:"parameters,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetworkConfig) Reset() { + *x = NetworkConfig{} + mi := &file_api_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_api_netmap_grpc_types_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *NetworkConfig) GetParameters() []*NetworkConfig_Parameter { + if x != nil { + return x.Parameters + } + return nil +} + +func (x *NetworkConfig) SetParameters(v []*NetworkConfig_Parameter) { + x.Parameters = v +} + +type NetworkConfig_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // List of parameter values + Parameters []*NetworkConfig_Parameter +} + +func (b0 NetworkConfig_builder) Build() *NetworkConfig { + m0 := &NetworkConfig{} + b, x := &b0, m0 + _, _ = b, x + x.Parameters = b.Parameters + return m0 +} + +// Information about FrostFS network +type NetworkInfo struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Number of the current epoch in the FrostFS network + CurrentEpoch *uint64 `protobuf:"varint,1,opt,name=current_epoch,json=currentEpoch" json:"current_epoch,omitempty"` + // Magic number of the sidechain of the FrostFS network + MagicNumber *uint64 `protobuf:"varint,2,opt,name=magic_number,json=magicNumber" json:"magic_number,omitempty"` + // MillisecondsPerBlock network parameter of the sidechain of the FrostFS + // network + MsPerBlock *int64 `protobuf:"varint,3,opt,name=ms_per_block,json=msPerBlock" json:"ms_per_block,omitempty"` + // FrostFS network configuration + NetworkConfig *NetworkConfig `protobuf:"bytes,4,opt,name=network_config,json=networkConfig" json:"network_config,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetworkInfo) Reset() { + *x = NetworkInfo{} + mi := &file_api_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_api_netmap_grpc_types_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *NetworkInfo) GetCurrentEpoch() uint64 { + if x != nil && x.CurrentEpoch != nil { + return *x.CurrentEpoch + } + return 0 +} + +func (x *NetworkInfo) GetMagicNumber() uint64 { + if x != nil && x.MagicNumber != nil { + return *x.MagicNumber + } + return 0 +} + +func (x *NetworkInfo) GetMsPerBlock() int64 { + if x != nil && x.MsPerBlock != nil { + return *x.MsPerBlock + } + return 0 +} + +func (x *NetworkInfo) GetNetworkConfig() *NetworkConfig { + if x != nil { + return x.NetworkConfig + } + return nil +} + +func (x *NetworkInfo) SetCurrentEpoch(v uint64) { + x.CurrentEpoch = &v +} + +func (x *NetworkInfo) SetMagicNumber(v uint64) { + x.MagicNumber = &v +} + +func (x *NetworkInfo) SetMsPerBlock(v int64) { + x.MsPerBlock = &v +} + +func (x *NetworkInfo) SetNetworkConfig(v *NetworkConfig) { + x.NetworkConfig = v +} + +func (x *NetworkInfo) HasCurrentEpoch() bool { + if x == nil { + return false + } + return x.CurrentEpoch != nil +} + +func (x *NetworkInfo) HasMagicNumber() bool { + if x == nil { + return false + } + return x.MagicNumber != nil +} + +func (x *NetworkInfo) HasMsPerBlock() bool { + if x == nil { + return false + } + return x.MsPerBlock != nil +} + +func (x *NetworkInfo) HasNetworkConfig() bool { + if x == nil { + return false + } + return x.NetworkConfig != nil +} + +func (x *NetworkInfo) ClearCurrentEpoch() { + x.CurrentEpoch = nil +} + +func (x *NetworkInfo) ClearMagicNumber() { + x.MagicNumber = nil +} + +func (x *NetworkInfo) ClearMsPerBlock() { + x.MsPerBlock = nil +} + +func (x *NetworkInfo) ClearNetworkConfig() { + x.NetworkConfig = nil +} + +type NetworkInfo_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Number of the current epoch in the FrostFS network + CurrentEpoch *uint64 + // Magic number of the sidechain of the FrostFS network + MagicNumber *uint64 + // MillisecondsPerBlock network parameter of the sidechain of the FrostFS + // network + MsPerBlock *int64 + // FrostFS network configuration + NetworkConfig *NetworkConfig +} + +func (b0 NetworkInfo_builder) Build() *NetworkInfo { + m0 := &NetworkInfo{} + b, x := &b0, m0 + _, _ = b, x + x.CurrentEpoch = b.CurrentEpoch + x.MagicNumber = b.MagicNumber + x.MsPerBlock = b.MsPerBlock + x.NetworkConfig = b.NetworkConfig + return m0 +} + +// Administrator-defined Attributes of the FrostFS 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 FrostFS +// Storage Node configuration uses ":" and "/" symbols, e.g.: +// +// `FrostFS_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 FrostFS Technical Specification. +type NodeInfo_Attribute struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Key of the node attribute + Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + // Value of the node attribute + Value *string `protobuf:"bytes,2,opt,name=value" 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" json:"parents,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NodeInfo_Attribute) Reset() { + *x = NodeInfo_Attribute{} + mi := &file_api_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_api_netmap_grpc_types_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *NodeInfo_Attribute) GetKey() string { + if x != nil && x.Key != nil { + return *x.Key + } + return "" +} + +func (x *NodeInfo_Attribute) GetValue() string { + if x != nil && x.Value != nil { + return *x.Value + } + return "" +} + +func (x *NodeInfo_Attribute) GetParents() []string { + if x != nil { + return x.Parents + } + return nil +} + +func (x *NodeInfo_Attribute) SetKey(v string) { + x.Key = &v +} + +func (x *NodeInfo_Attribute) SetValue(v string) { + x.Value = &v +} + +func (x *NodeInfo_Attribute) SetParents(v []string) { + x.Parents = v +} + +func (x *NodeInfo_Attribute) HasKey() bool { + if x == nil { + return false + } + return x.Key != nil +} + +func (x *NodeInfo_Attribute) HasValue() bool { + if x == nil { + return false + } + return x.Value != nil +} + +func (x *NodeInfo_Attribute) ClearKey() { + x.Key = nil +} + +func (x *NodeInfo_Attribute) ClearValue() { + x.Value = nil +} + +type NodeInfo_Attribute_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Key of the node attribute + Key *string + // Value of the node attribute + Value *string + // Parent keys, if any. For example for `City` it could be `Region` and + // `Country`. + Parents []string +} + +func (b0 NodeInfo_Attribute_builder) Build() *NodeInfo_Attribute { + m0 := &NodeInfo_Attribute{} + b, x := &b0, m0 + _, _ = b, x + x.Key = b.Key + x.Value = b.Value + x.Parents = b.Parents + return m0 +} + +// 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** \ +// FrostFS 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 FrostFS object measured in bytes. +// Value: little-endian integer. Default: 0. +// +// This value refers to the maximum size of a **physically** stored object +// in FrostFS. However, from a user's perspective, the **logical** size of a +// stored object can be significantly larger. The relationship between the +// physical and logical object sizes is governed by the following formula +// +// ```math +// \mathrm{Stored\ Object\ Size} \le +// \frac{ +// \left(\mathrm{Max\ Object\ Size}\right)^2 +// }{ +// \mathrm{Object\ ID\ Size} +// } +// ``` +// +// This arises from the fact that a tombstone, also being an object, stores +// the IDs of inhumed objects and cannot be divided into smaller objects, +// thus having an upper limit for its size. +// +// For example, if: +// +// - Max Object Size Size = 64 MiB; +// +// - Object ID Size = 32 B; +// +// then: +// ```math +// \mathrm{Stored\ Object\ Size} \le +// \frac{\left(64\ \mathrm{MiB}\right)^2}{32\ \mathrm{B}} = +// \frac{2^{52}}{2^5}\ \mathrm{B} = +// 2^{47}\ \mathrm{B} = +// 128\ \mathrm{TiB} +// ``` +// - **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 `protogen:"hybrid.v1"` + // Parameter key. UTF-8 encoded string + Key []byte `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + // Parameter value + Value []byte `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetworkConfig_Parameter) Reset() { + *x = NetworkConfig_Parameter{} + mi := &file_api_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_api_netmap_grpc_types_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *NetworkConfig_Parameter) SetKey(v []byte) { + if v == nil { + v = []byte{} + } + x.Key = v +} + +func (x *NetworkConfig_Parameter) SetValue(v []byte) { + if v == nil { + v = []byte{} + } + x.Value = v +} + +func (x *NetworkConfig_Parameter) HasKey() bool { + if x == nil { + return false + } + return x.Key != nil +} + +func (x *NetworkConfig_Parameter) HasValue() bool { + if x == nil { + return false + } + return x.Value != nil +} + +func (x *NetworkConfig_Parameter) ClearKey() { + x.Key = nil +} + +func (x *NetworkConfig_Parameter) ClearValue() { + x.Value = nil +} + +type NetworkConfig_Parameter_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Parameter key. UTF-8 encoded string + Key []byte + // Parameter value + Value []byte +} + +func (b0 NetworkConfig_Parameter_builder) Build() *NetworkConfig_Parameter { + m0 := &NetworkConfig_Parameter{} + b, x := &b0, m0 + _, _ = b, x + x.Key = b.Key + x.Value = b.Value + return m0 +} + +var File_api_netmap_grpc_types_proto protoreflect.FileDescriptor + +var file_api_netmap_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x61, 0x70, 0x69, 0x2f, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 0x62, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, + 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, + 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, + 0x07, +} + +var file_api_netmap_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_api_netmap_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_api_netmap_grpc_types_proto_goTypes = []any{ + (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_api_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_api_netmap_grpc_types_proto_init() } +func file_api_netmap_grpc_types_proto_init() { + if File_api_netmap_grpc_types_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_netmap_grpc_types_proto_rawDesc, + NumEnums: 3, + NumMessages: 10, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_netmap_grpc_types_proto_goTypes, + DependencyIndexes: file_api_netmap_grpc_types_proto_depIdxs, + EnumInfos: file_api_netmap_grpc_types_proto_enumTypes, + MessageInfos: file_api_netmap_grpc_types_proto_msgTypes, + }.Build() + File_api_netmap_grpc_types_proto = out.File + file_api_netmap_grpc_types_proto_rawDesc = nil + file_api_netmap_grpc_types_proto_goTypes = nil + file_api_netmap_grpc_types_proto_depIdxs = nil +} diff --git a/api/netmap/grpc/types_frostfs.pb.go b/api/netmap/grpc/types_frostfs.pb.go deleted file mode 100644 index 15f8959..0000000 --- a/api/netmap/grpc/types_frostfs.pb.go +++ /dev/null @@ -1,2749 +0,0 @@ -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package netmap - -import ( - json "encoding/json" - fmt "fmt" - pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" - proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" - encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" - easyproto "github.com/VictoriaMetrics/easyproto" - jlexer "github.com/mailru/easyjson/jlexer" - jwriter "github.com/mailru/easyjson/jwriter" - strconv "strconv" -) - -type 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.NestedStructureSizeUnchecked(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 { - 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, 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 - } - first := true - out.RawByte('{') - { - 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 !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 = "\"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 = 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 - } - first := true - out.RawByte('{') - { - 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 !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"attribute\":" - out.RawString(prefix) - out.String(x.Attribute) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - 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 - 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": - { - 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 - } - first := true - out.RawByte('{') - { - 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 = "\"selector\":" - out.RawString(prefix) - out.String(x.Selector) - } - { - 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 = "\"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 - 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": - { - var f string - f = in.String() - x.Selector = f - } - case "ecDataCount": - { - var f uint32 - r := in.JsonNumber() - n := r.String() - v, err := strconv.ParseUint(n, 10, 32) - if err != nil { - in.AddError(err) - return - } - pv := uint32(v) - f = pv - x.EcDataCount = f - } - case "ecParityCount": - { - var f uint32 - r := in.JsonNumber() - n := r.String() - v, err := strconv.ParseUint(n, 10, 32) - if err != nil { - in.AddError(err) - return - } - pv := uint32(v) - f = pv - x.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.NestedStructureSizeUnchecked(1, &x.Replicas[i]) - } - size += proto.UInt32Size(2, x.ContainerBackupFactor) - for i := range x.Selectors { - size += proto.NestedStructureSizeUnchecked(3, &x.Selectors[i]) - } - for i := range x.Filters { - size += proto.NestedStructureSizeUnchecked(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 { - x.Replicas[i].EmitProtobuf(mm.AppendMessage(1)) - } - if x.ContainerBackupFactor != 0 { - mm.AppendUint32(2, x.ContainerBackupFactor) - } - for i := range x.Selectors { - x.Selectors[i].EmitProtobuf(mm.AppendMessage(3)) - } - for i := range x.Filters { - 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, 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, 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, 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 - } - first := true - 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 !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 = "\"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 = "\"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 = "\"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 = Replica{} - f.UnmarshalEasyJSON(in) - list = append(list, f) - in.WantComma() - } - x.Replicas = list - in.Delim(']') - } - case "containerBackupFactor": - { - var f uint32 - r := in.JsonNumber() - n := r.String() - v, err := strconv.ParseUint(n, 10, 32) - if err != nil { - in.AddError(err) - return - } - pv := uint32(v) - f = pv - x.ContainerBackupFactor = f - } - case "selectors": - { - var f Selector - var list []Selector - in.Delim('[') - for !in.IsDelim(']') { - f = 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 = 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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"key\":" - out.RawString(prefix) - out.String(x.Key) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"value\":" - out.RawString(prefix) - out.String(x.Value) - } - { - 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('}') -} - -// 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.NestedStructureSizeUnchecked(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 { - 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, 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 - } - first := true - out.RawByte('{') - { - 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 !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 = "\"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 = "\"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('}') -} - -// 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 - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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 = 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.NestedStructureSizeUnchecked(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 { - 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, 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 - } - first := true - 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 !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('}') -} - -// 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 - 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": - { - var f NodeInfo - var list []NodeInfo - in.Delim('[') - for !in.IsDelim(']') { - f = 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 - } - first := true - out.RawByte('{') - { - 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 !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('}') -} - -// 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 - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - x.Key = f - } - case "value": - { - var f []byte - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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.NestedStructureSizeUnchecked(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 { - 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, 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 - } - first := true - 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('}') -} - -// 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 = 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.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 - } - first := true - 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 !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 = "\"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 = "\"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 - 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 - 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 - 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": - { - var f *NetworkConfig - f = new(NetworkConfig) - f.UnmarshalEasyJSON(in) - x.NetworkConfig = f - } - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} diff --git a/api/netmap/grpc/types_frostfs_fuzz.go b/api/netmap/grpc/types_frostfs_fuzz.go deleted file mode 100644 index 89ccd74..0000000 --- a/api/netmap/grpc/types_frostfs_fuzz.go +++ /dev/null @@ -1,159 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package netmap - -func DoFuzzProtoFilter(data []byte) int { - msg := new(Filter) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONFilter(data []byte) int { - msg := new(Filter) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoSelector(data []byte) int { - msg := new(Selector) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONSelector(data []byte) int { - msg := new(Selector) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoReplica(data []byte) int { - msg := new(Replica) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONReplica(data []byte) int { - msg := new(Replica) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoPlacementPolicy(data []byte) int { - msg := new(PlacementPolicy) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONPlacementPolicy(data []byte) int { - msg := new(PlacementPolicy) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoNodeInfo(data []byte) int { - msg := new(NodeInfo) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONNodeInfo(data []byte) int { - msg := new(NodeInfo) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoNetmap(data []byte) int { - msg := new(Netmap) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONNetmap(data []byte) int { - msg := new(Netmap) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoNetworkConfig(data []byte) int { - msg := new(NetworkConfig) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONNetworkConfig(data []byte) int { - msg := new(NetworkConfig) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoNetworkInfo(data []byte) int { - msg := new(NetworkInfo) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONNetworkInfo(data []byte) int { - msg := new(NetworkInfo) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} diff --git a/api/netmap/grpc/types_frostfs_test.go b/api/netmap/grpc/types_frostfs_test.go deleted file mode 100644 index 9996dc9..0000000 --- a/api/netmap/grpc/types_frostfs_test.go +++ /dev/null @@ -1,91 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package netmap - -import ( - testing "testing" -) - -func FuzzProtoFilter(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoFilter(data) - }) -} -func FuzzJSONFilter(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONFilter(data) - }) -} -func FuzzProtoSelector(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoSelector(data) - }) -} -func FuzzJSONSelector(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONSelector(data) - }) -} -func FuzzProtoReplica(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoReplica(data) - }) -} -func FuzzJSONReplica(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONReplica(data) - }) -} -func FuzzProtoPlacementPolicy(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoPlacementPolicy(data) - }) -} -func FuzzJSONPlacementPolicy(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONPlacementPolicy(data) - }) -} -func FuzzProtoNodeInfo(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoNodeInfo(data) - }) -} -func FuzzJSONNodeInfo(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONNodeInfo(data) - }) -} -func FuzzProtoNetmap(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoNetmap(data) - }) -} -func FuzzJSONNetmap(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONNetmap(data) - }) -} -func FuzzProtoNetworkConfig(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoNetworkConfig(data) - }) -} -func FuzzJSONNetworkConfig(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONNetworkConfig(data) - }) -} -func FuzzProtoNetworkInfo(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoNetworkInfo(data) - }) -} -func FuzzJSONNetworkInfo(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONNetworkInfo(data) - }) -} diff --git a/api/netmap/grpc/types_protoopaque.pb.go b/api/netmap/grpc/types_protoopaque.pb.go new file mode 100644 index 0000000..2322525 --- /dev/null +++ b/api/netmap/grpc/types_protoopaque.pb.go @@ -0,0 +1,2001 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/netmap/grpc/types.proto + +//go:build protoopaque + +package netmap + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 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_api_netmap_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (Operation) Type() protoreflect.EnumType { + return &file_api_netmap_grpc_types_proto_enumTypes[0] +} + +func (x Operation) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// 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_api_netmap_grpc_types_proto_enumTypes[1].Descriptor() +} + +func (Clause) Type() protoreflect.EnumType { + return &file_api_netmap_grpc_types_proto_enumTypes[1] +} + +func (x Clause) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Represents the enumeration of various states of the FrostFS 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_api_netmap_grpc_types_proto_enumTypes[2].Descriptor() +} + +func (NodeInfo_State) Type() protoreflect.EnumType { + return &file_api_netmap_grpc_types_proto_enumTypes[2] +} + +func (x NodeInfo_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + xxx_hidden_Key *string `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"` + xxx_hidden_Op Operation `protobuf:"varint,3,opt,name=op,enum=neo.fs.v2.netmap.Operation" json:"op,omitempty"` + xxx_hidden_Value *string `protobuf:"bytes,4,opt,name=value" json:"value,omitempty"` + xxx_hidden_Filters *[]*Filter `protobuf:"bytes,5,rep,name=filters" json:"filters,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Filter) Reset() { + *x = Filter{} + mi := &file_api_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_api_netmap_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Filter) GetName() string { + if x != nil { + if x.xxx_hidden_Name != nil { + return *x.xxx_hidden_Name + } + return "" + } + return "" +} + +func (x *Filter) GetKey() string { + if x != nil { + if x.xxx_hidden_Key != nil { + return *x.xxx_hidden_Key + } + return "" + } + return "" +} + +func (x *Filter) GetOp() Operation { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 2) { + return x.xxx_hidden_Op + } + } + return Operation_OPERATION_UNSPECIFIED +} + +func (x *Filter) GetValue() string { + if x != nil { + if x.xxx_hidden_Value != nil { + return *x.xxx_hidden_Value + } + return "" + } + return "" +} + +func (x *Filter) GetFilters() []*Filter { + if x != nil { + if x.xxx_hidden_Filters != nil { + return *x.xxx_hidden_Filters + } + } + return nil +} + +func (x *Filter) SetName(v string) { + x.xxx_hidden_Name = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 5) +} + +func (x *Filter) SetKey(v string) { + x.xxx_hidden_Key = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 5) +} + +func (x *Filter) SetOp(v Operation) { + x.xxx_hidden_Op = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 5) +} + +func (x *Filter) SetValue(v string) { + x.xxx_hidden_Value = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 5) +} + +func (x *Filter) SetFilters(v []*Filter) { + x.xxx_hidden_Filters = &v +} + +func (x *Filter) HasName() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *Filter) HasKey() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *Filter) HasOp() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *Filter) HasValue() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *Filter) ClearName() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Name = nil +} + +func (x *Filter) ClearKey() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Key = nil +} + +func (x *Filter) ClearOp() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Op = Operation_OPERATION_UNSPECIFIED +} + +func (x *Filter) ClearValue() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_Value = nil +} + +type Filter_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // 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 + // Key to filter + Key *string + // Filtering operation + Op *Operation + // Value to match + Value *string + // List of inner filters. Top level operation will be applied to the whole + // list. + Filters []*Filter +} + +func (b0 Filter_builder) Build() *Filter { + m0 := &Filter{} + b, x := &b0, m0 + _, _ = b, x + if b.Name != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 5) + x.xxx_hidden_Name = b.Name + } + if b.Key != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 5) + x.xxx_hidden_Key = b.Key + } + if b.Op != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 5) + x.xxx_hidden_Op = *b.Op + } + if b.Value != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 5) + x.xxx_hidden_Value = b.Value + } + x.xxx_hidden_Filters = &b.Filters + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + xxx_hidden_Count uint32 `protobuf:"varint,2,opt,name=count" json:"count,omitempty"` + xxx_hidden_Clause Clause `protobuf:"varint,3,opt,name=clause,enum=neo.fs.v2.netmap.Clause" json:"clause,omitempty"` + xxx_hidden_Attribute *string `protobuf:"bytes,4,opt,name=attribute" json:"attribute,omitempty"` + xxx_hidden_Filter *string `protobuf:"bytes,5,opt,name=filter" json:"filter,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Selector) Reset() { + *x = Selector{} + mi := &file_api_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_api_netmap_grpc_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Selector) GetName() string { + if x != nil { + if x.xxx_hidden_Name != nil { + return *x.xxx_hidden_Name + } + return "" + } + return "" +} + +func (x *Selector) GetCount() uint32 { + if x != nil { + return x.xxx_hidden_Count + } + return 0 +} + +func (x *Selector) GetClause() Clause { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 2) { + return x.xxx_hidden_Clause + } + } + return Clause_CLAUSE_UNSPECIFIED +} + +func (x *Selector) GetAttribute() string { + if x != nil { + if x.xxx_hidden_Attribute != nil { + return *x.xxx_hidden_Attribute + } + return "" + } + return "" +} + +func (x *Selector) GetFilter() string { + if x != nil { + if x.xxx_hidden_Filter != nil { + return *x.xxx_hidden_Filter + } + return "" + } + return "" +} + +func (x *Selector) SetName(v string) { + x.xxx_hidden_Name = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 5) +} + +func (x *Selector) SetCount(v uint32) { + x.xxx_hidden_Count = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 5) +} + +func (x *Selector) SetClause(v Clause) { + x.xxx_hidden_Clause = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 5) +} + +func (x *Selector) SetAttribute(v string) { + x.xxx_hidden_Attribute = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 5) +} + +func (x *Selector) SetFilter(v string) { + x.xxx_hidden_Filter = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 4, 5) +} + +func (x *Selector) HasName() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *Selector) HasCount() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *Selector) HasClause() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *Selector) HasAttribute() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *Selector) HasFilter() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 4) +} + +func (x *Selector) ClearName() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Name = nil +} + +func (x *Selector) ClearCount() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Count = 0 +} + +func (x *Selector) ClearClause() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Clause = Clause_CLAUSE_UNSPECIFIED +} + +func (x *Selector) ClearAttribute() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_Attribute = nil +} + +func (x *Selector) ClearFilter() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 4) + x.xxx_hidden_Filter = nil +} + +type Selector_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Selector name to reference in object placement section + Name *string + // How many nodes to select from the bucket + Count *uint32 + // Selector modifier showing how to form a bucket + Clause *Clause + // Bucket attribute to select from + Attribute *string + // Filter reference to select from + Filter *string +} + +func (b0 Selector_builder) Build() *Selector { + m0 := &Selector{} + b, x := &b0, m0 + _, _ = b, x + if b.Name != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 5) + x.xxx_hidden_Name = b.Name + } + if b.Count != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 5) + x.xxx_hidden_Count = *b.Count + } + if b.Clause != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 5) + x.xxx_hidden_Clause = *b.Clause + } + if b.Attribute != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 5) + x.xxx_hidden_Attribute = b.Attribute + } + if b.Filter != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 4, 5) + x.xxx_hidden_Filter = b.Filter + } + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_Count uint32 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"` + xxx_hidden_Selector *string `protobuf:"bytes,2,opt,name=selector" json:"selector,omitempty"` + xxx_hidden_EcDataCount uint32 `protobuf:"varint,3,opt,name=ec_data_count,json=ecDataCount" json:"ec_data_count,omitempty"` + xxx_hidden_EcParityCount uint32 `protobuf:"varint,4,opt,name=ec_parity_count,json=ecParityCount" json:"ec_parity_count,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Replica) Reset() { + *x = Replica{} + mi := &file_api_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_api_netmap_grpc_types_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Replica) GetCount() uint32 { + if x != nil { + return x.xxx_hidden_Count + } + return 0 +} + +func (x *Replica) GetSelector() string { + if x != nil { + if x.xxx_hidden_Selector != nil { + return *x.xxx_hidden_Selector + } + return "" + } + return "" +} + +func (x *Replica) GetEcDataCount() uint32 { + if x != nil { + return x.xxx_hidden_EcDataCount + } + return 0 +} + +func (x *Replica) GetEcParityCount() uint32 { + if x != nil { + return x.xxx_hidden_EcParityCount + } + return 0 +} + +func (x *Replica) SetCount(v uint32) { + x.xxx_hidden_Count = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 4) +} + +func (x *Replica) SetSelector(v string) { + x.xxx_hidden_Selector = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 4) +} + +func (x *Replica) SetEcDataCount(v uint32) { + x.xxx_hidden_EcDataCount = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 4) +} + +func (x *Replica) SetEcParityCount(v uint32) { + x.xxx_hidden_EcParityCount = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 4) +} + +func (x *Replica) HasCount() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *Replica) HasSelector() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *Replica) HasEcDataCount() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *Replica) HasEcParityCount() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *Replica) ClearCount() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Count = 0 +} + +func (x *Replica) ClearSelector() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Selector = nil +} + +func (x *Replica) ClearEcDataCount() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_EcDataCount = 0 +} + +func (x *Replica) ClearEcParityCount() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_EcParityCount = 0 +} + +type Replica_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // How many object replicas to put + Count *uint32 + // Named selector bucket to put replicas + Selector *string + // Data shards count + EcDataCount *uint32 + // Parity shards count + EcParityCount *uint32 +} + +func (b0 Replica_builder) Build() *Replica { + m0 := &Replica{} + b, x := &b0, m0 + _, _ = b, x + if b.Count != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 4) + x.xxx_hidden_Count = *b.Count + } + if b.Selector != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 4) + x.xxx_hidden_Selector = b.Selector + } + if b.EcDataCount != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 4) + x.xxx_hidden_EcDataCount = *b.EcDataCount + } + if b.EcParityCount != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 4) + x.xxx_hidden_EcParityCount = *b.EcParityCount + } + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_Replicas *[]*Replica `protobuf:"bytes,1,rep,name=replicas" json:"replicas,omitempty"` + xxx_hidden_ContainerBackupFactor uint32 `protobuf:"varint,2,opt,name=container_backup_factor,json=containerBackupFactor" json:"container_backup_factor,omitempty"` + xxx_hidden_Selectors *[]*Selector `protobuf:"bytes,3,rep,name=selectors" json:"selectors,omitempty"` + xxx_hidden_Filters *[]*Filter `protobuf:"bytes,4,rep,name=filters" json:"filters,omitempty"` + xxx_hidden_Unique bool `protobuf:"varint,5,opt,name=unique" json:"unique,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PlacementPolicy) Reset() { + *x = PlacementPolicy{} + mi := &file_api_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_api_netmap_grpc_types_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PlacementPolicy) GetReplicas() []*Replica { + if x != nil { + if x.xxx_hidden_Replicas != nil { + return *x.xxx_hidden_Replicas + } + } + return nil +} + +func (x *PlacementPolicy) GetContainerBackupFactor() uint32 { + if x != nil { + return x.xxx_hidden_ContainerBackupFactor + } + return 0 +} + +func (x *PlacementPolicy) GetSelectors() []*Selector { + if x != nil { + if x.xxx_hidden_Selectors != nil { + return *x.xxx_hidden_Selectors + } + } + return nil +} + +func (x *PlacementPolicy) GetFilters() []*Filter { + if x != nil { + if x.xxx_hidden_Filters != nil { + return *x.xxx_hidden_Filters + } + } + return nil +} + +func (x *PlacementPolicy) GetUnique() bool { + if x != nil { + return x.xxx_hidden_Unique + } + return false +} + +func (x *PlacementPolicy) SetReplicas(v []*Replica) { + x.xxx_hidden_Replicas = &v +} + +func (x *PlacementPolicy) SetContainerBackupFactor(v uint32) { + x.xxx_hidden_ContainerBackupFactor = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 5) +} + +func (x *PlacementPolicy) SetSelectors(v []*Selector) { + x.xxx_hidden_Selectors = &v +} + +func (x *PlacementPolicy) SetFilters(v []*Filter) { + x.xxx_hidden_Filters = &v +} + +func (x *PlacementPolicy) SetUnique(v bool) { + x.xxx_hidden_Unique = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 4, 5) +} + +func (x *PlacementPolicy) HasContainerBackupFactor() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *PlacementPolicy) HasUnique() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 4) +} + +func (x *PlacementPolicy) ClearContainerBackupFactor() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_ContainerBackupFactor = 0 +} + +func (x *PlacementPolicy) ClearUnique() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 4) + x.xxx_hidden_Unique = false +} + +type PlacementPolicy_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Rules to set number of object replicas and place each one into a named + // bucket + Replicas []*Replica + // Container backup factor controls how deep FrostFS will search for nodes + // alternatives to include into container's nodes subset + ContainerBackupFactor *uint32 + // Set of Selectors to form the container's nodes subset + Selectors []*Selector + // List of named filters to reference in selectors + Filters []*Filter + // Unique flag defines non-overlapping application for replicas + Unique *bool +} + +func (b0 PlacementPolicy_builder) Build() *PlacementPolicy { + m0 := &PlacementPolicy{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Replicas = &b.Replicas + if b.ContainerBackupFactor != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 5) + x.xxx_hidden_ContainerBackupFactor = *b.ContainerBackupFactor + } + x.xxx_hidden_Selectors = &b.Selectors + x.xxx_hidden_Filters = &b.Filters + if b.Unique != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 4, 5) + x.xxx_hidden_Unique = *b.Unique + } + return m0 +} + +// FrostFS node description +type NodeInfo struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_PublicKey []byte `protobuf:"bytes,1,opt,name=public_key,json=publicKey" json:"public_key,omitempty"` + xxx_hidden_Addresses []string `protobuf:"bytes,2,rep,name=addresses" json:"addresses,omitempty"` + xxx_hidden_Attributes *[]*NodeInfo_Attribute `protobuf:"bytes,3,rep,name=attributes" json:"attributes,omitempty"` + xxx_hidden_State NodeInfo_State `protobuf:"varint,4,opt,name=state,enum=neo.fs.v2.netmap.NodeInfo_State" json:"state,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NodeInfo) Reset() { + *x = NodeInfo{} + mi := &file_api_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_api_netmap_grpc_types_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *NodeInfo) GetPublicKey() []byte { + if x != nil { + return x.xxx_hidden_PublicKey + } + return nil +} + +func (x *NodeInfo) GetAddresses() []string { + if x != nil { + return x.xxx_hidden_Addresses + } + return nil +} + +func (x *NodeInfo) GetAttributes() []*NodeInfo_Attribute { + if x != nil { + if x.xxx_hidden_Attributes != nil { + return *x.xxx_hidden_Attributes + } + } + return nil +} + +func (x *NodeInfo) GetState() NodeInfo_State { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 3) { + return x.xxx_hidden_State + } + } + return NodeInfo_UNSPECIFIED +} + +func (x *NodeInfo) SetPublicKey(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_PublicKey = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 4) +} + +func (x *NodeInfo) SetAddresses(v []string) { + x.xxx_hidden_Addresses = v +} + +func (x *NodeInfo) SetAttributes(v []*NodeInfo_Attribute) { + x.xxx_hidden_Attributes = &v +} + +func (x *NodeInfo) SetState(v NodeInfo_State) { + x.xxx_hidden_State = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 4) +} + +func (x *NodeInfo) HasPublicKey() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *NodeInfo) HasState() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *NodeInfo) ClearPublicKey() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_PublicKey = nil +} + +func (x *NodeInfo) ClearState() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_State = NodeInfo_UNSPECIFIED +} + +type NodeInfo_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Public key of the FrostFS node in a binary format + PublicKey []byte + // Ways to connect to a node + Addresses []string + // Carries list of the FrostFS 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 + // Carries state of the FrostFS node + State *NodeInfo_State +} + +func (b0 NodeInfo_builder) Build() *NodeInfo { + m0 := &NodeInfo{} + b, x := &b0, m0 + _, _ = b, x + if b.PublicKey != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 4) + x.xxx_hidden_PublicKey = b.PublicKey + } + x.xxx_hidden_Addresses = b.Addresses + x.xxx_hidden_Attributes = &b.Attributes + if b.State != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 4) + x.xxx_hidden_State = *b.State + } + return m0 +} + +// Network map structure +type Netmap struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Epoch uint64 `protobuf:"varint,1,opt,name=epoch" json:"epoch,omitempty"` + xxx_hidden_Nodes *[]*NodeInfo `protobuf:"bytes,2,rep,name=nodes" json:"nodes,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Netmap) Reset() { + *x = Netmap{} + mi := &file_api_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_api_netmap_grpc_types_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Netmap) GetEpoch() uint64 { + if x != nil { + return x.xxx_hidden_Epoch + } + return 0 +} + +func (x *Netmap) GetNodes() []*NodeInfo { + if x != nil { + if x.xxx_hidden_Nodes != nil { + return *x.xxx_hidden_Nodes + } + } + return nil +} + +func (x *Netmap) SetEpoch(v uint64) { + x.xxx_hidden_Epoch = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2) +} + +func (x *Netmap) SetNodes(v []*NodeInfo) { + x.xxx_hidden_Nodes = &v +} + +func (x *Netmap) HasEpoch() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *Netmap) ClearEpoch() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Epoch = 0 +} + +type Netmap_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Network map revision number. + Epoch *uint64 + // Nodes presented in network. + Nodes []*NodeInfo +} + +func (b0 Netmap_builder) Build() *Netmap { + m0 := &Netmap{} + b, x := &b0, m0 + _, _ = b, x + if b.Epoch != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2) + x.xxx_hidden_Epoch = *b.Epoch + } + x.xxx_hidden_Nodes = &b.Nodes + return m0 +} + +// FrostFS network configuration +type NetworkConfig struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Parameters *[]*NetworkConfig_Parameter `protobuf:"bytes,1,rep,name=parameters" json:"parameters,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetworkConfig) Reset() { + *x = NetworkConfig{} + mi := &file_api_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_api_netmap_grpc_types_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *NetworkConfig) GetParameters() []*NetworkConfig_Parameter { + if x != nil { + if x.xxx_hidden_Parameters != nil { + return *x.xxx_hidden_Parameters + } + } + return nil +} + +func (x *NetworkConfig) SetParameters(v []*NetworkConfig_Parameter) { + x.xxx_hidden_Parameters = &v +} + +type NetworkConfig_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // List of parameter values + Parameters []*NetworkConfig_Parameter +} + +func (b0 NetworkConfig_builder) Build() *NetworkConfig { + m0 := &NetworkConfig{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Parameters = &b.Parameters + return m0 +} + +// Information about FrostFS network +type NetworkInfo struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_CurrentEpoch uint64 `protobuf:"varint,1,opt,name=current_epoch,json=currentEpoch" json:"current_epoch,omitempty"` + xxx_hidden_MagicNumber uint64 `protobuf:"varint,2,opt,name=magic_number,json=magicNumber" json:"magic_number,omitempty"` + xxx_hidden_MsPerBlock int64 `protobuf:"varint,3,opt,name=ms_per_block,json=msPerBlock" json:"ms_per_block,omitempty"` + xxx_hidden_NetworkConfig *NetworkConfig `protobuf:"bytes,4,opt,name=network_config,json=networkConfig" json:"network_config,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetworkInfo) Reset() { + *x = NetworkInfo{} + mi := &file_api_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_api_netmap_grpc_types_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *NetworkInfo) GetCurrentEpoch() uint64 { + if x != nil { + return x.xxx_hidden_CurrentEpoch + } + return 0 +} + +func (x *NetworkInfo) GetMagicNumber() uint64 { + if x != nil { + return x.xxx_hidden_MagicNumber + } + return 0 +} + +func (x *NetworkInfo) GetMsPerBlock() int64 { + if x != nil { + return x.xxx_hidden_MsPerBlock + } + return 0 +} + +func (x *NetworkInfo) GetNetworkConfig() *NetworkConfig { + if x != nil { + return x.xxx_hidden_NetworkConfig + } + return nil +} + +func (x *NetworkInfo) SetCurrentEpoch(v uint64) { + x.xxx_hidden_CurrentEpoch = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 4) +} + +func (x *NetworkInfo) SetMagicNumber(v uint64) { + x.xxx_hidden_MagicNumber = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 4) +} + +func (x *NetworkInfo) SetMsPerBlock(v int64) { + x.xxx_hidden_MsPerBlock = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 4) +} + +func (x *NetworkInfo) SetNetworkConfig(v *NetworkConfig) { + x.xxx_hidden_NetworkConfig = v +} + +func (x *NetworkInfo) HasCurrentEpoch() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *NetworkInfo) HasMagicNumber() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *NetworkInfo) HasMsPerBlock() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *NetworkInfo) HasNetworkConfig() bool { + if x == nil { + return false + } + return x.xxx_hidden_NetworkConfig != nil +} + +func (x *NetworkInfo) ClearCurrentEpoch() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_CurrentEpoch = 0 +} + +func (x *NetworkInfo) ClearMagicNumber() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_MagicNumber = 0 +} + +func (x *NetworkInfo) ClearMsPerBlock() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_MsPerBlock = 0 +} + +func (x *NetworkInfo) ClearNetworkConfig() { + x.xxx_hidden_NetworkConfig = nil +} + +type NetworkInfo_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Number of the current epoch in the FrostFS network + CurrentEpoch *uint64 + // Magic number of the sidechain of the FrostFS network + MagicNumber *uint64 + // MillisecondsPerBlock network parameter of the sidechain of the FrostFS + // network + MsPerBlock *int64 + // FrostFS network configuration + NetworkConfig *NetworkConfig +} + +func (b0 NetworkInfo_builder) Build() *NetworkInfo { + m0 := &NetworkInfo{} + b, x := &b0, m0 + _, _ = b, x + if b.CurrentEpoch != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 4) + x.xxx_hidden_CurrentEpoch = *b.CurrentEpoch + } + if b.MagicNumber != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 4) + x.xxx_hidden_MagicNumber = *b.MagicNumber + } + if b.MsPerBlock != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 4) + x.xxx_hidden_MsPerBlock = *b.MsPerBlock + } + x.xxx_hidden_NetworkConfig = b.NetworkConfig + return m0 +} + +// Administrator-defined Attributes of the FrostFS 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 FrostFS +// Storage Node configuration uses ":" and "/" symbols, e.g.: +// +// `FrostFS_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 FrostFS Technical Specification. +type NodeInfo_Attribute struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + xxx_hidden_Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + xxx_hidden_Parents []string `protobuf:"bytes,3,rep,name=parents" json:"parents,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NodeInfo_Attribute) Reset() { + *x = NodeInfo_Attribute{} + mi := &file_api_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_api_netmap_grpc_types_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *NodeInfo_Attribute) GetKey() string { + if x != nil { + if x.xxx_hidden_Key != nil { + return *x.xxx_hidden_Key + } + return "" + } + return "" +} + +func (x *NodeInfo_Attribute) GetValue() string { + if x != nil { + if x.xxx_hidden_Value != nil { + return *x.xxx_hidden_Value + } + return "" + } + return "" +} + +func (x *NodeInfo_Attribute) GetParents() []string { + if x != nil { + return x.xxx_hidden_Parents + } + return nil +} + +func (x *NodeInfo_Attribute) SetKey(v string) { + x.xxx_hidden_Key = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 3) +} + +func (x *NodeInfo_Attribute) SetValue(v string) { + x.xxx_hidden_Value = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 3) +} + +func (x *NodeInfo_Attribute) SetParents(v []string) { + x.xxx_hidden_Parents = v +} + +func (x *NodeInfo_Attribute) HasKey() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *NodeInfo_Attribute) HasValue() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *NodeInfo_Attribute) ClearKey() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Key = nil +} + +func (x *NodeInfo_Attribute) ClearValue() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Value = nil +} + +type NodeInfo_Attribute_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Key of the node attribute + Key *string + // Value of the node attribute + Value *string + // Parent keys, if any. For example for `City` it could be `Region` and + // `Country`. + Parents []string +} + +func (b0 NodeInfo_Attribute_builder) Build() *NodeInfo_Attribute { + m0 := &NodeInfo_Attribute{} + b, x := &b0, m0 + _, _ = b, x + if b.Key != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 3) + x.xxx_hidden_Key = b.Key + } + if b.Value != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 3) + x.xxx_hidden_Value = b.Value + } + x.xxx_hidden_Parents = b.Parents + return m0 +} + +// 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** \ +// FrostFS 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 FrostFS object measured in bytes. +// Value: little-endian integer. Default: 0. +// +// This value refers to the maximum size of a **physically** stored object +// in FrostFS. However, from a user's perspective, the **logical** size of a +// stored object can be significantly larger. The relationship between the +// physical and logical object sizes is governed by the following formula +// +// ```math +// \mathrm{Stored\ Object\ Size} \le +// \frac{ +// \left(\mathrm{Max\ Object\ Size}\right)^2 +// }{ +// \mathrm{Object\ ID\ Size} +// } +// ``` +// +// This arises from the fact that a tombstone, also being an object, stores +// the IDs of inhumed objects and cannot be divided into smaller objects, +// thus having an upper limit for its size. +// +// For example, if: +// +// - Max Object Size Size = 64 MiB; +// +// - Object ID Size = 32 B; +// +// then: +// ```math +// \mathrm{Stored\ Object\ Size} \le +// \frac{\left(64\ \mathrm{MiB}\right)^2}{32\ \mathrm{B}} = +// \frac{2^{52}}{2^5}\ \mathrm{B} = +// 2^{47}\ \mathrm{B} = +// 128\ \mathrm{TiB} +// ``` +// - **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 `protogen:"opaque.v1"` + xxx_hidden_Key []byte `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + xxx_hidden_Value []byte `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetworkConfig_Parameter) Reset() { + *x = NetworkConfig_Parameter{} + mi := &file_api_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_api_netmap_grpc_types_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *NetworkConfig_Parameter) GetKey() []byte { + if x != nil { + return x.xxx_hidden_Key + } + return nil +} + +func (x *NetworkConfig_Parameter) GetValue() []byte { + if x != nil { + return x.xxx_hidden_Value + } + return nil +} + +func (x *NetworkConfig_Parameter) SetKey(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Key = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2) +} + +func (x *NetworkConfig_Parameter) SetValue(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Value = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2) +} + +func (x *NetworkConfig_Parameter) HasKey() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *NetworkConfig_Parameter) HasValue() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *NetworkConfig_Parameter) ClearKey() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Key = nil +} + +func (x *NetworkConfig_Parameter) ClearValue() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Value = nil +} + +type NetworkConfig_Parameter_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Parameter key. UTF-8 encoded string + Key []byte + // Parameter value + Value []byte +} + +func (b0 NetworkConfig_Parameter_builder) Build() *NetworkConfig_Parameter { + m0 := &NetworkConfig_Parameter{} + b, x := &b0, m0 + _, _ = b, x + if b.Key != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2) + x.xxx_hidden_Key = b.Key + } + if b.Value != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2) + x.xxx_hidden_Value = b.Value + } + return m0 +} + +var File_api_netmap_grpc_types_proto protoreflect.FileDescriptor + +var file_api_netmap_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x61, 0x70, 0x69, 0x2f, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 0x62, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, + 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, + 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, + 0x07, +} + +var file_api_netmap_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_api_netmap_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_api_netmap_grpc_types_proto_goTypes = []any{ + (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_api_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_api_netmap_grpc_types_proto_init() } +func file_api_netmap_grpc_types_proto_init() { + if File_api_netmap_grpc_types_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_netmap_grpc_types_proto_rawDesc, + NumEnums: 3, + NumMessages: 10, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_netmap_grpc_types_proto_goTypes, + DependencyIndexes: file_api_netmap_grpc_types_proto_depIdxs, + EnumInfos: file_api_netmap_grpc_types_proto_enumTypes, + MessageInfos: file_api_netmap_grpc_types_proto_msgTypes, + }.Build() + File_api_netmap_grpc_types_proto = out.File + file_api_netmap_grpc_types_proto_rawDesc = nil + file_api_netmap_grpc_types_proto_goTypes = nil + file_api_netmap_grpc_types_proto_depIdxs = nil +} diff --git a/api/netmap/string.go b/api/netmap/string.go index a6805ae..7b9c146 100644 --- a/api/netmap/string.go +++ b/api/netmap/string.go @@ -14,12 +14,10 @@ func (x Clause) String() string { // // Returns true if s was parsed successfully. func (x *Clause) FromString(s string) bool { - var g netmap.Clause - - ok := g.FromString(s) + g, ok := netmap.Clause_value[s] if ok { - *x = ClauseFromGRPCMessage(g) + *x = ClauseFromGRPCMessage(netmap.Clause(g)) } return ok @@ -35,12 +33,10 @@ func (x Operation) String() string { // // Returns true if s was parsed successfully. func (x *Operation) FromString(s string) bool { - var g netmap.Operation - - ok := g.FromString(s) + g, ok := netmap.Operation_value[s] if ok { - *x = OperationFromGRPCMessage(g) + *x = OperationFromGRPCMessage(netmap.Operation(g)) } return ok @@ -56,12 +52,10 @@ func (x NodeState) String() string { // // Returns true if s was parsed successfully. func (x *NodeState) FromString(s string) bool { - var g netmap.NodeInfo_State - - ok := g.FromString(s) + g, ok := netmap.NodeInfo_State_value[s] if ok { - *x = NodeStateFromRPCMessage(g) + *x = NodeStateFromRPCMessage(netmap.NodeInfo_State(g)) } return ok diff --git a/api/object/convert.go b/api/object/convert.go index 7fb1d74..016a367 100644 --- a/api/object/convert.go +++ b/api/object/convert.go @@ -142,24 +142,24 @@ func (a *Attribute) FromGRPCMessage(m grpc.Message) error { return nil } -func AttributesToGRPC(xs []Attribute) (res []object.Header_Attribute) { +func AttributesToGRPC(xs []Attribute) (res []*object.Header_Attribute) { if xs != nil { - res = make([]object.Header_Attribute, 0, len(xs)) + res = make([]*object.Header_Attribute, 0, len(xs)) for i := range xs { - res = append(res, *xs[i].ToGRPCMessage().(*object.Header_Attribute)) + res = append(res, xs[i].ToGRPCMessage().(*object.Header_Attribute)) } } return } -func AttributesFromGRPC(xs []object.Header_Attribute) (res []Attribute, err error) { +func AttributesFromGRPC(xs []*object.Header_Attribute) (res []Attribute, err error) { if xs != nil { res = make([]Attribute, len(xs)) for i := range xs { - err = res[i].FromGRPCMessage(&xs[i]) + err = res[i].FromGRPCMessage(xs[i]) if err != nil { return } @@ -266,14 +266,14 @@ func (h *ECHeader) ToGRPCMessage() grpc.Message { if h != nil { m = new(object.Header_EC) - m.Parent = h.Parent.ToGRPCMessage().(*refsGRPC.ObjectID) - m.ParentSplitId = h.ParentSplitID - m.ParentSplitParentId = h.ParentSplitParentID.ToGRPCMessage().(*refsGRPC.ObjectID) - m.ParentAttributes = AttributesToGRPC(h.ParentAttributes) - m.Index = h.Index - m.Total = h.Total - m.Header = h.Header - m.HeaderLength = h.HeaderLength + m.SetParent(h.Parent.ToGRPCMessage().(*refsGRPC.ObjectID)) + m.SetParentSplitId(h.ParentSplitID) + m.SetParentSplitParentId(h.ParentSplitParentID.ToGRPCMessage().(*refsGRPC.ObjectID)) + m.SetParentAttributes(AttributesToGRPC(h.ParentAttributes)) + m.SetIndex(h.Index) + m.SetTotal(h.Total) + m.SetHeader(h.Header) + m.SetHeaderLength(h.HeaderLength) } return m @@ -681,9 +681,9 @@ func (s *ECInfo) ToGRPCMessage() grpc.Message { m = new(object.ECInfo) if s.Chunks != nil { - chunks := make([]object.ECInfo_Chunk, len(s.Chunks)) + chunks := make([]*object.ECInfo_Chunk, len(s.Chunks)) for i := range chunks { - chunks[i] = *s.Chunks[i].ToGRPCMessage().(*object.ECInfo_Chunk) + chunks[i] = s.Chunks[i].ToGRPCMessage().(*object.ECInfo_Chunk) } m.Chunks = chunks } @@ -704,7 +704,7 @@ func (s *ECInfo) FromGRPCMessage(m grpc.Message) error { } else { s.Chunks = make([]ECChunk, len(chunks)) for i := range chunks { - if err := s.Chunks[i].FromGRPCMessage(&chunks[i]); err != nil { + if err := s.Chunks[i].FromGRPCMessage(chunks[i]); err != nil { return err } } @@ -718,9 +718,9 @@ func (c *ECChunk) ToGRPCMessage() grpc.Message { if c != nil { m = new(object.ECInfo_Chunk) - m.Total = c.Total - m.Index = c.Index - m.Id = c.ID.ToGRPCMessage().(*refsGRPC.ObjectID) + m.SetTotal(c.Total) + m.SetIndex(c.Index) + m.SetId(c.ID.ToGRPCMessage().(*refsGRPC.ObjectID)) } return m @@ -735,8 +735,8 @@ func (c *ECChunk) FromGRPCMessage(m grpc.Message) error { if err := c.ID.FromGRPCMessage(v.GetId()); err != nil { return err } - c.Index = v.Index - c.Total = v.Total + c.Index = v.GetIndex() + c.Total = v.GetTotal() return nil } @@ -888,8 +888,7 @@ func (r *GetObjectPartChunk) ToGRPCMessage() grpc.Message { if r != nil { m = new(object.GetResponse_Body_Chunk) - - m.SetChunk(r.chunk) + m.Chunk = r.chunk } return m @@ -901,7 +900,7 @@ func (r *GetObjectPartChunk) FromGRPCMessage(m grpc.Message) error { return message.NewUnexpectedMessageType(m, v) } - r.chunk = v.GetChunk() + r.chunk = v.Chunk return nil } @@ -918,7 +917,7 @@ func (r *GetResponseBody) ToGRPCMessage() grpc.Message { case *GetObjectPartInit: m.SetInit(t.ToGRPCMessage().(*object.GetResponse_Body_Init)) case *GetObjectPartChunk: - m.SetChunk(t.ToGRPCMessage().(*object.GetResponse_Body_Chunk)) + m.SetChunk(t.ToGRPCMessage().(*object.GetResponse_Body_Chunk).Chunk) case *SplitInfo: m.SetSplitInfo(t.ToGRPCMessage().(*object.SplitInfo)) case *ECInfo: @@ -1088,7 +1087,7 @@ func (r *PutObjectPartChunk) ToGRPCMessage() grpc.Message { if r != nil { m = new(object.PutRequest_Body_Chunk) - m.SetChunk(r.chunk) + m.Chunk = r.chunk } return m @@ -1100,7 +1099,7 @@ func (r *PutObjectPartChunk) FromGRPCMessage(m grpc.Message) error { return message.NewUnexpectedMessageType(m, v) } - r.chunk = v.GetChunk() + r.chunk = v.Chunk return nil } @@ -1117,7 +1116,7 @@ func (r *PutRequestBody) ToGRPCMessage() grpc.Message { case *PutObjectPartInit: m.SetInit(t.ToGRPCMessage().(*object.PutRequest_Body_Init)) case *PutObjectPartChunk: - m.SetChunk(t.ToGRPCMessage().(*object.PutRequest_Body_Chunk)) + m.SetChunk(t.ToGRPCMessage().(*object.PutRequest_Body_Chunk).Chunk) default: panic(fmt.Sprintf("unknown put object part %T", t)) } @@ -1624,24 +1623,24 @@ func (f *SearchFilter) FromGRPCMessage(m grpc.Message) error { return nil } -func SearchFiltersToGRPC(fs []SearchFilter) (res []object.SearchRequest_Body_Filter) { +func SearchFiltersToGRPC(fs []SearchFilter) (res []*object.SearchRequest_Body_Filter) { if fs != nil { - res = make([]object.SearchRequest_Body_Filter, 0, len(fs)) + res = make([]*object.SearchRequest_Body_Filter, 0, len(fs)) for i := range fs { - res = append(res, *fs[i].ToGRPCMessage().(*object.SearchRequest_Body_Filter)) + res = append(res, fs[i].ToGRPCMessage().(*object.SearchRequest_Body_Filter)) } } return } -func SearchFiltersFromGRPC(fs []object.SearchRequest_Body_Filter) (res []SearchFilter, err error) { +func SearchFiltersFromGRPC(fs []*object.SearchRequest_Body_Filter) (res []SearchFilter, err error) { if fs != nil { res = make([]SearchFilter, len(fs)) for i := range fs { - err = res[i].FromGRPCMessage(&fs[i]) + err = res[i].FromGRPCMessage(fs[i]) if err != nil { return } @@ -1823,24 +1822,24 @@ func (r *Range) FromGRPCMessage(m grpc.Message) error { return nil } -func RangesToGRPC(rs []Range) (res []object.Range) { +func RangesToGRPC(rs []Range) (res []*object.Range) { if rs != nil { - res = make([]object.Range, 0, len(rs)) + res = make([]*object.Range, 0, len(rs)) for i := range rs { - res = append(res, *rs[i].ToGRPCMessage().(*object.Range)) + res = append(res, rs[i].ToGRPCMessage().(*object.Range)) } } return } -func RangesFromGRPC(rs []object.Range) (res []Range, err error) { +func RangesFromGRPC(rs []*object.Range) (res []Range, err error) { if rs != nil { res = make([]Range, len(rs)) for i := range rs { - err = res[i].FromGRPCMessage(&rs[i]) + err = res[i].FromGRPCMessage(rs[i]) if err != nil { return } @@ -1949,7 +1948,7 @@ func (r *GetRangePartChunk) ToGRPCMessage() grpc.Message { if r != nil { m = new(object.GetRangeResponse_Body_Chunk) - m.SetChunk(r.chunk) + m.Chunk = r.chunk } return m @@ -1961,7 +1960,7 @@ func (r *GetRangePartChunk) FromGRPCMessage(m grpc.Message) error { return message.NewUnexpectedMessageType(m, v) } - r.chunk = v.GetChunk() + r.chunk = v.Chunk return nil } @@ -1976,7 +1975,7 @@ func (r *GetRangeResponseBody) ToGRPCMessage() grpc.Message { case nil: m.RangePart = nil case *GetRangePartChunk: - m.SetChunk(v.ToGRPCMessage().(*object.GetRangeResponse_Body_Chunk)) + m.SetChunk(v.ToGRPCMessage().(*object.GetRangeResponse_Body_Chunk).Chunk) case *SplitInfo: m.SetSplitInfo(v.ToGRPCMessage().(*object.SplitInfo)) case *ECInfo: diff --git a/api/object/grpc/service.pb.go b/api/object/grpc/service.pb.go new file mode 100644 index 0000000..9603467 --- /dev/null +++ b/api/object/grpc/service.pb.go @@ -0,0 +1,6239 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/object/grpc/service.proto + +//go:build !protoopaque + +package object + +import ( + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// GET object request +type GetRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of get object request message. + Body *GetRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRequest) Reset() { + *x = GetRequest{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *GetRequest) SetBody(v *GetRequest_Body) { + x.Body = v +} + +func (x *GetRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *GetRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *GetRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *GetRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *GetRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *GetRequest) ClearBody() { + x.Body = nil +} + +func (x *GetRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *GetRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type GetRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of get object request message. + Body *GetRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 GetRequest_builder) Build() *GetRequest { + m0 := &GetRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// GET object response +type GetResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of get object response message. + Body *GetResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetResponse) Reset() { + *x = GetResponse{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *GetResponse) SetBody(v *GetResponse_Body) { + x.Body = v +} + +func (x *GetResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *GetResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *GetResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *GetResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *GetResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *GetResponse) ClearBody() { + x.Body = nil +} + +func (x *GetResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *GetResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type GetResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of get object response message. + Body *GetResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 GetResponse_builder) Build() *GetResponse { + m0 := &GetResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// PUT object request +type PutRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of put object request message. + Body *PutRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutRequest) Reset() { + *x = PutRequest{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *PutRequest) SetBody(v *PutRequest_Body) { + x.Body = v +} + +func (x *PutRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *PutRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *PutRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *PutRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *PutRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *PutRequest) ClearBody() { + x.Body = nil +} + +func (x *PutRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *PutRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type PutRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of put object request message. + Body *PutRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 PutRequest_builder) Build() *PutRequest { + m0 := &PutRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// PUT Object response +type PutResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of put object response message. + Body *PutResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutResponse) Reset() { + *x = PutResponse{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *PutResponse) SetBody(v *PutResponse_Body) { + x.Body = v +} + +func (x *PutResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *PutResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *PutResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *PutResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *PutResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *PutResponse) ClearBody() { + x.Body = nil +} + +func (x *PutResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *PutResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type PutResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of put object response message. + Body *PutResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 PutResponse_builder) Build() *PutResponse { + m0 := &PutResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Object DELETE request +type DeleteRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of delete object request message. + Body *DeleteRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteRequest) Reset() { + *x = DeleteRequest{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *DeleteRequest) SetBody(v *DeleteRequest_Body) { + x.Body = v +} + +func (x *DeleteRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *DeleteRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *DeleteRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *DeleteRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *DeleteRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *DeleteRequest) ClearBody() { + x.Body = nil +} + +func (x *DeleteRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *DeleteRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type DeleteRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of delete object request message. + Body *DeleteRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 DeleteRequest_builder) Build() *DeleteRequest { + m0 := &DeleteRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// DeleteResponse body is empty because we cannot guarantee permanent object +// removal in distributed system. +type DeleteResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of delete object response message. + Body *DeleteResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteResponse) Reset() { + *x = DeleteResponse{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *DeleteResponse) SetBody(v *DeleteResponse_Body) { + x.Body = v +} + +func (x *DeleteResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *DeleteResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *DeleteResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *DeleteResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *DeleteResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *DeleteResponse) ClearBody() { + x.Body = nil +} + +func (x *DeleteResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *DeleteResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type DeleteResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of delete object response message. + Body *DeleteResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 DeleteResponse_builder) Build() *DeleteResponse { + m0 := &DeleteResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Object HEAD request +type HeadRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of head object request message. + Body *HeadRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HeadRequest) Reset() { + *x = HeadRequest{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *HeadRequest) SetBody(v *HeadRequest_Body) { + x.Body = v +} + +func (x *HeadRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *HeadRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *HeadRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *HeadRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *HeadRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *HeadRequest) ClearBody() { + x.Body = nil +} + +func (x *HeadRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *HeadRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type HeadRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of head object request message. + Body *HeadRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 HeadRequest_builder) Build() *HeadRequest { + m0 := &HeadRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // Full object header + Header *Header `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + // Signed `ObjectID` to verify full header's authenticity + Signature *grpc1.Signature `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HeaderWithSignature) Reset() { + *x = HeaderWithSignature{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *HeaderWithSignature) SetHeader(v *Header) { + x.Header = v +} + +func (x *HeaderWithSignature) SetSignature(v *grpc1.Signature) { + x.Signature = v +} + +func (x *HeaderWithSignature) HasHeader() bool { + if x == nil { + return false + } + return x.Header != nil +} + +func (x *HeaderWithSignature) HasSignature() bool { + if x == nil { + return false + } + return x.Signature != nil +} + +func (x *HeaderWithSignature) ClearHeader() { + x.Header = nil +} + +func (x *HeaderWithSignature) ClearSignature() { + x.Signature = nil +} + +type HeaderWithSignature_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Full object header + Header *Header + // Signed `ObjectID` to verify full header's authenticity + Signature *grpc1.Signature +} + +func (b0 HeaderWithSignature_builder) Build() *HeaderWithSignature { + m0 := &HeaderWithSignature{} + b, x := &b0, m0 + _, _ = b, x + x.Header = b.Header + x.Signature = b.Signature + return m0 +} + +// Object HEAD response +type HeadResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of head object response message. + Body *HeadResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HeadResponse) Reset() { + *x = HeadResponse{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *HeadResponse) SetBody(v *HeadResponse_Body) { + x.Body = v +} + +func (x *HeadResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *HeadResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *HeadResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *HeadResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *HeadResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *HeadResponse) ClearBody() { + x.Body = nil +} + +func (x *HeadResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *HeadResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type HeadResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of head object response message. + Body *HeadResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 HeadResponse_builder) Build() *HeadResponse { + m0 := &HeadResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Object Search request +type SearchRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of search object request message. + Body *SearchRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchRequest) Reset() { + *x = SearchRequest{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *SearchRequest) SetBody(v *SearchRequest_Body) { + x.Body = v +} + +func (x *SearchRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *SearchRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *SearchRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *SearchRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *SearchRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *SearchRequest) ClearBody() { + x.Body = nil +} + +func (x *SearchRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *SearchRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type SearchRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of search object request message. + Body *SearchRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 SearchRequest_builder) Build() *SearchRequest { + m0 := &SearchRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Search response +type SearchResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of search object response message. + Body *SearchResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchResponse) Reset() { + *x = SearchResponse{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *SearchResponse) SetBody(v *SearchResponse_Body) { + x.Body = v +} + +func (x *SearchResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *SearchResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *SearchResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *SearchResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *SearchResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *SearchResponse) ClearBody() { + x.Body = nil +} + +func (x *SearchResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *SearchResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type SearchResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of search object response message. + Body *SearchResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 SearchResponse_builder) Build() *SearchResponse { + m0 := &SearchResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Object payload range.Ranges of zero length SHOULD be considered as invalid. +type Range struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Offset of the range from the object payload start + Offset *uint64 `protobuf:"varint,1,opt,name=offset" json:"offset,omitempty"` + // Length in bytes of the object payload range + Length *uint64 `protobuf:"varint,2,opt,name=length" json:"length,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Range) Reset() { + *x = Range{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Range) GetOffset() uint64 { + if x != nil && x.Offset != nil { + return *x.Offset + } + return 0 +} + +func (x *Range) GetLength() uint64 { + if x != nil && x.Length != nil { + return *x.Length + } + return 0 +} + +func (x *Range) SetOffset(v uint64) { + x.Offset = &v +} + +func (x *Range) SetLength(v uint64) { + x.Length = &v +} + +func (x *Range) HasOffset() bool { + if x == nil { + return false + } + return x.Offset != nil +} + +func (x *Range) HasLength() bool { + if x == nil { + return false + } + return x.Length != nil +} + +func (x *Range) ClearOffset() { + x.Offset = nil +} + +func (x *Range) ClearLength() { + x.Length = nil +} + +type Range_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Offset of the range from the object payload start + Offset *uint64 + // Length in bytes of the object payload range + Length *uint64 +} + +func (b0 Range_builder) Build() *Range { + m0 := &Range{} + b, x := &b0, m0 + _, _ = b, x + x.Offset = b.Offset + x.Length = b.Length + return m0 +} + +// Request part of object's payload +type GetRangeRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of get range object request message. + Body *GetRangeRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRangeRequest) Reset() { + *x = GetRangeRequest{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *GetRangeRequest) SetBody(v *GetRangeRequest_Body) { + x.Body = v +} + +func (x *GetRangeRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *GetRangeRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *GetRangeRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *GetRangeRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *GetRangeRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *GetRangeRequest) ClearBody() { + x.Body = nil +} + +func (x *GetRangeRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *GetRangeRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type GetRangeRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of get range object request message. + Body *GetRangeRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 GetRangeRequest_builder) Build() *GetRangeRequest { + m0 := &GetRangeRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Get part of object's payload +type GetRangeResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of get range object response message. + Body *GetRangeResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRangeResponse) Reset() { + *x = GetRangeResponse{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *GetRangeResponse) SetBody(v *GetRangeResponse_Body) { + x.Body = v +} + +func (x *GetRangeResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *GetRangeResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *GetRangeResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *GetRangeResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *GetRangeResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *GetRangeResponse) ClearBody() { + x.Body = nil +} + +func (x *GetRangeResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *GetRangeResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type GetRangeResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of get range object response message. + Body *GetRangeResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 GetRangeResponse_builder) Build() *GetRangeResponse { + m0 := &GetRangeResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Get hash of object's payload part +type GetRangeHashRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of get range hash object request message. + Body *GetRangeHashRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRangeHashRequest) Reset() { + *x = GetRangeHashRequest{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *GetRangeHashRequest) SetBody(v *GetRangeHashRequest_Body) { + x.Body = v +} + +func (x *GetRangeHashRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *GetRangeHashRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *GetRangeHashRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *GetRangeHashRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *GetRangeHashRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *GetRangeHashRequest) ClearBody() { + x.Body = nil +} + +func (x *GetRangeHashRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *GetRangeHashRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type GetRangeHashRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of get range hash object request message. + Body *GetRangeHashRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 GetRangeHashRequest_builder) Build() *GetRangeHashRequest { + m0 := &GetRangeHashRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Get hash of object's payload part +type GetRangeHashResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of get range hash object response message. + Body *GetRangeHashResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRangeHashResponse) Reset() { + *x = GetRangeHashResponse{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *GetRangeHashResponse) SetBody(v *GetRangeHashResponse_Body) { + x.Body = v +} + +func (x *GetRangeHashResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *GetRangeHashResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *GetRangeHashResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *GetRangeHashResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *GetRangeHashResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *GetRangeHashResponse) ClearBody() { + x.Body = nil +} + +func (x *GetRangeHashResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *GetRangeHashResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type GetRangeHashResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of get range hash object response message. + Body *GetRangeHashResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 GetRangeHashResponse_builder) Build() *GetRangeHashResponse { + m0 := &GetRangeHashResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Object PUT Single request +type PutSingleRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of put single object request message. + Body *PutSingleRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutSingleRequest) Reset() { + *x = PutSingleRequest{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *PutSingleRequest) SetBody(v *PutSingleRequest_Body) { + x.Body = v +} + +func (x *PutSingleRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *PutSingleRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *PutSingleRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *PutSingleRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *PutSingleRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *PutSingleRequest) ClearBody() { + x.Body = nil +} + +func (x *PutSingleRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *PutSingleRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type PutSingleRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of put single object request message. + Body *PutSingleRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 PutSingleRequest_builder) Build() *PutSingleRequest { + m0 := &PutSingleRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Object PUT Single response +type PutSingleResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of put single object response message. + Body *PutSingleResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutSingleResponse) Reset() { + *x = PutSingleResponse{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *PutSingleResponse) SetBody(v *PutSingleResponse_Body) { + x.Body = v +} + +func (x *PutSingleResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *PutSingleResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *PutSingleResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *PutSingleResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *PutSingleResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *PutSingleResponse) ClearBody() { + x.Body = nil +} + +func (x *PutSingleResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *PutSingleResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type PutSingleResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of put single object response message. + Body *PutSingleResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 PutSingleResponse_builder) Build() *PutSingleResponse { + m0 := &PutSingleResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Object PATCH request +type PatchRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body for patch request message. + Body *PatchRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PatchRequest) Reset() { + *x = PatchRequest{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *PatchRequest) SetBody(v *PatchRequest_Body) { + x.Body = v +} + +func (x *PatchRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *PatchRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *PatchRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *PatchRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *PatchRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *PatchRequest) ClearBody() { + x.Body = nil +} + +func (x *PatchRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *PatchRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type PatchRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body for patch request message. + Body *PatchRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 PatchRequest_builder) Build() *PatchRequest { + m0 := &PatchRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Object PATCH response +type PatchResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body for patch response message. + Body *PatchResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PatchResponse) Reset() { + *x = PatchResponse{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *PatchResponse) SetBody(v *PatchResponse_Body) { + x.Body = v +} + +func (x *PatchResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *PatchResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *PatchResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *PatchResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *PatchResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *PatchResponse) ClearBody() { + x.Body = nil +} + +func (x *PatchResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *PatchResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type PatchResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body for patch response message. + Body *PatchResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 PatchResponse_builder) Build() *PatchResponse { + m0 := &PatchResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// GET Object request body +type GetRequest_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Address of the requested object + Address *grpc1.Address `protobuf:"bytes,1,opt,name=address" 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" json:"raw,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRequest_Body) Reset() { + *x = GetRequest_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetRequest_Body) GetAddress() *grpc1.Address { + if x != nil { + return x.Address + } + return nil +} + +func (x *GetRequest_Body) GetRaw() bool { + if x != nil && x.Raw != nil { + return *x.Raw + } + return false +} + +func (x *GetRequest_Body) SetAddress(v *grpc1.Address) { + x.Address = v +} + +func (x *GetRequest_Body) SetRaw(v bool) { + x.Raw = &v +} + +func (x *GetRequest_Body) HasAddress() bool { + if x == nil { + return false + } + return x.Address != nil +} + +func (x *GetRequest_Body) HasRaw() bool { + if x == nil { + return false + } + return x.Raw != nil +} + +func (x *GetRequest_Body) ClearAddress() { + x.Address = nil +} + +func (x *GetRequest_Body) ClearRaw() { + x.Raw = nil +} + +type GetRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Address of the requested object + Address *grpc1.Address + // If `raw` flag is set, request will work only with objects that are + // physically stored on the peer node + Raw *bool +} + +func (b0 GetRequest_Body_builder) Build() *GetRequest_Body { + m0 := &GetRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.Address = b.Address + x.Raw = b.Raw + return m0 +} + +// GET Object Response body +type GetResponse_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Single message in the response stream. + // + // Types that are valid to be assigned to ObjectPart: + // + // *GetResponse_Body_Init_ + // *GetResponse_Body_Chunk + // *GetResponse_Body_SplitInfo + // *GetResponse_Body_EcInfo + ObjectPart isGetResponse_Body_ObjectPart `protobuf_oneof:"object_part"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetResponse_Body) Reset() { + *x = GetResponse_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetResponse_Body) GetObjectPart() isGetResponse_Body_ObjectPart { + if x != nil { + return x.ObjectPart + } + return nil +} + +func (x *GetResponse_Body) GetInit() *GetResponse_Body_Init { + if x != nil { + if x, ok := x.ObjectPart.(*GetResponse_Body_Init_); ok { + return x.Init + } + } + return nil +} + +func (x *GetResponse_Body) GetChunk() []byte { + if x != nil { + if x, ok := x.ObjectPart.(*GetResponse_Body_Chunk); ok { + return x.Chunk + } + } + return nil +} + +func (x *GetResponse_Body) GetSplitInfo() *SplitInfo { + if x != nil { + if x, ok := x.ObjectPart.(*GetResponse_Body_SplitInfo); ok { + return x.SplitInfo + } + } + return nil +} + +func (x *GetResponse_Body) GetEcInfo() *ECInfo { + if x != nil { + if x, ok := x.ObjectPart.(*GetResponse_Body_EcInfo); ok { + return x.EcInfo + } + } + return nil +} + +func (x *GetResponse_Body) SetInit(v *GetResponse_Body_Init) { + if v == nil { + x.ObjectPart = nil + return + } + x.ObjectPart = &GetResponse_Body_Init_{v} +} + +func (x *GetResponse_Body) SetChunk(v []byte) { + if v == nil { + v = []byte{} + } + x.ObjectPart = &GetResponse_Body_Chunk{v} +} + +func (x *GetResponse_Body) SetSplitInfo(v *SplitInfo) { + if v == nil { + x.ObjectPart = nil + return + } + x.ObjectPart = &GetResponse_Body_SplitInfo{v} +} + +func (x *GetResponse_Body) SetEcInfo(v *ECInfo) { + if v == nil { + x.ObjectPart = nil + return + } + x.ObjectPart = &GetResponse_Body_EcInfo{v} +} + +func (x *GetResponse_Body) HasObjectPart() bool { + if x == nil { + return false + } + return x.ObjectPart != nil +} + +func (x *GetResponse_Body) HasInit() bool { + if x == nil { + return false + } + _, ok := x.ObjectPart.(*GetResponse_Body_Init_) + return ok +} + +func (x *GetResponse_Body) HasChunk() bool { + if x == nil { + return false + } + _, ok := x.ObjectPart.(*GetResponse_Body_Chunk) + return ok +} + +func (x *GetResponse_Body) HasSplitInfo() bool { + if x == nil { + return false + } + _, ok := x.ObjectPart.(*GetResponse_Body_SplitInfo) + return ok +} + +func (x *GetResponse_Body) HasEcInfo() bool { + if x == nil { + return false + } + _, ok := x.ObjectPart.(*GetResponse_Body_EcInfo) + return ok +} + +func (x *GetResponse_Body) ClearObjectPart() { + x.ObjectPart = nil +} + +func (x *GetResponse_Body) ClearInit() { + if _, ok := x.ObjectPart.(*GetResponse_Body_Init_); ok { + x.ObjectPart = nil + } +} + +func (x *GetResponse_Body) ClearChunk() { + if _, ok := x.ObjectPart.(*GetResponse_Body_Chunk); ok { + x.ObjectPart = nil + } +} + +func (x *GetResponse_Body) ClearSplitInfo() { + if _, ok := x.ObjectPart.(*GetResponse_Body_SplitInfo); ok { + x.ObjectPart = nil + } +} + +func (x *GetResponse_Body) ClearEcInfo() { + if _, ok := x.ObjectPart.(*GetResponse_Body_EcInfo); ok { + x.ObjectPart = nil + } +} + +const GetResponse_Body_ObjectPart_not_set_case case_GetResponse_Body_ObjectPart = 0 +const GetResponse_Body_Init_case case_GetResponse_Body_ObjectPart = 1 +const GetResponse_Body_Chunk_case case_GetResponse_Body_ObjectPart = 2 +const GetResponse_Body_SplitInfo_case case_GetResponse_Body_ObjectPart = 3 +const GetResponse_Body_EcInfo_case case_GetResponse_Body_ObjectPart = 4 + +func (x *GetResponse_Body) WhichObjectPart() case_GetResponse_Body_ObjectPart { + if x == nil { + return GetResponse_Body_ObjectPart_not_set_case + } + switch x.ObjectPart.(type) { + case *GetResponse_Body_Init_: + return GetResponse_Body_Init_case + case *GetResponse_Body_Chunk: + return GetResponse_Body_Chunk_case + case *GetResponse_Body_SplitInfo: + return GetResponse_Body_SplitInfo_case + case *GetResponse_Body_EcInfo: + return GetResponse_Body_EcInfo_case + default: + return GetResponse_Body_ObjectPart_not_set_case + } +} + +type GetResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Single message in the response stream. + + // Fields of oneof ObjectPart: + // Initial part of the object stream + Init *GetResponse_Body_Init + // Chunked object payload + Chunk []byte + // Meta information of split hierarchy for object assembly. + SplitInfo *SplitInfo + // Meta information for EC object assembly. + EcInfo *ECInfo + // -- end of ObjectPart +} + +func (b0 GetResponse_Body_builder) Build() *GetResponse_Body { + m0 := &GetResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + if b.Init != nil { + x.ObjectPart = &GetResponse_Body_Init_{b.Init} + } + if b.Chunk != nil { + x.ObjectPart = &GetResponse_Body_Chunk{b.Chunk} + } + if b.SplitInfo != nil { + x.ObjectPart = &GetResponse_Body_SplitInfo{b.SplitInfo} + } + if b.EcInfo != nil { + x.ObjectPart = &GetResponse_Body_EcInfo{b.EcInfo} + } + return m0 +} + +type case_GetResponse_Body_ObjectPart protoreflect.FieldNumber + +func (x case_GetResponse_Body_ObjectPart) String() string { + md := file_api_object_grpc_service_proto_msgTypes[21].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +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,oneof"` +} + +type GetResponse_Body_Chunk struct { + // Chunked object payload + Chunk []byte `protobuf:"bytes,2,opt,name=chunk,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,oneof"` +} + +type GetResponse_Body_EcInfo struct { + // Meta information for EC object assembly. + EcInfo *ECInfo `protobuf:"bytes,4,opt,name=ec_info,json=ecInfo,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 `protogen:"hybrid.v1"` + // Object's unique identifier. + ObjectId *grpc1.ObjectID `protobuf:"bytes,1,opt,name=object_id,json=objectId" json:"object_id,omitempty"` + // Signed `ObjectID` + Signature *grpc1.Signature `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` + // Object metadata headers + Header *Header `protobuf:"bytes,3,opt,name=header" json:"header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetResponse_Body_Init) Reset() { + *x = GetResponse_Body_Init{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *GetResponse_Body_Init) SetObjectId(v *grpc1.ObjectID) { + x.ObjectId = v +} + +func (x *GetResponse_Body_Init) SetSignature(v *grpc1.Signature) { + x.Signature = v +} + +func (x *GetResponse_Body_Init) SetHeader(v *Header) { + x.Header = v +} + +func (x *GetResponse_Body_Init) HasObjectId() bool { + if x == nil { + return false + } + return x.ObjectId != nil +} + +func (x *GetResponse_Body_Init) HasSignature() bool { + if x == nil { + return false + } + return x.Signature != nil +} + +func (x *GetResponse_Body_Init) HasHeader() bool { + if x == nil { + return false + } + return x.Header != nil +} + +func (x *GetResponse_Body_Init) ClearObjectId() { + x.ObjectId = nil +} + +func (x *GetResponse_Body_Init) ClearSignature() { + x.Signature = nil +} + +func (x *GetResponse_Body_Init) ClearHeader() { + x.Header = nil +} + +type GetResponse_Body_Init_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Object's unique identifier. + ObjectId *grpc1.ObjectID + // Signed `ObjectID` + Signature *grpc1.Signature + // Object metadata headers + Header *Header +} + +func (b0 GetResponse_Body_Init_builder) Build() *GetResponse_Body_Init { + m0 := &GetResponse_Body_Init{} + b, x := &b0, m0 + _, _ = b, x + x.ObjectId = b.ObjectId + x.Signature = b.Signature + x.Header = b.Header + return m0 +} + +// PUT request body +type PutRequest_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Single message in the request stream. + // + // Types that are valid to be assigned to ObjectPart: + // + // *PutRequest_Body_Init_ + // *PutRequest_Body_Chunk + ObjectPart isPutRequest_Body_ObjectPart `protobuf_oneof:"object_part"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutRequest_Body) Reset() { + *x = PutRequest_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PutRequest_Body) GetObjectPart() isPutRequest_Body_ObjectPart { + if x != nil { + return x.ObjectPart + } + return nil +} + +func (x *PutRequest_Body) GetInit() *PutRequest_Body_Init { + if x != nil { + if x, ok := x.ObjectPart.(*PutRequest_Body_Init_); ok { + return x.Init + } + } + return nil +} + +func (x *PutRequest_Body) GetChunk() []byte { + if x != nil { + if x, ok := x.ObjectPart.(*PutRequest_Body_Chunk); ok { + return x.Chunk + } + } + return nil +} + +func (x *PutRequest_Body) SetInit(v *PutRequest_Body_Init) { + if v == nil { + x.ObjectPart = nil + return + } + x.ObjectPart = &PutRequest_Body_Init_{v} +} + +func (x *PutRequest_Body) SetChunk(v []byte) { + if v == nil { + v = []byte{} + } + x.ObjectPart = &PutRequest_Body_Chunk{v} +} + +func (x *PutRequest_Body) HasObjectPart() bool { + if x == nil { + return false + } + return x.ObjectPart != nil +} + +func (x *PutRequest_Body) HasInit() bool { + if x == nil { + return false + } + _, ok := x.ObjectPart.(*PutRequest_Body_Init_) + return ok +} + +func (x *PutRequest_Body) HasChunk() bool { + if x == nil { + return false + } + _, ok := x.ObjectPart.(*PutRequest_Body_Chunk) + return ok +} + +func (x *PutRequest_Body) ClearObjectPart() { + x.ObjectPart = nil +} + +func (x *PutRequest_Body) ClearInit() { + if _, ok := x.ObjectPart.(*PutRequest_Body_Init_); ok { + x.ObjectPart = nil + } +} + +func (x *PutRequest_Body) ClearChunk() { + if _, ok := x.ObjectPart.(*PutRequest_Body_Chunk); ok { + x.ObjectPart = nil + } +} + +const PutRequest_Body_ObjectPart_not_set_case case_PutRequest_Body_ObjectPart = 0 +const PutRequest_Body_Init_case case_PutRequest_Body_ObjectPart = 1 +const PutRequest_Body_Chunk_case case_PutRequest_Body_ObjectPart = 2 + +func (x *PutRequest_Body) WhichObjectPart() case_PutRequest_Body_ObjectPart { + if x == nil { + return PutRequest_Body_ObjectPart_not_set_case + } + switch x.ObjectPart.(type) { + case *PutRequest_Body_Init_: + return PutRequest_Body_Init_case + case *PutRequest_Body_Chunk: + return PutRequest_Body_Chunk_case + default: + return PutRequest_Body_ObjectPart_not_set_case + } +} + +type PutRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Single message in the request stream. + + // Fields of oneof ObjectPart: + // Initial part of the object stream + Init *PutRequest_Body_Init + // Chunked object payload + Chunk []byte + // -- end of ObjectPart +} + +func (b0 PutRequest_Body_builder) Build() *PutRequest_Body { + m0 := &PutRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + if b.Init != nil { + x.ObjectPart = &PutRequest_Body_Init_{b.Init} + } + if b.Chunk != nil { + x.ObjectPart = &PutRequest_Body_Chunk{b.Chunk} + } + return m0 +} + +type case_PutRequest_Body_ObjectPart protoreflect.FieldNumber + +func (x case_PutRequest_Body_ObjectPart) String() string { + md := file_api_object_grpc_service_proto_msgTypes[23].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +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,oneof"` +} + +type PutRequest_Body_Chunk struct { + // Chunked object payload + Chunk []byte `protobuf:"bytes,2,opt,name=chunk,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 `protogen:"hybrid.v1"` + // ObjectID if available. + ObjectId *grpc1.ObjectID `protobuf:"bytes,1,opt,name=object_id,json=objectId" json:"object_id,omitempty"` + // Object signature if available + Signature *grpc1.Signature `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` + // Object's Header + Header *Header `protobuf:"bytes,3,opt,name=header" 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" json:"copies_number,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutRequest_Body_Init) Reset() { + *x = PutRequest_Body_Init{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *PutRequest_Body_Init) SetObjectId(v *grpc1.ObjectID) { + x.ObjectId = v +} + +func (x *PutRequest_Body_Init) SetSignature(v *grpc1.Signature) { + x.Signature = v +} + +func (x *PutRequest_Body_Init) SetHeader(v *Header) { + x.Header = v +} + +func (x *PutRequest_Body_Init) SetCopiesNumber(v []uint32) { + x.CopiesNumber = v +} + +func (x *PutRequest_Body_Init) HasObjectId() bool { + if x == nil { + return false + } + return x.ObjectId != nil +} + +func (x *PutRequest_Body_Init) HasSignature() bool { + if x == nil { + return false + } + return x.Signature != nil +} + +func (x *PutRequest_Body_Init) HasHeader() bool { + if x == nil { + return false + } + return x.Header != nil +} + +func (x *PutRequest_Body_Init) ClearObjectId() { + x.ObjectId = nil +} + +func (x *PutRequest_Body_Init) ClearSignature() { + x.Signature = nil +} + +func (x *PutRequest_Body_Init) ClearHeader() { + x.Header = nil +} + +type PutRequest_Body_Init_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // ObjectID if available. + ObjectId *grpc1.ObjectID + // Object signature if available + Signature *grpc1.Signature + // Object's Header + Header *Header + // 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 +} + +func (b0 PutRequest_Body_Init_builder) Build() *PutRequest_Body_Init { + m0 := &PutRequest_Body_Init{} + b, x := &b0, m0 + _, _ = b, x + x.ObjectId = b.ObjectId + x.Signature = b.Signature + x.Header = b.Header + x.CopiesNumber = b.CopiesNumber + return m0 +} + +// PUT Object response body +type PutResponse_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Identifier of the saved object + ObjectId *grpc1.ObjectID `protobuf:"bytes,1,opt,name=object_id,json=objectId" json:"object_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutResponse_Body) Reset() { + *x = PutResponse_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PutResponse_Body) GetObjectId() *grpc1.ObjectID { + if x != nil { + return x.ObjectId + } + return nil +} + +func (x *PutResponse_Body) SetObjectId(v *grpc1.ObjectID) { + x.ObjectId = v +} + +func (x *PutResponse_Body) HasObjectId() bool { + if x == nil { + return false + } + return x.ObjectId != nil +} + +func (x *PutResponse_Body) ClearObjectId() { + x.ObjectId = nil +} + +type PutResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Identifier of the saved object + ObjectId *grpc1.ObjectID +} + +func (b0 PutResponse_Body_builder) Build() *PutResponse_Body { + m0 := &PutResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.ObjectId = b.ObjectId + return m0 +} + +// Object DELETE request body +type DeleteRequest_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Address of the object to be deleted + Address *grpc1.Address `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteRequest_Body) Reset() { + *x = DeleteRequest_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *DeleteRequest_Body) GetAddress() *grpc1.Address { + if x != nil { + return x.Address + } + return nil +} + +func (x *DeleteRequest_Body) SetAddress(v *grpc1.Address) { + x.Address = v +} + +func (x *DeleteRequest_Body) HasAddress() bool { + if x == nil { + return false + } + return x.Address != nil +} + +func (x *DeleteRequest_Body) ClearAddress() { + x.Address = nil +} + +type DeleteRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Address of the object to be deleted + Address *grpc1.Address +} + +func (b0 DeleteRequest_Body_builder) Build() *DeleteRequest_Body { + m0 := &DeleteRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.Address = b.Address + return m0 +} + +// Object DELETE Response has an empty body. +type DeleteResponse_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Address of the tombstone created for the deleted object + Tombstone *grpc1.Address `protobuf:"bytes,1,opt,name=tombstone" json:"tombstone,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteResponse_Body) Reset() { + *x = DeleteResponse_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *DeleteResponse_Body) GetTombstone() *grpc1.Address { + if x != nil { + return x.Tombstone + } + return nil +} + +func (x *DeleteResponse_Body) SetTombstone(v *grpc1.Address) { + x.Tombstone = v +} + +func (x *DeleteResponse_Body) HasTombstone() bool { + if x == nil { + return false + } + return x.Tombstone != nil +} + +func (x *DeleteResponse_Body) ClearTombstone() { + x.Tombstone = nil +} + +type DeleteResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Address of the tombstone created for the deleted object + Tombstone *grpc1.Address +} + +func (b0 DeleteResponse_Body_builder) Build() *DeleteResponse_Body { + m0 := &DeleteResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.Tombstone = b.Tombstone + return m0 +} + +// Object HEAD request body +type HeadRequest_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Address of the object with the requested Header + Address *grpc1.Address `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + // Return only minimal header subset + MainOnly *bool `protobuf:"varint,2,opt,name=main_only,json=mainOnly" 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" json:"raw,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HeadRequest_Body) Reset() { + *x = HeadRequest_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *HeadRequest_Body) GetAddress() *grpc1.Address { + if x != nil { + return x.Address + } + return nil +} + +func (x *HeadRequest_Body) GetMainOnly() bool { + if x != nil && x.MainOnly != nil { + return *x.MainOnly + } + return false +} + +func (x *HeadRequest_Body) GetRaw() bool { + if x != nil && x.Raw != nil { + return *x.Raw + } + return false +} + +func (x *HeadRequest_Body) SetAddress(v *grpc1.Address) { + x.Address = v +} + +func (x *HeadRequest_Body) SetMainOnly(v bool) { + x.MainOnly = &v +} + +func (x *HeadRequest_Body) SetRaw(v bool) { + x.Raw = &v +} + +func (x *HeadRequest_Body) HasAddress() bool { + if x == nil { + return false + } + return x.Address != nil +} + +func (x *HeadRequest_Body) HasMainOnly() bool { + if x == nil { + return false + } + return x.MainOnly != nil +} + +func (x *HeadRequest_Body) HasRaw() bool { + if x == nil { + return false + } + return x.Raw != nil +} + +func (x *HeadRequest_Body) ClearAddress() { + x.Address = nil +} + +func (x *HeadRequest_Body) ClearMainOnly() { + x.MainOnly = nil +} + +func (x *HeadRequest_Body) ClearRaw() { + x.Raw = nil +} + +type HeadRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Address of the object with the requested Header + Address *grpc1.Address + // Return only minimal header subset + MainOnly *bool + // If `raw` flag is set, request will work only with objects that are + // physically stored on the peer node + Raw *bool +} + +func (b0 HeadRequest_Body_builder) Build() *HeadRequest_Body { + m0 := &HeadRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.Address = b.Address + x.MainOnly = b.MainOnly + x.Raw = b.Raw + return m0 +} + +// Object HEAD response body +type HeadResponse_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Requested object header, it's part or meta information about split + // object. + // + // Types that are valid to be assigned to Head: + // + // *HeadResponse_Body_Header + // *HeadResponse_Body_ShortHeader + // *HeadResponse_Body_SplitInfo + // *HeadResponse_Body_EcInfo + Head isHeadResponse_Body_Head `protobuf_oneof:"head"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HeadResponse_Body) Reset() { + *x = HeadResponse_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *HeadResponse_Body) GetHead() isHeadResponse_Body_Head { + if x != nil { + return x.Head + } + return nil +} + +func (x *HeadResponse_Body) GetHeader() *HeaderWithSignature { + if x != nil { + if x, ok := x.Head.(*HeadResponse_Body_Header); ok { + return x.Header + } + } + return nil +} + +func (x *HeadResponse_Body) GetShortHeader() *ShortHeader { + if x != nil { + if x, ok := x.Head.(*HeadResponse_Body_ShortHeader); ok { + return x.ShortHeader + } + } + return nil +} + +func (x *HeadResponse_Body) GetSplitInfo() *SplitInfo { + if x != nil { + if x, ok := x.Head.(*HeadResponse_Body_SplitInfo); ok { + return x.SplitInfo + } + } + return nil +} + +func (x *HeadResponse_Body) GetEcInfo() *ECInfo { + if x != nil { + if x, ok := x.Head.(*HeadResponse_Body_EcInfo); ok { + return x.EcInfo + } + } + return nil +} + +func (x *HeadResponse_Body) SetHeader(v *HeaderWithSignature) { + if v == nil { + x.Head = nil + return + } + x.Head = &HeadResponse_Body_Header{v} +} + +func (x *HeadResponse_Body) SetShortHeader(v *ShortHeader) { + if v == nil { + x.Head = nil + return + } + x.Head = &HeadResponse_Body_ShortHeader{v} +} + +func (x *HeadResponse_Body) SetSplitInfo(v *SplitInfo) { + if v == nil { + x.Head = nil + return + } + x.Head = &HeadResponse_Body_SplitInfo{v} +} + +func (x *HeadResponse_Body) SetEcInfo(v *ECInfo) { + if v == nil { + x.Head = nil + return + } + x.Head = &HeadResponse_Body_EcInfo{v} +} + +func (x *HeadResponse_Body) HasHead() bool { + if x == nil { + return false + } + return x.Head != nil +} + +func (x *HeadResponse_Body) HasHeader() bool { + if x == nil { + return false + } + _, ok := x.Head.(*HeadResponse_Body_Header) + return ok +} + +func (x *HeadResponse_Body) HasShortHeader() bool { + if x == nil { + return false + } + _, ok := x.Head.(*HeadResponse_Body_ShortHeader) + return ok +} + +func (x *HeadResponse_Body) HasSplitInfo() bool { + if x == nil { + return false + } + _, ok := x.Head.(*HeadResponse_Body_SplitInfo) + return ok +} + +func (x *HeadResponse_Body) HasEcInfo() bool { + if x == nil { + return false + } + _, ok := x.Head.(*HeadResponse_Body_EcInfo) + return ok +} + +func (x *HeadResponse_Body) ClearHead() { + x.Head = nil +} + +func (x *HeadResponse_Body) ClearHeader() { + if _, ok := x.Head.(*HeadResponse_Body_Header); ok { + x.Head = nil + } +} + +func (x *HeadResponse_Body) ClearShortHeader() { + if _, ok := x.Head.(*HeadResponse_Body_ShortHeader); ok { + x.Head = nil + } +} + +func (x *HeadResponse_Body) ClearSplitInfo() { + if _, ok := x.Head.(*HeadResponse_Body_SplitInfo); ok { + x.Head = nil + } +} + +func (x *HeadResponse_Body) ClearEcInfo() { + if _, ok := x.Head.(*HeadResponse_Body_EcInfo); ok { + x.Head = nil + } +} + +const HeadResponse_Body_Head_not_set_case case_HeadResponse_Body_Head = 0 +const HeadResponse_Body_Header_case case_HeadResponse_Body_Head = 1 +const HeadResponse_Body_ShortHeader_case case_HeadResponse_Body_Head = 2 +const HeadResponse_Body_SplitInfo_case case_HeadResponse_Body_Head = 3 +const HeadResponse_Body_EcInfo_case case_HeadResponse_Body_Head = 4 + +func (x *HeadResponse_Body) WhichHead() case_HeadResponse_Body_Head { + if x == nil { + return HeadResponse_Body_Head_not_set_case + } + switch x.Head.(type) { + case *HeadResponse_Body_Header: + return HeadResponse_Body_Header_case + case *HeadResponse_Body_ShortHeader: + return HeadResponse_Body_ShortHeader_case + case *HeadResponse_Body_SplitInfo: + return HeadResponse_Body_SplitInfo_case + case *HeadResponse_Body_EcInfo: + return HeadResponse_Body_EcInfo_case + default: + return HeadResponse_Body_Head_not_set_case + } +} + +type HeadResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Requested object header, it's part or meta information about split + // object. + + // Fields of oneof Head: + // Full object's `Header` with `ObjectID` signature + Header *HeaderWithSignature + // Short object header + ShortHeader *ShortHeader + // Meta information of split hierarchy. + SplitInfo *SplitInfo + // Meta information for EC object assembly. + EcInfo *ECInfo + // -- end of Head +} + +func (b0 HeadResponse_Body_builder) Build() *HeadResponse_Body { + m0 := &HeadResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + if b.Header != nil { + x.Head = &HeadResponse_Body_Header{b.Header} + } + if b.ShortHeader != nil { + x.Head = &HeadResponse_Body_ShortHeader{b.ShortHeader} + } + if b.SplitInfo != nil { + x.Head = &HeadResponse_Body_SplitInfo{b.SplitInfo} + } + if b.EcInfo != nil { + x.Head = &HeadResponse_Body_EcInfo{b.EcInfo} + } + return m0 +} + +type case_HeadResponse_Body_Head protoreflect.FieldNumber + +func (x case_HeadResponse_Body_Head) String() string { + md := file_api_object_grpc_service_proto_msgTypes[29].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +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,oneof"` +} + +type HeadResponse_Body_ShortHeader struct { + // Short object header + ShortHeader *ShortHeader `protobuf:"bytes,2,opt,name=short_header,json=shortHeader,oneof"` +} + +type HeadResponse_Body_SplitInfo struct { + // Meta information of split hierarchy. + SplitInfo *SplitInfo `protobuf:"bytes,3,opt,name=split_info,json=splitInfo,oneof"` +} + +type HeadResponse_Body_EcInfo struct { + // Meta information for EC object assembly. + EcInfo *ECInfo `protobuf:"bytes,4,opt,name=ec_info,json=ecInfo,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 `protogen:"hybrid.v1"` + // Container identifier were to search + ContainerId *grpc1.ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerId" json:"container_id,omitempty"` + // Version of the Query Language used + Version *uint32 `protobuf:"varint,2,opt,name=version" json:"version,omitempty"` + // List of search expressions + Filters []*SearchRequest_Body_Filter `protobuf:"bytes,3,rep,name=filters" json:"filters,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchRequest_Body) Reset() { + *x = SearchRequest_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SearchRequest_Body) GetContainerId() *grpc1.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} + +func (x *SearchRequest_Body) GetVersion() uint32 { + if x != nil && x.Version != nil { + return *x.Version + } + return 0 +} + +func (x *SearchRequest_Body) GetFilters() []*SearchRequest_Body_Filter { + if x != nil { + return x.Filters + } + return nil +} + +func (x *SearchRequest_Body) SetContainerId(v *grpc1.ContainerID) { + x.ContainerId = v +} + +func (x *SearchRequest_Body) SetVersion(v uint32) { + x.Version = &v +} + +func (x *SearchRequest_Body) SetFilters(v []*SearchRequest_Body_Filter) { + x.Filters = v +} + +func (x *SearchRequest_Body) HasContainerId() bool { + if x == nil { + return false + } + return x.ContainerId != nil +} + +func (x *SearchRequest_Body) HasVersion() bool { + if x == nil { + return false + } + return x.Version != nil +} + +func (x *SearchRequest_Body) ClearContainerId() { + x.ContainerId = nil +} + +func (x *SearchRequest_Body) ClearVersion() { + x.Version = nil +} + +type SearchRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Container identifier were to search + ContainerId *grpc1.ContainerID + // Version of the Query Language used + Version *uint32 + // List of search expressions + Filters []*SearchRequest_Body_Filter +} + +func (b0 SearchRequest_Body_builder) Build() *SearchRequest_Body { + m0 := &SearchRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.ContainerId = b.ContainerId + x.Version = b.Version + x.Filters = b.Filters + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // Match type to use + MatchType *MatchType `protobuf:"varint,1,opt,name=match_type,json=matchType,enum=neo.fs.v2.object.MatchType" json:"match_type,omitempty"` + // Attribute or Header fields to match + Key *string `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"` + // Value to match + Value *string `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchRequest_Body_Filter) Reset() { + *x = SearchRequest_Body_Filter{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SearchRequest_Body_Filter) GetMatchType() MatchType { + if x != nil && x.MatchType != nil { + return *x.MatchType + } + return MatchType_MATCH_TYPE_UNSPECIFIED +} + +func (x *SearchRequest_Body_Filter) GetKey() string { + if x != nil && x.Key != nil { + return *x.Key + } + return "" +} + +func (x *SearchRequest_Body_Filter) GetValue() string { + if x != nil && x.Value != nil { + return *x.Value + } + return "" +} + +func (x *SearchRequest_Body_Filter) SetMatchType(v MatchType) { + x.MatchType = &v +} + +func (x *SearchRequest_Body_Filter) SetKey(v string) { + x.Key = &v +} + +func (x *SearchRequest_Body_Filter) SetValue(v string) { + x.Value = &v +} + +func (x *SearchRequest_Body_Filter) HasMatchType() bool { + if x == nil { + return false + } + return x.MatchType != nil +} + +func (x *SearchRequest_Body_Filter) HasKey() bool { + if x == nil { + return false + } + return x.Key != nil +} + +func (x *SearchRequest_Body_Filter) HasValue() bool { + if x == nil { + return false + } + return x.Value != nil +} + +func (x *SearchRequest_Body_Filter) ClearMatchType() { + x.MatchType = nil +} + +func (x *SearchRequest_Body_Filter) ClearKey() { + x.Key = nil +} + +func (x *SearchRequest_Body_Filter) ClearValue() { + x.Value = nil +} + +type SearchRequest_Body_Filter_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Match type to use + MatchType *MatchType + // Attribute or Header fields to match + Key *string + // Value to match + Value *string +} + +func (b0 SearchRequest_Body_Filter_builder) Build() *SearchRequest_Body_Filter { + m0 := &SearchRequest_Body_Filter{} + b, x := &b0, m0 + _, _ = b, x + x.MatchType = b.MatchType + x.Key = b.Key + x.Value = b.Value + return m0 +} + +// Object Search response body +type SearchResponse_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // List of `ObjectID`s that match the search query + IdList []*grpc1.ObjectID `protobuf:"bytes,1,rep,name=id_list,json=idList" json:"id_list,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchResponse_Body) Reset() { + *x = SearchResponse_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[32] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SearchResponse_Body) GetIdList() []*grpc1.ObjectID { + if x != nil { + return x.IdList + } + return nil +} + +func (x *SearchResponse_Body) SetIdList(v []*grpc1.ObjectID) { + x.IdList = v +} + +type SearchResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // List of `ObjectID`s that match the search query + IdList []*grpc1.ObjectID +} + +func (b0 SearchResponse_Body_builder) Build() *SearchResponse_Body { + m0 := &SearchResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.IdList = b.IdList + return m0 +} + +// Byte range of object's payload request body +type GetRangeRequest_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Address of the object containing the requested payload range + Address *grpc1.Address `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + // Requested payload range + Range *Range `protobuf:"bytes,2,opt,name=range" 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" json:"raw,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRangeRequest_Body) Reset() { + *x = GetRangeRequest_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 && x.Raw != nil { + return *x.Raw + } + return false +} + +func (x *GetRangeRequest_Body) SetAddress(v *grpc1.Address) { + x.Address = v +} + +func (x *GetRangeRequest_Body) SetRange(v *Range) { + x.Range = v +} + +func (x *GetRangeRequest_Body) SetRaw(v bool) { + x.Raw = &v +} + +func (x *GetRangeRequest_Body) HasAddress() bool { + if x == nil { + return false + } + return x.Address != nil +} + +func (x *GetRangeRequest_Body) HasRange() bool { + if x == nil { + return false + } + return x.Range != nil +} + +func (x *GetRangeRequest_Body) HasRaw() bool { + if x == nil { + return false + } + return x.Raw != nil +} + +func (x *GetRangeRequest_Body) ClearAddress() { + x.Address = nil +} + +func (x *GetRangeRequest_Body) ClearRange() { + x.Range = nil +} + +func (x *GetRangeRequest_Body) ClearRaw() { + x.Raw = nil +} + +type GetRangeRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Address of the object containing the requested payload range + Address *grpc1.Address + // Requested payload range + Range *Range + // If `raw` flag is set, request will work only with objects that are + // physically stored on the peer node. + Raw *bool +} + +func (b0 GetRangeRequest_Body_builder) Build() *GetRangeRequest_Body { + m0 := &GetRangeRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.Address = b.Address + x.Range = b.Range + x.Raw = b.Raw + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // Requested object range or meta information about split object. + // + // Types that are valid to be assigned to RangePart: + // + // *GetRangeResponse_Body_Chunk + // *GetRangeResponse_Body_SplitInfo + // *GetRangeResponse_Body_EcInfo + RangePart isGetRangeResponse_Body_RangePart `protobuf_oneof:"range_part"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRangeResponse_Body) Reset() { + *x = GetRangeResponse_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetRangeResponse_Body) GetRangePart() isGetRangeResponse_Body_RangePart { + if x != nil { + return x.RangePart + } + return nil +} + +func (x *GetRangeResponse_Body) GetChunk() []byte { + if x != nil { + if x, ok := x.RangePart.(*GetRangeResponse_Body_Chunk); ok { + return x.Chunk + } + } + return nil +} + +func (x *GetRangeResponse_Body) GetSplitInfo() *SplitInfo { + if x != nil { + if x, ok := x.RangePart.(*GetRangeResponse_Body_SplitInfo); ok { + return x.SplitInfo + } + } + return nil +} + +func (x *GetRangeResponse_Body) GetEcInfo() *ECInfo { + if x != nil { + if x, ok := x.RangePart.(*GetRangeResponse_Body_EcInfo); ok { + return x.EcInfo + } + } + return nil +} + +func (x *GetRangeResponse_Body) SetChunk(v []byte) { + if v == nil { + v = []byte{} + } + x.RangePart = &GetRangeResponse_Body_Chunk{v} +} + +func (x *GetRangeResponse_Body) SetSplitInfo(v *SplitInfo) { + if v == nil { + x.RangePart = nil + return + } + x.RangePart = &GetRangeResponse_Body_SplitInfo{v} +} + +func (x *GetRangeResponse_Body) SetEcInfo(v *ECInfo) { + if v == nil { + x.RangePart = nil + return + } + x.RangePart = &GetRangeResponse_Body_EcInfo{v} +} + +func (x *GetRangeResponse_Body) HasRangePart() bool { + if x == nil { + return false + } + return x.RangePart != nil +} + +func (x *GetRangeResponse_Body) HasChunk() bool { + if x == nil { + return false + } + _, ok := x.RangePart.(*GetRangeResponse_Body_Chunk) + return ok +} + +func (x *GetRangeResponse_Body) HasSplitInfo() bool { + if x == nil { + return false + } + _, ok := x.RangePart.(*GetRangeResponse_Body_SplitInfo) + return ok +} + +func (x *GetRangeResponse_Body) HasEcInfo() bool { + if x == nil { + return false + } + _, ok := x.RangePart.(*GetRangeResponse_Body_EcInfo) + return ok +} + +func (x *GetRangeResponse_Body) ClearRangePart() { + x.RangePart = nil +} + +func (x *GetRangeResponse_Body) ClearChunk() { + if _, ok := x.RangePart.(*GetRangeResponse_Body_Chunk); ok { + x.RangePart = nil + } +} + +func (x *GetRangeResponse_Body) ClearSplitInfo() { + if _, ok := x.RangePart.(*GetRangeResponse_Body_SplitInfo); ok { + x.RangePart = nil + } +} + +func (x *GetRangeResponse_Body) ClearEcInfo() { + if _, ok := x.RangePart.(*GetRangeResponse_Body_EcInfo); ok { + x.RangePart = nil + } +} + +const GetRangeResponse_Body_RangePart_not_set_case case_GetRangeResponse_Body_RangePart = 0 +const GetRangeResponse_Body_Chunk_case case_GetRangeResponse_Body_RangePart = 1 +const GetRangeResponse_Body_SplitInfo_case case_GetRangeResponse_Body_RangePart = 2 +const GetRangeResponse_Body_EcInfo_case case_GetRangeResponse_Body_RangePart = 3 + +func (x *GetRangeResponse_Body) WhichRangePart() case_GetRangeResponse_Body_RangePart { + if x == nil { + return GetRangeResponse_Body_RangePart_not_set_case + } + switch x.RangePart.(type) { + case *GetRangeResponse_Body_Chunk: + return GetRangeResponse_Body_Chunk_case + case *GetRangeResponse_Body_SplitInfo: + return GetRangeResponse_Body_SplitInfo_case + case *GetRangeResponse_Body_EcInfo: + return GetRangeResponse_Body_EcInfo_case + default: + return GetRangeResponse_Body_RangePart_not_set_case + } +} + +type GetRangeResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Requested object range or meta information about split object. + + // Fields of oneof RangePart: + // Chunked object payload's range. + Chunk []byte + // Meta information of split hierarchy. + SplitInfo *SplitInfo + // Meta information for EC object assembly. + EcInfo *ECInfo + // -- end of RangePart +} + +func (b0 GetRangeResponse_Body_builder) Build() *GetRangeResponse_Body { + m0 := &GetRangeResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + if b.Chunk != nil { + x.RangePart = &GetRangeResponse_Body_Chunk{b.Chunk} + } + if b.SplitInfo != nil { + x.RangePart = &GetRangeResponse_Body_SplitInfo{b.SplitInfo} + } + if b.EcInfo != nil { + x.RangePart = &GetRangeResponse_Body_EcInfo{b.EcInfo} + } + return m0 +} + +type case_GetRangeResponse_Body_RangePart protoreflect.FieldNumber + +func (x case_GetRangeResponse_Body_RangePart) String() string { + md := file_api_object_grpc_service_proto_msgTypes[34].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +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,oneof"` +} + +type GetRangeResponse_Body_SplitInfo struct { + // Meta information of split hierarchy. + SplitInfo *SplitInfo `protobuf:"bytes,2,opt,name=split_info,json=splitInfo,oneof"` +} + +type GetRangeResponse_Body_EcInfo struct { + // Meta information for EC object assembly. + EcInfo *ECInfo `protobuf:"bytes,3,opt,name=ec_info,json=ecInfo,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 `protogen:"hybrid.v1"` + // Address of the object that containing the requested payload range + Address *grpc1.Address `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + // List of object's payload ranges to calculate homomorphic hash + Ranges []*Range `protobuf:"bytes,2,rep,name=ranges" json:"ranges,omitempty"` + // Binary salt to XOR object's payload ranges before hash calculation + Salt []byte `protobuf:"bytes,3,opt,name=salt" json:"salt,omitempty"` + // Checksum algorithm type + Type *grpc1.ChecksumType `protobuf:"varint,4,opt,name=type,enum=neo.fs.v2.refs.ChecksumType" json:"type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRangeHashRequest_Body) Reset() { + *x = GetRangeHashRequest_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 && x.Type != nil { + return *x.Type + } + return grpc1.ChecksumType(0) +} + +func (x *GetRangeHashRequest_Body) SetAddress(v *grpc1.Address) { + x.Address = v +} + +func (x *GetRangeHashRequest_Body) SetRanges(v []*Range) { + x.Ranges = v +} + +func (x *GetRangeHashRequest_Body) SetSalt(v []byte) { + if v == nil { + v = []byte{} + } + x.Salt = v +} + +func (x *GetRangeHashRequest_Body) SetType(v grpc1.ChecksumType) { + x.Type = &v +} + +func (x *GetRangeHashRequest_Body) HasAddress() bool { + if x == nil { + return false + } + return x.Address != nil +} + +func (x *GetRangeHashRequest_Body) HasSalt() bool { + if x == nil { + return false + } + return x.Salt != nil +} + +func (x *GetRangeHashRequest_Body) HasType() bool { + if x == nil { + return false + } + return x.Type != nil +} + +func (x *GetRangeHashRequest_Body) ClearAddress() { + x.Address = nil +} + +func (x *GetRangeHashRequest_Body) ClearSalt() { + x.Salt = nil +} + +func (x *GetRangeHashRequest_Body) ClearType() { + x.Type = nil +} + +type GetRangeHashRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Address of the object that containing the requested payload range + Address *grpc1.Address + // List of object's payload ranges to calculate homomorphic hash + Ranges []*Range + // Binary salt to XOR object's payload ranges before hash calculation + Salt []byte + // Checksum algorithm type + Type *grpc1.ChecksumType +} + +func (b0 GetRangeHashRequest_Body_builder) Build() *GetRangeHashRequest_Body { + m0 := &GetRangeHashRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.Address = b.Address + x.Ranges = b.Ranges + x.Salt = b.Salt + x.Type = b.Type + return m0 +} + +// Get hash of object's payload part response body. +type GetRangeHashResponse_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Checksum algorithm type + Type *grpc1.ChecksumType `protobuf:"varint,1,opt,name=type,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" json:"hash_list,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRangeHashResponse_Body) Reset() { + *x = GetRangeHashResponse_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[36] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetRangeHashResponse_Body) GetType() grpc1.ChecksumType { + if x != nil && x.Type != nil { + return *x.Type + } + return grpc1.ChecksumType(0) +} + +func (x *GetRangeHashResponse_Body) GetHashList() [][]byte { + if x != nil { + return x.HashList + } + return nil +} + +func (x *GetRangeHashResponse_Body) SetType(v grpc1.ChecksumType) { + x.Type = &v +} + +func (x *GetRangeHashResponse_Body) SetHashList(v [][]byte) { + x.HashList = v +} + +func (x *GetRangeHashResponse_Body) HasType() bool { + if x == nil { + return false + } + return x.Type != nil +} + +func (x *GetRangeHashResponse_Body) ClearType() { + x.Type = nil +} + +type GetRangeHashResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Checksum algorithm type + Type *grpc1.ChecksumType + // List of range hashes in a binary format + HashList [][]byte +} + +func (b0 GetRangeHashResponse_Body_builder) Build() *GetRangeHashResponse_Body { + m0 := &GetRangeHashResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.Type = b.Type + x.HashList = b.HashList + return m0 +} + +// PUT Single request body +type PutSingleRequest_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Prepared object with payload. + Object *Object `protobuf:"bytes,1,opt,name=object" 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" json:"copies_number,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutSingleRequest_Body) Reset() { + *x = PutSingleRequest_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[37] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *PutSingleRequest_Body) SetObject(v *Object) { + x.Object = v +} + +func (x *PutSingleRequest_Body) SetCopiesNumber(v []uint32) { + x.CopiesNumber = v +} + +func (x *PutSingleRequest_Body) HasObject() bool { + if x == nil { + return false + } + return x.Object != nil +} + +func (x *PutSingleRequest_Body) ClearObject() { + x.Object = nil +} + +type PutSingleRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Prepared object with payload. + Object *Object + // 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 +} + +func (b0 PutSingleRequest_Body_builder) Build() *PutSingleRequest_Body { + m0 := &PutSingleRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.Object = b.Object + x.CopiesNumber = b.CopiesNumber + return m0 +} + +// PUT Single Object response body +type PutSingleResponse_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutSingleResponse_Body) Reset() { + *x = PutSingleResponse_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[38] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +type PutSingleResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + +} + +func (b0 PutSingleResponse_Body_builder) Build() *PutSingleResponse_Body { + m0 := &PutSingleResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + return m0 +} + +// PATCH request body +type PatchRequest_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // The address of the object that is requested to get patched. + Address *grpc1.Address `protobuf:"bytes,1,opt,name=address" 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" 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" json:"replace_attributes,omitempty"` + // The patch that is applied for the object. + Patch *PatchRequest_Body_Patch `protobuf:"bytes,4,opt,name=patch" json:"patch,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PatchRequest_Body) Reset() { + *x = PatchRequest_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[39] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 && x.ReplaceAttributes != nil { + return *x.ReplaceAttributes + } + return false +} + +func (x *PatchRequest_Body) GetPatch() *PatchRequest_Body_Patch { + if x != nil { + return x.Patch + } + return nil +} + +func (x *PatchRequest_Body) SetAddress(v *grpc1.Address) { + x.Address = v +} + +func (x *PatchRequest_Body) SetNewAttributes(v []*Header_Attribute) { + x.NewAttributes = v +} + +func (x *PatchRequest_Body) SetReplaceAttributes(v bool) { + x.ReplaceAttributes = &v +} + +func (x *PatchRequest_Body) SetPatch(v *PatchRequest_Body_Patch) { + x.Patch = v +} + +func (x *PatchRequest_Body) HasAddress() bool { + if x == nil { + return false + } + return x.Address != nil +} + +func (x *PatchRequest_Body) HasReplaceAttributes() bool { + if x == nil { + return false + } + return x.ReplaceAttributes != nil +} + +func (x *PatchRequest_Body) HasPatch() bool { + if x == nil { + return false + } + return x.Patch != nil +} + +func (x *PatchRequest_Body) ClearAddress() { + x.Address = nil +} + +func (x *PatchRequest_Body) ClearReplaceAttributes() { + x.ReplaceAttributes = nil +} + +func (x *PatchRequest_Body) ClearPatch() { + x.Patch = nil +} + +type PatchRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The address of the object that is requested to get patched. + Address *grpc1.Address + // New attributes for the object. See `replace_attributes` flag usage to + // define how new attributes should be set. + NewAttributes []*Header_Attribute + // 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 + // The patch that is applied for the object. + Patch *PatchRequest_Body_Patch +} + +func (b0 PatchRequest_Body_builder) Build() *PatchRequest_Body { + m0 := &PatchRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.Address = b.Address + x.NewAttributes = b.NewAttributes + x.ReplaceAttributes = b.ReplaceAttributes + x.Patch = b.Patch + return m0 +} + +// The patch for the object's payload. +type PatchRequest_Body_Patch struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // 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" 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" json:"chunk,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PatchRequest_Body_Patch) Reset() { + *x = PatchRequest_Body_Patch{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[40] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *PatchRequest_Body_Patch) SetSourceRange(v *Range) { + x.SourceRange = v +} + +func (x *PatchRequest_Body_Patch) SetChunk(v []byte) { + if v == nil { + v = []byte{} + } + x.Chunk = v +} + +func (x *PatchRequest_Body_Patch) HasSourceRange() bool { + if x == nil { + return false + } + return x.SourceRange != nil +} + +func (x *PatchRequest_Body_Patch) HasChunk() bool { + if x == nil { + return false + } + return x.Chunk != nil +} + +func (x *PatchRequest_Body_Patch) ClearSourceRange() { + x.SourceRange = nil +} + +func (x *PatchRequest_Body_Patch) ClearChunk() { + x.Chunk = nil +} + +type PatchRequest_Body_Patch_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // 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 + // The chunk that is being appended to or that replaces the original + // payload on the given range. + Chunk []byte +} + +func (b0 PatchRequest_Body_Patch_builder) Build() *PatchRequest_Body_Patch { + m0 := &PatchRequest_Body_Patch{} + b, x := &b0, m0 + _, _ = b, x + x.SourceRange = b.SourceRange + x.Chunk = b.Chunk + return m0 +} + +// PATCH response body +type PatchResponse_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // The object ID of the saved patched object. + ObjectId *grpc1.ObjectID `protobuf:"bytes,1,opt,name=object_id,json=objectId" json:"object_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PatchResponse_Body) Reset() { + *x = PatchResponse_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[41] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PatchResponse_Body) GetObjectId() *grpc1.ObjectID { + if x != nil { + return x.ObjectId + } + return nil +} + +func (x *PatchResponse_Body) SetObjectId(v *grpc1.ObjectID) { + x.ObjectId = v +} + +func (x *PatchResponse_Body) HasObjectId() bool { + if x == nil { + return false + } + return x.ObjectId != nil +} + +func (x *PatchResponse_Body) ClearObjectId() { + x.ObjectId = nil +} + +type PatchResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The object ID of the saved patched object. + ObjectId *grpc1.ObjectID +} + +func (b0 PatchResponse_Body_builder) Build() *PatchResponse_Body { + m0 := &PatchResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.ObjectId = b.ObjectId + return m0 +} + +var File_api_object_grpc_service_proto protoreflect.FileDescriptor + +var file_api_object_grpc_service_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x61, 0x70, 0x69, 0x2f, 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, 0x1b, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, + 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x61, 0x70, 0x69, 0x2f, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 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, 0x62, 0x5a, 0x43, 0x67, 0x69, 0x74, + 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, + 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 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, 0x08, 0x65, + 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_object_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 42) +var file_api_object_grpc_service_proto_goTypes = []any{ + (*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_api_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_api_object_grpc_service_proto_init() } +func file_api_object_grpc_service_proto_init() { + if File_api_object_grpc_service_proto != nil { + return + } + file_api_object_grpc_types_proto_init() + file_api_object_grpc_service_proto_msgTypes[21].OneofWrappers = []any{ + (*GetResponse_Body_Init_)(nil), + (*GetResponse_Body_Chunk)(nil), + (*GetResponse_Body_SplitInfo)(nil), + (*GetResponse_Body_EcInfo)(nil), + } + file_api_object_grpc_service_proto_msgTypes[23].OneofWrappers = []any{ + (*PutRequest_Body_Init_)(nil), + (*PutRequest_Body_Chunk)(nil), + } + file_api_object_grpc_service_proto_msgTypes[29].OneofWrappers = []any{ + (*HeadResponse_Body_Header)(nil), + (*HeadResponse_Body_ShortHeader)(nil), + (*HeadResponse_Body_SplitInfo)(nil), + (*HeadResponse_Body_EcInfo)(nil), + } + file_api_object_grpc_service_proto_msgTypes[34].OneofWrappers = []any{ + (*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_api_object_grpc_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 42, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_api_object_grpc_service_proto_goTypes, + DependencyIndexes: file_api_object_grpc_service_proto_depIdxs, + MessageInfos: file_api_object_grpc_service_proto_msgTypes, + }.Build() + File_api_object_grpc_service_proto = out.File + file_api_object_grpc_service_proto_rawDesc = nil + file_api_object_grpc_service_proto_goTypes = nil + file_api_object_grpc_service_proto_depIdxs = nil +} diff --git a/api/object/grpc/service_frostfs.pb.go b/api/object/grpc/service_frostfs.pb.go deleted file mode 100644 index a195f86..0000000 --- a/api/object/grpc/service_frostfs.pb.go +++ /dev/null @@ -1,9389 +0,0 @@ -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package object - -import ( - json "encoding/json" - fmt "fmt" - grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" - grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" - pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" - proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" - encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" - easyproto "github.com/VictoriaMetrics/easyproto" - jlexer "github.com/mailru/easyjson/jlexer" - jwriter "github.com/mailru/easyjson/jwriter" - 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.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 - } - first := true - out.RawByte('{') - { - 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 = "\"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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.EmitProtobuf(mm.AppendMessage(1)) - } - if x.Signature != nil { - x.Signature.EmitProtobuf(mm.AppendMessage(2)) - } - if x.Header != nil { - 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 - } - first := true - out.RawByte('{') - { - 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 = "\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - 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.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.EmitProtobuf(mm.AppendMessage(3)) - } - } - if inner, ok := x.ObjectPart.(*GetResponse_Body_EcInfo); ok { - if inner.EcInfo != nil { - 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() []byte { - if xx, ok := x.GetObjectPart().(*GetResponse_Body_Chunk); ok { - return xx.Chunk - } - 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 - } - first := true - out.RawByte('{') - switch xx := x.ObjectPart.(type) { - case *GetResponse_Body_Init_: - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"init\":" - out.RawString(prefix) - xx.Init.MarshalEasyJSON(out) - } - case *GetResponse_Body_Chunk: - { - 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 !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"splitInfo\":" - out.RawString(prefix) - xx.SplitInfo.MarshalEasyJSON(out) - } - case *GetResponse_Body_EcInfo: - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"ecInfo\":" - out.RawString(prefix) - xx.EcInfo.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 "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 - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.EmitProtobuf(mm.AppendMessage(1)) - } - if x.Signature != nil { - x.Signature.EmitProtobuf(mm.AppendMessage(2)) - } - if x.Header != nil { - 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 - } - first := true - out.RawByte('{') - { - 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 = "\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) - } - { - 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 = "\"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(']') { - 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() - } - 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.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() []byte { - if xx, ok := x.GetObjectPart().(*PutRequest_Body_Chunk); ok { - return xx.Chunk - } - 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 - } - first := true - out.RawByte('{') - switch xx := x.ObjectPart.(type) { - case *PutRequest_Body_Init_: - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"init\":" - out.RawString(prefix) - xx.Init.MarshalEasyJSON(out) - } - case *PutRequest_Body_Chunk: - { - 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("") - } - } - } - 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 - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"objectId\":" - out.RawString(prefix) - 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"address\":" - out.RawString(prefix) - 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"tombstone\":" - out.RawString(prefix) - 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.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 - } - first := true - out.RawByte('{') - { - 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 = "\"mainOnly\":" - out.RawString(prefix) - out.Bool(x.MainOnly) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.EmitProtobuf(mm.AppendMessage(1)) - } - if x.Signature != nil { - 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 - } - first := true - out.RawByte('{') - { - 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 = "\"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.EmitProtobuf(mm.AppendMessage(1)) - } - } - if inner, ok := x.Head.(*HeadResponse_Body_ShortHeader); ok { - 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.EmitProtobuf(mm.AppendMessage(3)) - } - } - if inner, ok := x.Head.(*HeadResponse_Body_EcInfo); ok { - if inner.EcInfo != nil { - 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 - } - first := true - out.RawByte('{') - switch xx := x.Head.(type) { - case *HeadResponse_Body_Header: - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"header\":" - out.RawString(prefix) - xx.Header.MarshalEasyJSON(out) - } - case *HeadResponse_Body_ShortHeader: - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"shortHeader\":" - out.RawString(prefix) - xx.ShortHeader.MarshalEasyJSON(out) - } - case *HeadResponse_Body_SplitInfo: - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"splitInfo\":" - out.RawString(prefix) - xx.SplitInfo.MarshalEasyJSON(out) - } - case *HeadResponse_Body_EcInfo: - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"ecInfo\":" - out.RawString(prefix) - xx.EcInfo.MarshalEasyJSON(out) - } - } - 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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 - } - first := true - out.RawByte('{') - { - 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 = "\"key\":" - out.RawString(prefix) - out.String(x.Key) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"value\":" - out.RawString(prefix) - out.String(x.Value) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.NestedStructureSizeUnchecked(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.EmitProtobuf(mm.AppendMessage(1)) - } - if x.Version != 0 { - mm.AppendUint32(2, x.Version) - } - for i := range x.Filters { - 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, 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 - } - first := true - out.RawByte('{') - { - 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 = "\"version\":" - out.RawString(prefix) - out.Uint32(x.Version) - } - { - 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('}') -} - -// 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 - 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": - { - var f SearchRequest_Body_Filter - var list []SearchRequest_Body_Filter - in.Delim('[') - for !in.IsDelim(']') { - f = 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.NestedStructureSizeUnchecked(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 { - 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, 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 - } - first := true - 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('}') -} - -// 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 = 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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 - } - first := true - 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 !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('}') -} - -// 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 - 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 - 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 - } - } - 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.EmitProtobuf(mm.AppendMessage(1)) - } - if x.Range != nil { - 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 - } - first := true - out.RawByte('{') - { - 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 = "\"range\":" - out.RawString(prefix) - x.Range.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.EmitProtobuf(mm.AppendMessage(2)) - } - } - if inner, ok := x.RangePart.(*GetRangeResponse_Body_EcInfo); ok { - if inner.EcInfo != nil { - 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() []byte { - if xx, ok := x.GetRangePart().(*GetRangeResponse_Body_Chunk); ok { - return xx.Chunk - } - 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 - } - first := true - out.RawByte('{') - switch xx := x.RangePart.(type) { - case *GetRangeResponse_Body_Chunk: - { - 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 !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"splitInfo\":" - out.RawString(prefix) - xx.SplitInfo.MarshalEasyJSON(out) - } - case *GetRangeResponse_Body_EcInfo: - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"ecInfo\":" - out.RawString(prefix) - xx.EcInfo.MarshalEasyJSON(out) - } - } - 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 - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.NestedStructureSizeUnchecked(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.EmitProtobuf(mm.AppendMessage(1)) - } - for i := range x.Ranges { - 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, 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 - } - first := true - out.RawByte('{') - { - 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 = "\"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 = "\"salt\":" - out.RawString(prefix) - if x.Salt != nil { - out.Base64Bytes(x.Salt) - } else { - out.String("") - } - } - { - 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('}') -} - -// 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 = Range{} - f.UnmarshalEasyJSON(in) - list = append(list, f) - in.WantComma() - } - x.Ranges = list - in.Delim(']') - } - case "salt": - { - var f []byte - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"type\":" - out.RawString(prefix) - v := int32(x.Type) - if vv, ok := grpc.ChecksumType_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } - } - { - 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('}') -} - -// 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(']') { - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.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 - } - first := true - out.RawByte('{') - { - 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 = "\"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(']') { - 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() - } - 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.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 - } - first := true - out.RawByte('{') - { - 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 = "\"chunk\":" - out.RawString(prefix) - if x.Chunk != nil { - out.Base64Bytes(x.Chunk) - } else { - out.String("") - } - } - 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 - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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.NestedStructureSizeUnchecked(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.EmitProtobuf(mm.AppendMessage(1)) - } - for i := range x.NewAttributes { - x.NewAttributes[i].EmitProtobuf(mm.AppendMessage(2)) - } - if x.ReplaceAttributes { - mm.AppendBool(3, x.ReplaceAttributes) - } - if x.Patch != nil { - 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, 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 - } - first := true - out.RawByte('{') - { - 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 = "\"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 = "\"replaceAttributes\":" - out.RawString(prefix) - out.Bool(x.ReplaceAttributes) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - 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 = 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"objectId\":" - out.RawString(prefix) - 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.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 *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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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/api/object/grpc/service_frostfs_fuzz.go b/api/object/grpc/service_frostfs_fuzz.go deleted file mode 100644 index f58ee01..0000000 --- a/api/object/grpc/service_frostfs_fuzz.go +++ /dev/null @@ -1,387 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package object - -func DoFuzzProtoGetRequest(data []byte) int { - msg := new(GetRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONGetRequest(data []byte) int { - msg := new(GetRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoGetResponse(data []byte) int { - msg := new(GetResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONGetResponse(data []byte) int { - msg := new(GetResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoPutRequest(data []byte) int { - msg := new(PutRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONPutRequest(data []byte) int { - msg := new(PutRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoPutResponse(data []byte) int { - msg := new(PutResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONPutResponse(data []byte) int { - msg := new(PutResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoDeleteRequest(data []byte) int { - msg := new(DeleteRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONDeleteRequest(data []byte) int { - msg := new(DeleteRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoDeleteResponse(data []byte) int { - msg := new(DeleteResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONDeleteResponse(data []byte) int { - msg := new(DeleteResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoHeadRequest(data []byte) int { - msg := new(HeadRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONHeadRequest(data []byte) int { - msg := new(HeadRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoHeaderWithSignature(data []byte) int { - msg := new(HeaderWithSignature) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONHeaderWithSignature(data []byte) int { - msg := new(HeaderWithSignature) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoHeadResponse(data []byte) int { - msg := new(HeadResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONHeadResponse(data []byte) int { - msg := new(HeadResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoSearchRequest(data []byte) int { - msg := new(SearchRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONSearchRequest(data []byte) int { - msg := new(SearchRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoSearchResponse(data []byte) int { - msg := new(SearchResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONSearchResponse(data []byte) int { - msg := new(SearchResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoRange(data []byte) int { - msg := new(Range) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONRange(data []byte) int { - msg := new(Range) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoGetRangeRequest(data []byte) int { - msg := new(GetRangeRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONGetRangeRequest(data []byte) int { - msg := new(GetRangeRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoGetRangeResponse(data []byte) int { - msg := new(GetRangeResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONGetRangeResponse(data []byte) int { - msg := new(GetRangeResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoGetRangeHashRequest(data []byte) int { - msg := new(GetRangeHashRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONGetRangeHashRequest(data []byte) int { - msg := new(GetRangeHashRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoGetRangeHashResponse(data []byte) int { - msg := new(GetRangeHashResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONGetRangeHashResponse(data []byte) int { - msg := new(GetRangeHashResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoPutSingleRequest(data []byte) int { - msg := new(PutSingleRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONPutSingleRequest(data []byte) int { - msg := new(PutSingleRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoPutSingleResponse(data []byte) int { - msg := new(PutSingleResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONPutSingleResponse(data []byte) int { - msg := new(PutSingleResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoPatchRequest(data []byte) int { - msg := new(PatchRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONPatchRequest(data []byte) int { - msg := new(PatchRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoPatchResponse(data []byte) int { - msg := new(PatchResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONPatchResponse(data []byte) int { - msg := new(PatchResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} diff --git a/api/object/grpc/service_frostfs_test.go b/api/object/grpc/service_frostfs_test.go deleted file mode 100644 index cb4baeb..0000000 --- a/api/object/grpc/service_frostfs_test.go +++ /dev/null @@ -1,211 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package object - -import ( - testing "testing" -) - -func FuzzProtoGetRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoGetRequest(data) - }) -} -func FuzzJSONGetRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONGetRequest(data) - }) -} -func FuzzProtoGetResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoGetResponse(data) - }) -} -func FuzzJSONGetResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONGetResponse(data) - }) -} -func FuzzProtoPutRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoPutRequest(data) - }) -} -func FuzzJSONPutRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONPutRequest(data) - }) -} -func FuzzProtoPutResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoPutResponse(data) - }) -} -func FuzzJSONPutResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONPutResponse(data) - }) -} -func FuzzProtoDeleteRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoDeleteRequest(data) - }) -} -func FuzzJSONDeleteRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONDeleteRequest(data) - }) -} -func FuzzProtoDeleteResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoDeleteResponse(data) - }) -} -func FuzzJSONDeleteResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONDeleteResponse(data) - }) -} -func FuzzProtoHeadRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoHeadRequest(data) - }) -} -func FuzzJSONHeadRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONHeadRequest(data) - }) -} -func FuzzProtoHeaderWithSignature(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoHeaderWithSignature(data) - }) -} -func FuzzJSONHeaderWithSignature(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONHeaderWithSignature(data) - }) -} -func FuzzProtoHeadResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoHeadResponse(data) - }) -} -func FuzzJSONHeadResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONHeadResponse(data) - }) -} -func FuzzProtoSearchRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoSearchRequest(data) - }) -} -func FuzzJSONSearchRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONSearchRequest(data) - }) -} -func FuzzProtoSearchResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoSearchResponse(data) - }) -} -func FuzzJSONSearchResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONSearchResponse(data) - }) -} -func FuzzProtoRange(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoRange(data) - }) -} -func FuzzJSONRange(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONRange(data) - }) -} -func FuzzProtoGetRangeRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoGetRangeRequest(data) - }) -} -func FuzzJSONGetRangeRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONGetRangeRequest(data) - }) -} -func FuzzProtoGetRangeResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoGetRangeResponse(data) - }) -} -func FuzzJSONGetRangeResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONGetRangeResponse(data) - }) -} -func FuzzProtoGetRangeHashRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoGetRangeHashRequest(data) - }) -} -func FuzzJSONGetRangeHashRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONGetRangeHashRequest(data) - }) -} -func FuzzProtoGetRangeHashResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoGetRangeHashResponse(data) - }) -} -func FuzzJSONGetRangeHashResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONGetRangeHashResponse(data) - }) -} -func FuzzProtoPutSingleRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoPutSingleRequest(data) - }) -} -func FuzzJSONPutSingleRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONPutSingleRequest(data) - }) -} -func FuzzProtoPutSingleResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoPutSingleResponse(data) - }) -} -func FuzzJSONPutSingleResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONPutSingleResponse(data) - }) -} -func FuzzProtoPatchRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoPatchRequest(data) - }) -} -func FuzzJSONPatchRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONPatchRequest(data) - }) -} -func FuzzProtoPatchResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoPatchResponse(data) - }) -} -func FuzzJSONPatchResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONPatchResponse(data) - }) -} diff --git a/api/object/grpc/service_grpc.pb.go b/api/object/grpc/service_grpc.pb.go index 2054f89..77c02af 100644 --- a/api/object/grpc/service_grpc.pb.go +++ b/api/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 v5.27.2 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.29.2 // source: api/object/grpc/service.proto package object @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( ObjectService_Get_FullMethodName = "/neo.fs.v2.object.ObjectService/Get" @@ -33,6 +33,9 @@ const ( // ObjectServiceClient is the client API for ObjectService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// `ObjectService` provides API for manipulating objects. Object operations do +// not affect the sidechain and are only served by nodes in p2p style. type ObjectServiceClient interface { // Receive full object structure, including Headers and payload. Response uses // gRPC stream. First response message carries the object with the requested @@ -71,7 +74,7 @@ type ObjectServiceClient interface { // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. - Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (ObjectService_GetClient, error) + Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetResponse], error) // Put the object into container. Request uses gRPC stream. First message // SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object // SHOULD be set. Session token SHOULD be obtained before `PUT` operation (see @@ -110,7 +113,7 @@ type ObjectServiceClient interface { // been deleted; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. - Put(ctx context.Context, opts ...grpc.CallOption) (ObjectService_PutClient, error) + Put(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[PutRequest, PutResponse], error) // Delete the object from a container. There is no immediate removal // guarantee. Object will be marked for removal and deleted eventually. // @@ -193,7 +196,7 @@ type ObjectServiceClient interface { // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. - Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (ObjectService_SearchClient, error) + Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SearchResponse], error) // Get byte range of data payload. Range is set as an (offset, length) tuple. // Like in `Get` method, the response uses gRPC stream. Requested range can be // restored by concatenation of all received payload chunks keeping the @@ -229,7 +232,7 @@ type ObjectServiceClient interface { // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. - GetRange(ctx context.Context, in *GetRangeRequest, opts ...grpc.CallOption) (ObjectService_GetRangeClient, error) + GetRange(ctx context.Context, in *GetRangeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetRangeResponse], error) // Returns homomorphic or regular hash of object's payload range after // applying XOR operation with the provided `salt`. Ranges are set of (offset, // length) tuples. Hashes order in response corresponds to the ranges order in @@ -347,7 +350,7 @@ type ObjectServiceClient interface { // has been deleted; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. - Patch(ctx context.Context, opts ...grpc.CallOption) (ObjectService_PatchClient, error) + Patch(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[PatchRequest, PatchResponse], error) } type objectServiceClient struct { @@ -358,12 +361,13 @@ func NewObjectServiceClient(cc grpc.ClientConnInterface) ObjectServiceClient { return &objectServiceClient{cc} } -func (c *objectServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (ObjectService_GetClient, error) { - stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[0], ObjectService_Get_FullMethodName, opts...) +func (c *objectServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[0], ObjectService_Get_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &objectServiceGetClient{stream} + x := &grpc.GenericClientStream[GetRequest, GetResponse]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -373,60 +377,26 @@ func (c *objectServiceClient) Get(ctx context.Context, in *GetRequest, opts ...g return x, nil } -type ObjectService_GetClient interface { - Recv() (*GetResponse, error) - grpc.ClientStream -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ObjectService_GetClient = grpc.ServerStreamingClient[GetResponse] -type objectServiceGetClient struct { - grpc.ClientStream -} - -func (x *objectServiceGetClient) Recv() (*GetResponse, error) { - m := new(GetResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *objectServiceClient) Put(ctx context.Context, opts ...grpc.CallOption) (ObjectService_PutClient, error) { - stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[1], ObjectService_Put_FullMethodName, opts...) +func (c *objectServiceClient) Put(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[PutRequest, PutResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[1], ObjectService_Put_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &objectServicePutClient{stream} + x := &grpc.GenericClientStream[PutRequest, PutResponse]{ClientStream: stream} return x, nil } -type ObjectService_PutClient interface { - Send(*PutRequest) error - CloseAndRecv() (*PutResponse, error) - grpc.ClientStream -} - -type objectServicePutClient struct { - grpc.ClientStream -} - -func (x *objectServicePutClient) Send(m *PutRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *objectServicePutClient) CloseAndRecv() (*PutResponse, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(PutResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ObjectService_PutClient = grpc.ClientStreamingClient[PutRequest, PutResponse] func (c *objectServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(DeleteResponse) - err := c.cc.Invoke(ctx, ObjectService_Delete_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ObjectService_Delete_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -434,20 +404,22 @@ func (c *objectServiceClient) Delete(ctx context.Context, in *DeleteRequest, opt } func (c *objectServiceClient) Head(ctx context.Context, in *HeadRequest, opts ...grpc.CallOption) (*HeadResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(HeadResponse) - err := c.cc.Invoke(ctx, ObjectService_Head_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ObjectService_Head_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *objectServiceClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (ObjectService_SearchClient, error) { - stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[2], ObjectService_Search_FullMethodName, opts...) +func (c *objectServiceClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SearchResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[2], ObjectService_Search_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &objectServiceSearchClient{stream} + x := &grpc.GenericClientStream[SearchRequest, SearchResponse]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -457,29 +429,16 @@ func (c *objectServiceClient) Search(ctx context.Context, in *SearchRequest, opt return x, nil } -type ObjectService_SearchClient interface { - Recv() (*SearchResponse, error) - grpc.ClientStream -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ObjectService_SearchClient = grpc.ServerStreamingClient[SearchResponse] -type objectServiceSearchClient struct { - grpc.ClientStream -} - -func (x *objectServiceSearchClient) Recv() (*SearchResponse, error) { - m := new(SearchResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *objectServiceClient) GetRange(ctx context.Context, in *GetRangeRequest, opts ...grpc.CallOption) (ObjectService_GetRangeClient, error) { - stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[3], ObjectService_GetRange_FullMethodName, opts...) +func (c *objectServiceClient) GetRange(ctx context.Context, in *GetRangeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetRangeResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[3], ObjectService_GetRange_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &objectServiceGetRangeClient{stream} + x := &grpc.GenericClientStream[GetRangeRequest, GetRangeResponse]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -489,26 +448,13 @@ func (c *objectServiceClient) GetRange(ctx context.Context, in *GetRangeRequest, return x, nil } -type ObjectService_GetRangeClient interface { - Recv() (*GetRangeResponse, error) - grpc.ClientStream -} - -type objectServiceGetRangeClient struct { - grpc.ClientStream -} - -func (x *objectServiceGetRangeClient) Recv() (*GetRangeResponse, error) { - m := new(GetRangeResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ObjectService_GetRangeClient = grpc.ServerStreamingClient[GetRangeResponse] func (c *objectServiceClient) GetRangeHash(ctx context.Context, in *GetRangeHashRequest, opts ...grpc.CallOption) (*GetRangeHashResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetRangeHashResponse) - err := c.cc.Invoke(ctx, ObjectService_GetRangeHash_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ObjectService_GetRangeHash_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -516,51 +462,34 @@ func (c *objectServiceClient) GetRangeHash(ctx context.Context, in *GetRangeHash } func (c *objectServiceClient) PutSingle(ctx context.Context, in *PutSingleRequest, opts ...grpc.CallOption) (*PutSingleResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(PutSingleResponse) - err := c.cc.Invoke(ctx, ObjectService_PutSingle_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ObjectService_PutSingle_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *objectServiceClient) Patch(ctx context.Context, opts ...grpc.CallOption) (ObjectService_PatchClient, error) { - stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[4], ObjectService_Patch_FullMethodName, opts...) +func (c *objectServiceClient) Patch(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[PatchRequest, PatchResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[4], ObjectService_Patch_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &objectServicePatchClient{stream} + x := &grpc.GenericClientStream[PatchRequest, PatchResponse]{ClientStream: stream} return x, nil } -type ObjectService_PatchClient interface { - Send(*PatchRequest) error - CloseAndRecv() (*PatchResponse, error) - grpc.ClientStream -} - -type objectServicePatchClient struct { - grpc.ClientStream -} - -func (x *objectServicePatchClient) Send(m *PatchRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *objectServicePatchClient) CloseAndRecv() (*PatchResponse, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(PatchResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ObjectService_PatchClient = grpc.ClientStreamingClient[PatchRequest, PatchResponse] // ObjectServiceServer is the server API for ObjectService service. // All implementations should embed UnimplementedObjectServiceServer -// for forward compatibility +// for forward compatibility. +// +// `ObjectService` provides API for manipulating objects. Object operations do +// not affect the sidechain and are only served by nodes in p2p style. type ObjectServiceServer interface { // Receive full object structure, including Headers and payload. Response uses // gRPC stream. First response message carries the object with the requested @@ -599,7 +528,7 @@ type ObjectServiceServer interface { // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. - Get(*GetRequest, ObjectService_GetServer) error + Get(*GetRequest, grpc.ServerStreamingServer[GetResponse]) error // Put the object into container. Request uses gRPC stream. First message // SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object // SHOULD be set. Session token SHOULD be obtained before `PUT` operation (see @@ -638,7 +567,7 @@ type ObjectServiceServer interface { // been deleted; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. - Put(ObjectService_PutServer) error + Put(grpc.ClientStreamingServer[PutRequest, PutResponse]) error // Delete the object from a container. There is no immediate removal // guarantee. Object will be marked for removal and deleted eventually. // @@ -721,7 +650,7 @@ type ObjectServiceServer interface { // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. - Search(*SearchRequest, ObjectService_SearchServer) error + Search(*SearchRequest, grpc.ServerStreamingServer[SearchResponse]) error // Get byte range of data payload. Range is set as an (offset, length) tuple. // Like in `Get` method, the response uses gRPC stream. Requested range can be // restored by concatenation of all received payload chunks keeping the @@ -757,7 +686,7 @@ type ObjectServiceServer interface { // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. - GetRange(*GetRangeRequest, ObjectService_GetRangeServer) error + GetRange(*GetRangeRequest, grpc.ServerStreamingServer[GetRangeResponse]) error // Returns homomorphic or regular hash of object's payload range after // applying XOR operation with the provided `salt`. Ranges are set of (offset, // length) tuples. Hashes order in response corresponds to the ranges order in @@ -875,17 +804,20 @@ type ObjectServiceServer interface { // has been deleted; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. - Patch(ObjectService_PatchServer) error + Patch(grpc.ClientStreamingServer[PatchRequest, PatchResponse]) error } -// UnimplementedObjectServiceServer should be embedded to have forward compatible implementations. -type UnimplementedObjectServiceServer struct { -} +// UnimplementedObjectServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedObjectServiceServer struct{} -func (UnimplementedObjectServiceServer) Get(*GetRequest, ObjectService_GetServer) error { +func (UnimplementedObjectServiceServer) Get(*GetRequest, grpc.ServerStreamingServer[GetResponse]) error { return status.Errorf(codes.Unimplemented, "method Get not implemented") } -func (UnimplementedObjectServiceServer) Put(ObjectService_PutServer) error { +func (UnimplementedObjectServiceServer) Put(grpc.ClientStreamingServer[PutRequest, PutResponse]) error { return status.Errorf(codes.Unimplemented, "method Put not implemented") } func (UnimplementedObjectServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) { @@ -894,10 +826,10 @@ func (UnimplementedObjectServiceServer) Delete(context.Context, *DeleteRequest) func (UnimplementedObjectServiceServer) Head(context.Context, *HeadRequest) (*HeadResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Head not implemented") } -func (UnimplementedObjectServiceServer) Search(*SearchRequest, ObjectService_SearchServer) error { +func (UnimplementedObjectServiceServer) Search(*SearchRequest, grpc.ServerStreamingServer[SearchResponse]) error { return status.Errorf(codes.Unimplemented, "method Search not implemented") } -func (UnimplementedObjectServiceServer) GetRange(*GetRangeRequest, ObjectService_GetRangeServer) error { +func (UnimplementedObjectServiceServer) GetRange(*GetRangeRequest, grpc.ServerStreamingServer[GetRangeResponse]) error { return status.Errorf(codes.Unimplemented, "method GetRange not implemented") } func (UnimplementedObjectServiceServer) GetRangeHash(context.Context, *GetRangeHashRequest) (*GetRangeHashResponse, error) { @@ -906,9 +838,10 @@ func (UnimplementedObjectServiceServer) GetRangeHash(context.Context, *GetRangeH func (UnimplementedObjectServiceServer) PutSingle(context.Context, *PutSingleRequest) (*PutSingleResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PutSingle not implemented") } -func (UnimplementedObjectServiceServer) Patch(ObjectService_PatchServer) error { +func (UnimplementedObjectServiceServer) Patch(grpc.ClientStreamingServer[PatchRequest, PatchResponse]) error { return status.Errorf(codes.Unimplemented, "method Patch not implemented") } +func (UnimplementedObjectServiceServer) testEmbeddedByValue() {} // UnsafeObjectServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ObjectServiceServer will @@ -918,6 +851,13 @@ type UnsafeObjectServiceServer interface { } func RegisterObjectServiceServer(s grpc.ServiceRegistrar, srv ObjectServiceServer) { + // If the following call pancis, it indicates UnimplementedObjectServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&ObjectService_ServiceDesc, srv) } @@ -926,47 +866,18 @@ func _ObjectService_Get_Handler(srv interface{}, stream grpc.ServerStream) error if err := stream.RecvMsg(m); err != nil { return err } - return srv.(ObjectServiceServer).Get(m, &objectServiceGetServer{stream}) + return srv.(ObjectServiceServer).Get(m, &grpc.GenericServerStream[GetRequest, GetResponse]{ServerStream: stream}) } -type ObjectService_GetServer interface { - Send(*GetResponse) error - grpc.ServerStream -} - -type objectServiceGetServer struct { - grpc.ServerStream -} - -func (x *objectServiceGetServer) Send(m *GetResponse) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ObjectService_GetServer = grpc.ServerStreamingServer[GetResponse] func _ObjectService_Put_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(ObjectServiceServer).Put(&objectServicePutServer{stream}) + return srv.(ObjectServiceServer).Put(&grpc.GenericServerStream[PutRequest, PutResponse]{ServerStream: stream}) } -type ObjectService_PutServer interface { - SendAndClose(*PutResponse) error - Recv() (*PutRequest, error) - grpc.ServerStream -} - -type objectServicePutServer struct { - grpc.ServerStream -} - -func (x *objectServicePutServer) SendAndClose(m *PutResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *objectServicePutServer) Recv() (*PutRequest, error) { - m := new(PutRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ObjectService_PutServer = grpc.ClientStreamingServer[PutRequest, PutResponse] func _ObjectService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteRequest) @@ -1009,42 +920,22 @@ func _ObjectService_Search_Handler(srv interface{}, stream grpc.ServerStream) er if err := stream.RecvMsg(m); err != nil { return err } - return srv.(ObjectServiceServer).Search(m, &objectServiceSearchServer{stream}) + return srv.(ObjectServiceServer).Search(m, &grpc.GenericServerStream[SearchRequest, SearchResponse]{ServerStream: stream}) } -type ObjectService_SearchServer interface { - Send(*SearchResponse) error - grpc.ServerStream -} - -type objectServiceSearchServer struct { - grpc.ServerStream -} - -func (x *objectServiceSearchServer) Send(m *SearchResponse) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ObjectService_SearchServer = grpc.ServerStreamingServer[SearchResponse] func _ObjectService_GetRange_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(GetRangeRequest) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(ObjectServiceServer).GetRange(m, &objectServiceGetRangeServer{stream}) + return srv.(ObjectServiceServer).GetRange(m, &grpc.GenericServerStream[GetRangeRequest, GetRangeResponse]{ServerStream: stream}) } -type ObjectService_GetRangeServer interface { - Send(*GetRangeResponse) error - grpc.ServerStream -} - -type objectServiceGetRangeServer struct { - grpc.ServerStream -} - -func (x *objectServiceGetRangeServer) Send(m *GetRangeResponse) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ObjectService_GetRangeServer = grpc.ServerStreamingServer[GetRangeResponse] func _ObjectService_GetRangeHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetRangeHashRequest) @@ -1083,30 +974,11 @@ func _ObjectService_PutSingle_Handler(srv interface{}, ctx context.Context, dec } func _ObjectService_Patch_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(ObjectServiceServer).Patch(&objectServicePatchServer{stream}) + return srv.(ObjectServiceServer).Patch(&grpc.GenericServerStream[PatchRequest, PatchResponse]{ServerStream: stream}) } -type ObjectService_PatchServer interface { - SendAndClose(*PatchResponse) error - Recv() (*PatchRequest, error) - grpc.ServerStream -} - -type objectServicePatchServer struct { - grpc.ServerStream -} - -func (x *objectServicePatchServer) SendAndClose(m *PatchResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *objectServicePatchServer) Recv() (*PatchRequest, error) { - m := new(PatchRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ObjectService_PatchServer = grpc.ClientStreamingServer[PatchRequest, PatchResponse] // ObjectService_ServiceDesc is the grpc.ServiceDesc for ObjectService service. // It's only intended for direct use with grpc.RegisterService, diff --git a/api/object/grpc/service_protoopaque.pb.go b/api/object/grpc/service_protoopaque.pb.go new file mode 100644 index 0000000..3a389a1 --- /dev/null +++ b/api/object/grpc/service_protoopaque.pb.go @@ -0,0 +1,6116 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/object/grpc/service.proto + +//go:build protoopaque + +package object + +import ( + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// GET object request +type GetRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *GetRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRequest) Reset() { + *x = GetRequest{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetRequest) GetBody() *GetRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *GetRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *GetRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *GetRequest) SetBody(v *GetRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *GetRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *GetRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *GetRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *GetRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *GetRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *GetRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *GetRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *GetRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type GetRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of get object request message. + Body *GetRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 GetRequest_builder) Build() *GetRequest { + m0 := &GetRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// GET object response +type GetResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *GetResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetResponse) Reset() { + *x = GetResponse{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetResponse) GetBody() *GetResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *GetResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *GetResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *GetResponse) SetBody(v *GetResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *GetResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *GetResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *GetResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *GetResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *GetResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *GetResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *GetResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *GetResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type GetResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of get object response message. + Body *GetResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 GetResponse_builder) Build() *GetResponse { + m0 := &GetResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// PUT object request +type PutRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *PutRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutRequest) Reset() { + *x = PutRequest{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PutRequest) GetBody() *PutRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *PutRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *PutRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *PutRequest) SetBody(v *PutRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *PutRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *PutRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *PutRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *PutRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *PutRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *PutRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *PutRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *PutRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type PutRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of put object request message. + Body *PutRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 PutRequest_builder) Build() *PutRequest { + m0 := &PutRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// PUT Object response +type PutResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *PutResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutResponse) Reset() { + *x = PutResponse{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PutResponse) GetBody() *PutResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *PutResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *PutResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *PutResponse) SetBody(v *PutResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *PutResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *PutResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *PutResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *PutResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *PutResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *PutResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *PutResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *PutResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type PutResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of put object response message. + Body *PutResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 PutResponse_builder) Build() *PutResponse { + m0 := &PutResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Object DELETE request +type DeleteRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *DeleteRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteRequest) Reset() { + *x = DeleteRequest{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *DeleteRequest) GetBody() *DeleteRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *DeleteRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *DeleteRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *DeleteRequest) SetBody(v *DeleteRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *DeleteRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *DeleteRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *DeleteRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *DeleteRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *DeleteRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *DeleteRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *DeleteRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *DeleteRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type DeleteRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of delete object request message. + Body *DeleteRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 DeleteRequest_builder) Build() *DeleteRequest { + m0 := &DeleteRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// DeleteResponse body is empty because we cannot guarantee permanent object +// removal in distributed system. +type DeleteResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *DeleteResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteResponse) Reset() { + *x = DeleteResponse{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *DeleteResponse) GetBody() *DeleteResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *DeleteResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *DeleteResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *DeleteResponse) SetBody(v *DeleteResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *DeleteResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *DeleteResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *DeleteResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *DeleteResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *DeleteResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *DeleteResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *DeleteResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *DeleteResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type DeleteResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of delete object response message. + Body *DeleteResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 DeleteResponse_builder) Build() *DeleteResponse { + m0 := &DeleteResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Object HEAD request +type HeadRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *HeadRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HeadRequest) Reset() { + *x = HeadRequest{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *HeadRequest) GetBody() *HeadRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *HeadRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *HeadRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *HeadRequest) SetBody(v *HeadRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *HeadRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *HeadRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *HeadRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *HeadRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *HeadRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *HeadRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *HeadRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *HeadRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type HeadRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of head object request message. + Body *HeadRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 HeadRequest_builder) Build() *HeadRequest { + m0 := &HeadRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_Header *Header `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + xxx_hidden_Signature *grpc1.Signature `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HeaderWithSignature) Reset() { + *x = HeaderWithSignature{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *HeaderWithSignature) GetHeader() *Header { + if x != nil { + return x.xxx_hidden_Header + } + return nil +} + +func (x *HeaderWithSignature) GetSignature() *grpc1.Signature { + if x != nil { + return x.xxx_hidden_Signature + } + return nil +} + +func (x *HeaderWithSignature) SetHeader(v *Header) { + x.xxx_hidden_Header = v +} + +func (x *HeaderWithSignature) SetSignature(v *grpc1.Signature) { + x.xxx_hidden_Signature = v +} + +func (x *HeaderWithSignature) HasHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_Header != nil +} + +func (x *HeaderWithSignature) HasSignature() bool { + if x == nil { + return false + } + return x.xxx_hidden_Signature != nil +} + +func (x *HeaderWithSignature) ClearHeader() { + x.xxx_hidden_Header = nil +} + +func (x *HeaderWithSignature) ClearSignature() { + x.xxx_hidden_Signature = nil +} + +type HeaderWithSignature_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Full object header + Header *Header + // Signed `ObjectID` to verify full header's authenticity + Signature *grpc1.Signature +} + +func (b0 HeaderWithSignature_builder) Build() *HeaderWithSignature { + m0 := &HeaderWithSignature{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Header = b.Header + x.xxx_hidden_Signature = b.Signature + return m0 +} + +// Object HEAD response +type HeadResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *HeadResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HeadResponse) Reset() { + *x = HeadResponse{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *HeadResponse) GetBody() *HeadResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *HeadResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *HeadResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *HeadResponse) SetBody(v *HeadResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *HeadResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *HeadResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *HeadResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *HeadResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *HeadResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *HeadResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *HeadResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *HeadResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type HeadResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of head object response message. + Body *HeadResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 HeadResponse_builder) Build() *HeadResponse { + m0 := &HeadResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Object Search request +type SearchRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *SearchRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchRequest) Reset() { + *x = SearchRequest{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SearchRequest) GetBody() *SearchRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *SearchRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *SearchRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *SearchRequest) SetBody(v *SearchRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *SearchRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *SearchRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *SearchRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *SearchRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *SearchRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *SearchRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *SearchRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *SearchRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type SearchRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of search object request message. + Body *SearchRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 SearchRequest_builder) Build() *SearchRequest { + m0 := &SearchRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Search response +type SearchResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *SearchResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchResponse) Reset() { + *x = SearchResponse{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SearchResponse) GetBody() *SearchResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *SearchResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *SearchResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *SearchResponse) SetBody(v *SearchResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *SearchResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *SearchResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *SearchResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *SearchResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *SearchResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *SearchResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *SearchResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *SearchResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type SearchResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of search object response message. + Body *SearchResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 SearchResponse_builder) Build() *SearchResponse { + m0 := &SearchResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Object payload range.Ranges of zero length SHOULD be considered as invalid. +type Range struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Offset uint64 `protobuf:"varint,1,opt,name=offset" json:"offset,omitempty"` + xxx_hidden_Length uint64 `protobuf:"varint,2,opt,name=length" json:"length,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Range) Reset() { + *x = Range{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Range) GetOffset() uint64 { + if x != nil { + return x.xxx_hidden_Offset + } + return 0 +} + +func (x *Range) GetLength() uint64 { + if x != nil { + return x.xxx_hidden_Length + } + return 0 +} + +func (x *Range) SetOffset(v uint64) { + x.xxx_hidden_Offset = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2) +} + +func (x *Range) SetLength(v uint64) { + x.xxx_hidden_Length = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2) +} + +func (x *Range) HasOffset() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *Range) HasLength() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *Range) ClearOffset() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Offset = 0 +} + +func (x *Range) ClearLength() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Length = 0 +} + +type Range_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Offset of the range from the object payload start + Offset *uint64 + // Length in bytes of the object payload range + Length *uint64 +} + +func (b0 Range_builder) Build() *Range { + m0 := &Range{} + b, x := &b0, m0 + _, _ = b, x + if b.Offset != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2) + x.xxx_hidden_Offset = *b.Offset + } + if b.Length != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2) + x.xxx_hidden_Length = *b.Length + } + return m0 +} + +// Request part of object's payload +type GetRangeRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *GetRangeRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRangeRequest) Reset() { + *x = GetRangeRequest{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetRangeRequest) GetBody() *GetRangeRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *GetRangeRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *GetRangeRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *GetRangeRequest) SetBody(v *GetRangeRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *GetRangeRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *GetRangeRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *GetRangeRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *GetRangeRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *GetRangeRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *GetRangeRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *GetRangeRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *GetRangeRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type GetRangeRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of get range object request message. + Body *GetRangeRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 GetRangeRequest_builder) Build() *GetRangeRequest { + m0 := &GetRangeRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Get part of object's payload +type GetRangeResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *GetRangeResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRangeResponse) Reset() { + *x = GetRangeResponse{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetRangeResponse) GetBody() *GetRangeResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *GetRangeResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *GetRangeResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *GetRangeResponse) SetBody(v *GetRangeResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *GetRangeResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *GetRangeResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *GetRangeResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *GetRangeResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *GetRangeResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *GetRangeResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *GetRangeResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *GetRangeResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type GetRangeResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of get range object response message. + Body *GetRangeResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 GetRangeResponse_builder) Build() *GetRangeResponse { + m0 := &GetRangeResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Get hash of object's payload part +type GetRangeHashRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *GetRangeHashRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRangeHashRequest) Reset() { + *x = GetRangeHashRequest{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetRangeHashRequest) GetBody() *GetRangeHashRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *GetRangeHashRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *GetRangeHashRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *GetRangeHashRequest) SetBody(v *GetRangeHashRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *GetRangeHashRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *GetRangeHashRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *GetRangeHashRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *GetRangeHashRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *GetRangeHashRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *GetRangeHashRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *GetRangeHashRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *GetRangeHashRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type GetRangeHashRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of get range hash object request message. + Body *GetRangeHashRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 GetRangeHashRequest_builder) Build() *GetRangeHashRequest { + m0 := &GetRangeHashRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Get hash of object's payload part +type GetRangeHashResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *GetRangeHashResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRangeHashResponse) Reset() { + *x = GetRangeHashResponse{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetRangeHashResponse) GetBody() *GetRangeHashResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *GetRangeHashResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *GetRangeHashResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *GetRangeHashResponse) SetBody(v *GetRangeHashResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *GetRangeHashResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *GetRangeHashResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *GetRangeHashResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *GetRangeHashResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *GetRangeHashResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *GetRangeHashResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *GetRangeHashResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *GetRangeHashResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type GetRangeHashResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of get range hash object response message. + Body *GetRangeHashResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 GetRangeHashResponse_builder) Build() *GetRangeHashResponse { + m0 := &GetRangeHashResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Object PUT Single request +type PutSingleRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *PutSingleRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutSingleRequest) Reset() { + *x = PutSingleRequest{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PutSingleRequest) GetBody() *PutSingleRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *PutSingleRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *PutSingleRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *PutSingleRequest) SetBody(v *PutSingleRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *PutSingleRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *PutSingleRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *PutSingleRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *PutSingleRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *PutSingleRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *PutSingleRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *PutSingleRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *PutSingleRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type PutSingleRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of put single object request message. + Body *PutSingleRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 PutSingleRequest_builder) Build() *PutSingleRequest { + m0 := &PutSingleRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Object PUT Single response +type PutSingleResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *PutSingleResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutSingleResponse) Reset() { + *x = PutSingleResponse{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PutSingleResponse) GetBody() *PutSingleResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *PutSingleResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *PutSingleResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *PutSingleResponse) SetBody(v *PutSingleResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *PutSingleResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *PutSingleResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *PutSingleResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *PutSingleResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *PutSingleResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *PutSingleResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *PutSingleResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *PutSingleResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type PutSingleResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of put single object response message. + Body *PutSingleResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 PutSingleResponse_builder) Build() *PutSingleResponse { + m0 := &PutSingleResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Object PATCH request +type PatchRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *PatchRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PatchRequest) Reset() { + *x = PatchRequest{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PatchRequest) GetBody() *PatchRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *PatchRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *PatchRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *PatchRequest) SetBody(v *PatchRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *PatchRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *PatchRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *PatchRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *PatchRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *PatchRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *PatchRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *PatchRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *PatchRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type PatchRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body for patch request message. + Body *PatchRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader +} + +func (b0 PatchRequest_builder) Build() *PatchRequest { + m0 := &PatchRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Object PATCH response +type PatchResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *PatchResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PatchResponse) Reset() { + *x = PatchResponse{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PatchResponse) GetBody() *PatchResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *PatchResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *PatchResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *PatchResponse) SetBody(v *PatchResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *PatchResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *PatchResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *PatchResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *PatchResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *PatchResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *PatchResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *PatchResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *PatchResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type PatchResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body for patch response message. + Body *PatchResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader +} + +func (b0 PatchResponse_builder) Build() *PatchResponse { + m0 := &PatchResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// GET Object request body +type GetRequest_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Address *grpc1.Address `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + xxx_hidden_Raw bool `protobuf:"varint,2,opt,name=raw" json:"raw,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRequest_Body) Reset() { + *x = GetRequest_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetRequest_Body) GetAddress() *grpc1.Address { + if x != nil { + return x.xxx_hidden_Address + } + return nil +} + +func (x *GetRequest_Body) GetRaw() bool { + if x != nil { + return x.xxx_hidden_Raw + } + return false +} + +func (x *GetRequest_Body) SetAddress(v *grpc1.Address) { + x.xxx_hidden_Address = v +} + +func (x *GetRequest_Body) SetRaw(v bool) { + x.xxx_hidden_Raw = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2) +} + +func (x *GetRequest_Body) HasAddress() bool { + if x == nil { + return false + } + return x.xxx_hidden_Address != nil +} + +func (x *GetRequest_Body) HasRaw() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *GetRequest_Body) ClearAddress() { + x.xxx_hidden_Address = nil +} + +func (x *GetRequest_Body) ClearRaw() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Raw = false +} + +type GetRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Address of the requested object + Address *grpc1.Address + // If `raw` flag is set, request will work only with objects that are + // physically stored on the peer node + Raw *bool +} + +func (b0 GetRequest_Body_builder) Build() *GetRequest_Body { + m0 := &GetRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Address = b.Address + if b.Raw != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2) + x.xxx_hidden_Raw = *b.Raw + } + return m0 +} + +// GET Object Response body +type GetResponse_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_ObjectPart isGetResponse_Body_ObjectPart `protobuf_oneof:"object_part"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetResponse_Body) Reset() { + *x = GetResponse_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetResponse_Body) GetInit() *GetResponse_Body_Init { + if x != nil { + if x, ok := x.xxx_hidden_ObjectPart.(*getResponse_Body_Init_); ok { + return x.Init + } + } + return nil +} + +func (x *GetResponse_Body) GetChunk() []byte { + if x != nil { + if x, ok := x.xxx_hidden_ObjectPart.(*getResponse_Body_Chunk); ok { + return x.Chunk + } + } + return nil +} + +func (x *GetResponse_Body) GetSplitInfo() *SplitInfo { + if x != nil { + if x, ok := x.xxx_hidden_ObjectPart.(*getResponse_Body_SplitInfo); ok { + return x.SplitInfo + } + } + return nil +} + +func (x *GetResponse_Body) GetEcInfo() *ECInfo { + if x != nil { + if x, ok := x.xxx_hidden_ObjectPart.(*getResponse_Body_EcInfo); ok { + return x.EcInfo + } + } + return nil +} + +func (x *GetResponse_Body) SetInit(v *GetResponse_Body_Init) { + if v == nil { + x.xxx_hidden_ObjectPart = nil + return + } + x.xxx_hidden_ObjectPart = &getResponse_Body_Init_{v} +} + +func (x *GetResponse_Body) SetChunk(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_ObjectPart = &getResponse_Body_Chunk{v} +} + +func (x *GetResponse_Body) SetSplitInfo(v *SplitInfo) { + if v == nil { + x.xxx_hidden_ObjectPart = nil + return + } + x.xxx_hidden_ObjectPart = &getResponse_Body_SplitInfo{v} +} + +func (x *GetResponse_Body) SetEcInfo(v *ECInfo) { + if v == nil { + x.xxx_hidden_ObjectPart = nil + return + } + x.xxx_hidden_ObjectPart = &getResponse_Body_EcInfo{v} +} + +func (x *GetResponse_Body) HasObjectPart() bool { + if x == nil { + return false + } + return x.xxx_hidden_ObjectPart != nil +} + +func (x *GetResponse_Body) HasInit() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_ObjectPart.(*getResponse_Body_Init_) + return ok +} + +func (x *GetResponse_Body) HasChunk() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_ObjectPart.(*getResponse_Body_Chunk) + return ok +} + +func (x *GetResponse_Body) HasSplitInfo() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_ObjectPart.(*getResponse_Body_SplitInfo) + return ok +} + +func (x *GetResponse_Body) HasEcInfo() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_ObjectPart.(*getResponse_Body_EcInfo) + return ok +} + +func (x *GetResponse_Body) ClearObjectPart() { + x.xxx_hidden_ObjectPart = nil +} + +func (x *GetResponse_Body) ClearInit() { + if _, ok := x.xxx_hidden_ObjectPart.(*getResponse_Body_Init_); ok { + x.xxx_hidden_ObjectPart = nil + } +} + +func (x *GetResponse_Body) ClearChunk() { + if _, ok := x.xxx_hidden_ObjectPart.(*getResponse_Body_Chunk); ok { + x.xxx_hidden_ObjectPart = nil + } +} + +func (x *GetResponse_Body) ClearSplitInfo() { + if _, ok := x.xxx_hidden_ObjectPart.(*getResponse_Body_SplitInfo); ok { + x.xxx_hidden_ObjectPart = nil + } +} + +func (x *GetResponse_Body) ClearEcInfo() { + if _, ok := x.xxx_hidden_ObjectPart.(*getResponse_Body_EcInfo); ok { + x.xxx_hidden_ObjectPart = nil + } +} + +const GetResponse_Body_ObjectPart_not_set_case case_GetResponse_Body_ObjectPart = 0 +const GetResponse_Body_Init_case case_GetResponse_Body_ObjectPart = 1 +const GetResponse_Body_Chunk_case case_GetResponse_Body_ObjectPart = 2 +const GetResponse_Body_SplitInfo_case case_GetResponse_Body_ObjectPart = 3 +const GetResponse_Body_EcInfo_case case_GetResponse_Body_ObjectPart = 4 + +func (x *GetResponse_Body) WhichObjectPart() case_GetResponse_Body_ObjectPart { + if x == nil { + return GetResponse_Body_ObjectPart_not_set_case + } + switch x.xxx_hidden_ObjectPart.(type) { + case *getResponse_Body_Init_: + return GetResponse_Body_Init_case + case *getResponse_Body_Chunk: + return GetResponse_Body_Chunk_case + case *getResponse_Body_SplitInfo: + return GetResponse_Body_SplitInfo_case + case *getResponse_Body_EcInfo: + return GetResponse_Body_EcInfo_case + default: + return GetResponse_Body_ObjectPart_not_set_case + } +} + +type GetResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Single message in the response stream. + + // Fields of oneof xxx_hidden_ObjectPart: + // Initial part of the object stream + Init *GetResponse_Body_Init + // Chunked object payload + Chunk []byte + // Meta information of split hierarchy for object assembly. + SplitInfo *SplitInfo + // Meta information for EC object assembly. + EcInfo *ECInfo + // -- end of xxx_hidden_ObjectPart +} + +func (b0 GetResponse_Body_builder) Build() *GetResponse_Body { + m0 := &GetResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + if b.Init != nil { + x.xxx_hidden_ObjectPart = &getResponse_Body_Init_{b.Init} + } + if b.Chunk != nil { + x.xxx_hidden_ObjectPart = &getResponse_Body_Chunk{b.Chunk} + } + if b.SplitInfo != nil { + x.xxx_hidden_ObjectPart = &getResponse_Body_SplitInfo{b.SplitInfo} + } + if b.EcInfo != nil { + x.xxx_hidden_ObjectPart = &getResponse_Body_EcInfo{b.EcInfo} + } + return m0 +} + +type case_GetResponse_Body_ObjectPart protoreflect.FieldNumber + +func (x case_GetResponse_Body_ObjectPart) String() string { + md := file_api_object_grpc_service_proto_msgTypes[21].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +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,oneof"` +} + +type getResponse_Body_Chunk struct { + // Chunked object payload + Chunk []byte `protobuf:"bytes,2,opt,name=chunk,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,oneof"` +} + +type getResponse_Body_EcInfo struct { + // Meta information for EC object assembly. + EcInfo *ECInfo `protobuf:"bytes,4,opt,name=ec_info,json=ecInfo,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 `protogen:"opaque.v1"` + xxx_hidden_ObjectId *grpc1.ObjectID `protobuf:"bytes,1,opt,name=object_id,json=objectId" json:"object_id,omitempty"` + xxx_hidden_Signature *grpc1.Signature `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` + xxx_hidden_Header *Header `protobuf:"bytes,3,opt,name=header" json:"header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetResponse_Body_Init) Reset() { + *x = GetResponse_Body_Init{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetResponse_Body_Init) GetObjectId() *grpc1.ObjectID { + if x != nil { + return x.xxx_hidden_ObjectId + } + return nil +} + +func (x *GetResponse_Body_Init) GetSignature() *grpc1.Signature { + if x != nil { + return x.xxx_hidden_Signature + } + return nil +} + +func (x *GetResponse_Body_Init) GetHeader() *Header { + if x != nil { + return x.xxx_hidden_Header + } + return nil +} + +func (x *GetResponse_Body_Init) SetObjectId(v *grpc1.ObjectID) { + x.xxx_hidden_ObjectId = v +} + +func (x *GetResponse_Body_Init) SetSignature(v *grpc1.Signature) { + x.xxx_hidden_Signature = v +} + +func (x *GetResponse_Body_Init) SetHeader(v *Header) { + x.xxx_hidden_Header = v +} + +func (x *GetResponse_Body_Init) HasObjectId() bool { + if x == nil { + return false + } + return x.xxx_hidden_ObjectId != nil +} + +func (x *GetResponse_Body_Init) HasSignature() bool { + if x == nil { + return false + } + return x.xxx_hidden_Signature != nil +} + +func (x *GetResponse_Body_Init) HasHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_Header != nil +} + +func (x *GetResponse_Body_Init) ClearObjectId() { + x.xxx_hidden_ObjectId = nil +} + +func (x *GetResponse_Body_Init) ClearSignature() { + x.xxx_hidden_Signature = nil +} + +func (x *GetResponse_Body_Init) ClearHeader() { + x.xxx_hidden_Header = nil +} + +type GetResponse_Body_Init_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Object's unique identifier. + ObjectId *grpc1.ObjectID + // Signed `ObjectID` + Signature *grpc1.Signature + // Object metadata headers + Header *Header +} + +func (b0 GetResponse_Body_Init_builder) Build() *GetResponse_Body_Init { + m0 := &GetResponse_Body_Init{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_ObjectId = b.ObjectId + x.xxx_hidden_Signature = b.Signature + x.xxx_hidden_Header = b.Header + return m0 +} + +// PUT request body +type PutRequest_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_ObjectPart isPutRequest_Body_ObjectPart `protobuf_oneof:"object_part"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutRequest_Body) Reset() { + *x = PutRequest_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PutRequest_Body) GetInit() *PutRequest_Body_Init { + if x != nil { + if x, ok := x.xxx_hidden_ObjectPart.(*putRequest_Body_Init_); ok { + return x.Init + } + } + return nil +} + +func (x *PutRequest_Body) GetChunk() []byte { + if x != nil { + if x, ok := x.xxx_hidden_ObjectPart.(*putRequest_Body_Chunk); ok { + return x.Chunk + } + } + return nil +} + +func (x *PutRequest_Body) SetInit(v *PutRequest_Body_Init) { + if v == nil { + x.xxx_hidden_ObjectPart = nil + return + } + x.xxx_hidden_ObjectPart = &putRequest_Body_Init_{v} +} + +func (x *PutRequest_Body) SetChunk(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_ObjectPart = &putRequest_Body_Chunk{v} +} + +func (x *PutRequest_Body) HasObjectPart() bool { + if x == nil { + return false + } + return x.xxx_hidden_ObjectPart != nil +} + +func (x *PutRequest_Body) HasInit() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_ObjectPart.(*putRequest_Body_Init_) + return ok +} + +func (x *PutRequest_Body) HasChunk() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_ObjectPart.(*putRequest_Body_Chunk) + return ok +} + +func (x *PutRequest_Body) ClearObjectPart() { + x.xxx_hidden_ObjectPart = nil +} + +func (x *PutRequest_Body) ClearInit() { + if _, ok := x.xxx_hidden_ObjectPart.(*putRequest_Body_Init_); ok { + x.xxx_hidden_ObjectPart = nil + } +} + +func (x *PutRequest_Body) ClearChunk() { + if _, ok := x.xxx_hidden_ObjectPart.(*putRequest_Body_Chunk); ok { + x.xxx_hidden_ObjectPart = nil + } +} + +const PutRequest_Body_ObjectPart_not_set_case case_PutRequest_Body_ObjectPart = 0 +const PutRequest_Body_Init_case case_PutRequest_Body_ObjectPart = 1 +const PutRequest_Body_Chunk_case case_PutRequest_Body_ObjectPart = 2 + +func (x *PutRequest_Body) WhichObjectPart() case_PutRequest_Body_ObjectPart { + if x == nil { + return PutRequest_Body_ObjectPart_not_set_case + } + switch x.xxx_hidden_ObjectPart.(type) { + case *putRequest_Body_Init_: + return PutRequest_Body_Init_case + case *putRequest_Body_Chunk: + return PutRequest_Body_Chunk_case + default: + return PutRequest_Body_ObjectPart_not_set_case + } +} + +type PutRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Single message in the request stream. + + // Fields of oneof xxx_hidden_ObjectPart: + // Initial part of the object stream + Init *PutRequest_Body_Init + // Chunked object payload + Chunk []byte + // -- end of xxx_hidden_ObjectPart +} + +func (b0 PutRequest_Body_builder) Build() *PutRequest_Body { + m0 := &PutRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + if b.Init != nil { + x.xxx_hidden_ObjectPart = &putRequest_Body_Init_{b.Init} + } + if b.Chunk != nil { + x.xxx_hidden_ObjectPart = &putRequest_Body_Chunk{b.Chunk} + } + return m0 +} + +type case_PutRequest_Body_ObjectPart protoreflect.FieldNumber + +func (x case_PutRequest_Body_ObjectPart) String() string { + md := file_api_object_grpc_service_proto_msgTypes[23].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +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,oneof"` +} + +type putRequest_Body_Chunk struct { + // Chunked object payload + Chunk []byte `protobuf:"bytes,2,opt,name=chunk,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 `protogen:"opaque.v1"` + xxx_hidden_ObjectId *grpc1.ObjectID `protobuf:"bytes,1,opt,name=object_id,json=objectId" json:"object_id,omitempty"` + xxx_hidden_Signature *grpc1.Signature `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` + xxx_hidden_Header *Header `protobuf:"bytes,3,opt,name=header" json:"header,omitempty"` + xxx_hidden_CopiesNumber []uint32 `protobuf:"varint,4,rep,packed,name=copies_number,json=copiesNumber" json:"copies_number,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutRequest_Body_Init) Reset() { + *x = PutRequest_Body_Init{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PutRequest_Body_Init) GetObjectId() *grpc1.ObjectID { + if x != nil { + return x.xxx_hidden_ObjectId + } + return nil +} + +func (x *PutRequest_Body_Init) GetSignature() *grpc1.Signature { + if x != nil { + return x.xxx_hidden_Signature + } + return nil +} + +func (x *PutRequest_Body_Init) GetHeader() *Header { + if x != nil { + return x.xxx_hidden_Header + } + return nil +} + +func (x *PutRequest_Body_Init) GetCopiesNumber() []uint32 { + if x != nil { + return x.xxx_hidden_CopiesNumber + } + return nil +} + +func (x *PutRequest_Body_Init) SetObjectId(v *grpc1.ObjectID) { + x.xxx_hidden_ObjectId = v +} + +func (x *PutRequest_Body_Init) SetSignature(v *grpc1.Signature) { + x.xxx_hidden_Signature = v +} + +func (x *PutRequest_Body_Init) SetHeader(v *Header) { + x.xxx_hidden_Header = v +} + +func (x *PutRequest_Body_Init) SetCopiesNumber(v []uint32) { + x.xxx_hidden_CopiesNumber = v +} + +func (x *PutRequest_Body_Init) HasObjectId() bool { + if x == nil { + return false + } + return x.xxx_hidden_ObjectId != nil +} + +func (x *PutRequest_Body_Init) HasSignature() bool { + if x == nil { + return false + } + return x.xxx_hidden_Signature != nil +} + +func (x *PutRequest_Body_Init) HasHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_Header != nil +} + +func (x *PutRequest_Body_Init) ClearObjectId() { + x.xxx_hidden_ObjectId = nil +} + +func (x *PutRequest_Body_Init) ClearSignature() { + x.xxx_hidden_Signature = nil +} + +func (x *PutRequest_Body_Init) ClearHeader() { + x.xxx_hidden_Header = nil +} + +type PutRequest_Body_Init_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // ObjectID if available. + ObjectId *grpc1.ObjectID + // Object signature if available + Signature *grpc1.Signature + // Object's Header + Header *Header + // 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 +} + +func (b0 PutRequest_Body_Init_builder) Build() *PutRequest_Body_Init { + m0 := &PutRequest_Body_Init{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_ObjectId = b.ObjectId + x.xxx_hidden_Signature = b.Signature + x.xxx_hidden_Header = b.Header + x.xxx_hidden_CopiesNumber = b.CopiesNumber + return m0 +} + +// PUT Object response body +type PutResponse_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_ObjectId *grpc1.ObjectID `protobuf:"bytes,1,opt,name=object_id,json=objectId" json:"object_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutResponse_Body) Reset() { + *x = PutResponse_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PutResponse_Body) GetObjectId() *grpc1.ObjectID { + if x != nil { + return x.xxx_hidden_ObjectId + } + return nil +} + +func (x *PutResponse_Body) SetObjectId(v *grpc1.ObjectID) { + x.xxx_hidden_ObjectId = v +} + +func (x *PutResponse_Body) HasObjectId() bool { + if x == nil { + return false + } + return x.xxx_hidden_ObjectId != nil +} + +func (x *PutResponse_Body) ClearObjectId() { + x.xxx_hidden_ObjectId = nil +} + +type PutResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Identifier of the saved object + ObjectId *grpc1.ObjectID +} + +func (b0 PutResponse_Body_builder) Build() *PutResponse_Body { + m0 := &PutResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_ObjectId = b.ObjectId + return m0 +} + +// Object DELETE request body +type DeleteRequest_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Address *grpc1.Address `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteRequest_Body) Reset() { + *x = DeleteRequest_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *DeleteRequest_Body) GetAddress() *grpc1.Address { + if x != nil { + return x.xxx_hidden_Address + } + return nil +} + +func (x *DeleteRequest_Body) SetAddress(v *grpc1.Address) { + x.xxx_hidden_Address = v +} + +func (x *DeleteRequest_Body) HasAddress() bool { + if x == nil { + return false + } + return x.xxx_hidden_Address != nil +} + +func (x *DeleteRequest_Body) ClearAddress() { + x.xxx_hidden_Address = nil +} + +type DeleteRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Address of the object to be deleted + Address *grpc1.Address +} + +func (b0 DeleteRequest_Body_builder) Build() *DeleteRequest_Body { + m0 := &DeleteRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Address = b.Address + return m0 +} + +// Object DELETE Response has an empty body. +type DeleteResponse_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Tombstone *grpc1.Address `protobuf:"bytes,1,opt,name=tombstone" json:"tombstone,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteResponse_Body) Reset() { + *x = DeleteResponse_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *DeleteResponse_Body) GetTombstone() *grpc1.Address { + if x != nil { + return x.xxx_hidden_Tombstone + } + return nil +} + +func (x *DeleteResponse_Body) SetTombstone(v *grpc1.Address) { + x.xxx_hidden_Tombstone = v +} + +func (x *DeleteResponse_Body) HasTombstone() bool { + if x == nil { + return false + } + return x.xxx_hidden_Tombstone != nil +} + +func (x *DeleteResponse_Body) ClearTombstone() { + x.xxx_hidden_Tombstone = nil +} + +type DeleteResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Address of the tombstone created for the deleted object + Tombstone *grpc1.Address +} + +func (b0 DeleteResponse_Body_builder) Build() *DeleteResponse_Body { + m0 := &DeleteResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Tombstone = b.Tombstone + return m0 +} + +// Object HEAD request body +type HeadRequest_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Address *grpc1.Address `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + xxx_hidden_MainOnly bool `protobuf:"varint,2,opt,name=main_only,json=mainOnly" json:"main_only,omitempty"` + xxx_hidden_Raw bool `protobuf:"varint,3,opt,name=raw" json:"raw,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HeadRequest_Body) Reset() { + *x = HeadRequest_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *HeadRequest_Body) GetAddress() *grpc1.Address { + if x != nil { + return x.xxx_hidden_Address + } + return nil +} + +func (x *HeadRequest_Body) GetMainOnly() bool { + if x != nil { + return x.xxx_hidden_MainOnly + } + return false +} + +func (x *HeadRequest_Body) GetRaw() bool { + if x != nil { + return x.xxx_hidden_Raw + } + return false +} + +func (x *HeadRequest_Body) SetAddress(v *grpc1.Address) { + x.xxx_hidden_Address = v +} + +func (x *HeadRequest_Body) SetMainOnly(v bool) { + x.xxx_hidden_MainOnly = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 3) +} + +func (x *HeadRequest_Body) SetRaw(v bool) { + x.xxx_hidden_Raw = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 3) +} + +func (x *HeadRequest_Body) HasAddress() bool { + if x == nil { + return false + } + return x.xxx_hidden_Address != nil +} + +func (x *HeadRequest_Body) HasMainOnly() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *HeadRequest_Body) HasRaw() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *HeadRequest_Body) ClearAddress() { + x.xxx_hidden_Address = nil +} + +func (x *HeadRequest_Body) ClearMainOnly() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_MainOnly = false +} + +func (x *HeadRequest_Body) ClearRaw() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Raw = false +} + +type HeadRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Address of the object with the requested Header + Address *grpc1.Address + // Return only minimal header subset + MainOnly *bool + // If `raw` flag is set, request will work only with objects that are + // physically stored on the peer node + Raw *bool +} + +func (b0 HeadRequest_Body_builder) Build() *HeadRequest_Body { + m0 := &HeadRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Address = b.Address + if b.MainOnly != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 3) + x.xxx_hidden_MainOnly = *b.MainOnly + } + if b.Raw != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 3) + x.xxx_hidden_Raw = *b.Raw + } + return m0 +} + +// Object HEAD response body +type HeadResponse_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Head isHeadResponse_Body_Head `protobuf_oneof:"head"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HeadResponse_Body) Reset() { + *x = HeadResponse_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *HeadResponse_Body) GetHeader() *HeaderWithSignature { + if x != nil { + if x, ok := x.xxx_hidden_Head.(*headResponse_Body_Header); ok { + return x.Header + } + } + return nil +} + +func (x *HeadResponse_Body) GetShortHeader() *ShortHeader { + if x != nil { + if x, ok := x.xxx_hidden_Head.(*headResponse_Body_ShortHeader); ok { + return x.ShortHeader + } + } + return nil +} + +func (x *HeadResponse_Body) GetSplitInfo() *SplitInfo { + if x != nil { + if x, ok := x.xxx_hidden_Head.(*headResponse_Body_SplitInfo); ok { + return x.SplitInfo + } + } + return nil +} + +func (x *HeadResponse_Body) GetEcInfo() *ECInfo { + if x != nil { + if x, ok := x.xxx_hidden_Head.(*headResponse_Body_EcInfo); ok { + return x.EcInfo + } + } + return nil +} + +func (x *HeadResponse_Body) SetHeader(v *HeaderWithSignature) { + if v == nil { + x.xxx_hidden_Head = nil + return + } + x.xxx_hidden_Head = &headResponse_Body_Header{v} +} + +func (x *HeadResponse_Body) SetShortHeader(v *ShortHeader) { + if v == nil { + x.xxx_hidden_Head = nil + return + } + x.xxx_hidden_Head = &headResponse_Body_ShortHeader{v} +} + +func (x *HeadResponse_Body) SetSplitInfo(v *SplitInfo) { + if v == nil { + x.xxx_hidden_Head = nil + return + } + x.xxx_hidden_Head = &headResponse_Body_SplitInfo{v} +} + +func (x *HeadResponse_Body) SetEcInfo(v *ECInfo) { + if v == nil { + x.xxx_hidden_Head = nil + return + } + x.xxx_hidden_Head = &headResponse_Body_EcInfo{v} +} + +func (x *HeadResponse_Body) HasHead() bool { + if x == nil { + return false + } + return x.xxx_hidden_Head != nil +} + +func (x *HeadResponse_Body) HasHeader() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Head.(*headResponse_Body_Header) + return ok +} + +func (x *HeadResponse_Body) HasShortHeader() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Head.(*headResponse_Body_ShortHeader) + return ok +} + +func (x *HeadResponse_Body) HasSplitInfo() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Head.(*headResponse_Body_SplitInfo) + return ok +} + +func (x *HeadResponse_Body) HasEcInfo() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Head.(*headResponse_Body_EcInfo) + return ok +} + +func (x *HeadResponse_Body) ClearHead() { + x.xxx_hidden_Head = nil +} + +func (x *HeadResponse_Body) ClearHeader() { + if _, ok := x.xxx_hidden_Head.(*headResponse_Body_Header); ok { + x.xxx_hidden_Head = nil + } +} + +func (x *HeadResponse_Body) ClearShortHeader() { + if _, ok := x.xxx_hidden_Head.(*headResponse_Body_ShortHeader); ok { + x.xxx_hidden_Head = nil + } +} + +func (x *HeadResponse_Body) ClearSplitInfo() { + if _, ok := x.xxx_hidden_Head.(*headResponse_Body_SplitInfo); ok { + x.xxx_hidden_Head = nil + } +} + +func (x *HeadResponse_Body) ClearEcInfo() { + if _, ok := x.xxx_hidden_Head.(*headResponse_Body_EcInfo); ok { + x.xxx_hidden_Head = nil + } +} + +const HeadResponse_Body_Head_not_set_case case_HeadResponse_Body_Head = 0 +const HeadResponse_Body_Header_case case_HeadResponse_Body_Head = 1 +const HeadResponse_Body_ShortHeader_case case_HeadResponse_Body_Head = 2 +const HeadResponse_Body_SplitInfo_case case_HeadResponse_Body_Head = 3 +const HeadResponse_Body_EcInfo_case case_HeadResponse_Body_Head = 4 + +func (x *HeadResponse_Body) WhichHead() case_HeadResponse_Body_Head { + if x == nil { + return HeadResponse_Body_Head_not_set_case + } + switch x.xxx_hidden_Head.(type) { + case *headResponse_Body_Header: + return HeadResponse_Body_Header_case + case *headResponse_Body_ShortHeader: + return HeadResponse_Body_ShortHeader_case + case *headResponse_Body_SplitInfo: + return HeadResponse_Body_SplitInfo_case + case *headResponse_Body_EcInfo: + return HeadResponse_Body_EcInfo_case + default: + return HeadResponse_Body_Head_not_set_case + } +} + +type HeadResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Requested object header, it's part or meta information about split + // object. + + // Fields of oneof xxx_hidden_Head: + // Full object's `Header` with `ObjectID` signature + Header *HeaderWithSignature + // Short object header + ShortHeader *ShortHeader + // Meta information of split hierarchy. + SplitInfo *SplitInfo + // Meta information for EC object assembly. + EcInfo *ECInfo + // -- end of xxx_hidden_Head +} + +func (b0 HeadResponse_Body_builder) Build() *HeadResponse_Body { + m0 := &HeadResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + if b.Header != nil { + x.xxx_hidden_Head = &headResponse_Body_Header{b.Header} + } + if b.ShortHeader != nil { + x.xxx_hidden_Head = &headResponse_Body_ShortHeader{b.ShortHeader} + } + if b.SplitInfo != nil { + x.xxx_hidden_Head = &headResponse_Body_SplitInfo{b.SplitInfo} + } + if b.EcInfo != nil { + x.xxx_hidden_Head = &headResponse_Body_EcInfo{b.EcInfo} + } + return m0 +} + +type case_HeadResponse_Body_Head protoreflect.FieldNumber + +func (x case_HeadResponse_Body_Head) String() string { + md := file_api_object_grpc_service_proto_msgTypes[29].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +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,oneof"` +} + +type headResponse_Body_ShortHeader struct { + // Short object header + ShortHeader *ShortHeader `protobuf:"bytes,2,opt,name=short_header,json=shortHeader,oneof"` +} + +type headResponse_Body_SplitInfo struct { + // Meta information of split hierarchy. + SplitInfo *SplitInfo `protobuf:"bytes,3,opt,name=split_info,json=splitInfo,oneof"` +} + +type headResponse_Body_EcInfo struct { + // Meta information for EC object assembly. + EcInfo *ECInfo `protobuf:"bytes,4,opt,name=ec_info,json=ecInfo,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 `protogen:"opaque.v1"` + xxx_hidden_ContainerId *grpc1.ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerId" json:"container_id,omitempty"` + xxx_hidden_Version uint32 `protobuf:"varint,2,opt,name=version" json:"version,omitempty"` + xxx_hidden_Filters *[]*SearchRequest_Body_Filter `protobuf:"bytes,3,rep,name=filters" json:"filters,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchRequest_Body) Reset() { + *x = SearchRequest_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SearchRequest_Body) GetContainerId() *grpc1.ContainerID { + if x != nil { + return x.xxx_hidden_ContainerId + } + return nil +} + +func (x *SearchRequest_Body) GetVersion() uint32 { + if x != nil { + return x.xxx_hidden_Version + } + return 0 +} + +func (x *SearchRequest_Body) GetFilters() []*SearchRequest_Body_Filter { + if x != nil { + if x.xxx_hidden_Filters != nil { + return *x.xxx_hidden_Filters + } + } + return nil +} + +func (x *SearchRequest_Body) SetContainerId(v *grpc1.ContainerID) { + x.xxx_hidden_ContainerId = v +} + +func (x *SearchRequest_Body) SetVersion(v uint32) { + x.xxx_hidden_Version = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 3) +} + +func (x *SearchRequest_Body) SetFilters(v []*SearchRequest_Body_Filter) { + x.xxx_hidden_Filters = &v +} + +func (x *SearchRequest_Body) HasContainerId() bool { + if x == nil { + return false + } + return x.xxx_hidden_ContainerId != nil +} + +func (x *SearchRequest_Body) HasVersion() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *SearchRequest_Body) ClearContainerId() { + x.xxx_hidden_ContainerId = nil +} + +func (x *SearchRequest_Body) ClearVersion() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Version = 0 +} + +type SearchRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Container identifier were to search + ContainerId *grpc1.ContainerID + // Version of the Query Language used + Version *uint32 + // List of search expressions + Filters []*SearchRequest_Body_Filter +} + +func (b0 SearchRequest_Body_builder) Build() *SearchRequest_Body { + m0 := &SearchRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_ContainerId = b.ContainerId + if b.Version != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 3) + x.xxx_hidden_Version = *b.Version + } + x.xxx_hidden_Filters = &b.Filters + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_MatchType MatchType `protobuf:"varint,1,opt,name=match_type,json=matchType,enum=neo.fs.v2.object.MatchType" json:"match_type,omitempty"` + xxx_hidden_Key *string `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"` + xxx_hidden_Value *string `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchRequest_Body_Filter) Reset() { + *x = SearchRequest_Body_Filter{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SearchRequest_Body_Filter) GetMatchType() MatchType { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 0) { + return x.xxx_hidden_MatchType + } + } + return MatchType_MATCH_TYPE_UNSPECIFIED +} + +func (x *SearchRequest_Body_Filter) GetKey() string { + if x != nil { + if x.xxx_hidden_Key != nil { + return *x.xxx_hidden_Key + } + return "" + } + return "" +} + +func (x *SearchRequest_Body_Filter) GetValue() string { + if x != nil { + if x.xxx_hidden_Value != nil { + return *x.xxx_hidden_Value + } + return "" + } + return "" +} + +func (x *SearchRequest_Body_Filter) SetMatchType(v MatchType) { + x.xxx_hidden_MatchType = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 3) +} + +func (x *SearchRequest_Body_Filter) SetKey(v string) { + x.xxx_hidden_Key = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 3) +} + +func (x *SearchRequest_Body_Filter) SetValue(v string) { + x.xxx_hidden_Value = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 3) +} + +func (x *SearchRequest_Body_Filter) HasMatchType() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *SearchRequest_Body_Filter) HasKey() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *SearchRequest_Body_Filter) HasValue() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *SearchRequest_Body_Filter) ClearMatchType() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_MatchType = MatchType_MATCH_TYPE_UNSPECIFIED +} + +func (x *SearchRequest_Body_Filter) ClearKey() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Key = nil +} + +func (x *SearchRequest_Body_Filter) ClearValue() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Value = nil +} + +type SearchRequest_Body_Filter_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Match type to use + MatchType *MatchType + // Attribute or Header fields to match + Key *string + // Value to match + Value *string +} + +func (b0 SearchRequest_Body_Filter_builder) Build() *SearchRequest_Body_Filter { + m0 := &SearchRequest_Body_Filter{} + b, x := &b0, m0 + _, _ = b, x + if b.MatchType != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 3) + x.xxx_hidden_MatchType = *b.MatchType + } + if b.Key != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 3) + x.xxx_hidden_Key = b.Key + } + if b.Value != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 3) + x.xxx_hidden_Value = b.Value + } + return m0 +} + +// Object Search response body +type SearchResponse_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_IdList *[]*grpc1.ObjectID `protobuf:"bytes,1,rep,name=id_list,json=idList" json:"id_list,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchResponse_Body) Reset() { + *x = SearchResponse_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[32] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SearchResponse_Body) GetIdList() []*grpc1.ObjectID { + if x != nil { + if x.xxx_hidden_IdList != nil { + return *x.xxx_hidden_IdList + } + } + return nil +} + +func (x *SearchResponse_Body) SetIdList(v []*grpc1.ObjectID) { + x.xxx_hidden_IdList = &v +} + +type SearchResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // List of `ObjectID`s that match the search query + IdList []*grpc1.ObjectID +} + +func (b0 SearchResponse_Body_builder) Build() *SearchResponse_Body { + m0 := &SearchResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_IdList = &b.IdList + return m0 +} + +// Byte range of object's payload request body +type GetRangeRequest_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Address *grpc1.Address `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + xxx_hidden_Range *Range `protobuf:"bytes,2,opt,name=range" json:"range,omitempty"` + xxx_hidden_Raw bool `protobuf:"varint,3,opt,name=raw" json:"raw,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRangeRequest_Body) Reset() { + *x = GetRangeRequest_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetRangeRequest_Body) GetAddress() *grpc1.Address { + if x != nil { + return x.xxx_hidden_Address + } + return nil +} + +func (x *GetRangeRequest_Body) GetRange() *Range { + if x != nil { + return x.xxx_hidden_Range + } + return nil +} + +func (x *GetRangeRequest_Body) GetRaw() bool { + if x != nil { + return x.xxx_hidden_Raw + } + return false +} + +func (x *GetRangeRequest_Body) SetAddress(v *grpc1.Address) { + x.xxx_hidden_Address = v +} + +func (x *GetRangeRequest_Body) SetRange(v *Range) { + x.xxx_hidden_Range = v +} + +func (x *GetRangeRequest_Body) SetRaw(v bool) { + x.xxx_hidden_Raw = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 3) +} + +func (x *GetRangeRequest_Body) HasAddress() bool { + if x == nil { + return false + } + return x.xxx_hidden_Address != nil +} + +func (x *GetRangeRequest_Body) HasRange() bool { + if x == nil { + return false + } + return x.xxx_hidden_Range != nil +} + +func (x *GetRangeRequest_Body) HasRaw() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *GetRangeRequest_Body) ClearAddress() { + x.xxx_hidden_Address = nil +} + +func (x *GetRangeRequest_Body) ClearRange() { + x.xxx_hidden_Range = nil +} + +func (x *GetRangeRequest_Body) ClearRaw() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Raw = false +} + +type GetRangeRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Address of the object containing the requested payload range + Address *grpc1.Address + // Requested payload range + Range *Range + // If `raw` flag is set, request will work only with objects that are + // physically stored on the peer node. + Raw *bool +} + +func (b0 GetRangeRequest_Body_builder) Build() *GetRangeRequest_Body { + m0 := &GetRangeRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Address = b.Address + x.xxx_hidden_Range = b.Range + if b.Raw != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 3) + x.xxx_hidden_Raw = *b.Raw + } + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_RangePart isGetRangeResponse_Body_RangePart `protobuf_oneof:"range_part"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRangeResponse_Body) Reset() { + *x = GetRangeResponse_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetRangeResponse_Body) GetChunk() []byte { + if x != nil { + if x, ok := x.xxx_hidden_RangePart.(*getRangeResponse_Body_Chunk); ok { + return x.Chunk + } + } + return nil +} + +func (x *GetRangeResponse_Body) GetSplitInfo() *SplitInfo { + if x != nil { + if x, ok := x.xxx_hidden_RangePart.(*getRangeResponse_Body_SplitInfo); ok { + return x.SplitInfo + } + } + return nil +} + +func (x *GetRangeResponse_Body) GetEcInfo() *ECInfo { + if x != nil { + if x, ok := x.xxx_hidden_RangePart.(*getRangeResponse_Body_EcInfo); ok { + return x.EcInfo + } + } + return nil +} + +func (x *GetRangeResponse_Body) SetChunk(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_RangePart = &getRangeResponse_Body_Chunk{v} +} + +func (x *GetRangeResponse_Body) SetSplitInfo(v *SplitInfo) { + if v == nil { + x.xxx_hidden_RangePart = nil + return + } + x.xxx_hidden_RangePart = &getRangeResponse_Body_SplitInfo{v} +} + +func (x *GetRangeResponse_Body) SetEcInfo(v *ECInfo) { + if v == nil { + x.xxx_hidden_RangePart = nil + return + } + x.xxx_hidden_RangePart = &getRangeResponse_Body_EcInfo{v} +} + +func (x *GetRangeResponse_Body) HasRangePart() bool { + if x == nil { + return false + } + return x.xxx_hidden_RangePart != nil +} + +func (x *GetRangeResponse_Body) HasChunk() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_RangePart.(*getRangeResponse_Body_Chunk) + return ok +} + +func (x *GetRangeResponse_Body) HasSplitInfo() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_RangePart.(*getRangeResponse_Body_SplitInfo) + return ok +} + +func (x *GetRangeResponse_Body) HasEcInfo() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_RangePart.(*getRangeResponse_Body_EcInfo) + return ok +} + +func (x *GetRangeResponse_Body) ClearRangePart() { + x.xxx_hidden_RangePart = nil +} + +func (x *GetRangeResponse_Body) ClearChunk() { + if _, ok := x.xxx_hidden_RangePart.(*getRangeResponse_Body_Chunk); ok { + x.xxx_hidden_RangePart = nil + } +} + +func (x *GetRangeResponse_Body) ClearSplitInfo() { + if _, ok := x.xxx_hidden_RangePart.(*getRangeResponse_Body_SplitInfo); ok { + x.xxx_hidden_RangePart = nil + } +} + +func (x *GetRangeResponse_Body) ClearEcInfo() { + if _, ok := x.xxx_hidden_RangePart.(*getRangeResponse_Body_EcInfo); ok { + x.xxx_hidden_RangePart = nil + } +} + +const GetRangeResponse_Body_RangePart_not_set_case case_GetRangeResponse_Body_RangePart = 0 +const GetRangeResponse_Body_Chunk_case case_GetRangeResponse_Body_RangePart = 1 +const GetRangeResponse_Body_SplitInfo_case case_GetRangeResponse_Body_RangePart = 2 +const GetRangeResponse_Body_EcInfo_case case_GetRangeResponse_Body_RangePart = 3 + +func (x *GetRangeResponse_Body) WhichRangePart() case_GetRangeResponse_Body_RangePart { + if x == nil { + return GetRangeResponse_Body_RangePart_not_set_case + } + switch x.xxx_hidden_RangePart.(type) { + case *getRangeResponse_Body_Chunk: + return GetRangeResponse_Body_Chunk_case + case *getRangeResponse_Body_SplitInfo: + return GetRangeResponse_Body_SplitInfo_case + case *getRangeResponse_Body_EcInfo: + return GetRangeResponse_Body_EcInfo_case + default: + return GetRangeResponse_Body_RangePart_not_set_case + } +} + +type GetRangeResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Requested object range or meta information about split object. + + // Fields of oneof xxx_hidden_RangePart: + // Chunked object payload's range. + Chunk []byte + // Meta information of split hierarchy. + SplitInfo *SplitInfo + // Meta information for EC object assembly. + EcInfo *ECInfo + // -- end of xxx_hidden_RangePart +} + +func (b0 GetRangeResponse_Body_builder) Build() *GetRangeResponse_Body { + m0 := &GetRangeResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + if b.Chunk != nil { + x.xxx_hidden_RangePart = &getRangeResponse_Body_Chunk{b.Chunk} + } + if b.SplitInfo != nil { + x.xxx_hidden_RangePart = &getRangeResponse_Body_SplitInfo{b.SplitInfo} + } + if b.EcInfo != nil { + x.xxx_hidden_RangePart = &getRangeResponse_Body_EcInfo{b.EcInfo} + } + return m0 +} + +type case_GetRangeResponse_Body_RangePart protoreflect.FieldNumber + +func (x case_GetRangeResponse_Body_RangePart) String() string { + md := file_api_object_grpc_service_proto_msgTypes[34].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +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,oneof"` +} + +type getRangeResponse_Body_SplitInfo struct { + // Meta information of split hierarchy. + SplitInfo *SplitInfo `protobuf:"bytes,2,opt,name=split_info,json=splitInfo,oneof"` +} + +type getRangeResponse_Body_EcInfo struct { + // Meta information for EC object assembly. + EcInfo *ECInfo `protobuf:"bytes,3,opt,name=ec_info,json=ecInfo,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 `protogen:"opaque.v1"` + xxx_hidden_Address *grpc1.Address `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + xxx_hidden_Ranges *[]*Range `protobuf:"bytes,2,rep,name=ranges" json:"ranges,omitempty"` + xxx_hidden_Salt []byte `protobuf:"bytes,3,opt,name=salt" json:"salt,omitempty"` + xxx_hidden_Type grpc1.ChecksumType `protobuf:"varint,4,opt,name=type,enum=neo.fs.v2.refs.ChecksumType" json:"type,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRangeHashRequest_Body) Reset() { + *x = GetRangeHashRequest_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetRangeHashRequest_Body) GetAddress() *grpc1.Address { + if x != nil { + return x.xxx_hidden_Address + } + return nil +} + +func (x *GetRangeHashRequest_Body) GetRanges() []*Range { + if x != nil { + if x.xxx_hidden_Ranges != nil { + return *x.xxx_hidden_Ranges + } + } + return nil +} + +func (x *GetRangeHashRequest_Body) GetSalt() []byte { + if x != nil { + return x.xxx_hidden_Salt + } + return nil +} + +func (x *GetRangeHashRequest_Body) GetType() grpc1.ChecksumType { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 3) { + return x.xxx_hidden_Type + } + } + return grpc1.ChecksumType(0) +} + +func (x *GetRangeHashRequest_Body) SetAddress(v *grpc1.Address) { + x.xxx_hidden_Address = v +} + +func (x *GetRangeHashRequest_Body) SetRanges(v []*Range) { + x.xxx_hidden_Ranges = &v +} + +func (x *GetRangeHashRequest_Body) SetSalt(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Salt = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 4) +} + +func (x *GetRangeHashRequest_Body) SetType(v grpc1.ChecksumType) { + x.xxx_hidden_Type = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 4) +} + +func (x *GetRangeHashRequest_Body) HasAddress() bool { + if x == nil { + return false + } + return x.xxx_hidden_Address != nil +} + +func (x *GetRangeHashRequest_Body) HasSalt() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *GetRangeHashRequest_Body) HasType() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *GetRangeHashRequest_Body) ClearAddress() { + x.xxx_hidden_Address = nil +} + +func (x *GetRangeHashRequest_Body) ClearSalt() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Salt = nil +} + +func (x *GetRangeHashRequest_Body) ClearType() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_Type = grpc1.ChecksumType_CHECKSUM_TYPE_UNSPECIFIED +} + +type GetRangeHashRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Address of the object that containing the requested payload range + Address *grpc1.Address + // List of object's payload ranges to calculate homomorphic hash + Ranges []*Range + // Binary salt to XOR object's payload ranges before hash calculation + Salt []byte + // Checksum algorithm type + Type *grpc1.ChecksumType +} + +func (b0 GetRangeHashRequest_Body_builder) Build() *GetRangeHashRequest_Body { + m0 := &GetRangeHashRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Address = b.Address + x.xxx_hidden_Ranges = &b.Ranges + if b.Salt != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 4) + x.xxx_hidden_Salt = b.Salt + } + if b.Type != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 4) + x.xxx_hidden_Type = *b.Type + } + return m0 +} + +// Get hash of object's payload part response body. +type GetRangeHashResponse_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Type grpc1.ChecksumType `protobuf:"varint,1,opt,name=type,enum=neo.fs.v2.refs.ChecksumType" json:"type,omitempty"` + xxx_hidden_HashList [][]byte `protobuf:"bytes,2,rep,name=hash_list,json=hashList" json:"hash_list,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRangeHashResponse_Body) Reset() { + *x = GetRangeHashResponse_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[36] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetRangeHashResponse_Body) GetType() grpc1.ChecksumType { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 0) { + return x.xxx_hidden_Type + } + } + return grpc1.ChecksumType(0) +} + +func (x *GetRangeHashResponse_Body) GetHashList() [][]byte { + if x != nil { + return x.xxx_hidden_HashList + } + return nil +} + +func (x *GetRangeHashResponse_Body) SetType(v grpc1.ChecksumType) { + x.xxx_hidden_Type = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2) +} + +func (x *GetRangeHashResponse_Body) SetHashList(v [][]byte) { + x.xxx_hidden_HashList = v +} + +func (x *GetRangeHashResponse_Body) HasType() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *GetRangeHashResponse_Body) ClearType() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Type = grpc1.ChecksumType_CHECKSUM_TYPE_UNSPECIFIED +} + +type GetRangeHashResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Checksum algorithm type + Type *grpc1.ChecksumType + // List of range hashes in a binary format + HashList [][]byte +} + +func (b0 GetRangeHashResponse_Body_builder) Build() *GetRangeHashResponse_Body { + m0 := &GetRangeHashResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + if b.Type != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2) + x.xxx_hidden_Type = *b.Type + } + x.xxx_hidden_HashList = b.HashList + return m0 +} + +// PUT Single request body +type PutSingleRequest_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Object *Object `protobuf:"bytes,1,opt,name=object" json:"object,omitempty"` + xxx_hidden_CopiesNumber []uint32 `protobuf:"varint,2,rep,packed,name=copies_number,json=copiesNumber" json:"copies_number,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutSingleRequest_Body) Reset() { + *x = PutSingleRequest_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[37] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PutSingleRequest_Body) GetObject() *Object { + if x != nil { + return x.xxx_hidden_Object + } + return nil +} + +func (x *PutSingleRequest_Body) GetCopiesNumber() []uint32 { + if x != nil { + return x.xxx_hidden_CopiesNumber + } + return nil +} + +func (x *PutSingleRequest_Body) SetObject(v *Object) { + x.xxx_hidden_Object = v +} + +func (x *PutSingleRequest_Body) SetCopiesNumber(v []uint32) { + x.xxx_hidden_CopiesNumber = v +} + +func (x *PutSingleRequest_Body) HasObject() bool { + if x == nil { + return false + } + return x.xxx_hidden_Object != nil +} + +func (x *PutSingleRequest_Body) ClearObject() { + x.xxx_hidden_Object = nil +} + +type PutSingleRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Prepared object with payload. + Object *Object + // 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 +} + +func (b0 PutSingleRequest_Body_builder) Build() *PutSingleRequest_Body { + m0 := &PutSingleRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Object = b.Object + x.xxx_hidden_CopiesNumber = b.CopiesNumber + return m0 +} + +// PUT Single Object response body +type PutSingleResponse_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PutSingleResponse_Body) Reset() { + *x = PutSingleResponse_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[38] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +type PutSingleResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + +} + +func (b0 PutSingleResponse_Body_builder) Build() *PutSingleResponse_Body { + m0 := &PutSingleResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + return m0 +} + +// PATCH request body +type PatchRequest_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Address *grpc1.Address `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + xxx_hidden_NewAttributes *[]*Header_Attribute `protobuf:"bytes,2,rep,name=new_attributes,json=newAttributes" json:"new_attributes,omitempty"` + xxx_hidden_ReplaceAttributes bool `protobuf:"varint,3,opt,name=replace_attributes,json=replaceAttributes" json:"replace_attributes,omitempty"` + xxx_hidden_Patch *PatchRequest_Body_Patch `protobuf:"bytes,4,opt,name=patch" json:"patch,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PatchRequest_Body) Reset() { + *x = PatchRequest_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[39] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PatchRequest_Body) GetAddress() *grpc1.Address { + if x != nil { + return x.xxx_hidden_Address + } + return nil +} + +func (x *PatchRequest_Body) GetNewAttributes() []*Header_Attribute { + if x != nil { + if x.xxx_hidden_NewAttributes != nil { + return *x.xxx_hidden_NewAttributes + } + } + return nil +} + +func (x *PatchRequest_Body) GetReplaceAttributes() bool { + if x != nil { + return x.xxx_hidden_ReplaceAttributes + } + return false +} + +func (x *PatchRequest_Body) GetPatch() *PatchRequest_Body_Patch { + if x != nil { + return x.xxx_hidden_Patch + } + return nil +} + +func (x *PatchRequest_Body) SetAddress(v *grpc1.Address) { + x.xxx_hidden_Address = v +} + +func (x *PatchRequest_Body) SetNewAttributes(v []*Header_Attribute) { + x.xxx_hidden_NewAttributes = &v +} + +func (x *PatchRequest_Body) SetReplaceAttributes(v bool) { + x.xxx_hidden_ReplaceAttributes = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 4) +} + +func (x *PatchRequest_Body) SetPatch(v *PatchRequest_Body_Patch) { + x.xxx_hidden_Patch = v +} + +func (x *PatchRequest_Body) HasAddress() bool { + if x == nil { + return false + } + return x.xxx_hidden_Address != nil +} + +func (x *PatchRequest_Body) HasReplaceAttributes() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *PatchRequest_Body) HasPatch() bool { + if x == nil { + return false + } + return x.xxx_hidden_Patch != nil +} + +func (x *PatchRequest_Body) ClearAddress() { + x.xxx_hidden_Address = nil +} + +func (x *PatchRequest_Body) ClearReplaceAttributes() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_ReplaceAttributes = false +} + +func (x *PatchRequest_Body) ClearPatch() { + x.xxx_hidden_Patch = nil +} + +type PatchRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The address of the object that is requested to get patched. + Address *grpc1.Address + // New attributes for the object. See `replace_attributes` flag usage to + // define how new attributes should be set. + NewAttributes []*Header_Attribute + // 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 + // The patch that is applied for the object. + Patch *PatchRequest_Body_Patch +} + +func (b0 PatchRequest_Body_builder) Build() *PatchRequest_Body { + m0 := &PatchRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Address = b.Address + x.xxx_hidden_NewAttributes = &b.NewAttributes + if b.ReplaceAttributes != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 4) + x.xxx_hidden_ReplaceAttributes = *b.ReplaceAttributes + } + x.xxx_hidden_Patch = b.Patch + return m0 +} + +// The patch for the object's payload. +type PatchRequest_Body_Patch struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_SourceRange *Range `protobuf:"bytes,1,opt,name=source_range,json=sourceRange" json:"source_range,omitempty"` + xxx_hidden_Chunk []byte `protobuf:"bytes,2,opt,name=chunk" json:"chunk,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PatchRequest_Body_Patch) Reset() { + *x = PatchRequest_Body_Patch{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[40] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PatchRequest_Body_Patch) GetSourceRange() *Range { + if x != nil { + return x.xxx_hidden_SourceRange + } + return nil +} + +func (x *PatchRequest_Body_Patch) GetChunk() []byte { + if x != nil { + return x.xxx_hidden_Chunk + } + return nil +} + +func (x *PatchRequest_Body_Patch) SetSourceRange(v *Range) { + x.xxx_hidden_SourceRange = v +} + +func (x *PatchRequest_Body_Patch) SetChunk(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Chunk = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2) +} + +func (x *PatchRequest_Body_Patch) HasSourceRange() bool { + if x == nil { + return false + } + return x.xxx_hidden_SourceRange != nil +} + +func (x *PatchRequest_Body_Patch) HasChunk() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *PatchRequest_Body_Patch) ClearSourceRange() { + x.xxx_hidden_SourceRange = nil +} + +func (x *PatchRequest_Body_Patch) ClearChunk() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Chunk = nil +} + +type PatchRequest_Body_Patch_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // 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 + // The chunk that is being appended to or that replaces the original + // payload on the given range. + Chunk []byte +} + +func (b0 PatchRequest_Body_Patch_builder) Build() *PatchRequest_Body_Patch { + m0 := &PatchRequest_Body_Patch{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_SourceRange = b.SourceRange + if b.Chunk != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2) + x.xxx_hidden_Chunk = b.Chunk + } + return m0 +} + +// PATCH response body +type PatchResponse_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_ObjectId *grpc1.ObjectID `protobuf:"bytes,1,opt,name=object_id,json=objectId" json:"object_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PatchResponse_Body) Reset() { + *x = PatchResponse_Body{} + mi := &file_api_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_api_object_grpc_service_proto_msgTypes[41] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PatchResponse_Body) GetObjectId() *grpc1.ObjectID { + if x != nil { + return x.xxx_hidden_ObjectId + } + return nil +} + +func (x *PatchResponse_Body) SetObjectId(v *grpc1.ObjectID) { + x.xxx_hidden_ObjectId = v +} + +func (x *PatchResponse_Body) HasObjectId() bool { + if x == nil { + return false + } + return x.xxx_hidden_ObjectId != nil +} + +func (x *PatchResponse_Body) ClearObjectId() { + x.xxx_hidden_ObjectId = nil +} + +type PatchResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The object ID of the saved patched object. + ObjectId *grpc1.ObjectID +} + +func (b0 PatchResponse_Body_builder) Build() *PatchResponse_Body { + m0 := &PatchResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_ObjectId = b.ObjectId + return m0 +} + +var File_api_object_grpc_service_proto protoreflect.FileDescriptor + +var file_api_object_grpc_service_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x61, 0x70, 0x69, 0x2f, 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, 0x1b, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, + 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x61, 0x70, 0x69, 0x2f, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 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, 0x62, 0x5a, 0x43, 0x67, 0x69, 0x74, + 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, + 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 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, 0x08, 0x65, + 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_object_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 42) +var file_api_object_grpc_service_proto_goTypes = []any{ + (*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_api_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_api_object_grpc_service_proto_init() } +func file_api_object_grpc_service_proto_init() { + if File_api_object_grpc_service_proto != nil { + return + } + file_api_object_grpc_types_proto_init() + file_api_object_grpc_service_proto_msgTypes[21].OneofWrappers = []any{ + (*getResponse_Body_Init_)(nil), + (*getResponse_Body_Chunk)(nil), + (*getResponse_Body_SplitInfo)(nil), + (*getResponse_Body_EcInfo)(nil), + } + file_api_object_grpc_service_proto_msgTypes[23].OneofWrappers = []any{ + (*putRequest_Body_Init_)(nil), + (*putRequest_Body_Chunk)(nil), + } + file_api_object_grpc_service_proto_msgTypes[29].OneofWrappers = []any{ + (*headResponse_Body_Header)(nil), + (*headResponse_Body_ShortHeader)(nil), + (*headResponse_Body_SplitInfo)(nil), + (*headResponse_Body_EcInfo)(nil), + } + file_api_object_grpc_service_proto_msgTypes[34].OneofWrappers = []any{ + (*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_api_object_grpc_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 42, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_api_object_grpc_service_proto_goTypes, + DependencyIndexes: file_api_object_grpc_service_proto_depIdxs, + MessageInfos: file_api_object_grpc_service_proto_msgTypes, + }.Build() + File_api_object_grpc_service_proto = out.File + file_api_object_grpc_service_proto_rawDesc = nil + file_api_object_grpc_service_proto_goTypes = nil + file_api_object_grpc_service_proto_depIdxs = nil +} diff --git a/api/object/grpc/types.pb.go b/api/object/grpc/types.pb.go new file mode 100644 index 0000000..8404e30 --- /dev/null +++ b/api/object/grpc/types.pb.go @@ -0,0 +1,2093 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/object/grpc/types.proto + +//go:build !protoopaque + +package object + +import ( + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 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_api_object_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (ObjectType) Type() protoreflect.EnumType { + return &file_api_object_grpc_types_proto_enumTypes[0] +} + +func (x ObjectType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// 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_api_object_grpc_types_proto_enumTypes[1].Descriptor() +} + +func (MatchType) Type() protoreflect.EnumType { + return &file_api_object_grpc_types_proto_enumTypes[1] +} + +func (x MatchType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Short header fields +type ShortHeader struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Object format version. Effectively, the version of API library used to + // create particular object. + Version *grpc.Version `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"` + // Epoch when the object was created + CreationEpoch *uint64 `protobuf:"varint,2,opt,name=creation_epoch,json=creationEpoch" json:"creation_epoch,omitempty"` + // Object's owner + OwnerId *grpc.OwnerID `protobuf:"bytes,3,opt,name=owner_id,json=ownerID" json:"owner_id,omitempty"` + // Type of the object payload content + ObjectType *ObjectType `protobuf:"varint,4,opt,name=object_type,json=objectType,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" json:"payload_length,omitempty"` + // Hash of payload bytes + PayloadHash *grpc.Checksum `protobuf:"bytes,6,opt,name=payload_hash,json=payloadHash" json:"payload_hash,omitempty"` + // Homomorphic hash of the object payload + HomomorphicHash *grpc.Checksum `protobuf:"bytes,7,opt,name=homomorphic_hash,json=homomorphicHash" json:"homomorphic_hash,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ShortHeader) Reset() { + *x = ShortHeader{} + mi := &file_api_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_api_object_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ShortHeader) GetVersion() *grpc.Version { + if x != nil { + return x.Version + } + return nil +} + +func (x *ShortHeader) GetCreationEpoch() uint64 { + if x != nil && x.CreationEpoch != 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 && x.ObjectType != nil { + return *x.ObjectType + } + return ObjectType_REGULAR +} + +func (x *ShortHeader) GetPayloadLength() uint64 { + if x != nil && x.PayloadLength != 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 +} + +func (x *ShortHeader) SetVersion(v *grpc.Version) { + x.Version = v +} + +func (x *ShortHeader) SetCreationEpoch(v uint64) { + x.CreationEpoch = &v +} + +func (x *ShortHeader) SetOwnerId(v *grpc.OwnerID) { + x.OwnerId = v +} + +func (x *ShortHeader) SetObjectType(v ObjectType) { + x.ObjectType = &v +} + +func (x *ShortHeader) SetPayloadLength(v uint64) { + x.PayloadLength = &v +} + +func (x *ShortHeader) SetPayloadHash(v *grpc.Checksum) { + x.PayloadHash = v +} + +func (x *ShortHeader) SetHomomorphicHash(v *grpc.Checksum) { + x.HomomorphicHash = v +} + +func (x *ShortHeader) HasVersion() bool { + if x == nil { + return false + } + return x.Version != nil +} + +func (x *ShortHeader) HasCreationEpoch() bool { + if x == nil { + return false + } + return x.CreationEpoch != nil +} + +func (x *ShortHeader) HasOwnerId() bool { + if x == nil { + return false + } + return x.OwnerId != nil +} + +func (x *ShortHeader) HasObjectType() bool { + if x == nil { + return false + } + return x.ObjectType != nil +} + +func (x *ShortHeader) HasPayloadLength() bool { + if x == nil { + return false + } + return x.PayloadLength != nil +} + +func (x *ShortHeader) HasPayloadHash() bool { + if x == nil { + return false + } + return x.PayloadHash != nil +} + +func (x *ShortHeader) HasHomomorphicHash() bool { + if x == nil { + return false + } + return x.HomomorphicHash != nil +} + +func (x *ShortHeader) ClearVersion() { + x.Version = nil +} + +func (x *ShortHeader) ClearCreationEpoch() { + x.CreationEpoch = nil +} + +func (x *ShortHeader) ClearOwnerId() { + x.OwnerId = nil +} + +func (x *ShortHeader) ClearObjectType() { + x.ObjectType = nil +} + +func (x *ShortHeader) ClearPayloadLength() { + x.PayloadLength = nil +} + +func (x *ShortHeader) ClearPayloadHash() { + x.PayloadHash = nil +} + +func (x *ShortHeader) ClearHomomorphicHash() { + x.HomomorphicHash = nil +} + +type ShortHeader_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Object format version. Effectively, the version of API library used to + // create particular object. + Version *grpc.Version + // Epoch when the object was created + CreationEpoch *uint64 + // Object's owner + OwnerId *grpc.OwnerID + // Type of the object payload content + ObjectType *ObjectType + // Size of payload in bytes. + // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown + PayloadLength *uint64 + // Hash of payload bytes + PayloadHash *grpc.Checksum + // Homomorphic hash of the object payload + HomomorphicHash *grpc.Checksum +} + +func (b0 ShortHeader_builder) Build() *ShortHeader { + m0 := &ShortHeader{} + b, x := &b0, m0 + _, _ = b, x + x.Version = b.Version + x.CreationEpoch = b.CreationEpoch + x.OwnerId = b.OwnerId + x.ObjectType = b.ObjectType + x.PayloadLength = b.PayloadLength + x.PayloadHash = b.PayloadHash + x.HomomorphicHash = b.HomomorphicHash + return m0 +} + +// Object Header +type Header struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Object format version. Effectively, the version of API library used to + // create particular object + Version *grpc.Version `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"` + // Object's container + ContainerId *grpc.ContainerID `protobuf:"bytes,2,opt,name=container_id,json=containerID" json:"container_id,omitempty"` + // Object's owner + OwnerId *grpc.OwnerID `protobuf:"bytes,3,opt,name=owner_id,json=ownerID" json:"owner_id,omitempty"` + // Object creation Epoch + CreationEpoch *uint64 `protobuf:"varint,4,opt,name=creation_epoch,json=creationEpoch" 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" json:"payload_length,omitempty"` + // Hash of payload bytes + PayloadHash *grpc.Checksum `protobuf:"bytes,6,opt,name=payload_hash,json=payloadHash" json:"payload_hash,omitempty"` + // Type of the object payload content + ObjectType *ObjectType `protobuf:"varint,7,opt,name=object_type,json=objectType,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" 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" json:"session_token,omitempty"` + // User-defined object attributes + Attributes []*Header_Attribute `protobuf:"bytes,10,rep,name=attributes" json:"attributes,omitempty"` + // Position of the object in the split hierarchy + Split *Header_Split `protobuf:"bytes,11,opt,name=split" json:"split,omitempty"` + // Erasure code chunk information. + Ec *Header_EC `protobuf:"bytes,12,opt,name=ec" json:"ec,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Header) Reset() { + *x = Header{} + mi := &file_api_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_api_object_grpc_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 && x.CreationEpoch != nil { + return *x.CreationEpoch + } + return 0 +} + +func (x *Header) GetPayloadLength() uint64 { + if x != nil && x.PayloadLength != 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 && x.ObjectType != 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 +} + +func (x *Header) SetVersion(v *grpc.Version) { + x.Version = v +} + +func (x *Header) SetContainerId(v *grpc.ContainerID) { + x.ContainerId = v +} + +func (x *Header) SetOwnerId(v *grpc.OwnerID) { + x.OwnerId = v +} + +func (x *Header) SetCreationEpoch(v uint64) { + x.CreationEpoch = &v +} + +func (x *Header) SetPayloadLength(v uint64) { + x.PayloadLength = &v +} + +func (x *Header) SetPayloadHash(v *grpc.Checksum) { + x.PayloadHash = v +} + +func (x *Header) SetObjectType(v ObjectType) { + x.ObjectType = &v +} + +func (x *Header) SetHomomorphicHash(v *grpc.Checksum) { + x.HomomorphicHash = v +} + +func (x *Header) SetSessionToken(v *grpc1.SessionToken) { + x.SessionToken = v +} + +func (x *Header) SetAttributes(v []*Header_Attribute) { + x.Attributes = v +} + +func (x *Header) SetSplit(v *Header_Split) { + x.Split = v +} + +func (x *Header) SetEc(v *Header_EC) { + x.Ec = v +} + +func (x *Header) HasVersion() bool { + if x == nil { + return false + } + return x.Version != nil +} + +func (x *Header) HasContainerId() bool { + if x == nil { + return false + } + return x.ContainerId != nil +} + +func (x *Header) HasOwnerId() bool { + if x == nil { + return false + } + return x.OwnerId != nil +} + +func (x *Header) HasCreationEpoch() bool { + if x == nil { + return false + } + return x.CreationEpoch != nil +} + +func (x *Header) HasPayloadLength() bool { + if x == nil { + return false + } + return x.PayloadLength != nil +} + +func (x *Header) HasPayloadHash() bool { + if x == nil { + return false + } + return x.PayloadHash != nil +} + +func (x *Header) HasObjectType() bool { + if x == nil { + return false + } + return x.ObjectType != nil +} + +func (x *Header) HasHomomorphicHash() bool { + if x == nil { + return false + } + return x.HomomorphicHash != nil +} + +func (x *Header) HasSessionToken() bool { + if x == nil { + return false + } + return x.SessionToken != nil +} + +func (x *Header) HasSplit() bool { + if x == nil { + return false + } + return x.Split != nil +} + +func (x *Header) HasEc() bool { + if x == nil { + return false + } + return x.Ec != nil +} + +func (x *Header) ClearVersion() { + x.Version = nil +} + +func (x *Header) ClearContainerId() { + x.ContainerId = nil +} + +func (x *Header) ClearOwnerId() { + x.OwnerId = nil +} + +func (x *Header) ClearCreationEpoch() { + x.CreationEpoch = nil +} + +func (x *Header) ClearPayloadLength() { + x.PayloadLength = nil +} + +func (x *Header) ClearPayloadHash() { + x.PayloadHash = nil +} + +func (x *Header) ClearObjectType() { + x.ObjectType = nil +} + +func (x *Header) ClearHomomorphicHash() { + x.HomomorphicHash = nil +} + +func (x *Header) ClearSessionToken() { + x.SessionToken = nil +} + +func (x *Header) ClearSplit() { + x.Split = nil +} + +func (x *Header) ClearEc() { + x.Ec = nil +} + +type Header_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Object format version. Effectively, the version of API library used to + // create particular object + Version *grpc.Version + // Object's container + ContainerId *grpc.ContainerID + // Object's owner + OwnerId *grpc.OwnerID + // Object creation Epoch + CreationEpoch *uint64 + // Size of payload in bytes. + // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown. + PayloadLength *uint64 + // Hash of payload bytes + PayloadHash *grpc.Checksum + // Type of the object payload content + ObjectType *ObjectType + // Homomorphic hash of the object payload + HomomorphicHash *grpc.Checksum + // Session token, if it was used during Object creation. Need it to verify + // integrity and authenticity out of Request scope. + SessionToken *grpc1.SessionToken + // User-defined object attributes + Attributes []*Header_Attribute + // Position of the object in the split hierarchy + Split *Header_Split + // Erasure code chunk information. + Ec *Header_EC +} + +func (b0 Header_builder) Build() *Header { + m0 := &Header{} + b, x := &b0, m0 + _, _ = b, x + x.Version = b.Version + x.ContainerId = b.ContainerId + x.OwnerId = b.OwnerId + x.CreationEpoch = b.CreationEpoch + x.PayloadLength = b.PayloadLength + x.PayloadHash = b.PayloadHash + x.ObjectType = b.ObjectType + x.HomomorphicHash = b.HomomorphicHash + x.SessionToken = b.SessionToken + x.Attributes = b.Attributes + x.Split = b.Split + x.Ec = b.Ec + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // Object's unique identifier. + ObjectId *grpc.ObjectID `protobuf:"bytes,1,opt,name=object_id,json=objectID" json:"object_id,omitempty"` + // Signed object_id + Signature *grpc.Signature `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` + // Object metadata headers + Header *Header `protobuf:"bytes,3,opt,name=header" json:"header,omitempty"` + // Payload bytes + Payload []byte `protobuf:"bytes,4,opt,name=payload" json:"payload,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Object) Reset() { + *x = Object{} + mi := &file_api_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_api_object_grpc_types_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *Object) SetObjectId(v *grpc.ObjectID) { + x.ObjectId = v +} + +func (x *Object) SetSignature(v *grpc.Signature) { + x.Signature = v +} + +func (x *Object) SetHeader(v *Header) { + x.Header = v +} + +func (x *Object) SetPayload(v []byte) { + if v == nil { + v = []byte{} + } + x.Payload = v +} + +func (x *Object) HasObjectId() bool { + if x == nil { + return false + } + return x.ObjectId != nil +} + +func (x *Object) HasSignature() bool { + if x == nil { + return false + } + return x.Signature != nil +} + +func (x *Object) HasHeader() bool { + if x == nil { + return false + } + return x.Header != nil +} + +func (x *Object) HasPayload() bool { + if x == nil { + return false + } + return x.Payload != nil +} + +func (x *Object) ClearObjectId() { + x.ObjectId = nil +} + +func (x *Object) ClearSignature() { + x.Signature = nil +} + +func (x *Object) ClearHeader() { + x.Header = nil +} + +func (x *Object) ClearPayload() { + x.Payload = nil +} + +type Object_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Object's unique identifier. + ObjectId *grpc.ObjectID + // Signed object_id + Signature *grpc.Signature + // Object metadata headers + Header *Header + // Payload bytes + Payload []byte +} + +func (b0 Object_builder) Build() *Object { + m0 := &Object{} + b, x := &b0, m0 + _, _ = b, x + x.ObjectId = b.ObjectId + x.Signature = b.Signature + x.Header = b.Header + x.Payload = b.Payload + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // 16 byte UUID used to identify the split object hierarchy parts. + SplitId []byte `protobuf:"bytes,1,opt,name=split_id,json=splitId" 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" 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" json:"link,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SplitInfo) Reset() { + *x = SplitInfo{} + mi := &file_api_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_api_object_grpc_types_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *SplitInfo) SetSplitId(v []byte) { + if v == nil { + v = []byte{} + } + x.SplitId = v +} + +func (x *SplitInfo) SetLastPart(v *grpc.ObjectID) { + x.LastPart = v +} + +func (x *SplitInfo) SetLink(v *grpc.ObjectID) { + x.Link = v +} + +func (x *SplitInfo) HasSplitId() bool { + if x == nil { + return false + } + return x.SplitId != nil +} + +func (x *SplitInfo) HasLastPart() bool { + if x == nil { + return false + } + return x.LastPart != nil +} + +func (x *SplitInfo) HasLink() bool { + if x == nil { + return false + } + return x.Link != nil +} + +func (x *SplitInfo) ClearSplitId() { + x.SplitId = nil +} + +func (x *SplitInfo) ClearLastPart() { + x.LastPart = nil +} + +func (x *SplitInfo) ClearLink() { + x.Link = nil +} + +type SplitInfo_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // 16 byte UUID used to identify the split object hierarchy parts. + SplitId []byte + // The identifier of the last object in split hierarchy parts. It contains + // split header with the original object header. + LastPart *grpc.ObjectID + // 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 +} + +func (b0 SplitInfo_builder) Build() *SplitInfo { + m0 := &SplitInfo{} + b, x := &b0, m0 + _, _ = b, x + x.SplitId = b.SplitId + x.LastPart = b.LastPart + x.Link = b.Link + return m0 +} + +// Meta information for the erasure-encoded object. +type ECInfo struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Chunk stored on the node. + Chunks []*ECInfo_Chunk `protobuf:"bytes,1,rep,name=chunks" json:"chunks,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ECInfo) Reset() { + *x = ECInfo{} + mi := &file_api_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_api_object_grpc_types_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ECInfo) GetChunks() []*ECInfo_Chunk { + if x != nil { + return x.Chunks + } + return nil +} + +func (x *ECInfo) SetChunks(v []*ECInfo_Chunk) { + x.Chunks = v +} + +type ECInfo_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Chunk stored on the node. + Chunks []*ECInfo_Chunk +} + +func (b0 ECInfo_builder) Build() *ECInfo { + m0 := &ECInfo{} + b, x := &b0, m0 + _, _ = b, x + x.Chunks = b.Chunks + return m0 +} + +// `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 FrostFS Technical Specification. +type Header_Attribute struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // string key to the object attribute + Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + // string value of the object attribute + Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Header_Attribute) Reset() { + *x = Header_Attribute{} + mi := &file_api_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_api_object_grpc_types_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Header_Attribute) GetKey() string { + if x != nil && x.Key != nil { + return *x.Key + } + return "" +} + +func (x *Header_Attribute) GetValue() string { + if x != nil && x.Value != nil { + return *x.Value + } + return "" +} + +func (x *Header_Attribute) SetKey(v string) { + x.Key = &v +} + +func (x *Header_Attribute) SetValue(v string) { + x.Value = &v +} + +func (x *Header_Attribute) HasKey() bool { + if x == nil { + return false + } + return x.Key != nil +} + +func (x *Header_Attribute) HasValue() bool { + if x == nil { + return false + } + return x.Value != nil +} + +func (x *Header_Attribute) ClearKey() { + x.Key = nil +} + +func (x *Header_Attribute) ClearValue() { + x.Value = nil +} + +type Header_Attribute_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // string key to the object attribute + Key *string + // string value of the object attribute + Value *string +} + +func (b0 Header_Attribute_builder) Build() *Header_Attribute { + m0 := &Header_Attribute{} + b, x := &b0, m0 + _, _ = b, x + x.Key = b.Key + x.Value = b.Value + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // Identifier of the origin object. Known only to the minor child. + Parent *grpc.ObjectID `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Identifier of the left split neighbor + Previous *grpc.ObjectID `protobuf:"bytes,2,opt,name=previous" 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" 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" json:"parent_header,omitempty"` + // List of identifiers of the objects generated by splitting current one. + Children []*grpc.ObjectID `protobuf:"bytes,5,rep,name=children" 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" json:"split_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Header_Split) Reset() { + *x = Header_Split{} + mi := &file_api_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_api_object_grpc_types_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *Header_Split) SetParent(v *grpc.ObjectID) { + x.Parent = v +} + +func (x *Header_Split) SetPrevious(v *grpc.ObjectID) { + x.Previous = v +} + +func (x *Header_Split) SetParentSignature(v *grpc.Signature) { + x.ParentSignature = v +} + +func (x *Header_Split) SetParentHeader(v *Header) { + x.ParentHeader = v +} + +func (x *Header_Split) SetChildren(v []*grpc.ObjectID) { + x.Children = v +} + +func (x *Header_Split) SetSplitId(v []byte) { + if v == nil { + v = []byte{} + } + x.SplitId = v +} + +func (x *Header_Split) HasParent() bool { + if x == nil { + return false + } + return x.Parent != nil +} + +func (x *Header_Split) HasPrevious() bool { + if x == nil { + return false + } + return x.Previous != nil +} + +func (x *Header_Split) HasParentSignature() bool { + if x == nil { + return false + } + return x.ParentSignature != nil +} + +func (x *Header_Split) HasParentHeader() bool { + if x == nil { + return false + } + return x.ParentHeader != nil +} + +func (x *Header_Split) HasSplitId() bool { + if x == nil { + return false + } + return x.SplitId != nil +} + +func (x *Header_Split) ClearParent() { + x.Parent = nil +} + +func (x *Header_Split) ClearPrevious() { + x.Previous = nil +} + +func (x *Header_Split) ClearParentSignature() { + x.ParentSignature = nil +} + +func (x *Header_Split) ClearParentHeader() { + x.ParentHeader = nil +} + +func (x *Header_Split) ClearSplitId() { + x.SplitId = nil +} + +type Header_Split_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Identifier of the origin object. Known only to the minor child. + Parent *grpc.ObjectID + // Identifier of the left split neighbor + Previous *grpc.ObjectID + // `signature` field of the parent object. Used to reconstruct parent. + ParentSignature *grpc.Signature + // `header` field of the parent object. Used to reconstruct parent. + ParentHeader *Header + // List of identifiers of the objects generated by splitting current one. + Children []*grpc.ObjectID + // 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 +} + +func (b0 Header_Split_builder) Build() *Header_Split { + m0 := &Header_Split{} + b, x := &b0, m0 + _, _ = b, x + x.Parent = b.Parent + x.Previous = b.Previous + x.ParentSignature = b.ParentSignature + x.ParentHeader = b.ParentHeader + x.Children = b.Children + x.SplitId = b.SplitId + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // Identifier of the origin object. Known to all chunks. + Parent *grpc.ObjectID `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Index of this chunk. + Index *uint32 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"` + // Total number of chunks in this split. + Total *uint32 `protobuf:"varint,3,opt,name=total" 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" json:"header_length,omitempty"` + // Chunk of a parent header. + Header []byte `protobuf:"bytes,5,opt,name=header" 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" 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" json:"parent_split_parent_id,omitempty"` + // EC parent's attributes. + ParentAttributes []*Header_Attribute `protobuf:"bytes,8,rep,name=parent_attributes,json=parentAttributes" json:"parent_attributes,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Header_EC) Reset() { + *x = Header_EC{} + mi := &file_api_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_api_object_grpc_types_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Header_EC) GetParent() *grpc.ObjectID { + if x != nil { + return x.Parent + } + return nil +} + +func (x *Header_EC) GetIndex() uint32 { + if x != nil && x.Index != nil { + return *x.Index + } + return 0 +} + +func (x *Header_EC) GetTotal() uint32 { + if x != nil && x.Total != nil { + return *x.Total + } + return 0 +} + +func (x *Header_EC) GetHeaderLength() uint32 { + if x != nil && x.HeaderLength != 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 +} + +func (x *Header_EC) SetParent(v *grpc.ObjectID) { + x.Parent = v +} + +func (x *Header_EC) SetIndex(v uint32) { + x.Index = &v +} + +func (x *Header_EC) SetTotal(v uint32) { + x.Total = &v +} + +func (x *Header_EC) SetHeaderLength(v uint32) { + x.HeaderLength = &v +} + +func (x *Header_EC) SetHeader(v []byte) { + if v == nil { + v = []byte{} + } + x.Header = v +} + +func (x *Header_EC) SetParentSplitId(v []byte) { + if v == nil { + v = []byte{} + } + x.ParentSplitId = v +} + +func (x *Header_EC) SetParentSplitParentId(v *grpc.ObjectID) { + x.ParentSplitParentId = v +} + +func (x *Header_EC) SetParentAttributes(v []*Header_Attribute) { + x.ParentAttributes = v +} + +func (x *Header_EC) HasParent() bool { + if x == nil { + return false + } + return x.Parent != nil +} + +func (x *Header_EC) HasIndex() bool { + if x == nil { + return false + } + return x.Index != nil +} + +func (x *Header_EC) HasTotal() bool { + if x == nil { + return false + } + return x.Total != nil +} + +func (x *Header_EC) HasHeaderLength() bool { + if x == nil { + return false + } + return x.HeaderLength != nil +} + +func (x *Header_EC) HasHeader() bool { + if x == nil { + return false + } + return x.Header != nil +} + +func (x *Header_EC) HasParentSplitId() bool { + if x == nil { + return false + } + return x.ParentSplitId != nil +} + +func (x *Header_EC) HasParentSplitParentId() bool { + if x == nil { + return false + } + return x.ParentSplitParentId != nil +} + +func (x *Header_EC) ClearParent() { + x.Parent = nil +} + +func (x *Header_EC) ClearIndex() { + x.Index = nil +} + +func (x *Header_EC) ClearTotal() { + x.Total = nil +} + +func (x *Header_EC) ClearHeaderLength() { + x.HeaderLength = nil +} + +func (x *Header_EC) ClearHeader() { + x.Header = nil +} + +func (x *Header_EC) ClearParentSplitId() { + x.ParentSplitId = nil +} + +func (x *Header_EC) ClearParentSplitParentId() { + x.ParentSplitParentId = nil +} + +type Header_EC_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Identifier of the origin object. Known to all chunks. + Parent *grpc.ObjectID + // Index of this chunk. + Index *uint32 + // Total number of chunks in this split. + Total *uint32 + // Total length of a parent header. Used to trim padding zeroes. + HeaderLength *uint32 + // Chunk of a parent header. + Header []byte + // 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 + // 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 + // EC parent's attributes. + ParentAttributes []*Header_Attribute +} + +func (b0 Header_EC_builder) Build() *Header_EC { + m0 := &Header_EC{} + b, x := &b0, m0 + _, _ = b, x + x.Parent = b.Parent + x.Index = b.Index + x.Total = b.Total + x.HeaderLength = b.HeaderLength + x.Header = b.Header + x.ParentSplitId = b.ParentSplitId + x.ParentSplitParentId = b.ParentSplitParentId + x.ParentAttributes = b.ParentAttributes + return m0 +} + +type ECInfo_Chunk struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Object ID of the chunk. + Id *grpc.ObjectID `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // Index of the chunk. + Index *uint32 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"` + // Total number of chunks in this split. + Total *uint32 `protobuf:"varint,3,opt,name=total" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ECInfo_Chunk) Reset() { + *x = ECInfo_Chunk{} + mi := &file_api_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_api_object_grpc_types_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ECInfo_Chunk) GetId() *grpc.ObjectID { + if x != nil { + return x.Id + } + return nil +} + +func (x *ECInfo_Chunk) GetIndex() uint32 { + if x != nil && x.Index != nil { + return *x.Index + } + return 0 +} + +func (x *ECInfo_Chunk) GetTotal() uint32 { + if x != nil && x.Total != nil { + return *x.Total + } + return 0 +} + +func (x *ECInfo_Chunk) SetId(v *grpc.ObjectID) { + x.Id = v +} + +func (x *ECInfo_Chunk) SetIndex(v uint32) { + x.Index = &v +} + +func (x *ECInfo_Chunk) SetTotal(v uint32) { + x.Total = &v +} + +func (x *ECInfo_Chunk) HasId() bool { + if x == nil { + return false + } + return x.Id != nil +} + +func (x *ECInfo_Chunk) HasIndex() bool { + if x == nil { + return false + } + return x.Index != nil +} + +func (x *ECInfo_Chunk) HasTotal() bool { + if x == nil { + return false + } + return x.Total != nil +} + +func (x *ECInfo_Chunk) ClearId() { + x.Id = nil +} + +func (x *ECInfo_Chunk) ClearIndex() { + x.Index = nil +} + +func (x *ECInfo_Chunk) ClearTotal() { + x.Total = nil +} + +type ECInfo_Chunk_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Object ID of the chunk. + Id *grpc.ObjectID + // Index of the chunk. + Index *uint32 + // Total number of chunks in this split. + Total *uint32 +} + +func (b0 ECInfo_Chunk_builder) Build() *ECInfo_Chunk { + m0 := &ECInfo_Chunk{} + b, x := &b0, m0 + _, _ = b, x + x.Id = b.Id + x.Index = b.Index + x.Total = b.Total + return m0 +} + +var File_api_object_grpc_types_proto protoreflect.FileDescriptor + +var file_api_object_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x61, 0x70, 0x69, 0x2f, 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, + 0x19, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x61, 0x70, 0x69, 0x2f, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 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, 0x62, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, + 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, + 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_object_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_api_object_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_api_object_grpc_types_proto_goTypes = []any{ + (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_api_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_api_object_grpc_types_proto_init() } +func file_api_object_grpc_types_proto_init() { + if File_api_object_grpc_types_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_object_grpc_types_proto_rawDesc, + NumEnums: 2, + NumMessages: 9, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_object_grpc_types_proto_goTypes, + DependencyIndexes: file_api_object_grpc_types_proto_depIdxs, + EnumInfos: file_api_object_grpc_types_proto_enumTypes, + MessageInfos: file_api_object_grpc_types_proto_msgTypes, + }.Build() + File_api_object_grpc_types_proto = out.File + file_api_object_grpc_types_proto_rawDesc = nil + file_api_object_grpc_types_proto_goTypes = nil + file_api_object_grpc_types_proto_depIdxs = nil +} diff --git a/api/object/grpc/types_frostfs.pb.go b/api/object/grpc/types_frostfs.pb.go deleted file mode 100644 index 6c9925c..0000000 --- a/api/object/grpc/types_frostfs.pb.go +++ /dev/null @@ -1,2992 +0,0 @@ -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package object - -import ( - json "encoding/json" - fmt "fmt" - grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" - grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" - pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" - proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" - encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" - easyproto "github.com/VictoriaMetrics/easyproto" - jlexer "github.com/mailru/easyjson/jlexer" - jwriter "github.com/mailru/easyjson/jwriter" - 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.EmitProtobuf(mm.AppendMessage(1)) - } - if x.CreationEpoch != 0 { - mm.AppendUint64(2, x.CreationEpoch) - } - if x.OwnerId != nil { - 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.EmitProtobuf(mm.AppendMessage(6)) - } - if x.HomomorphicHash != nil { - 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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"version\":" - out.RawString(prefix) - x.Version.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"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 !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 = "\"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 - 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": - { - 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 - 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": - { - 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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"key\":" - out.RawString(prefix) - out.String(x.Key) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"value\":" - out.RawString(prefix) - out.String(x.Value) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.NestedStructureSizeUnchecked(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.EmitProtobuf(mm.AppendMessage(1)) - } - if x.Previous != nil { - x.Previous.EmitProtobuf(mm.AppendMessage(2)) - } - if x.ParentSignature != nil { - x.ParentSignature.EmitProtobuf(mm.AppendMessage(3)) - } - if x.ParentHeader != nil { - x.ParentHeader.EmitProtobuf(mm.AppendMessage(4)) - } - for i := range x.Children { - 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, 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 - } - first := true - out.RawByte('{') - { - 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 = "\"previous\":" - out.RawString(prefix) - x.Previous.MarshalEasyJSON(out) - } - { - 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 = "\"parentHeader\":" - out.RawString(prefix) - x.ParentHeader.MarshalEasyJSON(out) - } - { - 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 = "\"splitID\":" - out.RawString(prefix) - if x.SplitId != nil { - out.Base64Bytes(x.SplitId) - } else { - out.String("") - } - } - 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 = grpc.ObjectID{} - f.UnmarshalEasyJSON(in) - list = append(list, f) - in.WantComma() - } - x.Children = list - in.Delim(']') - } - case "splitID": - { - var f []byte - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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.NestedStructureSizeUnchecked(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.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.EmitProtobuf(mm.AppendMessage(7)) - } - for i := range x.ParentAttributes { - 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, 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 - } - first := true - out.RawByte('{') - { - 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 = "\"index\":" - out.RawString(prefix) - out.Uint32(x.Index) - } - { - 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 = "\"headerLength\":" - out.RawString(prefix) - out.Uint32(x.HeaderLength) - } - { - 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 !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 !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 = "\"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 - 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 - 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 - 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": - { - var f []byte - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - x.Header = f - } - case "parentSplitID": - { - var f []byte - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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 = 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.NestedStructureSizeUnchecked(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.EmitProtobuf(mm.AppendMessage(1)) - } - if x.ContainerId != nil { - x.ContainerId.EmitProtobuf(mm.AppendMessage(2)) - } - if x.OwnerId != nil { - 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.EmitProtobuf(mm.AppendMessage(6)) - } - if int32(x.ObjectType) != 0 { - mm.AppendInt32(7, int32(x.ObjectType)) - } - if x.HomomorphicHash != nil { - x.HomomorphicHash.EmitProtobuf(mm.AppendMessage(8)) - } - if x.SessionToken != nil { - x.SessionToken.EmitProtobuf(mm.AppendMessage(9)) - } - for i := range x.Attributes { - x.Attributes[i].EmitProtobuf(mm.AppendMessage(10)) - } - if x.Split != nil { - x.Split.EmitProtobuf(mm.AppendMessage(11)) - } - if x.Ec != nil { - 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, 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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"version\":" - out.RawString(prefix) - x.Version.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"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 !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 = "\"sessionToken\":" - out.RawString(prefix) - x.SessionToken.MarshalEasyJSON(out) - } - { - 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 = "\"split\":" - out.RawString(prefix) - x.Split.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - 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 - 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 - 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": - { - 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 = 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.EmitProtobuf(mm.AppendMessage(1)) - } - if x.Signature != nil { - x.Signature.EmitProtobuf(mm.AppendMessage(2)) - } - if x.Header != nil { - 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 - } - first := true - out.RawByte('{') - { - 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 = "\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) - } - { - 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 = "\"payload\":" - out.RawString(prefix) - if x.Payload != nil { - out.Base64Bytes(x.Payload) - } else { - out.String("") - } - } - 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 - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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.EmitProtobuf(mm.AppendMessage(2)) - } - if x.Link != nil { - 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 - } - first := true - out.RawByte('{') - { - 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 !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 = "\"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 - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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.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 - } - first := true - out.RawByte('{') - { - 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 = "\"index\":" - out.RawString(prefix) - out.Uint32(x.Index) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - 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 - 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 - 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 - } - } - 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.NestedStructureSizeUnchecked(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 { - 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, 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 - } - first := true - 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('}') -} - -// 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 = 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/api/object/grpc/types_frostfs_fuzz.go b/api/object/grpc/types_frostfs_fuzz.go deleted file mode 100644 index 8491638..0000000 --- a/api/object/grpc/types_frostfs_fuzz.go +++ /dev/null @@ -1,102 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package object - -func DoFuzzProtoShortHeader(data []byte) int { - msg := new(ShortHeader) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONShortHeader(data []byte) int { - msg := new(ShortHeader) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoHeader(data []byte) int { - msg := new(Header) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONHeader(data []byte) int { - msg := new(Header) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoObject(data []byte) int { - msg := new(Object) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONObject(data []byte) int { - msg := new(Object) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoSplitInfo(data []byte) int { - msg := new(SplitInfo) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONSplitInfo(data []byte) int { - msg := new(SplitInfo) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoECInfo(data []byte) int { - msg := new(ECInfo) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONECInfo(data []byte) int { - msg := new(ECInfo) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} diff --git a/api/object/grpc/types_frostfs_test.go b/api/object/grpc/types_frostfs_test.go deleted file mode 100644 index 11825be..0000000 --- a/api/object/grpc/types_frostfs_test.go +++ /dev/null @@ -1,61 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package object - -import ( - testing "testing" -) - -func FuzzProtoShortHeader(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoShortHeader(data) - }) -} -func FuzzJSONShortHeader(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONShortHeader(data) - }) -} -func FuzzProtoHeader(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoHeader(data) - }) -} -func FuzzJSONHeader(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONHeader(data) - }) -} -func FuzzProtoObject(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoObject(data) - }) -} -func FuzzJSONObject(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONObject(data) - }) -} -func FuzzProtoSplitInfo(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoSplitInfo(data) - }) -} -func FuzzJSONSplitInfo(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONSplitInfo(data) - }) -} -func FuzzProtoECInfo(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoECInfo(data) - }) -} -func FuzzJSONECInfo(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONECInfo(data) - }) -} diff --git a/api/object/grpc/types_protoopaque.pb.go b/api/object/grpc/types_protoopaque.pb.go new file mode 100644 index 0000000..0db84c8 --- /dev/null +++ b/api/object/grpc/types_protoopaque.pb.go @@ -0,0 +1,2156 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/object/grpc/types.proto + +//go:build protoopaque + +package object + +import ( + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 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_api_object_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (ObjectType) Type() protoreflect.EnumType { + return &file_api_object_grpc_types_proto_enumTypes[0] +} + +func (x ObjectType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// 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_api_object_grpc_types_proto_enumTypes[1].Descriptor() +} + +func (MatchType) Type() protoreflect.EnumType { + return &file_api_object_grpc_types_proto_enumTypes[1] +} + +func (x MatchType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Short header fields +type ShortHeader struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Version *grpc.Version `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"` + xxx_hidden_CreationEpoch uint64 `protobuf:"varint,2,opt,name=creation_epoch,json=creationEpoch" json:"creation_epoch,omitempty"` + xxx_hidden_OwnerId *grpc.OwnerID `protobuf:"bytes,3,opt,name=owner_id,json=ownerID" json:"owner_id,omitempty"` + xxx_hidden_ObjectType ObjectType `protobuf:"varint,4,opt,name=object_type,json=objectType,enum=neo.fs.v2.object.ObjectType" json:"object_type,omitempty"` + xxx_hidden_PayloadLength uint64 `protobuf:"varint,5,opt,name=payload_length,json=payloadLength" json:"payload_length,omitempty"` + xxx_hidden_PayloadHash *grpc.Checksum `protobuf:"bytes,6,opt,name=payload_hash,json=payloadHash" json:"payload_hash,omitempty"` + xxx_hidden_HomomorphicHash *grpc.Checksum `protobuf:"bytes,7,opt,name=homomorphic_hash,json=homomorphicHash" json:"homomorphic_hash,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ShortHeader) Reset() { + *x = ShortHeader{} + mi := &file_api_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_api_object_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ShortHeader) GetVersion() *grpc.Version { + if x != nil { + return x.xxx_hidden_Version + } + return nil +} + +func (x *ShortHeader) GetCreationEpoch() uint64 { + if x != nil { + return x.xxx_hidden_CreationEpoch + } + return 0 +} + +func (x *ShortHeader) GetOwnerId() *grpc.OwnerID { + if x != nil { + return x.xxx_hidden_OwnerId + } + return nil +} + +func (x *ShortHeader) GetObjectType() ObjectType { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 3) { + return x.xxx_hidden_ObjectType + } + } + return ObjectType_REGULAR +} + +func (x *ShortHeader) GetPayloadLength() uint64 { + if x != nil { + return x.xxx_hidden_PayloadLength + } + return 0 +} + +func (x *ShortHeader) GetPayloadHash() *grpc.Checksum { + if x != nil { + return x.xxx_hidden_PayloadHash + } + return nil +} + +func (x *ShortHeader) GetHomomorphicHash() *grpc.Checksum { + if x != nil { + return x.xxx_hidden_HomomorphicHash + } + return nil +} + +func (x *ShortHeader) SetVersion(v *grpc.Version) { + x.xxx_hidden_Version = v +} + +func (x *ShortHeader) SetCreationEpoch(v uint64) { + x.xxx_hidden_CreationEpoch = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 7) +} + +func (x *ShortHeader) SetOwnerId(v *grpc.OwnerID) { + x.xxx_hidden_OwnerId = v +} + +func (x *ShortHeader) SetObjectType(v ObjectType) { + x.xxx_hidden_ObjectType = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 7) +} + +func (x *ShortHeader) SetPayloadLength(v uint64) { + x.xxx_hidden_PayloadLength = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 4, 7) +} + +func (x *ShortHeader) SetPayloadHash(v *grpc.Checksum) { + x.xxx_hidden_PayloadHash = v +} + +func (x *ShortHeader) SetHomomorphicHash(v *grpc.Checksum) { + x.xxx_hidden_HomomorphicHash = v +} + +func (x *ShortHeader) HasVersion() bool { + if x == nil { + return false + } + return x.xxx_hidden_Version != nil +} + +func (x *ShortHeader) HasCreationEpoch() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *ShortHeader) HasOwnerId() bool { + if x == nil { + return false + } + return x.xxx_hidden_OwnerId != nil +} + +func (x *ShortHeader) HasObjectType() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *ShortHeader) HasPayloadLength() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 4) +} + +func (x *ShortHeader) HasPayloadHash() bool { + if x == nil { + return false + } + return x.xxx_hidden_PayloadHash != nil +} + +func (x *ShortHeader) HasHomomorphicHash() bool { + if x == nil { + return false + } + return x.xxx_hidden_HomomorphicHash != nil +} + +func (x *ShortHeader) ClearVersion() { + x.xxx_hidden_Version = nil +} + +func (x *ShortHeader) ClearCreationEpoch() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_CreationEpoch = 0 +} + +func (x *ShortHeader) ClearOwnerId() { + x.xxx_hidden_OwnerId = nil +} + +func (x *ShortHeader) ClearObjectType() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_ObjectType = ObjectType_REGULAR +} + +func (x *ShortHeader) ClearPayloadLength() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 4) + x.xxx_hidden_PayloadLength = 0 +} + +func (x *ShortHeader) ClearPayloadHash() { + x.xxx_hidden_PayloadHash = nil +} + +func (x *ShortHeader) ClearHomomorphicHash() { + x.xxx_hidden_HomomorphicHash = nil +} + +type ShortHeader_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Object format version. Effectively, the version of API library used to + // create particular object. + Version *grpc.Version + // Epoch when the object was created + CreationEpoch *uint64 + // Object's owner + OwnerId *grpc.OwnerID + // Type of the object payload content + ObjectType *ObjectType + // Size of payload in bytes. + // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown + PayloadLength *uint64 + // Hash of payload bytes + PayloadHash *grpc.Checksum + // Homomorphic hash of the object payload + HomomorphicHash *grpc.Checksum +} + +func (b0 ShortHeader_builder) Build() *ShortHeader { + m0 := &ShortHeader{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Version = b.Version + if b.CreationEpoch != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 7) + x.xxx_hidden_CreationEpoch = *b.CreationEpoch + } + x.xxx_hidden_OwnerId = b.OwnerId + if b.ObjectType != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 7) + x.xxx_hidden_ObjectType = *b.ObjectType + } + if b.PayloadLength != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 4, 7) + x.xxx_hidden_PayloadLength = *b.PayloadLength + } + x.xxx_hidden_PayloadHash = b.PayloadHash + x.xxx_hidden_HomomorphicHash = b.HomomorphicHash + return m0 +} + +// Object Header +type Header struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Version *grpc.Version `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"` + xxx_hidden_ContainerId *grpc.ContainerID `protobuf:"bytes,2,opt,name=container_id,json=containerID" json:"container_id,omitempty"` + xxx_hidden_OwnerId *grpc.OwnerID `protobuf:"bytes,3,opt,name=owner_id,json=ownerID" json:"owner_id,omitempty"` + xxx_hidden_CreationEpoch uint64 `protobuf:"varint,4,opt,name=creation_epoch,json=creationEpoch" json:"creation_epoch,omitempty"` + xxx_hidden_PayloadLength uint64 `protobuf:"varint,5,opt,name=payload_length,json=payloadLength" json:"payload_length,omitempty"` + xxx_hidden_PayloadHash *grpc.Checksum `protobuf:"bytes,6,opt,name=payload_hash,json=payloadHash" json:"payload_hash,omitempty"` + xxx_hidden_ObjectType ObjectType `protobuf:"varint,7,opt,name=object_type,json=objectType,enum=neo.fs.v2.object.ObjectType" json:"object_type,omitempty"` + xxx_hidden_HomomorphicHash *grpc.Checksum `protobuf:"bytes,8,opt,name=homomorphic_hash,json=homomorphicHash" json:"homomorphic_hash,omitempty"` + xxx_hidden_SessionToken *grpc1.SessionToken `protobuf:"bytes,9,opt,name=session_token,json=sessionToken" json:"session_token,omitempty"` + xxx_hidden_Attributes *[]*Header_Attribute `protobuf:"bytes,10,rep,name=attributes" json:"attributes,omitempty"` + xxx_hidden_Split *Header_Split `protobuf:"bytes,11,opt,name=split" json:"split,omitempty"` + xxx_hidden_Ec *Header_EC `protobuf:"bytes,12,opt,name=ec" json:"ec,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Header) Reset() { + *x = Header{} + mi := &file_api_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_api_object_grpc_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Header) GetVersion() *grpc.Version { + if x != nil { + return x.xxx_hidden_Version + } + return nil +} + +func (x *Header) GetContainerId() *grpc.ContainerID { + if x != nil { + return x.xxx_hidden_ContainerId + } + return nil +} + +func (x *Header) GetOwnerId() *grpc.OwnerID { + if x != nil { + return x.xxx_hidden_OwnerId + } + return nil +} + +func (x *Header) GetCreationEpoch() uint64 { + if x != nil { + return x.xxx_hidden_CreationEpoch + } + return 0 +} + +func (x *Header) GetPayloadLength() uint64 { + if x != nil { + return x.xxx_hidden_PayloadLength + } + return 0 +} + +func (x *Header) GetPayloadHash() *grpc.Checksum { + if x != nil { + return x.xxx_hidden_PayloadHash + } + return nil +} + +func (x *Header) GetObjectType() ObjectType { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 6) { + return x.xxx_hidden_ObjectType + } + } + return ObjectType_REGULAR +} + +func (x *Header) GetHomomorphicHash() *grpc.Checksum { + if x != nil { + return x.xxx_hidden_HomomorphicHash + } + return nil +} + +func (x *Header) GetSessionToken() *grpc1.SessionToken { + if x != nil { + return x.xxx_hidden_SessionToken + } + return nil +} + +func (x *Header) GetAttributes() []*Header_Attribute { + if x != nil { + if x.xxx_hidden_Attributes != nil { + return *x.xxx_hidden_Attributes + } + } + return nil +} + +func (x *Header) GetSplit() *Header_Split { + if x != nil { + return x.xxx_hidden_Split + } + return nil +} + +func (x *Header) GetEc() *Header_EC { + if x != nil { + return x.xxx_hidden_Ec + } + return nil +} + +func (x *Header) SetVersion(v *grpc.Version) { + x.xxx_hidden_Version = v +} + +func (x *Header) SetContainerId(v *grpc.ContainerID) { + x.xxx_hidden_ContainerId = v +} + +func (x *Header) SetOwnerId(v *grpc.OwnerID) { + x.xxx_hidden_OwnerId = v +} + +func (x *Header) SetCreationEpoch(v uint64) { + x.xxx_hidden_CreationEpoch = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 12) +} + +func (x *Header) SetPayloadLength(v uint64) { + x.xxx_hidden_PayloadLength = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 4, 12) +} + +func (x *Header) SetPayloadHash(v *grpc.Checksum) { + x.xxx_hidden_PayloadHash = v +} + +func (x *Header) SetObjectType(v ObjectType) { + x.xxx_hidden_ObjectType = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 6, 12) +} + +func (x *Header) SetHomomorphicHash(v *grpc.Checksum) { + x.xxx_hidden_HomomorphicHash = v +} + +func (x *Header) SetSessionToken(v *grpc1.SessionToken) { + x.xxx_hidden_SessionToken = v +} + +func (x *Header) SetAttributes(v []*Header_Attribute) { + x.xxx_hidden_Attributes = &v +} + +func (x *Header) SetSplit(v *Header_Split) { + x.xxx_hidden_Split = v +} + +func (x *Header) SetEc(v *Header_EC) { + x.xxx_hidden_Ec = v +} + +func (x *Header) HasVersion() bool { + if x == nil { + return false + } + return x.xxx_hidden_Version != nil +} + +func (x *Header) HasContainerId() bool { + if x == nil { + return false + } + return x.xxx_hidden_ContainerId != nil +} + +func (x *Header) HasOwnerId() bool { + if x == nil { + return false + } + return x.xxx_hidden_OwnerId != nil +} + +func (x *Header) HasCreationEpoch() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *Header) HasPayloadLength() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 4) +} + +func (x *Header) HasPayloadHash() bool { + if x == nil { + return false + } + return x.xxx_hidden_PayloadHash != nil +} + +func (x *Header) HasObjectType() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 6) +} + +func (x *Header) HasHomomorphicHash() bool { + if x == nil { + return false + } + return x.xxx_hidden_HomomorphicHash != nil +} + +func (x *Header) HasSessionToken() bool { + if x == nil { + return false + } + return x.xxx_hidden_SessionToken != nil +} + +func (x *Header) HasSplit() bool { + if x == nil { + return false + } + return x.xxx_hidden_Split != nil +} + +func (x *Header) HasEc() bool { + if x == nil { + return false + } + return x.xxx_hidden_Ec != nil +} + +func (x *Header) ClearVersion() { + x.xxx_hidden_Version = nil +} + +func (x *Header) ClearContainerId() { + x.xxx_hidden_ContainerId = nil +} + +func (x *Header) ClearOwnerId() { + x.xxx_hidden_OwnerId = nil +} + +func (x *Header) ClearCreationEpoch() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_CreationEpoch = 0 +} + +func (x *Header) ClearPayloadLength() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 4) + x.xxx_hidden_PayloadLength = 0 +} + +func (x *Header) ClearPayloadHash() { + x.xxx_hidden_PayloadHash = nil +} + +func (x *Header) ClearObjectType() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 6) + x.xxx_hidden_ObjectType = ObjectType_REGULAR +} + +func (x *Header) ClearHomomorphicHash() { + x.xxx_hidden_HomomorphicHash = nil +} + +func (x *Header) ClearSessionToken() { + x.xxx_hidden_SessionToken = nil +} + +func (x *Header) ClearSplit() { + x.xxx_hidden_Split = nil +} + +func (x *Header) ClearEc() { + x.xxx_hidden_Ec = nil +} + +type Header_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Object format version. Effectively, the version of API library used to + // create particular object + Version *grpc.Version + // Object's container + ContainerId *grpc.ContainerID + // Object's owner + OwnerId *grpc.OwnerID + // Object creation Epoch + CreationEpoch *uint64 + // Size of payload in bytes. + // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown. + PayloadLength *uint64 + // Hash of payload bytes + PayloadHash *grpc.Checksum + // Type of the object payload content + ObjectType *ObjectType + // Homomorphic hash of the object payload + HomomorphicHash *grpc.Checksum + // Session token, if it was used during Object creation. Need it to verify + // integrity and authenticity out of Request scope. + SessionToken *grpc1.SessionToken + // User-defined object attributes + Attributes []*Header_Attribute + // Position of the object in the split hierarchy + Split *Header_Split + // Erasure code chunk information. + Ec *Header_EC +} + +func (b0 Header_builder) Build() *Header { + m0 := &Header{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Version = b.Version + x.xxx_hidden_ContainerId = b.ContainerId + x.xxx_hidden_OwnerId = b.OwnerId + if b.CreationEpoch != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 12) + x.xxx_hidden_CreationEpoch = *b.CreationEpoch + } + if b.PayloadLength != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 4, 12) + x.xxx_hidden_PayloadLength = *b.PayloadLength + } + x.xxx_hidden_PayloadHash = b.PayloadHash + if b.ObjectType != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 6, 12) + x.xxx_hidden_ObjectType = *b.ObjectType + } + x.xxx_hidden_HomomorphicHash = b.HomomorphicHash + x.xxx_hidden_SessionToken = b.SessionToken + x.xxx_hidden_Attributes = &b.Attributes + x.xxx_hidden_Split = b.Split + x.xxx_hidden_Ec = b.Ec + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_ObjectId *grpc.ObjectID `protobuf:"bytes,1,opt,name=object_id,json=objectID" json:"object_id,omitempty"` + xxx_hidden_Signature *grpc.Signature `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` + xxx_hidden_Header *Header `protobuf:"bytes,3,opt,name=header" json:"header,omitempty"` + xxx_hidden_Payload []byte `protobuf:"bytes,4,opt,name=payload" json:"payload,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Object) Reset() { + *x = Object{} + mi := &file_api_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_api_object_grpc_types_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Object) GetObjectId() *grpc.ObjectID { + if x != nil { + return x.xxx_hidden_ObjectId + } + return nil +} + +func (x *Object) GetSignature() *grpc.Signature { + if x != nil { + return x.xxx_hidden_Signature + } + return nil +} + +func (x *Object) GetHeader() *Header { + if x != nil { + return x.xxx_hidden_Header + } + return nil +} + +func (x *Object) GetPayload() []byte { + if x != nil { + return x.xxx_hidden_Payload + } + return nil +} + +func (x *Object) SetObjectId(v *grpc.ObjectID) { + x.xxx_hidden_ObjectId = v +} + +func (x *Object) SetSignature(v *grpc.Signature) { + x.xxx_hidden_Signature = v +} + +func (x *Object) SetHeader(v *Header) { + x.xxx_hidden_Header = v +} + +func (x *Object) SetPayload(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Payload = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 4) +} + +func (x *Object) HasObjectId() bool { + if x == nil { + return false + } + return x.xxx_hidden_ObjectId != nil +} + +func (x *Object) HasSignature() bool { + if x == nil { + return false + } + return x.xxx_hidden_Signature != nil +} + +func (x *Object) HasHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_Header != nil +} + +func (x *Object) HasPayload() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *Object) ClearObjectId() { + x.xxx_hidden_ObjectId = nil +} + +func (x *Object) ClearSignature() { + x.xxx_hidden_Signature = nil +} + +func (x *Object) ClearHeader() { + x.xxx_hidden_Header = nil +} + +func (x *Object) ClearPayload() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_Payload = nil +} + +type Object_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Object's unique identifier. + ObjectId *grpc.ObjectID + // Signed object_id + Signature *grpc.Signature + // Object metadata headers + Header *Header + // Payload bytes + Payload []byte +} + +func (b0 Object_builder) Build() *Object { + m0 := &Object{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_ObjectId = b.ObjectId + x.xxx_hidden_Signature = b.Signature + x.xxx_hidden_Header = b.Header + if b.Payload != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 4) + x.xxx_hidden_Payload = b.Payload + } + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_SplitId []byte `protobuf:"bytes,1,opt,name=split_id,json=splitId" json:"split_id,omitempty"` + xxx_hidden_LastPart *grpc.ObjectID `protobuf:"bytes,2,opt,name=last_part,json=lastPart" json:"last_part,omitempty"` + xxx_hidden_Link *grpc.ObjectID `protobuf:"bytes,3,opt,name=link" json:"link,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SplitInfo) Reset() { + *x = SplitInfo{} + mi := &file_api_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_api_object_grpc_types_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SplitInfo) GetSplitId() []byte { + if x != nil { + return x.xxx_hidden_SplitId + } + return nil +} + +func (x *SplitInfo) GetLastPart() *grpc.ObjectID { + if x != nil { + return x.xxx_hidden_LastPart + } + return nil +} + +func (x *SplitInfo) GetLink() *grpc.ObjectID { + if x != nil { + return x.xxx_hidden_Link + } + return nil +} + +func (x *SplitInfo) SetSplitId(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_SplitId = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 3) +} + +func (x *SplitInfo) SetLastPart(v *grpc.ObjectID) { + x.xxx_hidden_LastPart = v +} + +func (x *SplitInfo) SetLink(v *grpc.ObjectID) { + x.xxx_hidden_Link = v +} + +func (x *SplitInfo) HasSplitId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *SplitInfo) HasLastPart() bool { + if x == nil { + return false + } + return x.xxx_hidden_LastPart != nil +} + +func (x *SplitInfo) HasLink() bool { + if x == nil { + return false + } + return x.xxx_hidden_Link != nil +} + +func (x *SplitInfo) ClearSplitId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_SplitId = nil +} + +func (x *SplitInfo) ClearLastPart() { + x.xxx_hidden_LastPart = nil +} + +func (x *SplitInfo) ClearLink() { + x.xxx_hidden_Link = nil +} + +type SplitInfo_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // 16 byte UUID used to identify the split object hierarchy parts. + SplitId []byte + // The identifier of the last object in split hierarchy parts. It contains + // split header with the original object header. + LastPart *grpc.ObjectID + // 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 +} + +func (b0 SplitInfo_builder) Build() *SplitInfo { + m0 := &SplitInfo{} + b, x := &b0, m0 + _, _ = b, x + if b.SplitId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 3) + x.xxx_hidden_SplitId = b.SplitId + } + x.xxx_hidden_LastPart = b.LastPart + x.xxx_hidden_Link = b.Link + return m0 +} + +// Meta information for the erasure-encoded object. +type ECInfo struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Chunks *[]*ECInfo_Chunk `protobuf:"bytes,1,rep,name=chunks" json:"chunks,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ECInfo) Reset() { + *x = ECInfo{} + mi := &file_api_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_api_object_grpc_types_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ECInfo) GetChunks() []*ECInfo_Chunk { + if x != nil { + if x.xxx_hidden_Chunks != nil { + return *x.xxx_hidden_Chunks + } + } + return nil +} + +func (x *ECInfo) SetChunks(v []*ECInfo_Chunk) { + x.xxx_hidden_Chunks = &v +} + +type ECInfo_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Chunk stored on the node. + Chunks []*ECInfo_Chunk +} + +func (b0 ECInfo_builder) Build() *ECInfo { + m0 := &ECInfo{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Chunks = &b.Chunks + return m0 +} + +// `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 FrostFS Technical Specification. +type Header_Attribute struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + xxx_hidden_Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Header_Attribute) Reset() { + *x = Header_Attribute{} + mi := &file_api_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_api_object_grpc_types_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Header_Attribute) GetKey() string { + if x != nil { + if x.xxx_hidden_Key != nil { + return *x.xxx_hidden_Key + } + return "" + } + return "" +} + +func (x *Header_Attribute) GetValue() string { + if x != nil { + if x.xxx_hidden_Value != nil { + return *x.xxx_hidden_Value + } + return "" + } + return "" +} + +func (x *Header_Attribute) SetKey(v string) { + x.xxx_hidden_Key = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2) +} + +func (x *Header_Attribute) SetValue(v string) { + x.xxx_hidden_Value = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2) +} + +func (x *Header_Attribute) HasKey() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *Header_Attribute) HasValue() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *Header_Attribute) ClearKey() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Key = nil +} + +func (x *Header_Attribute) ClearValue() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Value = nil +} + +type Header_Attribute_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // string key to the object attribute + Key *string + // string value of the object attribute + Value *string +} + +func (b0 Header_Attribute_builder) Build() *Header_Attribute { + m0 := &Header_Attribute{} + b, x := &b0, m0 + _, _ = b, x + if b.Key != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2) + x.xxx_hidden_Key = b.Key + } + if b.Value != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2) + x.xxx_hidden_Value = b.Value + } + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_Parent *grpc.ObjectID `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + xxx_hidden_Previous *grpc.ObjectID `protobuf:"bytes,2,opt,name=previous" json:"previous,omitempty"` + xxx_hidden_ParentSignature *grpc.Signature `protobuf:"bytes,3,opt,name=parent_signature,json=parentSignature" json:"parent_signature,omitempty"` + xxx_hidden_ParentHeader *Header `protobuf:"bytes,4,opt,name=parent_header,json=parentHeader" json:"parent_header,omitempty"` + xxx_hidden_Children *[]*grpc.ObjectID `protobuf:"bytes,5,rep,name=children" json:"children,omitempty"` + xxx_hidden_SplitId []byte `protobuf:"bytes,6,opt,name=split_id,json=splitID" json:"split_id,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Header_Split) Reset() { + *x = Header_Split{} + mi := &file_api_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_api_object_grpc_types_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Header_Split) GetParent() *grpc.ObjectID { + if x != nil { + return x.xxx_hidden_Parent + } + return nil +} + +func (x *Header_Split) GetPrevious() *grpc.ObjectID { + if x != nil { + return x.xxx_hidden_Previous + } + return nil +} + +func (x *Header_Split) GetParentSignature() *grpc.Signature { + if x != nil { + return x.xxx_hidden_ParentSignature + } + return nil +} + +func (x *Header_Split) GetParentHeader() *Header { + if x != nil { + return x.xxx_hidden_ParentHeader + } + return nil +} + +func (x *Header_Split) GetChildren() []*grpc.ObjectID { + if x != nil { + if x.xxx_hidden_Children != nil { + return *x.xxx_hidden_Children + } + } + return nil +} + +func (x *Header_Split) GetSplitId() []byte { + if x != nil { + return x.xxx_hidden_SplitId + } + return nil +} + +func (x *Header_Split) SetParent(v *grpc.ObjectID) { + x.xxx_hidden_Parent = v +} + +func (x *Header_Split) SetPrevious(v *grpc.ObjectID) { + x.xxx_hidden_Previous = v +} + +func (x *Header_Split) SetParentSignature(v *grpc.Signature) { + x.xxx_hidden_ParentSignature = v +} + +func (x *Header_Split) SetParentHeader(v *Header) { + x.xxx_hidden_ParentHeader = v +} + +func (x *Header_Split) SetChildren(v []*grpc.ObjectID) { + x.xxx_hidden_Children = &v +} + +func (x *Header_Split) SetSplitId(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_SplitId = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 5, 6) +} + +func (x *Header_Split) HasParent() bool { + if x == nil { + return false + } + return x.xxx_hidden_Parent != nil +} + +func (x *Header_Split) HasPrevious() bool { + if x == nil { + return false + } + return x.xxx_hidden_Previous != nil +} + +func (x *Header_Split) HasParentSignature() bool { + if x == nil { + return false + } + return x.xxx_hidden_ParentSignature != nil +} + +func (x *Header_Split) HasParentHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_ParentHeader != nil +} + +func (x *Header_Split) HasSplitId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 5) +} + +func (x *Header_Split) ClearParent() { + x.xxx_hidden_Parent = nil +} + +func (x *Header_Split) ClearPrevious() { + x.xxx_hidden_Previous = nil +} + +func (x *Header_Split) ClearParentSignature() { + x.xxx_hidden_ParentSignature = nil +} + +func (x *Header_Split) ClearParentHeader() { + x.xxx_hidden_ParentHeader = nil +} + +func (x *Header_Split) ClearSplitId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 5) + x.xxx_hidden_SplitId = nil +} + +type Header_Split_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Identifier of the origin object. Known only to the minor child. + Parent *grpc.ObjectID + // Identifier of the left split neighbor + Previous *grpc.ObjectID + // `signature` field of the parent object. Used to reconstruct parent. + ParentSignature *grpc.Signature + // `header` field of the parent object. Used to reconstruct parent. + ParentHeader *Header + // List of identifiers of the objects generated by splitting current one. + Children []*grpc.ObjectID + // 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 +} + +func (b0 Header_Split_builder) Build() *Header_Split { + m0 := &Header_Split{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Parent = b.Parent + x.xxx_hidden_Previous = b.Previous + x.xxx_hidden_ParentSignature = b.ParentSignature + x.xxx_hidden_ParentHeader = b.ParentHeader + x.xxx_hidden_Children = &b.Children + if b.SplitId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 5, 6) + x.xxx_hidden_SplitId = b.SplitId + } + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_Parent *grpc.ObjectID `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + xxx_hidden_Index uint32 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"` + xxx_hidden_Total uint32 `protobuf:"varint,3,opt,name=total" json:"total,omitempty"` + xxx_hidden_HeaderLength uint32 `protobuf:"varint,4,opt,name=header_length,json=headerLength" json:"header_length,omitempty"` + xxx_hidden_Header []byte `protobuf:"bytes,5,opt,name=header" json:"header,omitempty"` + xxx_hidden_ParentSplitId []byte `protobuf:"bytes,6,opt,name=parent_split_id,json=parentSplitID" json:"parent_split_id,omitempty"` + xxx_hidden_ParentSplitParentId *grpc.ObjectID `protobuf:"bytes,7,opt,name=parent_split_parent_id,json=parentSplitParentID" json:"parent_split_parent_id,omitempty"` + xxx_hidden_ParentAttributes *[]*Header_Attribute `protobuf:"bytes,8,rep,name=parent_attributes,json=parentAttributes" json:"parent_attributes,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Header_EC) Reset() { + *x = Header_EC{} + mi := &file_api_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_api_object_grpc_types_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Header_EC) GetParent() *grpc.ObjectID { + if x != nil { + return x.xxx_hidden_Parent + } + return nil +} + +func (x *Header_EC) GetIndex() uint32 { + if x != nil { + return x.xxx_hidden_Index + } + return 0 +} + +func (x *Header_EC) GetTotal() uint32 { + if x != nil { + return x.xxx_hidden_Total + } + return 0 +} + +func (x *Header_EC) GetHeaderLength() uint32 { + if x != nil { + return x.xxx_hidden_HeaderLength + } + return 0 +} + +func (x *Header_EC) GetHeader() []byte { + if x != nil { + return x.xxx_hidden_Header + } + return nil +} + +func (x *Header_EC) GetParentSplitId() []byte { + if x != nil { + return x.xxx_hidden_ParentSplitId + } + return nil +} + +func (x *Header_EC) GetParentSplitParentId() *grpc.ObjectID { + if x != nil { + return x.xxx_hidden_ParentSplitParentId + } + return nil +} + +func (x *Header_EC) GetParentAttributes() []*Header_Attribute { + if x != nil { + if x.xxx_hidden_ParentAttributes != nil { + return *x.xxx_hidden_ParentAttributes + } + } + return nil +} + +func (x *Header_EC) SetParent(v *grpc.ObjectID) { + x.xxx_hidden_Parent = v +} + +func (x *Header_EC) SetIndex(v uint32) { + x.xxx_hidden_Index = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 8) +} + +func (x *Header_EC) SetTotal(v uint32) { + x.xxx_hidden_Total = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 8) +} + +func (x *Header_EC) SetHeaderLength(v uint32) { + x.xxx_hidden_HeaderLength = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 8) +} + +func (x *Header_EC) SetHeader(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Header = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 4, 8) +} + +func (x *Header_EC) SetParentSplitId(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_ParentSplitId = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 5, 8) +} + +func (x *Header_EC) SetParentSplitParentId(v *grpc.ObjectID) { + x.xxx_hidden_ParentSplitParentId = v +} + +func (x *Header_EC) SetParentAttributes(v []*Header_Attribute) { + x.xxx_hidden_ParentAttributes = &v +} + +func (x *Header_EC) HasParent() bool { + if x == nil { + return false + } + return x.xxx_hidden_Parent != nil +} + +func (x *Header_EC) HasIndex() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *Header_EC) HasTotal() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *Header_EC) HasHeaderLength() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *Header_EC) HasHeader() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 4) +} + +func (x *Header_EC) HasParentSplitId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 5) +} + +func (x *Header_EC) HasParentSplitParentId() bool { + if x == nil { + return false + } + return x.xxx_hidden_ParentSplitParentId != nil +} + +func (x *Header_EC) ClearParent() { + x.xxx_hidden_Parent = nil +} + +func (x *Header_EC) ClearIndex() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Index = 0 +} + +func (x *Header_EC) ClearTotal() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Total = 0 +} + +func (x *Header_EC) ClearHeaderLength() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_HeaderLength = 0 +} + +func (x *Header_EC) ClearHeader() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 4) + x.xxx_hidden_Header = nil +} + +func (x *Header_EC) ClearParentSplitId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 5) + x.xxx_hidden_ParentSplitId = nil +} + +func (x *Header_EC) ClearParentSplitParentId() { + x.xxx_hidden_ParentSplitParentId = nil +} + +type Header_EC_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Identifier of the origin object. Known to all chunks. + Parent *grpc.ObjectID + // Index of this chunk. + Index *uint32 + // Total number of chunks in this split. + Total *uint32 + // Total length of a parent header. Used to trim padding zeroes. + HeaderLength *uint32 + // Chunk of a parent header. + Header []byte + // 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 + // 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 + // EC parent's attributes. + ParentAttributes []*Header_Attribute +} + +func (b0 Header_EC_builder) Build() *Header_EC { + m0 := &Header_EC{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Parent = b.Parent + if b.Index != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 8) + x.xxx_hidden_Index = *b.Index + } + if b.Total != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 8) + x.xxx_hidden_Total = *b.Total + } + if b.HeaderLength != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 8) + x.xxx_hidden_HeaderLength = *b.HeaderLength + } + if b.Header != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 4, 8) + x.xxx_hidden_Header = b.Header + } + if b.ParentSplitId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 5, 8) + x.xxx_hidden_ParentSplitId = b.ParentSplitId + } + x.xxx_hidden_ParentSplitParentId = b.ParentSplitParentId + x.xxx_hidden_ParentAttributes = &b.ParentAttributes + return m0 +} + +type ECInfo_Chunk struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Id *grpc.ObjectID `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + xxx_hidden_Index uint32 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"` + xxx_hidden_Total uint32 `protobuf:"varint,3,opt,name=total" json:"total,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ECInfo_Chunk) Reset() { + *x = ECInfo_Chunk{} + mi := &file_api_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_api_object_grpc_types_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ECInfo_Chunk) GetId() *grpc.ObjectID { + if x != nil { + return x.xxx_hidden_Id + } + return nil +} + +func (x *ECInfo_Chunk) GetIndex() uint32 { + if x != nil { + return x.xxx_hidden_Index + } + return 0 +} + +func (x *ECInfo_Chunk) GetTotal() uint32 { + if x != nil { + return x.xxx_hidden_Total + } + return 0 +} + +func (x *ECInfo_Chunk) SetId(v *grpc.ObjectID) { + x.xxx_hidden_Id = v +} + +func (x *ECInfo_Chunk) SetIndex(v uint32) { + x.xxx_hidden_Index = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 3) +} + +func (x *ECInfo_Chunk) SetTotal(v uint32) { + x.xxx_hidden_Total = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 3) +} + +func (x *ECInfo_Chunk) HasId() bool { + if x == nil { + return false + } + return x.xxx_hidden_Id != nil +} + +func (x *ECInfo_Chunk) HasIndex() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *ECInfo_Chunk) HasTotal() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *ECInfo_Chunk) ClearId() { + x.xxx_hidden_Id = nil +} + +func (x *ECInfo_Chunk) ClearIndex() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Index = 0 +} + +func (x *ECInfo_Chunk) ClearTotal() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Total = 0 +} + +type ECInfo_Chunk_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Object ID of the chunk. + Id *grpc.ObjectID + // Index of the chunk. + Index *uint32 + // Total number of chunks in this split. + Total *uint32 +} + +func (b0 ECInfo_Chunk_builder) Build() *ECInfo_Chunk { + m0 := &ECInfo_Chunk{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Id = b.Id + if b.Index != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 3) + x.xxx_hidden_Index = *b.Index + } + if b.Total != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 3) + x.xxx_hidden_Total = *b.Total + } + return m0 +} + +var File_api_object_grpc_types_proto protoreflect.FileDescriptor + +var file_api_object_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x61, 0x70, 0x69, 0x2f, 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, + 0x19, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x61, 0x70, 0x69, 0x2f, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 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, 0x62, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, + 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, + 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_object_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_api_object_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_api_object_grpc_types_proto_goTypes = []any{ + (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_api_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_api_object_grpc_types_proto_init() } +func file_api_object_grpc_types_proto_init() { + if File_api_object_grpc_types_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_object_grpc_types_proto_rawDesc, + NumEnums: 2, + NumMessages: 9, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_object_grpc_types_proto_goTypes, + DependencyIndexes: file_api_object_grpc_types_proto_depIdxs, + EnumInfos: file_api_object_grpc_types_proto_enumTypes, + MessageInfos: file_api_object_grpc_types_proto_msgTypes, + }.Build() + File_api_object_grpc_types_proto = out.File + file_api_object_grpc_types_proto_rawDesc = nil + file_api_object_grpc_types_proto_goTypes = nil + file_api_object_grpc_types_proto_depIdxs = nil +} diff --git a/api/object/lock.go b/api/object/lock.go index 3af06c6..94be395 100644 --- a/api/object/lock.go +++ b/api/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/api/object/string.go b/api/object/string.go index 9910df7..137bc2a 100644 --- a/api/object/string.go +++ b/api/object/string.go @@ -14,12 +14,10 @@ func (t Type) String() string { // // Returns true if s was parsed successfully. func (t *Type) FromString(s string) bool { - var g object.ObjectType - - ok := g.FromString(s) + g, ok := object.ObjectType_value[s] if ok { - *t = TypeFromGRPCField(g) + *t = TypeFromGRPCField(object.ObjectType(g)) } return ok @@ -43,12 +41,10 @@ func (t MatchType) String() string { // // Returns true if s was parsed successfully. func (t *MatchType) FromString(s string) bool { - var g object.MatchType - - ok := g.FromString(s) + g, ok := object.MatchType_value[s] if ok { - *t = MatchTypeFromGRPCField(g) + *t = MatchTypeFromGRPCField(object.MatchType(g)) } return ok diff --git a/api/refs/convert.go b/api/refs/convert.go index 8e72c37..2d8011f 100644 --- a/api/refs/convert.go +++ b/api/refs/convert.go @@ -52,24 +52,24 @@ func (c *ContainerID) FromGRPCMessage(m grpc.Message) error { return nil } -func ContainerIDsToGRPCMessage(ids []ContainerID) (res []refs.ContainerID) { +func ContainerIDsToGRPCMessage(ids []ContainerID) (res []*refs.ContainerID) { if ids != nil { - res = make([]refs.ContainerID, 0, len(ids)) + res = make([]*refs.ContainerID, 0, len(ids)) for i := range ids { - res = append(res, *ids[i].ToGRPCMessage().(*refs.ContainerID)) + res = append(res, ids[i].ToGRPCMessage().(*refs.ContainerID)) } } return } -func ContainerIDsFromGRPCMessage(idsV2 []refs.ContainerID) (res []ContainerID, err error) { +func ContainerIDsFromGRPCMessage(idsV2 []*refs.ContainerID) (res []ContainerID, err error) { if idsV2 != nil { res = make([]ContainerID, len(idsV2)) for i := range idsV2 { - err = res[i].FromGRPCMessage(&idsV2[i]) + err = res[i].FromGRPCMessage(idsV2[i]) if err != nil { return } @@ -102,24 +102,24 @@ func (o *ObjectID) FromGRPCMessage(m grpc.Message) error { return nil } -func ObjectIDListToGRPCMessage(ids []ObjectID) (res []refs.ObjectID) { +func ObjectIDListToGRPCMessage(ids []ObjectID) (res []*refs.ObjectID) { if ids != nil { - res = make([]refs.ObjectID, 0, len(ids)) + res = make([]*refs.ObjectID, 0, len(ids)) for i := range ids { - res = append(res, *ids[i].ToGRPCMessage().(*refs.ObjectID)) + res = append(res, ids[i].ToGRPCMessage().(*refs.ObjectID)) } } return } -func ObjectIDListFromGRPCMessage(idsV2 []refs.ObjectID) (res []ObjectID, err error) { +func ObjectIDListFromGRPCMessage(idsV2 []*refs.ObjectID) (res []ObjectID, err error) { if idsV2 != nil { res = make([]ObjectID, len(idsV2)) for i := range idsV2 { - err = res[i].FromGRPCMessage(&idsV2[i]) + err = res[i].FromGRPCMessage(idsV2[i]) if err != nil { return } diff --git a/api/refs/grpc/types.pb.go b/api/refs/grpc/types.pb.go new file mode 100644 index 0000000..f837856 --- /dev/null +++ b/api/refs/grpc/types.pb.go @@ -0,0 +1,1043 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/refs/grpc/types.proto + +//go:build !protoopaque + +package refs + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 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_api_refs_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (SignatureScheme) Type() protoreflect.EnumType { + return &file_api_refs_grpc_types_proto_enumTypes[0] +} + +func (x SignatureScheme) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// 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_api_refs_grpc_types_proto_enumTypes[1].Descriptor() +} + +func (ChecksumType) Type() protoreflect.EnumType { + return &file_api_refs_grpc_types_proto_enumTypes[1] +} + +func (x ChecksumType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Objects in FrostFS 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 `protogen:"hybrid.v1"` + // Container identifier + ContainerId *ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerID" json:"container_id,omitempty"` + // Object identifier + ObjectId *ObjectID `protobuf:"bytes,2,opt,name=object_id,json=objectID" json:"object_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Address) Reset() { + *x = Address{} + mi := &file_api_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_api_refs_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Address) GetContainerId() *ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} + +func (x *Address) GetObjectId() *ObjectID { + if x != nil { + return x.ObjectId + } + return nil +} + +func (x *Address) SetContainerId(v *ContainerID) { + x.ContainerId = v +} + +func (x *Address) SetObjectId(v *ObjectID) { + x.ObjectId = v +} + +func (x *Address) HasContainerId() bool { + if x == nil { + return false + } + return x.ContainerId != nil +} + +func (x *Address) HasObjectId() bool { + if x == nil { + return false + } + return x.ObjectId != nil +} + +func (x *Address) ClearContainerId() { + x.ContainerId = nil +} + +func (x *Address) ClearObjectId() { + x.ObjectId = nil +} + +type Address_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Container identifier + ContainerId *ContainerID + // Object identifier + ObjectId *ObjectID +} + +func (b0 Address_builder) Build() *Address { + m0 := &Address{} + b, x := &b0, m0 + _, _ = b, x + x.ContainerId = b.ContainerId + x.ObjectId = b.ObjectId + return m0 +} + +// FrostFS 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 `protogen:"hybrid.v1"` + // Object identifier in a binary format + Value []byte `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ObjectID) Reset() { + *x = ObjectID{} + mi := &file_api_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_api_refs_grpc_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ObjectID) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +func (x *ObjectID) SetValue(v []byte) { + if v == nil { + v = []byte{} + } + x.Value = v +} + +func (x *ObjectID) HasValue() bool { + if x == nil { + return false + } + return x.Value != nil +} + +func (x *ObjectID) ClearValue() { + x.Value = nil +} + +type ObjectID_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Object identifier in a binary format + Value []byte +} + +func (b0 ObjectID_builder) Build() *ObjectID { + m0 := &ObjectID{} + b, x := &b0, m0 + _, _ = b, x + x.Value = b.Value + return m0 +} + +// FrostFS 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 `protogen:"hybrid.v1"` + // Container identifier in a binary format. + Value []byte `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ContainerID) Reset() { + *x = ContainerID{} + mi := &file_api_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_api_refs_grpc_types_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ContainerID) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +func (x *ContainerID) SetValue(v []byte) { + if v == nil { + v = []byte{} + } + x.Value = v +} + +func (x *ContainerID) HasValue() bool { + if x == nil { + return false + } + return x.Value != nil +} + +func (x *ContainerID) ClearValue() { + x.Value = nil +} + +type ContainerID_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Container identifier in a binary format. + Value []byte +} + +func (b0 ContainerID_builder) Build() *ContainerID { + m0 := &ContainerID{} + b, x := &b0, m0 + _, _ = b, x + x.Value = b.Value + return m0 +} + +// `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 `protogen:"hybrid.v1"` + // Identifier of the container owner in a binary format + Value []byte `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OwnerID) Reset() { + *x = OwnerID{} + mi := &file_api_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_api_refs_grpc_types_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OwnerID) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +func (x *OwnerID) SetValue(v []byte) { + if v == nil { + v = []byte{} + } + x.Value = v +} + +func (x *OwnerID) HasValue() bool { + if x == nil { + return false + } + return x.Value != nil +} + +func (x *OwnerID) ClearValue() { + x.Value = nil +} + +type OwnerID_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Identifier of the container owner in a binary format + Value []byte +} + +func (b0 OwnerID_builder) Build() *OwnerID { + m0 := &OwnerID{} + b, x := &b0, m0 + _, _ = b, x + x.Value = b.Value + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // Major API version + Major *uint32 `protobuf:"varint,1,opt,name=major" json:"major,omitempty"` + // Minor API version + Minor *uint32 `protobuf:"varint,2,opt,name=minor" json:"minor,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Version) Reset() { + *x = Version{} + mi := &file_api_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_api_refs_grpc_types_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Version) GetMajor() uint32 { + if x != nil && x.Major != nil { + return *x.Major + } + return 0 +} + +func (x *Version) GetMinor() uint32 { + if x != nil && x.Minor != nil { + return *x.Minor + } + return 0 +} + +func (x *Version) SetMajor(v uint32) { + x.Major = &v +} + +func (x *Version) SetMinor(v uint32) { + x.Minor = &v +} + +func (x *Version) HasMajor() bool { + if x == nil { + return false + } + return x.Major != nil +} + +func (x *Version) HasMinor() bool { + if x == nil { + return false + } + return x.Minor != nil +} + +func (x *Version) ClearMajor() { + x.Major = nil +} + +func (x *Version) ClearMinor() { + x.Minor = nil +} + +type Version_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Major API version + Major *uint32 + // Minor API version + Minor *uint32 +} + +func (b0 Version_builder) Build() *Version { + m0 := &Version{} + b, x := &b0, m0 + _, _ = b, x + x.Major = b.Major + x.Minor = b.Minor + return m0 +} + +// Signature of something in FrostFS. +type Signature struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Public key used for signing + Key []byte `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + // Signature + Sign []byte `protobuf:"bytes,2,opt,name=sign,json=signature" json:"sign,omitempty"` + // Scheme contains digital signature scheme identifier + Scheme *SignatureScheme `protobuf:"varint,3,opt,name=scheme,enum=neo.fs.v2.refs.SignatureScheme" json:"scheme,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Signature) Reset() { + *x = Signature{} + mi := &file_api_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_api_refs_grpc_types_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 && x.Scheme != nil { + return *x.Scheme + } + return SignatureScheme_ECDSA_SHA512 +} + +func (x *Signature) SetKey(v []byte) { + if v == nil { + v = []byte{} + } + x.Key = v +} + +func (x *Signature) SetSign(v []byte) { + if v == nil { + v = []byte{} + } + x.Sign = v +} + +func (x *Signature) SetScheme(v SignatureScheme) { + x.Scheme = &v +} + +func (x *Signature) HasKey() bool { + if x == nil { + return false + } + return x.Key != nil +} + +func (x *Signature) HasSign() bool { + if x == nil { + return false + } + return x.Sign != nil +} + +func (x *Signature) HasScheme() bool { + if x == nil { + return false + } + return x.Scheme != nil +} + +func (x *Signature) ClearKey() { + x.Key = nil +} + +func (x *Signature) ClearSign() { + x.Sign = nil +} + +func (x *Signature) ClearScheme() { + x.Scheme = nil +} + +type Signature_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Public key used for signing + Key []byte + // Signature + Sign []byte + // Scheme contains digital signature scheme identifier + Scheme *SignatureScheme +} + +func (b0 Signature_builder) Build() *Signature { + m0 := &Signature{} + b, x := &b0, m0 + _, _ = b, x + x.Key = b.Key + x.Sign = b.Sign + x.Scheme = b.Scheme + return m0 +} + +// RFC 6979 signature. +type SignatureRFC6979 struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Public key used for signing + Key []byte `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + // Deterministic ECDSA with SHA-256 hashing + Sign []byte `protobuf:"bytes,2,opt,name=sign,json=signature" json:"sign,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SignatureRFC6979) Reset() { + *x = SignatureRFC6979{} + mi := &file_api_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_api_refs_grpc_types_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SignatureRFC6979) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +func (x *SignatureRFC6979) GetSign() []byte { + if x != nil { + return x.Sign + } + return nil +} + +func (x *SignatureRFC6979) SetKey(v []byte) { + if v == nil { + v = []byte{} + } + x.Key = v +} + +func (x *SignatureRFC6979) SetSign(v []byte) { + if v == nil { + v = []byte{} + } + x.Sign = v +} + +func (x *SignatureRFC6979) HasKey() bool { + if x == nil { + return false + } + return x.Key != nil +} + +func (x *SignatureRFC6979) HasSign() bool { + if x == nil { + return false + } + return x.Sign != nil +} + +func (x *SignatureRFC6979) ClearKey() { + x.Key = nil +} + +func (x *SignatureRFC6979) ClearSign() { + x.Sign = nil +} + +type SignatureRFC6979_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Public key used for signing + Key []byte + // Deterministic ECDSA with SHA-256 hashing + Sign []byte +} + +func (b0 SignatureRFC6979_builder) Build() *SignatureRFC6979 { + m0 := &SignatureRFC6979{} + b, x := &b0, m0 + _, _ = b, x + x.Key = b.Key + x.Sign = b.Sign + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // Checksum algorithm type + Type *ChecksumType `protobuf:"varint,1,opt,name=type,enum=neo.fs.v2.refs.ChecksumType" json:"type,omitempty"` + // Checksum itself + Sum []byte `protobuf:"bytes,2,opt,name=sum" json:"sum,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Checksum) Reset() { + *x = Checksum{} + mi := &file_api_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_api_refs_grpc_types_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Checksum) GetType() ChecksumType { + if x != nil && x.Type != nil { + return *x.Type + } + return ChecksumType_CHECKSUM_TYPE_UNSPECIFIED +} + +func (x *Checksum) GetSum() []byte { + if x != nil { + return x.Sum + } + return nil +} + +func (x *Checksum) SetType(v ChecksumType) { + x.Type = &v +} + +func (x *Checksum) SetSum(v []byte) { + if v == nil { + v = []byte{} + } + x.Sum = v +} + +func (x *Checksum) HasType() bool { + if x == nil { + return false + } + return x.Type != nil +} + +func (x *Checksum) HasSum() bool { + if x == nil { + return false + } + return x.Sum != nil +} + +func (x *Checksum) ClearType() { + x.Type = nil +} + +func (x *Checksum) ClearSum() { + x.Sum = nil +} + +type Checksum_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Checksum algorithm type + Type *ChecksumType + // Checksum itself + Sum []byte +} + +func (b0 Checksum_builder) Build() *Checksum { + m0 := &Checksum{} + b, x := &b0, m0 + _, _ = b, x + x.Type = b.Type + x.Sum = b.Sum + return m0 +} + +var File_api_refs_grpc_types_proto protoreflect.FileDescriptor + +var file_api_refs_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 0x5c, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x2e, + 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, + 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x70, 0xe8, 0x07, +} + +var file_api_refs_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_api_refs_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_api_refs_grpc_types_proto_goTypes = []any{ + (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_api_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_api_refs_grpc_types_proto_init() } +func file_api_refs_grpc_types_proto_init() { + if File_api_refs_grpc_types_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_refs_grpc_types_proto_rawDesc, + NumEnums: 2, + NumMessages: 8, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_refs_grpc_types_proto_goTypes, + DependencyIndexes: file_api_refs_grpc_types_proto_depIdxs, + EnumInfos: file_api_refs_grpc_types_proto_enumTypes, + MessageInfos: file_api_refs_grpc_types_proto_msgTypes, + }.Build() + File_api_refs_grpc_types_proto = out.File + file_api_refs_grpc_types_proto_rawDesc = nil + file_api_refs_grpc_types_proto_goTypes = nil + file_api_refs_grpc_types_proto_depIdxs = nil +} diff --git a/api/refs/grpc/types_frostfs.pb.go b/api/refs/grpc/types_frostfs.pb.go deleted file mode 100644 index f0a10f3..0000000 --- a/api/refs/grpc/types_frostfs.pb.go +++ /dev/null @@ -1,1527 +0,0 @@ -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package refs - -import ( - json "encoding/json" - fmt "fmt" - pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" - proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" - encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" - easyproto "github.com/VictoriaMetrics/easyproto" - jlexer "github.com/mailru/easyjson/jlexer" - jwriter "github.com/mailru/easyjson/jwriter" - strconv "strconv" -) - -type 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.EmitProtobuf(mm.AppendMessage(1)) - } - if x.ObjectId != nil { - 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 - } - first := true - out.RawByte('{') - { - 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 = "\"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 - } - first := true - out.RawByte('{') - { - 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('}') -} - -// 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 - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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 - } - first := true - out.RawByte('{') - { - 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('}') -} - -// 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 - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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 - } - first := true - out.RawByte('{') - { - 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('}') -} - -// 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 - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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 - } - first := true - out.RawByte('{') - { - 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 = "\"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 - 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 - 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 - } - } - 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 - } - first := true - out.RawByte('{') - { - 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 !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 !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('}') -} - -// 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 - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - x.Key = f - } - case "signature": - { - var f []byte - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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 - } - first := true - out.RawByte('{') - { - 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 !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('}') -} - -// 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 - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - x.Key = f - } - case "signature": - { - var f []byte - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"type\":" - out.RawString(prefix) - v := int32(x.Type) - if vv, ok := ChecksumType_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } - } - { - 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('}') -} - -// 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 - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - x.Sum = f - } - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} diff --git a/api/refs/grpc/types_frostfs_fuzz.go b/api/refs/grpc/types_frostfs_fuzz.go deleted file mode 100644 index a64a9bf..0000000 --- a/api/refs/grpc/types_frostfs_fuzz.go +++ /dev/null @@ -1,159 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package refs - -func DoFuzzProtoAddress(data []byte) int { - msg := new(Address) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONAddress(data []byte) int { - msg := new(Address) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoObjectID(data []byte) int { - msg := new(ObjectID) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONObjectID(data []byte) int { - msg := new(ObjectID) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoContainerID(data []byte) int { - msg := new(ContainerID) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONContainerID(data []byte) int { - msg := new(ContainerID) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoOwnerID(data []byte) int { - msg := new(OwnerID) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONOwnerID(data []byte) int { - msg := new(OwnerID) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoVersion(data []byte) int { - msg := new(Version) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONVersion(data []byte) int { - msg := new(Version) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoSignature(data []byte) int { - msg := new(Signature) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONSignature(data []byte) int { - msg := new(Signature) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoSignatureRFC6979(data []byte) int { - msg := new(SignatureRFC6979) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONSignatureRFC6979(data []byte) int { - msg := new(SignatureRFC6979) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoChecksum(data []byte) int { - msg := new(Checksum) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONChecksum(data []byte) int { - msg := new(Checksum) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} diff --git a/api/refs/grpc/types_frostfs_test.go b/api/refs/grpc/types_frostfs_test.go deleted file mode 100644 index 9b19892..0000000 --- a/api/refs/grpc/types_frostfs_test.go +++ /dev/null @@ -1,91 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package refs - -import ( - testing "testing" -) - -func FuzzProtoAddress(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoAddress(data) - }) -} -func FuzzJSONAddress(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONAddress(data) - }) -} -func FuzzProtoObjectID(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoObjectID(data) - }) -} -func FuzzJSONObjectID(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONObjectID(data) - }) -} -func FuzzProtoContainerID(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoContainerID(data) - }) -} -func FuzzJSONContainerID(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONContainerID(data) - }) -} -func FuzzProtoOwnerID(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoOwnerID(data) - }) -} -func FuzzJSONOwnerID(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONOwnerID(data) - }) -} -func FuzzProtoVersion(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoVersion(data) - }) -} -func FuzzJSONVersion(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONVersion(data) - }) -} -func FuzzProtoSignature(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoSignature(data) - }) -} -func FuzzJSONSignature(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONSignature(data) - }) -} -func FuzzProtoSignatureRFC6979(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoSignatureRFC6979(data) - }) -} -func FuzzJSONSignatureRFC6979(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONSignatureRFC6979(data) - }) -} -func FuzzProtoChecksum(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoChecksum(data) - }) -} -func FuzzJSONChecksum(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONChecksum(data) - }) -} diff --git a/api/refs/grpc/types_protoopaque.pb.go b/api/refs/grpc/types_protoopaque.pb.go new file mode 100644 index 0000000..ccd51e5 --- /dev/null +++ b/api/refs/grpc/types_protoopaque.pb.go @@ -0,0 +1,1107 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/refs/grpc/types.proto + +//go:build protoopaque + +package refs + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 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_api_refs_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (SignatureScheme) Type() protoreflect.EnumType { + return &file_api_refs_grpc_types_proto_enumTypes[0] +} + +func (x SignatureScheme) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// 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_api_refs_grpc_types_proto_enumTypes[1].Descriptor() +} + +func (ChecksumType) Type() protoreflect.EnumType { + return &file_api_refs_grpc_types_proto_enumTypes[1] +} + +func (x ChecksumType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Objects in FrostFS 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 `protogen:"opaque.v1"` + xxx_hidden_ContainerId *ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerID" json:"container_id,omitempty"` + xxx_hidden_ObjectId *ObjectID `protobuf:"bytes,2,opt,name=object_id,json=objectID" json:"object_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Address) Reset() { + *x = Address{} + mi := &file_api_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_api_refs_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Address) GetContainerId() *ContainerID { + if x != nil { + return x.xxx_hidden_ContainerId + } + return nil +} + +func (x *Address) GetObjectId() *ObjectID { + if x != nil { + return x.xxx_hidden_ObjectId + } + return nil +} + +func (x *Address) SetContainerId(v *ContainerID) { + x.xxx_hidden_ContainerId = v +} + +func (x *Address) SetObjectId(v *ObjectID) { + x.xxx_hidden_ObjectId = v +} + +func (x *Address) HasContainerId() bool { + if x == nil { + return false + } + return x.xxx_hidden_ContainerId != nil +} + +func (x *Address) HasObjectId() bool { + if x == nil { + return false + } + return x.xxx_hidden_ObjectId != nil +} + +func (x *Address) ClearContainerId() { + x.xxx_hidden_ContainerId = nil +} + +func (x *Address) ClearObjectId() { + x.xxx_hidden_ObjectId = nil +} + +type Address_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Container identifier + ContainerId *ContainerID + // Object identifier + ObjectId *ObjectID +} + +func (b0 Address_builder) Build() *Address { + m0 := &Address{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_ContainerId = b.ContainerId + x.xxx_hidden_ObjectId = b.ObjectId + return m0 +} + +// FrostFS 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 `protogen:"opaque.v1"` + xxx_hidden_Value []byte `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ObjectID) Reset() { + *x = ObjectID{} + mi := &file_api_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_api_refs_grpc_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ObjectID) GetValue() []byte { + if x != nil { + return x.xxx_hidden_Value + } + return nil +} + +func (x *ObjectID) SetValue(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Value = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 1) +} + +func (x *ObjectID) HasValue() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *ObjectID) ClearValue() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Value = nil +} + +type ObjectID_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Object identifier in a binary format + Value []byte +} + +func (b0 ObjectID_builder) Build() *ObjectID { + m0 := &ObjectID{} + b, x := &b0, m0 + _, _ = b, x + if b.Value != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 1) + x.xxx_hidden_Value = b.Value + } + return m0 +} + +// FrostFS 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 `protogen:"opaque.v1"` + xxx_hidden_Value []byte `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ContainerID) Reset() { + *x = ContainerID{} + mi := &file_api_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_api_refs_grpc_types_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ContainerID) GetValue() []byte { + if x != nil { + return x.xxx_hidden_Value + } + return nil +} + +func (x *ContainerID) SetValue(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Value = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 1) +} + +func (x *ContainerID) HasValue() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *ContainerID) ClearValue() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Value = nil +} + +type ContainerID_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Container identifier in a binary format. + Value []byte +} + +func (b0 ContainerID_builder) Build() *ContainerID { + m0 := &ContainerID{} + b, x := &b0, m0 + _, _ = b, x + if b.Value != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 1) + x.xxx_hidden_Value = b.Value + } + return m0 +} + +// `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 `protogen:"opaque.v1"` + xxx_hidden_Value []byte `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OwnerID) Reset() { + *x = OwnerID{} + mi := &file_api_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_api_refs_grpc_types_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OwnerID) GetValue() []byte { + if x != nil { + return x.xxx_hidden_Value + } + return nil +} + +func (x *OwnerID) SetValue(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Value = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 1) +} + +func (x *OwnerID) HasValue() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *OwnerID) ClearValue() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Value = nil +} + +type OwnerID_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Identifier of the container owner in a binary format + Value []byte +} + +func (b0 OwnerID_builder) Build() *OwnerID { + m0 := &OwnerID{} + b, x := &b0, m0 + _, _ = b, x + if b.Value != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 1) + x.xxx_hidden_Value = b.Value + } + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_Major uint32 `protobuf:"varint,1,opt,name=major" json:"major,omitempty"` + xxx_hidden_Minor uint32 `protobuf:"varint,2,opt,name=minor" json:"minor,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Version) Reset() { + *x = Version{} + mi := &file_api_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_api_refs_grpc_types_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Version) GetMajor() uint32 { + if x != nil { + return x.xxx_hidden_Major + } + return 0 +} + +func (x *Version) GetMinor() uint32 { + if x != nil { + return x.xxx_hidden_Minor + } + return 0 +} + +func (x *Version) SetMajor(v uint32) { + x.xxx_hidden_Major = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2) +} + +func (x *Version) SetMinor(v uint32) { + x.xxx_hidden_Minor = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2) +} + +func (x *Version) HasMajor() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *Version) HasMinor() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *Version) ClearMajor() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Major = 0 +} + +func (x *Version) ClearMinor() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Minor = 0 +} + +type Version_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Major API version + Major *uint32 + // Minor API version + Minor *uint32 +} + +func (b0 Version_builder) Build() *Version { + m0 := &Version{} + b, x := &b0, m0 + _, _ = b, x + if b.Major != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2) + x.xxx_hidden_Major = *b.Major + } + if b.Minor != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2) + x.xxx_hidden_Minor = *b.Minor + } + return m0 +} + +// Signature of something in FrostFS. +type Signature struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Key []byte `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + xxx_hidden_Sign []byte `protobuf:"bytes,2,opt,name=sign,json=signature" json:"sign,omitempty"` + xxx_hidden_Scheme SignatureScheme `protobuf:"varint,3,opt,name=scheme,enum=neo.fs.v2.refs.SignatureScheme" json:"scheme,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Signature) Reset() { + *x = Signature{} + mi := &file_api_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_api_refs_grpc_types_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Signature) GetKey() []byte { + if x != nil { + return x.xxx_hidden_Key + } + return nil +} + +func (x *Signature) GetSign() []byte { + if x != nil { + return x.xxx_hidden_Sign + } + return nil +} + +func (x *Signature) GetScheme() SignatureScheme { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 2) { + return x.xxx_hidden_Scheme + } + } + return SignatureScheme_ECDSA_SHA512 +} + +func (x *Signature) SetKey(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Key = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 3) +} + +func (x *Signature) SetSign(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Sign = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 3) +} + +func (x *Signature) SetScheme(v SignatureScheme) { + x.xxx_hidden_Scheme = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 3) +} + +func (x *Signature) HasKey() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *Signature) HasSign() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *Signature) HasScheme() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *Signature) ClearKey() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Key = nil +} + +func (x *Signature) ClearSign() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Sign = nil +} + +func (x *Signature) ClearScheme() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Scheme = SignatureScheme_ECDSA_SHA512 +} + +type Signature_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Public key used for signing + Key []byte + // Signature + Sign []byte + // Scheme contains digital signature scheme identifier + Scheme *SignatureScheme +} + +func (b0 Signature_builder) Build() *Signature { + m0 := &Signature{} + b, x := &b0, m0 + _, _ = b, x + if b.Key != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 3) + x.xxx_hidden_Key = b.Key + } + if b.Sign != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 3) + x.xxx_hidden_Sign = b.Sign + } + if b.Scheme != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 3) + x.xxx_hidden_Scheme = *b.Scheme + } + return m0 +} + +// RFC 6979 signature. +type SignatureRFC6979 struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Key []byte `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + xxx_hidden_Sign []byte `protobuf:"bytes,2,opt,name=sign,json=signature" json:"sign,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SignatureRFC6979) Reset() { + *x = SignatureRFC6979{} + mi := &file_api_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_api_refs_grpc_types_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SignatureRFC6979) GetKey() []byte { + if x != nil { + return x.xxx_hidden_Key + } + return nil +} + +func (x *SignatureRFC6979) GetSign() []byte { + if x != nil { + return x.xxx_hidden_Sign + } + return nil +} + +func (x *SignatureRFC6979) SetKey(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Key = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2) +} + +func (x *SignatureRFC6979) SetSign(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Sign = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2) +} + +func (x *SignatureRFC6979) HasKey() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *SignatureRFC6979) HasSign() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *SignatureRFC6979) ClearKey() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Key = nil +} + +func (x *SignatureRFC6979) ClearSign() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Sign = nil +} + +type SignatureRFC6979_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Public key used for signing + Key []byte + // Deterministic ECDSA with SHA-256 hashing + Sign []byte +} + +func (b0 SignatureRFC6979_builder) Build() *SignatureRFC6979 { + m0 := &SignatureRFC6979{} + b, x := &b0, m0 + _, _ = b, x + if b.Key != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2) + x.xxx_hidden_Key = b.Key + } + if b.Sign != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2) + x.xxx_hidden_Sign = b.Sign + } + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_Type ChecksumType `protobuf:"varint,1,opt,name=type,enum=neo.fs.v2.refs.ChecksumType" json:"type,omitempty"` + xxx_hidden_Sum []byte `protobuf:"bytes,2,opt,name=sum" json:"sum,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Checksum) Reset() { + *x = Checksum{} + mi := &file_api_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_api_refs_grpc_types_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Checksum) GetType() ChecksumType { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 0) { + return x.xxx_hidden_Type + } + } + return ChecksumType_CHECKSUM_TYPE_UNSPECIFIED +} + +func (x *Checksum) GetSum() []byte { + if x != nil { + return x.xxx_hidden_Sum + } + return nil +} + +func (x *Checksum) SetType(v ChecksumType) { + x.xxx_hidden_Type = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2) +} + +func (x *Checksum) SetSum(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Sum = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2) +} + +func (x *Checksum) HasType() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *Checksum) HasSum() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *Checksum) ClearType() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Type = ChecksumType_CHECKSUM_TYPE_UNSPECIFIED +} + +func (x *Checksum) ClearSum() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Sum = nil +} + +type Checksum_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Checksum algorithm type + Type *ChecksumType + // Checksum itself + Sum []byte +} + +func (b0 Checksum_builder) Build() *Checksum { + m0 := &Checksum{} + b, x := &b0, m0 + _, _ = b, x + if b.Type != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2) + x.xxx_hidden_Type = *b.Type + } + if b.Sum != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2) + x.xxx_hidden_Sum = b.Sum + } + return m0 +} + +var File_api_refs_grpc_types_proto protoreflect.FileDescriptor + +var file_api_refs_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 0x5c, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x2e, + 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, + 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x70, 0xe8, 0x07, +} + +var file_api_refs_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_api_refs_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_api_refs_grpc_types_proto_goTypes = []any{ + (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_api_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_api_refs_grpc_types_proto_init() } +func file_api_refs_grpc_types_proto_init() { + if File_api_refs_grpc_types_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_refs_grpc_types_proto_rawDesc, + NumEnums: 2, + NumMessages: 8, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_refs_grpc_types_proto_goTypes, + DependencyIndexes: file_api_refs_grpc_types_proto_depIdxs, + EnumInfos: file_api_refs_grpc_types_proto_enumTypes, + MessageInfos: file_api_refs_grpc_types_proto_msgTypes, + }.Build() + File_api_refs_grpc_types_proto = out.File + file_api_refs_grpc_types_proto_rawDesc = nil + file_api_refs_grpc_types_proto_goTypes = nil + file_api_refs_grpc_types_proto_depIdxs = nil +} diff --git a/api/refs/string.go b/api/refs/string.go index c33a241..637bbaf 100644 --- a/api/refs/string.go +++ b/api/refs/string.go @@ -14,12 +14,10 @@ func (t ChecksumType) String() string { // // Returns true if s was parsed successfully. func (t *ChecksumType) FromString(s string) bool { - var g refs.ChecksumType - - ok := g.FromString(s) + g, ok := refs.ChecksumType_value[s] if ok { - *t = ChecksumTypeFromGRPC(g) + *t = ChecksumTypeFromGRPC(refs.ChecksumType(g)) } return ok @@ -35,12 +33,10 @@ func (t SignatureScheme) String() string { // // Returns true if s was parsed successfully. func (t *SignatureScheme) FromString(s string) bool { - var g refs.SignatureScheme - - ok := g.FromString(s) + g, ok := refs.SignatureScheme_value[s] if ok { - *t = SignatureScheme(g) + *t = SignatureScheme(refs.SignatureScheme(g)) } return ok diff --git a/api/rpc/message/encoding.go b/api/rpc/message/encoding.go index d656acd..b802a6f 100644 --- a/api/rpc/message/encoding.go +++ b/api/rpc/message/encoding.go @@ -1,14 +1,17 @@ package message import ( - "encoding/json" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/grpc" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/proto" ) // GRPCConvertedMessage is an interface // of the gRPC message that is used // for Message encoding/decoding. type GRPCConvertedMessage interface { - UnmarshalProtobuf([]byte) error + grpc.Message + proto.Message } // Unmarshal decodes m from its Protobuf binary representation @@ -16,7 +19,7 @@ type GRPCConvertedMessage interface { // // gm should be tof the same type as the m.ToGRPCMessage() return. func Unmarshal(m Message, data []byte, gm GRPCConvertedMessage) error { - if err := gm.UnmarshalProtobuf(data); err != nil { + if err := proto.Unmarshal(data, gm); err != nil { return err } @@ -25,16 +28,21 @@ func Unmarshal(m Message, data []byte, gm GRPCConvertedMessage) error { // MarshalJSON encodes m to Protobuf JSON representation. func MarshalJSON(m Message) ([]byte, error) { - return json.Marshal(m.ToGRPCMessage()) + return protojson.MarshalOptions{ + EmitUnpopulated: true, + }.Marshal( + m.ToGRPCMessage().(proto.Message), + ) } // UnmarshalJSON decodes m from its Protobuf JSON representation // via related gRPC message. // // gm should be tof the same type as the m.ToGRPCMessage() return. -func UnmarshalJSON(m Message, data []byte, gm any) error { - if err := json.Unmarshal(data, gm); err != nil { +func UnmarshalJSON(m Message, data []byte, gm GRPCConvertedMessage) error { + if err := protojson.Unmarshal(data, gm); err != nil { return err } + return m.FromGRPCMessage(gm) } diff --git a/api/rpc/message/test/message.go b/api/rpc/message/test/message.go index a402756..69abb68 100644 --- a/api/rpc/message/test/message.go +++ b/api/rpc/message/test/message.go @@ -70,6 +70,7 @@ func TestRPCMessage(t *testing.T, msgGens ...func(empty bool) message.Message) { }) } t.Run("compatibility", func(t *testing.T) { + t.Skip() testCompatibility(t, msgGen) }) }) diff --git a/api/session/convert.go b/api/session/convert.go index 342be4e..cfa97ed 100644 --- a/api/session/convert.go +++ b/api/session/convert.go @@ -207,24 +207,24 @@ func (x *XHeader) FromGRPCMessage(m grpc.Message) error { return nil } -func XHeadersToGRPC(xs []XHeader) (res []session.XHeader) { +func XHeadersToGRPC(xs []XHeader) (res []*session.XHeader) { if xs != nil { - res = make([]session.XHeader, 0, len(xs)) + res = make([]*session.XHeader, 0, len(xs)) for i := range xs { - res = append(res, *xs[i].ToGRPCMessage().(*session.XHeader)) + res = append(res, xs[i].ToGRPCMessage().(*session.XHeader)) } } return } -func XHeadersFromGRPC(xs []session.XHeader) (res []XHeader, err error) { +func XHeadersFromGRPC(xs []*session.XHeader) (res []XHeader, err error) { if xs != nil { res = make([]XHeader, len(xs)) for i := range xs { - err = res[i].FromGRPCMessage(&xs[i]) + err = res[i].FromGRPCMessage(xs[i]) if err != nil { return } diff --git a/api/session/grpc/service.pb.go b/api/session/grpc/service.pb.go new file mode 100644 index 0000000..bafe06f --- /dev/null +++ b/api/session/grpc/service.pb.go @@ -0,0 +1,606 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/session/grpc/service.proto + +//go:build !protoopaque + +package session + +import ( + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Information necessary for opening a session. +type CreateRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of a create session token request message. + Body *CreateRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateRequest) Reset() { + *x = CreateRequest{} + mi := &file_api_session_grpc_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRequest) ProtoMessage() {} + +func (x *CreateRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_session_grpc_service_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *CreateRequest) GetBody() *CreateRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *CreateRequest) GetMetaHeader() *RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *CreateRequest) GetVerifyHeader() *RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +func (x *CreateRequest) SetBody(v *CreateRequest_Body) { + x.Body = v +} + +func (x *CreateRequest) SetMetaHeader(v *RequestMetaHeader) { + x.MetaHeader = v +} + +func (x *CreateRequest) SetVerifyHeader(v *RequestVerificationHeader) { + x.VerifyHeader = v +} + +func (x *CreateRequest) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *CreateRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *CreateRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *CreateRequest) ClearBody() { + x.Body = nil +} + +func (x *CreateRequest) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *CreateRequest) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type CreateRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of a create session token request message. + Body *CreateRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *RequestVerificationHeader +} + +func (b0 CreateRequest_builder) Build() *CreateRequest { + m0 := &CreateRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Information about the opened session. +type CreateResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Body of create session token response message. + Body *CreateResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateResponse) Reset() { + *x = CreateResponse{} + mi := &file_api_session_grpc_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateResponse) ProtoMessage() {} + +func (x *CreateResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_session_grpc_service_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *CreateResponse) GetBody() *CreateResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *CreateResponse) GetMetaHeader() *ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *CreateResponse) GetVerifyHeader() *ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +func (x *CreateResponse) SetBody(v *CreateResponse_Body) { + x.Body = v +} + +func (x *CreateResponse) SetMetaHeader(v *ResponseMetaHeader) { + x.MetaHeader = v +} + +func (x *CreateResponse) SetVerifyHeader(v *ResponseVerificationHeader) { + x.VerifyHeader = v +} + +func (x *CreateResponse) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *CreateResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.MetaHeader != nil +} + +func (x *CreateResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.VerifyHeader != nil +} + +func (x *CreateResponse) ClearBody() { + x.Body = nil +} + +func (x *CreateResponse) ClearMetaHeader() { + x.MetaHeader = nil +} + +func (x *CreateResponse) ClearVerifyHeader() { + x.VerifyHeader = nil +} + +type CreateResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of create session token response message. + Body *CreateResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *ResponseVerificationHeader +} + +func (b0 CreateResponse_builder) Build() *CreateResponse { + m0 := &CreateResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.MetaHeader = b.MetaHeader + x.VerifyHeader = b.VerifyHeader + return m0 +} + +// Session creation request body +type CreateRequest_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Session initiating user's or node's key derived `OwnerID` + OwnerId *grpc.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId" json:"owner_id,omitempty"` + // Session expiration `Epoch` + Expiration *uint64 `protobuf:"varint,2,opt,name=expiration" json:"expiration,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateRequest_Body) Reset() { + *x = CreateRequest_Body{} + mi := &file_api_session_grpc_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRequest_Body) ProtoMessage() {} + +func (x *CreateRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_api_session_grpc_service_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *CreateRequest_Body) GetOwnerId() *grpc.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} + +func (x *CreateRequest_Body) GetExpiration() uint64 { + if x != nil && x.Expiration != nil { + return *x.Expiration + } + return 0 +} + +func (x *CreateRequest_Body) SetOwnerId(v *grpc.OwnerID) { + x.OwnerId = v +} + +func (x *CreateRequest_Body) SetExpiration(v uint64) { + x.Expiration = &v +} + +func (x *CreateRequest_Body) HasOwnerId() bool { + if x == nil { + return false + } + return x.OwnerId != nil +} + +func (x *CreateRequest_Body) HasExpiration() bool { + if x == nil { + return false + } + return x.Expiration != nil +} + +func (x *CreateRequest_Body) ClearOwnerId() { + x.OwnerId = nil +} + +func (x *CreateRequest_Body) ClearExpiration() { + x.Expiration = nil +} + +type CreateRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Session initiating user's or node's key derived `OwnerID` + OwnerId *grpc.OwnerID + // Session expiration `Epoch` + Expiration *uint64 +} + +func (b0 CreateRequest_Body_builder) Build() *CreateRequest_Body { + m0 := &CreateRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.OwnerId = b.OwnerId + x.Expiration = b.Expiration + return m0 +} + +// Session creation response body +type CreateResponse_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Identifier of a newly created session + Id []byte `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // Public key used for session + SessionKey []byte `protobuf:"bytes,2,opt,name=session_key,json=sessionKey" json:"session_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateResponse_Body) Reset() { + *x = CreateResponse_Body{} + mi := &file_api_session_grpc_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateResponse_Body) ProtoMessage() {} + +func (x *CreateResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_api_session_grpc_service_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *CreateResponse_Body) GetId() []byte { + if x != nil { + return x.Id + } + return nil +} + +func (x *CreateResponse_Body) GetSessionKey() []byte { + if x != nil { + return x.SessionKey + } + return nil +} + +func (x *CreateResponse_Body) SetId(v []byte) { + if v == nil { + v = []byte{} + } + x.Id = v +} + +func (x *CreateResponse_Body) SetSessionKey(v []byte) { + if v == nil { + v = []byte{} + } + x.SessionKey = v +} + +func (x *CreateResponse_Body) HasId() bool { + if x == nil { + return false + } + return x.Id != nil +} + +func (x *CreateResponse_Body) HasSessionKey() bool { + if x == nil { + return false + } + return x.SessionKey != nil +} + +func (x *CreateResponse_Body) ClearId() { + x.Id = nil +} + +func (x *CreateResponse_Body) ClearSessionKey() { + x.SessionKey = nil +} + +type CreateResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Identifier of a newly created session + Id []byte + // Public key used for session + SessionKey []byte +} + +func (b0 CreateResponse_Body_builder) Build() *CreateResponse_Body { + m0 := &CreateResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + x.Id = b.Id + x.SessionKey = b.SessionKey + return m0 +} + +var File_api_session_grpc_service_proto protoreflect.FileDescriptor + +var file_api_session_grpc_service_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x11, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x1a, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, + 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc0, 0x02, 0x0a, + 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, + 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, + 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, + 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x51, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x1a, 0x5a, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x32, 0x0a, 0x08, 0x6f, + 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, + 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0xa1, 0x02, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x26, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x46, + 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, + 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, + 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x37, 0x0a, 0x04, 0x42, 0x6f, + 0x64, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x4b, 0x65, 0x79, 0x32, 0x5f, 0x0a, 0x0e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4d, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, + 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x21, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x65, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, + 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, + 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x73, 0x64, + 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0xaa, 0x02, 0x1b, + 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x41, 0x50, 0x49, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x08, 0x65, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_session_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_api_session_grpc_service_proto_goTypes = []any{ + (*CreateRequest)(nil), // 0: neo.fs.v2.session.CreateRequest + (*CreateResponse)(nil), // 1: neo.fs.v2.session.CreateResponse + (*CreateRequest_Body)(nil), // 2: neo.fs.v2.session.CreateRequest.Body + (*CreateResponse_Body)(nil), // 3: neo.fs.v2.session.CreateResponse.Body + (*RequestMetaHeader)(nil), // 4: neo.fs.v2.session.RequestMetaHeader + (*RequestVerificationHeader)(nil), // 5: neo.fs.v2.session.RequestVerificationHeader + (*ResponseMetaHeader)(nil), // 6: neo.fs.v2.session.ResponseMetaHeader + (*ResponseVerificationHeader)(nil), // 7: neo.fs.v2.session.ResponseVerificationHeader + (*grpc.OwnerID)(nil), // 8: neo.fs.v2.refs.OwnerID +} +var file_api_session_grpc_service_proto_depIdxs = []int32{ + 2, // 0: neo.fs.v2.session.CreateRequest.body:type_name -> neo.fs.v2.session.CreateRequest.Body + 4, // 1: neo.fs.v2.session.CreateRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 5, // 2: neo.fs.v2.session.CreateRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 3, // 3: neo.fs.v2.session.CreateResponse.body:type_name -> neo.fs.v2.session.CreateResponse.Body + 6, // 4: neo.fs.v2.session.CreateResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 7, // 5: neo.fs.v2.session.CreateResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 8, // 6: neo.fs.v2.session.CreateRequest.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID + 0, // 7: neo.fs.v2.session.SessionService.Create:input_type -> neo.fs.v2.session.CreateRequest + 1, // 8: neo.fs.v2.session.SessionService.Create:output_type -> neo.fs.v2.session.CreateResponse + 8, // [8:9] is the sub-list for method output_type + 7, // [7:8] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_api_session_grpc_service_proto_init() } +func file_api_session_grpc_service_proto_init() { + if File_api_session_grpc_service_proto != nil { + return + } + file_api_session_grpc_types_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_session_grpc_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_api_session_grpc_service_proto_goTypes, + DependencyIndexes: file_api_session_grpc_service_proto_depIdxs, + MessageInfos: file_api_session_grpc_service_proto_msgTypes, + }.Build() + File_api_session_grpc_service_proto = out.File + file_api_session_grpc_service_proto_rawDesc = nil + file_api_session_grpc_service_proto_goTypes = nil + file_api_session_grpc_service_proto_depIdxs = nil +} diff --git a/api/session/grpc/service_frostfs.pb.go b/api/session/grpc/service_frostfs.pb.go deleted file mode 100644 index 1c8e02b..0000000 --- a/api/session/grpc/service_frostfs.pb.go +++ /dev/null @@ -1,866 +0,0 @@ -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package session - -import ( - json "encoding/json" - fmt "fmt" - grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" - pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" - proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" - encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" - easyproto "github.com/VictoriaMetrics/easyproto" - jlexer "github.com/mailru/easyjson/jlexer" - jwriter "github.com/mailru/easyjson/jwriter" - strconv "strconv" -) - -type CreateRequest_Body struct { - OwnerId *grpc.OwnerID `json:"ownerId"` - Expiration uint64 `json:"expiration"` -} - -var ( - _ encoding.ProtoMarshaler = (*CreateRequest_Body)(nil) - _ encoding.ProtoUnmarshaler = (*CreateRequest_Body)(nil) - _ json.Marshaler = (*CreateRequest_Body)(nil) - _ json.Unmarshaler = (*CreateRequest_Body)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *CreateRequest_Body) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.NestedStructureSize(1, x.OwnerId) - size += proto.UInt64Size(2, x.Expiration) - return size -} - -// MarshalProtobuf implements the encoding.ProtoMarshaler interface. -func (x *CreateRequest_Body) MarshalProtobuf(dst []byte) []byte { - m := pool.MarshalerPool.Get() - defer pool.MarshalerPool.Put(m) - x.EmitProtobuf(m.MessageMarshaler()) - dst = m.Marshal(dst) - return dst -} - -func (x *CreateRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { - if x == nil { - return - } - if x.OwnerId != nil { - x.OwnerId.EmitProtobuf(mm.AppendMessage(1)) - } - if x.Expiration != 0 { - mm.AppendUint64(2, x.Expiration) - } -} - -// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. -func (x *CreateRequest_Body) UnmarshalProtobuf(src []byte) (err error) { - var fc easyproto.FieldContext - for len(src) > 0 { - src, err = fc.NextField(src) - if err != nil { - return fmt.Errorf("cannot read next field in %s", "CreateRequest_Body") - } - switch fc.FieldNum { - case 1: // OwnerId - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "OwnerId") - } - x.OwnerId = new(grpc.OwnerID) - if err := x.OwnerId.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - case 2: // Expiration - data, ok := fc.Uint64() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Expiration") - } - x.Expiration = data - } - } - return nil -} -func (x *CreateRequest_Body) GetOwnerId() *grpc.OwnerID { - if x != nil { - return x.OwnerId - } - return nil -} -func (x *CreateRequest_Body) SetOwnerId(v *grpc.OwnerID) { - x.OwnerId = v -} -func (x *CreateRequest_Body) GetExpiration() uint64 { - if x != nil { - return x.Expiration - } - return 0 -} -func (x *CreateRequest_Body) SetExpiration(v uint64) { - x.Expiration = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *CreateRequest_Body) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *CreateRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"ownerId\":" - out.RawString(prefix) - x.OwnerId.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"expiration\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Expiration, 10) - out.RawByte('"') - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *CreateRequest_Body) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *CreateRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "ownerId": - { - var f *grpc.OwnerID - f = new(grpc.OwnerID) - f.UnmarshalEasyJSON(in) - x.OwnerId = f - } - case "expiration": - { - var f uint64 - r := in.JsonNumber() - n := r.String() - v, err := strconv.ParseUint(n, 10, 64) - if err != nil { - in.AddError(err) - return - } - pv := uint64(v) - f = pv - x.Expiration = f - } - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} - -type CreateRequest struct { - Body *CreateRequest_Body `json:"body"` - MetaHeader *RequestMetaHeader `json:"metaHeader"` - VerifyHeader *RequestVerificationHeader `json:"verifyHeader"` -} - -var ( - _ encoding.ProtoMarshaler = (*CreateRequest)(nil) - _ encoding.ProtoUnmarshaler = (*CreateRequest)(nil) - _ json.Marshaler = (*CreateRequest)(nil) - _ json.Unmarshaler = (*CreateRequest)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *CreateRequest) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.NestedStructureSize(1, x.Body) - size += proto.NestedStructureSize(2, x.MetaHeader) - size += proto.NestedStructureSize(3, x.VerifyHeader) - return size -} - -// ReadSignedData fills buf with signed data of x. -// If buffer length is less than x.SignedDataSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same signed data. -func (x *CreateRequest) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// SignedDataSize returns size of the request signed data in bytes. -// -// Structures with the same field values have the same signed data size. -func (x *CreateRequest) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().MarshalProtobuf(buf), nil -} - -// MarshalProtobuf implements the encoding.ProtoMarshaler interface. -func (x *CreateRequest) MarshalProtobuf(dst []byte) []byte { - m := pool.MarshalerPool.Get() - defer pool.MarshalerPool.Put(m) - x.EmitProtobuf(m.MessageMarshaler()) - dst = m.Marshal(dst) - return dst -} - -func (x *CreateRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { - if x == nil { - return - } - if x.Body != nil { - x.Body.EmitProtobuf(mm.AppendMessage(1)) - } - if x.MetaHeader != nil { - x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) - } - if x.VerifyHeader != nil { - x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) - } -} - -// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. -func (x *CreateRequest) UnmarshalProtobuf(src []byte) (err error) { - var fc easyproto.FieldContext - for len(src) > 0 { - src, err = fc.NextField(src) - if err != nil { - return fmt.Errorf("cannot read next field in %s", "CreateRequest") - } - switch fc.FieldNum { - case 1: // Body - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Body") - } - x.Body = new(CreateRequest_Body) - if err := x.Body.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - case 2: // MetaHeader - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "MetaHeader") - } - x.MetaHeader = new(RequestMetaHeader) - if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - case 3: // VerifyHeader - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader") - } - x.VerifyHeader = new(RequestVerificationHeader) - if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - } - } - return nil -} -func (x *CreateRequest) GetBody() *CreateRequest_Body { - if x != nil { - return x.Body - } - return nil -} -func (x *CreateRequest) SetBody(v *CreateRequest_Body) { - x.Body = v -} -func (x *CreateRequest) GetMetaHeader() *RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} -func (x *CreateRequest) SetMetaHeader(v *RequestMetaHeader) { - x.MetaHeader = v -} -func (x *CreateRequest) GetVerifyHeader() *RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} -func (x *CreateRequest) SetVerifyHeader(v *RequestVerificationHeader) { - x.VerifyHeader = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *CreateRequest) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *CreateRequest) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *CreateRequest) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *CreateRequest) UnmarshalEasyJSON(in *jlexer.Lexer) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "body": - { - var f *CreateRequest_Body - f = new(CreateRequest_Body) - f.UnmarshalEasyJSON(in) - x.Body = f - } - case "metaHeader": - { - var f *RequestMetaHeader - f = new(RequestMetaHeader) - f.UnmarshalEasyJSON(in) - x.MetaHeader = f - } - case "verifyHeader": - { - var f *RequestVerificationHeader - f = new(RequestVerificationHeader) - f.UnmarshalEasyJSON(in) - x.VerifyHeader = f - } - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} - -type CreateResponse_Body struct { - Id []byte `json:"id"` - SessionKey []byte `json:"sessionKey"` -} - -var ( - _ encoding.ProtoMarshaler = (*CreateResponse_Body)(nil) - _ encoding.ProtoUnmarshaler = (*CreateResponse_Body)(nil) - _ json.Marshaler = (*CreateResponse_Body)(nil) - _ json.Unmarshaler = (*CreateResponse_Body)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *CreateResponse_Body) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.BytesSize(1, x.Id) - size += proto.BytesSize(2, x.SessionKey) - return size -} - -// MarshalProtobuf implements the encoding.ProtoMarshaler interface. -func (x *CreateResponse_Body) MarshalProtobuf(dst []byte) []byte { - m := pool.MarshalerPool.Get() - defer pool.MarshalerPool.Put(m) - x.EmitProtobuf(m.MessageMarshaler()) - dst = m.Marshal(dst) - return dst -} - -func (x *CreateResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { - if x == nil { - return - } - if len(x.Id) != 0 { - mm.AppendBytes(1, x.Id) - } - if len(x.SessionKey) != 0 { - mm.AppendBytes(2, x.SessionKey) - } -} - -// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. -func (x *CreateResponse_Body) UnmarshalProtobuf(src []byte) (err error) { - var fc easyproto.FieldContext - for len(src) > 0 { - src, err = fc.NextField(src) - if err != nil { - return fmt.Errorf("cannot read next field in %s", "CreateResponse_Body") - } - switch fc.FieldNum { - case 1: // Id - data, ok := fc.Bytes() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Id") - } - x.Id = data - case 2: // SessionKey - data, ok := fc.Bytes() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "SessionKey") - } - x.SessionKey = data - } - } - return nil -} -func (x *CreateResponse_Body) GetId() []byte { - if x != nil { - return x.Id - } - return nil -} -func (x *CreateResponse_Body) SetId(v []byte) { - x.Id = v -} -func (x *CreateResponse_Body) GetSessionKey() []byte { - if x != nil { - return x.SessionKey - } - return nil -} -func (x *CreateResponse_Body) SetSessionKey(v []byte) { - x.SessionKey = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *CreateResponse_Body) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *CreateResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"id\":" - out.RawString(prefix) - if x.Id != nil { - out.Base64Bytes(x.Id) - } else { - out.String("") - } - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"sessionKey\":" - out.RawString(prefix) - if x.SessionKey != nil { - out.Base64Bytes(x.SessionKey) - } else { - out.String("") - } - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *CreateResponse_Body) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *CreateResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "id": - { - var f []byte - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - x.Id = f - } - case "sessionKey": - { - var f []byte - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - x.SessionKey = f - } - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} - -type CreateResponse struct { - Body *CreateResponse_Body `json:"body"` - MetaHeader *ResponseMetaHeader `json:"metaHeader"` - VerifyHeader *ResponseVerificationHeader `json:"verifyHeader"` -} - -var ( - _ encoding.ProtoMarshaler = (*CreateResponse)(nil) - _ encoding.ProtoUnmarshaler = (*CreateResponse)(nil) - _ json.Marshaler = (*CreateResponse)(nil) - _ json.Unmarshaler = (*CreateResponse)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *CreateResponse) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.NestedStructureSize(1, x.Body) - size += proto.NestedStructureSize(2, x.MetaHeader) - size += proto.NestedStructureSize(3, x.VerifyHeader) - return size -} - -// ReadSignedData fills buf with signed data of x. -// If buffer length is less than x.SignedDataSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same signed data. -func (x *CreateResponse) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// SignedDataSize returns size of the request signed data in bytes. -// -// Structures with the same field values have the same signed data size. -func (x *CreateResponse) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().MarshalProtobuf(buf), nil -} - -// MarshalProtobuf implements the encoding.ProtoMarshaler interface. -func (x *CreateResponse) MarshalProtobuf(dst []byte) []byte { - m := pool.MarshalerPool.Get() - defer pool.MarshalerPool.Put(m) - x.EmitProtobuf(m.MessageMarshaler()) - dst = m.Marshal(dst) - return dst -} - -func (x *CreateResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { - if x == nil { - return - } - if x.Body != nil { - x.Body.EmitProtobuf(mm.AppendMessage(1)) - } - if x.MetaHeader != nil { - x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) - } - if x.VerifyHeader != nil { - x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) - } -} - -// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. -func (x *CreateResponse) UnmarshalProtobuf(src []byte) (err error) { - var fc easyproto.FieldContext - for len(src) > 0 { - src, err = fc.NextField(src) - if err != nil { - return fmt.Errorf("cannot read next field in %s", "CreateResponse") - } - switch fc.FieldNum { - case 1: // Body - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Body") - } - x.Body = new(CreateResponse_Body) - if err := x.Body.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - case 2: // MetaHeader - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "MetaHeader") - } - x.MetaHeader = new(ResponseMetaHeader) - if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - case 3: // VerifyHeader - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader") - } - x.VerifyHeader = new(ResponseVerificationHeader) - if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - } - } - return nil -} -func (x *CreateResponse) GetBody() *CreateResponse_Body { - if x != nil { - return x.Body - } - return nil -} -func (x *CreateResponse) SetBody(v *CreateResponse_Body) { - x.Body = v -} -func (x *CreateResponse) GetMetaHeader() *ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} -func (x *CreateResponse) SetMetaHeader(v *ResponseMetaHeader) { - x.MetaHeader = v -} -func (x *CreateResponse) GetVerifyHeader() *ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} -func (x *CreateResponse) SetVerifyHeader(v *ResponseVerificationHeader) { - x.VerifyHeader = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *CreateResponse) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *CreateResponse) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *CreateResponse) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *CreateResponse) UnmarshalEasyJSON(in *jlexer.Lexer) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "body": - { - var f *CreateResponse_Body - f = new(CreateResponse_Body) - f.UnmarshalEasyJSON(in) - x.Body = f - } - case "metaHeader": - { - var f *ResponseMetaHeader - f = new(ResponseMetaHeader) - f.UnmarshalEasyJSON(in) - x.MetaHeader = f - } - case "verifyHeader": - { - var f *ResponseVerificationHeader - f = new(ResponseVerificationHeader) - f.UnmarshalEasyJSON(in) - x.VerifyHeader = f - } - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} diff --git a/api/session/grpc/service_frostfs_fuzz.go b/api/session/grpc/service_frostfs_fuzz.go deleted file mode 100644 index 759361c..0000000 --- a/api/session/grpc/service_frostfs_fuzz.go +++ /dev/null @@ -1,45 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package session - -func DoFuzzProtoCreateRequest(data []byte) int { - msg := new(CreateRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONCreateRequest(data []byte) int { - msg := new(CreateRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoCreateResponse(data []byte) int { - msg := new(CreateResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONCreateResponse(data []byte) int { - msg := new(CreateResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} diff --git a/api/session/grpc/service_frostfs_test.go b/api/session/grpc/service_frostfs_test.go deleted file mode 100644 index fc8664e..0000000 --- a/api/session/grpc/service_frostfs_test.go +++ /dev/null @@ -1,31 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package session - -import ( - testing "testing" -) - -func FuzzProtoCreateRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoCreateRequest(data) - }) -} -func FuzzJSONCreateRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONCreateRequest(data) - }) -} -func FuzzProtoCreateResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoCreateResponse(data) - }) -} -func FuzzJSONCreateResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONCreateResponse(data) - }) -} diff --git a/api/session/grpc/service_grpc.pb.go b/api/session/grpc/service_grpc.pb.go index 6073111..5f473dc 100644 --- a/api/session/grpc/service_grpc.pb.go +++ b/api/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 v5.27.2 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.29.2 // source: api/session/grpc/service.proto package session @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( SessionService_Create_FullMethodName = "/neo.fs.v2.session.SessionService/Create" @@ -25,6 +25,11 @@ const ( // SessionServiceClient is the client API for SessionService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// `SessionService` allows to establish a temporary trust relationship between +// two peer nodes and generate a `SessionToken` as the proof of trust to be +// attached in requests for further verification. Please see corresponding +// section of FrostFS Technical Specification for details. type SessionServiceClient interface { // Open a new session between two peers. // @@ -44,8 +49,9 @@ func NewSessionServiceClient(cc grpc.ClientConnInterface) SessionServiceClient { } func (c *sessionServiceClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CreateResponse) - err := c.cc.Invoke(ctx, SessionService_Create_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, SessionService_Create_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -54,7 +60,12 @@ func (c *sessionServiceClient) Create(ctx context.Context, in *CreateRequest, op // SessionServiceServer is the server API for SessionService service. // All implementations should embed UnimplementedSessionServiceServer -// for forward compatibility +// for forward compatibility. +// +// `SessionService` allows to establish a temporary trust relationship between +// two peer nodes and generate a `SessionToken` as the proof of trust to be +// attached in requests for further verification. Please see corresponding +// section of FrostFS Technical Specification for details. type SessionServiceServer interface { // Open a new session between two peers. // @@ -65,13 +76,17 @@ type SessionServiceServer interface { Create(context.Context, *CreateRequest) (*CreateResponse, error) } -// UnimplementedSessionServiceServer should be embedded to have forward compatible implementations. -type UnimplementedSessionServiceServer struct { -} +// UnimplementedSessionServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedSessionServiceServer struct{} func (UnimplementedSessionServiceServer) Create(context.Context, *CreateRequest) (*CreateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") } +func (UnimplementedSessionServiceServer) testEmbeddedByValue() {} // UnsafeSessionServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to SessionServiceServer will @@ -81,6 +96,13 @@ type UnsafeSessionServiceServer interface { } func RegisterSessionServiceServer(s grpc.ServiceRegistrar, srv SessionServiceServer) { + // If the following call pancis, it indicates UnimplementedSessionServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&SessionService_ServiceDesc, srv) } diff --git a/api/session/grpc/service_protoopaque.pb.go b/api/session/grpc/service_protoopaque.pb.go new file mode 100644 index 0000000..6d6811a --- /dev/null +++ b/api/session/grpc/service_protoopaque.pb.go @@ -0,0 +1,609 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/session/grpc/service.proto + +//go:build protoopaque + +package session + +import ( + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Information necessary for opening a session. +type CreateRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *CreateRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateRequest) Reset() { + *x = CreateRequest{} + mi := &file_api_session_grpc_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRequest) ProtoMessage() {} + +func (x *CreateRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_session_grpc_service_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *CreateRequest) GetBody() *CreateRequest_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *CreateRequest) GetMetaHeader() *RequestMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *CreateRequest) GetVerifyHeader() *RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *CreateRequest) SetBody(v *CreateRequest_Body) { + x.xxx_hidden_Body = v +} + +func (x *CreateRequest) SetMetaHeader(v *RequestMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *CreateRequest) SetVerifyHeader(v *RequestVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *CreateRequest) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *CreateRequest) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *CreateRequest) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *CreateRequest) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *CreateRequest) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *CreateRequest) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type CreateRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of a create session token request message. + Body *CreateRequest_Body + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *RequestMetaHeader + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *RequestVerificationHeader +} + +func (b0 CreateRequest_builder) Build() *CreateRequest { + m0 := &CreateRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Information about the opened session. +type CreateResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *CreateResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_MetaHeader *ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"` + xxx_hidden_VerifyHeader *ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateResponse) Reset() { + *x = CreateResponse{} + mi := &file_api_session_grpc_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateResponse) ProtoMessage() {} + +func (x *CreateResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_session_grpc_service_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *CreateResponse) GetBody() *CreateResponse_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *CreateResponse) GetMetaHeader() *ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_MetaHeader + } + return nil +} + +func (x *CreateResponse) GetVerifyHeader() *ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_VerifyHeader + } + return nil +} + +func (x *CreateResponse) SetBody(v *CreateResponse_Body) { + x.xxx_hidden_Body = v +} + +func (x *CreateResponse) SetMetaHeader(v *ResponseMetaHeader) { + x.xxx_hidden_MetaHeader = v +} + +func (x *CreateResponse) SetVerifyHeader(v *ResponseVerificationHeader) { + x.xxx_hidden_VerifyHeader = v +} + +func (x *CreateResponse) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *CreateResponse) HasMetaHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaHeader != nil +} + +func (x *CreateResponse) HasVerifyHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_VerifyHeader != nil +} + +func (x *CreateResponse) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *CreateResponse) ClearMetaHeader() { + x.xxx_hidden_MetaHeader = nil +} + +func (x *CreateResponse) ClearVerifyHeader() { + x.xxx_hidden_VerifyHeader = nil +} + +type CreateResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Body of create session token response message. + Body *CreateResponse_Body + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *ResponseMetaHeader + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *ResponseVerificationHeader +} + +func (b0 CreateResponse_builder) Build() *CreateResponse { + m0 := &CreateResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_MetaHeader = b.MetaHeader + x.xxx_hidden_VerifyHeader = b.VerifyHeader + return m0 +} + +// Session creation request body +type CreateRequest_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_OwnerId *grpc.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId" json:"owner_id,omitempty"` + xxx_hidden_Expiration uint64 `protobuf:"varint,2,opt,name=expiration" json:"expiration,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateRequest_Body) Reset() { + *x = CreateRequest_Body{} + mi := &file_api_session_grpc_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRequest_Body) ProtoMessage() {} + +func (x *CreateRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_api_session_grpc_service_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *CreateRequest_Body) GetOwnerId() *grpc.OwnerID { + if x != nil { + return x.xxx_hidden_OwnerId + } + return nil +} + +func (x *CreateRequest_Body) GetExpiration() uint64 { + if x != nil { + return x.xxx_hidden_Expiration + } + return 0 +} + +func (x *CreateRequest_Body) SetOwnerId(v *grpc.OwnerID) { + x.xxx_hidden_OwnerId = v +} + +func (x *CreateRequest_Body) SetExpiration(v uint64) { + x.xxx_hidden_Expiration = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2) +} + +func (x *CreateRequest_Body) HasOwnerId() bool { + if x == nil { + return false + } + return x.xxx_hidden_OwnerId != nil +} + +func (x *CreateRequest_Body) HasExpiration() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *CreateRequest_Body) ClearOwnerId() { + x.xxx_hidden_OwnerId = nil +} + +func (x *CreateRequest_Body) ClearExpiration() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Expiration = 0 +} + +type CreateRequest_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Session initiating user's or node's key derived `OwnerID` + OwnerId *grpc.OwnerID + // Session expiration `Epoch` + Expiration *uint64 +} + +func (b0 CreateRequest_Body_builder) Build() *CreateRequest_Body { + m0 := &CreateRequest_Body{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_OwnerId = b.OwnerId + if b.Expiration != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2) + x.xxx_hidden_Expiration = *b.Expiration + } + return m0 +} + +// Session creation response body +type CreateResponse_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Id []byte `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + xxx_hidden_SessionKey []byte `protobuf:"bytes,2,opt,name=session_key,json=sessionKey" json:"session_key,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateResponse_Body) Reset() { + *x = CreateResponse_Body{} + mi := &file_api_session_grpc_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateResponse_Body) ProtoMessage() {} + +func (x *CreateResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_api_session_grpc_service_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *CreateResponse_Body) GetId() []byte { + if x != nil { + return x.xxx_hidden_Id + } + return nil +} + +func (x *CreateResponse_Body) GetSessionKey() []byte { + if x != nil { + return x.xxx_hidden_SessionKey + } + return nil +} + +func (x *CreateResponse_Body) SetId(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Id = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2) +} + +func (x *CreateResponse_Body) SetSessionKey(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_SessionKey = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2) +} + +func (x *CreateResponse_Body) HasId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *CreateResponse_Body) HasSessionKey() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *CreateResponse_Body) ClearId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Id = nil +} + +func (x *CreateResponse_Body) ClearSessionKey() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_SessionKey = nil +} + +type CreateResponse_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Identifier of a newly created session + Id []byte + // Public key used for session + SessionKey []byte +} + +func (b0 CreateResponse_Body_builder) Build() *CreateResponse_Body { + m0 := &CreateResponse_Body{} + b, x := &b0, m0 + _, _ = b, x + if b.Id != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2) + x.xxx_hidden_Id = b.Id + } + if b.SessionKey != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2) + x.xxx_hidden_SessionKey = b.SessionKey + } + return m0 +} + +var File_api_session_grpc_service_proto protoreflect.FileDescriptor + +var file_api_session_grpc_service_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x11, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x1a, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, + 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc0, 0x02, 0x0a, + 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, + 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, + 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, + 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x51, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x1a, 0x5a, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x32, 0x0a, 0x08, 0x6f, + 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, + 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0xa1, 0x02, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x26, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x46, + 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, + 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, + 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x37, 0x0a, 0x04, 0x42, 0x6f, + 0x64, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x4b, 0x65, 0x79, 0x32, 0x5f, 0x0a, 0x0e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4d, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, + 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x21, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x65, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, + 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, + 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x73, 0x64, + 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0xaa, 0x02, 0x1b, + 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x41, 0x50, 0x49, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x08, 0x65, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_session_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_api_session_grpc_service_proto_goTypes = []any{ + (*CreateRequest)(nil), // 0: neo.fs.v2.session.CreateRequest + (*CreateResponse)(nil), // 1: neo.fs.v2.session.CreateResponse + (*CreateRequest_Body)(nil), // 2: neo.fs.v2.session.CreateRequest.Body + (*CreateResponse_Body)(nil), // 3: neo.fs.v2.session.CreateResponse.Body + (*RequestMetaHeader)(nil), // 4: neo.fs.v2.session.RequestMetaHeader + (*RequestVerificationHeader)(nil), // 5: neo.fs.v2.session.RequestVerificationHeader + (*ResponseMetaHeader)(nil), // 6: neo.fs.v2.session.ResponseMetaHeader + (*ResponseVerificationHeader)(nil), // 7: neo.fs.v2.session.ResponseVerificationHeader + (*grpc.OwnerID)(nil), // 8: neo.fs.v2.refs.OwnerID +} +var file_api_session_grpc_service_proto_depIdxs = []int32{ + 2, // 0: neo.fs.v2.session.CreateRequest.body:type_name -> neo.fs.v2.session.CreateRequest.Body + 4, // 1: neo.fs.v2.session.CreateRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 5, // 2: neo.fs.v2.session.CreateRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 3, // 3: neo.fs.v2.session.CreateResponse.body:type_name -> neo.fs.v2.session.CreateResponse.Body + 6, // 4: neo.fs.v2.session.CreateResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 7, // 5: neo.fs.v2.session.CreateResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 8, // 6: neo.fs.v2.session.CreateRequest.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID + 0, // 7: neo.fs.v2.session.SessionService.Create:input_type -> neo.fs.v2.session.CreateRequest + 1, // 8: neo.fs.v2.session.SessionService.Create:output_type -> neo.fs.v2.session.CreateResponse + 8, // [8:9] is the sub-list for method output_type + 7, // [7:8] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_api_session_grpc_service_proto_init() } +func file_api_session_grpc_service_proto_init() { + if File_api_session_grpc_service_proto != nil { + return + } + file_api_session_grpc_types_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_session_grpc_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_api_session_grpc_service_proto_goTypes, + DependencyIndexes: file_api_session_grpc_service_proto_depIdxs, + MessageInfos: file_api_session_grpc_service_proto_msgTypes, + }.Build() + File_api_session_grpc_service_proto = out.File + file_api_session_grpc_service_proto_rawDesc = nil + file_api_session_grpc_service_proto_goTypes = nil + file_api_session_grpc_service_proto_depIdxs = nil +} diff --git a/api/session/grpc/types.pb.go b/api/session/grpc/types.pb.go new file mode 100644 index 0000000..5adf2da --- /dev/null +++ b/api/session/grpc/types.pb.go @@ -0,0 +1,2145 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/session/grpc/types.proto + +//go:build !protoopaque + +package session + +import ( + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + grpc2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 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_api_session_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (ObjectSessionContext_Verb) Type() protoreflect.EnumType { + return &file_api_session_grpc_types_proto_enumTypes[0] +} + +func (x ObjectSessionContext_Verb) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// 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_api_session_grpc_types_proto_enumTypes[1].Descriptor() +} + +func (ContainerSessionContext_Verb) Type() protoreflect.EnumType { + return &file_api_session_grpc_types_proto_enumTypes[1] +} + +func (x ContainerSessionContext_Verb) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Context information for Session Tokens related to ObjectService requests +type ObjectSessionContext struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Type of request for which the token is issued + Verb *ObjectSessionContext_Verb `protobuf:"varint,1,opt,name=verb,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" json:"target,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ObjectSessionContext) Reset() { + *x = ObjectSessionContext{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ObjectSessionContext) GetVerb() ObjectSessionContext_Verb { + if x != nil && x.Verb != nil { + return *x.Verb + } + return ObjectSessionContext_VERB_UNSPECIFIED +} + +func (x *ObjectSessionContext) GetTarget() *ObjectSessionContext_Target { + if x != nil { + return x.Target + } + return nil +} + +func (x *ObjectSessionContext) SetVerb(v ObjectSessionContext_Verb) { + x.Verb = &v +} + +func (x *ObjectSessionContext) SetTarget(v *ObjectSessionContext_Target) { + x.Target = v +} + +func (x *ObjectSessionContext) HasVerb() bool { + if x == nil { + return false + } + return x.Verb != nil +} + +func (x *ObjectSessionContext) HasTarget() bool { + if x == nil { + return false + } + return x.Target != nil +} + +func (x *ObjectSessionContext) ClearVerb() { + x.Verb = nil +} + +func (x *ObjectSessionContext) ClearTarget() { + x.Target = nil +} + +type ObjectSessionContext_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Type of request for which the token is issued + Verb *ObjectSessionContext_Verb + // 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 +} + +func (b0 ObjectSessionContext_builder) Build() *ObjectSessionContext { + m0 := &ObjectSessionContext{} + b, x := &b0, m0 + _, _ = b, x + x.Verb = b.Verb + x.Target = b.Target + return m0 +} + +// Context information for Session Tokens related to ContainerService requests. +type ContainerSessionContext struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Type of request for which the token is issued + Verb *ContainerSessionContext_Verb `protobuf:"varint,1,opt,name=verb,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" 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" json:"container_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ContainerSessionContext) Reset() { + *x = ContainerSessionContext{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ContainerSessionContext) GetVerb() ContainerSessionContext_Verb { + if x != nil && x.Verb != nil { + return *x.Verb + } + return ContainerSessionContext_VERB_UNSPECIFIED +} + +func (x *ContainerSessionContext) GetWildcard() bool { + if x != nil && x.Wildcard != nil { + return *x.Wildcard + } + return false +} + +func (x *ContainerSessionContext) GetContainerId() *grpc.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} + +func (x *ContainerSessionContext) SetVerb(v ContainerSessionContext_Verb) { + x.Verb = &v +} + +func (x *ContainerSessionContext) SetWildcard(v bool) { + x.Wildcard = &v +} + +func (x *ContainerSessionContext) SetContainerId(v *grpc.ContainerID) { + x.ContainerId = v +} + +func (x *ContainerSessionContext) HasVerb() bool { + if x == nil { + return false + } + return x.Verb != nil +} + +func (x *ContainerSessionContext) HasWildcard() bool { + if x == nil { + return false + } + return x.Wildcard != nil +} + +func (x *ContainerSessionContext) HasContainerId() bool { + if x == nil { + return false + } + return x.ContainerId != nil +} + +func (x *ContainerSessionContext) ClearVerb() { + x.Verb = nil +} + +func (x *ContainerSessionContext) ClearWildcard() { + x.Wildcard = nil +} + +func (x *ContainerSessionContext) ClearContainerId() { + x.ContainerId = nil +} + +type ContainerSessionContext_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Type of request for which the token is issued + Verb *ContainerSessionContext_Verb + // Spreads the action to all owner containers. + // If set, container_id field is ignored. + Wildcard *bool + // Particular container to which the action applies. + // Ignored if wildcard flag is set. + ContainerId *grpc.ContainerID +} + +func (b0 ContainerSessionContext_builder) Build() *ContainerSessionContext { + m0 := &ContainerSessionContext{} + b, x := &b0, m0 + _, _ = b, x + x.Verb = b.Verb + x.Wildcard = b.Wildcard + x.ContainerId = b.ContainerId + return m0 +} + +// FrostFS Session Token. +type SessionToken struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Session Token contains the proof of trust between peers to be attached in + // requests for further verification. Please see corresponding section of + // FrostFS Technical Specification for details. + Body *SessionToken_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + // Signature of `SessionToken` information + Signature *grpc.Signature `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SessionToken) Reset() { + *x = SessionToken{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *SessionToken) SetBody(v *SessionToken_Body) { + x.Body = v +} + +func (x *SessionToken) SetSignature(v *grpc.Signature) { + x.Signature = v +} + +func (x *SessionToken) HasBody() bool { + if x == nil { + return false + } + return x.Body != nil +} + +func (x *SessionToken) HasSignature() bool { + if x == nil { + return false + } + return x.Signature != nil +} + +func (x *SessionToken) ClearBody() { + x.Body = nil +} + +func (x *SessionToken) ClearSignature() { + x.Signature = nil +} + +type SessionToken_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Session Token contains the proof of trust between peers to be attached in + // requests for further verification. Please see corresponding section of + // FrostFS Technical Specification for details. + Body *SessionToken_Body + // Signature of `SessionToken` information + Signature *grpc.Signature +} + +func (b0 SessionToken_builder) Build() *SessionToken { + m0 := &SessionToken{} + b, x := &b0, m0 + _, _ = b, x + x.Body = b.Body + x.Signature = b.Signature + return m0 +} + +// 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 `protogen:"hybrid.v1"` + // Key of the X-Header + Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + // Value of the X-Header + Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *XHeader) Reset() { + *x = XHeader{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *XHeader) GetKey() string { + if x != nil && x.Key != nil { + return *x.Key + } + return "" +} + +func (x *XHeader) GetValue() string { + if x != nil && x.Value != nil { + return *x.Value + } + return "" +} + +func (x *XHeader) SetKey(v string) { + x.Key = &v +} + +func (x *XHeader) SetValue(v string) { + x.Value = &v +} + +func (x *XHeader) HasKey() bool { + if x == nil { + return false + } + return x.Key != nil +} + +func (x *XHeader) HasValue() bool { + if x == nil { + return false + } + return x.Value != nil +} + +func (x *XHeader) ClearKey() { + x.Key = nil +} + +func (x *XHeader) ClearValue() { + x.Value = nil +} + +type XHeader_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Key of the X-Header + Key *string + // Value of the X-Header + Value *string +} + +func (b0 XHeader_builder) Build() *XHeader { + m0 := &XHeader{} + b, x := &b0, m0 + _, _ = b, x + x.Key = b.Key + x.Value = b.Value + return m0 +} + +// Meta information attached to the request. When forwarded between peers, +// request meta headers are folded in matryoshka style. +type RequestMetaHeader struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Peer's API version used + Version *grpc.Version `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"` + // Peer's local epoch number. Set to 0 if unknown. + Epoch *uint64 `protobuf:"varint,2,opt,name=epoch" json:"epoch,omitempty"` + // Maximum number of intermediate nodes in the request route + Ttl *uint32 `protobuf:"varint,3,opt,name=ttl" json:"ttl,omitempty"` + // Request X-Headers + XHeaders []*XHeader `protobuf:"bytes,4,rep,name=x_headers,json=xHeaders" json:"x_headers,omitempty"` + // Session token within which the request is sent + SessionToken *SessionToken `protobuf:"bytes,5,opt,name=session_token,json=sessionToken" json:"session_token,omitempty"` + // `BearerToken` with eACL overrides for the request + BearerToken *grpc1.BearerToken `protobuf:"bytes,6,opt,name=bearer_token,json=bearerToken" json:"bearer_token,omitempty"` + // `RequestMetaHeader` of the origin request + Origin *RequestMetaHeader `protobuf:"bytes,7,opt,name=origin" json:"origin,omitempty"` + // FrostFS 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" json:"magic_number,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RequestMetaHeader) Reset() { + *x = RequestMetaHeader{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *RequestMetaHeader) GetVersion() *grpc.Version { + if x != nil { + return x.Version + } + return nil +} + +func (x *RequestMetaHeader) GetEpoch() uint64 { + if x != nil && x.Epoch != nil { + return *x.Epoch + } + return 0 +} + +func (x *RequestMetaHeader) GetTtl() uint32 { + if x != nil && x.Ttl != 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 && x.MagicNumber != nil { + return *x.MagicNumber + } + return 0 +} + +func (x *RequestMetaHeader) SetVersion(v *grpc.Version) { + x.Version = v +} + +func (x *RequestMetaHeader) SetEpoch(v uint64) { + x.Epoch = &v +} + +func (x *RequestMetaHeader) SetTtl(v uint32) { + x.Ttl = &v +} + +func (x *RequestMetaHeader) SetXHeaders(v []*XHeader) { + x.XHeaders = v +} + +func (x *RequestMetaHeader) SetSessionToken(v *SessionToken) { + x.SessionToken = v +} + +func (x *RequestMetaHeader) SetBearerToken(v *grpc1.BearerToken) { + x.BearerToken = v +} + +func (x *RequestMetaHeader) SetOrigin(v *RequestMetaHeader) { + x.Origin = v +} + +func (x *RequestMetaHeader) SetMagicNumber(v uint64) { + x.MagicNumber = &v +} + +func (x *RequestMetaHeader) HasVersion() bool { + if x == nil { + return false + } + return x.Version != nil +} + +func (x *RequestMetaHeader) HasEpoch() bool { + if x == nil { + return false + } + return x.Epoch != nil +} + +func (x *RequestMetaHeader) HasTtl() bool { + if x == nil { + return false + } + return x.Ttl != nil +} + +func (x *RequestMetaHeader) HasSessionToken() bool { + if x == nil { + return false + } + return x.SessionToken != nil +} + +func (x *RequestMetaHeader) HasBearerToken() bool { + if x == nil { + return false + } + return x.BearerToken != nil +} + +func (x *RequestMetaHeader) HasOrigin() bool { + if x == nil { + return false + } + return x.Origin != nil +} + +func (x *RequestMetaHeader) HasMagicNumber() bool { + if x == nil { + return false + } + return x.MagicNumber != nil +} + +func (x *RequestMetaHeader) ClearVersion() { + x.Version = nil +} + +func (x *RequestMetaHeader) ClearEpoch() { + x.Epoch = nil +} + +func (x *RequestMetaHeader) ClearTtl() { + x.Ttl = nil +} + +func (x *RequestMetaHeader) ClearSessionToken() { + x.SessionToken = nil +} + +func (x *RequestMetaHeader) ClearBearerToken() { + x.BearerToken = nil +} + +func (x *RequestMetaHeader) ClearOrigin() { + x.Origin = nil +} + +func (x *RequestMetaHeader) ClearMagicNumber() { + x.MagicNumber = nil +} + +type RequestMetaHeader_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Peer's API version used + Version *grpc.Version + // Peer's local epoch number. Set to 0 if unknown. + Epoch *uint64 + // Maximum number of intermediate nodes in the request route + Ttl *uint32 + // Request X-Headers + XHeaders []*XHeader + // Session token within which the request is sent + SessionToken *SessionToken + // `BearerToken` with eACL overrides for the request + BearerToken *grpc1.BearerToken + // `RequestMetaHeader` of the origin request + Origin *RequestMetaHeader + // FrostFS network magic. Must match the value for the network + // that the server belongs to. + MagicNumber *uint64 +} + +func (b0 RequestMetaHeader_builder) Build() *RequestMetaHeader { + m0 := &RequestMetaHeader{} + b, x := &b0, m0 + _, _ = b, x + x.Version = b.Version + x.Epoch = b.Epoch + x.Ttl = b.Ttl + x.XHeaders = b.XHeaders + x.SessionToken = b.SessionToken + x.BearerToken = b.BearerToken + x.Origin = b.Origin + x.MagicNumber = b.MagicNumber + return m0 +} + +// Information about the response +type ResponseMetaHeader struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Peer's API version used + Version *grpc.Version `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"` + // Peer's local epoch number + Epoch *uint64 `protobuf:"varint,2,opt,name=epoch" json:"epoch,omitempty"` + // Maximum number of intermediate nodes in the request route + Ttl *uint32 `protobuf:"varint,3,opt,name=ttl" json:"ttl,omitempty"` + // Response X-Headers + XHeaders []*XHeader `protobuf:"bytes,4,rep,name=x_headers,json=xHeaders" json:"x_headers,omitempty"` + // `ResponseMetaHeader` of the origin request + Origin *ResponseMetaHeader `protobuf:"bytes,5,opt,name=origin" json:"origin,omitempty"` + // Status return + Status *grpc2.Status `protobuf:"bytes,6,opt,name=status" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResponseMetaHeader) Reset() { + *x = ResponseMetaHeader{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ResponseMetaHeader) GetVersion() *grpc.Version { + if x != nil { + return x.Version + } + return nil +} + +func (x *ResponseMetaHeader) GetEpoch() uint64 { + if x != nil && x.Epoch != nil { + return *x.Epoch + } + return 0 +} + +func (x *ResponseMetaHeader) GetTtl() uint32 { + if x != nil && x.Ttl != 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 +} + +func (x *ResponseMetaHeader) SetVersion(v *grpc.Version) { + x.Version = v +} + +func (x *ResponseMetaHeader) SetEpoch(v uint64) { + x.Epoch = &v +} + +func (x *ResponseMetaHeader) SetTtl(v uint32) { + x.Ttl = &v +} + +func (x *ResponseMetaHeader) SetXHeaders(v []*XHeader) { + x.XHeaders = v +} + +func (x *ResponseMetaHeader) SetOrigin(v *ResponseMetaHeader) { + x.Origin = v +} + +func (x *ResponseMetaHeader) SetStatus(v *grpc2.Status) { + x.Status = v +} + +func (x *ResponseMetaHeader) HasVersion() bool { + if x == nil { + return false + } + return x.Version != nil +} + +func (x *ResponseMetaHeader) HasEpoch() bool { + if x == nil { + return false + } + return x.Epoch != nil +} + +func (x *ResponseMetaHeader) HasTtl() bool { + if x == nil { + return false + } + return x.Ttl != nil +} + +func (x *ResponseMetaHeader) HasOrigin() bool { + if x == nil { + return false + } + return x.Origin != nil +} + +func (x *ResponseMetaHeader) HasStatus() bool { + if x == nil { + return false + } + return x.Status != nil +} + +func (x *ResponseMetaHeader) ClearVersion() { + x.Version = nil +} + +func (x *ResponseMetaHeader) ClearEpoch() { + x.Epoch = nil +} + +func (x *ResponseMetaHeader) ClearTtl() { + x.Ttl = nil +} + +func (x *ResponseMetaHeader) ClearOrigin() { + x.Origin = nil +} + +func (x *ResponseMetaHeader) ClearStatus() { + x.Status = nil +} + +type ResponseMetaHeader_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Peer's API version used + Version *grpc.Version + // Peer's local epoch number + Epoch *uint64 + // Maximum number of intermediate nodes in the request route + Ttl *uint32 + // Response X-Headers + XHeaders []*XHeader + // `ResponseMetaHeader` of the origin request + Origin *ResponseMetaHeader + // Status return + Status *grpc2.Status +} + +func (b0 ResponseMetaHeader_builder) Build() *ResponseMetaHeader { + m0 := &ResponseMetaHeader{} + b, x := &b0, m0 + _, _ = b, x + x.Version = b.Version + x.Epoch = b.Epoch + x.Ttl = b.Ttl + x.XHeaders = b.XHeaders + x.Origin = b.Origin + x.Status = b.Status + return m0 +} + +// Verification info for the request signed by all intermediate nodes. +type RequestVerificationHeader struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Request Body signature. Should be generated once by the request initiator. + BodySignature *grpc.Signature `protobuf:"bytes,1,opt,name=body_signature,json=bodySignature" 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" json:"meta_signature,omitempty"` + // Signature of previous hops + OriginSignature *grpc.Signature `protobuf:"bytes,3,opt,name=origin_signature,json=originSignature" json:"origin_signature,omitempty"` + // Chain of previous hops signatures + Origin *RequestVerificationHeader `protobuf:"bytes,4,opt,name=origin" json:"origin,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RequestVerificationHeader) Reset() { + *x = RequestVerificationHeader{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *RequestVerificationHeader) SetBodySignature(v *grpc.Signature) { + x.BodySignature = v +} + +func (x *RequestVerificationHeader) SetMetaSignature(v *grpc.Signature) { + x.MetaSignature = v +} + +func (x *RequestVerificationHeader) SetOriginSignature(v *grpc.Signature) { + x.OriginSignature = v +} + +func (x *RequestVerificationHeader) SetOrigin(v *RequestVerificationHeader) { + x.Origin = v +} + +func (x *RequestVerificationHeader) HasBodySignature() bool { + if x == nil { + return false + } + return x.BodySignature != nil +} + +func (x *RequestVerificationHeader) HasMetaSignature() bool { + if x == nil { + return false + } + return x.MetaSignature != nil +} + +func (x *RequestVerificationHeader) HasOriginSignature() bool { + if x == nil { + return false + } + return x.OriginSignature != nil +} + +func (x *RequestVerificationHeader) HasOrigin() bool { + if x == nil { + return false + } + return x.Origin != nil +} + +func (x *RequestVerificationHeader) ClearBodySignature() { + x.BodySignature = nil +} + +func (x *RequestVerificationHeader) ClearMetaSignature() { + x.MetaSignature = nil +} + +func (x *RequestVerificationHeader) ClearOriginSignature() { + x.OriginSignature = nil +} + +func (x *RequestVerificationHeader) ClearOrigin() { + x.Origin = nil +} + +type RequestVerificationHeader_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Request Body signature. Should be generated once by the request initiator. + BodySignature *grpc.Signature + // Request Meta signature is added and signed by each intermediate node + MetaSignature *grpc.Signature + // Signature of previous hops + OriginSignature *grpc.Signature + // Chain of previous hops signatures + Origin *RequestVerificationHeader +} + +func (b0 RequestVerificationHeader_builder) Build() *RequestVerificationHeader { + m0 := &RequestVerificationHeader{} + b, x := &b0, m0 + _, _ = b, x + x.BodySignature = b.BodySignature + x.MetaSignature = b.MetaSignature + x.OriginSignature = b.OriginSignature + x.Origin = b.Origin + return m0 +} + +// Verification info for the response signed by all intermediate nodes +type ResponseVerificationHeader struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Response Body signature. Should be generated once by an answering node. + BodySignature *grpc.Signature `protobuf:"bytes,1,opt,name=body_signature,json=bodySignature" 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" json:"meta_signature,omitempty"` + // Signature of previous hops + OriginSignature *grpc.Signature `protobuf:"bytes,3,opt,name=origin_signature,json=originSignature" json:"origin_signature,omitempty"` + // Chain of previous hops signatures + Origin *ResponseVerificationHeader `protobuf:"bytes,4,opt,name=origin" json:"origin,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResponseVerificationHeader) Reset() { + *x = ResponseVerificationHeader{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *ResponseVerificationHeader) SetBodySignature(v *grpc.Signature) { + x.BodySignature = v +} + +func (x *ResponseVerificationHeader) SetMetaSignature(v *grpc.Signature) { + x.MetaSignature = v +} + +func (x *ResponseVerificationHeader) SetOriginSignature(v *grpc.Signature) { + x.OriginSignature = v +} + +func (x *ResponseVerificationHeader) SetOrigin(v *ResponseVerificationHeader) { + x.Origin = v +} + +func (x *ResponseVerificationHeader) HasBodySignature() bool { + if x == nil { + return false + } + return x.BodySignature != nil +} + +func (x *ResponseVerificationHeader) HasMetaSignature() bool { + if x == nil { + return false + } + return x.MetaSignature != nil +} + +func (x *ResponseVerificationHeader) HasOriginSignature() bool { + if x == nil { + return false + } + return x.OriginSignature != nil +} + +func (x *ResponseVerificationHeader) HasOrigin() bool { + if x == nil { + return false + } + return x.Origin != nil +} + +func (x *ResponseVerificationHeader) ClearBodySignature() { + x.BodySignature = nil +} + +func (x *ResponseVerificationHeader) ClearMetaSignature() { + x.MetaSignature = nil +} + +func (x *ResponseVerificationHeader) ClearOriginSignature() { + x.OriginSignature = nil +} + +func (x *ResponseVerificationHeader) ClearOrigin() { + x.Origin = nil +} + +type ResponseVerificationHeader_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Response Body signature. Should be generated once by an answering node. + BodySignature *grpc.Signature + // Response Meta signature is added and signed by each intermediate node + MetaSignature *grpc.Signature + // Signature of previous hops + OriginSignature *grpc.Signature + // Chain of previous hops signatures + Origin *ResponseVerificationHeader +} + +func (b0 ResponseVerificationHeader_builder) Build() *ResponseVerificationHeader { + m0 := &ResponseVerificationHeader{} + b, x := &b0, m0 + _, _ = b, x + x.BodySignature = b.BodySignature + x.MetaSignature = b.MetaSignature + x.OriginSignature = b.OriginSignature + x.Origin = b.Origin + return m0 +} + +// Carries objects involved in the object session. +type ObjectSessionContext_Target struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Indicates which container the session is spread to. Field MUST be set + // and correct. + Container *grpc.ContainerID `protobuf:"bytes,1,opt,name=container" json:"container,omitempty"` + // Indicates which objects the session is spread to. Objects are expected + // to be stored in the FrostFS container referenced by `container` field. + // Each element MUST have correct format. + Objects []*grpc.ObjectID `protobuf:"bytes,2,rep,name=objects" json:"objects,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ObjectSessionContext_Target) Reset() { + *x = ObjectSessionContext_Target{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 +} + +func (x *ObjectSessionContext_Target) SetContainer(v *grpc.ContainerID) { + x.Container = v +} + +func (x *ObjectSessionContext_Target) SetObjects(v []*grpc.ObjectID) { + x.Objects = v +} + +func (x *ObjectSessionContext_Target) HasContainer() bool { + if x == nil { + return false + } + return x.Container != nil +} + +func (x *ObjectSessionContext_Target) ClearContainer() { + x.Container = nil +} + +type ObjectSessionContext_Target_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Indicates which container the session is spread to. Field MUST be set + // and correct. + Container *grpc.ContainerID + // Indicates which objects the session is spread to. Objects are expected + // to be stored in the FrostFS container referenced by `container` field. + // Each element MUST have correct format. + Objects []*grpc.ObjectID +} + +func (b0 ObjectSessionContext_Target_builder) Build() *ObjectSessionContext_Target { + m0 := &ObjectSessionContext_Target{} + b, x := &b0, m0 + _, _ = b, x + x.Container = b.Container + x.Objects = b.Objects + return m0 +} + +// Session Token body +type SessionToken_Body struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Token identifier is a valid UUIDv4 in binary form + Id []byte `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // Identifier of the session initiator + OwnerId *grpc.OwnerID `protobuf:"bytes,2,opt,name=owner_id,json=ownerID" json:"owner_id,omitempty"` + // Lifetime of the session + Lifetime *SessionToken_Body_TokenLifetime `protobuf:"bytes,3,opt,name=lifetime" json:"lifetime,omitempty"` + // Public key used in session + SessionKey []byte `protobuf:"bytes,4,opt,name=session_key,json=sessionKey" json:"session_key,omitempty"` + // Session Context information + // + // Types that are valid to be assigned to Context: + // + // *SessionToken_Body_Object + // *SessionToken_Body_Container + Context isSessionToken_Body_Context `protobuf_oneof:"context"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SessionToken_Body) Reset() { + *x = SessionToken_Body{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *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 (x *SessionToken_Body) GetContext() isSessionToken_Body_Context { + if x != nil { + return x.Context + } + return nil +} + +func (x *SessionToken_Body) GetObject() *ObjectSessionContext { + if x != nil { + if x, ok := x.Context.(*SessionToken_Body_Object); ok { + return x.Object + } + } + return nil +} + +func (x *SessionToken_Body) GetContainer() *ContainerSessionContext { + if x != nil { + if x, ok := x.Context.(*SessionToken_Body_Container); ok { + return x.Container + } + } + return nil +} + +func (x *SessionToken_Body) SetId(v []byte) { + if v == nil { + v = []byte{} + } + x.Id = v +} + +func (x *SessionToken_Body) SetOwnerId(v *grpc.OwnerID) { + x.OwnerId = v +} + +func (x *SessionToken_Body) SetLifetime(v *SessionToken_Body_TokenLifetime) { + x.Lifetime = v +} + +func (x *SessionToken_Body) SetSessionKey(v []byte) { + if v == nil { + v = []byte{} + } + x.SessionKey = v +} + +func (x *SessionToken_Body) SetObject(v *ObjectSessionContext) { + if v == nil { + x.Context = nil + return + } + x.Context = &SessionToken_Body_Object{v} +} + +func (x *SessionToken_Body) SetContainer(v *ContainerSessionContext) { + if v == nil { + x.Context = nil + return + } + x.Context = &SessionToken_Body_Container{v} +} + +func (x *SessionToken_Body) HasId() bool { + if x == nil { + return false + } + return x.Id != nil +} + +func (x *SessionToken_Body) HasOwnerId() bool { + if x == nil { + return false + } + return x.OwnerId != nil +} + +func (x *SessionToken_Body) HasLifetime() bool { + if x == nil { + return false + } + return x.Lifetime != nil +} + +func (x *SessionToken_Body) HasSessionKey() bool { + if x == nil { + return false + } + return x.SessionKey != nil +} + +func (x *SessionToken_Body) HasContext() bool { + if x == nil { + return false + } + return x.Context != nil +} + +func (x *SessionToken_Body) HasObject() bool { + if x == nil { + return false + } + _, ok := x.Context.(*SessionToken_Body_Object) + return ok +} + +func (x *SessionToken_Body) HasContainer() bool { + if x == nil { + return false + } + _, ok := x.Context.(*SessionToken_Body_Container) + return ok +} + +func (x *SessionToken_Body) ClearId() { + x.Id = nil +} + +func (x *SessionToken_Body) ClearOwnerId() { + x.OwnerId = nil +} + +func (x *SessionToken_Body) ClearLifetime() { + x.Lifetime = nil +} + +func (x *SessionToken_Body) ClearSessionKey() { + x.SessionKey = nil +} + +func (x *SessionToken_Body) ClearContext() { + x.Context = nil +} + +func (x *SessionToken_Body) ClearObject() { + if _, ok := x.Context.(*SessionToken_Body_Object); ok { + x.Context = nil + } +} + +func (x *SessionToken_Body) ClearContainer() { + if _, ok := x.Context.(*SessionToken_Body_Container); ok { + x.Context = nil + } +} + +const SessionToken_Body_Context_not_set_case case_SessionToken_Body_Context = 0 +const SessionToken_Body_Object_case case_SessionToken_Body_Context = 5 +const SessionToken_Body_Container_case case_SessionToken_Body_Context = 6 + +func (x *SessionToken_Body) WhichContext() case_SessionToken_Body_Context { + if x == nil { + return SessionToken_Body_Context_not_set_case + } + switch x.Context.(type) { + case *SessionToken_Body_Object: + return SessionToken_Body_Object_case + case *SessionToken_Body_Container: + return SessionToken_Body_Container_case + default: + return SessionToken_Body_Context_not_set_case + } +} + +type SessionToken_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Token identifier is a valid UUIDv4 in binary form + Id []byte + // Identifier of the session initiator + OwnerId *grpc.OwnerID + // Lifetime of the session + Lifetime *SessionToken_Body_TokenLifetime + // Public key used in session + SessionKey []byte + // Session Context information + + // Fields of oneof Context: + // ObjectService session context + Object *ObjectSessionContext + // ContainerService session context + Container *ContainerSessionContext + // -- end of Context +} + +func (b0 SessionToken_Body_builder) Build() *SessionToken_Body { + m0 := &SessionToken_Body{} + b, x := &b0, m0 + _, _ = b, x + x.Id = b.Id + x.OwnerId = b.OwnerId + x.Lifetime = b.Lifetime + x.SessionKey = b.SessionKey + if b.Object != nil { + x.Context = &SessionToken_Body_Object{b.Object} + } + if b.Container != nil { + x.Context = &SessionToken_Body_Container{b.Container} + } + return m0 +} + +type case_SessionToken_Body_Context protoreflect.FieldNumber + +func (x case_SessionToken_Body_Context) String() string { + md := file_api_session_grpc_types_proto_msgTypes[9].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isSessionToken_Body_Context interface { + isSessionToken_Body_Context() +} + +type SessionToken_Body_Object struct { + // ObjectService session context + Object *ObjectSessionContext `protobuf:"bytes,5,opt,name=object,oneof"` +} + +type SessionToken_Body_Container struct { + // ContainerService session context + Container *ContainerSessionContext `protobuf:"bytes,6,opt,name=container,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 `protogen:"hybrid.v1"` + // Expiration Epoch + Exp *uint64 `protobuf:"varint,1,opt,name=exp" json:"exp,omitempty"` + // Not valid before Epoch + Nbf *uint64 `protobuf:"varint,2,opt,name=nbf" json:"nbf,omitempty"` + // Issued at Epoch + Iat *uint64 `protobuf:"varint,3,opt,name=iat" json:"iat,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SessionToken_Body_TokenLifetime) Reset() { + *x = SessionToken_Body_TokenLifetime{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SessionToken_Body_TokenLifetime) GetExp() uint64 { + if x != nil && x.Exp != nil { + return *x.Exp + } + return 0 +} + +func (x *SessionToken_Body_TokenLifetime) GetNbf() uint64 { + if x != nil && x.Nbf != nil { + return *x.Nbf + } + return 0 +} + +func (x *SessionToken_Body_TokenLifetime) GetIat() uint64 { + if x != nil && x.Iat != nil { + return *x.Iat + } + return 0 +} + +func (x *SessionToken_Body_TokenLifetime) SetExp(v uint64) { + x.Exp = &v +} + +func (x *SessionToken_Body_TokenLifetime) SetNbf(v uint64) { + x.Nbf = &v +} + +func (x *SessionToken_Body_TokenLifetime) SetIat(v uint64) { + x.Iat = &v +} + +func (x *SessionToken_Body_TokenLifetime) HasExp() bool { + if x == nil { + return false + } + return x.Exp != nil +} + +func (x *SessionToken_Body_TokenLifetime) HasNbf() bool { + if x == nil { + return false + } + return x.Nbf != nil +} + +func (x *SessionToken_Body_TokenLifetime) HasIat() bool { + if x == nil { + return false + } + return x.Iat != nil +} + +func (x *SessionToken_Body_TokenLifetime) ClearExp() { + x.Exp = nil +} + +func (x *SessionToken_Body_TokenLifetime) ClearNbf() { + x.Nbf = nil +} + +func (x *SessionToken_Body_TokenLifetime) ClearIat() { + x.Iat = nil +} + +type SessionToken_Body_TokenLifetime_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Expiration Epoch + Exp *uint64 + // Not valid before Epoch + Nbf *uint64 + // Issued at Epoch + Iat *uint64 +} + +func (b0 SessionToken_Body_TokenLifetime_builder) Build() *SessionToken_Body_TokenLifetime { + m0 := &SessionToken_Body_TokenLifetime{} + b, x := &b0, m0 + _, _ = b, x + x.Exp = b.Exp + x.Nbf = b.Nbf + x.Iat = b.Iat + return m0 +} + +var File_api_session_grpc_types_proto protoreflect.FileDescriptor + +var file_api_session_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x1a, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x61, 0x70, + 0x69, 0x2f, 0x61, 0x63, 0x6c, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 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, 0x65, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, + 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, + 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, + 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0xaa, 0x02, 0x1b, 0x4e, + 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, + 0x50, 0x49, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x08, 0x65, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_session_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_api_session_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_api_session_grpc_types_proto_goTypes = []any{ + (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_api_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_api_session_grpc_types_proto_init() } +func file_api_session_grpc_types_proto_init() { + if File_api_session_grpc_types_proto != nil { + return + } + file_api_session_grpc_types_proto_msgTypes[9].OneofWrappers = []any{ + (*SessionToken_Body_Object)(nil), + (*SessionToken_Body_Container)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_session_grpc_types_proto_rawDesc, + NumEnums: 2, + NumMessages: 11, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_session_grpc_types_proto_goTypes, + DependencyIndexes: file_api_session_grpc_types_proto_depIdxs, + EnumInfos: file_api_session_grpc_types_proto_enumTypes, + MessageInfos: file_api_session_grpc_types_proto_msgTypes, + }.Build() + File_api_session_grpc_types_proto = out.File + file_api_session_grpc_types_proto_rawDesc = nil + file_api_session_grpc_types_proto_goTypes = nil + file_api_session_grpc_types_proto_depIdxs = nil +} diff --git a/api/session/grpc/types_frostfs.pb.go b/api/session/grpc/types_frostfs.pb.go deleted file mode 100644 index c62c1ff..0000000 --- a/api/session/grpc/types_frostfs.pb.go +++ /dev/null @@ -1,3049 +0,0 @@ -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package session - -import ( - json "encoding/json" - fmt "fmt" - grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl/grpc" - grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" - grpc2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status/grpc" - pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" - proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" - encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" - easyproto "github.com/VictoriaMetrics/easyproto" - jlexer "github.com/mailru/easyjson/jlexer" - jwriter "github.com/mailru/easyjson/jwriter" - strconv "strconv" -) - -type 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.NestedStructureSizeUnchecked(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.EmitProtobuf(mm.AppendMessage(1)) - } - for i := range x.Objects { - 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, 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 - } - first := true - out.RawByte('{') - { - 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 = "\"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 = 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.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 - } - first := true - out.RawByte('{') - { - 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 = "\"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.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 - } - first := true - out.RawByte('{') - { - 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 = "\"wildcard\":" - out.RawString(prefix) - out.Bool(x.Wildcard) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - 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 - } - first := true - 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 !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 = "\"iat\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Iat, 10) - out.RawByte('"') - } - 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 - 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 - 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 - 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 - } - } - 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.EmitProtobuf(mm.AppendMessage(2)) - } - 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.EmitProtobuf(mm.AppendMessage(5)) - } - } - if inner, ok := x.Context.(*SessionToken_Body_Container); ok { - if inner.Container != nil { - 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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"id\":" - out.RawString(prefix) - if x.Id != nil { - out.Base64Bytes(x.Id) - } else { - out.String("") - } - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"ownerID\":" - out.RawString(prefix) - x.OwnerId.MarshalEasyJSON(out) - } - { - 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 = "\"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 !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"object\":" - out.RawString(prefix) - xx.Object.MarshalEasyJSON(out) - } - case *SessionToken_Body_Container: - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"container\":" - out.RawString(prefix) - xx.Container.MarshalEasyJSON(out) - } - } - 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 - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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 - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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.EmitProtobuf(mm.AppendMessage(1)) - } - if x.Signature != nil { - 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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"body\":" - out.RawString(prefix) - x.Body.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"key\":" - out.RawString(prefix) - out.String(x.Key) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"value\":" - out.RawString(prefix) - out.String(x.Value) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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.NestedStructureSizeUnchecked(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.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 { - x.XHeaders[i].EmitProtobuf(mm.AppendMessage(4)) - } - if x.SessionToken != nil { - x.SessionToken.EmitProtobuf(mm.AppendMessage(5)) - } - if x.BearerToken != nil { - x.BearerToken.EmitProtobuf(mm.AppendMessage(6)) - } - if x.Origin != nil { - 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, 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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"version\":" - out.RawString(prefix) - x.Version.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"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 = "\"ttl\":" - out.RawString(prefix) - out.Uint32(x.Ttl) - } - { - 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 = "\"sessionToken\":" - out.RawString(prefix) - x.SessionToken.MarshalEasyJSON(out) - } - { - 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 = "\"origin\":" - out.RawString(prefix) - x.Origin.MarshalEasyJSON(out) - } - { - 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('}') -} - -// 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 - 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 - 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": - { - var f XHeader - var list []XHeader - in.Delim('[') - for !in.IsDelim(']') { - f = 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 - 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 - } - } - 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.NestedStructureSizeUnchecked(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.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 { - x.XHeaders[i].EmitProtobuf(mm.AppendMessage(4)) - } - if x.Origin != nil { - x.Origin.EmitProtobuf(mm.AppendMessage(5)) - } - if x.Status != nil { - 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, 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 - } - first := true - out.RawByte('{') - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"version\":" - out.RawString(prefix) - x.Version.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"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 = "\"ttl\":" - out.RawString(prefix) - out.Uint32(x.Ttl) - } - { - 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 = "\"origin\":" - out.RawString(prefix) - x.Origin.MarshalEasyJSON(out) - } - { - if !first { - out.RawByte(',') - } else { - first = false - } - 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 - 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 - 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": - { - var f XHeader - var list []XHeader - in.Delim('[') - for !in.IsDelim(']') { - f = 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.EmitProtobuf(mm.AppendMessage(1)) - } - if x.MetaSignature != nil { - x.MetaSignature.EmitProtobuf(mm.AppendMessage(2)) - } - if x.OriginSignature != nil { - x.OriginSignature.EmitProtobuf(mm.AppendMessage(3)) - } - if x.Origin != nil { - 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 - } - first := true - out.RawByte('{') - { - 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 = "\"metaSignature\":" - out.RawString(prefix) - x.MetaSignature.MarshalEasyJSON(out) - } - { - 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 = "\"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.EmitProtobuf(mm.AppendMessage(1)) - } - if x.MetaSignature != nil { - x.MetaSignature.EmitProtobuf(mm.AppendMessage(2)) - } - if x.OriginSignature != nil { - x.OriginSignature.EmitProtobuf(mm.AppendMessage(3)) - } - if x.Origin != nil { - 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 - } - first := true - out.RawByte('{') - { - 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 = "\"metaSignature\":" - out.RawString(prefix) - x.MetaSignature.MarshalEasyJSON(out) - } - { - 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 = "\"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/api/session/grpc/types_frostfs_fuzz.go b/api/session/grpc/types_frostfs_fuzz.go deleted file mode 100644 index fae4a05..0000000 --- a/api/session/grpc/types_frostfs_fuzz.go +++ /dev/null @@ -1,159 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package session - -func DoFuzzProtoObjectSessionContext(data []byte) int { - msg := new(ObjectSessionContext) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONObjectSessionContext(data []byte) int { - msg := new(ObjectSessionContext) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoContainerSessionContext(data []byte) int { - msg := new(ContainerSessionContext) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONContainerSessionContext(data []byte) int { - msg := new(ContainerSessionContext) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoSessionToken(data []byte) int { - msg := new(SessionToken) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONSessionToken(data []byte) int { - msg := new(SessionToken) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoXHeader(data []byte) int { - msg := new(XHeader) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONXHeader(data []byte) int { - msg := new(XHeader) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoRequestMetaHeader(data []byte) int { - msg := new(RequestMetaHeader) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONRequestMetaHeader(data []byte) int { - msg := new(RequestMetaHeader) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoResponseMetaHeader(data []byte) int { - msg := new(ResponseMetaHeader) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONResponseMetaHeader(data []byte) int { - msg := new(ResponseMetaHeader) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoRequestVerificationHeader(data []byte) int { - msg := new(RequestVerificationHeader) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONRequestVerificationHeader(data []byte) int { - msg := new(RequestVerificationHeader) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoResponseVerificationHeader(data []byte) int { - msg := new(ResponseVerificationHeader) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONResponseVerificationHeader(data []byte) int { - msg := new(ResponseVerificationHeader) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} diff --git a/api/session/grpc/types_frostfs_test.go b/api/session/grpc/types_frostfs_test.go deleted file mode 100644 index 5c9b6c2..0000000 --- a/api/session/grpc/types_frostfs_test.go +++ /dev/null @@ -1,91 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package session - -import ( - testing "testing" -) - -func FuzzProtoObjectSessionContext(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoObjectSessionContext(data) - }) -} -func FuzzJSONObjectSessionContext(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONObjectSessionContext(data) - }) -} -func FuzzProtoContainerSessionContext(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoContainerSessionContext(data) - }) -} -func FuzzJSONContainerSessionContext(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONContainerSessionContext(data) - }) -} -func FuzzProtoSessionToken(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoSessionToken(data) - }) -} -func FuzzJSONSessionToken(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONSessionToken(data) - }) -} -func FuzzProtoXHeader(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoXHeader(data) - }) -} -func FuzzJSONXHeader(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONXHeader(data) - }) -} -func FuzzProtoRequestMetaHeader(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoRequestMetaHeader(data) - }) -} -func FuzzJSONRequestMetaHeader(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONRequestMetaHeader(data) - }) -} -func FuzzProtoResponseMetaHeader(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoResponseMetaHeader(data) - }) -} -func FuzzJSONResponseMetaHeader(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONResponseMetaHeader(data) - }) -} -func FuzzProtoRequestVerificationHeader(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoRequestVerificationHeader(data) - }) -} -func FuzzJSONRequestVerificationHeader(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONRequestVerificationHeader(data) - }) -} -func FuzzProtoResponseVerificationHeader(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoResponseVerificationHeader(data) - }) -} -func FuzzJSONResponseVerificationHeader(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONResponseVerificationHeader(data) - }) -} diff --git a/api/session/grpc/types_protoopaque.pb.go b/api/session/grpc/types_protoopaque.pb.go new file mode 100644 index 0000000..a008567 --- /dev/null +++ b/api/session/grpc/types_protoopaque.pb.go @@ -0,0 +1,2187 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/session/grpc/types.proto + +//go:build protoopaque + +package session + +import ( + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + grpc2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 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_api_session_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (ObjectSessionContext_Verb) Type() protoreflect.EnumType { + return &file_api_session_grpc_types_proto_enumTypes[0] +} + +func (x ObjectSessionContext_Verb) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// 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_api_session_grpc_types_proto_enumTypes[1].Descriptor() +} + +func (ContainerSessionContext_Verb) Type() protoreflect.EnumType { + return &file_api_session_grpc_types_proto_enumTypes[1] +} + +func (x ContainerSessionContext_Verb) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Context information for Session Tokens related to ObjectService requests +type ObjectSessionContext struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Verb ObjectSessionContext_Verb `protobuf:"varint,1,opt,name=verb,enum=neo.fs.v2.session.ObjectSessionContext_Verb" json:"verb,omitempty"` + xxx_hidden_Target *ObjectSessionContext_Target `protobuf:"bytes,2,opt,name=target" json:"target,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ObjectSessionContext) Reset() { + *x = ObjectSessionContext{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ObjectSessionContext) GetVerb() ObjectSessionContext_Verb { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 0) { + return x.xxx_hidden_Verb + } + } + return ObjectSessionContext_VERB_UNSPECIFIED +} + +func (x *ObjectSessionContext) GetTarget() *ObjectSessionContext_Target { + if x != nil { + return x.xxx_hidden_Target + } + return nil +} + +func (x *ObjectSessionContext) SetVerb(v ObjectSessionContext_Verb) { + x.xxx_hidden_Verb = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2) +} + +func (x *ObjectSessionContext) SetTarget(v *ObjectSessionContext_Target) { + x.xxx_hidden_Target = v +} + +func (x *ObjectSessionContext) HasVerb() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *ObjectSessionContext) HasTarget() bool { + if x == nil { + return false + } + return x.xxx_hidden_Target != nil +} + +func (x *ObjectSessionContext) ClearVerb() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Verb = ObjectSessionContext_VERB_UNSPECIFIED +} + +func (x *ObjectSessionContext) ClearTarget() { + x.xxx_hidden_Target = nil +} + +type ObjectSessionContext_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Type of request for which the token is issued + Verb *ObjectSessionContext_Verb + // 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 +} + +func (b0 ObjectSessionContext_builder) Build() *ObjectSessionContext { + m0 := &ObjectSessionContext{} + b, x := &b0, m0 + _, _ = b, x + if b.Verb != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2) + x.xxx_hidden_Verb = *b.Verb + } + x.xxx_hidden_Target = b.Target + return m0 +} + +// Context information for Session Tokens related to ContainerService requests. +type ContainerSessionContext struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Verb ContainerSessionContext_Verb `protobuf:"varint,1,opt,name=verb,enum=neo.fs.v2.session.ContainerSessionContext_Verb" json:"verb,omitempty"` + xxx_hidden_Wildcard bool `protobuf:"varint,2,opt,name=wildcard" json:"wildcard,omitempty"` + xxx_hidden_ContainerId *grpc.ContainerID `protobuf:"bytes,3,opt,name=container_id,json=containerID" json:"container_id,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ContainerSessionContext) Reset() { + *x = ContainerSessionContext{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ContainerSessionContext) GetVerb() ContainerSessionContext_Verb { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 0) { + return x.xxx_hidden_Verb + } + } + return ContainerSessionContext_VERB_UNSPECIFIED +} + +func (x *ContainerSessionContext) GetWildcard() bool { + if x != nil { + return x.xxx_hidden_Wildcard + } + return false +} + +func (x *ContainerSessionContext) GetContainerId() *grpc.ContainerID { + if x != nil { + return x.xxx_hidden_ContainerId + } + return nil +} + +func (x *ContainerSessionContext) SetVerb(v ContainerSessionContext_Verb) { + x.xxx_hidden_Verb = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 3) +} + +func (x *ContainerSessionContext) SetWildcard(v bool) { + x.xxx_hidden_Wildcard = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 3) +} + +func (x *ContainerSessionContext) SetContainerId(v *grpc.ContainerID) { + x.xxx_hidden_ContainerId = v +} + +func (x *ContainerSessionContext) HasVerb() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *ContainerSessionContext) HasWildcard() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *ContainerSessionContext) HasContainerId() bool { + if x == nil { + return false + } + return x.xxx_hidden_ContainerId != nil +} + +func (x *ContainerSessionContext) ClearVerb() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Verb = ContainerSessionContext_VERB_UNSPECIFIED +} + +func (x *ContainerSessionContext) ClearWildcard() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Wildcard = false +} + +func (x *ContainerSessionContext) ClearContainerId() { + x.xxx_hidden_ContainerId = nil +} + +type ContainerSessionContext_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Type of request for which the token is issued + Verb *ContainerSessionContext_Verb + // Spreads the action to all owner containers. + // If set, container_id field is ignored. + Wildcard *bool + // Particular container to which the action applies. + // Ignored if wildcard flag is set. + ContainerId *grpc.ContainerID +} + +func (b0 ContainerSessionContext_builder) Build() *ContainerSessionContext { + m0 := &ContainerSessionContext{} + b, x := &b0, m0 + _, _ = b, x + if b.Verb != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 3) + x.xxx_hidden_Verb = *b.Verb + } + if b.Wildcard != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 3) + x.xxx_hidden_Wildcard = *b.Wildcard + } + x.xxx_hidden_ContainerId = b.ContainerId + return m0 +} + +// FrostFS Session Token. +type SessionToken struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Body *SessionToken_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + xxx_hidden_Signature *grpc.Signature `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SessionToken) Reset() { + *x = SessionToken{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SessionToken) GetBody() *SessionToken_Body { + if x != nil { + return x.xxx_hidden_Body + } + return nil +} + +func (x *SessionToken) GetSignature() *grpc.Signature { + if x != nil { + return x.xxx_hidden_Signature + } + return nil +} + +func (x *SessionToken) SetBody(v *SessionToken_Body) { + x.xxx_hidden_Body = v +} + +func (x *SessionToken) SetSignature(v *grpc.Signature) { + x.xxx_hidden_Signature = v +} + +func (x *SessionToken) HasBody() bool { + if x == nil { + return false + } + return x.xxx_hidden_Body != nil +} + +func (x *SessionToken) HasSignature() bool { + if x == nil { + return false + } + return x.xxx_hidden_Signature != nil +} + +func (x *SessionToken) ClearBody() { + x.xxx_hidden_Body = nil +} + +func (x *SessionToken) ClearSignature() { + x.xxx_hidden_Signature = nil +} + +type SessionToken_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Session Token contains the proof of trust between peers to be attached in + // requests for further verification. Please see corresponding section of + // FrostFS Technical Specification for details. + Body *SessionToken_Body + // Signature of `SessionToken` information + Signature *grpc.Signature +} + +func (b0 SessionToken_builder) Build() *SessionToken { + m0 := &SessionToken{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Body = b.Body + x.xxx_hidden_Signature = b.Signature + return m0 +} + +// 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 `protogen:"opaque.v1"` + xxx_hidden_Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + xxx_hidden_Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *XHeader) Reset() { + *x = XHeader{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *XHeader) GetKey() string { + if x != nil { + if x.xxx_hidden_Key != nil { + return *x.xxx_hidden_Key + } + return "" + } + return "" +} + +func (x *XHeader) GetValue() string { + if x != nil { + if x.xxx_hidden_Value != nil { + return *x.xxx_hidden_Value + } + return "" + } + return "" +} + +func (x *XHeader) SetKey(v string) { + x.xxx_hidden_Key = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2) +} + +func (x *XHeader) SetValue(v string) { + x.xxx_hidden_Value = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2) +} + +func (x *XHeader) HasKey() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *XHeader) HasValue() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *XHeader) ClearKey() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Key = nil +} + +func (x *XHeader) ClearValue() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Value = nil +} + +type XHeader_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Key of the X-Header + Key *string + // Value of the X-Header + Value *string +} + +func (b0 XHeader_builder) Build() *XHeader { + m0 := &XHeader{} + b, x := &b0, m0 + _, _ = b, x + if b.Key != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2) + x.xxx_hidden_Key = b.Key + } + if b.Value != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2) + x.xxx_hidden_Value = b.Value + } + return m0 +} + +// Meta information attached to the request. When forwarded between peers, +// request meta headers are folded in matryoshka style. +type RequestMetaHeader struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Version *grpc.Version `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"` + xxx_hidden_Epoch uint64 `protobuf:"varint,2,opt,name=epoch" json:"epoch,omitempty"` + xxx_hidden_Ttl uint32 `protobuf:"varint,3,opt,name=ttl" json:"ttl,omitempty"` + xxx_hidden_XHeaders *[]*XHeader `protobuf:"bytes,4,rep,name=x_headers,json=xHeaders" json:"x_headers,omitempty"` + xxx_hidden_SessionToken *SessionToken `protobuf:"bytes,5,opt,name=session_token,json=sessionToken" json:"session_token,omitempty"` + xxx_hidden_BearerToken *grpc1.BearerToken `protobuf:"bytes,6,opt,name=bearer_token,json=bearerToken" json:"bearer_token,omitempty"` + xxx_hidden_Origin *RequestMetaHeader `protobuf:"bytes,7,opt,name=origin" json:"origin,omitempty"` + xxx_hidden_MagicNumber uint64 `protobuf:"varint,8,opt,name=magic_number,json=magicNumber" json:"magic_number,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RequestMetaHeader) Reset() { + *x = RequestMetaHeader{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *RequestMetaHeader) GetVersion() *grpc.Version { + if x != nil { + return x.xxx_hidden_Version + } + return nil +} + +func (x *RequestMetaHeader) GetEpoch() uint64 { + if x != nil { + return x.xxx_hidden_Epoch + } + return 0 +} + +func (x *RequestMetaHeader) GetTtl() uint32 { + if x != nil { + return x.xxx_hidden_Ttl + } + return 0 +} + +func (x *RequestMetaHeader) GetXHeaders() []*XHeader { + if x != nil { + if x.xxx_hidden_XHeaders != nil { + return *x.xxx_hidden_XHeaders + } + } + return nil +} + +func (x *RequestMetaHeader) GetSessionToken() *SessionToken { + if x != nil { + return x.xxx_hidden_SessionToken + } + return nil +} + +func (x *RequestMetaHeader) GetBearerToken() *grpc1.BearerToken { + if x != nil { + return x.xxx_hidden_BearerToken + } + return nil +} + +func (x *RequestMetaHeader) GetOrigin() *RequestMetaHeader { + if x != nil { + return x.xxx_hidden_Origin + } + return nil +} + +func (x *RequestMetaHeader) GetMagicNumber() uint64 { + if x != nil { + return x.xxx_hidden_MagicNumber + } + return 0 +} + +func (x *RequestMetaHeader) SetVersion(v *grpc.Version) { + x.xxx_hidden_Version = v +} + +func (x *RequestMetaHeader) SetEpoch(v uint64) { + x.xxx_hidden_Epoch = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 8) +} + +func (x *RequestMetaHeader) SetTtl(v uint32) { + x.xxx_hidden_Ttl = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 8) +} + +func (x *RequestMetaHeader) SetXHeaders(v []*XHeader) { + x.xxx_hidden_XHeaders = &v +} + +func (x *RequestMetaHeader) SetSessionToken(v *SessionToken) { + x.xxx_hidden_SessionToken = v +} + +func (x *RequestMetaHeader) SetBearerToken(v *grpc1.BearerToken) { + x.xxx_hidden_BearerToken = v +} + +func (x *RequestMetaHeader) SetOrigin(v *RequestMetaHeader) { + x.xxx_hidden_Origin = v +} + +func (x *RequestMetaHeader) SetMagicNumber(v uint64) { + x.xxx_hidden_MagicNumber = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 7, 8) +} + +func (x *RequestMetaHeader) HasVersion() bool { + if x == nil { + return false + } + return x.xxx_hidden_Version != nil +} + +func (x *RequestMetaHeader) HasEpoch() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *RequestMetaHeader) HasTtl() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *RequestMetaHeader) HasSessionToken() bool { + if x == nil { + return false + } + return x.xxx_hidden_SessionToken != nil +} + +func (x *RequestMetaHeader) HasBearerToken() bool { + if x == nil { + return false + } + return x.xxx_hidden_BearerToken != nil +} + +func (x *RequestMetaHeader) HasOrigin() bool { + if x == nil { + return false + } + return x.xxx_hidden_Origin != nil +} + +func (x *RequestMetaHeader) HasMagicNumber() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 7) +} + +func (x *RequestMetaHeader) ClearVersion() { + x.xxx_hidden_Version = nil +} + +func (x *RequestMetaHeader) ClearEpoch() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Epoch = 0 +} + +func (x *RequestMetaHeader) ClearTtl() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Ttl = 0 +} + +func (x *RequestMetaHeader) ClearSessionToken() { + x.xxx_hidden_SessionToken = nil +} + +func (x *RequestMetaHeader) ClearBearerToken() { + x.xxx_hidden_BearerToken = nil +} + +func (x *RequestMetaHeader) ClearOrigin() { + x.xxx_hidden_Origin = nil +} + +func (x *RequestMetaHeader) ClearMagicNumber() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 7) + x.xxx_hidden_MagicNumber = 0 +} + +type RequestMetaHeader_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Peer's API version used + Version *grpc.Version + // Peer's local epoch number. Set to 0 if unknown. + Epoch *uint64 + // Maximum number of intermediate nodes in the request route + Ttl *uint32 + // Request X-Headers + XHeaders []*XHeader + // Session token within which the request is sent + SessionToken *SessionToken + // `BearerToken` with eACL overrides for the request + BearerToken *grpc1.BearerToken + // `RequestMetaHeader` of the origin request + Origin *RequestMetaHeader + // FrostFS network magic. Must match the value for the network + // that the server belongs to. + MagicNumber *uint64 +} + +func (b0 RequestMetaHeader_builder) Build() *RequestMetaHeader { + m0 := &RequestMetaHeader{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Version = b.Version + if b.Epoch != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 8) + x.xxx_hidden_Epoch = *b.Epoch + } + if b.Ttl != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 8) + x.xxx_hidden_Ttl = *b.Ttl + } + x.xxx_hidden_XHeaders = &b.XHeaders + x.xxx_hidden_SessionToken = b.SessionToken + x.xxx_hidden_BearerToken = b.BearerToken + x.xxx_hidden_Origin = b.Origin + if b.MagicNumber != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 7, 8) + x.xxx_hidden_MagicNumber = *b.MagicNumber + } + return m0 +} + +// Information about the response +type ResponseMetaHeader struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Version *grpc.Version `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"` + xxx_hidden_Epoch uint64 `protobuf:"varint,2,opt,name=epoch" json:"epoch,omitempty"` + xxx_hidden_Ttl uint32 `protobuf:"varint,3,opt,name=ttl" json:"ttl,omitempty"` + xxx_hidden_XHeaders *[]*XHeader `protobuf:"bytes,4,rep,name=x_headers,json=xHeaders" json:"x_headers,omitempty"` + xxx_hidden_Origin *ResponseMetaHeader `protobuf:"bytes,5,opt,name=origin" json:"origin,omitempty"` + xxx_hidden_Status *grpc2.Status `protobuf:"bytes,6,opt,name=status" json:"status,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResponseMetaHeader) Reset() { + *x = ResponseMetaHeader{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ResponseMetaHeader) GetVersion() *grpc.Version { + if x != nil { + return x.xxx_hidden_Version + } + return nil +} + +func (x *ResponseMetaHeader) GetEpoch() uint64 { + if x != nil { + return x.xxx_hidden_Epoch + } + return 0 +} + +func (x *ResponseMetaHeader) GetTtl() uint32 { + if x != nil { + return x.xxx_hidden_Ttl + } + return 0 +} + +func (x *ResponseMetaHeader) GetXHeaders() []*XHeader { + if x != nil { + if x.xxx_hidden_XHeaders != nil { + return *x.xxx_hidden_XHeaders + } + } + return nil +} + +func (x *ResponseMetaHeader) GetOrigin() *ResponseMetaHeader { + if x != nil { + return x.xxx_hidden_Origin + } + return nil +} + +func (x *ResponseMetaHeader) GetStatus() *grpc2.Status { + if x != nil { + return x.xxx_hidden_Status + } + return nil +} + +func (x *ResponseMetaHeader) SetVersion(v *grpc.Version) { + x.xxx_hidden_Version = v +} + +func (x *ResponseMetaHeader) SetEpoch(v uint64) { + x.xxx_hidden_Epoch = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 6) +} + +func (x *ResponseMetaHeader) SetTtl(v uint32) { + x.xxx_hidden_Ttl = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 6) +} + +func (x *ResponseMetaHeader) SetXHeaders(v []*XHeader) { + x.xxx_hidden_XHeaders = &v +} + +func (x *ResponseMetaHeader) SetOrigin(v *ResponseMetaHeader) { + x.xxx_hidden_Origin = v +} + +func (x *ResponseMetaHeader) SetStatus(v *grpc2.Status) { + x.xxx_hidden_Status = v +} + +func (x *ResponseMetaHeader) HasVersion() bool { + if x == nil { + return false + } + return x.xxx_hidden_Version != nil +} + +func (x *ResponseMetaHeader) HasEpoch() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *ResponseMetaHeader) HasTtl() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *ResponseMetaHeader) HasOrigin() bool { + if x == nil { + return false + } + return x.xxx_hidden_Origin != nil +} + +func (x *ResponseMetaHeader) HasStatus() bool { + if x == nil { + return false + } + return x.xxx_hidden_Status != nil +} + +func (x *ResponseMetaHeader) ClearVersion() { + x.xxx_hidden_Version = nil +} + +func (x *ResponseMetaHeader) ClearEpoch() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Epoch = 0 +} + +func (x *ResponseMetaHeader) ClearTtl() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Ttl = 0 +} + +func (x *ResponseMetaHeader) ClearOrigin() { + x.xxx_hidden_Origin = nil +} + +func (x *ResponseMetaHeader) ClearStatus() { + x.xxx_hidden_Status = nil +} + +type ResponseMetaHeader_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Peer's API version used + Version *grpc.Version + // Peer's local epoch number + Epoch *uint64 + // Maximum number of intermediate nodes in the request route + Ttl *uint32 + // Response X-Headers + XHeaders []*XHeader + // `ResponseMetaHeader` of the origin request + Origin *ResponseMetaHeader + // Status return + Status *grpc2.Status +} + +func (b0 ResponseMetaHeader_builder) Build() *ResponseMetaHeader { + m0 := &ResponseMetaHeader{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Version = b.Version + if b.Epoch != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 6) + x.xxx_hidden_Epoch = *b.Epoch + } + if b.Ttl != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 6) + x.xxx_hidden_Ttl = *b.Ttl + } + x.xxx_hidden_XHeaders = &b.XHeaders + x.xxx_hidden_Origin = b.Origin + x.xxx_hidden_Status = b.Status + return m0 +} + +// Verification info for the request signed by all intermediate nodes. +type RequestVerificationHeader struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_BodySignature *grpc.Signature `protobuf:"bytes,1,opt,name=body_signature,json=bodySignature" json:"body_signature,omitempty"` + xxx_hidden_MetaSignature *grpc.Signature `protobuf:"bytes,2,opt,name=meta_signature,json=metaSignature" json:"meta_signature,omitempty"` + xxx_hidden_OriginSignature *grpc.Signature `protobuf:"bytes,3,opt,name=origin_signature,json=originSignature" json:"origin_signature,omitempty"` + xxx_hidden_Origin *RequestVerificationHeader `protobuf:"bytes,4,opt,name=origin" json:"origin,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RequestVerificationHeader) Reset() { + *x = RequestVerificationHeader{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *RequestVerificationHeader) GetBodySignature() *grpc.Signature { + if x != nil { + return x.xxx_hidden_BodySignature + } + return nil +} + +func (x *RequestVerificationHeader) GetMetaSignature() *grpc.Signature { + if x != nil { + return x.xxx_hidden_MetaSignature + } + return nil +} + +func (x *RequestVerificationHeader) GetOriginSignature() *grpc.Signature { + if x != nil { + return x.xxx_hidden_OriginSignature + } + return nil +} + +func (x *RequestVerificationHeader) GetOrigin() *RequestVerificationHeader { + if x != nil { + return x.xxx_hidden_Origin + } + return nil +} + +func (x *RequestVerificationHeader) SetBodySignature(v *grpc.Signature) { + x.xxx_hidden_BodySignature = v +} + +func (x *RequestVerificationHeader) SetMetaSignature(v *grpc.Signature) { + x.xxx_hidden_MetaSignature = v +} + +func (x *RequestVerificationHeader) SetOriginSignature(v *grpc.Signature) { + x.xxx_hidden_OriginSignature = v +} + +func (x *RequestVerificationHeader) SetOrigin(v *RequestVerificationHeader) { + x.xxx_hidden_Origin = v +} + +func (x *RequestVerificationHeader) HasBodySignature() bool { + if x == nil { + return false + } + return x.xxx_hidden_BodySignature != nil +} + +func (x *RequestVerificationHeader) HasMetaSignature() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaSignature != nil +} + +func (x *RequestVerificationHeader) HasOriginSignature() bool { + if x == nil { + return false + } + return x.xxx_hidden_OriginSignature != nil +} + +func (x *RequestVerificationHeader) HasOrigin() bool { + if x == nil { + return false + } + return x.xxx_hidden_Origin != nil +} + +func (x *RequestVerificationHeader) ClearBodySignature() { + x.xxx_hidden_BodySignature = nil +} + +func (x *RequestVerificationHeader) ClearMetaSignature() { + x.xxx_hidden_MetaSignature = nil +} + +func (x *RequestVerificationHeader) ClearOriginSignature() { + x.xxx_hidden_OriginSignature = nil +} + +func (x *RequestVerificationHeader) ClearOrigin() { + x.xxx_hidden_Origin = nil +} + +type RequestVerificationHeader_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Request Body signature. Should be generated once by the request initiator. + BodySignature *grpc.Signature + // Request Meta signature is added and signed by each intermediate node + MetaSignature *grpc.Signature + // Signature of previous hops + OriginSignature *grpc.Signature + // Chain of previous hops signatures + Origin *RequestVerificationHeader +} + +func (b0 RequestVerificationHeader_builder) Build() *RequestVerificationHeader { + m0 := &RequestVerificationHeader{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_BodySignature = b.BodySignature + x.xxx_hidden_MetaSignature = b.MetaSignature + x.xxx_hidden_OriginSignature = b.OriginSignature + x.xxx_hidden_Origin = b.Origin + return m0 +} + +// Verification info for the response signed by all intermediate nodes +type ResponseVerificationHeader struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_BodySignature *grpc.Signature `protobuf:"bytes,1,opt,name=body_signature,json=bodySignature" json:"body_signature,omitempty"` + xxx_hidden_MetaSignature *grpc.Signature `protobuf:"bytes,2,opt,name=meta_signature,json=metaSignature" json:"meta_signature,omitempty"` + xxx_hidden_OriginSignature *grpc.Signature `protobuf:"bytes,3,opt,name=origin_signature,json=originSignature" json:"origin_signature,omitempty"` + xxx_hidden_Origin *ResponseVerificationHeader `protobuf:"bytes,4,opt,name=origin" json:"origin,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResponseVerificationHeader) Reset() { + *x = ResponseVerificationHeader{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ResponseVerificationHeader) GetBodySignature() *grpc.Signature { + if x != nil { + return x.xxx_hidden_BodySignature + } + return nil +} + +func (x *ResponseVerificationHeader) GetMetaSignature() *grpc.Signature { + if x != nil { + return x.xxx_hidden_MetaSignature + } + return nil +} + +func (x *ResponseVerificationHeader) GetOriginSignature() *grpc.Signature { + if x != nil { + return x.xxx_hidden_OriginSignature + } + return nil +} + +func (x *ResponseVerificationHeader) GetOrigin() *ResponseVerificationHeader { + if x != nil { + return x.xxx_hidden_Origin + } + return nil +} + +func (x *ResponseVerificationHeader) SetBodySignature(v *grpc.Signature) { + x.xxx_hidden_BodySignature = v +} + +func (x *ResponseVerificationHeader) SetMetaSignature(v *grpc.Signature) { + x.xxx_hidden_MetaSignature = v +} + +func (x *ResponseVerificationHeader) SetOriginSignature(v *grpc.Signature) { + x.xxx_hidden_OriginSignature = v +} + +func (x *ResponseVerificationHeader) SetOrigin(v *ResponseVerificationHeader) { + x.xxx_hidden_Origin = v +} + +func (x *ResponseVerificationHeader) HasBodySignature() bool { + if x == nil { + return false + } + return x.xxx_hidden_BodySignature != nil +} + +func (x *ResponseVerificationHeader) HasMetaSignature() bool { + if x == nil { + return false + } + return x.xxx_hidden_MetaSignature != nil +} + +func (x *ResponseVerificationHeader) HasOriginSignature() bool { + if x == nil { + return false + } + return x.xxx_hidden_OriginSignature != nil +} + +func (x *ResponseVerificationHeader) HasOrigin() bool { + if x == nil { + return false + } + return x.xxx_hidden_Origin != nil +} + +func (x *ResponseVerificationHeader) ClearBodySignature() { + x.xxx_hidden_BodySignature = nil +} + +func (x *ResponseVerificationHeader) ClearMetaSignature() { + x.xxx_hidden_MetaSignature = nil +} + +func (x *ResponseVerificationHeader) ClearOriginSignature() { + x.xxx_hidden_OriginSignature = nil +} + +func (x *ResponseVerificationHeader) ClearOrigin() { + x.xxx_hidden_Origin = nil +} + +type ResponseVerificationHeader_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Response Body signature. Should be generated once by an answering node. + BodySignature *grpc.Signature + // Response Meta signature is added and signed by each intermediate node + MetaSignature *grpc.Signature + // Signature of previous hops + OriginSignature *grpc.Signature + // Chain of previous hops signatures + Origin *ResponseVerificationHeader +} + +func (b0 ResponseVerificationHeader_builder) Build() *ResponseVerificationHeader { + m0 := &ResponseVerificationHeader{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_BodySignature = b.BodySignature + x.xxx_hidden_MetaSignature = b.MetaSignature + x.xxx_hidden_OriginSignature = b.OriginSignature + x.xxx_hidden_Origin = b.Origin + return m0 +} + +// Carries objects involved in the object session. +type ObjectSessionContext_Target struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Container *grpc.ContainerID `protobuf:"bytes,1,opt,name=container" json:"container,omitempty"` + xxx_hidden_Objects *[]*grpc.ObjectID `protobuf:"bytes,2,rep,name=objects" json:"objects,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ObjectSessionContext_Target) Reset() { + *x = ObjectSessionContext_Target{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ObjectSessionContext_Target) GetContainer() *grpc.ContainerID { + if x != nil { + return x.xxx_hidden_Container + } + return nil +} + +func (x *ObjectSessionContext_Target) GetObjects() []*grpc.ObjectID { + if x != nil { + if x.xxx_hidden_Objects != nil { + return *x.xxx_hidden_Objects + } + } + return nil +} + +func (x *ObjectSessionContext_Target) SetContainer(v *grpc.ContainerID) { + x.xxx_hidden_Container = v +} + +func (x *ObjectSessionContext_Target) SetObjects(v []*grpc.ObjectID) { + x.xxx_hidden_Objects = &v +} + +func (x *ObjectSessionContext_Target) HasContainer() bool { + if x == nil { + return false + } + return x.xxx_hidden_Container != nil +} + +func (x *ObjectSessionContext_Target) ClearContainer() { + x.xxx_hidden_Container = nil +} + +type ObjectSessionContext_Target_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Indicates which container the session is spread to. Field MUST be set + // and correct. + Container *grpc.ContainerID + // Indicates which objects the session is spread to. Objects are expected + // to be stored in the FrostFS container referenced by `container` field. + // Each element MUST have correct format. + Objects []*grpc.ObjectID +} + +func (b0 ObjectSessionContext_Target_builder) Build() *ObjectSessionContext_Target { + m0 := &ObjectSessionContext_Target{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Container = b.Container + x.xxx_hidden_Objects = &b.Objects + return m0 +} + +// Session Token body +type SessionToken_Body struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Id []byte `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + xxx_hidden_OwnerId *grpc.OwnerID `protobuf:"bytes,2,opt,name=owner_id,json=ownerID" json:"owner_id,omitempty"` + xxx_hidden_Lifetime *SessionToken_Body_TokenLifetime `protobuf:"bytes,3,opt,name=lifetime" json:"lifetime,omitempty"` + xxx_hidden_SessionKey []byte `protobuf:"bytes,4,opt,name=session_key,json=sessionKey" json:"session_key,omitempty"` + xxx_hidden_Context isSessionToken_Body_Context `protobuf_oneof:"context"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SessionToken_Body) Reset() { + *x = SessionToken_Body{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SessionToken_Body) GetId() []byte { + if x != nil { + return x.xxx_hidden_Id + } + return nil +} + +func (x *SessionToken_Body) GetOwnerId() *grpc.OwnerID { + if x != nil { + return x.xxx_hidden_OwnerId + } + return nil +} + +func (x *SessionToken_Body) GetLifetime() *SessionToken_Body_TokenLifetime { + if x != nil { + return x.xxx_hidden_Lifetime + } + return nil +} + +func (x *SessionToken_Body) GetSessionKey() []byte { + if x != nil { + return x.xxx_hidden_SessionKey + } + return nil +} + +func (x *SessionToken_Body) GetObject() *ObjectSessionContext { + if x != nil { + if x, ok := x.xxx_hidden_Context.(*sessionToken_Body_Object); ok { + return x.Object + } + } + return nil +} + +func (x *SessionToken_Body) GetContainer() *ContainerSessionContext { + if x != nil { + if x, ok := x.xxx_hidden_Context.(*sessionToken_Body_Container); ok { + return x.Container + } + } + return nil +} + +func (x *SessionToken_Body) SetId(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Id = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 5) +} + +func (x *SessionToken_Body) SetOwnerId(v *grpc.OwnerID) { + x.xxx_hidden_OwnerId = v +} + +func (x *SessionToken_Body) SetLifetime(v *SessionToken_Body_TokenLifetime) { + x.xxx_hidden_Lifetime = v +} + +func (x *SessionToken_Body) SetSessionKey(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_SessionKey = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 5) +} + +func (x *SessionToken_Body) SetObject(v *ObjectSessionContext) { + if v == nil { + x.xxx_hidden_Context = nil + return + } + x.xxx_hidden_Context = &sessionToken_Body_Object{v} +} + +func (x *SessionToken_Body) SetContainer(v *ContainerSessionContext) { + if v == nil { + x.xxx_hidden_Context = nil + return + } + x.xxx_hidden_Context = &sessionToken_Body_Container{v} +} + +func (x *SessionToken_Body) HasId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *SessionToken_Body) HasOwnerId() bool { + if x == nil { + return false + } + return x.xxx_hidden_OwnerId != nil +} + +func (x *SessionToken_Body) HasLifetime() bool { + if x == nil { + return false + } + return x.xxx_hidden_Lifetime != nil +} + +func (x *SessionToken_Body) HasSessionKey() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *SessionToken_Body) HasContext() bool { + if x == nil { + return false + } + return x.xxx_hidden_Context != nil +} + +func (x *SessionToken_Body) HasObject() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Context.(*sessionToken_Body_Object) + return ok +} + +func (x *SessionToken_Body) HasContainer() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Context.(*sessionToken_Body_Container) + return ok +} + +func (x *SessionToken_Body) ClearId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Id = nil +} + +func (x *SessionToken_Body) ClearOwnerId() { + x.xxx_hidden_OwnerId = nil +} + +func (x *SessionToken_Body) ClearLifetime() { + x.xxx_hidden_Lifetime = nil +} + +func (x *SessionToken_Body) ClearSessionKey() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_SessionKey = nil +} + +func (x *SessionToken_Body) ClearContext() { + x.xxx_hidden_Context = nil +} + +func (x *SessionToken_Body) ClearObject() { + if _, ok := x.xxx_hidden_Context.(*sessionToken_Body_Object); ok { + x.xxx_hidden_Context = nil + } +} + +func (x *SessionToken_Body) ClearContainer() { + if _, ok := x.xxx_hidden_Context.(*sessionToken_Body_Container); ok { + x.xxx_hidden_Context = nil + } +} + +const SessionToken_Body_Context_not_set_case case_SessionToken_Body_Context = 0 +const SessionToken_Body_Object_case case_SessionToken_Body_Context = 5 +const SessionToken_Body_Container_case case_SessionToken_Body_Context = 6 + +func (x *SessionToken_Body) WhichContext() case_SessionToken_Body_Context { + if x == nil { + return SessionToken_Body_Context_not_set_case + } + switch x.xxx_hidden_Context.(type) { + case *sessionToken_Body_Object: + return SessionToken_Body_Object_case + case *sessionToken_Body_Container: + return SessionToken_Body_Container_case + default: + return SessionToken_Body_Context_not_set_case + } +} + +type SessionToken_Body_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Token identifier is a valid UUIDv4 in binary form + Id []byte + // Identifier of the session initiator + OwnerId *grpc.OwnerID + // Lifetime of the session + Lifetime *SessionToken_Body_TokenLifetime + // Public key used in session + SessionKey []byte + // Session Context information + + // Fields of oneof xxx_hidden_Context: + // ObjectService session context + Object *ObjectSessionContext + // ContainerService session context + Container *ContainerSessionContext + // -- end of xxx_hidden_Context +} + +func (b0 SessionToken_Body_builder) Build() *SessionToken_Body { + m0 := &SessionToken_Body{} + b, x := &b0, m0 + _, _ = b, x + if b.Id != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 5) + x.xxx_hidden_Id = b.Id + } + x.xxx_hidden_OwnerId = b.OwnerId + x.xxx_hidden_Lifetime = b.Lifetime + if b.SessionKey != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 5) + x.xxx_hidden_SessionKey = b.SessionKey + } + if b.Object != nil { + x.xxx_hidden_Context = &sessionToken_Body_Object{b.Object} + } + if b.Container != nil { + x.xxx_hidden_Context = &sessionToken_Body_Container{b.Container} + } + return m0 +} + +type case_SessionToken_Body_Context protoreflect.FieldNumber + +func (x case_SessionToken_Body_Context) String() string { + md := file_api_session_grpc_types_proto_msgTypes[9].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isSessionToken_Body_Context interface { + isSessionToken_Body_Context() +} + +type sessionToken_Body_Object struct { + // ObjectService session context + Object *ObjectSessionContext `protobuf:"bytes,5,opt,name=object,oneof"` +} + +type sessionToken_Body_Container struct { + // ContainerService session context + Container *ContainerSessionContext `protobuf:"bytes,6,opt,name=container,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 `protogen:"opaque.v1"` + xxx_hidden_Exp uint64 `protobuf:"varint,1,opt,name=exp" json:"exp,omitempty"` + xxx_hidden_Nbf uint64 `protobuf:"varint,2,opt,name=nbf" json:"nbf,omitempty"` + xxx_hidden_Iat uint64 `protobuf:"varint,3,opt,name=iat" json:"iat,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SessionToken_Body_TokenLifetime) Reset() { + *x = SessionToken_Body_TokenLifetime{} + mi := &file_api_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_api_session_grpc_types_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SessionToken_Body_TokenLifetime) GetExp() uint64 { + if x != nil { + return x.xxx_hidden_Exp + } + return 0 +} + +func (x *SessionToken_Body_TokenLifetime) GetNbf() uint64 { + if x != nil { + return x.xxx_hidden_Nbf + } + return 0 +} + +func (x *SessionToken_Body_TokenLifetime) GetIat() uint64 { + if x != nil { + return x.xxx_hidden_Iat + } + return 0 +} + +func (x *SessionToken_Body_TokenLifetime) SetExp(v uint64) { + x.xxx_hidden_Exp = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 3) +} + +func (x *SessionToken_Body_TokenLifetime) SetNbf(v uint64) { + x.xxx_hidden_Nbf = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 3) +} + +func (x *SessionToken_Body_TokenLifetime) SetIat(v uint64) { + x.xxx_hidden_Iat = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 3) +} + +func (x *SessionToken_Body_TokenLifetime) HasExp() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *SessionToken_Body_TokenLifetime) HasNbf() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *SessionToken_Body_TokenLifetime) HasIat() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *SessionToken_Body_TokenLifetime) ClearExp() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Exp = 0 +} + +func (x *SessionToken_Body_TokenLifetime) ClearNbf() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Nbf = 0 +} + +func (x *SessionToken_Body_TokenLifetime) ClearIat() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Iat = 0 +} + +type SessionToken_Body_TokenLifetime_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Expiration Epoch + Exp *uint64 + // Not valid before Epoch + Nbf *uint64 + // Issued at Epoch + Iat *uint64 +} + +func (b0 SessionToken_Body_TokenLifetime_builder) Build() *SessionToken_Body_TokenLifetime { + m0 := &SessionToken_Body_TokenLifetime{} + b, x := &b0, m0 + _, _ = b, x + if b.Exp != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 3) + x.xxx_hidden_Exp = *b.Exp + } + if b.Nbf != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 3) + x.xxx_hidden_Nbf = *b.Nbf + } + if b.Iat != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 3) + x.xxx_hidden_Iat = *b.Iat + } + return m0 +} + +var File_api_session_grpc_types_proto protoreflect.FileDescriptor + +var file_api_session_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x1a, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x61, 0x70, + 0x69, 0x2f, 0x61, 0x63, 0x6c, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 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, 0x65, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, + 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, + 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, + 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0xaa, 0x02, 0x1b, 0x4e, + 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, + 0x50, 0x49, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x08, 0x65, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_session_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_api_session_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_api_session_grpc_types_proto_goTypes = []any{ + (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_api_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_api_session_grpc_types_proto_init() } +func file_api_session_grpc_types_proto_init() { + if File_api_session_grpc_types_proto != nil { + return + } + file_api_session_grpc_types_proto_msgTypes[9].OneofWrappers = []any{ + (*sessionToken_Body_Object)(nil), + (*sessionToken_Body_Container)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_session_grpc_types_proto_rawDesc, + NumEnums: 2, + NumMessages: 11, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_session_grpc_types_proto_goTypes, + DependencyIndexes: file_api_session_grpc_types_proto_depIdxs, + EnumInfos: file_api_session_grpc_types_proto_enumTypes, + MessageInfos: file_api_session_grpc_types_proto_msgTypes, + }.Build() + File_api_session_grpc_types_proto = out.File + file_api_session_grpc_types_proto_rawDesc = nil + file_api_session_grpc_types_proto_goTypes = nil + file_api_session_grpc_types_proto_depIdxs = nil +} diff --git a/api/session/string.go b/api/session/string.go index fd2d425..83c3fa2 100644 --- a/api/session/string.go +++ b/api/session/string.go @@ -14,12 +14,10 @@ func (x ObjectSessionVerb) String() string { // // Returns true if s was parsed successfully. func (x *ObjectSessionVerb) FromString(s string) bool { - var g session.ObjectSessionContext_Verb - - ok := g.FromString(s) + g, ok := session.ObjectSessionContext_Verb_value[s] if ok { - *x = ObjectSessionVerbFromGRPCField(g) + *x = ObjectSessionVerbFromGRPCField(session.ObjectSessionContext_Verb(g)) } return ok @@ -35,12 +33,10 @@ func (x ContainerSessionVerb) String() string { // // Returns true if s was parsed successfully. func (x *ContainerSessionVerb) FromString(s string) bool { - var g session.ContainerSessionContext_Verb - - ok := g.FromString(s) + g, ok := session.ContainerSessionContext_Verb_value[s] if ok { - *x = ContainerSessionVerbFromGRPCField(g) + *x = ContainerSessionVerbFromGRPCField(session.ContainerSessionContext_Verb(g)) } return ok diff --git a/api/status/convert.go b/api/status/convert.go index 2612c52..9b273dd 100644 --- a/api/status/convert.go +++ b/api/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 := range ln { - ds = append(ds, *x.details[i].ToGRPCMessage().(*status.Status_Detail)) + ds = append(ds, x.details[i].ToGRPCMessage().(*status.Status_Detail)) } } @@ -81,7 +81,7 @@ func (x *Status) FromGRPCMessage(m grpc.Message) error { ds = make([]Detail, ln) for i := range ln { - if err := ds[i].FromGRPCMessage(&dsV2[i]); err != nil { + if err := ds[i].FromGRPCMessage(dsV2[i]); err != nil { return err } } diff --git a/api/status/grpc/types.pb.go b/api/status/grpc/types.pb.go new file mode 100644 index 0000000..e44ae18 --- /dev/null +++ b/api/status/grpc/types.pb.go @@ -0,0 +1,742 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/status/grpc/types.proto + +//go:build !protoopaque + +package status + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Section identifiers. +type Section int32 + +const ( + // Successful return codes. + Section_SECTION_SUCCESS Section = 0 + // Failure codes regardless of the operation. + Section_SECTION_FAILURE_COMMON Section = 1 + // Object service-specific errors. + Section_SECTION_OBJECT Section = 2 + // Container service-specific errors. + Section_SECTION_CONTAINER Section = 3 + // Session service-specific errors. + Section_SECTION_SESSION Section = 4 + // Session service-specific errors. + Section_SECTION_APE_MANAGER Section = 5 +) + +// Enum value maps for Section. +var ( + Section_name = map[int32]string{ + 0: "SECTION_SUCCESS", + 1: "SECTION_FAILURE_COMMON", + 2: "SECTION_OBJECT", + 3: "SECTION_CONTAINER", + 4: "SECTION_SESSION", + 5: "SECTION_APE_MANAGER", + } + Section_value = map[string]int32{ + "SECTION_SUCCESS": 0, + "SECTION_FAILURE_COMMON": 1, + "SECTION_OBJECT": 2, + "SECTION_CONTAINER": 3, + "SECTION_SESSION": 4, + "SECTION_APE_MANAGER": 5, + } +) + +func (x Section) Enum() *Section { + p := new(Section) + *p = x + return p +} + +func (x Section) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Section) Descriptor() protoreflect.EnumDescriptor { + return file_api_status_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (Section) Type() protoreflect.EnumType { + return &file_api_status_grpc_types_proto_enumTypes[0] +} + +func (x Section) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Section of FrostFS successful return codes. +type Success int32 + +const ( + // [**0**] Default success. Not detailed. + // If the server cannot match successful outcome to the code, it should + // use this code. + Success_OK Success = 0 +) + +// Enum value maps for Success. +var ( + Success_name = map[int32]string{ + 0: "OK", + } + Success_value = map[string]int32{ + "OK": 0, + } +) + +func (x Success) Enum() *Success { + p := new(Success) + *p = x + return p +} + +func (x Success) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Success) Descriptor() protoreflect.EnumDescriptor { + return file_api_status_grpc_types_proto_enumTypes[1].Descriptor() +} + +func (Success) Type() protoreflect.EnumType { + return &file_api_status_grpc_types_proto_enumTypes[1] +} + +func (x Success) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Section of failed statuses independent of the operation. +type CommonFail int32 + +const ( + // [**1024**] Internal server error, default failure. Not detailed. + // If the server cannot match failed outcome to the code, it should + // use this code. + CommonFail_INTERNAL CommonFail = 0 + // [**1025**] Wrong magic of the FrostFS network. + // Details: + // - [**0**] Magic number of the served FrostFS network (big-endian 64-bit + // unsigned integer). + CommonFail_WRONG_MAGIC_NUMBER CommonFail = 1 + // [**1026**] Signature verification failure. + CommonFail_SIGNATURE_VERIFICATION_FAIL CommonFail = 2 + // [**1027**] Node is under maintenance. + CommonFail_NODE_UNDER_MAINTENANCE CommonFail = 3 + // [**1028**] Invalid argument error. If the server fails on validation of a + // request parameter as the client sent it incorrectly, then this code should + // be used. + CommonFail_INVALID_ARGUMENT CommonFail = 4 +) + +// Enum value maps for CommonFail. +var ( + CommonFail_name = map[int32]string{ + 0: "INTERNAL", + 1: "WRONG_MAGIC_NUMBER", + 2: "SIGNATURE_VERIFICATION_FAIL", + 3: "NODE_UNDER_MAINTENANCE", + 4: "INVALID_ARGUMENT", + } + CommonFail_value = map[string]int32{ + "INTERNAL": 0, + "WRONG_MAGIC_NUMBER": 1, + "SIGNATURE_VERIFICATION_FAIL": 2, + "NODE_UNDER_MAINTENANCE": 3, + "INVALID_ARGUMENT": 4, + } +) + +func (x CommonFail) Enum() *CommonFail { + p := new(CommonFail) + *p = x + return p +} + +func (x CommonFail) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CommonFail) Descriptor() protoreflect.EnumDescriptor { + return file_api_status_grpc_types_proto_enumTypes[2].Descriptor() +} + +func (CommonFail) Type() protoreflect.EnumType { + return &file_api_status_grpc_types_proto_enumTypes[2] +} + +func (x CommonFail) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Section of statuses for object-related operations. +type Object int32 + +const ( + // [**2048**] Access denied by ACL. + // Details: + // - [**0**] Human-readable description (UTF-8 encoded string). + Object_ACCESS_DENIED Object = 0 + // [**2049**] Object not found. + Object_OBJECT_NOT_FOUND Object = 1 + // [**2050**] Operation rejected by the object lock. + Object_LOCKED Object = 2 + // [**2051**] Locking an object with a non-REGULAR type rejected. + Object_LOCK_NON_REGULAR_OBJECT Object = 3 + // [**2052**] Object has been marked deleted. + Object_OBJECT_ALREADY_REMOVED Object = 4 + // [**2053**] Invalid range has been requested for an object. + Object_OUT_OF_RANGE Object = 5 +) + +// Enum value maps for Object. +var ( + Object_name = map[int32]string{ + 0: "ACCESS_DENIED", + 1: "OBJECT_NOT_FOUND", + 2: "LOCKED", + 3: "LOCK_NON_REGULAR_OBJECT", + 4: "OBJECT_ALREADY_REMOVED", + 5: "OUT_OF_RANGE", + } + Object_value = map[string]int32{ + "ACCESS_DENIED": 0, + "OBJECT_NOT_FOUND": 1, + "LOCKED": 2, + "LOCK_NON_REGULAR_OBJECT": 3, + "OBJECT_ALREADY_REMOVED": 4, + "OUT_OF_RANGE": 5, + } +) + +func (x Object) Enum() *Object { + p := new(Object) + *p = x + return p +} + +func (x Object) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Object) Descriptor() protoreflect.EnumDescriptor { + return file_api_status_grpc_types_proto_enumTypes[3].Descriptor() +} + +func (Object) Type() protoreflect.EnumType { + return &file_api_status_grpc_types_proto_enumTypes[3] +} + +func (x Object) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Section of statuses for container-related operations. +type Container int32 + +const ( + // [**3072**] Container not found. + Container_CONTAINER_NOT_FOUND Container = 0 + // [**3073**] eACL table not found. + Container_EACL_NOT_FOUND Container = 1 + // [**3074**] Container access denied. + Container_CONTAINER_ACCESS_DENIED Container = 2 +) + +// Enum value maps for Container. +var ( + Container_name = map[int32]string{ + 0: "CONTAINER_NOT_FOUND", + 1: "EACL_NOT_FOUND", + 2: "CONTAINER_ACCESS_DENIED", + } + Container_value = map[string]int32{ + "CONTAINER_NOT_FOUND": 0, + "EACL_NOT_FOUND": 1, + "CONTAINER_ACCESS_DENIED": 2, + } +) + +func (x Container) Enum() *Container { + p := new(Container) + *p = x + return p +} + +func (x Container) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Container) Descriptor() protoreflect.EnumDescriptor { + return file_api_status_grpc_types_proto_enumTypes[4].Descriptor() +} + +func (Container) Type() protoreflect.EnumType { + return &file_api_status_grpc_types_proto_enumTypes[4] +} + +func (x Container) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Section of statuses for session-related operations. +type Session int32 + +const ( + // [**4096**] Token not found. + Session_TOKEN_NOT_FOUND Session = 0 + // [**4097**] Token has expired. + Session_TOKEN_EXPIRED Session = 1 +) + +// Enum value maps for Session. +var ( + Session_name = map[int32]string{ + 0: "TOKEN_NOT_FOUND", + 1: "TOKEN_EXPIRED", + } + Session_value = map[string]int32{ + "TOKEN_NOT_FOUND": 0, + "TOKEN_EXPIRED": 1, + } +) + +func (x Session) Enum() *Session { + p := new(Session) + *p = x + return p +} + +func (x Session) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Session) Descriptor() protoreflect.EnumDescriptor { + return file_api_status_grpc_types_proto_enumTypes[5].Descriptor() +} + +func (Session) Type() protoreflect.EnumType { + return &file_api_status_grpc_types_proto_enumTypes[5] +} + +func (x Session) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Section of status for APE manager related operations. +type APEManager int32 + +const ( + // [**5120**] The operation is denied by APE manager. + APEManager_APE_MANAGER_ACCESS_DENIED APEManager = 0 +) + +// Enum value maps for APEManager. +var ( + APEManager_name = map[int32]string{ + 0: "APE_MANAGER_ACCESS_DENIED", + } + APEManager_value = map[string]int32{ + "APE_MANAGER_ACCESS_DENIED": 0, + } +) + +func (x APEManager) Enum() *APEManager { + p := new(APEManager) + *p = x + return p +} + +func (x APEManager) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (APEManager) Descriptor() protoreflect.EnumDescriptor { + return file_api_status_grpc_types_proto_enumTypes[6].Descriptor() +} + +func (APEManager) Type() protoreflect.EnumType { + return &file_api_status_grpc_types_proto_enumTypes[6] +} + +func (x APEManager) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Declares the general format of the status returns of the FrostFS RPC +// protocol. Status is present in all response messages. Each RPC of FrostFS +// protocol describes the possible outcomes and details of the operation. +// +// Each status is assigned a one-to-one numeric code. Any unique result of an +// operation in FrostFS is unambiguously associated with the code value. +// +// Numerical set of codes is split into 1024-element sections. An enumeration +// is defined for each section. Values can be referred to in the following ways: +// +// * numerical value ranging from 0 to 4,294,967,295 (global code); +// +// - values from enumeration (local code). The formula for the ratio of the +// local code (`L`) of a defined section (`S`) to the global one (`G`): +// `G = 1024 * S + L`. +// +// All outcomes are divided into successful and failed, which corresponds +// to the success or failure of the operation. The definition of success +// follows the semantics of RPC and the description of its purpose. +// The server must not attach code that is the opposite of the outcome type. +// +// See the set of return codes in the description for calls. +// +// Each status can carry a developer-facing error message. It should be a human +// readable text in English. The server should not transmit (and the client +// should not expect) useful information in the message. Field `details` +// should make the return more detailed. +type Status struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // The status code + Code *uint32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + // Developer-facing error message + Message *string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` + // Data detailing the outcome of the operation. Must be unique by ID. + Details []*Status_Detail `protobuf:"bytes,3,rep,name=details" json:"details,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Status) Reset() { + *x = Status{} + mi := &file_api_status_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Status) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Status) ProtoMessage() {} + +func (x *Status) ProtoReflect() protoreflect.Message { + mi := &file_api_status_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Status) GetCode() uint32 { + if x != nil && x.Code != nil { + return *x.Code + } + return 0 +} + +func (x *Status) GetMessage() string { + if x != nil && x.Message != nil { + return *x.Message + } + return "" +} + +func (x *Status) GetDetails() []*Status_Detail { + if x != nil { + return x.Details + } + return nil +} + +func (x *Status) SetCode(v uint32) { + x.Code = &v +} + +func (x *Status) SetMessage(v string) { + x.Message = &v +} + +func (x *Status) SetDetails(v []*Status_Detail) { + x.Details = v +} + +func (x *Status) HasCode() bool { + if x == nil { + return false + } + return x.Code != nil +} + +func (x *Status) HasMessage() bool { + if x == nil { + return false + } + return x.Message != nil +} + +func (x *Status) ClearCode() { + x.Code = nil +} + +func (x *Status) ClearMessage() { + x.Message = nil +} + +type Status_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The status code + Code *uint32 + // Developer-facing error message + Message *string + // Data detailing the outcome of the operation. Must be unique by ID. + Details []*Status_Detail +} + +func (b0 Status_builder) Build() *Status { + m0 := &Status{} + b, x := &b0, m0 + _, _ = b, x + x.Code = b.Code + x.Message = b.Message + x.Details = b.Details + return m0 +} + +// Return detail. It contains additional information that can be used to +// analyze the response. Each code defines a set of details that can be +// attached to a status. Client should not handle details that are not +// covered by the code. +type Status_Detail struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Detail ID. The identifier is required to determine the binary format + // of the detail and how to decode it. + Id *uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + // Binary status detail. Must follow the format associated with ID. + // The possibility of missing a value must be explicitly allowed. + Value []byte `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Status_Detail) Reset() { + *x = Status_Detail{} + mi := &file_api_status_grpc_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Status_Detail) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Status_Detail) ProtoMessage() {} + +func (x *Status_Detail) ProtoReflect() protoreflect.Message { + mi := &file_api_status_grpc_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Status_Detail) GetId() uint32 { + if x != nil && x.Id != nil { + return *x.Id + } + return 0 +} + +func (x *Status_Detail) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +func (x *Status_Detail) SetId(v uint32) { + x.Id = &v +} + +func (x *Status_Detail) SetValue(v []byte) { + if v == nil { + v = []byte{} + } + x.Value = v +} + +func (x *Status_Detail) HasId() bool { + if x == nil { + return false + } + return x.Id != nil +} + +func (x *Status_Detail) HasValue() bool { + if x == nil { + return false + } + return x.Value != nil +} + +func (x *Status_Detail) ClearId() { + x.Id = nil +} + +func (x *Status_Detail) ClearValue() { + x.Value = nil +} + +type Status_Detail_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Detail ID. The identifier is required to determine the binary format + // of the detail and how to decode it. + Id *uint32 + // Binary status detail. Must follow the format associated with ID. + // The possibility of missing a value must be explicitly allowed. + Value []byte +} + +func (b0 Status_Detail_builder) Build() *Status_Detail { + m0 := &Status_Detail{} + b, x := &b0, m0 + _, _ = b, x + x.Id = b.Id + x.Value = b.Value + return m0 +} + +var File_api_status_grpc_types_proto protoreflect.FileDescriptor + +var file_api_status_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, + 0xa1, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x2e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x1a, 0x2e, 0x0a, 0x06, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x2a, 0x93, 0x01, 0x0a, 0x07, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x13, 0x0a, 0x0f, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, + 0x53, 0x53, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, + 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x10, 0x01, + 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4f, 0x42, 0x4a, 0x45, + 0x43, 0x54, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, + 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x53, + 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x04, + 0x12, 0x17, 0x0a, 0x13, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x50, 0x45, 0x5f, + 0x4d, 0x41, 0x4e, 0x41, 0x47, 0x45, 0x52, 0x10, 0x05, 0x2a, 0x11, 0x0a, 0x07, 0x53, 0x75, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, 0x2a, 0x85, 0x01, 0x0a, + 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x12, 0x0c, 0x0a, 0x08, 0x49, + 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x57, 0x52, 0x4f, + 0x4e, 0x47, 0x5f, 0x4d, 0x41, 0x47, 0x49, 0x43, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, + 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x53, 0x49, 0x47, 0x4e, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x56, + 0x45, 0x52, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x49, 0x4c, + 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x4e, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x44, 0x45, 0x52, + 0x5f, 0x4d, 0x41, 0x49, 0x4e, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x03, 0x12, 0x14, + 0x0a, 0x10, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x41, 0x52, 0x47, 0x55, 0x4d, 0x45, + 0x4e, 0x54, 0x10, 0x04, 0x2a, 0x88, 0x01, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, + 0x11, 0x0a, 0x0d, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4e, 0x4f, 0x54, + 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x4f, 0x43, 0x4b, + 0x45, 0x44, 0x10, 0x02, 0x12, 0x1b, 0x0a, 0x17, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x4e, 0x4f, 0x4e, + 0x5f, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, + 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x41, 0x4c, 0x52, 0x45, + 0x41, 0x44, 0x59, 0x5f, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x44, 0x10, 0x04, 0x12, 0x10, 0x0a, + 0x0c, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x05, 0x2a, + 0x55, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x13, + 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, + 0x55, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x41, 0x43, 0x4c, 0x5f, 0x4e, 0x4f, + 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, 0x4e, + 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, + 0x4e, 0x49, 0x45, 0x44, 0x10, 0x02, 0x2a, 0x31, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, + 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, + 0x45, 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x01, 0x2a, 0x2b, 0x0a, 0x0a, 0x41, 0x50, 0x45, + 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x19, 0x41, 0x50, 0x45, 0x5f, 0x4d, + 0x41, 0x4e, 0x41, 0x47, 0x45, 0x52, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, + 0x4e, 0x49, 0x45, 0x44, 0x10, 0x00, 0x42, 0x62, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, + 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, + 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, + 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0xaa, 0x02, 0x1a, + 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x41, 0x50, 0x49, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x62, 0x08, 0x65, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_status_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 7) +var file_api_status_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_api_status_grpc_types_proto_goTypes = []any{ + (Section)(0), // 0: neo.fs.v2.status.Section + (Success)(0), // 1: neo.fs.v2.status.Success + (CommonFail)(0), // 2: neo.fs.v2.status.CommonFail + (Object)(0), // 3: neo.fs.v2.status.Object + (Container)(0), // 4: neo.fs.v2.status.Container + (Session)(0), // 5: neo.fs.v2.status.Session + (APEManager)(0), // 6: neo.fs.v2.status.APEManager + (*Status)(nil), // 7: neo.fs.v2.status.Status + (*Status_Detail)(nil), // 8: neo.fs.v2.status.Status.Detail +} +var file_api_status_grpc_types_proto_depIdxs = []int32{ + 8, // 0: neo.fs.v2.status.Status.details:type_name -> neo.fs.v2.status.Status.Detail + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_api_status_grpc_types_proto_init() } +func file_api_status_grpc_types_proto_init() { + if File_api_status_grpc_types_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_status_grpc_types_proto_rawDesc, + NumEnums: 7, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_status_grpc_types_proto_goTypes, + DependencyIndexes: file_api_status_grpc_types_proto_depIdxs, + EnumInfos: file_api_status_grpc_types_proto_enumTypes, + MessageInfos: file_api_status_grpc_types_proto_msgTypes, + }.Build() + File_api_status_grpc_types_proto = out.File + file_api_status_grpc_types_proto_rawDesc = nil + file_api_status_grpc_types_proto_goTypes = nil + file_api_status_grpc_types_proto_depIdxs = nil +} diff --git a/api/status/grpc/types_frostfs.pb.go b/api/status/grpc/types_frostfs.pb.go deleted file mode 100644 index 35dec11..0000000 --- a/api/status/grpc/types_frostfs.pb.go +++ /dev/null @@ -1,694 +0,0 @@ -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package status - -import ( - json "encoding/json" - fmt "fmt" - pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" - proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" - encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" - easyproto "github.com/VictoriaMetrics/easyproto" - jlexer "github.com/mailru/easyjson/jlexer" - jwriter "github.com/mailru/easyjson/jwriter" - strconv "strconv" -) - -type 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 - } - first := true - out.RawByte('{') - { - 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 = "\"value\":" - out.RawString(prefix) - if x.Value != nil { - out.Base64Bytes(x.Value) - } else { - out.String("") - } - } - 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 - 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": - { - var f []byte - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - 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.NestedStructureSizeUnchecked(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 { - 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, 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 - } - first := true - out.RawByte('{') - { - 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 = "\"message\":" - out.RawString(prefix) - out.String(x.Message) - } - { - 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('}') -} - -// 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 - 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": - { - 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 = 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/api/status/grpc/types_frostfs_fuzz.go b/api/status/grpc/types_frostfs_fuzz.go deleted file mode 100644 index ce9d84e..0000000 --- a/api/status/grpc/types_frostfs_fuzz.go +++ /dev/null @@ -1,26 +0,0 @@ -//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/api/status/grpc/types_frostfs_test.go b/api/status/grpc/types_frostfs_test.go deleted file mode 100644 index dfc5631..0000000 --- a/api/status/grpc/types_frostfs_test.go +++ /dev/null @@ -1,21 +0,0 @@ -//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/api/status/grpc/types_protoopaque.pb.go b/api/status/grpc/types_protoopaque.pb.go new file mode 100644 index 0000000..d1877ab --- /dev/null +++ b/api/status/grpc/types_protoopaque.pb.go @@ -0,0 +1,764 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/status/grpc/types.proto + +//go:build protoopaque + +package status + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Section identifiers. +type Section int32 + +const ( + // Successful return codes. + Section_SECTION_SUCCESS Section = 0 + // Failure codes regardless of the operation. + Section_SECTION_FAILURE_COMMON Section = 1 + // Object service-specific errors. + Section_SECTION_OBJECT Section = 2 + // Container service-specific errors. + Section_SECTION_CONTAINER Section = 3 + // Session service-specific errors. + Section_SECTION_SESSION Section = 4 + // Session service-specific errors. + Section_SECTION_APE_MANAGER Section = 5 +) + +// Enum value maps for Section. +var ( + Section_name = map[int32]string{ + 0: "SECTION_SUCCESS", + 1: "SECTION_FAILURE_COMMON", + 2: "SECTION_OBJECT", + 3: "SECTION_CONTAINER", + 4: "SECTION_SESSION", + 5: "SECTION_APE_MANAGER", + } + Section_value = map[string]int32{ + "SECTION_SUCCESS": 0, + "SECTION_FAILURE_COMMON": 1, + "SECTION_OBJECT": 2, + "SECTION_CONTAINER": 3, + "SECTION_SESSION": 4, + "SECTION_APE_MANAGER": 5, + } +) + +func (x Section) Enum() *Section { + p := new(Section) + *p = x + return p +} + +func (x Section) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Section) Descriptor() protoreflect.EnumDescriptor { + return file_api_status_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (Section) Type() protoreflect.EnumType { + return &file_api_status_grpc_types_proto_enumTypes[0] +} + +func (x Section) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Section of FrostFS successful return codes. +type Success int32 + +const ( + // [**0**] Default success. Not detailed. + // If the server cannot match successful outcome to the code, it should + // use this code. + Success_OK Success = 0 +) + +// Enum value maps for Success. +var ( + Success_name = map[int32]string{ + 0: "OK", + } + Success_value = map[string]int32{ + "OK": 0, + } +) + +func (x Success) Enum() *Success { + p := new(Success) + *p = x + return p +} + +func (x Success) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Success) Descriptor() protoreflect.EnumDescriptor { + return file_api_status_grpc_types_proto_enumTypes[1].Descriptor() +} + +func (Success) Type() protoreflect.EnumType { + return &file_api_status_grpc_types_proto_enumTypes[1] +} + +func (x Success) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Section of failed statuses independent of the operation. +type CommonFail int32 + +const ( + // [**1024**] Internal server error, default failure. Not detailed. + // If the server cannot match failed outcome to the code, it should + // use this code. + CommonFail_INTERNAL CommonFail = 0 + // [**1025**] Wrong magic of the FrostFS network. + // Details: + // - [**0**] Magic number of the served FrostFS network (big-endian 64-bit + // unsigned integer). + CommonFail_WRONG_MAGIC_NUMBER CommonFail = 1 + // [**1026**] Signature verification failure. + CommonFail_SIGNATURE_VERIFICATION_FAIL CommonFail = 2 + // [**1027**] Node is under maintenance. + CommonFail_NODE_UNDER_MAINTENANCE CommonFail = 3 + // [**1028**] Invalid argument error. If the server fails on validation of a + // request parameter as the client sent it incorrectly, then this code should + // be used. + CommonFail_INVALID_ARGUMENT CommonFail = 4 +) + +// Enum value maps for CommonFail. +var ( + CommonFail_name = map[int32]string{ + 0: "INTERNAL", + 1: "WRONG_MAGIC_NUMBER", + 2: "SIGNATURE_VERIFICATION_FAIL", + 3: "NODE_UNDER_MAINTENANCE", + 4: "INVALID_ARGUMENT", + } + CommonFail_value = map[string]int32{ + "INTERNAL": 0, + "WRONG_MAGIC_NUMBER": 1, + "SIGNATURE_VERIFICATION_FAIL": 2, + "NODE_UNDER_MAINTENANCE": 3, + "INVALID_ARGUMENT": 4, + } +) + +func (x CommonFail) Enum() *CommonFail { + p := new(CommonFail) + *p = x + return p +} + +func (x CommonFail) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CommonFail) Descriptor() protoreflect.EnumDescriptor { + return file_api_status_grpc_types_proto_enumTypes[2].Descriptor() +} + +func (CommonFail) Type() protoreflect.EnumType { + return &file_api_status_grpc_types_proto_enumTypes[2] +} + +func (x CommonFail) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Section of statuses for object-related operations. +type Object int32 + +const ( + // [**2048**] Access denied by ACL. + // Details: + // - [**0**] Human-readable description (UTF-8 encoded string). + Object_ACCESS_DENIED Object = 0 + // [**2049**] Object not found. + Object_OBJECT_NOT_FOUND Object = 1 + // [**2050**] Operation rejected by the object lock. + Object_LOCKED Object = 2 + // [**2051**] Locking an object with a non-REGULAR type rejected. + Object_LOCK_NON_REGULAR_OBJECT Object = 3 + // [**2052**] Object has been marked deleted. + Object_OBJECT_ALREADY_REMOVED Object = 4 + // [**2053**] Invalid range has been requested for an object. + Object_OUT_OF_RANGE Object = 5 +) + +// Enum value maps for Object. +var ( + Object_name = map[int32]string{ + 0: "ACCESS_DENIED", + 1: "OBJECT_NOT_FOUND", + 2: "LOCKED", + 3: "LOCK_NON_REGULAR_OBJECT", + 4: "OBJECT_ALREADY_REMOVED", + 5: "OUT_OF_RANGE", + } + Object_value = map[string]int32{ + "ACCESS_DENIED": 0, + "OBJECT_NOT_FOUND": 1, + "LOCKED": 2, + "LOCK_NON_REGULAR_OBJECT": 3, + "OBJECT_ALREADY_REMOVED": 4, + "OUT_OF_RANGE": 5, + } +) + +func (x Object) Enum() *Object { + p := new(Object) + *p = x + return p +} + +func (x Object) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Object) Descriptor() protoreflect.EnumDescriptor { + return file_api_status_grpc_types_proto_enumTypes[3].Descriptor() +} + +func (Object) Type() protoreflect.EnumType { + return &file_api_status_grpc_types_proto_enumTypes[3] +} + +func (x Object) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Section of statuses for container-related operations. +type Container int32 + +const ( + // [**3072**] Container not found. + Container_CONTAINER_NOT_FOUND Container = 0 + // [**3073**] eACL table not found. + Container_EACL_NOT_FOUND Container = 1 + // [**3074**] Container access denied. + Container_CONTAINER_ACCESS_DENIED Container = 2 +) + +// Enum value maps for Container. +var ( + Container_name = map[int32]string{ + 0: "CONTAINER_NOT_FOUND", + 1: "EACL_NOT_FOUND", + 2: "CONTAINER_ACCESS_DENIED", + } + Container_value = map[string]int32{ + "CONTAINER_NOT_FOUND": 0, + "EACL_NOT_FOUND": 1, + "CONTAINER_ACCESS_DENIED": 2, + } +) + +func (x Container) Enum() *Container { + p := new(Container) + *p = x + return p +} + +func (x Container) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Container) Descriptor() protoreflect.EnumDescriptor { + return file_api_status_grpc_types_proto_enumTypes[4].Descriptor() +} + +func (Container) Type() protoreflect.EnumType { + return &file_api_status_grpc_types_proto_enumTypes[4] +} + +func (x Container) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Section of statuses for session-related operations. +type Session int32 + +const ( + // [**4096**] Token not found. + Session_TOKEN_NOT_FOUND Session = 0 + // [**4097**] Token has expired. + Session_TOKEN_EXPIRED Session = 1 +) + +// Enum value maps for Session. +var ( + Session_name = map[int32]string{ + 0: "TOKEN_NOT_FOUND", + 1: "TOKEN_EXPIRED", + } + Session_value = map[string]int32{ + "TOKEN_NOT_FOUND": 0, + "TOKEN_EXPIRED": 1, + } +) + +func (x Session) Enum() *Session { + p := new(Session) + *p = x + return p +} + +func (x Session) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Session) Descriptor() protoreflect.EnumDescriptor { + return file_api_status_grpc_types_proto_enumTypes[5].Descriptor() +} + +func (Session) Type() protoreflect.EnumType { + return &file_api_status_grpc_types_proto_enumTypes[5] +} + +func (x Session) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Section of status for APE manager related operations. +type APEManager int32 + +const ( + // [**5120**] The operation is denied by APE manager. + APEManager_APE_MANAGER_ACCESS_DENIED APEManager = 0 +) + +// Enum value maps for APEManager. +var ( + APEManager_name = map[int32]string{ + 0: "APE_MANAGER_ACCESS_DENIED", + } + APEManager_value = map[string]int32{ + "APE_MANAGER_ACCESS_DENIED": 0, + } +) + +func (x APEManager) Enum() *APEManager { + p := new(APEManager) + *p = x + return p +} + +func (x APEManager) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (APEManager) Descriptor() protoreflect.EnumDescriptor { + return file_api_status_grpc_types_proto_enumTypes[6].Descriptor() +} + +func (APEManager) Type() protoreflect.EnumType { + return &file_api_status_grpc_types_proto_enumTypes[6] +} + +func (x APEManager) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Declares the general format of the status returns of the FrostFS RPC +// protocol. Status is present in all response messages. Each RPC of FrostFS +// protocol describes the possible outcomes and details of the operation. +// +// Each status is assigned a one-to-one numeric code. Any unique result of an +// operation in FrostFS is unambiguously associated with the code value. +// +// Numerical set of codes is split into 1024-element sections. An enumeration +// is defined for each section. Values can be referred to in the following ways: +// +// * numerical value ranging from 0 to 4,294,967,295 (global code); +// +// - values from enumeration (local code). The formula for the ratio of the +// local code (`L`) of a defined section (`S`) to the global one (`G`): +// `G = 1024 * S + L`. +// +// All outcomes are divided into successful and failed, which corresponds +// to the success or failure of the operation. The definition of success +// follows the semantics of RPC and the description of its purpose. +// The server must not attach code that is the opposite of the outcome type. +// +// See the set of return codes in the description for calls. +// +// Each status can carry a developer-facing error message. It should be a human +// readable text in English. The server should not transmit (and the client +// should not expect) useful information in the message. Field `details` +// should make the return more detailed. +type Status struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Code uint32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + xxx_hidden_Message *string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` + xxx_hidden_Details *[]*Status_Detail `protobuf:"bytes,3,rep,name=details" json:"details,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Status) Reset() { + *x = Status{} + mi := &file_api_status_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Status) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Status) ProtoMessage() {} + +func (x *Status) ProtoReflect() protoreflect.Message { + mi := &file_api_status_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Status) GetCode() uint32 { + if x != nil { + return x.xxx_hidden_Code + } + return 0 +} + +func (x *Status) GetMessage() string { + if x != nil { + if x.xxx_hidden_Message != nil { + return *x.xxx_hidden_Message + } + return "" + } + return "" +} + +func (x *Status) GetDetails() []*Status_Detail { + if x != nil { + if x.xxx_hidden_Details != nil { + return *x.xxx_hidden_Details + } + } + return nil +} + +func (x *Status) SetCode(v uint32) { + x.xxx_hidden_Code = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 3) +} + +func (x *Status) SetMessage(v string) { + x.xxx_hidden_Message = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 3) +} + +func (x *Status) SetDetails(v []*Status_Detail) { + x.xxx_hidden_Details = &v +} + +func (x *Status) HasCode() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *Status) HasMessage() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *Status) ClearCode() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Code = 0 +} + +func (x *Status) ClearMessage() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Message = nil +} + +type Status_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The status code + Code *uint32 + // Developer-facing error message + Message *string + // Data detailing the outcome of the operation. Must be unique by ID. + Details []*Status_Detail +} + +func (b0 Status_builder) Build() *Status { + m0 := &Status{} + b, x := &b0, m0 + _, _ = b, x + if b.Code != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 3) + x.xxx_hidden_Code = *b.Code + } + if b.Message != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 3) + x.xxx_hidden_Message = b.Message + } + x.xxx_hidden_Details = &b.Details + return m0 +} + +// Return detail. It contains additional information that can be used to +// analyze the response. Each code defines a set of details that can be +// attached to a status. Client should not handle details that are not +// covered by the code. +type Status_Detail struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Id uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + xxx_hidden_Value []byte `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Status_Detail) Reset() { + *x = Status_Detail{} + mi := &file_api_status_grpc_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Status_Detail) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Status_Detail) ProtoMessage() {} + +func (x *Status_Detail) ProtoReflect() protoreflect.Message { + mi := &file_api_status_grpc_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Status_Detail) GetId() uint32 { + if x != nil { + return x.xxx_hidden_Id + } + return 0 +} + +func (x *Status_Detail) GetValue() []byte { + if x != nil { + return x.xxx_hidden_Value + } + return nil +} + +func (x *Status_Detail) SetId(v uint32) { + x.xxx_hidden_Id = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2) +} + +func (x *Status_Detail) SetValue(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Value = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2) +} + +func (x *Status_Detail) HasId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *Status_Detail) HasValue() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *Status_Detail) ClearId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Id = 0 +} + +func (x *Status_Detail) ClearValue() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Value = nil +} + +type Status_Detail_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Detail ID. The identifier is required to determine the binary format + // of the detail and how to decode it. + Id *uint32 + // Binary status detail. Must follow the format associated with ID. + // The possibility of missing a value must be explicitly allowed. + Value []byte +} + +func (b0 Status_Detail_builder) Build() *Status_Detail { + m0 := &Status_Detail{} + b, x := &b0, m0 + _, _ = b, x + if b.Id != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2) + x.xxx_hidden_Id = *b.Id + } + if b.Value != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2) + x.xxx_hidden_Value = b.Value + } + return m0 +} + +var File_api_status_grpc_types_proto protoreflect.FileDescriptor + +var file_api_status_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, + 0xa1, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x2e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x1a, 0x2e, 0x0a, 0x06, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x2a, 0x93, 0x01, 0x0a, 0x07, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x13, 0x0a, 0x0f, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, + 0x53, 0x53, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, + 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x10, 0x01, + 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4f, 0x42, 0x4a, 0x45, + 0x43, 0x54, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, + 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x53, + 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x04, + 0x12, 0x17, 0x0a, 0x13, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x50, 0x45, 0x5f, + 0x4d, 0x41, 0x4e, 0x41, 0x47, 0x45, 0x52, 0x10, 0x05, 0x2a, 0x11, 0x0a, 0x07, 0x53, 0x75, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, 0x2a, 0x85, 0x01, 0x0a, + 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x12, 0x0c, 0x0a, 0x08, 0x49, + 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x57, 0x52, 0x4f, + 0x4e, 0x47, 0x5f, 0x4d, 0x41, 0x47, 0x49, 0x43, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, + 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x53, 0x49, 0x47, 0x4e, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x56, + 0x45, 0x52, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x49, 0x4c, + 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x4e, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x44, 0x45, 0x52, + 0x5f, 0x4d, 0x41, 0x49, 0x4e, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x03, 0x12, 0x14, + 0x0a, 0x10, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x41, 0x52, 0x47, 0x55, 0x4d, 0x45, + 0x4e, 0x54, 0x10, 0x04, 0x2a, 0x88, 0x01, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, + 0x11, 0x0a, 0x0d, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4e, 0x4f, 0x54, + 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x4f, 0x43, 0x4b, + 0x45, 0x44, 0x10, 0x02, 0x12, 0x1b, 0x0a, 0x17, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x4e, 0x4f, 0x4e, + 0x5f, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, + 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x41, 0x4c, 0x52, 0x45, + 0x41, 0x44, 0x59, 0x5f, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x44, 0x10, 0x04, 0x12, 0x10, 0x0a, + 0x0c, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x05, 0x2a, + 0x55, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x13, + 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, + 0x55, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x41, 0x43, 0x4c, 0x5f, 0x4e, 0x4f, + 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, 0x4e, + 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, + 0x4e, 0x49, 0x45, 0x44, 0x10, 0x02, 0x2a, 0x31, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, + 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, + 0x45, 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x01, 0x2a, 0x2b, 0x0a, 0x0a, 0x41, 0x50, 0x45, + 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x19, 0x41, 0x50, 0x45, 0x5f, 0x4d, + 0x41, 0x4e, 0x41, 0x47, 0x45, 0x52, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, + 0x4e, 0x49, 0x45, 0x44, 0x10, 0x00, 0x42, 0x62, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, + 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, + 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, + 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0xaa, 0x02, 0x1a, + 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x41, 0x50, 0x49, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x62, 0x08, 0x65, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, +} + +var file_api_status_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 7) +var file_api_status_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_api_status_grpc_types_proto_goTypes = []any{ + (Section)(0), // 0: neo.fs.v2.status.Section + (Success)(0), // 1: neo.fs.v2.status.Success + (CommonFail)(0), // 2: neo.fs.v2.status.CommonFail + (Object)(0), // 3: neo.fs.v2.status.Object + (Container)(0), // 4: neo.fs.v2.status.Container + (Session)(0), // 5: neo.fs.v2.status.Session + (APEManager)(0), // 6: neo.fs.v2.status.APEManager + (*Status)(nil), // 7: neo.fs.v2.status.Status + (*Status_Detail)(nil), // 8: neo.fs.v2.status.Status.Detail +} +var file_api_status_grpc_types_proto_depIdxs = []int32{ + 8, // 0: neo.fs.v2.status.Status.details:type_name -> neo.fs.v2.status.Status.Detail + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_api_status_grpc_types_proto_init() } +func file_api_status_grpc_types_proto_init() { + if File_api_status_grpc_types_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_status_grpc_types_proto_rawDesc, + NumEnums: 7, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_status_grpc_types_proto_goTypes, + DependencyIndexes: file_api_status_grpc_types_proto_depIdxs, + EnumInfos: file_api_status_grpc_types_proto_enumTypes, + MessageInfos: file_api_status_grpc_types_proto_msgTypes, + }.Build() + File_api_status_grpc_types_proto = out.File + file_api_status_grpc_types_proto_rawDesc = nil + file_api_status_grpc_types_proto_goTypes = nil + file_api_status_grpc_types_proto_depIdxs = nil +} diff --git a/api/tombstone/grpc/types.pb.go b/api/tombstone/grpc/types.pb.go new file mode 100644 index 0000000..11fc6ce --- /dev/null +++ b/api/tombstone/grpc/types.pb.go @@ -0,0 +1,219 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/tombstone/grpc/types.proto + +//go:build !protoopaque + +package tombstone + +import ( + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Tombstone keeps record of deleted objects for a few epochs until they are +// purged from the FrostFS network. +type Tombstone struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Last FrostFS epoch number of the tombstone lifetime. It's set by the + // tombstone creator depending on the current FrostFS 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" 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" json:"split_id,omitempty"` + // List of objects to be deleted. + Members []*grpc.ObjectID `protobuf:"bytes,3,rep,name=members" json:"members,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Tombstone) Reset() { + *x = Tombstone{} + mi := &file_api_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_api_tombstone_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Tombstone) GetExpirationEpoch() uint64 { + if x != nil && x.ExpirationEpoch != 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 +} + +func (x *Tombstone) SetExpirationEpoch(v uint64) { + x.ExpirationEpoch = &v +} + +func (x *Tombstone) SetSplitId(v []byte) { + if v == nil { + v = []byte{} + } + x.SplitId = v +} + +func (x *Tombstone) SetMembers(v []*grpc.ObjectID) { + x.Members = v +} + +func (x *Tombstone) HasExpirationEpoch() bool { + if x == nil { + return false + } + return x.ExpirationEpoch != nil +} + +func (x *Tombstone) HasSplitId() bool { + if x == nil { + return false + } + return x.SplitId != nil +} + +func (x *Tombstone) ClearExpirationEpoch() { + x.ExpirationEpoch = nil +} + +func (x *Tombstone) ClearSplitId() { + x.SplitId = nil +} + +type Tombstone_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Last FrostFS epoch number of the tombstone lifetime. It's set by the + // tombstone creator depending on the current FrostFS 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 + // 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 + // List of objects to be deleted. + Members []*grpc.ObjectID +} + +func (b0 Tombstone_builder) Build() *Tombstone { + m0 := &Tombstone{} + b, x := &b0, m0 + _, _ = b, x + x.ExpirationEpoch = b.ExpirationEpoch + x.SplitId = b.SplitId + x.Members = b.Members + return m0 +} + +var File_api_tombstone_grpc_types_proto protoreflect.FileDescriptor + +var file_api_tombstone_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x61, 0x70, 0x69, 0x2f, 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, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, + 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 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, 0x6b, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x2e, + 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, + 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, + 0xe8, 0x07, +} + +var file_api_tombstone_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_api_tombstone_grpc_types_proto_goTypes = []any{ + (*Tombstone)(nil), // 0: neo.fs.v2.tombstone.Tombstone + (*grpc.ObjectID)(nil), // 1: neo.fs.v2.refs.ObjectID +} +var file_api_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_api_tombstone_grpc_types_proto_init() } +func file_api_tombstone_grpc_types_proto_init() { + if File_api_tombstone_grpc_types_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_tombstone_grpc_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_tombstone_grpc_types_proto_goTypes, + DependencyIndexes: file_api_tombstone_grpc_types_proto_depIdxs, + MessageInfos: file_api_tombstone_grpc_types_proto_msgTypes, + }.Build() + File_api_tombstone_grpc_types_proto = out.File + file_api_tombstone_grpc_types_proto_rawDesc = nil + file_api_tombstone_grpc_types_proto_goTypes = nil + file_api_tombstone_grpc_types_proto_depIdxs = nil +} diff --git a/api/tombstone/grpc/types_frostfs.pb.go b/api/tombstone/grpc/types_frostfs.pb.go deleted file mode 100644 index df31004..0000000 --- a/api/tombstone/grpc/types_frostfs.pb.go +++ /dev/null @@ -1,264 +0,0 @@ -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package tombstone - -import ( - json "encoding/json" - fmt "fmt" - grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" - pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" - proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto" - encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding" - easyproto "github.com/VictoriaMetrics/easyproto" - jlexer "github.com/mailru/easyjson/jlexer" - jwriter "github.com/mailru/easyjson/jwriter" - strconv "strconv" -) - -type 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.NestedStructureSizeUnchecked(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 { - 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, 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 - } - first := true - 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 !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 !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"members\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Members { - if i != 0 { - out.RawByte(',') - } - x.Members[i].MarshalEasyJSON(out) - } - out.RawByte(']') - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *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 - 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": - { - var f []byte - { - tmp := in.Bytes() - if len(tmp) == 0 { - tmp = nil - } - f = tmp - } - x.SplitId = f - } - case "members": - { - var f grpc.ObjectID - var list []grpc.ObjectID - in.Delim('[') - for !in.IsDelim(']') { - f = grpc.ObjectID{} - f.UnmarshalEasyJSON(in) - list = append(list, f) - in.WantComma() - } - x.Members = list - in.Delim(']') - } - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} diff --git a/api/tombstone/grpc/types_frostfs_fuzz.go b/api/tombstone/grpc/types_frostfs_fuzz.go deleted file mode 100644 index 57cfb58..0000000 --- a/api/tombstone/grpc/types_frostfs_fuzz.go +++ /dev/null @@ -1,26 +0,0 @@ -//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/api/tombstone/grpc/types_frostfs_test.go b/api/tombstone/grpc/types_frostfs_test.go deleted file mode 100644 index 8264824..0000000 --- a/api/tombstone/grpc/types_frostfs_test.go +++ /dev/null @@ -1,21 +0,0 @@ -//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/api/tombstone/grpc/types_protoopaque.pb.go b/api/tombstone/grpc/types_protoopaque.pb.go new file mode 100644 index 0000000..7caeef2 --- /dev/null +++ b/api/tombstone/grpc/types_protoopaque.pb.go @@ -0,0 +1,224 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/tombstone/grpc/types.proto + +//go:build protoopaque + +package tombstone + +import ( + grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Tombstone keeps record of deleted objects for a few epochs until they are +// purged from the FrostFS network. +type Tombstone struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_ExpirationEpoch uint64 `protobuf:"varint,1,opt,name=expiration_epoch,json=expirationEpoch" json:"expiration_epoch,omitempty"` + xxx_hidden_SplitId []byte `protobuf:"bytes,2,opt,name=split_id,json=splitID" json:"split_id,omitempty"` + xxx_hidden_Members *[]*grpc.ObjectID `protobuf:"bytes,3,rep,name=members" json:"members,omitempty"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Tombstone) Reset() { + *x = Tombstone{} + mi := &file_api_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_api_tombstone_grpc_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Tombstone) GetExpirationEpoch() uint64 { + if x != nil { + return x.xxx_hidden_ExpirationEpoch + } + return 0 +} + +func (x *Tombstone) GetSplitId() []byte { + if x != nil { + return x.xxx_hidden_SplitId + } + return nil +} + +func (x *Tombstone) GetMembers() []*grpc.ObjectID { + if x != nil { + if x.xxx_hidden_Members != nil { + return *x.xxx_hidden_Members + } + } + return nil +} + +func (x *Tombstone) SetExpirationEpoch(v uint64) { + x.xxx_hidden_ExpirationEpoch = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 3) +} + +func (x *Tombstone) SetSplitId(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_SplitId = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 3) +} + +func (x *Tombstone) SetMembers(v []*grpc.ObjectID) { + x.xxx_hidden_Members = &v +} + +func (x *Tombstone) HasExpirationEpoch() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *Tombstone) HasSplitId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *Tombstone) ClearExpirationEpoch() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_ExpirationEpoch = 0 +} + +func (x *Tombstone) ClearSplitId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_SplitId = nil +} + +type Tombstone_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Last FrostFS epoch number of the tombstone lifetime. It's set by the + // tombstone creator depending on the current FrostFS 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 + // 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 + // List of objects to be deleted. + Members []*grpc.ObjectID +} + +func (b0 Tombstone_builder) Build() *Tombstone { + m0 := &Tombstone{} + b, x := &b0, m0 + _, _ = b, x + if b.ExpirationEpoch != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 3) + x.xxx_hidden_ExpirationEpoch = *b.ExpirationEpoch + } + if b.SplitId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 3) + x.xxx_hidden_SplitId = b.SplitId + } + x.xxx_hidden_Members = &b.Members + return m0 +} + +var File_api_tombstone_grpc_types_proto protoreflect.FileDescriptor + +var file_api_tombstone_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x61, 0x70, 0x69, 0x2f, 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, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, + 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 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, 0x6b, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x2e, + 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, + 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, + 0xe8, 0x07, +} + +var file_api_tombstone_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_api_tombstone_grpc_types_proto_goTypes = []any{ + (*Tombstone)(nil), // 0: neo.fs.v2.tombstone.Tombstone + (*grpc.ObjectID)(nil), // 1: neo.fs.v2.refs.ObjectID +} +var file_api_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_api_tombstone_grpc_types_proto_init() } +func file_api_tombstone_grpc_types_proto_init() { + if File_api_tombstone_grpc_types_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_tombstone_grpc_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_tombstone_grpc_types_proto_goTypes, + DependencyIndexes: file_api_tombstone_grpc_types_proto_depIdxs, + MessageInfos: file_api_tombstone_grpc_types_proto_msgTypes, + }.Build() + File_api_tombstone_grpc_types_proto = out.File + file_api_tombstone_grpc_types_proto_rawDesc = nil + file_api_tombstone_grpc_types_proto_goTypes = nil + file_api_tombstone_grpc_types_proto_depIdxs = nil +} diff --git a/object/raw_test.go b/object/raw_test.go index 56bbe86..914ea11 100644 --- a/object/raw_test.go +++ b/object/raw_test.go @@ -303,6 +303,10 @@ func TestObjectEncoding(t *testing.T) { o2 := New() require.NoError(t, o2.UnmarshalJSON(data)) + // New protobuf generator replaces nil payload with []byte{} in setters. + require.Empty(t, o2.Payload()) + o2.SetPayload(nil) + require.Equal(t, o, o2) }) } From 4b4f35bbac91fbaacd0dbb6e493c2dff45eb0783 Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Tue, 21 Jan 2025 14:32:02 +0300 Subject: [PATCH 137/197] [#320] make/proto: Add installing protoc-gen-go-grpc Signed-off-by: Alexander Chuprov --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index eab6ec1..27bff9b 100755 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ LINT_DIR = $(OUTPUT_LINT_DIR)/golangci-lint-$(LINT_VERSION)-v$(TRUECLOUDLAB_LINT PROTOC_VERSION ?= 29.2 PROTOC_GEN_GO_VERSION ?= $(shell go list -f '{{.Version}}' -m google.golang.org/protobuf) +PROTOC_GEN_GRPC_GO_VERSION ?= 1.5.1 PROTOC_OS_VERSION=osx-x86_64 ifeq ($(shell uname), Linux) PROTOC_OS_VERSION=linux-x86_64 @@ -44,6 +45,8 @@ protoc-install: @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) + @echo "⇒ Installing protoc-gen-go-grpc..." + @GOBIN=$(PROTOC_GEN_GO_DIR) go install -v google.golang.org/grpc/cmd/protoc-gen-go-grpc@v$(PROTOC_GEN_GRPC_GO_VERSION) # Regenerate code for proto files @@ -56,6 +59,7 @@ protoc: echo "⇒ Processing $$f "; \ $(PROTOC_DIR)/bin/protoc \ --plugin=protoc-gen-go=$(PROTOC_GEN_GO_DIR)/protoc-gen-go \ + --plugin=protoc-gen-go-grpc=$(PROTOC_GEN_GO_DIR)/protoc-gen-go-grpc \ --go_out=. --go_opt=paths=source_relative \ --go_opt=default_api_level=API_HYBRID \ --go-grpc_opt=require_unimplemented_servers=false \ From 7c577ecaebded917a518bc3d58dd1980fa6c04af Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Tue, 21 Jan 2025 14:33:23 +0300 Subject: [PATCH 138/197] [#320] api: Run 'make proto' Signed-off-by: Alexander Chuprov --- api/util/proto/test/test.pb.go | 528 +++++++++---- api/util/proto/test/test_protoopaque.pb.go | 817 +++++++++++++++++++++ 2 files changed, 1182 insertions(+), 163 deletions(-) create mode 100644 api/util/proto/test/test_protoopaque.pb.go diff --git a/api/util/proto/test/test.pb.go b/api/util/proto/test/test.pb.go index ba190d6..bbf1381 100644 --- a/api/util/proto/test/test.pb.go +++ b/api/util/proto/test/test.pb.go @@ -1,16 +1,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.33.0 -// protoc v5.27.2 +// protoc-gen-go v1.36.1 +// protoc v5.29.2 // source: api/util/proto/test/test.proto +//go:build !protoopaque + package test import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - sync "sync" ) const ( @@ -64,42 +65,34 @@ func (x Primitives_SomeEnum) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// Deprecated: Use Primitives_SomeEnum.Descriptor instead. -func (Primitives_SomeEnum) EnumDescriptor() ([]byte, []int) { - return file_api_util_proto_test_test_proto_rawDescGZIP(), []int{0, 0} -} - type Primitives struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - FieldA []byte `protobuf:"bytes,1,opt,name=field_a,json=fieldA,proto3" json:"field_a,omitempty"` - FieldB string `protobuf:"bytes,2,opt,name=field_b,json=fieldB,proto3" json:"field_b,omitempty"` - FieldC bool `protobuf:"varint,200,opt,name=field_c,json=fieldC,proto3" json:"field_c,omitempty"` - FieldD int32 `protobuf:"varint,201,opt,name=field_d,json=fieldD,proto3" json:"field_d,omitempty"` - FieldE uint32 `protobuf:"varint,202,opt,name=field_e,json=fieldE,proto3" json:"field_e,omitempty"` - FieldF int64 `protobuf:"varint,203,opt,name=field_f,json=fieldF,proto3" json:"field_f,omitempty"` - FieldG uint64 `protobuf:"varint,204,opt,name=field_g,json=fieldG,proto3" json:"field_g,omitempty"` - FieldI uint64 `protobuf:"fixed64,205,opt,name=field_i,json=fieldI,proto3" json:"field_i,omitempty"` - 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: + state protoimpl.MessageState `protogen:"hybrid.v1"` + FieldA []byte `protobuf:"bytes,1,opt,name=field_a,json=fieldA,proto3" json:"field_a,omitempty"` + FieldB string `protobuf:"bytes,2,opt,name=field_b,json=fieldB,proto3" json:"field_b,omitempty"` + FieldC bool `protobuf:"varint,200,opt,name=field_c,json=fieldC,proto3" json:"field_c,omitempty"` + FieldD int32 `protobuf:"varint,201,opt,name=field_d,json=fieldD,proto3" json:"field_d,omitempty"` + FieldE uint32 `protobuf:"varint,202,opt,name=field_e,json=fieldE,proto3" json:"field_e,omitempty"` + FieldF int64 `protobuf:"varint,203,opt,name=field_f,json=fieldF,proto3" json:"field_f,omitempty"` + FieldG uint64 `protobuf:"varint,204,opt,name=field_g,json=fieldG,proto3" json:"field_g,omitempty"` + FieldI uint64 `protobuf:"fixed64,205,opt,name=field_i,json=fieldI,proto3" json:"field_i,omitempty"` + 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 valid to be assigned to FieldM: // // *Primitives_FieldMa // *Primitives_FieldMe // *Primitives_FieldAux - FieldM isPrimitives_FieldM `protobuf_oneof:"field_m"` + FieldM isPrimitives_FieldM `protobuf_oneof:"field_m"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Primitives) Reset() { *x = Primitives{} - if protoimpl.UnsafeEnabled { - mi := &file_api_util_proto_test_test_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_api_util_proto_test_test_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Primitives) String() string { @@ -110,7 +103,7 @@ func (*Primitives) ProtoMessage() {} func (x *Primitives) ProtoReflect() protoreflect.Message { mi := &file_api_util_proto_test_test_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -120,11 +113,6 @@ func (x *Primitives) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Primitives.ProtoReflect.Descriptor instead. -func (*Primitives) Descriptor() ([]byte, []int) { - return file_api_util_proto_test_test_proto_rawDescGZIP(), []int{0} -} - func (x *Primitives) GetFieldA() []byte { if x != nil { return x.FieldA @@ -202,34 +190,238 @@ func (x *Primitives) GetFieldH() Primitives_SomeEnum { return Primitives_UNKNOWN } -func (m *Primitives) GetFieldM() isPrimitives_FieldM { - if m != nil { - return m.FieldM +func (x *Primitives) GetFieldM() isPrimitives_FieldM { + if x != nil { + return x.FieldM } return nil } func (x *Primitives) GetFieldMa() []byte { - if x, ok := x.GetFieldM().(*Primitives_FieldMa); ok { - return x.FieldMa + if x != nil { + if x, ok := x.FieldM.(*Primitives_FieldMa); ok { + return x.FieldMa + } } return nil } func (x *Primitives) GetFieldMe() uint32 { - if x, ok := x.GetFieldM().(*Primitives_FieldMe); ok { - return x.FieldMe + if x != nil { + if x, ok := x.FieldM.(*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 + if x != nil { + if x, ok := x.FieldM.(*Primitives_FieldAux); ok { + return x.FieldAux + } } return nil } +func (x *Primitives) SetFieldA(v []byte) { + if v == nil { + v = []byte{} + } + x.FieldA = v +} + +func (x *Primitives) SetFieldB(v string) { + x.FieldB = v +} + +func (x *Primitives) SetFieldC(v bool) { + x.FieldC = v +} + +func (x *Primitives) SetFieldD(v int32) { + x.FieldD = v +} + +func (x *Primitives) SetFieldE(v uint32) { + x.FieldE = v +} + +func (x *Primitives) SetFieldF(v int64) { + x.FieldF = v +} + +func (x *Primitives) SetFieldG(v uint64) { + x.FieldG = v +} + +func (x *Primitives) SetFieldI(v uint64) { + x.FieldI = v +} + +func (x *Primitives) SetFieldJ(v float64) { + x.FieldJ = v +} + +func (x *Primitives) SetFieldK(v uint32) { + x.FieldK = v +} + +func (x *Primitives) SetFieldH(v Primitives_SomeEnum) { + x.FieldH = v +} + +func (x *Primitives) SetFieldMa(v []byte) { + if v == nil { + v = []byte{} + } + x.FieldM = &Primitives_FieldMa{v} +} + +func (x *Primitives) SetFieldMe(v uint32) { + x.FieldM = &Primitives_FieldMe{v} +} + +func (x *Primitives) SetFieldAux(v *Primitives_Aux) { + if v == nil { + x.FieldM = nil + return + } + x.FieldM = &Primitives_FieldAux{v} +} + +func (x *Primitives) HasFieldM() bool { + if x == nil { + return false + } + return x.FieldM != nil +} + +func (x *Primitives) HasFieldMa() bool { + if x == nil { + return false + } + _, ok := x.FieldM.(*Primitives_FieldMa) + return ok +} + +func (x *Primitives) HasFieldMe() bool { + if x == nil { + return false + } + _, ok := x.FieldM.(*Primitives_FieldMe) + return ok +} + +func (x *Primitives) HasFieldAux() bool { + if x == nil { + return false + } + _, ok := x.FieldM.(*Primitives_FieldAux) + return ok +} + +func (x *Primitives) ClearFieldM() { + x.FieldM = nil +} + +func (x *Primitives) ClearFieldMa() { + if _, ok := x.FieldM.(*Primitives_FieldMa); ok { + x.FieldM = nil + } +} + +func (x *Primitives) ClearFieldMe() { + if _, ok := x.FieldM.(*Primitives_FieldMe); ok { + x.FieldM = nil + } +} + +func (x *Primitives) ClearFieldAux() { + if _, ok := x.FieldM.(*Primitives_FieldAux); ok { + x.FieldM = nil + } +} + +const Primitives_FieldM_not_set_case case_Primitives_FieldM = 0 +const Primitives_FieldMa_case case_Primitives_FieldM = 401 +const Primitives_FieldMe_case case_Primitives_FieldM = 402 +const Primitives_FieldAux_case case_Primitives_FieldM = 403 + +func (x *Primitives) WhichFieldM() case_Primitives_FieldM { + if x == nil { + return Primitives_FieldM_not_set_case + } + switch x.FieldM.(type) { + case *Primitives_FieldMa: + return Primitives_FieldMa_case + case *Primitives_FieldMe: + return Primitives_FieldMe_case + case *Primitives_FieldAux: + return Primitives_FieldAux_case + default: + return Primitives_FieldM_not_set_case + } +} + +type Primitives_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + FieldA []byte + FieldB string + FieldC bool + FieldD int32 + FieldE uint32 + FieldF int64 + FieldG uint64 + FieldI uint64 + FieldJ float64 + FieldK uint32 + FieldH Primitives_SomeEnum + // Fields of oneof FieldM: + FieldMa []byte + FieldMe *uint32 + FieldAux *Primitives_Aux + // -- end of FieldM +} + +func (b0 Primitives_builder) Build() *Primitives { + m0 := &Primitives{} + b, x := &b0, m0 + _, _ = b, x + x.FieldA = b.FieldA + x.FieldB = b.FieldB + x.FieldC = b.FieldC + x.FieldD = b.FieldD + x.FieldE = b.FieldE + x.FieldF = b.FieldF + x.FieldG = b.FieldG + x.FieldI = b.FieldI + x.FieldJ = b.FieldJ + x.FieldK = b.FieldK + x.FieldH = b.FieldH + if b.FieldMa != nil { + x.FieldM = &Primitives_FieldMa{b.FieldMa} + } + if b.FieldMe != nil { + x.FieldM = &Primitives_FieldMe{*b.FieldMe} + } + if b.FieldAux != nil { + x.FieldM = &Primitives_FieldAux{b.FieldAux} + } + return m0 +} + +type case_Primitives_FieldM protoreflect.FieldNumber + +func (x case_Primitives_FieldM) String() string { + md := file_api_util_proto_test_test_proto_msgTypes[0].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + type isPrimitives_FieldM interface { isPrimitives_FieldM() } @@ -253,27 +445,24 @@ func (*Primitives_FieldMe) isPrimitives_FieldM() {} func (*Primitives_FieldAux) isPrimitives_FieldM() {} type RepPrimitives struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"hybrid.v1"` + 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"` 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"` - FieldAux []*RepPrimitives_Aux `protobuf:"bytes,8,rep,name=field_aux,json=fieldAux,proto3" json:"field_aux,omitempty"` + sizeCache protoimpl.SizeCache } func (x *RepPrimitives) Reset() { *x = RepPrimitives{} - if protoimpl.UnsafeEnabled { - mi := &file_api_util_proto_test_test_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_api_util_proto_test_test_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *RepPrimitives) String() string { @@ -284,7 +473,7 @@ func (*RepPrimitives) ProtoMessage() {} func (x *RepPrimitives) ProtoReflect() protoreflect.Message { mi := &file_api_util_proto_test_test_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -294,11 +483,6 @@ func (x *RepPrimitives) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use RepPrimitives.ProtoReflect.Descriptor instead. -func (*RepPrimitives) Descriptor() ([]byte, []int) { - return file_api_util_proto_test_test_proto_rawDescGZIP(), []int{1} -} - func (x *RepPrimitives) GetFieldA() [][]byte { if x != nil { return x.FieldA @@ -355,21 +539,78 @@ func (x *RepPrimitives) GetFieldAux() []*RepPrimitives_Aux { return nil } -type Primitives_Aux struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields +func (x *RepPrimitives) SetFieldA(v [][]byte) { + x.FieldA = v +} - InnerField uint32 `protobuf:"varint,1,opt,name=inner_field,json=innerField,proto3" json:"inner_field,omitempty"` +func (x *RepPrimitives) SetFieldB(v []string) { + x.FieldB = v +} + +func (x *RepPrimitives) SetFieldC(v []int32) { + x.FieldC = v +} + +func (x *RepPrimitives) SetFieldD(v []uint32) { + x.FieldD = v +} + +func (x *RepPrimitives) SetFieldE(v []int64) { + x.FieldE = v +} + +func (x *RepPrimitives) SetFieldF(v []uint64) { + x.FieldF = v +} + +func (x *RepPrimitives) SetFieldFu(v []uint64) { + x.FieldFu = v +} + +func (x *RepPrimitives) SetFieldAux(v []*RepPrimitives_Aux) { + x.FieldAux = v +} + +type RepPrimitives_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + FieldA [][]byte + FieldB []string + FieldC []int32 + FieldD []uint32 + FieldE []int64 + FieldF []uint64 + FieldFu []uint64 + FieldAux []*RepPrimitives_Aux +} + +func (b0 RepPrimitives_builder) Build() *RepPrimitives { + m0 := &RepPrimitives{} + b, x := &b0, m0 + _, _ = b, x + x.FieldA = b.FieldA + x.FieldB = b.FieldB + x.FieldC = b.FieldC + x.FieldD = b.FieldD + x.FieldE = b.FieldE + x.FieldF = b.FieldF + x.FieldFu = b.FieldFu + x.FieldAux = b.FieldAux + return m0 +} + +type Primitives_Aux struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + InnerField uint32 `protobuf:"varint,1,opt,name=inner_field,json=innerField,proto3" json:"inner_field,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Primitives_Aux) Reset() { *x = Primitives_Aux{} - if protoimpl.UnsafeEnabled { - mi := &file_api_util_proto_test_test_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_api_util_proto_test_test_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Primitives_Aux) String() string { @@ -380,7 +621,7 @@ func (*Primitives_Aux) ProtoMessage() {} func (x *Primitives_Aux) ProtoReflect() protoreflect.Message { mi := &file_api_util_proto_test_test_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -390,11 +631,6 @@ func (x *Primitives_Aux) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Primitives_Aux.ProtoReflect.Descriptor instead. -func (*Primitives_Aux) Descriptor() ([]byte, []int) { - return file_api_util_proto_test_test_proto_rawDescGZIP(), []int{0, 0} -} - func (x *Primitives_Aux) GetInnerField() uint32 { if x != nil { return x.InnerField @@ -402,21 +638,36 @@ func (x *Primitives_Aux) GetInnerField() uint32 { return 0 } -type RepPrimitives_Aux struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields +func (x *Primitives_Aux) SetInnerField(v uint32) { + x.InnerField = v +} - InnerField uint32 `protobuf:"varint,1,opt,name=inner_field,json=innerField,proto3" json:"inner_field,omitempty"` +type Primitives_Aux_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + InnerField uint32 +} + +func (b0 Primitives_Aux_builder) Build() *Primitives_Aux { + m0 := &Primitives_Aux{} + b, x := &b0, m0 + _, _ = b, x + x.InnerField = b.InnerField + return m0 +} + +type RepPrimitives_Aux struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + InnerField uint32 `protobuf:"varint,1,opt,name=inner_field,json=innerField,proto3" json:"inner_field,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *RepPrimitives_Aux) Reset() { *x = RepPrimitives_Aux{} - if protoimpl.UnsafeEnabled { - mi := &file_api_util_proto_test_test_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_api_util_proto_test_test_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *RepPrimitives_Aux) String() string { @@ -427,7 +678,7 @@ func (*RepPrimitives_Aux) ProtoMessage() {} func (x *RepPrimitives_Aux) ProtoReflect() protoreflect.Message { mi := &file_api_util_proto_test_test_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -437,11 +688,6 @@ func (x *RepPrimitives_Aux) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use RepPrimitives_Aux.ProtoReflect.Descriptor instead. -func (*RepPrimitives_Aux) Descriptor() ([]byte, []int) { - return file_api_util_proto_test_test_proto_rawDescGZIP(), []int{1, 0} -} - func (x *RepPrimitives_Aux) GetInnerField() uint32 { if x != nil { return x.InnerField @@ -449,6 +695,24 @@ func (x *RepPrimitives_Aux) GetInnerField() uint32 { return 0 } +func (x *RepPrimitives_Aux) SetInnerField(v uint32) { + x.InnerField = v +} + +type RepPrimitives_Aux_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + InnerField uint32 +} + +func (b0 RepPrimitives_Aux_builder) Build() *RepPrimitives_Aux { + m0 := &RepPrimitives_Aux{} + b, x := &b0, m0 + _, _ = b, x + x.InnerField = b.InnerField + return m0 +} + var File_api_util_proto_test_test_proto protoreflect.FileDescriptor var file_api_util_proto_test_test_proto_rawDesc = []byte{ @@ -511,21 +775,9 @@ var file_api_util_proto_test_test_proto_rawDesc = []byte{ 0x74, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var ( - file_api_util_proto_test_test_proto_rawDescOnce sync.Once - file_api_util_proto_test_test_proto_rawDescData = file_api_util_proto_test_test_proto_rawDesc -) - -func file_api_util_proto_test_test_proto_rawDescGZIP() []byte { - file_api_util_proto_test_test_proto_rawDescOnce.Do(func() { - file_api_util_proto_test_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_util_proto_test_test_proto_rawDescData) - }) - return file_api_util_proto_test_test_proto_rawDescData -} - var file_api_util_proto_test_test_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_api_util_proto_test_test_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_api_util_proto_test_test_proto_goTypes = []interface{}{ +var file_api_util_proto_test_test_proto_goTypes = []any{ (Primitives_SomeEnum)(0), // 0: test.Primitives.SomeEnum (*Primitives)(nil), // 1: test.Primitives (*RepPrimitives)(nil), // 2: test.RepPrimitives @@ -548,57 +800,7 @@ func file_api_util_proto_test_test_proto_init() { if File_api_util_proto_test_test_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_api_util_proto_test_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Primitives); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_util_proto_test_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RepPrimitives); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_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_api_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_api_util_proto_test_test_proto_msgTypes[0].OneofWrappers = []interface{}{ + file_api_util_proto_test_test_proto_msgTypes[0].OneofWrappers = []any{ (*Primitives_FieldMa)(nil), (*Primitives_FieldMe)(nil), (*Primitives_FieldAux)(nil), diff --git a/api/util/proto/test/test_protoopaque.pb.go b/api/util/proto/test/test_protoopaque.pb.go new file mode 100644 index 0000000..29ce3b7 --- /dev/null +++ b/api/util/proto/test/test_protoopaque.pb.go @@ -0,0 +1,817 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v5.29.2 +// source: api/util/proto/test/test.proto + +//go:build protoopaque + +package test + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Primitives_SomeEnum int32 + +const ( + Primitives_UNKNOWN Primitives_SomeEnum = 0 + Primitives_POSITIVE Primitives_SomeEnum = 1 + Primitives_NEGATIVE Primitives_SomeEnum = -1 +) + +// Enum value maps for Primitives_SomeEnum. +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) Enum() *Primitives_SomeEnum { + p := new(Primitives_SomeEnum) + *p = x + return p +} + +func (x Primitives_SomeEnum) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Primitives_SomeEnum) Descriptor() protoreflect.EnumDescriptor { + return file_api_util_proto_test_test_proto_enumTypes[0].Descriptor() +} + +func (Primitives_SomeEnum) Type() protoreflect.EnumType { + return &file_api_util_proto_test_test_proto_enumTypes[0] +} + +func (x Primitives_SomeEnum) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +type Primitives struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_FieldA []byte `protobuf:"bytes,1,opt,name=field_a,json=fieldA,proto3" json:"field_a,omitempty"` + xxx_hidden_FieldB string `protobuf:"bytes,2,opt,name=field_b,json=fieldB,proto3" json:"field_b,omitempty"` + xxx_hidden_FieldC bool `protobuf:"varint,200,opt,name=field_c,json=fieldC,proto3" json:"field_c,omitempty"` + xxx_hidden_FieldD int32 `protobuf:"varint,201,opt,name=field_d,json=fieldD,proto3" json:"field_d,omitempty"` + xxx_hidden_FieldE uint32 `protobuf:"varint,202,opt,name=field_e,json=fieldE,proto3" json:"field_e,omitempty"` + xxx_hidden_FieldF int64 `protobuf:"varint,203,opt,name=field_f,json=fieldF,proto3" json:"field_f,omitempty"` + xxx_hidden_FieldG uint64 `protobuf:"varint,204,opt,name=field_g,json=fieldG,proto3" json:"field_g,omitempty"` + xxx_hidden_FieldI uint64 `protobuf:"fixed64,205,opt,name=field_i,json=fieldI,proto3" json:"field_i,omitempty"` + xxx_hidden_FieldJ float64 `protobuf:"fixed64,206,opt,name=field_j,json=fieldJ,proto3" json:"field_j,omitempty"` + xxx_hidden_FieldK uint32 `protobuf:"fixed32,207,opt,name=field_k,json=fieldK,proto3" json:"field_k,omitempty"` + xxx_hidden_FieldH Primitives_SomeEnum `protobuf:"varint,300,opt,name=field_h,json=fieldH,proto3,enum=test.Primitives_SomeEnum" json:"field_h,omitempty"` + xxx_hidden_FieldM isPrimitives_FieldM `protobuf_oneof:"field_m"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Primitives) Reset() { + *x = Primitives{} + mi := &file_api_util_proto_test_test_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Primitives) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Primitives) ProtoMessage() {} + +func (x *Primitives) ProtoReflect() protoreflect.Message { + mi := &file_api_util_proto_test_test_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Primitives) GetFieldA() []byte { + if x != nil { + return x.xxx_hidden_FieldA + } + return nil +} + +func (x *Primitives) GetFieldB() string { + if x != nil { + return x.xxx_hidden_FieldB + } + return "" +} + +func (x *Primitives) GetFieldC() bool { + if x != nil { + return x.xxx_hidden_FieldC + } + return false +} + +func (x *Primitives) GetFieldD() int32 { + if x != nil { + return x.xxx_hidden_FieldD + } + return 0 +} + +func (x *Primitives) GetFieldE() uint32 { + if x != nil { + return x.xxx_hidden_FieldE + } + return 0 +} + +func (x *Primitives) GetFieldF() int64 { + if x != nil { + return x.xxx_hidden_FieldF + } + return 0 +} + +func (x *Primitives) GetFieldG() uint64 { + if x != nil { + return x.xxx_hidden_FieldG + } + return 0 +} + +func (x *Primitives) GetFieldI() uint64 { + if x != nil { + return x.xxx_hidden_FieldI + } + return 0 +} + +func (x *Primitives) GetFieldJ() float64 { + if x != nil { + return x.xxx_hidden_FieldJ + } + return 0 +} + +func (x *Primitives) GetFieldK() uint32 { + if x != nil { + return x.xxx_hidden_FieldK + } + return 0 +} + +func (x *Primitives) GetFieldH() Primitives_SomeEnum { + if x != nil { + return x.xxx_hidden_FieldH + } + return Primitives_UNKNOWN +} + +func (x *Primitives) GetFieldMa() []byte { + if x != nil { + if x, ok := x.xxx_hidden_FieldM.(*primitives_FieldMa); ok { + return x.FieldMa + } + } + return nil +} + +func (x *Primitives) GetFieldMe() uint32 { + if x != nil { + if x, ok := x.xxx_hidden_FieldM.(*primitives_FieldMe); ok { + return x.FieldMe + } + } + return 0 +} + +func (x *Primitives) GetFieldAux() *Primitives_Aux { + if x != nil { + if x, ok := x.xxx_hidden_FieldM.(*primitives_FieldAux); ok { + return x.FieldAux + } + } + return nil +} + +func (x *Primitives) SetFieldA(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_FieldA = v +} + +func (x *Primitives) SetFieldB(v string) { + x.xxx_hidden_FieldB = v +} + +func (x *Primitives) SetFieldC(v bool) { + x.xxx_hidden_FieldC = v +} + +func (x *Primitives) SetFieldD(v int32) { + x.xxx_hidden_FieldD = v +} + +func (x *Primitives) SetFieldE(v uint32) { + x.xxx_hidden_FieldE = v +} + +func (x *Primitives) SetFieldF(v int64) { + x.xxx_hidden_FieldF = v +} + +func (x *Primitives) SetFieldG(v uint64) { + x.xxx_hidden_FieldG = v +} + +func (x *Primitives) SetFieldI(v uint64) { + x.xxx_hidden_FieldI = v +} + +func (x *Primitives) SetFieldJ(v float64) { + x.xxx_hidden_FieldJ = v +} + +func (x *Primitives) SetFieldK(v uint32) { + x.xxx_hidden_FieldK = v +} + +func (x *Primitives) SetFieldH(v Primitives_SomeEnum) { + x.xxx_hidden_FieldH = v +} + +func (x *Primitives) SetFieldMa(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_FieldM = &primitives_FieldMa{v} +} + +func (x *Primitives) SetFieldMe(v uint32) { + x.xxx_hidden_FieldM = &primitives_FieldMe{v} +} + +func (x *Primitives) SetFieldAux(v *Primitives_Aux) { + if v == nil { + x.xxx_hidden_FieldM = nil + return + } + x.xxx_hidden_FieldM = &primitives_FieldAux{v} +} + +func (x *Primitives) HasFieldM() bool { + if x == nil { + return false + } + return x.xxx_hidden_FieldM != nil +} + +func (x *Primitives) HasFieldMa() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_FieldM.(*primitives_FieldMa) + return ok +} + +func (x *Primitives) HasFieldMe() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_FieldM.(*primitives_FieldMe) + return ok +} + +func (x *Primitives) HasFieldAux() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_FieldM.(*primitives_FieldAux) + return ok +} + +func (x *Primitives) ClearFieldM() { + x.xxx_hidden_FieldM = nil +} + +func (x *Primitives) ClearFieldMa() { + if _, ok := x.xxx_hidden_FieldM.(*primitives_FieldMa); ok { + x.xxx_hidden_FieldM = nil + } +} + +func (x *Primitives) ClearFieldMe() { + if _, ok := x.xxx_hidden_FieldM.(*primitives_FieldMe); ok { + x.xxx_hidden_FieldM = nil + } +} + +func (x *Primitives) ClearFieldAux() { + if _, ok := x.xxx_hidden_FieldM.(*primitives_FieldAux); ok { + x.xxx_hidden_FieldM = nil + } +} + +const Primitives_FieldM_not_set_case case_Primitives_FieldM = 0 +const Primitives_FieldMa_case case_Primitives_FieldM = 401 +const Primitives_FieldMe_case case_Primitives_FieldM = 402 +const Primitives_FieldAux_case case_Primitives_FieldM = 403 + +func (x *Primitives) WhichFieldM() case_Primitives_FieldM { + if x == nil { + return Primitives_FieldM_not_set_case + } + switch x.xxx_hidden_FieldM.(type) { + case *primitives_FieldMa: + return Primitives_FieldMa_case + case *primitives_FieldMe: + return Primitives_FieldMe_case + case *primitives_FieldAux: + return Primitives_FieldAux_case + default: + return Primitives_FieldM_not_set_case + } +} + +type Primitives_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + FieldA []byte + FieldB string + FieldC bool + FieldD int32 + FieldE uint32 + FieldF int64 + FieldG uint64 + FieldI uint64 + FieldJ float64 + FieldK uint32 + FieldH Primitives_SomeEnum + // Fields of oneof xxx_hidden_FieldM: + FieldMa []byte + FieldMe *uint32 + FieldAux *Primitives_Aux + // -- end of xxx_hidden_FieldM +} + +func (b0 Primitives_builder) Build() *Primitives { + m0 := &Primitives{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_FieldA = b.FieldA + x.xxx_hidden_FieldB = b.FieldB + x.xxx_hidden_FieldC = b.FieldC + x.xxx_hidden_FieldD = b.FieldD + x.xxx_hidden_FieldE = b.FieldE + x.xxx_hidden_FieldF = b.FieldF + x.xxx_hidden_FieldG = b.FieldG + x.xxx_hidden_FieldI = b.FieldI + x.xxx_hidden_FieldJ = b.FieldJ + x.xxx_hidden_FieldK = b.FieldK + x.xxx_hidden_FieldH = b.FieldH + if b.FieldMa != nil { + x.xxx_hidden_FieldM = &primitives_FieldMa{b.FieldMa} + } + if b.FieldMe != nil { + x.xxx_hidden_FieldM = &primitives_FieldMe{*b.FieldMe} + } + if b.FieldAux != nil { + x.xxx_hidden_FieldM = &primitives_FieldAux{b.FieldAux} + } + return m0 +} + +type case_Primitives_FieldM protoreflect.FieldNumber + +func (x case_Primitives_FieldM) String() string { + md := file_api_util_proto_test_test_proto_msgTypes[0].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +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 `protogen:"opaque.v1"` + xxx_hidden_FieldA [][]byte `protobuf:"bytes,1,rep,name=field_a,json=fieldA,proto3" json:"field_a,omitempty"` + xxx_hidden_FieldB []string `protobuf:"bytes,2,rep,name=field_b,json=fieldB,proto3" json:"field_b,omitempty"` + xxx_hidden_FieldC []int32 `protobuf:"varint,3,rep,packed,name=field_c,json=fieldC,proto3" json:"field_c,omitempty"` + xxx_hidden_FieldD []uint32 `protobuf:"varint,4,rep,packed,name=field_d,json=fieldD,proto3" json:"field_d,omitempty"` + xxx_hidden_FieldE []int64 `protobuf:"varint,5,rep,packed,name=field_e,json=fieldE,proto3" json:"field_e,omitempty"` + xxx_hidden_FieldF []uint64 `protobuf:"varint,6,rep,packed,name=field_f,json=fieldF,proto3" json:"field_f,omitempty"` + xxx_hidden_FieldFu []uint64 `protobuf:"varint,7,rep,name=field_fu,json=fieldFu,proto3" json:"field_fu,omitempty"` + xxx_hidden_FieldAux *[]*RepPrimitives_Aux `protobuf:"bytes,8,rep,name=field_aux,json=fieldAux,proto3" json:"field_aux,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RepPrimitives) Reset() { + *x = RepPrimitives{} + mi := &file_api_util_proto_test_test_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RepPrimitives) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RepPrimitives) ProtoMessage() {} + +func (x *RepPrimitives) ProtoReflect() protoreflect.Message { + mi := &file_api_util_proto_test_test_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *RepPrimitives) GetFieldA() [][]byte { + if x != nil { + return x.xxx_hidden_FieldA + } + return nil +} + +func (x *RepPrimitives) GetFieldB() []string { + if x != nil { + return x.xxx_hidden_FieldB + } + return nil +} + +func (x *RepPrimitives) GetFieldC() []int32 { + if x != nil { + return x.xxx_hidden_FieldC + } + return nil +} + +func (x *RepPrimitives) GetFieldD() []uint32 { + if x != nil { + return x.xxx_hidden_FieldD + } + return nil +} + +func (x *RepPrimitives) GetFieldE() []int64 { + if x != nil { + return x.xxx_hidden_FieldE + } + return nil +} + +func (x *RepPrimitives) GetFieldF() []uint64 { + if x != nil { + return x.xxx_hidden_FieldF + } + return nil +} + +func (x *RepPrimitives) GetFieldFu() []uint64 { + if x != nil { + return x.xxx_hidden_FieldFu + } + return nil +} + +func (x *RepPrimitives) GetFieldAux() []*RepPrimitives_Aux { + if x != nil { + if x.xxx_hidden_FieldAux != nil { + return *x.xxx_hidden_FieldAux + } + } + return nil +} + +func (x *RepPrimitives) SetFieldA(v [][]byte) { + x.xxx_hidden_FieldA = v +} + +func (x *RepPrimitives) SetFieldB(v []string) { + x.xxx_hidden_FieldB = v +} + +func (x *RepPrimitives) SetFieldC(v []int32) { + x.xxx_hidden_FieldC = v +} + +func (x *RepPrimitives) SetFieldD(v []uint32) { + x.xxx_hidden_FieldD = v +} + +func (x *RepPrimitives) SetFieldE(v []int64) { + x.xxx_hidden_FieldE = v +} + +func (x *RepPrimitives) SetFieldF(v []uint64) { + x.xxx_hidden_FieldF = v +} + +func (x *RepPrimitives) SetFieldFu(v []uint64) { + x.xxx_hidden_FieldFu = v +} + +func (x *RepPrimitives) SetFieldAux(v []*RepPrimitives_Aux) { + x.xxx_hidden_FieldAux = &v +} + +type RepPrimitives_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + FieldA [][]byte + FieldB []string + FieldC []int32 + FieldD []uint32 + FieldE []int64 + FieldF []uint64 + FieldFu []uint64 + FieldAux []*RepPrimitives_Aux +} + +func (b0 RepPrimitives_builder) Build() *RepPrimitives { + m0 := &RepPrimitives{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_FieldA = b.FieldA + x.xxx_hidden_FieldB = b.FieldB + x.xxx_hidden_FieldC = b.FieldC + x.xxx_hidden_FieldD = b.FieldD + x.xxx_hidden_FieldE = b.FieldE + x.xxx_hidden_FieldF = b.FieldF + x.xxx_hidden_FieldFu = b.FieldFu + x.xxx_hidden_FieldAux = &b.FieldAux + return m0 +} + +type Primitives_Aux struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_InnerField uint32 `protobuf:"varint,1,opt,name=inner_field,json=innerField,proto3" json:"inner_field,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Primitives_Aux) Reset() { + *x = Primitives_Aux{} + mi := &file_api_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_api_util_proto_test_test_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Primitives_Aux) GetInnerField() uint32 { + if x != nil { + return x.xxx_hidden_InnerField + } + return 0 +} + +func (x *Primitives_Aux) SetInnerField(v uint32) { + x.xxx_hidden_InnerField = v +} + +type Primitives_Aux_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + InnerField uint32 +} + +func (b0 Primitives_Aux_builder) Build() *Primitives_Aux { + m0 := &Primitives_Aux{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_InnerField = b.InnerField + return m0 +} + +type RepPrimitives_Aux struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_InnerField uint32 `protobuf:"varint,1,opt,name=inner_field,json=innerField,proto3" json:"inner_field,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RepPrimitives_Aux) Reset() { + *x = RepPrimitives_Aux{} + mi := &file_api_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_api_util_proto_test_test_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *RepPrimitives_Aux) GetInnerField() uint32 { + if x != nil { + return x.xxx_hidden_InnerField + } + return 0 +} + +func (x *RepPrimitives_Aux) SetInnerField(v uint32) { + x.xxx_hidden_InnerField = v +} + +type RepPrimitives_Aux_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + InnerField uint32 +} + +func (b0 RepPrimitives_Aux_builder) Build() *RepPrimitives_Aux { + m0 := &RepPrimitives_Aux{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_InnerField = b.InnerField + return m0 +} + +var File_api_util_proto_test_test_proto protoreflect.FileDescriptor + +var file_api_util_proto_test_test_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x61, 0x70, 0x69, 0x2f, 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, 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, 0x6c, 0x64, 0x42, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x5f, 0x63, 0x18, 0xc8, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x43, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x64, 0x18, 0xc9, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x65, 0x18, 0xca, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x45, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x66, + 0x18, 0xcb, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x46, 0x12, + 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x67, 0x18, 0xcc, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x47, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x5f, 0x69, 0x18, 0xcd, 0x01, 0x20, 0x01, 0x28, 0x06, 0x52, 0x06, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x49, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6a, 0x18, 0xce, + 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4a, 0x12, 0x18, 0x0a, + 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6b, 0x18, 0xcf, 0x01, 0x20, 0x01, 0x28, 0x07, 0x52, + 0x06, 0x66, 0x69, 0x65, 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, 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, + 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, 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, 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 file_api_util_proto_test_test_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_api_util_proto_test_test_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_api_util_proto_test_test_proto_goTypes = []any{ + (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_api_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 + 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_api_util_proto_test_test_proto_init() } +func file_api_util_proto_test_test_proto_init() { + if File_api_util_proto_test_test_proto != nil { + return + } + file_api_util_proto_test_test_proto_msgTypes[0].OneofWrappers = []any{ + (*primitives_FieldMa)(nil), + (*primitives_FieldMe)(nil), + (*primitives_FieldAux)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_util_proto_test_test_proto_rawDesc, + NumEnums: 1, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_util_proto_test_test_proto_goTypes, + DependencyIndexes: file_api_util_proto_test_test_proto_depIdxs, + EnumInfos: file_api_util_proto_test_test_proto_enumTypes, + MessageInfos: file_api_util_proto_test_test_proto_msgTypes, + }.Build() + File_api_util_proto_test_test_proto = out.File + file_api_util_proto_test_test_proto_rawDesc = nil + file_api_util_proto_test_test_proto_goTypes = nil + file_api_util_proto_test_test_proto_depIdxs = nil +} From 9d7f7bd04f63cf373a50c7e88e815cb332b561b2 Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Tue, 21 Jan 2025 14:35:18 +0300 Subject: [PATCH 139/197] [#320] .forgejo: Add generate-proto action Signed-off-by: Alexander Chuprov --- .forgejo/workflows/codegen.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .forgejo/workflows/codegen.yml diff --git a/.forgejo/workflows/codegen.yml b/.forgejo/workflows/codegen.yml new file mode 100644 index 0000000..521f7f7 --- /dev/null +++ b/.forgejo/workflows/codegen.yml @@ -0,0 +1,22 @@ +name: Code generation +on: [pull_request] + +jobs: + wrappers: + name: Generate proto + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '1.23' + - name: Generate proto + run: make protoc + # The command seems to be non-deterministic. + # However, with >20 runs I haven't been able to reproduce the issue. + # This `git diff` is here to print diff in case we catch the behaviour again. + - name: Print diff + run: git diff HEAD + - name: Check that nothing has changed + run: git diff-index --exit-code HEAD From 761d087b93bcf0bfb2775fd4401f2dbc32625e86 Mon Sep 17 00:00:00 2001 From: Ekaterina Lebedeva Date: Mon, 27 Jan 2025 12:00:58 +0300 Subject: [PATCH 140/197] [#302] user: Make `ScriptHash` return no error Signed-off-by: Ekaterina Lebedeva --- user/id.go | 5 +++-- user/id_test.go | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/user/id.go b/user/id.go index 2d64d43..d185992 100644 --- a/user/id.go +++ b/user/id.go @@ -73,8 +73,9 @@ func (x *ID) SetScriptHash(scriptHash util.Uint160) { } // ScriptHash calculates and returns script hash of ID. -func (x *ID) ScriptHash() (util.Uint160, error) { - return util.Uint160DecodeBytesBE(x.w[1:21]) +func (x *ID) ScriptHash() util.Uint160 { + res, _ := util.Uint160DecodeBytesBE(x.w[1:21]) + return res } // WalletBytes returns FrostFS user ID as Neo3 wallet address in a binary format. diff --git a/user/id_test.go b/user/id_test.go index afeb746..c517dc5 100644 --- a/user/id_test.go +++ b/user/id_test.go @@ -51,8 +51,7 @@ func TestID_SetScriptHash(t *testing.T) { func TestID_ScriptHash(t *testing.T) { userID := usertest.ID() - scriptHash, err := userID.ScriptHash() - require.NoError(t, err) + scriptHash := userID.ScriptHash() ownerAddress := userID.EncodeToString() decodedScriptHash, err := address.StringToUint160(ownerAddress) From 00cebd297f8ed490e014f485412acbd75b5a07a6 Mon Sep 17 00:00:00 2001 From: Ekaterina Lebedeva Date: Mon, 27 Jan 2025 19:07:45 +0300 Subject: [PATCH 141/197] [#303] user: Make `user.ID` a `util.Uint160` Signed-off-by: Ekaterina Lebedeva --- user/id.go | 76 +++++++++++++++++++++++++----------------------------- 1 file changed, 35 insertions(+), 41 deletions(-) diff --git a/user/id.go b/user/id.go index d185992..c8e2d14 100644 --- a/user/id.go +++ b/user/id.go @@ -12,9 +12,8 @@ import ( "github.com/nspcc-dev/neo-go/pkg/util" ) -const idSize = 25 - -var zeroSlice = bytes.Repeat([]byte{0}, idSize) +// idFullSize is the size of ID in bytes, including prefix and checksum. +const idFullSize = util.Uint160Size + 5 // ID identifies users of the FrostFS system. // @@ -25,7 +24,7 @@ var zeroSlice = bytes.Repeat([]byte{0}, idSize) // so it MUST be initialized using some modifying function (e.g. SetScriptHash, // IDFromKey, etc.). type ID struct { - w []byte + w util.Uint160 } // ReadFromV2 reads ID from the refs.OwnerID message. Returns an error if @@ -33,22 +32,7 @@ type ID struct { // // See also WriteToV2. func (x *ID) ReadFromV2(m refs.OwnerID) error { - w := m.GetValue() - if len(w) != idSize { - return fmt.Errorf("invalid length %d, expected %d", len(w), idSize) - } - - if w[0] != address.NEO3Prefix { - return fmt.Errorf("invalid prefix byte 0x%X, expected 0x%X", w[0], address.NEO3Prefix) - } - - if !bytes.Equal(w[21:], hash.Checksum(w[:21])) { - return errors.New("checksum mismatch") - } - - x.w = w - - return nil + return x.setUserID(m.GetValue()) } // WriteToV2 writes ID to the refs.OwnerID message. @@ -56,26 +40,17 @@ func (x *ID) ReadFromV2(m refs.OwnerID) error { // // See also ReadFromV2. func (x ID) WriteToV2(m *refs.OwnerID) { - m.SetValue(x.w) + m.SetValue(x.WalletBytes()) } // SetScriptHash forms user ID from wallet address scripthash. func (x *ID) SetScriptHash(scriptHash util.Uint160) { - if cap(x.w) < idSize { - x.w = make([]byte, idSize) - } else if len(x.w) < idSize { - x.w = x.w[:idSize] - } - - x.w[0] = address.Prefix - copy(x.w[1:], scriptHash.BytesBE()) - copy(x.w[21:], hash.Checksum(x.w[:21])) + x.w = scriptHash } // ScriptHash calculates and returns script hash of ID. func (x *ID) ScriptHash() util.Uint160 { - res, _ := util.Uint160DecodeBytesBE(x.w[1:21]) - return res + return x.w } // WalletBytes returns FrostFS user ID as Neo3 wallet address in a binary format. @@ -84,14 +59,18 @@ func (x *ID) ScriptHash() util.Uint160 { // // See also Neo3 wallet docs. func (x ID) WalletBytes() []byte { - return x.w + v := make([]byte, idFullSize) + v[0] = address.Prefix + copy(v[1:], x.w[:]) + copy(v[21:], hash.Checksum(v[:21])) + return v } // EncodeToString encodes ID into FrostFS API V2 protocol string. // // See also DecodeString. func (x ID) EncodeToString() string { - return base58.Encode(x.w) + return base58.Encode(x.WalletBytes()) } // DecodeString decodes FrostFS API V2 protocol string. Returns an error @@ -101,14 +80,11 @@ func (x ID) EncodeToString() string { // // See also EncodeToString. func (x *ID) DecodeString(s string) error { - var err error - - x.w, err = base58.Decode(s) + w, err := base58.Decode(s) if err != nil { return fmt.Errorf("decode base58: %w", err) } - - return nil + return x.setUserID(w) } // String implements fmt.Stringer. @@ -122,10 +98,28 @@ func (x ID) String() string { // Equals defines a comparison relation between two ID instances. func (x ID) Equals(x2 ID) bool { - return bytes.Equal(x.w, x2.w) + return x.w == x2.w } // IsEmpty returns True, if ID is empty value. func (x ID) IsEmpty() bool { - return bytes.Equal(zeroSlice, x.w) + return x.w == util.Uint160{} +} + +func (x *ID) setUserID(w []byte) error { + if len(w) != idFullSize { + return fmt.Errorf("invalid length %d, expected %d", len(w), idFullSize) + } + + if w[0] != address.NEO3Prefix { + return fmt.Errorf("invalid prefix byte 0x%X, expected 0x%X", w[0], address.NEO3Prefix) + } + + if !bytes.Equal(w[21:], hash.Checksum(w[:21])) { + return errors.New("checksum mismatch") + } + + copy(x.w[:], w[1:21]) + + return nil } From d195cb5104019a410bd9329703fa01e758981da1 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Wed, 29 Jan 2025 16:32:27 +0300 Subject: [PATCH 142/197] [#324] rpc: Fix mem leak Signed-off-by: Dmitrii Stepanov --- api/rpc/client/init.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api/rpc/client/init.go b/api/rpc/client/init.go index 95e9301..4edfd0b 100644 --- a/api/rpc/client/init.go +++ b/api/rpc/client/init.go @@ -52,6 +52,7 @@ func (c *Client) Init(info common.CallMethodInfo, opts ...CallOption) (MessageRe } ctx, cancel := context.WithCancel(prm.ctx) + defer cancel() // `conn.NewStream` doesn't check if `conn` may turn up invalidated right before this invocation. // In such cases, the operation can hang indefinitely, with the context timeout being the only @@ -61,7 +62,13 @@ func (c *Client) Init(info common.CallMethodInfo, opts ...CallOption) (MessageRe // would propagate to all subsequent read/write operations on the opened stream, // which is not desired for the stream's lifecycle management. dialTimeoutTimer := time.NewTimer(c.dialTimeout) - defer dialTimeoutTimer.Stop() + defer func() { + dialTimeoutTimer.Stop() + select { + case <-dialTimeoutTimer.C: + default: + } + }() type newStreamRes struct { stream grpc.ClientStream From 37350dbb1ef22ec7343d62a5b5851881e159ac94 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Wed, 29 Jan 2025 19:57:29 +0300 Subject: [PATCH 143/197] [#326] pool: Fix panic that causes mutex deadlock Two concurrent 'deleteClientFromMap' calls for the same client may produce panic and deadlock. First goroutine acquires lock, removes element from the map, releases lock. Second goroutine acquires lock, and throws panic while trying to call 'close()' on empty struct. Lock is never released and it causes deadlock for other goroutines. Signed-off-by: Alex Vanin --- pool/tree/pool.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pool/tree/pool.go b/pool/tree/pool.go index ddfdc0e..b77d63a 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -1009,8 +1009,10 @@ func (p *Pool) addClientToMap(hash uint64, cl client) { func (p *Pool) deleteClientFromMap(hash uint64) { p.mutex.Lock() - _ = p.clientMap[hash].close() - delete(p.clientMap, hash) + if cli, ok := p.clientMap[hash]; ok { + _ = cli.close() + delete(p.clientMap, hash) + } p.mutex.Unlock() } From 2786fadb256e94ef2772be1883874687aeb50335 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Wed, 29 Jan 2025 20:12:54 +0300 Subject: [PATCH 144/197] [#326] pool: Add test for concurrent client deletion Signed-off-by: Alex Vanin --- pool/tree/pool_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pool/tree/pool_test.go b/pool/tree/pool_test.go index 607e037..5814a77 100644 --- a/pool/tree/pool_test.go +++ b/pool/tree/pool_test.go @@ -10,6 +10,7 @@ import ( cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" + netmaptest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap/test" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool" "git.frostfs.info/TrueCloudLab/hrw" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" @@ -416,6 +417,21 @@ func TestRetryContainerNodes(t *testing.T) { }) } +func TestDeleteClientTwice(t *testing.T) { + p := Pool{ + clientMap: makeClientMap([]netmap.NodeInfo{netmaptest.NodeInfo()}), + } + // emulate concurrent requests as consecutive requests + // to delete the same client from the map twice + for idToDelete := range p.clientMap { + p.deleteClientFromMap(idToDelete) + require.NotPanics(t, func() { + p.deleteClientFromMap(idToDelete) + }) + } + require.Empty(t, p.clientMap) +} + func makeInnerPool(nodes [][]string) []*innerPool { res := make([]*innerPool, len(nodes)) From 593dd77d841aa6652377d3755684d0a968e25fff Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Thu, 30 Jan 2025 10:49:34 +0300 Subject: [PATCH 145/197] [#327] rpc: Fix mem leak gRPC stream must be closed by `cancel` to prevent memleak. Signed-off-by: Dmitrii Stepanov --- api/rpc/client/flows.go | 36 +++++++++++++++++++++++--------- api/rpc/client/init.go | 5 ++++- api/rpc/client/stream_wrapper.go | 11 +++++++++- 3 files changed, 40 insertions(+), 12 deletions(-) diff --git a/api/rpc/client/flows.go b/api/rpc/client/flows.go index 671c679..2a945b4 100644 --- a/api/rpc/client/flows.go +++ b/api/rpc/client/flows.go @@ -12,18 +12,20 @@ import ( // SendUnary initializes communication session by RPC info, performs unary RPC // and closes the session. func SendUnary(cli *Client, info common.CallMethodInfo, req, resp message.Message, opts ...CallOption) error { - rw, err := cli.Init(info, opts...) + rw, err := cli.initInternal(info, opts...) if err != nil { return err } err = rw.WriteMessage(req) if err != nil { + rw.cancel() return err } err = rw.ReadMessage(resp) if err != nil { + rw.cancel() return err } @@ -38,18 +40,28 @@ type MessageWriterCloser interface { } type clientStreamWriterCloser struct { - MessageReadWriter - + sw *streamWrapper resp message.Message } +// WriteMessage implements MessageWriterCloser. +func (c *clientStreamWriterCloser) WriteMessage(m message.Message) error { + return c.sw.WriteMessage(m) +} + func (c *clientStreamWriterCloser) Close() error { - err := c.MessageReadWriter.Close() + err := c.sw.closeSend() if err != nil { + c.sw.cancel() return err } - return c.ReadMessage(c.resp) + if err = c.sw.ReadMessage(c.resp); err != nil { + c.sw.cancel() + return err + } + + return c.sw.Close() } // OpenClientStream initializes communication session by RPC info, opens client-side stream @@ -57,14 +69,14 @@ func (c *clientStreamWriterCloser) Close() error { // // All stream writes must be performed before the closing. Close must be called once. func OpenClientStream(cli *Client, info common.CallMethodInfo, resp message.Message, opts ...CallOption) (MessageWriterCloser, error) { - rw, err := cli.Init(info, opts...) + rw, err := cli.initInternal(info, opts...) if err != nil { return nil, err } return &clientStreamWriterCloser{ - MessageReadWriter: rw, - resp: resp, + sw: rw, + resp: resp, }, nil } @@ -76,7 +88,7 @@ type MessageReaderCloser interface { } type serverStreamReaderCloser struct { - rw MessageReadWriter + rw *streamWrapper once sync.Once @@ -91,11 +103,15 @@ func (s *serverStreamReaderCloser) ReadMessage(msg message.Message) error { }) if err != nil { + s.rw.cancel() return err } err = s.rw.ReadMessage(msg) if !errors.Is(err, io.EOF) { + if err != nil { + s.rw.cancel() + } return err } @@ -112,7 +128,7 @@ func (s *serverStreamReaderCloser) ReadMessage(msg message.Message) error { // // All stream reads must be performed before the closing. Close must be called once. func OpenServerStream(cli *Client, info common.CallMethodInfo, req message.Message, opts ...CallOption) (MessageReader, error) { - rw, err := cli.Init(info, opts...) + rw, err := cli.initInternal(info, opts...) if err != nil { return nil, err } diff --git a/api/rpc/client/init.go b/api/rpc/client/init.go index 4edfd0b..08a9925 100644 --- a/api/rpc/client/init.go +++ b/api/rpc/client/init.go @@ -41,6 +41,10 @@ type MessageReadWriter interface { // Init initiates a messaging session and returns the interface for message transmitting. func (c *Client) Init(info common.CallMethodInfo, opts ...CallOption) (MessageReadWriter, error) { + return c.initInternal(info, opts...) +} + +func (c *Client) initInternal(info common.CallMethodInfo, opts ...CallOption) (*streamWrapper, error) { prm := defaultCallParameters() for _, opt := range opts { @@ -52,7 +56,6 @@ func (c *Client) Init(info common.CallMethodInfo, opts ...CallOption) (MessageRe } ctx, cancel := context.WithCancel(prm.ctx) - defer cancel() // `conn.NewStream` doesn't check if `conn` may turn up invalidated right before this invocation. // In such cases, the operation can hang indefinitely, with the context timeout being the only diff --git a/api/rpc/client/stream_wrapper.go b/api/rpc/client/stream_wrapper.go index 4c7bb1f..85d5ad5 100644 --- a/api/rpc/client/stream_wrapper.go +++ b/api/rpc/client/stream_wrapper.go @@ -34,10 +34,15 @@ func (w streamWrapper) WriteMessage(m message.Message) error { }) } -func (w *streamWrapper) Close() error { +func (w *streamWrapper) closeSend() error { return w.withTimeout(w.ClientStream.CloseSend) } +func (w *streamWrapper) Close() error { + w.cancel() + return nil +} + func (w *streamWrapper) withTimeout(closure func() error) error { ch := make(chan error, 1) go func() { @@ -50,6 +55,10 @@ func (w *streamWrapper) withTimeout(closure func() error) error { select { case err := <-ch: tt.Stop() + select { + case <-tt.C: + default: + } return err case <-tt.C: w.cancel() From 8389887a3421e56a5dc70a0a2657772ec1f6b64a Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Tue, 28 Jan 2025 14:37:33 +0300 Subject: [PATCH 146/197] [#319] object/transformer: Add expiration epoch to each part Signed-off-by: Aleksey Savchuk --- object/transformer/transformer.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/object/transformer/transformer.go b/object/transformer/transformer.go index f7e5cd3..ce5259f 100644 --- a/object/transformer/transformer.go +++ b/object/transformer/transformer.go @@ -6,6 +6,7 @@ import ( "crypto/sha256" "fmt" + objectV2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" buffPool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/checksum" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" @@ -327,4 +328,11 @@ func (s *payloadSizeLimiter) prepareFirstChild() { s.current.SetAttributes() // attributes will be added to parent in detachParent + + // add expiration epoch to each part + for _, attr := range s.parAttrs { + if attr.Key() == objectV2.SysAttributeExpEpoch { + s.current.SetAttributes(attr) + } + } } From f08a7f0b3ce079200cfe1884ce528d4e73fe5884 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 4 Feb 2025 17:58:50 +0300 Subject: [PATCH 147/197] [#331] pool: Avoid connection leak in tree pool with netmap support To avoid connection leak, call `close()` immediately after connection is established. In regular tree pool, unhealthy connections are handled by background goroutine which calls `redialIfNecessary()` to reestablish connection. Here it is not viable so connection must be close. Signed-off-by: Alex Vanin --- pool/tree/pool.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pool/tree/pool.go b/pool/tree/pool.go index b77d63a..ab6e98a 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -1032,6 +1032,16 @@ func (p *Pool) getNewTreeClient(ctx context.Context, node netmap.NodeInfo) (*tre newTreeCl := newTreeClient(addr.URIAddr(), p.dialOptions, p.nodeDialTimeout, p.streamTimeout) if err = newTreeCl.dial(ctx); err != nil { p.log(zap.WarnLevel, "failed to dial tree client", zap.String("address", addr.URIAddr()), zap.Error(err)) + + // We have to close connection here after failed `dial()`. + // This is NOT necessary in object pool and regular tree pool without netmap support, because: + // - object pool uses SDK object client which closes connection during `dial()` call by itself, + // - regular tree pool is going to reuse connection by calling `redialIfNecessary()`. + // Tree pool with netmap support does not operate with background goroutine, so we have to close connection immediately. + if err = newTreeCl.close(); err != nil { + p.log(zap.WarnLevel, "failed to close recently dialed tree client", zap.String("address", addr.URIAddr()), zap.Error(err)) + } + return false } From 4ecbfb0edfe4ddfae9065f0a6da59cdea88b05dc Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 4 Feb 2025 21:12:40 +0300 Subject: [PATCH 148/197] [#331] pool: Add mocked test tree service and check goroutine leak Use real gRPC connection in new mocked tree service. Signed-off-by: Alex Vanin --- pool/tree/pool_server_test.go | 234 ++++++++++++++++++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100644 pool/tree/pool_server_test.go diff --git a/pool/tree/pool_server_test.go b/pool/tree/pool_server_test.go new file mode 100644 index 0000000..7e3447f --- /dev/null +++ b/pool/tree/pool_server_test.go @@ -0,0 +1,234 @@ +package tree + +import ( + "bytes" + "context" + "errors" + "net" + "runtime" + "strconv" + "testing" + + apinetmap "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" + cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" + cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool" + tree "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool/tree/service" + "github.com/nspcc-dev/neo-go/pkg/crypto/keys" + "github.com/stretchr/testify/require" + "google.golang.org/grpc" +) + +type mockTreeServer struct { + id int + srv *grpc.Server + lis net.Listener + key *keys.PrivateKey + + healthy bool + addCounter int +} + +type mockNetmapSource struct { + servers []*mockTreeServer + policy string +} + +func (m *mockNetmapSource) NetMapSnapshot(context.Context) (netmap.NetMap, error) { + nm := netmap.NetMap{} + nodes := make([]netmap.NodeInfo, len(m.servers)) + for i, server := range m.servers { + ni := apinetmap.NodeInfo{} + ni.SetAddresses(server.lis.Addr().String()) + ni.SetPublicKey(server.key.PublicKey().Bytes()) + err := nodes[i].ReadFromV2(ni) // no other way to set address field in netmap.NodeInfo + if err != nil { + return nm, err + } + nodes[i].SetAttribute("id", strconv.Itoa(server.id)) + } + nm.SetNodes(nodes) + return nm, nil +} + +func (m *mockNetmapSource) PlacementPolicy(context.Context, cid.ID) (netmap.PlacementPolicy, error) { + p := netmap.PlacementPolicy{} + return p, p.DecodeString(m.policy) +} + +func (m *mockTreeServer) Serve() { + go m.srv.Serve(m.lis) +} + +func (m *mockTreeServer) Stop() { + m.srv.Stop() +} + +func (m *mockTreeServer) Addr() string { + return m.lis.Addr().String() +} + +func (m *mockTreeServer) Add(context.Context, *tree.AddRequest) (*tree.AddResponse, error) { + m.addCounter++ + return &tree.AddResponse{}, nil +} + +func (m *mockTreeServer) AddByPath(context.Context, *tree.AddByPathRequest) (*tree.AddByPathResponse, error) { + panic("implement me") +} + +func (m *mockTreeServer) Remove(context.Context, *tree.RemoveRequest) (*tree.RemoveResponse, error) { + panic("implement me") +} + +func (m *mockTreeServer) Move(context.Context, *tree.MoveRequest) (*tree.MoveResponse, error) { + panic("implement me") +} + +func (m *mockTreeServer) GetNodeByPath(context.Context, *tree.GetNodeByPathRequest) (*tree.GetNodeByPathResponse, error) { + panic("implement me") +} + +func (m *mockTreeServer) GetSubTree(*tree.GetSubTreeRequest, tree.TreeService_GetSubTreeServer) error { + panic("implement me") +} + +func (m *mockTreeServer) TreeList(context.Context, *tree.TreeListRequest) (*tree.TreeListResponse, error) { + panic("implement me") +} + +func (m *mockTreeServer) Apply(context.Context, *tree.ApplyRequest) (*tree.ApplyResponse, error) { + panic("implement me") +} + +func (m *mockTreeServer) GetOpLog(*tree.GetOpLogRequest, tree.TreeService_GetOpLogServer) error { + panic("implement me") +} + +func (m *mockTreeServer) Healthcheck(context.Context, *tree.HealthcheckRequest) (*tree.HealthcheckResponse, error) { + if m.healthy { + return new(tree.HealthcheckResponse), nil + } + return nil, errors.New("not healthy") +} + +func createTestServer(t *testing.T, id int) *mockTreeServer { + lis, err := net.Listen("tcp", "127.0.0.1:0") + require.NoError(t, err) + + key, err := keys.NewPrivateKey() + require.NoError(t, err) + + res := &mockTreeServer{ + id: id, + srv: grpc.NewServer(), + lis: lis, + key: key, + healthy: true, + } + + tree.RegisterTreeServiceServer(res.srv, res) + + return res +} + +func preparePoolWithNetmapSource(t *testing.T, n int, p string) (*Pool, []*mockTreeServer, *mockNetmapSource) { + poolInitParams := InitParameters{} + + servers := make([]*mockTreeServer, n) + for i := range servers { + servers[i] = createTestServer(t, i) + servers[i].healthy = true + servers[i].Serve() + poolInitParams.AddNode(pool.NewNodeParam(1, servers[i].Addr(), 1)) + } + + source := &mockNetmapSource{ + servers: servers, + policy: p, + } + + key, err := keys.NewPrivateKey() + require.NoError(t, err) + poolInitParams.SetKey(key) + poolInitParams.SetNetMapInfoSource(source) + + cli, err := NewPool(poolInitParams) + require.NoError(t, err) + + return cli, servers, source +} + +func sortServers(ctx context.Context, servers []*mockTreeServer, source *mockNetmapSource, cnr cid.ID) ([]*mockTreeServer, error) { + res := make([]*mockTreeServer, len(servers)) + snapshot, err := source.NetMapSnapshot(ctx) + if err != nil { + return nil, err + } + + policy, err := source.PlacementPolicy(ctx, cnr) + if err != nil { + return nil, err + } + + cnrNodes, err := snapshot.ContainerNodes(policy, cnr[:]) + if err != nil { + return nil, err + } + + priorityNodes, err := snapshot.PlacementVectors(cnrNodes, cnr[:]) + if err != nil { + return nil, err + } + + // find servers based on public key and store pointers in res + for i := range priorityNodes { + for j := range priorityNodes[i] { + key := priorityNodes[i][j].PublicKey() + for k := range servers { + if bytes.Equal(servers[k].key.PublicKey().Bytes(), key) { + res[i+j] = servers[k] + } + } + } + } + + return res, nil +} + +func TestConnectionLeak(t *testing.T) { + const ( + numberOfNodes = 4 + placementPolicy = "REP 2" + ) + + // Initialize gRPC servers and create pool with netmap source + treePool, servers, source := preparePoolWithNetmapSource(t, numberOfNodes, placementPolicy) + for i := range servers { + defer servers[i].Stop() + } + + cnr := cidtest.ID() + ctx := context.Background() + + // Make priority node for cnr unhealthy, so it is going to be redialled on every request + sortedServers, err := sortServers(ctx, servers, source, cnr) + require.NoError(t, err) + sortedServers[0].healthy = false + + // Make RPC and check that pool switched to healthy server + _, err = treePool.AddNode(context.Background(), AddNodeParams{CID: cnr}) + require.NoError(t, err) + require.Equal(t, 0, sortedServers[0].addCounter) // unhealthy + require.Equal(t, 1, sortedServers[1].addCounter) // healthy + + // Check that go routines are not leaked during multiple requests + routinesBefore := runtime.NumGoroutine() + for i := 0; i < 1000; i++ { + _, err = treePool.AddNode(context.Background(), AddNodeParams{CID: cnr}) + require.NoError(t, err) + } + // not more than 1 extra goroutine is created due to async operations + require.LessOrEqual(t, runtime.NumGoroutine()-routinesBefore, 1) +} From 5a35fa4353c1584c7ea4770de41ba86c30ef990a Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Wed, 5 Feb 2025 10:44:03 +0300 Subject: [PATCH 149/197] [#331] pool: Fix 'sortServers' in tree pool server test Signed-off-by: Alex Vanin --- pool/tree/pool_server_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pool/tree/pool_server_test.go b/pool/tree/pool_server_test.go index 7e3447f..edba93f 100644 --- a/pool/tree/pool_server_test.go +++ b/pool/tree/pool_server_test.go @@ -183,12 +183,15 @@ func sortServers(ctx context.Context, servers []*mockTreeServer, source *mockNet } // find servers based on public key and store pointers in res + index := 0 for i := range priorityNodes { for j := range priorityNodes[i] { key := priorityNodes[i][j].PublicKey() for k := range servers { if bytes.Equal(servers[k].key.PublicKey().Bytes(), key) { - res[i+j] = servers[k] + res[index] = servers[k] + index++ + break } } } From cf0bbd03ae7f404dfe341c695f2ac6876e748696 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Wed, 5 Feb 2025 14:01:26 +0300 Subject: [PATCH 150/197] [#332] api/status: Regenerate common statuses Introduced a new common status `RESOURCE_EXHAUSTED`. Signed-off-by: Aleksey Savchuk --- api/status/grpc/types.pb.go | 64 ++++++++++++++----------- api/status/grpc/types_protoopaque.pb.go | 64 ++++++++++++++----------- 2 files changed, 70 insertions(+), 58 deletions(-) diff --git a/api/status/grpc/types.pb.go b/api/status/grpc/types.pb.go index e44ae18..a23fc09 100644 --- a/api/status/grpc/types.pb.go +++ b/api/status/grpc/types.pb.go @@ -144,6 +144,9 @@ const ( // request parameter as the client sent it incorrectly, then this code should // be used. CommonFail_INVALID_ARGUMENT CommonFail = 4 + // [**1029**] Resource exhausted failure. If the operation cannot be performed + // due to a lack of resources. + CommonFail_RESOURCE_EXHAUSTED CommonFail = 5 ) // Enum value maps for CommonFail. @@ -154,6 +157,7 @@ var ( 2: "SIGNATURE_VERIFICATION_FAIL", 3: "NODE_UNDER_MAINTENANCE", 4: "INVALID_ARGUMENT", + 5: "RESOURCE_EXHAUSTED", } CommonFail_value = map[string]int32{ "INTERNAL": 0, @@ -161,6 +165,7 @@ var ( "SIGNATURE_VERIFICATION_FAIL": 2, "NODE_UNDER_MAINTENANCE": 3, "INVALID_ARGUMENT": 4, + "RESOURCE_EXHAUSTED": 5, } ) @@ -654,7 +659,7 @@ var file_api_status_grpc_types_proto_rawDesc = []byte{ 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, + 0x63, 0x65, 0x73, 0x73, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, 0x2a, 0x9d, 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, @@ -663,34 +668,35 @@ var file_api_status_grpc_types_proto_rawDesc = []byte{ 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x4e, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x44, 0x45, 0x52, 0x5f, 0x4d, 0x41, 0x49, 0x4e, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x41, 0x52, 0x47, 0x55, 0x4d, 0x45, - 0x4e, 0x54, 0x10, 0x04, 0x2a, 0x88, 0x01, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, - 0x11, 0x0a, 0x0d, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4e, 0x4f, 0x54, - 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x4f, 0x43, 0x4b, - 0x45, 0x44, 0x10, 0x02, 0x12, 0x1b, 0x0a, 0x17, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x4e, 0x4f, 0x4e, - 0x5f, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, - 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x41, 0x4c, 0x52, 0x45, - 0x41, 0x44, 0x59, 0x5f, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x44, 0x10, 0x04, 0x12, 0x10, 0x0a, - 0x0c, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x05, 0x2a, - 0x55, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x13, - 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, - 0x55, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x41, 0x43, 0x4c, 0x5f, 0x4e, 0x4f, - 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, 0x4e, - 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, - 0x4e, 0x49, 0x45, 0x44, 0x10, 0x02, 0x2a, 0x31, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, - 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, - 0x45, 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x01, 0x2a, 0x2b, 0x0a, 0x0a, 0x41, 0x50, 0x45, - 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x19, 0x41, 0x50, 0x45, 0x5f, 0x4d, - 0x41, 0x4e, 0x41, 0x47, 0x45, 0x52, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, - 0x4e, 0x49, 0x45, 0x44, 0x10, 0x00, 0x42, 0x62, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, - 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, - 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, - 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0xaa, 0x02, 0x1a, - 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x41, 0x50, 0x49, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x62, 0x08, 0x65, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, + 0x4e, 0x54, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, + 0x5f, 0x45, 0x58, 0x48, 0x41, 0x55, 0x53, 0x54, 0x45, 0x44, 0x10, 0x05, 0x2a, 0x88, 0x01, 0x0a, + 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x43, 0x43, 0x45, 0x53, + 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x42, + 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x01, + 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x02, 0x12, 0x1b, 0x0a, 0x17, + 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x4e, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, + 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x42, 0x4a, + 0x45, 0x43, 0x54, 0x5f, 0x41, 0x4c, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x52, 0x45, 0x4d, 0x4f, + 0x56, 0x45, 0x44, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, + 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x05, 0x2a, 0x55, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, + 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, + 0x0e, 0x45, 0x41, 0x43, 0x4c, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, + 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x41, + 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x02, 0x2a, 0x31, + 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x4f, 0x4b, + 0x45, 0x4e, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x11, + 0x0a, 0x0d, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x45, 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, + 0x01, 0x2a, 0x2b, 0x0a, 0x0a, 0x41, 0x50, 0x45, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, + 0x1d, 0x0a, 0x19, 0x41, 0x50, 0x45, 0x5f, 0x4d, 0x41, 0x4e, 0x41, 0x47, 0x45, 0x52, 0x5f, 0x41, + 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x00, 0x42, 0x62, + 0x5a, 0x43, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, + 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, + 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x62, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, } var file_api_status_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 7) diff --git a/api/status/grpc/types_protoopaque.pb.go b/api/status/grpc/types_protoopaque.pb.go index d1877ab..16ae0e9 100644 --- a/api/status/grpc/types_protoopaque.pb.go +++ b/api/status/grpc/types_protoopaque.pb.go @@ -144,6 +144,9 @@ const ( // request parameter as the client sent it incorrectly, then this code should // be used. CommonFail_INVALID_ARGUMENT CommonFail = 4 + // [**1029**] Resource exhausted failure. If the operation cannot be performed + // due to a lack of resources. + CommonFail_RESOURCE_EXHAUSTED CommonFail = 5 ) // Enum value maps for CommonFail. @@ -154,6 +157,7 @@ var ( 2: "SIGNATURE_VERIFICATION_FAIL", 3: "NODE_UNDER_MAINTENANCE", 4: "INVALID_ARGUMENT", + 5: "RESOURCE_EXHAUSTED", } CommonFail_value = map[string]int32{ "INTERNAL": 0, @@ -161,6 +165,7 @@ var ( "SIGNATURE_VERIFICATION_FAIL": 2, "NODE_UNDER_MAINTENANCE": 3, "INVALID_ARGUMENT": 4, + "RESOURCE_EXHAUSTED": 5, } ) @@ -676,7 +681,7 @@ var file_api_status_grpc_types_proto_rawDesc = []byte{ 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, + 0x63, 0x65, 0x73, 0x73, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, 0x2a, 0x9d, 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, @@ -685,34 +690,35 @@ var file_api_status_grpc_types_proto_rawDesc = []byte{ 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x4e, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x44, 0x45, 0x52, 0x5f, 0x4d, 0x41, 0x49, 0x4e, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x41, 0x52, 0x47, 0x55, 0x4d, 0x45, - 0x4e, 0x54, 0x10, 0x04, 0x2a, 0x88, 0x01, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, - 0x11, 0x0a, 0x0d, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4e, 0x4f, 0x54, - 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x4f, 0x43, 0x4b, - 0x45, 0x44, 0x10, 0x02, 0x12, 0x1b, 0x0a, 0x17, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x4e, 0x4f, 0x4e, - 0x5f, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, - 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x41, 0x4c, 0x52, 0x45, - 0x41, 0x44, 0x59, 0x5f, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x44, 0x10, 0x04, 0x12, 0x10, 0x0a, - 0x0c, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x05, 0x2a, - 0x55, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x13, - 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, - 0x55, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x41, 0x43, 0x4c, 0x5f, 0x4e, 0x4f, - 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, 0x4e, - 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, - 0x4e, 0x49, 0x45, 0x44, 0x10, 0x02, 0x2a, 0x31, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, - 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, - 0x45, 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x01, 0x2a, 0x2b, 0x0a, 0x0a, 0x41, 0x50, 0x45, - 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x19, 0x41, 0x50, 0x45, 0x5f, 0x4d, - 0x41, 0x4e, 0x41, 0x47, 0x45, 0x52, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, - 0x4e, 0x49, 0x45, 0x44, 0x10, 0x00, 0x42, 0x62, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, - 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, - 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, - 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0xaa, 0x02, 0x1a, - 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x41, 0x50, 0x49, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x62, 0x08, 0x65, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, + 0x4e, 0x54, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, + 0x5f, 0x45, 0x58, 0x48, 0x41, 0x55, 0x53, 0x54, 0x45, 0x44, 0x10, 0x05, 0x2a, 0x88, 0x01, 0x0a, + 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x43, 0x43, 0x45, 0x53, + 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x42, + 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x01, + 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x02, 0x12, 0x1b, 0x0a, 0x17, + 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x4e, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, + 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x42, 0x4a, + 0x45, 0x43, 0x54, 0x5f, 0x41, 0x4c, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x52, 0x45, 0x4d, 0x4f, + 0x56, 0x45, 0x44, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, + 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x05, 0x2a, 0x55, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, + 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, + 0x0e, 0x45, 0x41, 0x43, 0x4c, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, + 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x41, + 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x02, 0x2a, 0x31, + 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x4f, 0x4b, + 0x45, 0x4e, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x11, + 0x0a, 0x0d, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x45, 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, + 0x01, 0x2a, 0x2b, 0x0a, 0x0a, 0x41, 0x50, 0x45, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, + 0x1d, 0x0a, 0x19, 0x41, 0x50, 0x45, 0x5f, 0x4d, 0x41, 0x4e, 0x41, 0x47, 0x45, 0x52, 0x5f, 0x41, + 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x00, 0x42, 0x62, + 0x5a, 0x43, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, + 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, + 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x62, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, } var file_api_status_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 7) From 7bdc78f2b5c2cd396c68196d84326af8e3820bff Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Wed, 5 Feb 2025 14:11:39 +0300 Subject: [PATCH 151/197] [#332] client/status: Support `RESOURCE_EXHAUSTED` status Signed-off-by: Aleksey Savchuk --- api/status/status.go | 2 ++ client/status/common.go | 59 ++++++++++++++++++++++++++++++++++++ client/status/common_test.go | 39 ++++++++++++++++++++++++ client/status/v2.go | 2 ++ 4 files changed, 102 insertions(+) diff --git a/api/status/status.go b/api/status/status.go index 53d361e..7fe9111 100644 --- a/api/status/status.go +++ b/api/status/status.go @@ -65,6 +65,8 @@ const ( NodeUnderMaintenance // InvalidArgument is a local Code value for INVALID_ARGUMENT status. InvalidArgument + // ResourceExhausted is a local Code value for RESOURCE_EXHAUSTED status. + ResourceExhausted ) const ( diff --git a/client/status/common.go b/client/status/common.go index 486bc72..65c4ba3 100644 --- a/client/status/common.go +++ b/client/status/common.go @@ -296,3 +296,62 @@ func (x *InvalidArgument) SetMessage(v string) { func (x InvalidArgument) Message() string { return x.v2.Message() } + +// ResourceExhausted is a failure status indicating that +// the operation cannot be performed due to a lack of resources. +// Instances provide Status and StatusV2 interfaces. +type ResourceExhausted struct { + v2 status.Status +} + +const defaultResourceExhaustedMsg = "resource exhausted" + +// Error implements the error interface. +func (x *ResourceExhausted) Error() string { + msg := x.v2.Message() + if msg == "" { + msg = defaultResourceExhaustedMsg + } + + return errMessageStatusV2( + globalizeCodeV2(status.ResourceExhausted, status.GlobalizeCommonFail), + msg, + ) +} + +// implements local interface defined in FromStatusV2 func. +func (x *ResourceExhausted) fromStatusV2(st *status.Status) { + x.v2 = *st +} + +// ToStatusV2 implements StatusV2 interface method. +// If the value was returned by FromStatusV2, returns the source message. +// Otherwise, returns message with +// - code: RESOURCE_EXHAUSTED; +// - string message: written message via SetMessage or +// "resource exhausted" as a default message; +// - details: empty. +func (x ResourceExhausted) ToStatusV2() *status.Status { + x.v2.SetCode(globalizeCodeV2(status.ResourceExhausted, status.GlobalizeCommonFail)) + if x.v2.Message() == "" { + x.v2.SetMessage(defaultResourceExhaustedMsg) + } + + return &x.v2 +} + +// SetMessage writes invalid argument failure message. +// Message should be used for debug purposes only. +// +// See also Message. +func (x *ResourceExhausted) SetMessage(v string) { + x.v2.SetMessage(v) +} + +// Message returns status message. Zero status returns empty message. +// Message should be used for debug purposes only. +// +// See also SetMessage. +func (x ResourceExhausted) Message() string { + return x.v2.Message() +} diff --git a/client/status/common_test.go b/client/status/common_test.go index e55883e..0c3d2d5 100644 --- a/client/status/common_test.go +++ b/client/status/common_test.go @@ -167,3 +167,42 @@ func TestInvalidArgument(t *testing.T) { require.Equal(t, msg, stV2.Message()) }) } + +func TestResourceExhausted(t *testing.T) { + t.Run("default", func(t *testing.T) { + var st apistatus.ResourceExhausted + + require.Empty(t, st.Message()) + }) + + t.Run("custom message", func(t *testing.T) { + var st apistatus.ResourceExhausted + msg := "some message" + + st.SetMessage(msg) + + stV2 := st.ToStatusV2() + + require.Equal(t, msg, st.Message()) + require.Equal(t, msg, stV2.Message()) + }) + + t.Run("empty to V2", func(t *testing.T) { + var st apistatus.ResourceExhausted + + stV2 := st.ToStatusV2() + + require.Equal(t, "resource exhausted", stV2.Message()) + }) + + t.Run("non-empty to V2", func(t *testing.T) { + var st apistatus.ResourceExhausted + msg := "some other msg" + + st.SetMessage(msg) + + stV2 := st.ToStatusV2() + + require.Equal(t, msg, stV2.Message()) + }) +} diff --git a/client/status/v2.go b/client/status/v2.go index 95dfb8a..6ee3d84 100644 --- a/client/status/v2.go +++ b/client/status/v2.go @@ -80,6 +80,8 @@ func FromStatusV2(st *status.Status) Status { decoder = new(NodeUnderMaintenance) case status.InvalidArgument: decoder = new(InvalidArgument) + case status.ResourceExhausted: + decoder = new(ResourceExhausted) } case object.LocalizeFailStatus(&code): switch code { From 56892e48accf9010a13b6ac201f3e8cfa9f7af04 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Mon, 17 Feb 2025 15:55:30 +0300 Subject: [PATCH 152/197] [#334] rpc: Use DeadlineExceeded error when creating stream failed by timeout According to https://pkg.go.dev/context#pkg-variables, ContextCancelled should be returned when the context is canceled for some reason other than its deadline passing. So creating gRPC stream with dial timeout fits better for context.DeadlineExceeded. Signed-off-by: Dmitrii Stepanov --- api/rpc/client/init.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/rpc/client/init.go b/api/rpc/client/init.go index 08a9925..834f5da 100644 --- a/api/rpc/client/init.go +++ b/api/rpc/client/init.go @@ -101,7 +101,7 @@ func (c *Client) initInternal(info common.CallMethodInfo, opts ...CallOption) (* if res.stream != nil && res.err == nil { _ = res.stream.CloseSend() } - return nil, context.Canceled + return nil, context.DeadlineExceeded case res = <-newStreamCh: } From 148a341b6fc1451a4d673d1ffb704ce458ab282c Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Mon, 17 Feb 2025 11:49:10 +0300 Subject: [PATCH 153/197] [#294] object: Implement Cmp() function for ID struct Signed-off-by: Alexander Chuprov --- object/id/id.go | 7 +++++++ object/id/id_test.go | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/object/id/id.go b/object/id/id.go index d1dfe80..29e6a3a 100644 --- a/object/id/id.go +++ b/object/id/id.go @@ -4,6 +4,7 @@ import ( "crypto/ecdsa" "crypto/sha256" "fmt" + "strings" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto" @@ -167,3 +168,9 @@ func (id *ID) UnmarshalJSON(data []byte) error { return nil } + +// Cmp returns an integer comparing two base58 encoded object ID lexicographically. +// The result will be 0 if id1 == id2, -1 if id1 < id2, and +1 if id1 > id2. +func (id ID) Cmp(id2 ID) int { + return strings.Compare(id.EncodeToString(), id2.EncodeToString()) +} diff --git a/object/id/id_test.go b/object/id/id_test.go index e1a2e26..9df6186 100644 --- a/object/id/id_test.go +++ b/object/id/id_test.go @@ -3,7 +3,9 @@ package oid import ( "crypto/rand" "crypto/sha256" + "slices" "strconv" + "strings" "testing" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" @@ -180,3 +182,16 @@ func TestID_Encode(t *testing.T) { require.Equal(t, emptyID, id.EncodeToString()) }) } + +func TestID_Cmp(t *testing.T) { + id1 := randID(t) + id2 := randID(t) + id3 := randID(t) + + arr := []ID{id1, id2, id3} + + slices.SortFunc(arr, ID.Cmp) + for i := 1; i < len(arr); i++ { + require.NotEqual(t, strings.Compare(arr[i-1].EncodeToString(), arr[i].EncodeToString()), 1, "array is not sorted correctly") + } +} From bcb5fd22d4dee49866cda930717e828eb13f7842 Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Mon, 17 Feb 2025 11:49:39 +0300 Subject: [PATCH 154/197] [#294] container: Implement Cmp() function for ID struct Signed-off-by: Alexander Chuprov --- container/id/id.go | 7 +++++++ container/id/id_test.go | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/container/id/id.go b/container/id/id.go index 569968a..1cbd60b 100644 --- a/container/id/id.go +++ b/container/id/id.go @@ -3,6 +3,7 @@ package cid import ( "crypto/sha256" "fmt" + "strings" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" "github.com/mr-tron/base58" @@ -113,3 +114,9 @@ func (id *ID) DecodeString(s string) error { func (id ID) String() string { return id.EncodeToString() } + +// Cmp returns an integer comparing two base58 encoded container ID lexicographically. +// The result will be 0 if id1 == id2, -1 if id1 < id2, and +1 if id1 > id2. +func (id ID) Cmp(id2 ID) int { + return strings.Compare(id.EncodeToString(), id2.EncodeToString()) +} diff --git a/container/id/id_test.go b/container/id/id_test.go index 6f60d92..2bbd8b3 100644 --- a/container/id/id_test.go +++ b/container/id/id_test.go @@ -3,6 +3,8 @@ package cid_test import ( "crypto/rand" "crypto/sha256" + "slices" + "strings" "testing" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" @@ -106,3 +108,17 @@ func TestID_Encode(t *testing.T) { require.Equal(t, emptyID, id.EncodeToString()) }) } + +func TestID_Cmp(t *testing.T) { + var arr []cid.ID + for i := 0; i < 3; i++ { + checksum := randSHA256Checksum() + arr = append(arr, cidtest.IDWithChecksum(checksum)) + } + + slices.SortFunc(arr, cid.ID.Cmp) + + for i := 1; i < len(arr); i++ { + require.NotEqual(t, strings.Compare(arr[i-1].EncodeToString(), arr[i].EncodeToString()), 1, "array is not sorted correctly") + } +} From c3f7378887a476db9695812ea0fb89b1ecde6b78 Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Mon, 17 Feb 2025 11:50:05 +0300 Subject: [PATCH 155/197] [#294] user: Implement Cmp() function for ID struct Signed-off-by: Alexander Chuprov --- user/id.go | 7 +++++++ user/id_test.go | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/user/id.go b/user/id.go index c8e2d14..c77ae67 100644 --- a/user/id.go +++ b/user/id.go @@ -4,6 +4,7 @@ import ( "bytes" "errors" "fmt" + "strings" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" "github.com/mr-tron/base58" @@ -123,3 +124,9 @@ func (x *ID) setUserID(w []byte) error { return nil } + +// Cmp returns an integer comparing two base58 encoded user ID lexicographically. +// The result will be 0 if id1 == id2, -1 if id1 < id2, and +1 if id1 > id2. +func (x ID) Cmp(x2 ID) int { + return strings.Compare(x.EncodeToString(), x2.EncodeToString()) +} diff --git a/user/id_test.go b/user/id_test.go index c517dc5..c253336 100644 --- a/user/id_test.go +++ b/user/id_test.go @@ -3,6 +3,8 @@ package user_test import ( "bytes" "crypto/rand" + "slices" + "strings" "testing" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" @@ -132,3 +134,16 @@ func TestID_Equal(t *testing.T) { require.True(t, id3.Equals(id1)) // commutativity require.False(t, id1.Equals(id2)) } + +func TestID_Cmp(t *testing.T) { + id1 := usertest.ID() + id2 := usertest.ID() + id3 := usertest.ID() + + arr := []ID{id1, id2, id3} + + slices.SortFunc(arr, ID.Cmp) + for i := 1; i < len(arr); i++ { + require.NotEqual(t, strings.Compare(arr[i-1].EncodeToString(), arr[i].EncodeToString()), 1, "array is not sorted correctly") + } +} From ada0513504c68fa4c4c52311ac914948b92cb18b Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Fri, 28 Feb 2025 10:36:18 +0300 Subject: [PATCH 156/197] [#336] pool/tree: Do probe in getSubTree to handle error in advance Signed-off-by: Denis Kirillov --- pool/tree/pool.go | 33 +++++++++++++++++++++++++++++---- pool/tree/pool_server_test.go | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 63 insertions(+), 5 deletions(-) diff --git a/pool/tree/pool.go b/pool/tree/pool.go index ab6e98a..c82e269 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -414,12 +414,19 @@ func (p *Pool) GetNodes(ctx context.Context, prm GetNodesParams) ([]*tree.GetNod // // Must be initialized using Pool.GetSubTree, any other usage is unsafe. type SubTreeReader struct { - cli *rpcapi.GetSubTreeResponseReader + cli *rpcapi.GetSubTreeResponseReader + probe *tree.GetSubTreeResponseBody } // Read reads another list of the subtree nodes. func (x *SubTreeReader) Read(buf []*tree.GetSubTreeResponseBody) (int, error) { - for i := range buf { + i := 0 + if x.probe != nil && len(buf) != 0 { + buf[0] = x.probe + x.probe = nil + i = 1 + } + for ; i < len(buf); i++ { var resp tree.GetSubTreeResponse err := x.cli.Read(&resp) if err == io.EOF { @@ -436,6 +443,10 @@ func (x *SubTreeReader) Read(buf []*tree.GetSubTreeResponseBody) (int, error) { // ReadAll reads all nodes subtree nodes. func (x *SubTreeReader) ReadAll() ([]*tree.GetSubTreeResponseBody, error) { var res []*tree.GetSubTreeResponseBody + if x.probe != nil { + res = append(res, x.probe) + x.probe = nil + } for { var resp tree.GetSubTreeResponse err := x.cli.Read(&resp) @@ -452,6 +463,12 @@ func (x *SubTreeReader) ReadAll() ([]*tree.GetSubTreeResponseBody, error) { // Next gets the next node from subtree. func (x *SubTreeReader) Next() (*tree.GetSubTreeResponseBody, error) { + if x.probe != nil { + res := x.probe + x.probe = nil + return res, nil + } + var resp tree.GetSubTreeResponse err := x.cli.Read(&resp) if err == io.EOF { @@ -495,16 +512,24 @@ func (p *Pool) GetSubTree(ctx context.Context, prm GetSubTreeParams) (*SubTreeRe } var cli *rpcapi.GetSubTreeResponseReader + var probeBody *tree.GetSubTreeResponseBody err := p.requestWithRetry(ctx, prm.CID, func(client *rpcclient.Client) (inErr error) { cli, inErr = rpcapi.GetSubTree(client, request, rpcclient.WithContext(ctx)) - return handleError("failed to get sub tree client", inErr) + if inErr != nil { + return handleError("failed to get sub tree client", inErr) + } + + probe := &tree.GetSubTreeResponse{} + inErr = cli.Read(probe) + probeBody = probe.GetBody() + return handleError("failed to get first resp from sub tree client", inErr) }) p.methods[methodGetSubTree].IncRequests(time.Since(start)) if err != nil { return nil, err } - return &SubTreeReader{cli: cli}, nil + return &SubTreeReader{cli: cli, probe: probeBody}, nil } // AddNode invokes eponymous method from TreeServiceClient. diff --git a/pool/tree/pool_server_test.go b/pool/tree/pool_server_test.go index edba93f..014e454 100644 --- a/pool/tree/pool_server_test.go +++ b/pool/tree/pool_server_test.go @@ -28,6 +28,9 @@ type mockTreeServer struct { healthy bool addCounter int + + getSubTreeError error + getSubTreeCounter int } type mockNetmapSource struct { @@ -91,7 +94,8 @@ func (m *mockTreeServer) GetNodeByPath(context.Context, *tree.GetNodeByPathReque } func (m *mockTreeServer) GetSubTree(*tree.GetSubTreeRequest, tree.TreeService_GetSubTreeServer) error { - panic("implement me") + m.getSubTreeCounter++ + return m.getSubTreeError } func (m *mockTreeServer) TreeList(context.Context, *tree.TreeListRequest) (*tree.TreeListResponse, error) { @@ -235,3 +239,32 @@ func TestConnectionLeak(t *testing.T) { // not more than 1 extra goroutine is created due to async operations require.LessOrEqual(t, runtime.NumGoroutine()-routinesBefore, 1) } + +func TestStreamRetry(t *testing.T) { + const ( + numberOfNodes = 4 + placementPolicy = "REP 2" + ) + + // Initialize gRPC servers and create pool with netmap source + treePool, servers, _ := preparePoolWithNetmapSource(t, numberOfNodes, placementPolicy) + for i := range servers { + servers[i].getSubTreeError = errors.New("tree not found") + } + defer func() { + for i := range servers { + servers[i].Stop() + } + }() + + cnr := cidtest.ID() + ctx := context.Background() + + _, err := treePool.GetSubTree(ctx, GetSubTreeParams{CID: cnr}) + require.Error(t, err) + + for i := range servers { + // check we retried every available node in the pool + require.Equal(t, 1, servers[i].getSubTreeCounter) + } +} From 2b8329e026c74d310817938c6cb8243749d0d49e Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 28 Feb 2025 12:29:23 +0300 Subject: [PATCH 157/197] [#336] pool/tree: Increase test coverage in TestStreamRetry Signed-off-by: Alex Vanin --- pool/tree/pool_server_test.go | 99 ++++++++++++++++++++++++++++++----- 1 file changed, 87 insertions(+), 12 deletions(-) diff --git a/pool/tree/pool_server_test.go b/pool/tree/pool_server_test.go index 014e454..01373da 100644 --- a/pool/tree/pool_server_test.go +++ b/pool/tree/pool_server_test.go @@ -4,12 +4,14 @@ import ( "bytes" "context" "errors" + "io" "net" "runtime" "strconv" "testing" apinetmap "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" + apitree "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/tree" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" @@ -29,8 +31,9 @@ type mockTreeServer struct { healthy bool addCounter int - getSubTreeError error - getSubTreeCounter int + getSubTreeError error + getSubTreeResponses []*tree.GetSubTreeResponse_Body + getSubTreeCounter int } type mockNetmapSource struct { @@ -93,9 +96,22 @@ func (m *mockTreeServer) GetNodeByPath(context.Context, *tree.GetNodeByPathReque panic("implement me") } -func (m *mockTreeServer) GetSubTree(*tree.GetSubTreeRequest, tree.TreeService_GetSubTreeServer) error { +func (m *mockTreeServer) GetSubTree(_ *tree.GetSubTreeRequest, s tree.TreeService_GetSubTreeServer) error { m.getSubTreeCounter++ - return m.getSubTreeError + + if m.getSubTreeError != nil { + return m.getSubTreeError + } + + for i := range m.getSubTreeResponses { + if err := s.Send(&tree.GetSubTreeResponse{ + Body: m.getSubTreeResponses[i], + }); err != nil { + return err + } + } + + return nil } func (m *mockTreeServer) TreeList(context.Context, *tree.TreeListRequest) (*tree.TreeListResponse, error) { @@ -246,11 +262,20 @@ func TestStreamRetry(t *testing.T) { placementPolicy = "REP 2" ) - // Initialize gRPC servers and create pool with netmap source - treePool, servers, _ := preparePoolWithNetmapSource(t, numberOfNodes, placementPolicy) - for i := range servers { - servers[i].getSubTreeError = errors.New("tree not found") + expected := []*tree.GetSubTreeResponse_Body{ + { + NodeId: []uint64{1}, + }, + { + NodeId: []uint64{2}, + }, + { + NodeId: []uint64{3}, + }, } + + // Initialize gRPC servers and create pool with netmap source + treePool, servers, source := preparePoolWithNetmapSource(t, numberOfNodes, placementPolicy) defer func() { for i := range servers { servers[i].Stop() @@ -260,11 +285,61 @@ func TestStreamRetry(t *testing.T) { cnr := cidtest.ID() ctx := context.Background() - _, err := treePool.GetSubTree(ctx, GetSubTreeParams{CID: cnr}) - require.Error(t, err) + sortedServers, err := sortServers(ctx, servers, source, cnr) + require.NoError(t, err) + + // Return expected response in last priority node, others return error + for i := range sortedServers { + if i == len(sortedServers)-1 { + sortedServers[i].getSubTreeResponses = expected + } else { + sortedServers[i].getSubTreeError = errors.New("tree not found") + } + } + + t.Run("read all", func(t *testing.T) { + reader, err := treePool.GetSubTree(ctx, GetSubTreeParams{CID: cnr}) + require.NoError(t, err) + + data, err := reader.ReadAll() + require.NoError(t, err) + + require.Len(t, data, len(expected)) + for i := range expected { + require.EqualValues(t, expected[i].GetNodeId(), data[i].GetNodeID()) + } + }) + + t.Run("next", func(t *testing.T) { + reader, err := treePool.GetSubTree(ctx, GetSubTreeParams{CID: cnr}) + require.NoError(t, err) + + for i := range expected { + resp, err := reader.Next() + require.NoError(t, err) + require.Equal(t, expected[i].GetNodeId(), resp.GetNodeID()) + } + + _, err = reader.Next() + require.Error(t, io.EOF, err) + }) + + t.Run("read", func(t *testing.T) { + reader, err := treePool.GetSubTree(ctx, GetSubTreeParams{CID: cnr}) + require.NoError(t, err) + + buf := make([]*apitree.GetSubTreeResponseBody, len(expected)) + _, err = reader.Read(buf) + require.NoError(t, err) + + require.Len(t, buf, len(expected)) + for i := range expected { + require.EqualValues(t, expected[i].GetNodeId(), buf[i].GetNodeID()) + } + }) for i := range servers { - // check we retried every available node in the pool - require.Equal(t, 1, servers[i].getSubTreeCounter) + // check we retried every available node in the pool three times + require.Equal(t, 3, servers[i].getSubTreeCounter) } } From c8d71c450a290f28d39203f0c096bea925cdfbce Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Mon, 3 Mar 2025 17:06:04 +0300 Subject: [PATCH 158/197] [#339] pool/tree: Add circuit breaker Signed-off-by: Alex Vanin --- pool/tree/circuitbreaker.go | 83 ++++++++++++++++++++++++++++++++ pool/tree/circuitbreaker_test.go | 60 +++++++++++++++++++++++ pool/tree/pool.go | 8 ++- 3 files changed, 149 insertions(+), 2 deletions(-) create mode 100644 pool/tree/circuitbreaker.go create mode 100644 pool/tree/circuitbreaker_test.go diff --git a/pool/tree/circuitbreaker.go b/pool/tree/circuitbreaker.go new file mode 100644 index 0000000..83d11c4 --- /dev/null +++ b/pool/tree/circuitbreaker.go @@ -0,0 +1,83 @@ +package tree + +import ( + "context" + "errors" + "sync" + "time" +) + +const ( + defaultThreshold = 10 + defaultBreakDuration = 10 * time.Second +) + +type ( + circuitBreaker struct { + breakDuration time.Duration + threshold int + + mu sync.Mutex + state map[string]state + } + + state struct { + counter int + breakTimestamp time.Time + } + + dialer interface { + dial(context.Context) error + endpoint() string + } +) + +var ErrCBClosed = errors.New("circuit breaker is closed") + +func NewCircuitBreaker(breakDuration time.Duration, threshold int) *circuitBreaker { + if threshold == 0 { + threshold = defaultThreshold + } + if breakDuration == 0 { + breakDuration = defaultBreakDuration + } + return &circuitBreaker{ + breakDuration: breakDuration, + threshold: threshold, + state: make(map[string]state), + } +} + +func (c *circuitBreaker) Dial(ctx context.Context, cli dialer) error { + c.mu.Lock() + defer c.mu.Unlock() + + endpoint := cli.endpoint() + + if _, ok := c.state[endpoint]; !ok { + c.state[endpoint] = state{} + } + + s := c.state[endpoint] + defer func() { + c.state[endpoint] = s + }() + + if time.Since(s.breakTimestamp) < c.breakDuration { + return ErrCBClosed + } + + err := cli.dial(ctx) + if err == nil { + s.counter = 0 + return nil + } + + s.counter++ + if s.counter >= c.threshold { + s.counter = c.threshold + s.breakTimestamp = time.Now() + } + + return err +} diff --git a/pool/tree/circuitbreaker_test.go b/pool/tree/circuitbreaker_test.go new file mode 100644 index 0000000..f507655 --- /dev/null +++ b/pool/tree/circuitbreaker_test.go @@ -0,0 +1,60 @@ +package tree + +import ( + "context" + "errors" + "testing" + "time" + + "github.com/stretchr/testify/require" +) + +type ( + testDialer struct { + err error + addr string + } +) + +func (d *testDialer) dial(_ context.Context) error { + return d.err +} + +func (d *testDialer) endpoint() string { + return d.addr +} + +func TestCircuitBreaker(t *testing.T) { + ctx := context.Background() + remoteErr := errors.New("service is being synchronized") + d := &testDialer{ + err: remoteErr, + addr: "addr", + } + + // Hit threshold + cb := NewCircuitBreaker(1*time.Second, 10) + for i := 0; i < 10; i++ { + err := cb.Dial(ctx, d) + require.ErrorIs(t, err, remoteErr) + } + + // Immediate request should return circuit breaker error + d.err = nil + require.ErrorIs(t, cb.Dial(ctx, d), ErrCBClosed) + + // Request after breakDuration should be ok + time.Sleep(1 * time.Second) + require.NoError(t, cb.Dial(ctx, d)) + + // Then hit threshold once again + d.err = remoteErr + for i := 0; i < 10; i++ { + err := cb.Dial(ctx, d) + require.ErrorIs(t, err, remoteErr) + } + + // Immediate request should return circuit breaker error + d.err = nil + require.ErrorIs(t, cb.Dial(ctx, d), ErrCBClosed) +} diff --git a/pool/tree/pool.go b/pool/tree/pool.go index c82e269..b0c8af6 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -117,6 +117,9 @@ type Pool struct { // * retry in case of request failure (see Pool.requestWithRetry) // startIndices will be used if netMapInfoSource is not set startIndices [2]int + + // circuit breaker for dial operations + cb *circuitBreaker } type innerPool struct { @@ -248,6 +251,7 @@ func NewPool(options InitParameters) (*Pool, error) { methods: methods, netMapInfoSource: options.netMapInfoSource, clientMap: make(map[uint64]client), + cb: NewCircuitBreaker(0, 0), } if options.netMapInfoSource == nil { @@ -284,7 +288,7 @@ func (p *Pool) Dial(ctx context.Context) error { clients := make([]client, len(nodes)) for j, node := range nodes { clients[j] = newTreeClient(node.Address(), p.dialOptions, p.nodeDialTimeout, p.streamTimeout) - if err := clients[j].dial(ctx); err != nil { + if err := p.cb.Dial(ctx, clients[j]); err != nil { p.log(zap.WarnLevel, "failed to dial tree client", zap.String("address", node.Address()), zap.Error(err)) continue } @@ -1055,7 +1059,7 @@ func (p *Pool) getNewTreeClient(ctx context.Context, node netmap.NodeInfo) (*tre } newTreeCl := newTreeClient(addr.URIAddr(), p.dialOptions, p.nodeDialTimeout, p.streamTimeout) - if err = newTreeCl.dial(ctx); err != nil { + if err = p.cb.Dial(ctx, newTreeCl); err != nil { p.log(zap.WarnLevel, "failed to dial tree client", zap.String("address", addr.URIAddr()), zap.Error(err)) // We have to close connection here after failed `dial()`. From f78fb6dcb064fd2e6521a54b42b088d82560ebb0 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 4 Mar 2025 12:17:20 +0300 Subject: [PATCH 159/197] [#339] pool/tree: Make circuit breaker more generic Signed-off-by: Alex Vanin --- pool/tree/circuitbreaker.go | 35 ++++++----------------- pool/tree/circuitbreaker_test.go | 49 ++++++++++---------------------- pool/tree/pool.go | 38 ++++++++++++++++++------- 3 files changed, 51 insertions(+), 71 deletions(-) diff --git a/pool/tree/circuitbreaker.go b/pool/tree/circuitbreaker.go index 83d11c4..c494ddd 100644 --- a/pool/tree/circuitbreaker.go +++ b/pool/tree/circuitbreaker.go @@ -1,73 +1,54 @@ package tree import ( - "context" "errors" "sync" "time" ) -const ( - defaultThreshold = 10 - defaultBreakDuration = 10 * time.Second -) - type ( circuitBreaker struct { breakDuration time.Duration threshold int mu sync.Mutex - state map[string]state + state map[uint64]state } state struct { counter int breakTimestamp time.Time } - - dialer interface { - dial(context.Context) error - endpoint() string - } ) var ErrCBClosed = errors.New("circuit breaker is closed") func NewCircuitBreaker(breakDuration time.Duration, threshold int) *circuitBreaker { - if threshold == 0 { - threshold = defaultThreshold - } - if breakDuration == 0 { - breakDuration = defaultBreakDuration - } return &circuitBreaker{ breakDuration: breakDuration, threshold: threshold, - state: make(map[string]state), + state: make(map[uint64]state), } } -func (c *circuitBreaker) Dial(ctx context.Context, cli dialer) error { +func (c *circuitBreaker) Do(id uint64, f func() error) error { c.mu.Lock() defer c.mu.Unlock() - endpoint := cli.endpoint() - - if _, ok := c.state[endpoint]; !ok { - c.state[endpoint] = state{} + if _, ok := c.state[id]; !ok { + c.state[id] = state{} } - s := c.state[endpoint] + s := c.state[id] defer func() { - c.state[endpoint] = s + c.state[id] = s }() if time.Since(s.breakTimestamp) < c.breakDuration { return ErrCBClosed } - err := cli.dial(ctx) + err := f() if err == nil { s.counter = 0 return nil diff --git a/pool/tree/circuitbreaker_test.go b/pool/tree/circuitbreaker_test.go index f507655..4f7974c 100644 --- a/pool/tree/circuitbreaker_test.go +++ b/pool/tree/circuitbreaker_test.go @@ -1,7 +1,6 @@ package tree import ( - "context" "errors" "testing" "time" @@ -9,52 +8,34 @@ import ( "github.com/stretchr/testify/require" ) -type ( - testDialer struct { - err error - addr string - } -) - -func (d *testDialer) dial(_ context.Context) error { - return d.err -} - -func (d *testDialer) endpoint() string { - return d.addr -} - func TestCircuitBreaker(t *testing.T) { - ctx := context.Background() remoteErr := errors.New("service is being synchronized") - d := &testDialer{ - err: remoteErr, - addr: "addr", - } + breakDuration := 1 * time.Second + threshold := 10 + cb := NewCircuitBreaker(breakDuration, threshold) // Hit threshold - cb := NewCircuitBreaker(1*time.Second, 10) - for i := 0; i < 10; i++ { - err := cb.Dial(ctx, d) + for i := 0; i < threshold; i++ { + err := cb.Do(1, func() error { return remoteErr }) require.ErrorIs(t, err, remoteErr) } + // Different client should not be affected by threshold + require.NoError(t, cb.Do(2, func() error { return nil })) + // Immediate request should return circuit breaker error - d.err = nil - require.ErrorIs(t, cb.Dial(ctx, d), ErrCBClosed) + require.ErrorIs(t, cb.Do(1, func() error { return nil }), ErrCBClosed) // Request after breakDuration should be ok - time.Sleep(1 * time.Second) - require.NoError(t, cb.Dial(ctx, d)) + time.Sleep(breakDuration) + require.NoError(t, cb.Do(1, func() error { return nil })) - // Then hit threshold once again - d.err = remoteErr - for i := 0; i < 10; i++ { - err := cb.Dial(ctx, d) + // Try hitting threshold one more time after break duration + for i := 0; i < threshold; i++ { + err := cb.Do(1, func() error { return remoteErr }) require.ErrorIs(t, err, remoteErr) } // Immediate request should return circuit breaker error - d.err = nil - require.ErrorIs(t, cb.Dial(ctx, d), ErrCBClosed) + require.ErrorIs(t, cb.Do(1, func() error { return nil }), ErrCBClosed) } diff --git a/pool/tree/pool.go b/pool/tree/pool.go index b0c8af6..5c7fbce 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -24,10 +24,12 @@ import ( ) const ( - defaultRebalanceInterval = 15 * time.Second - defaultHealthcheckTimeout = 4 * time.Second - defaultDialTimeout = 5 * time.Second - defaultStreamTimeout = 10 * time.Second + defaultRebalanceInterval = 15 * time.Second + defaultHealthcheckTimeout = 4 * time.Second + defaultDialTimeout = 5 * time.Second + defaultStreamTimeout = 10 * time.Second + defaultCircuitBreakerDuration = 10 * time.Second + defaultCircuitBreakerTreshold = 10 ) // SubTreeSort defines an order of nodes returned from GetSubTree RPC. @@ -76,6 +78,8 @@ type InitParameters struct { dialOptions []grpc.DialOption maxRequestAttempts int netMapInfoSource NetMapInfoSource + circuitBreakerThreshold int + circuitBreakerDuration time.Duration } type NetMapInfoSource interface { @@ -117,8 +121,7 @@ type Pool struct { // * retry in case of request failure (see Pool.requestWithRetry) // startIndices will be used if netMapInfoSource is not set startIndices [2]int - - // circuit breaker for dial operations + // circuit breaker for dial operations when netmap is being used cb *circuitBreaker } @@ -251,7 +254,10 @@ func NewPool(options InitParameters) (*Pool, error) { methods: methods, netMapInfoSource: options.netMapInfoSource, clientMap: make(map[uint64]client), - cb: NewCircuitBreaker(0, 0), + cb: NewCircuitBreaker( + options.circuitBreakerDuration, + options.circuitBreakerThreshold, + ), } if options.netMapInfoSource == nil { @@ -288,7 +294,7 @@ func (p *Pool) Dial(ctx context.Context) error { clients := make([]client, len(nodes)) for j, node := range nodes { clients[j] = newTreeClient(node.Address(), p.dialOptions, p.nodeDialTimeout, p.streamTimeout) - if err := p.cb.Dial(ctx, clients[j]); err != nil { + if err := clients[j].dial(ctx); err != nil { p.log(zap.WarnLevel, "failed to dial tree client", zap.String("address", node.Address()), zap.Error(err)) continue } @@ -793,6 +799,15 @@ func fillDefaultInitParams(params *InitParameters) { if params.maxRequestAttempts <= 0 { params.maxRequestAttempts = len(params.nodeParams) } + + if params.circuitBreakerDuration <= 0 { + params.circuitBreakerDuration = defaultCircuitBreakerDuration + + } + + if params.circuitBreakerThreshold <= 0 { + params.circuitBreakerThreshold = defaultCircuitBreakerTreshold + } } func (p *Pool) log(level zapcore.Level, msg string, fields ...zap.Field) { @@ -988,7 +1003,10 @@ LOOP: treeCl, ok := p.getClientFromMap(cnrNode.Hash()) if !ok { - treeCl, err = p.getNewTreeClient(ctx, cnrNode) + err = p.cb.Do(cnrNode.Hash(), func() error { + treeCl, err = p.getNewTreeClient(ctx, cnrNode) + return err + }) if err != nil { finErr = finalError(finErr, err) p.log(zap.DebugLevel, "failed to create tree client", zap.String("request_id", reqID), zap.Int("remaining attempts", attempts)) @@ -1059,7 +1077,7 @@ func (p *Pool) getNewTreeClient(ctx context.Context, node netmap.NodeInfo) (*tre } newTreeCl := newTreeClient(addr.URIAddr(), p.dialOptions, p.nodeDialTimeout, p.streamTimeout) - if err = p.cb.Dial(ctx, newTreeCl); err != nil { + if err = newTreeCl.dial(ctx); err != nil { p.log(zap.WarnLevel, "failed to dial tree client", zap.String("address", addr.URIAddr()), zap.Error(err)) // We have to close connection here after failed `dial()`. From c5991fc66d30e02d61ad0b4a8068201c85b9c5dc Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 4 Mar 2025 12:20:24 +0300 Subject: [PATCH 160/197] [#339] pool/tree: Fix linter issues Signed-off-by: Alex Vanin --- pool/tree/circuitbreaker.go | 2 +- pool/tree/circuitbreaker_test.go | 2 +- pool/tree/pool.go | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pool/tree/circuitbreaker.go b/pool/tree/circuitbreaker.go index c494ddd..db63fb8 100644 --- a/pool/tree/circuitbreaker.go +++ b/pool/tree/circuitbreaker.go @@ -23,7 +23,7 @@ type ( var ErrCBClosed = errors.New("circuit breaker is closed") -func NewCircuitBreaker(breakDuration time.Duration, threshold int) *circuitBreaker { +func newCircuitBreaker(breakDuration time.Duration, threshold int) *circuitBreaker { return &circuitBreaker{ breakDuration: breakDuration, threshold: threshold, diff --git a/pool/tree/circuitbreaker_test.go b/pool/tree/circuitbreaker_test.go index 4f7974c..d15e920 100644 --- a/pool/tree/circuitbreaker_test.go +++ b/pool/tree/circuitbreaker_test.go @@ -12,7 +12,7 @@ func TestCircuitBreaker(t *testing.T) { remoteErr := errors.New("service is being synchronized") breakDuration := 1 * time.Second threshold := 10 - cb := NewCircuitBreaker(breakDuration, threshold) + cb := newCircuitBreaker(breakDuration, threshold) // Hit threshold for i := 0; i < threshold; i++ { diff --git a/pool/tree/pool.go b/pool/tree/pool.go index 5c7fbce..60c205f 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -254,7 +254,7 @@ func NewPool(options InitParameters) (*Pool, error) { methods: methods, netMapInfoSource: options.netMapInfoSource, clientMap: make(map[uint64]client), - cb: NewCircuitBreaker( + cb: newCircuitBreaker( options.circuitBreakerDuration, options.circuitBreakerThreshold, ), @@ -802,7 +802,6 @@ func fillDefaultInitParams(params *InitParameters) { if params.circuitBreakerDuration <= 0 { params.circuitBreakerDuration = defaultCircuitBreakerDuration - } if params.circuitBreakerThreshold <= 0 { From 2d08fa524019bb2298428074097a7242116fba24 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 4 Mar 2025 12:41:07 +0300 Subject: [PATCH 161/197] [#339] pool/tree: Close replaced connection in client map There is a race condition: multiple clients are created and dialled, but only one is stored in the map. Others are remaining active but not used. With this change, new connection replaces old connection and closes it. Signed-off-by: Alex Vanin --- pool/tree/pool.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pool/tree/pool.go b/pool/tree/pool.go index 60c205f..7b1afef 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -1012,7 +1012,7 @@ LOOP: continue } - p.addClientToMap(cnrNode.Hash(), treeCl) + treeCl = p.addClientToMap(cnrNode.Hash(), treeCl) } attempts-- @@ -1047,10 +1047,16 @@ func (p *Pool) getClientFromMap(hash uint64) (client, bool) { return cl, ok } -func (p *Pool) addClientToMap(hash uint64, cl client) { +func (p *Pool) addClientToMap(hash uint64, cl client) client { p.mutex.Lock() + defer p.mutex.Unlock() + + if old, ok := p.clientMap[hash]; ok { + _ = cl.close() + return old + } p.clientMap[hash] = cl - p.mutex.Unlock() + return cl } func (p *Pool) deleteClientFromMap(hash uint64) { From 06ef257ddc9ffc8f489de3ea73e9b53dfcbfa174 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 4 Mar 2025 14:08:08 +0300 Subject: [PATCH 162/197] [#339] pool/tree: Do not lock mutex on circuit break function Circuit break function may take some time to execute so it should not be executed when lock is enabled. Signed-off-by: Alex Vanin --- pool/tree/circuitbreaker.go | 61 ++++++++++++++++++++++---------- pool/tree/circuitbreaker_test.go | 27 ++++++++++++++ 2 files changed, 69 insertions(+), 19 deletions(-) diff --git a/pool/tree/circuitbreaker.go b/pool/tree/circuitbreaker.go index db63fb8..5eadcb4 100644 --- a/pool/tree/circuitbreaker.go +++ b/pool/tree/circuitbreaker.go @@ -11,7 +11,7 @@ type ( breakDuration time.Duration threshold int - mu sync.Mutex + mu sync.RWMutex state map[uint64]state } @@ -31,33 +31,56 @@ func newCircuitBreaker(breakDuration time.Duration, threshold int) *circuitBreak } } -func (c *circuitBreaker) Do(id uint64, f func() error) error { - c.mu.Lock() - defer c.mu.Unlock() +func (cb *circuitBreaker) breakTime(id uint64) (time.Time, bool) { + cb.mu.RLock() + defer cb.mu.RUnlock() - if _, ok := c.state[id]; !ok { - c.state[id] = state{} + if s, ok := cb.state[id]; ok { + return s.breakTimestamp, true } - s := c.state[id] - defer func() { - c.state[id] = s - }() + return time.Time{}, false +} - if time.Since(s.breakTimestamp) < c.breakDuration { +func (cb *circuitBreaker) openBreak(id uint64) { + cb.mu.Lock() + defer cb.mu.Unlock() + delete(cb.state, id) +} + +func (cb *circuitBreaker) incError(id uint64, doTime time.Time) { + cb.mu.Lock() + defer cb.mu.Unlock() + + s := cb.state[id] + + s.counter++ + if s.counter >= cb.threshold { + s.counter = cb.threshold + if s.breakTimestamp.Before(doTime) { + s.breakTimestamp = doTime + } + } + + cb.state[id] = s +} + +func (c *circuitBreaker) Do(id uint64, f func() error) error { + breakTime, ok := c.breakTime(id) + if ok && time.Since(breakTime) < c.breakDuration { return ErrCBClosed } + // Use this timestamp to update circuit breaker in case of an error. + // f() may be blocked for unpredictable duration, so concurrent calls + // may update time in 'incError' endlessly and circuit will never be open + doTime := time.Now() + err := f() if err == nil { - s.counter = 0 - return nil - } - - s.counter++ - if s.counter >= c.threshold { - s.counter = c.threshold - s.breakTimestamp = time.Now() + c.openBreak(id) + } else { + c.incError(id, doTime) } return err diff --git a/pool/tree/circuitbreaker_test.go b/pool/tree/circuitbreaker_test.go index d15e920..aefa9d6 100644 --- a/pool/tree/circuitbreaker_test.go +++ b/pool/tree/circuitbreaker_test.go @@ -2,6 +2,7 @@ package tree import ( "errors" + "runtime" "testing" "time" @@ -39,3 +40,29 @@ func TestCircuitBreaker(t *testing.T) { // Immediate request should return circuit breaker error require.ErrorIs(t, cb.Do(1, func() error { return nil }), ErrCBClosed) } + +func TestCircuitBreakerNoBlock(t *testing.T) { + remoteErr := errors.New("service is being synchronized") + funcDuration := 2 * time.Second + threshold := 100 + cb := newCircuitBreaker(1*time.Minute, threshold) + + slowFunc := func() error { + time.Sleep(funcDuration) + return remoteErr + } + + for i := 0; i < threshold; i++ { + // run in multiple goroutines Do function and make sure it is not + go func() { + cb.Do(1, slowFunc) + }() + } + + // wait for one slow func duration + some delta + time.Sleep(funcDuration + 100*time.Millisecond) + runtime.Gosched() + // expect that all goroutines were not blocked by mutex in circuit breaker + // therefore all functions are done and circuit is closed + require.ErrorIs(t, cb.Do(1, func() error { return nil }), ErrCBClosed) +} From d592bb931eb861a1acd239854e80bbf71ece8a7a Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 4 Mar 2025 14:49:07 +0300 Subject: [PATCH 163/197] [#339] pool/tree: Configure circuit breaker parameters Signed-off-by: Alex Vanin --- pool/tree/pool.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pool/tree/pool.go b/pool/tree/pool.go index 7b1afef..f5cee26 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -376,6 +376,18 @@ func (x *InitParameters) SetNetMapInfoSource(netMapInfoSource NetMapInfoSource) x.netMapInfoSource = netMapInfoSource } +// SetCircuitBreakerThreshold sets number of consecutive failed connection before +// circuit is considered closed and therefore return error immediately. +func (x *InitParameters) SetCircuitBreakerThreshold(circuitBreakerThreshold int) { + x.circuitBreakerThreshold = circuitBreakerThreshold +} + +// SetCircuitBreakerDuration sets duration for circuit to be considered closed. +// This effectively limits to one new connection try per duration. +func (x *InitParameters) SetCircuitBreakerDuration(circuitBreakerDuration time.Duration) { + x.circuitBreakerDuration = circuitBreakerDuration +} + // GetNodes invokes eponymous method from TreeServiceClient. // // Can return predefined errors: From 7a37613988a4f15877df26cd3a482c0e79a23f9f Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 4 Mar 2025 17:37:58 +0300 Subject: [PATCH 164/197] [#339] pool/tree: Improve code after review Signed-off-by: Alex Vanin --- pool/tree/circuitbreaker.go | 33 ++++++++++++++------------------ pool/tree/circuitbreaker_test.go | 20 +++++++++---------- 2 files changed, 24 insertions(+), 29 deletions(-) diff --git a/pool/tree/circuitbreaker.go b/pool/tree/circuitbreaker.go index 5eadcb4..82615a6 100644 --- a/pool/tree/circuitbreaker.go +++ b/pool/tree/circuitbreaker.go @@ -31,15 +31,16 @@ func newCircuitBreaker(breakDuration time.Duration, threshold int) *circuitBreak } } -func (cb *circuitBreaker) breakTime(id uint64) (time.Time, bool) { +func (cb *circuitBreaker) checkBreak(id uint64) error { cb.mu.RLock() - defer cb.mu.RUnlock() + s, ok := cb.state[id] + cb.mu.RUnlock() - if s, ok := cb.state[id]; ok { - return s.breakTimestamp, true + if ok && time.Since(s.breakTimestamp) < cb.breakDuration { + return ErrCBClosed } - return time.Time{}, false + return nil } func (cb *circuitBreaker) openBreak(id uint64) { @@ -48,7 +49,7 @@ func (cb *circuitBreaker) openBreak(id uint64) { delete(cb.state, id) } -func (cb *circuitBreaker) incError(id uint64, doTime time.Time) { +func (cb *circuitBreaker) incError(id uint64) { cb.mu.Lock() defer cb.mu.Unlock() @@ -57,30 +58,24 @@ func (cb *circuitBreaker) incError(id uint64, doTime time.Time) { s.counter++ if s.counter >= cb.threshold { s.counter = cb.threshold - if s.breakTimestamp.Before(doTime) { - s.breakTimestamp = doTime + if time.Since(s.breakTimestamp) >= cb.breakDuration { + s.breakTimestamp = time.Now() } } cb.state[id] = s } -func (c *circuitBreaker) Do(id uint64, f func() error) error { - breakTime, ok := c.breakTime(id) - if ok && time.Since(breakTime) < c.breakDuration { - return ErrCBClosed +func (cb *circuitBreaker) Do(id uint64, f func() error) error { + if err := cb.checkBreak(id); err != nil { + return err } - // Use this timestamp to update circuit breaker in case of an error. - // f() may be blocked for unpredictable duration, so concurrent calls - // may update time in 'incError' endlessly and circuit will never be open - doTime := time.Now() - err := f() if err == nil { - c.openBreak(id) + cb.openBreak(id) } else { - c.incError(id, doTime) + cb.incError(id) } return err diff --git a/pool/tree/circuitbreaker_test.go b/pool/tree/circuitbreaker_test.go index aefa9d6..c616d1b 100644 --- a/pool/tree/circuitbreaker_test.go +++ b/pool/tree/circuitbreaker_test.go @@ -2,7 +2,6 @@ package tree import ( "errors" - "runtime" "testing" "time" @@ -43,9 +42,9 @@ func TestCircuitBreaker(t *testing.T) { func TestCircuitBreakerNoBlock(t *testing.T) { remoteErr := errors.New("service is being synchronized") - funcDuration := 2 * time.Second + funcDuration := 200 * time.Millisecond threshold := 100 - cb := newCircuitBreaker(1*time.Minute, threshold) + cb := newCircuitBreaker(10*funcDuration, threshold) slowFunc := func() error { time.Sleep(funcDuration) @@ -53,16 +52,17 @@ func TestCircuitBreakerNoBlock(t *testing.T) { } for i := 0; i < threshold; i++ { - // run in multiple goroutines Do function and make sure it is not + // run in multiple goroutines Do function go func() { cb.Do(1, slowFunc) }() } - // wait for one slow func duration + some delta - time.Sleep(funcDuration + 100*time.Millisecond) - runtime.Gosched() - // expect that all goroutines were not blocked by mutex in circuit breaker - // therefore all functions are done and circuit is closed - require.ErrorIs(t, cb.Do(1, func() error { return nil }), ErrCBClosed) + time.Sleep(funcDuration) + + // eventually at most after one more func duration circuit breaker will be + // closed and not blocked by slow func execution under mutex + require.Eventually(t, func() bool { + return errors.Is(cb.Do(1, func() error { return nil }), ErrCBClosed) + }, funcDuration, funcDuration/10) } From 69b0711d12d94cf4cb07eb1de218c1955a3c66ad Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 5 Mar 2025 15:06:29 +0300 Subject: [PATCH 165/197] [#342] client: Disable service config query By default, gRPC fetches TXT report while resolving a domain. https://github.com/grpc/grpc-go/blob/0914bba6c5c5a545d34bd11e5dee0bbb8eaadd3f/internal/resolver/dns/dns_resolver.go#L336 This leads to a hanging dial if DNS is unavailable, even though the host may be specified in `/etc/hosts` (hello, localhost!). Use `grpc.WithDisableServiceConfig()` to override the default. This option seems impossible to override with `WithGRPCDialOpts()`, but we do not use service config anyway. Signed-off-by: Evgenii Stratonikov --- api/rpc/client/options.go | 1 + 1 file changed, 1 insertion(+) diff --git a/api/rpc/client/options.go b/api/rpc/client/options.go index 5711cd4..df6f6ed 100644 --- a/api/rpc/client/options.go +++ b/api/rpc/client/options.go @@ -38,6 +38,7 @@ func (c *cfg) initDefault() { c.rwTimeout = defaultRWTimeout c.grpcDialOpts = []grpc.DialOption{ grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithDisableServiceConfig(), } } From b480df99ca2a3bde634eacf47c471ba9aba051ae Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Wed, 5 Mar 2025 18:16:25 +0300 Subject: [PATCH 166/197] [#300] pool: Extract connection handler functionality to 'connectionManager' Signed-off-by: Alexander Chuprov --- pool/pool.go | 281 +++++++++++++++++++++++++------------------ pool/pool_test.go | 59 +++++---- pool/sampler_test.go | 21 ++-- 3 files changed, 201 insertions(+), 160 deletions(-) diff --git a/pool/pool.go b/pool/pool.go index 1f69577..5b37fcb 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -2006,17 +2006,23 @@ type resCreateSession struct { // // See pool package overview to get some examples. type Pool struct { - innerPools []*innerPool - key *ecdsa.PrivateKey + manager *connectionManager + logger *zap.Logger + key *ecdsa.PrivateKey + cache *sessionCache + stokenDuration uint64 + + maxObjectSize uint64 +} + +type connectionManager struct { + innerPools []*innerPool + cancel context.CancelFunc closedCh chan struct{} - cache *sessionCache - stokenDuration uint64 rebalanceParams rebalanceParameters clientBuilder clientBuilder logger *zap.Logger - - maxObjectSize uint64 } type innerPool struct { @@ -2038,8 +2044,10 @@ const ( defaultBufferMaxSizeForPut = 3 * 1024 * 1024 // 3 MB ) -// NewPool creates connection pool using parameters. -func NewPool(options InitParameters) (*Pool, error) { +// newConnectionManager returns an instance of connectionManager configured according to the parameters. +// +// Before using connectionManager, you MUST call Dial. +func newConnectionManager(options InitParameters) (*connectionManager, error) { if options.key == nil { return nil, fmt.Errorf("missed required parameter 'Key'") } @@ -2049,18 +2057,8 @@ func NewPool(options InitParameters) (*Pool, error) { return nil, err } - cache, err := newCache(options.sessionExpirationDuration) - if err != nil { - return nil, fmt.Errorf("couldn't create cache: %w", err) - } - - fillDefaultInitParams(&options, cache) - - pool := &Pool{ - key: options.key, - cache: cache, - logger: options.logger, - stokenDuration: options.sessionExpirationDuration, + manager := &connectionManager{ + logger: options.logger, rebalanceParams: rebalanceParameters{ nodesParams: nodesParams, nodeRequestTimeout: options.healthcheckTimeout, @@ -2070,6 +2068,33 @@ func NewPool(options InitParameters) (*Pool, error) { clientBuilder: options.clientBuilder, } + return manager, nil +} + +// NewPool returns an instance of Pool configured according to the parameters. +// +// Before using Pool, you MUST call Dial. +func NewPool(options InitParameters) (*Pool, error) { + cache, err := newCache(options.sessionExpirationDuration) + if err != nil { + return nil, fmt.Errorf("couldn't create cache: %w", err) + } + + fillDefaultInitParams(&options, cache) + + manager, err := newConnectionManager(options) + if err != nil { + return nil, err + } + + pool := &Pool{ + cache: cache, + key: options.key, + logger: options.logger, + manager: manager, + stokenDuration: options.sessionExpirationDuration, + } + return pool, nil } @@ -2082,28 +2107,51 @@ func NewPool(options InitParameters) (*Pool, error) { // // See also InitParameters.SetClientRebalanceInterval. func (p *Pool) Dial(ctx context.Context) error { - inner := make([]*innerPool, len(p.rebalanceParams.nodesParams)) + err := p.manager.dial(ctx) + if err != nil { + return err + } + + var atLeastOneHealthy bool + p.manager.iterate(func(cl client) { + var st session.Object + err := initSessionForDuration(ctx, &st, cl, p.manager.rebalanceParams.sessionExpirationDuration, *p.key, false) + if err != nil { + if p.logger != nil { + p.logger.Log(zap.WarnLevel, "failed to create frostfs session token for client", + zap.String("address", cl.address()), zap.Error(err)) + } + return + } + + _ = p.cache.Put(formCacheKey(cl.address(), p.key, false), st) + atLeastOneHealthy = true + }) + + if !atLeastOneHealthy { + return fmt.Errorf("at least one node must be healthy") + } + + ni, err := p.NetworkInfo(ctx) + if err != nil { + return fmt.Errorf("get network info for max object size: %w", err) + } + p.maxObjectSize = ni.MaxObjectSize() + return nil +} + +func (cm *connectionManager) dial(ctx context.Context) error { + inner := make([]*innerPool, len(cm.rebalanceParams.nodesParams)) var atLeastOneHealthy bool - for i, params := range p.rebalanceParams.nodesParams { + for i, params := range cm.rebalanceParams.nodesParams { clients := make([]client, len(params.weights)) for j, addr := range params.addresses { - clients[j] = p.clientBuilder(addr) + clients[j] = cm.clientBuilder(addr) if err := clients[j].dial(ctx); err != nil { - p.log(zap.WarnLevel, "failed to build client", zap.String("address", addr), zap.Error(err)) + cm.log(zap.WarnLevel, "failed to build client", zap.String("address", addr), zap.Error(err)) continue } - - var st session.Object - err := initSessionForDuration(ctx, &st, clients[j], p.rebalanceParams.sessionExpirationDuration, *p.key, false) - if err != nil { - clients[j].setUnhealthy() - p.log(zap.WarnLevel, "failed to create frostfs session token for client", - zap.String("address", addr), zap.Error(err)) - continue - } - - _ = p.cache.Put(formCacheKey(addr, p.key, false), st) atLeastOneHealthy = true } source := rand.NewSource(time.Now().UnixNano()) @@ -2120,26 +2168,20 @@ func (p *Pool) Dial(ctx context.Context) error { } ctx, cancel := context.WithCancel(ctx) - p.cancel = cancel - p.closedCh = make(chan struct{}) - p.innerPools = inner + cm.cancel = cancel + cm.closedCh = make(chan struct{}) + cm.innerPools = inner - ni, err := p.NetworkInfo(ctx) - if err != nil { - return fmt.Errorf("get network info for max object size: %w", err) - } - p.maxObjectSize = ni.MaxObjectSize() - - go p.startRebalance(ctx) + go cm.startRebalance(ctx) return nil } -func (p *Pool) log(level zapcore.Level, msg string, fields ...zap.Field) { - if p.logger == nil { +func (cm *connectionManager) log(level zapcore.Level, msg string, fields ...zap.Field) { + if cm.logger == nil { return } - p.logger.Log(level, msg, fields...) + cm.logger.Log(level, msg, fields...) } func fillDefaultInitParams(params *InitParameters, cache *sessionCache) { @@ -2226,47 +2268,47 @@ func adjustNodeParams(nodeParams []NodeParam) ([]*nodesParam, error) { } // startRebalance runs loop to monitor connection healthy status. -func (p *Pool) startRebalance(ctx context.Context) { - ticker := time.NewTicker(p.rebalanceParams.clientRebalanceInterval) +func (cm *connectionManager) startRebalance(ctx context.Context) { + ticker := time.NewTicker(cm.rebalanceParams.clientRebalanceInterval) defer ticker.Stop() - buffers := make([][]float64, len(p.rebalanceParams.nodesParams)) - for i, params := range p.rebalanceParams.nodesParams { + buffers := make([][]float64, len(cm.rebalanceParams.nodesParams)) + for i, params := range cm.rebalanceParams.nodesParams { buffers[i] = make([]float64, len(params.weights)) } for { select { case <-ctx.Done(): - close(p.closedCh) + close(cm.closedCh) return case <-ticker.C: - p.updateNodesHealth(ctx, buffers) - ticker.Reset(p.rebalanceParams.clientRebalanceInterval) + cm.updateNodesHealth(ctx, buffers) + ticker.Reset(cm.rebalanceParams.clientRebalanceInterval) } } } -func (p *Pool) updateNodesHealth(ctx context.Context, buffers [][]float64) { +func (cm *connectionManager) updateNodesHealth(ctx context.Context, buffers [][]float64) { wg := sync.WaitGroup{} - for i, inner := range p.innerPools { + for i, inner := range cm.innerPools { wg.Add(1) bufferWeights := buffers[i] go func(i int, _ *innerPool) { defer wg.Done() - p.updateInnerNodesHealth(ctx, i, bufferWeights) + cm.updateInnerNodesHealth(ctx, i, bufferWeights) }(i, inner) } wg.Wait() } -func (p *Pool) updateInnerNodesHealth(ctx context.Context, i int, bufferWeights []float64) { - if i > len(p.innerPools)-1 { +func (cm *connectionManager) updateInnerNodesHealth(ctx context.Context, i int, bufferWeights []float64) { + if i > len(cm.innerPools)-1 { return } - pool := p.innerPools[i] - options := p.rebalanceParams + pool := cm.innerPools[i] + options := cm.rebalanceParams healthyChanged := new(atomic.Bool) wg := sync.WaitGroup{} @@ -2285,7 +2327,6 @@ func (p *Pool) updateInnerNodesHealth(ctx context.Context, i int, bufferWeights bufferWeights[j] = options.nodesParams[i].weights[j] } else { bufferWeights[j] = 0 - p.cache.DeleteByPrefix(cli.address()) } if changed { @@ -2294,7 +2335,7 @@ func (p *Pool) updateInnerNodesHealth(ctx context.Context, i int, bufferWeights fields = append(fields, zap.String("reason", err.Error())) } - p.log(zap.DebugLevel, "health has changed", fields...) + cm.log(zap.DebugLevel, "health has changed", fields...) healthyChanged.Store(true) } }(j, cli) @@ -2362,8 +2403,8 @@ func adjustWeights(weights []float64) []float64 { return adjusted } -func (p *Pool) connection() (client, error) { - for _, inner := range p.innerPools { +func (cm *connectionManager) connection() (client, error) { + for _, inner := range cm.innerPools { cp, err := inner.connection() if err == nil { return cp, nil @@ -2373,6 +2414,17 @@ func (p *Pool) connection() (client, error) { return nil, errors.New("no healthy client") } +// iterate iterates over all clients in all innerPools. +func (cm *connectionManager) iterate(cb func(client)) { + for _, inner := range cm.innerPools { + for _, cl := range inner.clients { + if cl.isHealthy() { + cb(cl) + } + } + } +} + func (p *innerPool) connection() (client, error) { p.lock.RLock() // need lock because of using p.sampler defer p.lock.RUnlock() @@ -2484,32 +2536,33 @@ type callContext struct { sessionClientCut bool } -func (p *Pool) initCallContext(ctx *callContext, cfg prmCommon, prmCtx prmContext) error { - cp, err := p.connection() +func (p *Pool) initCall(ctxCall *callContext, cfg prmCommon, prmCtx prmContext) error { + p.fillAppropriateKey(&cfg) + cp, err := p.manager.connection() if err != nil { return err } - ctx.key = cfg.key - if ctx.key == nil { + ctxCall.key = cfg.key + if ctxCall.key == nil { // use pool key if caller didn't specify its own - ctx.key = p.key + ctxCall.key = p.key } - ctx.endpoint = cp.address() - ctx.client = cp + ctxCall.endpoint = cp.address() + ctxCall.client = cp - if ctx.sessionTarget != nil && cfg.stoken != nil { - ctx.sessionTarget(*cfg.stoken) + if ctxCall.sessionTarget != nil && cfg.stoken != nil { + ctxCall.sessionTarget(*cfg.stoken) } // note that we don't override session provided by the caller - ctx.sessionDefault = cfg.stoken == nil && prmCtx.defaultSession - if ctx.sessionDefault { - ctx.sessionVerb = prmCtx.verb - ctx.sessionCnr = prmCtx.cnr - ctx.sessionObjSet = prmCtx.objSet - ctx.sessionObjs = prmCtx.objs + ctxCall.sessionDefault = cfg.stoken == nil && prmCtx.defaultSession + if ctxCall.sessionDefault { + ctxCall.sessionVerb = prmCtx.verb + ctxCall.sessionCnr = prmCtx.cnr + ctxCall.sessionObjSet = prmCtx.objSet + ctxCall.sessionObjs = prmCtx.objs } return err @@ -2594,10 +2647,8 @@ func (p *Pool) PatchObject(ctx context.Context, prm PrmObjectPatch) (ResPatchObj prmCtx.useVerb(session.VerbObjectPatch) prmCtx.useContainer(prm.addr.Container()) - p.fillAppropriateKey(&prm.prmCommon) - var ctxCall callContext - if err := p.initCallContext(&ctxCall, prm.prmCommon, prmCtx); err != nil { + if err := p.initCall(&ctxCall, prm.prmCommon, prmCtx); err != nil { return ResPatchObject{}, fmt.Errorf("init call context: %w", err) } @@ -2629,11 +2680,9 @@ func (p *Pool) PutObject(ctx context.Context, prm PrmObjectPut) (ResPutObject, e prmCtx.useVerb(session.VerbObjectPut) prmCtx.useContainer(cnr) - p.fillAppropriateKey(&prm.prmCommon) - var ctxCall callContext ctxCall.sessionClientCut = prm.clientCut - if err := p.initCallContext(&ctxCall, prm.prmCommon, prmCtx); err != nil { + if err := p.initCall(&ctxCall, prm.prmCommon, prmCtx); err != nil { return ResPutObject{}, fmt.Errorf("init call context: %w", err) } @@ -2686,12 +2735,10 @@ func (p *Pool) DeleteObject(ctx context.Context, prm PrmObjectDelete) error { } } - p.fillAppropriateKey(&prm.prmCommon) - var cc callContext cc.sessionTarget = prm.UseSession - err := p.initCallContext(&cc, prm.prmCommon, prmCtx) + err := p.initCall(&cc, prm.prmCommon, prmCtx) if err != nil { return err } @@ -2735,14 +2782,12 @@ type ResGetObject struct { // // Main return value MUST NOT be processed on an erroneous return. func (p *Pool) GetObject(ctx context.Context, prm PrmObjectGet) (ResGetObject, error) { - p.fillAppropriateKey(&prm.prmCommon) - var cc callContext cc.sessionTarget = prm.UseSession var res ResGetObject - err := p.initCallContext(&cc, prm.prmCommon, prmContext{}) + err := p.initCall(&cc, prm.prmCommon, prmContext{}) if err != nil { return res, err } @@ -2760,14 +2805,12 @@ func (p *Pool) GetObject(ctx context.Context, prm PrmObjectGet) (ResGetObject, e // // Main return value MUST NOT be processed on an erroneous return. func (p *Pool) HeadObject(ctx context.Context, prm PrmObjectHead) (object.Object, error) { - p.fillAppropriateKey(&prm.prmCommon) - var cc callContext cc.sessionTarget = prm.UseSession var obj object.Object - err := p.initCallContext(&cc, prm.prmCommon, prmContext{}) + err := p.initCall(&cc, prm.prmCommon, prmContext{}) if err != nil { return obj, err } @@ -2811,14 +2854,12 @@ func (x *ResObjectRange) Close() error { // // Main return value MUST NOT be processed on an erroneous return. func (p *Pool) ObjectRange(ctx context.Context, prm PrmObjectRange) (ResObjectRange, error) { - p.fillAppropriateKey(&prm.prmCommon) - var cc callContext cc.sessionTarget = prm.UseSession var res ResObjectRange - err := p.initCallContext(&cc, prm.prmCommon, prmContext{}) + err := p.initCall(&cc, prm.prmCommon, prmContext{}) if err != nil { return res, err } @@ -2882,14 +2923,12 @@ func (x *ResObjectSearch) Close() { // // Main return value MUST NOT be processed on an erroneous return. func (p *Pool) SearchObjects(ctx context.Context, prm PrmObjectSearch) (ResObjectSearch, error) { - p.fillAppropriateKey(&prm.prmCommon) - var cc callContext cc.sessionTarget = prm.UseSession var res ResObjectSearch - err := p.initCallContext(&cc, prm.prmCommon, prmContext{}) + err := p.initCall(&cc, prm.prmCommon, prmContext{}) if err != nil { return res, err } @@ -2914,7 +2953,7 @@ func (p *Pool) SearchObjects(ctx context.Context, prm PrmObjectSearch) (ResObjec // // Main return value MUST NOT be processed on an erroneous return. func (p *Pool) PutContainer(ctx context.Context, prm PrmContainerPut) (cid.ID, error) { - cp, err := p.connection() + cp, err := p.manager.connection() if err != nil { return cid.ID{}, err } @@ -2931,7 +2970,7 @@ func (p *Pool) PutContainer(ctx context.Context, prm PrmContainerPut) (cid.ID, e // // Main return value MUST NOT be processed on an erroneous return. func (p *Pool) GetContainer(ctx context.Context, prm PrmContainerGet) (container.Container, error) { - cp, err := p.connection() + cp, err := p.manager.connection() if err != nil { return container.Container{}, err } @@ -2946,7 +2985,7 @@ func (p *Pool) GetContainer(ctx context.Context, prm PrmContainerGet) (container // ListContainers requests identifiers of the account-owned containers. func (p *Pool) ListContainers(ctx context.Context, prm PrmContainerList) ([]cid.ID, error) { - cp, err := p.connection() + cp, err := p.manager.connection() if err != nil { return nil, err } @@ -2962,7 +3001,7 @@ func (p *Pool) ListContainers(ctx context.Context, prm PrmContainerList) ([]cid. // ListContainersStream requests identifiers of the account-owned containers. func (p *Pool) ListContainersStream(ctx context.Context, prm PrmListStream) (ResListStream, error) { var res ResListStream - cp, err := p.connection() + cp, err := p.manager.connection() if err != nil { return res, err } @@ -2984,7 +3023,7 @@ func (p *Pool) ListContainersStream(ctx context.Context, prm PrmListStream) (Res // // Success can be verified by reading by identifier (see GetContainer). func (p *Pool) DeleteContainer(ctx context.Context, prm PrmContainerDelete) error { - cp, err := p.connection() + cp, err := p.manager.connection() if err != nil { return err } @@ -2999,7 +3038,7 @@ func (p *Pool) DeleteContainer(ctx context.Context, prm PrmContainerDelete) erro // AddAPEChain sends a request to set APE chain rules for a target (basically, for a container). func (p *Pool) AddAPEChain(ctx context.Context, prm PrmAddAPEChain) error { - cp, err := p.connection() + cp, err := p.manager.connection() if err != nil { return err } @@ -3014,7 +3053,7 @@ func (p *Pool) AddAPEChain(ctx context.Context, prm PrmAddAPEChain) error { // RemoveAPEChain sends a request to remove APE chain rules for a target. func (p *Pool) RemoveAPEChain(ctx context.Context, prm PrmRemoveAPEChain) error { - cp, err := p.connection() + cp, err := p.manager.connection() if err != nil { return err } @@ -3029,7 +3068,7 @@ func (p *Pool) RemoveAPEChain(ctx context.Context, prm PrmRemoveAPEChain) error // ListAPEChains sends a request to list APE chains rules for a target. func (p *Pool) ListAPEChains(ctx context.Context, prm PrmListAPEChains) ([]ape.Chain, error) { - cp, err := p.connection() + cp, err := p.manager.connection() if err != nil { return nil, err } @@ -3046,7 +3085,7 @@ func (p *Pool) ListAPEChains(ctx context.Context, prm PrmListAPEChains) ([]ape.C // // Main return value MUST NOT be processed on an erroneous return. func (p *Pool) Balance(ctx context.Context, prm PrmBalanceGet) (accounting.Decimal, error) { - cp, err := p.connection() + cp, err := p.manager.connection() if err != nil { return accounting.Decimal{}, err } @@ -3061,8 +3100,12 @@ func (p *Pool) Balance(ctx context.Context, prm PrmBalanceGet) (accounting.Decim // Statistic returns connection statistics. func (p Pool) Statistic() Statistic { + return p.manager.Statistic() +} + +func (cm connectionManager) Statistic() Statistic { stat := Statistic{} - for _, inner := range p.innerPools { + for _, inner := range cm.innerPools { nodes := make([]string, 0, len(inner.clients)) inner.lock.RLock() for _, cl := range inner.clients { @@ -3130,7 +3173,7 @@ func waitFor(ctx context.Context, params *WaitParams, condition func(context.Con // // Main return value MUST NOT be processed on an erroneous return. func (p *Pool) NetworkInfo(ctx context.Context) (netmap.NetworkInfo, error) { - cp, err := p.connection() + cp, err := p.manager.connection() if err != nil { return netmap.NetworkInfo{}, err } @@ -3147,7 +3190,7 @@ func (p *Pool) NetworkInfo(ctx context.Context) (netmap.NetworkInfo, error) { // // Main return value MUST NOT be processed on an erroneous return. func (p *Pool) NetMapSnapshot(ctx context.Context) (netmap.NetMap, error) { - cp, err := p.connection() + cp, err := p.manager.connection() if err != nil { return netmap.NetMap{}, err } @@ -3162,11 +3205,15 @@ func (p *Pool) NetMapSnapshot(ctx context.Context) (netmap.NetMap, error) { // Close closes the Pool and releases all the associated resources. func (p *Pool) Close() { - p.cancel() - <-p.closedCh + p.manager.close() +} + +func (cm *connectionManager) close() { + cm.cancel() + <-cm.closedCh // close all clients - for _, pools := range p.innerPools { + for _, pools := range cm.innerPools { for _, cli := range pools.clients { _ = cli.close() } diff --git a/pool/pool_test.go b/pool/pool_test.go index 1362654..75163fd 100644 --- a/pool/pool_test.go +++ b/pool/pool_test.go @@ -104,7 +104,7 @@ func TestBuildPoolOneNodeFailed(t *testing.T) { expectedAuthKey := frostfsecdsa.PublicKey(clientKeys[1].PublicKey) condition := func() bool { - cp, err := clientPool.connection() + cp, err := clientPool.manager.connection() if err != nil { return false } @@ -141,7 +141,7 @@ func TestOneNode(t *testing.T) { require.NoError(t, err) t.Cleanup(pool.Close) - cp, err := pool.connection() + cp, err := pool.manager.connection() require.NoError(t, err) st, _ := pool.cache.Get(formCacheKey(cp.address(), pool.key, false)) expectedAuthKey := frostfsecdsa.PublicKey(key1.PublicKey) @@ -171,7 +171,7 @@ func TestTwoNodes(t *testing.T) { require.NoError(t, err) t.Cleanup(pool.Close) - cp, err := pool.connection() + cp, err := pool.manager.connection() require.NoError(t, err) st, _ := pool.cache.Get(formCacheKey(cp.address(), pool.key, false)) require.True(t, assertAuthKeyForAny(st, clientKeys)) @@ -220,13 +220,12 @@ func TestOneOfTwoFailed(t *testing.T) { err = pool.Dial(context.Background()) require.NoError(t, err) - require.NoError(t, err) t.Cleanup(pool.Close) time.Sleep(2 * time.Second) for range 5 { - cp, err := pool.connection() + cp, err := pool.manager.connection() require.NoError(t, err) st, _ := pool.cache.Get(formCacheKey(cp.address(), pool.key, false)) require.True(t, assertAuthKeyForAny(st, clientKeys)) @@ -369,7 +368,7 @@ func TestUpdateNodesHealth(t *testing.T) { tc.prepareCli(cli) p, log := newPool(t, cli) - p.updateNodesHealth(ctx, [][]float64{{1}}) + p.manager.updateNodesHealth(ctx, [][]float64{{1}}) changed := tc.wasHealthy != tc.willHealthy require.Equalf(t, tc.willHealthy, cli.isHealthy(), "healthy status should be: %v", tc.willHealthy) @@ -385,19 +384,20 @@ func newPool(t *testing.T, cli *mockClient) (*Pool, *observer.ObservedLogs) { require.NoError(t, err) return &Pool{ - innerPools: []*innerPool{{ - sampler: newSampler([]float64{1}, rand.NewSource(0)), - clients: []client{cli}, - }}, - cache: cache, - key: newPrivateKey(t), - closedCh: make(chan struct{}), - rebalanceParams: rebalanceParameters{ - nodesParams: []*nodesParam{{1, []string{"peer0"}, []float64{1}}}, - nodeRequestTimeout: time.Second, - clientRebalanceInterval: 200 * time.Millisecond, - }, - logger: log, + cache: cache, + key: newPrivateKey(t), + manager: &connectionManager{ + innerPools: []*innerPool{{ + sampler: newSampler([]float64{1}, rand.NewSource(0)), + clients: []client{cli}, + }}, + closedCh: make(chan struct{}), + rebalanceParams: rebalanceParameters{ + nodesParams: []*nodesParam{{1, []string{"peer0"}, []float64{1}}}, + nodeRequestTimeout: time.Second, + clientRebalanceInterval: 200 * time.Millisecond, + }, + logger: log}, }, observedLog } @@ -435,7 +435,7 @@ func TestTwoFailed(t *testing.T) { time.Sleep(2 * time.Second) - _, err = pool.connection() + _, err = pool.manager.connection() require.Error(t, err) require.Contains(t, err.Error(), "no healthy") } @@ -469,7 +469,7 @@ func TestSessionCache(t *testing.T) { t.Cleanup(pool.Close) // cache must contain session token - cp, err := pool.connection() + cp, err := pool.manager.connection() require.NoError(t, err) st, _ := pool.cache.Get(formCacheKey(cp.address(), pool.key, false)) require.True(t, st.AssertAuthKey(&expectedAuthKey)) @@ -482,7 +482,7 @@ func TestSessionCache(t *testing.T) { require.Error(t, err) // cache must not contain session token - cp, err = pool.connection() + cp, err = pool.manager.connection() require.NoError(t, err) _, ok := pool.cache.Get(formCacheKey(cp.address(), pool.key, false)) require.False(t, ok) @@ -494,7 +494,7 @@ func TestSessionCache(t *testing.T) { require.NoError(t, err) // cache must contain session token - cp, err = pool.connection() + cp, err = pool.manager.connection() require.NoError(t, err) st, _ = pool.cache.Get(formCacheKey(cp.address(), pool.key, false)) require.True(t, st.AssertAuthKey(&expectedAuthKey)) @@ -538,7 +538,7 @@ func TestPriority(t *testing.T) { expectedAuthKey1 := frostfsecdsa.PublicKey(clientKeys[0].PublicKey) firstNode := func() bool { - cp, err := pool.connection() + cp, err := pool.manager.connection() require.NoError(t, err) st, _ := pool.cache.Get(formCacheKey(cp.address(), pool.key, false)) return st.AssertAuthKey(&expectedAuthKey1) @@ -546,7 +546,7 @@ func TestPriority(t *testing.T) { expectedAuthKey2 := frostfsecdsa.PublicKey(clientKeys[1].PublicKey) secondNode := func() bool { - cp, err := pool.connection() + cp, err := pool.manager.connection() require.NoError(t, err) st, _ := pool.cache.Get(formCacheKey(cp.address(), pool.key, false)) return st.AssertAuthKey(&expectedAuthKey2) @@ -583,7 +583,7 @@ func TestSessionCacheWithKey(t *testing.T) { require.NoError(t, err) // cache must contain session token - cp, err := pool.connection() + cp, err := pool.manager.connection() require.NoError(t, err) st, _ := pool.cache.Get(formCacheKey(cp.address(), pool.key, false)) require.True(t, st.AssertAuthKey(&expectedAuthKey)) @@ -636,9 +636,8 @@ func TestSessionTokenOwner(t *testing.T) { cc.sessionTarget = func(tok session.Object) { tkn = tok } - err = p.initCallContext(&cc, prm, prmCtx) + err = p.initCall(&cc, prm, prmCtx) require.NoError(t, err) - err = p.openDefaultSession(ctx, &cc) require.NoError(t, err) require.True(t, tkn.VerifySignature()) @@ -922,14 +921,14 @@ func TestSwitchAfterErrorThreshold(t *testing.T) { t.Cleanup(pool.Close) for range errorThreshold { - conn, err := pool.connection() + conn, err := pool.manager.connection() require.NoError(t, err) require.Equal(t, nodes[0].address, conn.address()) _, err = conn.objectGet(ctx, PrmObjectGet{}) require.Error(t, err) } - conn, err := pool.connection() + conn, err := pool.manager.connection() require.NoError(t, err) require.Equal(t, nodes[1].address, conn.address()) _, err = conn.objectGet(ctx, PrmObjectGet{}) diff --git a/pool/sampler_test.go b/pool/sampler_test.go index ab06e0f..b0860b1 100644 --- a/pool/sampler_test.go +++ b/pool/sampler_test.go @@ -47,9 +47,6 @@ func TestHealthyReweight(t *testing.T) { buffer = make([]float64, len(weights)) ) - cache, err := newCache(0) - require.NoError(t, err) - client1 := newMockClient(names[0], *newPrivateKey(t)) client1.errOnDial() @@ -59,22 +56,20 @@ func TestHealthyReweight(t *testing.T) { sampler: newSampler(weights, rand.NewSource(0)), clients: []client{client1, client2}, } - p := &Pool{ + cm := &connectionManager{ innerPools: []*innerPool{inner}, - cache: cache, - key: newPrivateKey(t), rebalanceParams: rebalanceParameters{nodesParams: []*nodesParam{{weights: weights}}}, } // check getting first node connection before rebalance happened - connection0, err := p.connection() + connection0, err := cm.connection() require.NoError(t, err) mock0 := connection0.(*mockClient) require.Equal(t, names[0], mock0.address()) - p.updateInnerNodesHealth(context.TODO(), 0, buffer) + cm.updateInnerNodesHealth(context.TODO(), 0, buffer) - connection1, err := p.connection() + connection1, err := cm.connection() require.NoError(t, err) mock1 := connection1.(*mockClient) require.Equal(t, names[1], mock1.address()) @@ -84,10 +79,10 @@ func TestHealthyReweight(t *testing.T) { inner.clients[0] = newMockClient(names[0], *newPrivateKey(t)) inner.lock.Unlock() - p.updateInnerNodesHealth(context.TODO(), 0, buffer) + cm.updateInnerNodesHealth(context.TODO(), 0, buffer) inner.sampler = newSampler(weights, rand.NewSource(0)) - connection0, err = p.connection() + connection0, err = cm.connection() require.NoError(t, err) mock0 = connection0.(*mockClient) require.Equal(t, names[0], mock0.address()) @@ -108,12 +103,12 @@ func TestHealthyNoReweight(t *testing.T) { newMockClient(names[1], *newPrivateKey(t)), }, } - p := &Pool{ + cm := &connectionManager{ innerPools: []*innerPool{inner}, rebalanceParams: rebalanceParameters{nodesParams: []*nodesParam{{weights: weights}}}, } - p.updateInnerNodesHealth(context.TODO(), 0, buffer) + cm.updateInnerNodesHealth(context.TODO(), 0, buffer) inner.lock.RLock() defer inner.lock.RUnlock() From b083bf85469fc1084e1da808bc0f69927abd68a0 Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Tue, 4 Mar 2025 18:06:26 +0300 Subject: [PATCH 167/197] [#300] pool: Extract healthCheck functionality from 'connectionManager' to 'healthCheck' Signed-off-by: Alexander Chuprov --- pool/pool.go | 70 ++++++++++++++++++++++++++++++++--------------- pool/pool_test.go | 7 ++--- 2 files changed, 51 insertions(+), 26 deletions(-) diff --git a/pool/pool.go b/pool/pool.go index 5b37fcb..4cf156d 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -2023,6 +2023,21 @@ type connectionManager struct { rebalanceParams rebalanceParameters clientBuilder clientBuilder logger *zap.Logger + healthChecker *healthCheck +} + +type healthCheck struct { + cancel context.CancelFunc + closedCh chan struct{} + + clientRebalanceInterval time.Duration +} + +func newHealthCheck(clientRebalanceInterval time.Duration) *healthCheck { + var h healthCheck + h.clientRebalanceInterval = clientRebalanceInterval + h.closedCh = make(chan struct{}) + return &h } type innerPool struct { @@ -2167,15 +2182,22 @@ func (cm *connectionManager) dial(ctx context.Context) error { return fmt.Errorf("at least one node must be healthy") } - ctx, cancel := context.WithCancel(ctx) - cm.cancel = cancel - cm.closedCh = make(chan struct{}) cm.innerPools = inner - go cm.startRebalance(ctx) + cm.healthChecker = newHealthCheck(cm.rebalanceParams.clientRebalanceInterval) + cm.healthChecker.startRebalance(ctx, cm.rebalance) return nil } +func (cm *connectionManager) rebalance(ctx context.Context) { + buffers := make([][]float64, len(cm.rebalanceParams.nodesParams)) + for i, params := range cm.rebalanceParams.nodesParams { + buffers[i] = make([]float64, len(params.weights)) + } + + cm.updateNodesHealth(ctx, buffers) +} + func (cm *connectionManager) log(level zapcore.Level, msg string, fields ...zap.Field) { if cm.logger == nil { return @@ -2268,25 +2290,30 @@ func adjustNodeParams(nodeParams []NodeParam) ([]*nodesParam, error) { } // startRebalance runs loop to monitor connection healthy status. -func (cm *connectionManager) startRebalance(ctx context.Context) { - ticker := time.NewTicker(cm.rebalanceParams.clientRebalanceInterval) - defer ticker.Stop() +func (h *healthCheck) startRebalance(ctx context.Context, callback func(ctx context.Context)) { + ctx, cancel := context.WithCancel(ctx) + h.cancel = cancel - buffers := make([][]float64, len(cm.rebalanceParams.nodesParams)) - for i, params := range cm.rebalanceParams.nodesParams { - buffers[i] = make([]float64, len(params.weights)) - } + go func() { + ticker := time.NewTicker(h.clientRebalanceInterval) + defer ticker.Stop() - for { - select { - case <-ctx.Done(): - close(cm.closedCh) - return - case <-ticker.C: - cm.updateNodesHealth(ctx, buffers) - ticker.Reset(cm.rebalanceParams.clientRebalanceInterval) + for { + select { + case <-ctx.Done(): + close(h.closedCh) + return + case <-ticker.C: + callback(ctx) + ticker.Reset(h.clientRebalanceInterval) + } } - } + }() +} + +func (h *healthCheck) stopRebalance() { + h.cancel() + <-h.closedCh } func (cm *connectionManager) updateNodesHealth(ctx context.Context, buffers [][]float64) { @@ -3209,8 +3236,7 @@ func (p *Pool) Close() { } func (cm *connectionManager) close() { - cm.cancel() - <-cm.closedCh + cm.healthChecker.stopRebalance() // close all clients for _, pools := range cm.innerPools { diff --git a/pool/pool_test.go b/pool/pool_test.go index 75163fd..b063294 100644 --- a/pool/pool_test.go +++ b/pool/pool_test.go @@ -391,11 +391,10 @@ func newPool(t *testing.T, cli *mockClient) (*Pool, *observer.ObservedLogs) { sampler: newSampler([]float64{1}, rand.NewSource(0)), clients: []client{cli}, }}, - closedCh: make(chan struct{}), + healthChecker: newHealthCheck(200 * time.Millisecond), rebalanceParams: rebalanceParameters{ - nodesParams: []*nodesParam{{1, []string{"peer0"}, []float64{1}}}, - nodeRequestTimeout: time.Second, - clientRebalanceInterval: 200 * time.Millisecond, + nodesParams: []*nodesParam{{1, []string{"peer0"}, []float64{1}}}, + nodeRequestTimeout: time.Second, }, logger: log}, }, observedLog From d77a8742bc4e6b7664f21f944a4da1a738ad8b35 Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Tue, 4 Mar 2025 18:08:35 +0300 Subject: [PATCH 168/197] [#300] pool: Move 'healthCheck' to separate file Signed-off-by: Alexander Chuprov --- pool/healthcheck.go | 47 +++++++++++++++++++++++++++++++++++++++++++++ pool/pool.go | 41 --------------------------------------- 2 files changed, 47 insertions(+), 41 deletions(-) create mode 100644 pool/healthcheck.go diff --git a/pool/healthcheck.go b/pool/healthcheck.go new file mode 100644 index 0000000..2f5dec9 --- /dev/null +++ b/pool/healthcheck.go @@ -0,0 +1,47 @@ +package pool + +import ( + "context" + "time" +) + +type healthCheck struct { + cancel context.CancelFunc + closedCh chan struct{} + + clientRebalanceInterval time.Duration +} + +func newHealthCheck(clientRebalanceInterval time.Duration) *healthCheck { + var h healthCheck + h.clientRebalanceInterval = clientRebalanceInterval + h.closedCh = make(chan struct{}) + return &h +} + +// startRebalance runs loop to monitor connection healthy status. +func (h *healthCheck) startRebalance(ctx context.Context, callback func(ctx context.Context)) { + ctx, cancel := context.WithCancel(ctx) + h.cancel = cancel + + go func() { + ticker := time.NewTicker(h.clientRebalanceInterval) + defer ticker.Stop() + + for { + select { + case <-ctx.Done(): + close(h.closedCh) + return + case <-ticker.C: + callback(ctx) + ticker.Reset(h.clientRebalanceInterval) + } + } + }() +} + +func (h *healthCheck) stopRebalance() { + h.cancel() + <-h.closedCh +} diff --git a/pool/pool.go b/pool/pool.go index 4cf156d..8810c15 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -2026,20 +2026,6 @@ type connectionManager struct { healthChecker *healthCheck } -type healthCheck struct { - cancel context.CancelFunc - closedCh chan struct{} - - clientRebalanceInterval time.Duration -} - -func newHealthCheck(clientRebalanceInterval time.Duration) *healthCheck { - var h healthCheck - h.clientRebalanceInterval = clientRebalanceInterval - h.closedCh = make(chan struct{}) - return &h -} - type innerPool struct { lock sync.RWMutex sampler *sampler @@ -2289,33 +2275,6 @@ func adjustNodeParams(nodeParams []NodeParam) ([]*nodesParam, error) { return nodesParams, nil } -// startRebalance runs loop to monitor connection healthy status. -func (h *healthCheck) startRebalance(ctx context.Context, callback func(ctx context.Context)) { - ctx, cancel := context.WithCancel(ctx) - h.cancel = cancel - - go func() { - ticker := time.NewTicker(h.clientRebalanceInterval) - defer ticker.Stop() - - for { - select { - case <-ctx.Done(): - close(h.closedCh) - return - case <-ticker.C: - callback(ctx) - ticker.Reset(h.clientRebalanceInterval) - } - } - }() -} - -func (h *healthCheck) stopRebalance() { - h.cancel() - <-h.closedCh -} - func (cm *connectionManager) updateNodesHealth(ctx context.Context, buffers [][]float64) { wg := sync.WaitGroup{} for i, inner := range cm.innerPools { From cee7f9de4749aaf99e6a375182e546ae5f384d49 Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Tue, 4 Mar 2025 18:22:14 +0300 Subject: [PATCH 169/197] [#300] pool: Move 'connectionManager' to separate file Signed-off-by: Alexander Chuprov --- pool/connection_manager.go | 332 +++++++++++++++++++++++++++++++++++++ pool/pool.go | 321 ----------------------------------- 2 files changed, 332 insertions(+), 321 deletions(-) create mode 100644 pool/connection_manager.go diff --git a/pool/connection_manager.go b/pool/connection_manager.go new file mode 100644 index 0000000..5b9a08d --- /dev/null +++ b/pool/connection_manager.go @@ -0,0 +1,332 @@ +package pool + +import ( + "context" + "errors" + "fmt" + "math/rand" + "sort" + "sync" + "sync/atomic" + "time" + + apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" +) + +type innerPool struct { + lock sync.RWMutex + sampler *sampler + clients []client +} + +type connectionManager struct { + innerPools []*innerPool + rebalanceParams rebalanceParameters + clientBuilder clientBuilder + logger *zap.Logger + healthChecker *healthCheck +} + +// newConnectionManager returns an instance of connectionManager configured according to the parameters. +// +// Before using connectionManager, you MUST call Dial. +func newConnectionManager(options InitParameters) (*connectionManager, error) { + if options.key == nil { + return nil, fmt.Errorf("missed required parameter 'Key'") + } + + nodesParams, err := adjustNodeParams(options.nodeParams) + if err != nil { + return nil, err + } + + manager := &connectionManager{ + logger: options.logger, + rebalanceParams: rebalanceParameters{ + nodesParams: nodesParams, + nodeRequestTimeout: options.healthcheckTimeout, + clientRebalanceInterval: options.clientRebalanceInterval, + sessionExpirationDuration: options.sessionExpirationDuration, + }, + clientBuilder: options.clientBuilder, + } + + return manager, nil +} + +func (cm *connectionManager) dial(ctx context.Context) error { + inner := make([]*innerPool, len(cm.rebalanceParams.nodesParams)) + var atLeastOneHealthy bool + + for i, params := range cm.rebalanceParams.nodesParams { + clients := make([]client, len(params.weights)) + for j, addr := range params.addresses { + clients[j] = cm.clientBuilder(addr) + if err := clients[j].dial(ctx); err != nil { + cm.log(zap.WarnLevel, "failed to build client", zap.String("address", addr), zap.Error(err)) + continue + } + atLeastOneHealthy = true + } + source := rand.NewSource(time.Now().UnixNano()) + sampl := newSampler(params.weights, source) + + inner[i] = &innerPool{ + sampler: sampl, + clients: clients, + } + } + + if !atLeastOneHealthy { + return fmt.Errorf("at least one node must be healthy") + } + + cm.innerPools = inner + + cm.healthChecker = newHealthCheck(cm.rebalanceParams.clientRebalanceInterval) + cm.healthChecker.startRebalance(ctx, cm.rebalance) + return nil +} + +func (cm *connectionManager) rebalance(ctx context.Context) { + buffers := make([][]float64, len(cm.rebalanceParams.nodesParams)) + for i, params := range cm.rebalanceParams.nodesParams { + buffers[i] = make([]float64, len(params.weights)) + } + + cm.updateNodesHealth(ctx, buffers) +} + +func (cm *connectionManager) log(level zapcore.Level, msg string, fields ...zap.Field) { + if cm.logger == nil { + return + } + + cm.logger.Log(level, msg, fields...) +} + +func adjustNodeParams(nodeParams []NodeParam) ([]*nodesParam, error) { + if len(nodeParams) == 0 { + return nil, errors.New("no FrostFS peers configured") + } + + nodesParamsMap := make(map[int]*nodesParam) + for _, param := range nodeParams { + nodes, ok := nodesParamsMap[param.priority] + if !ok { + nodes = &nodesParam{priority: param.priority} + } + nodes.addresses = append(nodes.addresses, param.address) + nodes.weights = append(nodes.weights, param.weight) + nodesParamsMap[param.priority] = nodes + } + + nodesParams := make([]*nodesParam, 0, len(nodesParamsMap)) + for _, nodes := range nodesParamsMap { + nodes.weights = adjustWeights(nodes.weights) + nodesParams = append(nodesParams, nodes) + } + + sort.Slice(nodesParams, func(i, j int) bool { + return nodesParams[i].priority < nodesParams[j].priority + }) + + return nodesParams, nil +} + +func (cm *connectionManager) updateNodesHealth(ctx context.Context, buffers [][]float64) { + wg := sync.WaitGroup{} + for i, inner := range cm.innerPools { + wg.Add(1) + + bufferWeights := buffers[i] + go func(i int, _ *innerPool) { + defer wg.Done() + cm.updateInnerNodesHealth(ctx, i, bufferWeights) + }(i, inner) + } + wg.Wait() +} + +func (cm *connectionManager) updateInnerNodesHealth(ctx context.Context, i int, bufferWeights []float64) { + if i > len(cm.innerPools)-1 { + return + } + pool := cm.innerPools[i] + options := cm.rebalanceParams + + healthyChanged := new(atomic.Bool) + wg := sync.WaitGroup{} + + for j, cli := range pool.clients { + wg.Add(1) + go func(j int, cli client) { + defer wg.Done() + + tctx, c := context.WithTimeout(ctx, options.nodeRequestTimeout) + defer c() + + changed, err := restartIfUnhealthy(tctx, cli) + healthy := err == nil + if healthy { + bufferWeights[j] = options.nodesParams[i].weights[j] + } else { + bufferWeights[j] = 0 + } + + if changed { + fields := []zap.Field{zap.String("address", cli.address()), zap.Bool("healthy", healthy)} + if err != nil { + fields = append(fields, zap.String("reason", err.Error())) + } + + cm.log(zap.DebugLevel, "health has changed", fields...) + healthyChanged.Store(true) + } + }(j, cli) + } + wg.Wait() + + if healthyChanged.Load() { + probabilities := adjustWeights(bufferWeights) + source := rand.NewSource(time.Now().UnixNano()) + pool.lock.Lock() + pool.sampler = newSampler(probabilities, source) + pool.lock.Unlock() + } +} + +// restartIfUnhealthy checks healthy status of client and recreate it if status is unhealthy. +// Indicating if status was changed by this function call and returns error that caused unhealthy status. +func restartIfUnhealthy(ctx context.Context, c client) (changed bool, err error) { + defer func() { + if err != nil { + c.setUnhealthy() + } else { + c.setHealthy() + } + }() + + wasHealthy := c.isHealthy() + + if res, err := c.healthcheck(ctx); err == nil { + if res.Status().IsMaintenance() { + return wasHealthy, new(apistatus.NodeUnderMaintenance) + } + + return !wasHealthy, nil + } + + if err = c.restart(ctx); err != nil { + return wasHealthy, err + } + + res, err := c.healthcheck(ctx) + if err != nil { + return wasHealthy, err + } + + if res.Status().IsMaintenance() { + return wasHealthy, new(apistatus.NodeUnderMaintenance) + } + + return !wasHealthy, nil +} + +func adjustWeights(weights []float64) []float64 { + adjusted := make([]float64, len(weights)) + sum := 0.0 + for _, weight := range weights { + sum += weight + } + if sum > 0 { + for i, weight := range weights { + adjusted[i] = weight / sum + } + } + + return adjusted +} + +func (cm *connectionManager) connection() (client, error) { + for _, inner := range cm.innerPools { + cp, err := inner.connection() + if err == nil { + return cp, nil + } + } + + return nil, errors.New("no healthy client") +} + +// iterate iterates over all clients in all innerPools. +func (cm *connectionManager) iterate(cb func(client)) { + for _, inner := range cm.innerPools { + for _, cl := range inner.clients { + if cl.isHealthy() { + cb(cl) + } + } + } +} + +func (p *innerPool) connection() (client, error) { + p.lock.RLock() // need lock because of using p.sampler + defer p.lock.RUnlock() + if len(p.clients) == 1 { + cp := p.clients[0] + if cp.isHealthy() { + return cp, nil + } + return nil, errors.New("no healthy client") + } + attempts := 3 * len(p.clients) + for range attempts { + i := p.sampler.Next() + if cp := p.clients[i]; cp.isHealthy() { + return cp, nil + } + } + + return nil, errors.New("no healthy client") +} + +func (cm connectionManager) Statistic() Statistic { + stat := Statistic{} + for _, inner := range cm.innerPools { + nodes := make([]string, 0, len(inner.clients)) + inner.lock.RLock() + for _, cl := range inner.clients { + if cl.isHealthy() { + nodes = append(nodes, cl.address()) + } + node := NodeStatistic{ + address: cl.address(), + methods: cl.methodsStatus(), + overallErrors: cl.overallErrorRate(), + currentErrors: cl.currentErrorRate(), + } + stat.nodes = append(stat.nodes, node) + stat.overallErrors += node.overallErrors + } + inner.lock.RUnlock() + if len(stat.currentNodes) == 0 { + stat.currentNodes = nodes + } + } + + return stat +} + +func (cm *connectionManager) close() { + cm.healthChecker.stopRebalance() + + // close all clients + for _, pools := range cm.innerPools { + for _, cli := range pools.clients { + _ = cli.close() + } + } +} diff --git a/pool/pool.go b/pool/pool.go index 8810c15..bbbebba 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -8,8 +8,6 @@ import ( "fmt" "io" "math" - "math/rand" - "sort" "sync" "sync/atomic" "time" @@ -2015,23 +2013,6 @@ type Pool struct { maxObjectSize uint64 } -type connectionManager struct { - innerPools []*innerPool - - cancel context.CancelFunc - closedCh chan struct{} - rebalanceParams rebalanceParameters - clientBuilder clientBuilder - logger *zap.Logger - healthChecker *healthCheck -} - -type innerPool struct { - lock sync.RWMutex - sampler *sampler - clients []client -} - const ( defaultSessionTokenExpirationDuration = 100 // in epochs defaultErrorThreshold = 100 @@ -2045,33 +2026,6 @@ const ( defaultBufferMaxSizeForPut = 3 * 1024 * 1024 // 3 MB ) -// newConnectionManager returns an instance of connectionManager configured according to the parameters. -// -// Before using connectionManager, you MUST call Dial. -func newConnectionManager(options InitParameters) (*connectionManager, error) { - if options.key == nil { - return nil, fmt.Errorf("missed required parameter 'Key'") - } - - nodesParams, err := adjustNodeParams(options.nodeParams) - if err != nil { - return nil, err - } - - manager := &connectionManager{ - logger: options.logger, - rebalanceParams: rebalanceParameters{ - nodesParams: nodesParams, - nodeRequestTimeout: options.healthcheckTimeout, - clientRebalanceInterval: options.clientRebalanceInterval, - sessionExpirationDuration: options.sessionExpirationDuration, - }, - clientBuilder: options.clientBuilder, - } - - return manager, nil -} - // NewPool returns an instance of Pool configured according to the parameters. // // Before using Pool, you MUST call Dial. @@ -2141,57 +2095,6 @@ func (p *Pool) Dial(ctx context.Context) error { return nil } -func (cm *connectionManager) dial(ctx context.Context) error { - inner := make([]*innerPool, len(cm.rebalanceParams.nodesParams)) - var atLeastOneHealthy bool - - for i, params := range cm.rebalanceParams.nodesParams { - clients := make([]client, len(params.weights)) - for j, addr := range params.addresses { - clients[j] = cm.clientBuilder(addr) - if err := clients[j].dial(ctx); err != nil { - cm.log(zap.WarnLevel, "failed to build client", zap.String("address", addr), zap.Error(err)) - continue - } - atLeastOneHealthy = true - } - source := rand.NewSource(time.Now().UnixNano()) - sampl := newSampler(params.weights, source) - - inner[i] = &innerPool{ - sampler: sampl, - clients: clients, - } - } - - if !atLeastOneHealthy { - return fmt.Errorf("at least one node must be healthy") - } - - cm.innerPools = inner - - cm.healthChecker = newHealthCheck(cm.rebalanceParams.clientRebalanceInterval) - cm.healthChecker.startRebalance(ctx, cm.rebalance) - return nil -} - -func (cm *connectionManager) rebalance(ctx context.Context) { - buffers := make([][]float64, len(cm.rebalanceParams.nodesParams)) - for i, params := range cm.rebalanceParams.nodesParams { - buffers[i] = make([]float64, len(params.weights)) - } - - cm.updateNodesHealth(ctx, buffers) -} - -func (cm *connectionManager) log(level zapcore.Level, msg string, fields ...zap.Field) { - if cm.logger == nil { - return - } - - cm.logger.Log(level, msg, fields...) -} - func fillDefaultInitParams(params *InitParameters, cache *sessionCache) { if params.sessionExpirationDuration == 0 { params.sessionExpirationDuration = defaultSessionTokenExpirationDuration @@ -2246,192 +2149,6 @@ func fillDefaultInitParams(params *InitParameters, cache *sessionCache) { } } -func adjustNodeParams(nodeParams []NodeParam) ([]*nodesParam, error) { - if len(nodeParams) == 0 { - return nil, errors.New("no FrostFS peers configured") - } - - nodesParamsMap := make(map[int]*nodesParam) - for _, param := range nodeParams { - nodes, ok := nodesParamsMap[param.priority] - if !ok { - nodes = &nodesParam{priority: param.priority} - } - nodes.addresses = append(nodes.addresses, param.address) - nodes.weights = append(nodes.weights, param.weight) - nodesParamsMap[param.priority] = nodes - } - - nodesParams := make([]*nodesParam, 0, len(nodesParamsMap)) - for _, nodes := range nodesParamsMap { - nodes.weights = adjustWeights(nodes.weights) - nodesParams = append(nodesParams, nodes) - } - - sort.Slice(nodesParams, func(i, j int) bool { - return nodesParams[i].priority < nodesParams[j].priority - }) - - return nodesParams, nil -} - -func (cm *connectionManager) updateNodesHealth(ctx context.Context, buffers [][]float64) { - wg := sync.WaitGroup{} - for i, inner := range cm.innerPools { - wg.Add(1) - - bufferWeights := buffers[i] - go func(i int, _ *innerPool) { - defer wg.Done() - cm.updateInnerNodesHealth(ctx, i, bufferWeights) - }(i, inner) - } - wg.Wait() -} - -func (cm *connectionManager) updateInnerNodesHealth(ctx context.Context, i int, bufferWeights []float64) { - if i > len(cm.innerPools)-1 { - return - } - pool := cm.innerPools[i] - options := cm.rebalanceParams - - healthyChanged := new(atomic.Bool) - wg := sync.WaitGroup{} - - for j, cli := range pool.clients { - wg.Add(1) - go func(j int, cli client) { - defer wg.Done() - - tctx, c := context.WithTimeout(ctx, options.nodeRequestTimeout) - defer c() - - changed, err := restartIfUnhealthy(tctx, cli) - healthy := err == nil - if healthy { - bufferWeights[j] = options.nodesParams[i].weights[j] - } else { - bufferWeights[j] = 0 - } - - if changed { - fields := []zap.Field{zap.String("address", cli.address()), zap.Bool("healthy", healthy)} - if err != nil { - fields = append(fields, zap.String("reason", err.Error())) - } - - cm.log(zap.DebugLevel, "health has changed", fields...) - healthyChanged.Store(true) - } - }(j, cli) - } - wg.Wait() - - if healthyChanged.Load() { - probabilities := adjustWeights(bufferWeights) - source := rand.NewSource(time.Now().UnixNano()) - pool.lock.Lock() - pool.sampler = newSampler(probabilities, source) - pool.lock.Unlock() - } -} - -// restartIfUnhealthy checks healthy status of client and recreate it if status is unhealthy. -// Indicating if status was changed by this function call and returns error that caused unhealthy status. -func restartIfUnhealthy(ctx context.Context, c client) (changed bool, err error) { - defer func() { - if err != nil { - c.setUnhealthy() - } else { - c.setHealthy() - } - }() - - wasHealthy := c.isHealthy() - - if res, err := c.healthcheck(ctx); err == nil { - if res.Status().IsMaintenance() { - return wasHealthy, new(apistatus.NodeUnderMaintenance) - } - - return !wasHealthy, nil - } - - if err = c.restart(ctx); err != nil { - return wasHealthy, err - } - - res, err := c.healthcheck(ctx) - if err != nil { - return wasHealthy, err - } - - if res.Status().IsMaintenance() { - return wasHealthy, new(apistatus.NodeUnderMaintenance) - } - - return !wasHealthy, nil -} - -func adjustWeights(weights []float64) []float64 { - adjusted := make([]float64, len(weights)) - sum := 0.0 - for _, weight := range weights { - sum += weight - } - if sum > 0 { - for i, weight := range weights { - adjusted[i] = weight / sum - } - } - - return adjusted -} - -func (cm *connectionManager) connection() (client, error) { - for _, inner := range cm.innerPools { - cp, err := inner.connection() - if err == nil { - return cp, nil - } - } - - return nil, errors.New("no healthy client") -} - -// iterate iterates over all clients in all innerPools. -func (cm *connectionManager) iterate(cb func(client)) { - for _, inner := range cm.innerPools { - for _, cl := range inner.clients { - if cl.isHealthy() { - cb(cl) - } - } - } -} - -func (p *innerPool) connection() (client, error) { - p.lock.RLock() // need lock because of using p.sampler - defer p.lock.RUnlock() - if len(p.clients) == 1 { - cp := p.clients[0] - if cp.isHealthy() { - return cp, nil - } - return nil, errors.New("no healthy client") - } - attempts := 3 * len(p.clients) - for range attempts { - i := p.sampler.Next() - if cp := p.clients[i]; cp.isHealthy() { - return cp, nil - } - } - - return nil, errors.New("no healthy client") -} - func formCacheKey(address string, key *ecdsa.PrivateKey, clientCut bool) string { k := keys.PrivateKey{PrivateKey: *key} @@ -3089,33 +2806,6 @@ func (p Pool) Statistic() Statistic { return p.manager.Statistic() } -func (cm connectionManager) Statistic() Statistic { - stat := Statistic{} - for _, inner := range cm.innerPools { - nodes := make([]string, 0, len(inner.clients)) - inner.lock.RLock() - for _, cl := range inner.clients { - if cl.isHealthy() { - nodes = append(nodes, cl.address()) - } - node := NodeStatistic{ - address: cl.address(), - methods: cl.methodsStatus(), - overallErrors: cl.overallErrorRate(), - currentErrors: cl.currentErrorRate(), - } - stat.nodes = append(stat.nodes, node) - stat.overallErrors += node.overallErrors - } - inner.lock.RUnlock() - if len(stat.currentNodes) == 0 { - stat.currentNodes = nodes - } - } - - return stat -} - // waitForContainerPresence waits until the container is found on the FrostFS network. func waitForContainerPresence(ctx context.Context, cli client, prm PrmContainerGet, waitParams *WaitParams) error { return waitFor(ctx, waitParams, func(ctx context.Context) bool { @@ -3194,17 +2884,6 @@ func (p *Pool) Close() { p.manager.close() } -func (cm *connectionManager) close() { - cm.healthChecker.stopRebalance() - - // close all clients - for _, pools := range cm.innerPools { - for _, cli := range pools.clients { - _ = cli.close() - } - } -} - // SyncContainerWithNetwork applies network configuration received via // the Pool to the container. Changes the container if it does not satisfy // network configuration. From 56046935b0874da519cc2009ddb6b927e44dff93 Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Wed, 5 Mar 2025 15:30:15 +0300 Subject: [PATCH 170/197] [#300] pool: Move 'clientWrapper' to separate file Signed-off-by: Alexander Chuprov --- pool/client.go | 1283 ++++++++++++++++++++++++++++++++++++++++++++++++ pool/pool.go | 1260 ----------------------------------------------- 2 files changed, 1283 insertions(+), 1260 deletions(-) create mode 100644 pool/client.go diff --git a/pool/client.go b/pool/client.go new file mode 100644 index 0000000..f1abbf2 --- /dev/null +++ b/pool/client.go @@ -0,0 +1,1283 @@ +package pool + +import ( + "bytes" + "context" + "crypto/ecdsa" + "errors" + "fmt" + "io" + "sync" + "sync/atomic" + "time" + + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/accounting" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ape" + sdkClient "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client" + apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container" + cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" + "google.golang.org/grpc" +) + +// errPoolClientUnhealthy is an error to indicate that client in pool is unhealthy. +var errPoolClientUnhealthy = errors.New("pool client unhealthy") + +// clientStatusMonitor count error rate and other statistics for connection. +type clientStatusMonitor struct { + logger *zap.Logger + addr string + healthy *atomic.Uint32 + errorThreshold uint32 + + mu sync.RWMutex // protect counters + currentErrorCount uint32 + overallErrorCount uint64 + methods []*MethodStatus +} + +// values for healthy status of clientStatusMonitor. +const ( + // statusUnhealthyOnRequest is set when communication after dialing to the + // endpoint is failed due to immediate or accumulated errors, connection is + // available and pool should close it before re-establishing connection once again. + statusUnhealthyOnRequest = iota + + // statusHealthy is set when connection is ready to be used by the pool. + statusHealthy +) + +// MethodIndex index of method in list of statuses in clientStatusMonitor. +type MethodIndex int + +const ( + methodBalanceGet MethodIndex = iota + methodContainerPut + methodContainerGet + methodContainerList + methodContainerListStream + methodContainerDelete + methodEndpointInfo + methodNetworkInfo + methodNetMapSnapshot + methodObjectPut + methodObjectDelete + methodObjectGet + methodObjectHead + methodObjectRange + methodObjectPatch + methodSessionCreate + methodAPEManagerAddChain + methodAPEManagerRemoveChain + methodAPEManagerListChains + methodLast +) + +// String implements fmt.Stringer. +func (m MethodIndex) String() string { + switch m { + case methodBalanceGet: + return "balanceGet" + case methodContainerPut: + return "containerPut" + case methodContainerGet: + return "containerGet" + case methodContainerList: + return "containerList" + case methodContainerDelete: + return "containerDelete" + case methodEndpointInfo: + return "endpointInfo" + case methodNetworkInfo: + return "networkInfo" + case methodNetMapSnapshot: + return "netMapSnapshot" + case methodObjectPut: + return "objectPut" + case methodObjectPatch: + return "objectPatch" + case methodObjectDelete: + return "objectDelete" + case methodObjectGet: + return "objectGet" + case methodObjectHead: + return "objectHead" + case methodObjectRange: + return "objectRange" + case methodSessionCreate: + return "sessionCreate" + case methodAPEManagerAddChain: + return "apeManagerAddChain" + case methodAPEManagerRemoveChain: + return "apeManagerRemoveChain" + case methodAPEManagerListChains: + return "apeManagerListChains" + case methodLast: + return "it's a system name rather than a method" + default: + return "unknown" + } +} + +func newClientStatusMonitor(logger *zap.Logger, addr string, errorThreshold uint32) clientStatusMonitor { + methods := make([]*MethodStatus, methodLast) + for i := methodBalanceGet; i < methodLast; i++ { + methods[i] = &MethodStatus{name: i.String()} + } + + healthy := new(atomic.Uint32) + healthy.Store(statusHealthy) + + return clientStatusMonitor{ + logger: logger, + addr: addr, + healthy: healthy, + errorThreshold: errorThreshold, + methods: methods, + } +} + +// clientWrapper is used by default, alternative implementations are intended for testing purposes only. +type clientWrapper struct { + clientMutex sync.RWMutex + client *sdkClient.Client + dialed bool + prm wrapperPrm + + clientStatusMonitor +} + +// wrapperPrm is params to create clientWrapper. +type wrapperPrm struct { + logger *zap.Logger + address string + key ecdsa.PrivateKey + dialTimeout time.Duration + streamTimeout time.Duration + errorThreshold uint32 + responseInfoCallback func(sdkClient.ResponseMetaInfo) error + poolRequestInfoCallback func(RequestInfo) + dialOptions []grpc.DialOption + + gracefulCloseOnSwitchTimeout time.Duration +} + +// setAddress sets endpoint to connect in FrostFS network. +func (x *wrapperPrm) setAddress(address string) { + x.address = address +} + +// setKey sets sdkClient.Client private key to be used for the protocol communication by default. +func (x *wrapperPrm) setKey(key ecdsa.PrivateKey) { + x.key = key +} + +// setLogger sets sdkClient.Client logger. +func (x *wrapperPrm) setLogger(logger *zap.Logger) { + x.logger = logger +} + +// setDialTimeout sets the timeout for connection to be established. +func (x *wrapperPrm) setDialTimeout(timeout time.Duration) { + x.dialTimeout = timeout +} + +// setStreamTimeout sets the timeout for individual operations in streaming RPC. +func (x *wrapperPrm) setStreamTimeout(timeout time.Duration) { + x.streamTimeout = timeout +} + +// setErrorThreshold sets threshold after reaching which connection is considered unhealthy +// until Pool.startRebalance routing updates its status. +func (x *wrapperPrm) setErrorThreshold(threshold uint32) { + x.errorThreshold = threshold +} + +// setGracefulCloseOnSwitchTimeout specifies the timeout after which unhealthy client be closed during rebalancing +// if it will become healthy back. +// +// See also setErrorThreshold. +func (x *wrapperPrm) setGracefulCloseOnSwitchTimeout(timeout time.Duration) { + x.gracefulCloseOnSwitchTimeout = timeout +} + +// setPoolRequestCallback sets callback that will be invoked after every pool response. +func (x *wrapperPrm) setPoolRequestCallback(f func(RequestInfo)) { + x.poolRequestInfoCallback = f +} + +// setResponseInfoCallback sets callback that will be invoked after every response. +func (x *wrapperPrm) setResponseInfoCallback(f func(sdkClient.ResponseMetaInfo) error) { + x.responseInfoCallback = f +} + +// setGRPCDialOptions sets the gRPC dial options for new gRPC client connection. +func (x *wrapperPrm) setGRPCDialOptions(opts []grpc.DialOption) { + x.dialOptions = opts +} + +// newWrapper creates a clientWrapper that implements the client interface. +func newWrapper(prm wrapperPrm) *clientWrapper { + var cl sdkClient.Client + prmInit := sdkClient.PrmInit{ + Key: prm.key, + ResponseInfoCallback: prm.responseInfoCallback, + } + + cl.Init(prmInit) + + res := &clientWrapper{ + client: &cl, + clientStatusMonitor: newClientStatusMonitor(prm.logger, prm.address, prm.errorThreshold), + prm: prm, + } + + return res +} + +// dial establishes a connection to the server from the FrostFS network. +// Returns an error describing failure reason. If failed, the client +// SHOULD NOT be used. +func (c *clientWrapper) dial(ctx context.Context) error { + cl, err := c.getClient() + if err != nil { + return err + } + + prmDial := sdkClient.PrmDial{ + Endpoint: c.prm.address, + DialTimeout: c.prm.dialTimeout, + StreamTimeout: c.prm.streamTimeout, + GRPCDialOptions: c.prm.dialOptions, + } + + err = cl.Dial(ctx, prmDial) + c.setDialed(err == nil) + if err != nil { + return err + } + + return nil +} + +// restart recreates and redial inner sdk client. +func (c *clientWrapper) restart(ctx context.Context) error { + var cl sdkClient.Client + prmInit := sdkClient.PrmInit{ + Key: c.prm.key, + ResponseInfoCallback: c.prm.responseInfoCallback, + } + + cl.Init(prmInit) + + prmDial := sdkClient.PrmDial{ + Endpoint: c.prm.address, + DialTimeout: c.prm.dialTimeout, + StreamTimeout: c.prm.streamTimeout, + GRPCDialOptions: c.prm.dialOptions, + } + + // if connection is dialed before, to avoid routine / connection leak, + // pool has to close it and then initialize once again. + if c.isDialed() { + c.scheduleGracefulClose() + } + + err := cl.Dial(ctx, prmDial) + c.setDialed(err == nil) + if err != nil { + return err + } + + c.clientMutex.Lock() + c.client = &cl + c.clientMutex.Unlock() + + return nil +} + +func (c *clientWrapper) isDialed() bool { + c.mu.RLock() + defer c.mu.RUnlock() + return c.dialed +} + +func (c *clientWrapper) setDialed(dialed bool) { + c.mu.Lock() + c.dialed = dialed + c.mu.Unlock() +} + +func (c *clientWrapper) getClient() (*sdkClient.Client, error) { + c.clientMutex.RLock() + defer c.clientMutex.RUnlock() + if c.isHealthy() { + return c.client, nil + } + return nil, errPoolClientUnhealthy +} + +func (c *clientWrapper) getClientRaw() *sdkClient.Client { + c.clientMutex.RLock() + defer c.clientMutex.RUnlock() + return c.client +} + +// balanceGet invokes sdkClient.BalanceGet parse response status to error and return result as is. +func (c *clientWrapper) balanceGet(ctx context.Context, prm PrmBalanceGet) (accounting.Decimal, error) { + cl, err := c.getClient() + if err != nil { + return accounting.Decimal{}, err + } + + cliPrm := sdkClient.PrmBalanceGet{ + Account: prm.account, + } + + start := time.Now() + res, err := cl.BalanceGet(ctx, cliPrm) + c.incRequests(time.Since(start), methodBalanceGet) + var st apistatus.Status + if res != nil { + st = res.Status() + } + if err = c.handleError(ctx, st, err); err != nil { + return accounting.Decimal{}, fmt.Errorf("balance get on client: %w", err) + } + + return res.Amount(), nil +} + +// containerPut invokes sdkClient.ContainerPut parse response status to error and return result as is. +// It also waits for the container to appear on the network. +func (c *clientWrapper) containerPut(ctx context.Context, prm PrmContainerPut) (cid.ID, error) { + cl, err := c.getClient() + if err != nil { + return cid.ID{}, err + } + + start := time.Now() + res, err := cl.ContainerPut(ctx, prm.ClientParams) + c.incRequests(time.Since(start), methodContainerPut) + var st apistatus.Status + if res != nil { + st = res.Status() + } + if err = c.handleError(ctx, st, err); err != nil { + return cid.ID{}, fmt.Errorf("container put on client: %w", err) + } + + if prm.WaitParams == nil { + prm.WaitParams = defaultWaitParams() + } + if err = prm.WaitParams.CheckValidity(); err != nil { + return cid.ID{}, fmt.Errorf("invalid wait parameters: %w", err) + } + + idCnr := res.ID() + + getPrm := PrmContainerGet{ + ContainerID: idCnr, + Session: prm.ClientParams.Session, + } + + err = waitForContainerPresence(ctx, c, getPrm, prm.WaitParams) + if err = c.handleError(ctx, nil, err); err != nil { + return cid.ID{}, fmt.Errorf("wait container presence on client: %w", err) + } + + return idCnr, nil +} + +// containerGet invokes sdkClient.ContainerGet parse response status to error and return result as is. +func (c *clientWrapper) containerGet(ctx context.Context, prm PrmContainerGet) (container.Container, error) { + cl, err := c.getClient() + if err != nil { + return container.Container{}, err + } + + cliPrm := sdkClient.PrmContainerGet{ + ContainerID: &prm.ContainerID, + Session: prm.Session, + } + + start := time.Now() + res, err := cl.ContainerGet(ctx, cliPrm) + c.incRequests(time.Since(start), methodContainerGet) + var st apistatus.Status + if res != nil { + st = res.Status() + } + if err = c.handleError(ctx, st, err); err != nil { + return container.Container{}, fmt.Errorf("container get on client: %w", err) + } + + return res.Container(), nil +} + +// containerList invokes sdkClient.ContainerList parse response status to error and return result as is. +func (c *clientWrapper) containerList(ctx context.Context, prm PrmContainerList) ([]cid.ID, error) { + cl, err := c.getClient() + if err != nil { + return nil, err + } + + cliPrm := sdkClient.PrmContainerList{ + OwnerID: prm.OwnerID, + Session: prm.Session, + } + + start := time.Now() + res, err := cl.ContainerList(ctx, cliPrm) + c.incRequests(time.Since(start), methodContainerList) + var st apistatus.Status + if res != nil { + st = res.Status() + } + if err = c.handleError(ctx, st, err); err != nil { + return nil, fmt.Errorf("container list on client: %w", err) + } + return res.Containers(), nil +} + +// PrmListStream groups parameters of ListContainersStream operation. +type PrmListStream struct { + OwnerID user.ID + + Session *session.Container +} + +// ResListStream is designed to read list of object identifiers from FrostFS system. +// +// Must be initialized using Pool.ListContainersStream, any other usage is unsafe. +type ResListStream struct { + r *sdkClient.ContainerListReader + handleError func(context.Context, apistatus.Status, error) error +} + +// Read reads another list of the container identifiers. +func (x *ResListStream) Read(buf []cid.ID) (int, error) { + n, ok := x.r.Read(buf) + if !ok { + res, err := x.r.Close() + if err == nil { + return n, io.EOF + } + + var status apistatus.Status + if res != nil { + status = res.Status() + } + err = x.handleError(nil, status, err) + + return n, err + } + + return n, nil +} + +// Iterate iterates over the list of found container identifiers. +// f can return true to stop iteration earlier. +// +// Returns an error if container can't be read. +func (x *ResListStream) Iterate(f func(cid.ID) bool) error { + return x.r.Iterate(f) +} + +// Close ends reading list of the matched containers and returns the result of the operation +// along with the final results. Must be called after using the ResListStream. +func (x *ResListStream) Close() { + _, _ = x.r.Close() +} + +// containerList invokes sdkClient.ContainerList parse response status to error and return result as is. +func (c *clientWrapper) containerListStream(ctx context.Context, prm PrmListStream) (ResListStream, error) { + cl, err := c.getClient() + if err != nil { + return ResListStream{}, err + } + + cliPrm := sdkClient.PrmContainerListStream{ + OwnerID: prm.OwnerID, + Session: prm.Session, + } + + res, err := cl.ContainerListInit(ctx, cliPrm) + if err = c.handleError(ctx, nil, err); err != nil { + return ResListStream{}, fmt.Errorf("init container listing on client: %w", err) + } + return ResListStream{r: res, handleError: c.handleError}, nil +} + +// containerDelete invokes sdkClient.ContainerDelete parse response status to error. +// It also waits for the container to be removed from the network. +func (c *clientWrapper) containerDelete(ctx context.Context, prm PrmContainerDelete) error { + cl, err := c.getClient() + if err != nil { + return err + } + + cliPrm := sdkClient.PrmContainerDelete{ + ContainerID: &prm.ContainerID, + Session: prm.Session, + } + + start := time.Now() + res, err := cl.ContainerDelete(ctx, cliPrm) + c.incRequests(time.Since(start), methodContainerDelete) + var st apistatus.Status + if res != nil { + st = res.Status() + } + if err = c.handleError(ctx, st, err); err != nil { + return fmt.Errorf("container delete on client: %w", err) + } + + if prm.WaitParams == nil { + prm.WaitParams = defaultWaitParams() + } + if err := prm.WaitParams.CheckValidity(); err != nil { + return fmt.Errorf("invalid wait parameters: %w", err) + } + + getPrm := PrmContainerGet{ + ContainerID: prm.ContainerID, + Session: prm.Session, + } + + return waitForContainerRemoved(ctx, c, getPrm, prm.WaitParams) +} + +// apeManagerAddChain invokes sdkClient.APEManagerAddChain and parse response status to error. +func (c *clientWrapper) apeManagerAddChain(ctx context.Context, prm PrmAddAPEChain) error { + cl, err := c.getClient() + if err != nil { + return err + } + + cliPrm := sdkClient.PrmAPEManagerAddChain{ + ChainTarget: prm.Target, + Chain: prm.Chain, + } + + start := time.Now() + res, err := cl.APEManagerAddChain(ctx, cliPrm) + c.incRequests(time.Since(start), methodAPEManagerAddChain) + var st apistatus.Status + if res != nil { + st = res.Status() + } + if err = c.handleError(ctx, st, err); err != nil { + return fmt.Errorf("add chain error: %w", err) + } + + return nil +} + +// apeManagerRemoveChain invokes sdkClient.APEManagerRemoveChain and parse response status to error. +func (c *clientWrapper) apeManagerRemoveChain(ctx context.Context, prm PrmRemoveAPEChain) error { + cl, err := c.getClient() + if err != nil { + return err + } + + cliPrm := sdkClient.PrmAPEManagerRemoveChain{ + ChainTarget: prm.Target, + ChainID: prm.ChainID, + } + + start := time.Now() + res, err := cl.APEManagerRemoveChain(ctx, cliPrm) + c.incRequests(time.Since(start), methodAPEManagerRemoveChain) + var st apistatus.Status + if res != nil { + st = res.Status() + } + if err = c.handleError(ctx, st, err); err != nil { + return fmt.Errorf("remove chain error: %w", err) + } + + return nil +} + +// apeManagerListChains invokes sdkClient.APEManagerListChains. Returns chains and parsed response status to error. +func (c *clientWrapper) apeManagerListChains(ctx context.Context, prm PrmListAPEChains) ([]ape.Chain, error) { + cl, err := c.getClient() + if err != nil { + return nil, err + } + + cliPrm := sdkClient.PrmAPEManagerListChains{ + ChainTarget: prm.Target, + } + + start := time.Now() + res, err := cl.APEManagerListChains(ctx, cliPrm) + c.incRequests(time.Since(start), methodAPEManagerListChains) + var st apistatus.Status + if res != nil { + st = res.Status() + } + if err = c.handleError(ctx, st, err); err != nil { + return nil, fmt.Errorf("list chains error: %w", err) + } + + return res.Chains, nil +} + +// endpointInfo invokes sdkClient.EndpointInfo parse response status to error and return result as is. +func (c *clientWrapper) endpointInfo(ctx context.Context, _ prmEndpointInfo) (netmap.NodeInfo, error) { + cl, err := c.getClient() + if err != nil { + return netmap.NodeInfo{}, err + } + + return c.endpointInfoRaw(ctx, cl) +} + +func (c *clientWrapper) healthcheck(ctx context.Context) (netmap.NodeInfo, error) { + cl := c.getClientRaw() + return c.endpointInfoRaw(ctx, cl) +} + +func (c *clientWrapper) endpointInfoRaw(ctx context.Context, cl *sdkClient.Client) (netmap.NodeInfo, error) { + start := time.Now() + res, err := cl.EndpointInfo(ctx, sdkClient.PrmEndpointInfo{}) + c.incRequests(time.Since(start), methodEndpointInfo) + var st apistatus.Status + if res != nil { + st = res.Status() + } + if err = c.handleError(ctx, st, err); err != nil { + return netmap.NodeInfo{}, fmt.Errorf("endpoint info on client: %w", err) + } + + return res.NodeInfo(), nil +} + +// networkInfo invokes sdkClient.NetworkInfo parse response status to error and return result as is. +func (c *clientWrapper) networkInfo(ctx context.Context, _ prmNetworkInfo) (netmap.NetworkInfo, error) { + cl, err := c.getClient() + if err != nil { + return netmap.NetworkInfo{}, err + } + + start := time.Now() + res, err := cl.NetworkInfo(ctx, sdkClient.PrmNetworkInfo{}) + c.incRequests(time.Since(start), methodNetworkInfo) + var st apistatus.Status + if res != nil { + st = res.Status() + } + if err = c.handleError(ctx, st, err); err != nil { + return netmap.NetworkInfo{}, fmt.Errorf("network info on client: %w", err) + } + + return res.Info(), nil +} + +// networkInfo invokes sdkClient.NetworkInfo parse response status to error and return result as is. +func (c *clientWrapper) netMapSnapshot(ctx context.Context, _ prmNetMapSnapshot) (netmap.NetMap, error) { + cl, err := c.getClient() + if err != nil { + return netmap.NetMap{}, err + } + + start := time.Now() + res, err := cl.NetMapSnapshot(ctx, sdkClient.PrmNetMapSnapshot{}) + c.incRequests(time.Since(start), methodNetMapSnapshot) + var st apistatus.Status + if res != nil { + st = res.Status() + } + if err = c.handleError(ctx, st, err); err != nil { + return netmap.NetMap{}, fmt.Errorf("network map snapshot on client: %w", err) + } + + return res.NetMap(), nil +} + +// objectPatch patches object in FrostFS. +func (c *clientWrapper) objectPatch(ctx context.Context, prm PrmObjectPatch) (ResPatchObject, error) { + cl, err := c.getClient() + if err != nil { + return ResPatchObject{}, err + } + + start := time.Now() + pObj, err := cl.ObjectPatchInit(ctx, sdkClient.PrmObjectPatch{ + Address: prm.addr, + Session: prm.stoken, + Key: prm.key, + BearerToken: prm.btoken, + MaxChunkLength: prm.maxPayloadPatchChunkLength, + }) + if err = c.handleError(ctx, nil, err); err != nil { + return ResPatchObject{}, fmt.Errorf("init patching on API client: %w", err) + } + c.incRequests(time.Since(start), methodObjectPatch) + + start = time.Now() + attrPatchSuccess := pObj.PatchAttributes(ctx, prm.newAttrs, prm.replaceAttrs) + c.incRequests(time.Since(start), methodObjectPatch) + + if attrPatchSuccess { + start = time.Now() + _ = pObj.PatchPayload(ctx, prm.rng, prm.payload) + c.incRequests(time.Since(start), methodObjectPatch) + } + + res, err := pObj.Close(ctx) + var st apistatus.Status + if res != nil { + st = res.Status() + } + if err = c.handleError(ctx, st, err); err != nil { + return ResPatchObject{}, fmt.Errorf("client failure: %w", err) + } + + return ResPatchObject{ObjectID: res.ObjectID()}, nil +} + +// objectPut writes object to FrostFS. +func (c *clientWrapper) objectPut(ctx context.Context, prm PrmObjectPut) (ResPutObject, error) { + if prm.bufferMaxSize == 0 { + prm.bufferMaxSize = defaultBufferMaxSizeForPut + } + + if prm.clientCut { + return c.objectPutClientCut(ctx, prm) + } + + return c.objectPutServerCut(ctx, prm) +} + +func (c *clientWrapper) objectPutServerCut(ctx context.Context, prm PrmObjectPut) (ResPutObject, error) { + cl, err := c.getClient() + if err != nil { + return ResPutObject{}, err + } + + cliPrm := sdkClient.PrmObjectPutInit{ + CopiesNumber: prm.copiesNumber, + Session: prm.stoken, + Key: prm.key, + BearerToken: prm.btoken, + } + + start := time.Now() + wObj, err := cl.ObjectPutInit(ctx, cliPrm) + c.incRequests(time.Since(start), methodObjectPut) + if err = c.handleError(ctx, nil, err); err != nil { + return ResPutObject{}, fmt.Errorf("init writing on API client: %w", err) + } + + if wObj.WriteHeader(ctx, prm.hdr) { + sz := prm.hdr.PayloadSize() + + if data := prm.hdr.Payload(); len(data) > 0 { + if prm.payload != nil { + prm.payload = io.MultiReader(bytes.NewReader(data), prm.payload) + } else { + prm.payload = bytes.NewReader(data) + sz = uint64(len(data)) + } + } + + if prm.payload != nil { + if sz == 0 || sz > prm.bufferMaxSize { + sz = prm.bufferMaxSize + } + + buf := make([]byte, sz) + + var n int + + for { + n, err = prm.payload.Read(buf) + if n > 0 { + start = time.Now() + successWrite := wObj.WritePayloadChunk(ctx, buf[:n]) + c.incRequests(time.Since(start), methodObjectPut) + if !successWrite { + break + } + + continue + } + + if errors.Is(err, io.EOF) { + break + } + + return ResPutObject{}, fmt.Errorf("read payload: %w", c.handleError(ctx, nil, err)) + } + } + } + + res, err := wObj.Close(ctx) + var st apistatus.Status + if res != nil { + st = res.Status() + } + if err = c.handleError(ctx, st, err); err != nil { // here err already carries both status and client errors + return ResPutObject{}, fmt.Errorf("client failure: %w", err) + } + + return ResPutObject{ + ObjectID: res.StoredObjectID(), + Epoch: res.StoredEpoch(), + }, nil +} + +func (c *clientWrapper) objectPutClientCut(ctx context.Context, prm PrmObjectPut) (ResPutObject, error) { + putInitPrm := PrmObjectPutClientCutInit{ + PrmObjectPut: prm, + } + + start := time.Now() + wObj, err := c.objectPutInitTransformer(putInitPrm) + c.incRequests(time.Since(start), methodObjectPut) + if err = c.handleError(ctx, nil, err); err != nil { + return ResPutObject{}, fmt.Errorf("init writing on API client: %w", err) + } + + if wObj.WriteHeader(ctx, prm.hdr) { + sz := prm.hdr.PayloadSize() + + if data := prm.hdr.Payload(); len(data) > 0 { + if prm.payload != nil { + prm.payload = io.MultiReader(bytes.NewReader(data), prm.payload) + } else { + prm.payload = bytes.NewReader(data) + sz = uint64(len(data)) + } + } + + if prm.payload != nil { + if sz == 0 || sz > prm.bufferMaxSize { + sz = prm.bufferMaxSize + } + + buf := make([]byte, sz) + + var n int + + for { + n, err = prm.payload.Read(buf) + if n > 0 { + start = time.Now() + successWrite := wObj.WritePayloadChunk(ctx, buf[:n]) + c.incRequests(time.Since(start), methodObjectPut) + if !successWrite { + break + } + + continue + } + + if errors.Is(err, io.EOF) { + break + } + + return ResPutObject{}, fmt.Errorf("read payload: %w", c.handleError(ctx, nil, err)) + } + } + } + + res, err := wObj.Close(ctx) + var st apistatus.Status + if res != nil { + st = res.Status + } + if err = c.handleError(ctx, st, err); err != nil { // here err already carries both status and client errors + return ResPutObject{}, fmt.Errorf("client failure: %w", err) + } + + return ResPutObject{ + ObjectID: res.OID, + Epoch: res.Epoch, + }, nil +} + +// objectDelete invokes sdkClient.ObjectDelete parse response status to error. +func (c *clientWrapper) objectDelete(ctx context.Context, prm PrmObjectDelete) error { + cl, err := c.getClient() + if err != nil { + return err + } + + cnr := prm.addr.Container() + obj := prm.addr.Object() + + cliPrm := sdkClient.PrmObjectDelete{ + BearerToken: prm.btoken, + Session: prm.stoken, + ContainerID: &cnr, + ObjectID: &obj, + Key: prm.key, + } + + start := time.Now() + res, err := cl.ObjectDelete(ctx, cliPrm) + c.incRequests(time.Since(start), methodObjectDelete) + var st apistatus.Status + if res != nil { + st = res.Status() + } + if err = c.handleError(ctx, st, err); err != nil { + return fmt.Errorf("delete object on client: %w", err) + } + return nil +} + +// objectGet returns reader for object. +func (c *clientWrapper) objectGet(ctx context.Context, prm PrmObjectGet) (ResGetObject, error) { + cl, err := c.getClient() + if err != nil { + return ResGetObject{}, err + } + + prmCnr := prm.addr.Container() + prmObj := prm.addr.Object() + + cliPrm := sdkClient.PrmObjectGet{ + BearerToken: prm.btoken, + Session: prm.stoken, + ContainerID: &prmCnr, + ObjectID: &prmObj, + Key: prm.key, + } + + var res ResGetObject + + rObj, err := cl.ObjectGetInit(ctx, cliPrm) + if err = c.handleError(ctx, nil, err); err != nil { + return ResGetObject{}, fmt.Errorf("init object reading on client: %w", err) + } + + start := time.Now() + successReadHeader := rObj.ReadHeader(&res.Header) + c.incRequests(time.Since(start), methodObjectGet) + if !successReadHeader { + rObjRes, err := rObj.Close() + var st apistatus.Status + if rObjRes != nil { + st = rObjRes.Status() + } + err = c.handleError(ctx, st, err) + return res, fmt.Errorf("read header: %w", err) + } + + res.Payload = &objectReadCloser{ + reader: rObj, + elapsedTimeCallback: func(elapsed time.Duration) { + c.incRequests(elapsed, methodObjectGet) + }, + } + + return res, nil +} + +// objectHead invokes sdkClient.ObjectHead parse response status to error and return result as is. +func (c *clientWrapper) objectHead(ctx context.Context, prm PrmObjectHead) (object.Object, error) { + cl, err := c.getClient() + if err != nil { + return object.Object{}, err + } + + prmCnr := prm.addr.Container() + prmObj := prm.addr.Object() + + cliPrm := sdkClient.PrmObjectHead{ + BearerToken: prm.btoken, + Session: prm.stoken, + Raw: prm.raw, + ContainerID: &prmCnr, + ObjectID: &prmObj, + Key: prm.key, + } + + var obj object.Object + + start := time.Now() + res, err := cl.ObjectHead(ctx, cliPrm) + c.incRequests(time.Since(start), methodObjectHead) + var st apistatus.Status + if res != nil { + st = res.Status() + } + if err = c.handleError(ctx, st, err); err != nil { + return obj, fmt.Errorf("read object header via client: %w", err) + } + if !res.ReadHeader(&obj) { + return obj, errors.New("missing object header in response") + } + + return obj, nil +} + +// objectRange returns object range reader. +func (c *clientWrapper) objectRange(ctx context.Context, prm PrmObjectRange) (ResObjectRange, error) { + cl, err := c.getClient() + if err != nil { + return ResObjectRange{}, err + } + + prmCnr := prm.addr.Container() + prmObj := prm.addr.Object() + + cliPrm := sdkClient.PrmObjectRange{ + BearerToken: prm.btoken, + Session: prm.stoken, + ContainerID: &prmCnr, + ObjectID: &prmObj, + Offset: prm.off, + Length: prm.ln, + Key: prm.key, + } + + start := time.Now() + res, err := cl.ObjectRangeInit(ctx, cliPrm) + c.incRequests(time.Since(start), methodObjectRange) + if err = c.handleError(ctx, nil, err); err != nil { + return ResObjectRange{}, fmt.Errorf("init payload range reading on client: %w", err) + } + + return ResObjectRange{ + payload: res, + elapsedTimeCallback: func(elapsed time.Duration) { + c.incRequests(elapsed, methodObjectRange) + }, + }, nil +} + +// objectSearch invokes sdkClient.ObjectSearchInit parse response status to error and return result as is. +func (c *clientWrapper) objectSearch(ctx context.Context, prm PrmObjectSearch) (ResObjectSearch, error) { + cl, err := c.getClient() + if err != nil { + return ResObjectSearch{}, err + } + + cliPrm := sdkClient.PrmObjectSearch{ + ContainerID: &prm.cnrID, + Filters: prm.filters, + Session: prm.stoken, + BearerToken: prm.btoken, + Key: prm.key, + } + + res, err := cl.ObjectSearchInit(ctx, cliPrm) + if err = c.handleError(ctx, nil, err); err != nil { + return ResObjectSearch{}, fmt.Errorf("init object searching on client: %w", err) + } + + return ResObjectSearch{r: res, handleError: c.handleError}, nil +} + +// sessionCreate invokes sdkClient.SessionCreate parse response status to error and return result as is. +func (c *clientWrapper) sessionCreate(ctx context.Context, prm prmCreateSession) (resCreateSession, error) { + cl, err := c.getClient() + if err != nil { + return resCreateSession{}, err + } + + cliPrm := sdkClient.PrmSessionCreate{ + Expiration: prm.exp, + Key: &prm.key, + } + + start := time.Now() + res, err := cl.SessionCreate(ctx, cliPrm) + c.incRequests(time.Since(start), methodSessionCreate) + var st apistatus.Status + if res != nil { + st = res.Status() + } + if err = c.handleError(ctx, st, err); err != nil { + return resCreateSession{}, fmt.Errorf("session creation on client: %w", err) + } + + return resCreateSession{ + id: res.ID(), + sessionKey: res.PublicKey(), + }, nil +} + +func (c *clientStatusMonitor) isHealthy() bool { + return c.healthy.Load() == statusHealthy +} + +func (c *clientStatusMonitor) setHealthy() { + c.healthy.Store(statusHealthy) +} + +func (c *clientStatusMonitor) setUnhealthy() { + c.healthy.Store(statusUnhealthyOnRequest) +} + +func (c *clientStatusMonitor) address() string { + return c.addr +} + +func (c *clientStatusMonitor) incErrorRate() { + c.mu.Lock() + c.currentErrorCount++ + c.overallErrorCount++ + + thresholdReached := c.currentErrorCount >= c.errorThreshold + if thresholdReached { + c.setUnhealthy() + c.currentErrorCount = 0 + } + c.mu.Unlock() + + if thresholdReached { + c.log(zapcore.WarnLevel, "error threshold reached", + zap.String("address", c.addr), zap.Uint32("threshold", c.errorThreshold)) + } +} + +func (c *clientStatusMonitor) incErrorRateToUnhealthy(err error) { + c.mu.Lock() + c.currentErrorCount = 0 + c.overallErrorCount++ + c.setUnhealthy() + c.mu.Unlock() + + c.log(zapcore.WarnLevel, "explicitly mark node unhealthy", zap.String("address", c.addr), zap.Error(err)) +} + +func (c *clientStatusMonitor) log(level zapcore.Level, msg string, fields ...zap.Field) { + if c.logger == nil { + return + } + + c.logger.Log(level, msg, fields...) +} + +func (c *clientStatusMonitor) currentErrorRate() uint32 { + c.mu.RLock() + defer c.mu.RUnlock() + return c.currentErrorCount +} + +func (c *clientStatusMonitor) overallErrorRate() uint64 { + c.mu.RLock() + defer c.mu.RUnlock() + return c.overallErrorCount +} + +func (c *clientStatusMonitor) methodsStatus() []StatusSnapshot { + result := make([]StatusSnapshot, len(c.methods)) + for i, val := range c.methods { + result[i] = val.Snapshot() + } + + return result +} + +func (c *clientWrapper) incRequests(elapsed time.Duration, method MethodIndex) { + methodStat := c.methods[method] + methodStat.IncRequests(elapsed) + if c.prm.poolRequestInfoCallback != nil { + c.prm.poolRequestInfoCallback(RequestInfo{ + Address: c.prm.address, + Method: method, + Elapsed: elapsed, + }) + } +} + +func (c *clientWrapper) close() error { + if !c.isDialed() { + return nil + } + if cl := c.getClientRaw(); cl != nil { + return cl.Close() + } + return nil +} + +func (c *clientWrapper) scheduleGracefulClose() { + cl := c.getClientRaw() + if cl == nil { + return + } + + time.AfterFunc(c.prm.gracefulCloseOnSwitchTimeout, func() { + if err := cl.Close(); err != nil { + c.log(zap.DebugLevel, "close unhealthy client during rebalance", zap.String("address", c.address()), zap.Error(err)) + } + }) +} + +func (c *clientStatusMonitor) handleError(ctx context.Context, st apistatus.Status, err error) error { + if stErr := apistatus.ErrFromStatus(st); stErr != nil { + switch stErr.(type) { + case *apistatus.ServerInternal, + *apistatus.WrongMagicNumber, + *apistatus.SignatureVerification: + c.incErrorRate() + case *apistatus.NodeUnderMaintenance: + c.incErrorRateToUnhealthy(stErr) + } + + if err == nil { + err = stErr + } + + return err + } + + if err != nil { + if needCountError(ctx, err) { + if sdkClient.IsErrNodeUnderMaintenance(err) { + c.incErrorRateToUnhealthy(err) + } else { + c.incErrorRate() + } + } + + return err + } + + return nil +} + +func needCountError(ctx context.Context, err error) bool { + // non-status logic error that could be returned + // from the SDK client; should not be considered + // as a connection error + var siErr *object.SplitInfoError + if errors.As(err, &siErr) { + return false + } + var eiErr *object.ECInfoError + if errors.As(err, &eiErr) { + return false + } + + if ctx != nil && errors.Is(ctx.Err(), context.Canceled) { + return false + } + + return true +} + +// clientBuilder is a type alias of client constructors which open connection +// to the given endpoint. +type clientBuilder = func(endpoint string) client + +// RequestInfo groups info about pool request. +type RequestInfo struct { + Address string + Method MethodIndex + Elapsed time.Duration +} diff --git a/pool/pool.go b/pool/pool.go index bbbebba..869ff2c 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -1,15 +1,12 @@ package pool import ( - "bytes" "context" "crypto/ecdsa" "errors" "fmt" "io" "math" - "sync" - "sync/atomic" "time" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/accounting" @@ -29,7 +26,6 @@ import ( "github.com/google/uuid" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "go.uber.org/zap" - "go.uber.org/zap/zapcore" "google.golang.org/grpc" ) @@ -110,1262 +106,6 @@ type clientStatus interface { methodsStatus() []StatusSnapshot } -// errPoolClientUnhealthy is an error to indicate that client in pool is unhealthy. -var errPoolClientUnhealthy = errors.New("pool client unhealthy") - -// clientStatusMonitor count error rate and other statistics for connection. -type clientStatusMonitor struct { - logger *zap.Logger - addr string - healthy *atomic.Uint32 - errorThreshold uint32 - - mu sync.RWMutex // protect counters - currentErrorCount uint32 - overallErrorCount uint64 - methods []*MethodStatus -} - -// values for healthy status of clientStatusMonitor. -const ( - // statusUnhealthyOnRequest is set when communication after dialing to the - // endpoint is failed due to immediate or accumulated errors, connection is - // available and pool should close it before re-establishing connection once again. - statusUnhealthyOnRequest = iota - - // statusHealthy is set when connection is ready to be used by the pool. - statusHealthy -) - -// MethodIndex index of method in list of statuses in clientStatusMonitor. -type MethodIndex int - -const ( - methodBalanceGet MethodIndex = iota - methodContainerPut - methodContainerGet - methodContainerList - methodContainerListStream - methodContainerDelete - methodEndpointInfo - methodNetworkInfo - methodNetMapSnapshot - methodObjectPut - methodObjectDelete - methodObjectGet - methodObjectHead - methodObjectRange - methodObjectPatch - methodSessionCreate - methodAPEManagerAddChain - methodAPEManagerRemoveChain - methodAPEManagerListChains - methodLast -) - -// String implements fmt.Stringer. -func (m MethodIndex) String() string { - switch m { - case methodBalanceGet: - return "balanceGet" - case methodContainerPut: - return "containerPut" - case methodContainerGet: - return "containerGet" - case methodContainerList: - return "containerList" - case methodContainerDelete: - return "containerDelete" - case methodEndpointInfo: - return "endpointInfo" - case methodNetworkInfo: - return "networkInfo" - case methodNetMapSnapshot: - return "netMapSnapshot" - case methodObjectPut: - return "objectPut" - case methodObjectPatch: - return "objectPatch" - case methodObjectDelete: - return "objectDelete" - case methodObjectGet: - return "objectGet" - case methodObjectHead: - return "objectHead" - case methodObjectRange: - return "objectRange" - case methodSessionCreate: - return "sessionCreate" - case methodAPEManagerAddChain: - return "apeManagerAddChain" - case methodAPEManagerRemoveChain: - return "apeManagerRemoveChain" - case methodAPEManagerListChains: - return "apeManagerListChains" - case methodLast: - return "it's a system name rather than a method" - default: - return "unknown" - } -} - -func newClientStatusMonitor(logger *zap.Logger, addr string, errorThreshold uint32) clientStatusMonitor { - methods := make([]*MethodStatus, methodLast) - for i := methodBalanceGet; i < methodLast; i++ { - methods[i] = &MethodStatus{name: i.String()} - } - - healthy := new(atomic.Uint32) - healthy.Store(statusHealthy) - - return clientStatusMonitor{ - logger: logger, - addr: addr, - healthy: healthy, - errorThreshold: errorThreshold, - methods: methods, - } -} - -// clientWrapper is used by default, alternative implementations are intended for testing purposes only. -type clientWrapper struct { - clientMutex sync.RWMutex - client *sdkClient.Client - dialed bool - prm wrapperPrm - - clientStatusMonitor -} - -// wrapperPrm is params to create clientWrapper. -type wrapperPrm struct { - logger *zap.Logger - address string - key ecdsa.PrivateKey - dialTimeout time.Duration - streamTimeout time.Duration - errorThreshold uint32 - responseInfoCallback func(sdkClient.ResponseMetaInfo) error - poolRequestInfoCallback func(RequestInfo) - dialOptions []grpc.DialOption - - gracefulCloseOnSwitchTimeout time.Duration -} - -// setAddress sets endpoint to connect in FrostFS network. -func (x *wrapperPrm) setAddress(address string) { - x.address = address -} - -// setKey sets sdkClient.Client private key to be used for the protocol communication by default. -func (x *wrapperPrm) setKey(key ecdsa.PrivateKey) { - x.key = key -} - -// setLogger sets sdkClient.Client logger. -func (x *wrapperPrm) setLogger(logger *zap.Logger) { - x.logger = logger -} - -// setDialTimeout sets the timeout for connection to be established. -func (x *wrapperPrm) setDialTimeout(timeout time.Duration) { - x.dialTimeout = timeout -} - -// setStreamTimeout sets the timeout for individual operations in streaming RPC. -func (x *wrapperPrm) setStreamTimeout(timeout time.Duration) { - x.streamTimeout = timeout -} - -// setErrorThreshold sets threshold after reaching which connection is considered unhealthy -// until Pool.startRebalance routing updates its status. -func (x *wrapperPrm) setErrorThreshold(threshold uint32) { - x.errorThreshold = threshold -} - -// setGracefulCloseOnSwitchTimeout specifies the timeout after which unhealthy client be closed during rebalancing -// if it will become healthy back. -// -// See also setErrorThreshold. -func (x *wrapperPrm) setGracefulCloseOnSwitchTimeout(timeout time.Duration) { - x.gracefulCloseOnSwitchTimeout = timeout -} - -// setPoolRequestCallback sets callback that will be invoked after every pool response. -func (x *wrapperPrm) setPoolRequestCallback(f func(RequestInfo)) { - x.poolRequestInfoCallback = f -} - -// setResponseInfoCallback sets callback that will be invoked after every response. -func (x *wrapperPrm) setResponseInfoCallback(f func(sdkClient.ResponseMetaInfo) error) { - x.responseInfoCallback = f -} - -// setGRPCDialOptions sets the gRPC dial options for new gRPC client connection. -func (x *wrapperPrm) setGRPCDialOptions(opts []grpc.DialOption) { - x.dialOptions = opts -} - -// newWrapper creates a clientWrapper that implements the client interface. -func newWrapper(prm wrapperPrm) *clientWrapper { - var cl sdkClient.Client - prmInit := sdkClient.PrmInit{ - Key: prm.key, - ResponseInfoCallback: prm.responseInfoCallback, - } - - cl.Init(prmInit) - - res := &clientWrapper{ - client: &cl, - clientStatusMonitor: newClientStatusMonitor(prm.logger, prm.address, prm.errorThreshold), - prm: prm, - } - - return res -} - -// dial establishes a connection to the server from the FrostFS network. -// Returns an error describing failure reason. If failed, the client -// SHOULD NOT be used. -func (c *clientWrapper) dial(ctx context.Context) error { - cl, err := c.getClient() - if err != nil { - return err - } - - prmDial := sdkClient.PrmDial{ - Endpoint: c.prm.address, - DialTimeout: c.prm.dialTimeout, - StreamTimeout: c.prm.streamTimeout, - GRPCDialOptions: c.prm.dialOptions, - } - - err = cl.Dial(ctx, prmDial) - c.setDialed(err == nil) - if err != nil { - return err - } - - return nil -} - -// restart recreates and redial inner sdk client. -func (c *clientWrapper) restart(ctx context.Context) error { - var cl sdkClient.Client - prmInit := sdkClient.PrmInit{ - Key: c.prm.key, - ResponseInfoCallback: c.prm.responseInfoCallback, - } - - cl.Init(prmInit) - - prmDial := sdkClient.PrmDial{ - Endpoint: c.prm.address, - DialTimeout: c.prm.dialTimeout, - StreamTimeout: c.prm.streamTimeout, - GRPCDialOptions: c.prm.dialOptions, - } - - // if connection is dialed before, to avoid routine / connection leak, - // pool has to close it and then initialize once again. - if c.isDialed() { - c.scheduleGracefulClose() - } - - err := cl.Dial(ctx, prmDial) - c.setDialed(err == nil) - if err != nil { - return err - } - - c.clientMutex.Lock() - c.client = &cl - c.clientMutex.Unlock() - - return nil -} - -func (c *clientWrapper) isDialed() bool { - c.mu.RLock() - defer c.mu.RUnlock() - return c.dialed -} - -func (c *clientWrapper) setDialed(dialed bool) { - c.mu.Lock() - c.dialed = dialed - c.mu.Unlock() -} - -func (c *clientWrapper) getClient() (*sdkClient.Client, error) { - c.clientMutex.RLock() - defer c.clientMutex.RUnlock() - if c.isHealthy() { - return c.client, nil - } - return nil, errPoolClientUnhealthy -} - -func (c *clientWrapper) getClientRaw() *sdkClient.Client { - c.clientMutex.RLock() - defer c.clientMutex.RUnlock() - return c.client -} - -// balanceGet invokes sdkClient.BalanceGet parse response status to error and return result as is. -func (c *clientWrapper) balanceGet(ctx context.Context, prm PrmBalanceGet) (accounting.Decimal, error) { - cl, err := c.getClient() - if err != nil { - return accounting.Decimal{}, err - } - - cliPrm := sdkClient.PrmBalanceGet{ - Account: prm.account, - } - - start := time.Now() - res, err := cl.BalanceGet(ctx, cliPrm) - c.incRequests(time.Since(start), methodBalanceGet) - var st apistatus.Status - if res != nil { - st = res.Status() - } - if err = c.handleError(ctx, st, err); err != nil { - return accounting.Decimal{}, fmt.Errorf("balance get on client: %w", err) - } - - return res.Amount(), nil -} - -// containerPut invokes sdkClient.ContainerPut parse response status to error and return result as is. -// It also waits for the container to appear on the network. -func (c *clientWrapper) containerPut(ctx context.Context, prm PrmContainerPut) (cid.ID, error) { - cl, err := c.getClient() - if err != nil { - return cid.ID{}, err - } - - start := time.Now() - res, err := cl.ContainerPut(ctx, prm.ClientParams) - c.incRequests(time.Since(start), methodContainerPut) - var st apistatus.Status - if res != nil { - st = res.Status() - } - if err = c.handleError(ctx, st, err); err != nil { - return cid.ID{}, fmt.Errorf("container put on client: %w", err) - } - - if prm.WaitParams == nil { - prm.WaitParams = defaultWaitParams() - } - if err = prm.WaitParams.CheckValidity(); err != nil { - return cid.ID{}, fmt.Errorf("invalid wait parameters: %w", err) - } - - idCnr := res.ID() - - getPrm := PrmContainerGet{ - ContainerID: idCnr, - Session: prm.ClientParams.Session, - } - - err = waitForContainerPresence(ctx, c, getPrm, prm.WaitParams) - if err = c.handleError(ctx, nil, err); err != nil { - return cid.ID{}, fmt.Errorf("wait container presence on client: %w", err) - } - - return idCnr, nil -} - -// containerGet invokes sdkClient.ContainerGet parse response status to error and return result as is. -func (c *clientWrapper) containerGet(ctx context.Context, prm PrmContainerGet) (container.Container, error) { - cl, err := c.getClient() - if err != nil { - return container.Container{}, err - } - - cliPrm := sdkClient.PrmContainerGet{ - ContainerID: &prm.ContainerID, - Session: prm.Session, - } - - start := time.Now() - res, err := cl.ContainerGet(ctx, cliPrm) - c.incRequests(time.Since(start), methodContainerGet) - var st apistatus.Status - if res != nil { - st = res.Status() - } - if err = c.handleError(ctx, st, err); err != nil { - return container.Container{}, fmt.Errorf("container get on client: %w", err) - } - - return res.Container(), nil -} - -// containerList invokes sdkClient.ContainerList parse response status to error and return result as is. -func (c *clientWrapper) containerList(ctx context.Context, prm PrmContainerList) ([]cid.ID, error) { - cl, err := c.getClient() - if err != nil { - return nil, err - } - - cliPrm := sdkClient.PrmContainerList{ - OwnerID: prm.OwnerID, - Session: prm.Session, - } - - start := time.Now() - res, err := cl.ContainerList(ctx, cliPrm) - c.incRequests(time.Since(start), methodContainerList) - var st apistatus.Status - if res != nil { - st = res.Status() - } - if err = c.handleError(ctx, st, err); err != nil { - return nil, fmt.Errorf("container list on client: %w", err) - } - return res.Containers(), nil -} - -// PrmListStream groups parameters of ListContainersStream operation. -type PrmListStream struct { - OwnerID user.ID - - Session *session.Container -} - -// ResListStream is designed to read list of object identifiers from FrostFS system. -// -// Must be initialized using Pool.ListContainersStream, any other usage is unsafe. -type ResListStream struct { - r *sdkClient.ContainerListReader - handleError func(context.Context, apistatus.Status, error) error -} - -// Read reads another list of the container identifiers. -func (x *ResListStream) Read(buf []cid.ID) (int, error) { - n, ok := x.r.Read(buf) - if !ok { - res, err := x.r.Close() - if err == nil { - return n, io.EOF - } - - var status apistatus.Status - if res != nil { - status = res.Status() - } - err = x.handleError(nil, status, err) - - return n, err - } - - return n, nil -} - -// Iterate iterates over the list of found container identifiers. -// f can return true to stop iteration earlier. -// -// Returns an error if container can't be read. -func (x *ResListStream) Iterate(f func(cid.ID) bool) error { - return x.r.Iterate(f) -} - -// Close ends reading list of the matched containers and returns the result of the operation -// along with the final results. Must be called after using the ResListStream. -func (x *ResListStream) Close() { - _, _ = x.r.Close() -} - -// containerList invokes sdkClient.ContainerList parse response status to error and return result as is. -func (c *clientWrapper) containerListStream(ctx context.Context, prm PrmListStream) (ResListStream, error) { - cl, err := c.getClient() - if err != nil { - return ResListStream{}, err - } - - cliPrm := sdkClient.PrmContainerListStream{ - OwnerID: prm.OwnerID, - Session: prm.Session, - } - - res, err := cl.ContainerListInit(ctx, cliPrm) - if err = c.handleError(ctx, nil, err); err != nil { - return ResListStream{}, fmt.Errorf("init container listing on client: %w", err) - } - return ResListStream{r: res, handleError: c.handleError}, nil -} - -// containerDelete invokes sdkClient.ContainerDelete parse response status to error. -// It also waits for the container to be removed from the network. -func (c *clientWrapper) containerDelete(ctx context.Context, prm PrmContainerDelete) error { - cl, err := c.getClient() - if err != nil { - return err - } - - cliPrm := sdkClient.PrmContainerDelete{ - ContainerID: &prm.ContainerID, - Session: prm.Session, - } - - start := time.Now() - res, err := cl.ContainerDelete(ctx, cliPrm) - c.incRequests(time.Since(start), methodContainerDelete) - var st apistatus.Status - if res != nil { - st = res.Status() - } - if err = c.handleError(ctx, st, err); err != nil { - return fmt.Errorf("container delete on client: %w", err) - } - - if prm.WaitParams == nil { - prm.WaitParams = defaultWaitParams() - } - if err := prm.WaitParams.CheckValidity(); err != nil { - return fmt.Errorf("invalid wait parameters: %w", err) - } - - getPrm := PrmContainerGet{ - ContainerID: prm.ContainerID, - Session: prm.Session, - } - - return waitForContainerRemoved(ctx, c, getPrm, prm.WaitParams) -} - -// apeManagerAddChain invokes sdkClient.APEManagerAddChain and parse response status to error. -func (c *clientWrapper) apeManagerAddChain(ctx context.Context, prm PrmAddAPEChain) error { - cl, err := c.getClient() - if err != nil { - return err - } - - cliPrm := sdkClient.PrmAPEManagerAddChain{ - ChainTarget: prm.Target, - Chain: prm.Chain, - } - - start := time.Now() - res, err := cl.APEManagerAddChain(ctx, cliPrm) - c.incRequests(time.Since(start), methodAPEManagerAddChain) - var st apistatus.Status - if res != nil { - st = res.Status() - } - if err = c.handleError(ctx, st, err); err != nil { - return fmt.Errorf("add chain error: %w", err) - } - - return nil -} - -// apeManagerRemoveChain invokes sdkClient.APEManagerRemoveChain and parse response status to error. -func (c *clientWrapper) apeManagerRemoveChain(ctx context.Context, prm PrmRemoveAPEChain) error { - cl, err := c.getClient() - if err != nil { - return err - } - - cliPrm := sdkClient.PrmAPEManagerRemoveChain{ - ChainTarget: prm.Target, - ChainID: prm.ChainID, - } - - start := time.Now() - res, err := cl.APEManagerRemoveChain(ctx, cliPrm) - c.incRequests(time.Since(start), methodAPEManagerRemoveChain) - var st apistatus.Status - if res != nil { - st = res.Status() - } - if err = c.handleError(ctx, st, err); err != nil { - return fmt.Errorf("remove chain error: %w", err) - } - - return nil -} - -// apeManagerListChains invokes sdkClient.APEManagerListChains. Returns chains and parsed response status to error. -func (c *clientWrapper) apeManagerListChains(ctx context.Context, prm PrmListAPEChains) ([]ape.Chain, error) { - cl, err := c.getClient() - if err != nil { - return nil, err - } - - cliPrm := sdkClient.PrmAPEManagerListChains{ - ChainTarget: prm.Target, - } - - start := time.Now() - res, err := cl.APEManagerListChains(ctx, cliPrm) - c.incRequests(time.Since(start), methodAPEManagerListChains) - var st apistatus.Status - if res != nil { - st = res.Status() - } - if err = c.handleError(ctx, st, err); err != nil { - return nil, fmt.Errorf("list chains error: %w", err) - } - - return res.Chains, nil -} - -// endpointInfo invokes sdkClient.EndpointInfo parse response status to error and return result as is. -func (c *clientWrapper) endpointInfo(ctx context.Context, _ prmEndpointInfo) (netmap.NodeInfo, error) { - cl, err := c.getClient() - if err != nil { - return netmap.NodeInfo{}, err - } - - return c.endpointInfoRaw(ctx, cl) -} - -func (c *clientWrapper) healthcheck(ctx context.Context) (netmap.NodeInfo, error) { - cl := c.getClientRaw() - return c.endpointInfoRaw(ctx, cl) -} - -func (c *clientWrapper) endpointInfoRaw(ctx context.Context, cl *sdkClient.Client) (netmap.NodeInfo, error) { - start := time.Now() - res, err := cl.EndpointInfo(ctx, sdkClient.PrmEndpointInfo{}) - c.incRequests(time.Since(start), methodEndpointInfo) - var st apistatus.Status - if res != nil { - st = res.Status() - } - if err = c.handleError(ctx, st, err); err != nil { - return netmap.NodeInfo{}, fmt.Errorf("endpoint info on client: %w", err) - } - - return res.NodeInfo(), nil -} - -// networkInfo invokes sdkClient.NetworkInfo parse response status to error and return result as is. -func (c *clientWrapper) networkInfo(ctx context.Context, _ prmNetworkInfo) (netmap.NetworkInfo, error) { - cl, err := c.getClient() - if err != nil { - return netmap.NetworkInfo{}, err - } - - start := time.Now() - res, err := cl.NetworkInfo(ctx, sdkClient.PrmNetworkInfo{}) - c.incRequests(time.Since(start), methodNetworkInfo) - var st apistatus.Status - if res != nil { - st = res.Status() - } - if err = c.handleError(ctx, st, err); err != nil { - return netmap.NetworkInfo{}, fmt.Errorf("network info on client: %w", err) - } - - return res.Info(), nil -} - -// networkInfo invokes sdkClient.NetworkInfo parse response status to error and return result as is. -func (c *clientWrapper) netMapSnapshot(ctx context.Context, _ prmNetMapSnapshot) (netmap.NetMap, error) { - cl, err := c.getClient() - if err != nil { - return netmap.NetMap{}, err - } - - start := time.Now() - res, err := cl.NetMapSnapshot(ctx, sdkClient.PrmNetMapSnapshot{}) - c.incRequests(time.Since(start), methodNetMapSnapshot) - var st apistatus.Status - if res != nil { - st = res.Status() - } - if err = c.handleError(ctx, st, err); err != nil { - return netmap.NetMap{}, fmt.Errorf("network map snapshot on client: %w", err) - } - - return res.NetMap(), nil -} - -// objectPatch patches object in FrostFS. -func (c *clientWrapper) objectPatch(ctx context.Context, prm PrmObjectPatch) (ResPatchObject, error) { - cl, err := c.getClient() - if err != nil { - return ResPatchObject{}, err - } - - start := time.Now() - pObj, err := cl.ObjectPatchInit(ctx, sdkClient.PrmObjectPatch{ - Address: prm.addr, - Session: prm.stoken, - Key: prm.key, - BearerToken: prm.btoken, - MaxChunkLength: prm.maxPayloadPatchChunkLength, - }) - if err = c.handleError(ctx, nil, err); err != nil { - return ResPatchObject{}, fmt.Errorf("init patching on API client: %w", err) - } - c.incRequests(time.Since(start), methodObjectPatch) - - start = time.Now() - attrPatchSuccess := pObj.PatchAttributes(ctx, prm.newAttrs, prm.replaceAttrs) - c.incRequests(time.Since(start), methodObjectPatch) - - if attrPatchSuccess { - start = time.Now() - _ = pObj.PatchPayload(ctx, prm.rng, prm.payload) - c.incRequests(time.Since(start), methodObjectPatch) - } - - res, err := pObj.Close(ctx) - var st apistatus.Status - if res != nil { - st = res.Status() - } - if err = c.handleError(ctx, st, err); err != nil { - return ResPatchObject{}, fmt.Errorf("client failure: %w", err) - } - - return ResPatchObject{ObjectID: res.ObjectID()}, nil -} - -// objectPut writes object to FrostFS. -func (c *clientWrapper) objectPut(ctx context.Context, prm PrmObjectPut) (ResPutObject, error) { - if prm.bufferMaxSize == 0 { - prm.bufferMaxSize = defaultBufferMaxSizeForPut - } - - if prm.clientCut { - return c.objectPutClientCut(ctx, prm) - } - - return c.objectPutServerCut(ctx, prm) -} - -func (c *clientWrapper) objectPutServerCut(ctx context.Context, prm PrmObjectPut) (ResPutObject, error) { - cl, err := c.getClient() - if err != nil { - return ResPutObject{}, err - } - - cliPrm := sdkClient.PrmObjectPutInit{ - CopiesNumber: prm.copiesNumber, - Session: prm.stoken, - Key: prm.key, - BearerToken: prm.btoken, - } - - start := time.Now() - wObj, err := cl.ObjectPutInit(ctx, cliPrm) - c.incRequests(time.Since(start), methodObjectPut) - if err = c.handleError(ctx, nil, err); err != nil { - return ResPutObject{}, fmt.Errorf("init writing on API client: %w", err) - } - - if wObj.WriteHeader(ctx, prm.hdr) { - sz := prm.hdr.PayloadSize() - - if data := prm.hdr.Payload(); len(data) > 0 { - if prm.payload != nil { - prm.payload = io.MultiReader(bytes.NewReader(data), prm.payload) - } else { - prm.payload = bytes.NewReader(data) - sz = uint64(len(data)) - } - } - - if prm.payload != nil { - if sz == 0 || sz > prm.bufferMaxSize { - sz = prm.bufferMaxSize - } - - buf := make([]byte, sz) - - var n int - - for { - n, err = prm.payload.Read(buf) - if n > 0 { - start = time.Now() - successWrite := wObj.WritePayloadChunk(ctx, buf[:n]) - c.incRequests(time.Since(start), methodObjectPut) - if !successWrite { - break - } - - continue - } - - if errors.Is(err, io.EOF) { - break - } - - return ResPutObject{}, fmt.Errorf("read payload: %w", c.handleError(ctx, nil, err)) - } - } - } - - res, err := wObj.Close(ctx) - var st apistatus.Status - if res != nil { - st = res.Status() - } - if err = c.handleError(ctx, st, err); err != nil { // here err already carries both status and client errors - return ResPutObject{}, fmt.Errorf("client failure: %w", err) - } - - return ResPutObject{ - ObjectID: res.StoredObjectID(), - Epoch: res.StoredEpoch(), - }, nil -} - -func (c *clientWrapper) objectPutClientCut(ctx context.Context, prm PrmObjectPut) (ResPutObject, error) { - putInitPrm := PrmObjectPutClientCutInit{ - PrmObjectPut: prm, - } - - start := time.Now() - wObj, err := c.objectPutInitTransformer(putInitPrm) - c.incRequests(time.Since(start), methodObjectPut) - if err = c.handleError(ctx, nil, err); err != nil { - return ResPutObject{}, fmt.Errorf("init writing on API client: %w", err) - } - - if wObj.WriteHeader(ctx, prm.hdr) { - sz := prm.hdr.PayloadSize() - - if data := prm.hdr.Payload(); len(data) > 0 { - if prm.payload != nil { - prm.payload = io.MultiReader(bytes.NewReader(data), prm.payload) - } else { - prm.payload = bytes.NewReader(data) - sz = uint64(len(data)) - } - } - - if prm.payload != nil { - if sz == 0 || sz > prm.bufferMaxSize { - sz = prm.bufferMaxSize - } - - buf := make([]byte, sz) - - var n int - - for { - n, err = prm.payload.Read(buf) - if n > 0 { - start = time.Now() - successWrite := wObj.WritePayloadChunk(ctx, buf[:n]) - c.incRequests(time.Since(start), methodObjectPut) - if !successWrite { - break - } - - continue - } - - if errors.Is(err, io.EOF) { - break - } - - return ResPutObject{}, fmt.Errorf("read payload: %w", c.handleError(ctx, nil, err)) - } - } - } - - res, err := wObj.Close(ctx) - var st apistatus.Status - if res != nil { - st = res.Status - } - if err = c.handleError(ctx, st, err); err != nil { // here err already carries both status and client errors - return ResPutObject{}, fmt.Errorf("client failure: %w", err) - } - - return ResPutObject{ - ObjectID: res.OID, - Epoch: res.Epoch, - }, nil -} - -// objectDelete invokes sdkClient.ObjectDelete parse response status to error. -func (c *clientWrapper) objectDelete(ctx context.Context, prm PrmObjectDelete) error { - cl, err := c.getClient() - if err != nil { - return err - } - - cnr := prm.addr.Container() - obj := prm.addr.Object() - - cliPrm := sdkClient.PrmObjectDelete{ - BearerToken: prm.btoken, - Session: prm.stoken, - ContainerID: &cnr, - ObjectID: &obj, - Key: prm.key, - } - - start := time.Now() - res, err := cl.ObjectDelete(ctx, cliPrm) - c.incRequests(time.Since(start), methodObjectDelete) - var st apistatus.Status - if res != nil { - st = res.Status() - } - if err = c.handleError(ctx, st, err); err != nil { - return fmt.Errorf("delete object on client: %w", err) - } - return nil -} - -// objectGet returns reader for object. -func (c *clientWrapper) objectGet(ctx context.Context, prm PrmObjectGet) (ResGetObject, error) { - cl, err := c.getClient() - if err != nil { - return ResGetObject{}, err - } - - prmCnr := prm.addr.Container() - prmObj := prm.addr.Object() - - cliPrm := sdkClient.PrmObjectGet{ - BearerToken: prm.btoken, - Session: prm.stoken, - ContainerID: &prmCnr, - ObjectID: &prmObj, - Key: prm.key, - } - - var res ResGetObject - - rObj, err := cl.ObjectGetInit(ctx, cliPrm) - if err = c.handleError(ctx, nil, err); err != nil { - return ResGetObject{}, fmt.Errorf("init object reading on client: %w", err) - } - - start := time.Now() - successReadHeader := rObj.ReadHeader(&res.Header) - c.incRequests(time.Since(start), methodObjectGet) - if !successReadHeader { - rObjRes, err := rObj.Close() - var st apistatus.Status - if rObjRes != nil { - st = rObjRes.Status() - } - err = c.handleError(ctx, st, err) - return res, fmt.Errorf("read header: %w", err) - } - - res.Payload = &objectReadCloser{ - reader: rObj, - elapsedTimeCallback: func(elapsed time.Duration) { - c.incRequests(elapsed, methodObjectGet) - }, - } - - return res, nil -} - -// objectHead invokes sdkClient.ObjectHead parse response status to error and return result as is. -func (c *clientWrapper) objectHead(ctx context.Context, prm PrmObjectHead) (object.Object, error) { - cl, err := c.getClient() - if err != nil { - return object.Object{}, err - } - - prmCnr := prm.addr.Container() - prmObj := prm.addr.Object() - - cliPrm := sdkClient.PrmObjectHead{ - BearerToken: prm.btoken, - Session: prm.stoken, - Raw: prm.raw, - ContainerID: &prmCnr, - ObjectID: &prmObj, - Key: prm.key, - } - - var obj object.Object - - start := time.Now() - res, err := cl.ObjectHead(ctx, cliPrm) - c.incRequests(time.Since(start), methodObjectHead) - var st apistatus.Status - if res != nil { - st = res.Status() - } - if err = c.handleError(ctx, st, err); err != nil { - return obj, fmt.Errorf("read object header via client: %w", err) - } - if !res.ReadHeader(&obj) { - return obj, errors.New("missing object header in response") - } - - return obj, nil -} - -// objectRange returns object range reader. -func (c *clientWrapper) objectRange(ctx context.Context, prm PrmObjectRange) (ResObjectRange, error) { - cl, err := c.getClient() - if err != nil { - return ResObjectRange{}, err - } - - prmCnr := prm.addr.Container() - prmObj := prm.addr.Object() - - cliPrm := sdkClient.PrmObjectRange{ - BearerToken: prm.btoken, - Session: prm.stoken, - ContainerID: &prmCnr, - ObjectID: &prmObj, - Offset: prm.off, - Length: prm.ln, - Key: prm.key, - } - - start := time.Now() - res, err := cl.ObjectRangeInit(ctx, cliPrm) - c.incRequests(time.Since(start), methodObjectRange) - if err = c.handleError(ctx, nil, err); err != nil { - return ResObjectRange{}, fmt.Errorf("init payload range reading on client: %w", err) - } - - return ResObjectRange{ - payload: res, - elapsedTimeCallback: func(elapsed time.Duration) { - c.incRequests(elapsed, methodObjectRange) - }, - }, nil -} - -// objectSearch invokes sdkClient.ObjectSearchInit parse response status to error and return result as is. -func (c *clientWrapper) objectSearch(ctx context.Context, prm PrmObjectSearch) (ResObjectSearch, error) { - cl, err := c.getClient() - if err != nil { - return ResObjectSearch{}, err - } - - cliPrm := sdkClient.PrmObjectSearch{ - ContainerID: &prm.cnrID, - Filters: prm.filters, - Session: prm.stoken, - BearerToken: prm.btoken, - Key: prm.key, - } - - res, err := cl.ObjectSearchInit(ctx, cliPrm) - if err = c.handleError(ctx, nil, err); err != nil { - return ResObjectSearch{}, fmt.Errorf("init object searching on client: %w", err) - } - - return ResObjectSearch{r: res, handleError: c.handleError}, nil -} - -// sessionCreate invokes sdkClient.SessionCreate parse response status to error and return result as is. -func (c *clientWrapper) sessionCreate(ctx context.Context, prm prmCreateSession) (resCreateSession, error) { - cl, err := c.getClient() - if err != nil { - return resCreateSession{}, err - } - - cliPrm := sdkClient.PrmSessionCreate{ - Expiration: prm.exp, - Key: &prm.key, - } - - start := time.Now() - res, err := cl.SessionCreate(ctx, cliPrm) - c.incRequests(time.Since(start), methodSessionCreate) - var st apistatus.Status - if res != nil { - st = res.Status() - } - if err = c.handleError(ctx, st, err); err != nil { - return resCreateSession{}, fmt.Errorf("session creation on client: %w", err) - } - - return resCreateSession{ - id: res.ID(), - sessionKey: res.PublicKey(), - }, nil -} - -func (c *clientStatusMonitor) isHealthy() bool { - return c.healthy.Load() == statusHealthy -} - -func (c *clientStatusMonitor) setHealthy() { - c.healthy.Store(statusHealthy) -} - -func (c *clientStatusMonitor) setUnhealthy() { - c.healthy.Store(statusUnhealthyOnRequest) -} - -func (c *clientStatusMonitor) address() string { - return c.addr -} - -func (c *clientStatusMonitor) incErrorRate() { - c.mu.Lock() - c.currentErrorCount++ - c.overallErrorCount++ - - thresholdReached := c.currentErrorCount >= c.errorThreshold - if thresholdReached { - c.setUnhealthy() - c.currentErrorCount = 0 - } - c.mu.Unlock() - - if thresholdReached { - c.log(zapcore.WarnLevel, "error threshold reached", - zap.String("address", c.addr), zap.Uint32("threshold", c.errorThreshold)) - } -} - -func (c *clientStatusMonitor) incErrorRateToUnhealthy(err error) { - c.mu.Lock() - c.currentErrorCount = 0 - c.overallErrorCount++ - c.setUnhealthy() - c.mu.Unlock() - - c.log(zapcore.WarnLevel, "explicitly mark node unhealthy", zap.String("address", c.addr), zap.Error(err)) -} - -func (c *clientStatusMonitor) log(level zapcore.Level, msg string, fields ...zap.Field) { - if c.logger == nil { - return - } - - c.logger.Log(level, msg, fields...) -} - -func (c *clientStatusMonitor) currentErrorRate() uint32 { - c.mu.RLock() - defer c.mu.RUnlock() - return c.currentErrorCount -} - -func (c *clientStatusMonitor) overallErrorRate() uint64 { - c.mu.RLock() - defer c.mu.RUnlock() - return c.overallErrorCount -} - -func (c *clientStatusMonitor) methodsStatus() []StatusSnapshot { - result := make([]StatusSnapshot, len(c.methods)) - for i, val := range c.methods { - result[i] = val.Snapshot() - } - - return result -} - -func (c *clientWrapper) incRequests(elapsed time.Duration, method MethodIndex) { - methodStat := c.methods[method] - methodStat.IncRequests(elapsed) - if c.prm.poolRequestInfoCallback != nil { - c.prm.poolRequestInfoCallback(RequestInfo{ - Address: c.prm.address, - Method: method, - Elapsed: elapsed, - }) - } -} - -func (c *clientWrapper) close() error { - if !c.isDialed() { - return nil - } - if cl := c.getClientRaw(); cl != nil { - return cl.Close() - } - return nil -} - -func (c *clientWrapper) scheduleGracefulClose() { - cl := c.getClientRaw() - if cl == nil { - return - } - - time.AfterFunc(c.prm.gracefulCloseOnSwitchTimeout, func() { - if err := cl.Close(); err != nil { - c.log(zap.DebugLevel, "close unhealthy client during rebalance", zap.String("address", c.address()), zap.Error(err)) - } - }) -} - -func (c *clientStatusMonitor) handleError(ctx context.Context, st apistatus.Status, err error) error { - if stErr := apistatus.ErrFromStatus(st); stErr != nil { - switch stErr.(type) { - case *apistatus.ServerInternal, - *apistatus.WrongMagicNumber, - *apistatus.SignatureVerification: - c.incErrorRate() - case *apistatus.NodeUnderMaintenance: - c.incErrorRateToUnhealthy(stErr) - } - - if err == nil { - err = stErr - } - - return err - } - - if err != nil { - if needCountError(ctx, err) { - if sdkClient.IsErrNodeUnderMaintenance(err) { - c.incErrorRateToUnhealthy(err) - } else { - c.incErrorRate() - } - } - - return err - } - - return nil -} - -func needCountError(ctx context.Context, err error) bool { - // non-status logic error that could be returned - // from the SDK client; should not be considered - // as a connection error - var siErr *object.SplitInfoError - if errors.As(err, &siErr) { - return false - } - var eiErr *object.ECInfoError - if errors.As(err, &eiErr) { - return false - } - - if ctx != nil && errors.Is(ctx.Err(), context.Canceled) { - return false - } - - return true -} - -// clientBuilder is a type alias of client constructors which open connection -// to the given endpoint. -type clientBuilder = func(endpoint string) client - -// RequestInfo groups info about pool request. -type RequestInfo struct { - Address string - Method MethodIndex - Elapsed time.Duration -} - // InitParameters contains values used to initialize connection Pool. type InitParameters struct { key *ecdsa.PrivateKey From 17177697b5f8d869a47687421712abbc48de1203 Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Wed, 5 Mar 2025 15:30:48 +0300 Subject: [PATCH 171/197] [#300] pool/cm: Remove unused mutex in 'statistics' Signed-off-by: Alexander Chuprov --- pool/connection_manager.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/pool/connection_manager.go b/pool/connection_manager.go index 5b9a08d..b142529 100644 --- a/pool/connection_manager.go +++ b/pool/connection_manager.go @@ -297,7 +297,6 @@ func (cm connectionManager) Statistic() Statistic { stat := Statistic{} for _, inner := range cm.innerPools { nodes := make([]string, 0, len(inner.clients)) - inner.lock.RLock() for _, cl := range inner.clients { if cl.isHealthy() { nodes = append(nodes, cl.address()) @@ -311,7 +310,6 @@ func (cm connectionManager) Statistic() Statistic { stat.nodes = append(stat.nodes, node) stat.overallErrors += node.overallErrors } - inner.lock.RUnlock() if len(stat.currentNodes) == 0 { stat.currentNodes = nodes } From f70c0c9081a996e34121debaff56ed98b72eafcd Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Wed, 5 Mar 2025 15:42:42 +0300 Subject: [PATCH 172/197] [#300] pool: Remove obvious comments Signed-off-by: Alexander Chuprov --- pool/pool.go | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/pool/pool.go b/pool/pool.go index 869ff2c..2f30ae4 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -1082,8 +1082,6 @@ type ResPatchObject struct { } // PatchObject patches an object through a remote server using FrostFS API protocol. -// -// Main return value MUST NOT be processed on an erroneous return. func (p *Pool) PatchObject(ctx context.Context, prm PrmObjectPatch) (ResPatchObject, error) { var prmCtx prmContext prmCtx.useDefaultSession() @@ -1113,8 +1111,6 @@ func (p *Pool) PatchObject(ctx context.Context, prm PrmObjectPatch) (ResPatchObj } // PutObject writes an object through a remote server using FrostFS API protocol. -// -// Main return value MUST NOT be processed on an erroneous return. func (p *Pool) PutObject(ctx context.Context, prm PrmObjectPut) (ResPutObject, error) { cnr, _ := prm.hdr.ContainerID() @@ -1222,8 +1218,6 @@ type ResGetObject struct { } // GetObject reads object header and initiates reading an object payload through a remote server using FrostFS API protocol. -// -// Main return value MUST NOT be processed on an erroneous return. func (p *Pool) GetObject(ctx context.Context, prm PrmObjectGet) (ResGetObject, error) { var cc callContext cc.sessionTarget = prm.UseSession @@ -1245,8 +1239,6 @@ func (p *Pool) GetObject(ctx context.Context, prm PrmObjectGet) (ResGetObject, e } // HeadObject reads object header through a remote server using FrostFS API protocol. -// -// Main return value MUST NOT be processed on an erroneous return. func (p *Pool) HeadObject(ctx context.Context, prm PrmObjectHead) (object.Object, error) { var cc callContext cc.sessionTarget = prm.UseSession @@ -1294,8 +1286,6 @@ func (x *ResObjectRange) Close() error { // ObjectRange initiates reading an object's payload range through a remote // server using FrostFS API protocol. -// -// Main return value MUST NOT be processed on an erroneous return. func (p *Pool) ObjectRange(ctx context.Context, prm PrmObjectRange) (ResObjectRange, error) { var cc callContext cc.sessionTarget = prm.UseSession @@ -1363,8 +1353,6 @@ func (x *ResObjectSearch) Close() { // // The call only opens the transmission channel, explicit fetching of matched objects // is done using the ResObjectSearch. Resulting reader must be finally closed. -// -// Main return value MUST NOT be processed on an erroneous return. func (p *Pool) SearchObjects(ctx context.Context, prm PrmObjectSearch) (ResObjectSearch, error) { var cc callContext cc.sessionTarget = prm.UseSession @@ -1393,8 +1381,6 @@ func (p *Pool) SearchObjects(ctx context.Context, prm PrmObjectSearch) (ResObjec // waiting timeout: 120s // // Success can be verified by reading by identifier (see GetContainer). -// -// Main return value MUST NOT be processed on an erroneous return. func (p *Pool) PutContainer(ctx context.Context, prm PrmContainerPut) (cid.ID, error) { cp, err := p.manager.connection() if err != nil { @@ -1410,8 +1396,6 @@ func (p *Pool) PutContainer(ctx context.Context, prm PrmContainerPut) (cid.ID, e } // GetContainer reads FrostFS container by ID. -// -// Main return value MUST NOT be processed on an erroneous return. func (p *Pool) GetContainer(ctx context.Context, prm PrmContainerGet) (container.Container, error) { cp, err := p.manager.connection() if err != nil { @@ -1525,8 +1509,6 @@ func (p *Pool) ListAPEChains(ctx context.Context, prm PrmListAPEChains) ([]ape.C } // Balance requests current balance of the FrostFS account. -// -// Main return value MUST NOT be processed on an erroneous return. func (p *Pool) Balance(ctx context.Context, prm PrmBalanceGet) (accounting.Decimal, error) { cp, err := p.manager.connection() if err != nil { @@ -1586,8 +1568,6 @@ func waitFor(ctx context.Context, params *WaitParams, condition func(context.Con } // NetworkInfo requests information about the FrostFS network of which the remote server is a part. -// -// Main return value MUST NOT be processed on an erroneous return. func (p *Pool) NetworkInfo(ctx context.Context) (netmap.NetworkInfo, error) { cp, err := p.manager.connection() if err != nil { @@ -1603,8 +1583,6 @@ func (p *Pool) NetworkInfo(ctx context.Context) (netmap.NetworkInfo, error) { } // NetMapSnapshot requests information about the FrostFS network map. -// -// Main return value MUST NOT be processed on an erroneous return. func (p *Pool) NetMapSnapshot(ctx context.Context) (netmap.NetMap, error) { cp, err := p.manager.connection() if err != nil { From 749b4e9ab592d23a1327a77ee7df91e7efab9944 Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Fri, 7 Mar 2025 13:59:38 +0300 Subject: [PATCH 173/197] [#344] netmap: Add method `Clone` Signed-off-by: Anton Nikiforov --- api/netmap/types.go | 32 +++++++++++++++++++++++++++ api/netmap/types_test.go | 48 ++++++++++++++++++++++++++++++++++++++++ netmap/netmap.go | 15 +++++++++++++ netmap/netmap_test.go | 26 ++++++++++++++++++++++ netmap/node_info.go | 11 +++++++++ netmap/node_info_test.go | 9 ++++++++ 6 files changed, 141 insertions(+) create mode 100644 api/netmap/types_test.go diff --git a/api/netmap/types.go b/api/netmap/types.go index 877357d..38810ab 100644 --- a/api/netmap/types.go +++ b/api/netmap/types.go @@ -1,6 +1,9 @@ package netmap import ( + "bytes" + "slices" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" ) @@ -382,6 +385,18 @@ func (a *Attribute) SetParents(parent []string) { a.parents = parent } +// Clone returns a copy of Attribute. +func (a *Attribute) Clone() *Attribute { + if a == nil { + return nil + } + return &Attribute{ + parents: slices.Clone(a.parents), + value: a.value, + key: a.key, + } +} + func (ni *NodeInfo) GetPublicKey() []byte { if ni != nil { return ni.publicKey @@ -465,6 +480,23 @@ func (ni *NodeInfo) SetState(state NodeState) { ni.state = state } +// Clone returns a copy of NodeInfo. +func (ni *NodeInfo) Clone() *NodeInfo { + if ni == nil { + return nil + } + dst := NodeInfo{ + addresses: slices.Clone(ni.addresses), + publicKey: bytes.Clone(ni.publicKey), + state: ni.state, + attributes: make([]Attribute, len(ni.attributes)), + } + for i, v := range ni.attributes { + dst.attributes[i] = *v.Clone() + } + return &dst +} + func (l *LocalNodeInfoResponseBody) GetVersion() *refs.Version { if l != nil { return l.version diff --git a/api/netmap/types_test.go b/api/netmap/types_test.go new file mode 100644 index 0000000..47d9d7b --- /dev/null +++ b/api/netmap/types_test.go @@ -0,0 +1,48 @@ +package netmap + +import ( + "bytes" + "slices" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestNodeInfo_Clone(t *testing.T) { + var ni NodeInfo + ni.publicKey = []byte{2} + attr := Attribute{ + key: "key", + value: "value", + parents: []string{"parent", "parent2"}, + } + ni.attributes = []Attribute{attr} + ni.addresses = []string{"5", "6"} + + c := ni.Clone() + + require.True(t, c != &ni) + require.True(t, bytes.Equal(c.publicKey, ni.publicKey)) + require.True(t, &(c.publicKey[0]) != &(ni.publicKey[0])) + require.True(t, &(c.attributes[0]) != &(ni.attributes[0])) + require.True(t, slices.Compare(c.addresses, ni.addresses) == 0) + require.True(t, &(c.addresses[0]) != &(ni.addresses[0])) +} + +func TestAttribute_Clone(t *testing.T) { + attr := Attribute{ + key: "key", + value: "value", + parents: []string{"parent1", "parent2"}, + } + + c := attr.Clone() + + require.True(t, c != &attr) + require.True(t, c.key == attr.key) + require.True(t, &(c.key) != &(attr.key)) + require.True(t, &(c.value) != &(attr.value)) + require.True(t, c.value == attr.value) + require.True(t, &(c.parents[0]) != &(attr.parents[0])) + require.True(t, slices.Compare(c.parents, attr.parents) == 0) +} diff --git a/netmap/netmap.go b/netmap/netmap.go index 0d3b668..b119f07 100644 --- a/netmap/netmap.go +++ b/netmap/netmap.go @@ -96,6 +96,21 @@ func (m NetMap) Epoch() uint64 { return m.epoch } +// Clone returns a copy of NetMap. +func (m *NetMap) Clone() *NetMap { + if m == nil { + return nil + } + dst := NetMap{ + epoch: m.epoch, + nodes: make([]NodeInfo, len(m.nodes)), + } + for i, node := range m.nodes { + dst.nodes[i] = *node.Clone() + } + return &dst +} + // nodes is a slice of NodeInfo instances needed for HRW sorting. type nodes []NodeInfo diff --git a/netmap/netmap_test.go b/netmap/netmap_test.go index 2aab542..5be5412 100644 --- a/netmap/netmap_test.go +++ b/netmap/netmap_test.go @@ -1,6 +1,7 @@ package netmap_test import ( + "bytes" "testing" v2netmap "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" @@ -45,3 +46,28 @@ func TestNetMap_SetEpoch(t *testing.T) { require.EqualValues(t, e, m.Epoch()) } + +func TestNetMap_Clone(t *testing.T) { + nm := new(netmap.NetMap) + nm.SetEpoch(1) + var ni netmap.NodeInfo + ni.SetPublicKey([]byte{1, 2, 3}) + nm.SetNodes([]netmap.NodeInfo{ni}) + + clone := nm.Clone() + + require.True(t, clone != nm) + require.True(t, &(clone.Nodes()[0]) != &(nm.Nodes()[0])) + + var clonev2 v2netmap.NetMap + clone.WriteToV2(&clonev2) + var bufClone []byte + bufClone = clonev2.StableMarshal(bufClone) + + var nmv2 v2netmap.NetMap + nm.WriteToV2(&nmv2) + var bufNM []byte + bufNM = nmv2.StableMarshal(bufNM) + + require.True(t, bytes.Equal(bufClone, bufNM)) +} diff --git a/netmap/node_info.go b/netmap/node_info.go index 0d250ce..a792337 100644 --- a/netmap/node_info.go +++ b/netmap/node_info.go @@ -563,6 +563,17 @@ func (x *NodeInfo) SetStatus(state NodeState) { x.m.SetState(netmap.NodeState(state)) } +// Clone returns a copy of NodeInfo. +func (x *NodeInfo) Clone() *NodeInfo { + if x == nil { + return nil + } + return &NodeInfo{ + hash: x.hash, + m: *x.m.Clone(), + } +} + // String implements fmt.Stringer. // // String is designed to be human-readable, and its format MAY differ between diff --git a/netmap/node_info_test.go b/netmap/node_info_test.go index 54c78b2..965213e 100644 --- a/netmap/node_info_test.go +++ b/netmap/node_info_test.go @@ -108,3 +108,12 @@ func TestNodeInfo_ExternalAddr(t *testing.T) { n.SetExternalAddresses(addr[1:]...) require.Equal(t, addr[1:], n.ExternalAddresses()) } + +func TestNodeInfo_Clone(t *testing.T) { + var ni NodeInfo + ni.SetPublicKey([]byte{2, 3}) + + c := ni.Clone() + require.True(t, c != &ni) + require.True(t, &(c.PublicKey()[0]) != &(ni.PublicKey()[0])) +} From fe5b28e6bfb2d5414c62af911025686400d997ac Mon Sep 17 00:00:00 2001 From: Ekaterina Lebedeva Date: Thu, 6 Mar 2025 05:23:53 +0300 Subject: [PATCH 174/197] [#338] pool: Support avg request time for ListContainerStream Signed-off-by: Ekaterina Lebedeva --- pool/client.go | 30 +++++++++++++++++++++++++----- pool/statistic.go | 5 +++++ 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/pool/client.go b/pool/client.go index f1abbf2..7865072 100644 --- a/pool/client.go +++ b/pool/client.go @@ -90,6 +90,8 @@ func (m MethodIndex) String() string { return "containerGet" case methodContainerList: return "containerList" + case methodContainerListStream: + return "containerListStream" case methodContainerDelete: return "containerDelete" case methodEndpointInfo: @@ -457,13 +459,16 @@ type PrmListStream struct { // // Must be initialized using Pool.ListContainersStream, any other usage is unsafe. type ResListStream struct { - r *sdkClient.ContainerListReader - handleError func(context.Context, apistatus.Status, error) error + r *sdkClient.ContainerListReader + elapsedTimeCallback func(time.Duration) + handleError func(context.Context, apistatus.Status, error) error } // Read reads another list of the container identifiers. func (x *ResListStream) Read(buf []cid.ID) (int, error) { + start := time.Now() n, ok := x.r.Read(buf) + x.elapsedTimeCallback(time.Since(start)) if !ok { res, err := x.r.Close() if err == nil { @@ -487,7 +492,14 @@ func (x *ResListStream) Read(buf []cid.ID) (int, error) { // // Returns an error if container can't be read. func (x *ResListStream) Iterate(f func(cid.ID) bool) error { - return x.r.Iterate(f) + start := time.Now() + err := x.r.Iterate(func(id cid.ID) bool { + x.elapsedTimeCallback(time.Since(start)) + stop := f(id) + start = time.Now() + return stop + }) + return err } // Close ends reading list of the matched containers and returns the result of the operation @@ -508,11 +520,19 @@ func (c *clientWrapper) containerListStream(ctx context.Context, prm PrmListStre Session: prm.Session, } - res, err := cl.ContainerListInit(ctx, cliPrm) + start := time.Now() + cnrRdr, err := cl.ContainerListInit(ctx, cliPrm) + c.incRequests(time.Since(start), methodContainerListStream) if err = c.handleError(ctx, nil, err); err != nil { return ResListStream{}, fmt.Errorf("init container listing on client: %w", err) } - return ResListStream{r: res, handleError: c.handleError}, nil + return ResListStream{ + r: cnrRdr, + elapsedTimeCallback: func(elapsed time.Duration) { + c.incRequests(elapsed, methodContainerListStream) + }, + handleError: c.handleError, + }, nil } // containerDelete invokes sdkClient.ContainerDelete parse response status to error. diff --git a/pool/statistic.go b/pool/statistic.go index 40da88f..b9c2430 100644 --- a/pool/statistic.go +++ b/pool/statistic.go @@ -97,6 +97,11 @@ func (n NodeStatistic) AverageListContainer() time.Duration { return n.averageTime(methodContainerList) } +// AverageListContainerStream returns average time to perform ContainerListStream request. +func (n NodeStatistic) AverageListContainerStream() time.Duration { + return n.averageTime(methodContainerListStream) +} + // AverageDeleteContainer returns average time to perform ContainerDelete request. func (n NodeStatistic) AverageDeleteContainer() time.Duration { return n.averageTime(methodContainerDelete) From a262a0038f7dbd485e03c13c5f3e8f23dd3cad80 Mon Sep 17 00:00:00 2001 From: Ekaterina Lebedeva Date: Mon, 10 Mar 2025 19:24:26 +0300 Subject: [PATCH 175/197] [#343] pool: Fix Yoda condition go-staticcheck recommends not to use Yoda conditions. Signed-off-by: Ekaterina Lebedeva --- pool/pool_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pool/pool_test.go b/pool/pool_test.go index b063294..e6af664 100644 --- a/pool/pool_test.go +++ b/pool/pool_test.go @@ -372,7 +372,7 @@ func TestUpdateNodesHealth(t *testing.T) { changed := tc.wasHealthy != tc.willHealthy require.Equalf(t, tc.willHealthy, cli.isHealthy(), "healthy status should be: %v", tc.willHealthy) - require.Equalf(t, changed, 1 == log.Len(), "healthy status should be changed: %v", changed) + require.Equalf(t, changed, log.Len() == 1, "healthy status should be changed: %v", changed) }) } } From 87bb55f992dc3b7eb43c1bfc5f0fe4567c641d61 Mon Sep 17 00:00:00 2001 From: Pavel Pogodaev Date: Fri, 24 Jan 2025 12:41:07 +0300 Subject: [PATCH 176/197] [#51] add address to logs Signed-off-by: Pavel Pogodaev --- pool/object_put_pool_transformer.go | 7 ++++--- pool/pool.go | 2 +- pool/tree/client.go | 10 +++++++--- pool/tree/pool.go | 6 +++--- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/pool/object_put_pool_transformer.go b/pool/object_put_pool_transformer.go index e596aeb..6955919 100644 --- a/pool/object_put_pool_transformer.go +++ b/pool/object_put_pool_transformer.go @@ -2,6 +2,7 @@ package pool import ( "context" + "fmt" sdkClient "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" @@ -134,7 +135,7 @@ func (it *internalTarget) putAsStream(ctx context.Context, o *object.Object) err it.res.OID = res.StoredObjectID() it.res.Epoch = res.StoredEpoch() } - return err + return fmt.Errorf("put as stream '%s': %w", it.address, err) } func (it *internalTarget) tryPutSingle(ctx context.Context, o *object.Object) (bool, error) { @@ -151,7 +152,7 @@ func (it *internalTarget) tryPutSingle(ctx context.Context, o *object.Object) (b res, err := it.client.ObjectPutSingle(ctx, cliPrm) if err != nil && status.Code(err) == codes.Unimplemented { - return false, err + return false, fmt.Errorf("address '%s': %w", it.address, err) } if err == nil { @@ -166,5 +167,5 @@ func (it *internalTarget) tryPutSingle(ctx context.Context, o *object.Object) (b } return true, nil } - return true, err + return true, fmt.Errorf("try put single '%s': %w", it.address, err) } diff --git a/pool/pool.go b/pool/pool.go index 2f30ae4..f6588c5 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -1646,7 +1646,7 @@ func (p *Pool) GetSplitInfo(ctx context.Context, cnrID cid.ID, objID oid.ID, tok case errors.As(err, &errSplit): return errSplit.SplitInfo(), nil case err == nil || errors.As(err, &errECInfo): - return nil, relations.ErrNoSplitInfo + return nil, fmt.Errorf("failed to get raw object header %w", relations.ErrNoSplitInfo) default: return nil, fmt.Errorf("failed to get raw object header: %w", err) } diff --git a/pool/tree/client.go b/pool/tree/client.go index b93b5e6..b7682d9 100644 --- a/pool/tree/client.go +++ b/pool/tree/client.go @@ -49,11 +49,11 @@ func (c *treeClient) dial(ctx context.Context) error { var err error c.client, err = c.createClient() if err != nil { - return err + return fmt.Errorf("couldn't dial '%s': %w", c.address, err) } if _, err = rpcapi.Healthcheck(c.client, &tree.HealthcheckRequest{}, rpcclient.WithContext(ctx)); err != nil { - return fmt.Errorf("healthcheck tree service: %w", err) + return fmt.Errorf("healthcheck tree service '%s': %w", c.address, err) } c.healthy = true @@ -127,5 +127,9 @@ func (c *treeClient) close() error { if c.client == nil || c.client.Conn() == nil { return nil } - return c.client.Conn().Close() + err := c.client.Conn().Close() + if err != nil { + return fmt.Errorf("address '%s': %w", c.address, err) + } + return nil } diff --git a/pool/tree/pool.go b/pool/tree/pool.go index f5cee26..dda74c1 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -295,7 +295,7 @@ func (p *Pool) Dial(ctx context.Context) error { for j, node := range nodes { clients[j] = newTreeClient(node.Address(), p.dialOptions, p.nodeDialTimeout, p.streamTimeout) if err := clients[j].dial(ctx); err != nil { - p.log(zap.WarnLevel, "failed to dial tree client", zap.String("address", node.Address()), zap.Error(err)) + p.log(zap.WarnLevel, "failed to dial tree client", zap.Error(err)) continue } @@ -1095,7 +1095,7 @@ func (p *Pool) getNewTreeClient(ctx context.Context, node netmap.NodeInfo) (*tre newTreeCl := newTreeClient(addr.URIAddr(), p.dialOptions, p.nodeDialTimeout, p.streamTimeout) if err = newTreeCl.dial(ctx); err != nil { - p.log(zap.WarnLevel, "failed to dial tree client", zap.String("address", addr.URIAddr()), zap.Error(err)) + p.log(zap.WarnLevel, "failed to dial tree client", zap.Error(err)) // We have to close connection here after failed `dial()`. // This is NOT necessary in object pool and regular tree pool without netmap support, because: @@ -1103,7 +1103,7 @@ func (p *Pool) getNewTreeClient(ctx context.Context, node netmap.NodeInfo) (*tre // - regular tree pool is going to reuse connection by calling `redialIfNecessary()`. // Tree pool with netmap support does not operate with background goroutine, so we have to close connection immediately. if err = newTreeCl.close(); err != nil { - p.log(zap.WarnLevel, "failed to close recently dialed tree client", zap.String("address", addr.URIAddr()), zap.Error(err)) + p.log(zap.WarnLevel, "failed to close recently dialed tree client", zap.Error(err)) } return false From 826df9303cb7510f7cc7890348bf579bf417bae8 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Wed, 26 Mar 2025 13:10:16 +0300 Subject: [PATCH 177/197] [#349] object: Regenerate protobuf for `Patch` method * `PatchRequestBody` got `NewSplitHeader` field * Introduce `SetNewSplitHeader`, `GetNewSplitHeader` * Fix converter and marshaler Signed-off-by: Airat Arifullin --- api/object/convert.go | 15 ++ api/object/grpc/service.pb.go | 248 ++++++++++++--------- api/object/grpc/service_protoopaque.pb.go | 250 ++++++++++++---------- api/object/marshal.go | 13 +- api/object/types.go | 10 + 5 files changed, 317 insertions(+), 219 deletions(-) diff --git a/api/object/convert.go b/api/object/convert.go index 016a367..90e40dc 100644 --- a/api/object/convert.go +++ b/api/object/convert.go @@ -2389,6 +2389,7 @@ func (r *PatchRequestBody) ToGRPCMessage() grpc.Message { m.SetNewAttributes(AttributesToGRPC(r.newAttributes)) m.SetReplaceAttributes(r.replaceAttributes) m.SetPatch(r.patch.ToGRPCMessage().(*object.PatchRequest_Body_Patch)) + m.SetNewSplitHeader(r.newSplitHeader.ToGRPCMessage().(*object.Header_Split)) } return m @@ -2437,6 +2438,20 @@ func (r *PatchRequestBody) FromGRPCMessage(m grpc.Message) error { } } + newSplitHeader := v.GetNewSplitHeader() + if newSplitHeader == nil { + r.newSplitHeader = nil + } else { + if r.newSplitHeader == nil { + r.newSplitHeader = new(SplitHeader) + } + + err = r.newSplitHeader.FromGRPCMessage(newSplitHeader) + if err != nil { + return err + } + } + return nil } diff --git a/api/object/grpc/service.pb.go b/api/object/grpc/service.pb.go index 9603467..8926f5c 100644 --- a/api/object/grpc/service.pb.go +++ b/api/object/grpc/service.pb.go @@ -5181,6 +5181,9 @@ type PatchRequest_Body struct { // 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" json:"replace_attributes,omitempty"` + // New split header for the object. This defines how the object will relate + // to other objects in a split operation. + NewSplitHeader *Header_Split `protobuf:"bytes,5,opt,name=new_split_header,json=newSplitHeader" json:"new_split_header,omitempty"` // The patch that is applied for the object. Patch *PatchRequest_Body_Patch `protobuf:"bytes,4,opt,name=patch" json:"patch,omitempty"` unknownFields protoimpl.UnknownFields @@ -5233,6 +5236,13 @@ func (x *PatchRequest_Body) GetReplaceAttributes() bool { return false } +func (x *PatchRequest_Body) GetNewSplitHeader() *Header_Split { + if x != nil { + return x.NewSplitHeader + } + return nil +} + func (x *PatchRequest_Body) GetPatch() *PatchRequest_Body_Patch { if x != nil { return x.Patch @@ -5252,6 +5262,10 @@ func (x *PatchRequest_Body) SetReplaceAttributes(v bool) { x.ReplaceAttributes = &v } +func (x *PatchRequest_Body) SetNewSplitHeader(v *Header_Split) { + x.NewSplitHeader = v +} + func (x *PatchRequest_Body) SetPatch(v *PatchRequest_Body_Patch) { x.Patch = v } @@ -5270,6 +5284,13 @@ func (x *PatchRequest_Body) HasReplaceAttributes() bool { return x.ReplaceAttributes != nil } +func (x *PatchRequest_Body) HasNewSplitHeader() bool { + if x == nil { + return false + } + return x.NewSplitHeader != nil +} + func (x *PatchRequest_Body) HasPatch() bool { if x == nil { return false @@ -5285,6 +5306,10 @@ func (x *PatchRequest_Body) ClearReplaceAttributes() { x.ReplaceAttributes = nil } +func (x *PatchRequest_Body) ClearNewSplitHeader() { + x.NewSplitHeader = nil +} + func (x *PatchRequest_Body) ClearPatch() { x.Patch = nil } @@ -5305,6 +5330,9 @@ type PatchRequest_Body_builder struct { // merged. If the incoming `new_attributes` list contains already existing // key, then it just replaces it while merging the lists. ReplaceAttributes *bool + // New split header for the object. This defines how the object will relate + // to other objects in a split operation. + NewSplitHeader *Header_Split // The patch that is applied for the object. Patch *PatchRequest_Body_Patch } @@ -5316,6 +5344,7 @@ func (b0 PatchRequest_Body_builder) Build() *PatchRequest_Body { x.Address = b.Address x.NewAttributes = b.NewAttributes x.ReplaceAttributes = b.ReplaceAttributes + x.NewSplitHeader = b.NewSplitHeader x.Patch = b.Patch return m0 } @@ -5902,7 +5931,7 @@ var file_api_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, 0x22, 0xb3, 0x04, 0x0a, 0x0c, 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, + 0x04, 0x42, 0x6f, 0x64, 0x79, 0x22, 0xfd, 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, @@ -5916,7 +5945,7 @@ var file_api_object_grpc_service_proto_rawDesc = []byte{ 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, + 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x99, 0x03, 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, @@ -5928,87 +5957,92 @@ var file_api_object_grpc_service_proto_rawDesc = []byte{ 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, + 0x48, 0x0a, 0x10, 0x6e, 0x65, 0x77, 0x5f, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x18, 0x05, 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, 0x0e, 0x6e, 0x65, 0x77, 0x53, 0x70, + 0x6c, 0x69, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 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, 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, + 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, 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, + 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, 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, 0x62, 0x5a, 0x43, 0x67, 0x69, 0x74, - 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, - 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, - 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 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, 0x08, 0x65, - 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, + 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, 0x62, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, + 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, + 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x70, 0xe8, 0x07, } var file_api_object_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 42) @@ -6071,6 +6105,7 @@ var file_api_object_grpc_service_proto_goTypes = []any{ (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 + (*Header_Split)(nil), // 58: neo.fs.v2.object.Header.Split } var file_api_object_grpc_service_proto_depIdxs = []int32{ 20, // 0: neo.fs.v2.object.GetRequest.body:type_name -> neo.fs.v2.object.GetRequest.Body @@ -6163,32 +6198,33 @@ var file_api_object_grpc_service_proto_depIdxs = []int32{ 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 + 58, // 90: neo.fs.v2.object.PatchRequest.Body.new_split_header:type_name -> neo.fs.v2.object.Header.Split + 40, // 91: neo.fs.v2.object.PatchRequest.Body.patch:type_name -> neo.fs.v2.object.PatchRequest.Body.Patch + 11, // 92: neo.fs.v2.object.PatchRequest.Body.Patch.source_range:type_name -> neo.fs.v2.object.Range + 51, // 93: neo.fs.v2.object.PatchResponse.Body.object_id:type_name -> neo.fs.v2.refs.ObjectID + 0, // 94: neo.fs.v2.object.ObjectService.Get:input_type -> neo.fs.v2.object.GetRequest + 2, // 95: neo.fs.v2.object.ObjectService.Put:input_type -> neo.fs.v2.object.PutRequest + 4, // 96: neo.fs.v2.object.ObjectService.Delete:input_type -> neo.fs.v2.object.DeleteRequest + 6, // 97: neo.fs.v2.object.ObjectService.Head:input_type -> neo.fs.v2.object.HeadRequest + 9, // 98: neo.fs.v2.object.ObjectService.Search:input_type -> neo.fs.v2.object.SearchRequest + 12, // 99: neo.fs.v2.object.ObjectService.GetRange:input_type -> neo.fs.v2.object.GetRangeRequest + 14, // 100: neo.fs.v2.object.ObjectService.GetRangeHash:input_type -> neo.fs.v2.object.GetRangeHashRequest + 16, // 101: neo.fs.v2.object.ObjectService.PutSingle:input_type -> neo.fs.v2.object.PutSingleRequest + 18, // 102: neo.fs.v2.object.ObjectService.Patch:input_type -> neo.fs.v2.object.PatchRequest + 1, // 103: neo.fs.v2.object.ObjectService.Get:output_type -> neo.fs.v2.object.GetResponse + 3, // 104: neo.fs.v2.object.ObjectService.Put:output_type -> neo.fs.v2.object.PutResponse + 5, // 105: neo.fs.v2.object.ObjectService.Delete:output_type -> neo.fs.v2.object.DeleteResponse + 8, // 106: neo.fs.v2.object.ObjectService.Head:output_type -> neo.fs.v2.object.HeadResponse + 10, // 107: neo.fs.v2.object.ObjectService.Search:output_type -> neo.fs.v2.object.SearchResponse + 13, // 108: neo.fs.v2.object.ObjectService.GetRange:output_type -> neo.fs.v2.object.GetRangeResponse + 15, // 109: neo.fs.v2.object.ObjectService.GetRangeHash:output_type -> neo.fs.v2.object.GetRangeHashResponse + 17, // 110: neo.fs.v2.object.ObjectService.PutSingle:output_type -> neo.fs.v2.object.PutSingleResponse + 19, // 111: neo.fs.v2.object.ObjectService.Patch:output_type -> neo.fs.v2.object.PatchResponse + 103, // [103:112] is the sub-list for method output_type + 94, // [94:103] is the sub-list for method input_type + 94, // [94:94] is the sub-list for extension type_name + 94, // [94:94] is the sub-list for extension extendee + 0, // [0:94] is the sub-list for field type_name } func init() { file_api_object_grpc_service_proto_init() } diff --git a/api/object/grpc/service_protoopaque.pb.go b/api/object/grpc/service_protoopaque.pb.go index 3a389a1..8c74ef0 100644 --- a/api/object/grpc/service_protoopaque.pb.go +++ b/api/object/grpc/service_protoopaque.pb.go @@ -5050,6 +5050,7 @@ type PatchRequest_Body struct { xxx_hidden_Address *grpc1.Address `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` xxx_hidden_NewAttributes *[]*Header_Attribute `protobuf:"bytes,2,rep,name=new_attributes,json=newAttributes" json:"new_attributes,omitempty"` xxx_hidden_ReplaceAttributes bool `protobuf:"varint,3,opt,name=replace_attributes,json=replaceAttributes" json:"replace_attributes,omitempty"` + xxx_hidden_NewSplitHeader *Header_Split `protobuf:"bytes,5,opt,name=new_split_header,json=newSplitHeader" json:"new_split_header,omitempty"` xxx_hidden_Patch *PatchRequest_Body_Patch `protobuf:"bytes,4,opt,name=patch" json:"patch,omitempty"` XXX_raceDetectHookData protoimpl.RaceDetectHookData XXX_presence [1]uint32 @@ -5105,6 +5106,13 @@ func (x *PatchRequest_Body) GetReplaceAttributes() bool { return false } +func (x *PatchRequest_Body) GetNewSplitHeader() *Header_Split { + if x != nil { + return x.xxx_hidden_NewSplitHeader + } + return nil +} + func (x *PatchRequest_Body) GetPatch() *PatchRequest_Body_Patch { if x != nil { return x.xxx_hidden_Patch @@ -5122,7 +5130,11 @@ func (x *PatchRequest_Body) SetNewAttributes(v []*Header_Attribute) { func (x *PatchRequest_Body) SetReplaceAttributes(v bool) { x.xxx_hidden_ReplaceAttributes = v - protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 4) + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 5) +} + +func (x *PatchRequest_Body) SetNewSplitHeader(v *Header_Split) { + x.xxx_hidden_NewSplitHeader = v } func (x *PatchRequest_Body) SetPatch(v *PatchRequest_Body_Patch) { @@ -5143,6 +5155,13 @@ func (x *PatchRequest_Body) HasReplaceAttributes() bool { return protoimpl.X.Present(&(x.XXX_presence[0]), 2) } +func (x *PatchRequest_Body) HasNewSplitHeader() bool { + if x == nil { + return false + } + return x.xxx_hidden_NewSplitHeader != nil +} + func (x *PatchRequest_Body) HasPatch() bool { if x == nil { return false @@ -5159,6 +5178,10 @@ func (x *PatchRequest_Body) ClearReplaceAttributes() { x.xxx_hidden_ReplaceAttributes = false } +func (x *PatchRequest_Body) ClearNewSplitHeader() { + x.xxx_hidden_NewSplitHeader = nil +} + func (x *PatchRequest_Body) ClearPatch() { x.xxx_hidden_Patch = nil } @@ -5179,6 +5202,9 @@ type PatchRequest_Body_builder struct { // merged. If the incoming `new_attributes` list contains already existing // key, then it just replaces it while merging the lists. ReplaceAttributes *bool + // New split header for the object. This defines how the object will relate + // to other objects in a split operation. + NewSplitHeader *Header_Split // The patch that is applied for the object. Patch *PatchRequest_Body_Patch } @@ -5190,9 +5216,10 @@ func (b0 PatchRequest_Body_builder) Build() *PatchRequest_Body { x.xxx_hidden_Address = b.Address x.xxx_hidden_NewAttributes = &b.NewAttributes if b.ReplaceAttributes != nil { - protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 4) + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 5) x.xxx_hidden_ReplaceAttributes = *b.ReplaceAttributes } + x.xxx_hidden_NewSplitHeader = b.NewSplitHeader x.xxx_hidden_Patch = b.Patch return m0 } @@ -5779,7 +5806,7 @@ var file_api_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, 0x22, 0xb3, 0x04, 0x0a, 0x0c, 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, + 0x04, 0x42, 0x6f, 0x64, 0x79, 0x22, 0xfd, 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, @@ -5793,7 +5820,7 @@ var file_api_object_grpc_service_proto_rawDesc = []byte{ 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, + 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x99, 0x03, 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, @@ -5805,87 +5832,92 @@ var file_api_object_grpc_service_proto_rawDesc = []byte{ 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, + 0x48, 0x0a, 0x10, 0x6e, 0x65, 0x77, 0x5f, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x18, 0x05, 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, 0x0e, 0x6e, 0x65, 0x77, 0x53, 0x70, + 0x6c, 0x69, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 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, 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, + 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, 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, + 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, 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, 0x62, 0x5a, 0x43, 0x67, 0x69, 0x74, - 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, - 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, - 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 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, 0x08, 0x65, - 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07, + 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, 0x62, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, + 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x73, 0x64, 0x6b, + 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x70, 0xe8, 0x07, } var file_api_object_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 42) @@ -5948,6 +5980,7 @@ var file_api_object_grpc_service_proto_goTypes = []any{ (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 + (*Header_Split)(nil), // 58: neo.fs.v2.object.Header.Split } var file_api_object_grpc_service_proto_depIdxs = []int32{ 20, // 0: neo.fs.v2.object.GetRequest.body:type_name -> neo.fs.v2.object.GetRequest.Body @@ -6040,32 +6073,33 @@ var file_api_object_grpc_service_proto_depIdxs = []int32{ 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 + 58, // 90: neo.fs.v2.object.PatchRequest.Body.new_split_header:type_name -> neo.fs.v2.object.Header.Split + 40, // 91: neo.fs.v2.object.PatchRequest.Body.patch:type_name -> neo.fs.v2.object.PatchRequest.Body.Patch + 11, // 92: neo.fs.v2.object.PatchRequest.Body.Patch.source_range:type_name -> neo.fs.v2.object.Range + 51, // 93: neo.fs.v2.object.PatchResponse.Body.object_id:type_name -> neo.fs.v2.refs.ObjectID + 0, // 94: neo.fs.v2.object.ObjectService.Get:input_type -> neo.fs.v2.object.GetRequest + 2, // 95: neo.fs.v2.object.ObjectService.Put:input_type -> neo.fs.v2.object.PutRequest + 4, // 96: neo.fs.v2.object.ObjectService.Delete:input_type -> neo.fs.v2.object.DeleteRequest + 6, // 97: neo.fs.v2.object.ObjectService.Head:input_type -> neo.fs.v2.object.HeadRequest + 9, // 98: neo.fs.v2.object.ObjectService.Search:input_type -> neo.fs.v2.object.SearchRequest + 12, // 99: neo.fs.v2.object.ObjectService.GetRange:input_type -> neo.fs.v2.object.GetRangeRequest + 14, // 100: neo.fs.v2.object.ObjectService.GetRangeHash:input_type -> neo.fs.v2.object.GetRangeHashRequest + 16, // 101: neo.fs.v2.object.ObjectService.PutSingle:input_type -> neo.fs.v2.object.PutSingleRequest + 18, // 102: neo.fs.v2.object.ObjectService.Patch:input_type -> neo.fs.v2.object.PatchRequest + 1, // 103: neo.fs.v2.object.ObjectService.Get:output_type -> neo.fs.v2.object.GetResponse + 3, // 104: neo.fs.v2.object.ObjectService.Put:output_type -> neo.fs.v2.object.PutResponse + 5, // 105: neo.fs.v2.object.ObjectService.Delete:output_type -> neo.fs.v2.object.DeleteResponse + 8, // 106: neo.fs.v2.object.ObjectService.Head:output_type -> neo.fs.v2.object.HeadResponse + 10, // 107: neo.fs.v2.object.ObjectService.Search:output_type -> neo.fs.v2.object.SearchResponse + 13, // 108: neo.fs.v2.object.ObjectService.GetRange:output_type -> neo.fs.v2.object.GetRangeResponse + 15, // 109: neo.fs.v2.object.ObjectService.GetRangeHash:output_type -> neo.fs.v2.object.GetRangeHashResponse + 17, // 110: neo.fs.v2.object.ObjectService.PutSingle:output_type -> neo.fs.v2.object.PutSingleResponse + 19, // 111: neo.fs.v2.object.ObjectService.Patch:output_type -> neo.fs.v2.object.PatchResponse + 103, // [103:112] is the sub-list for method output_type + 94, // [94:103] is the sub-list for method input_type + 94, // [94:94] is the sub-list for extension type_name + 94, // [94:94] is the sub-list for extension extendee + 0, // [0:94] is the sub-list for field type_name } func init() { file_api_object_grpc_service_proto_init() } diff --git a/api/object/marshal.go b/api/object/marshal.go index 82e265b..2ed888c 100644 --- a/api/object/marshal.go +++ b/api/object/marshal.go @@ -136,10 +136,11 @@ const ( patchRequestBodyPatchRangeField = 1 patchRequestBodyPatchChunkField = 2 - patchRequestBodyAddrField = 1 - patchRequestBodyNewAttrsField = 2 - patchRequestBodyReplaceAttrField = 3 - patchRequestBodyPatchField = 4 + patchRequestBodyAddrField = 1 + patchRequestBodyNewAttrsField = 2 + patchRequestBodyReplaceAttrField = 3 + patchRequestBodyPatchField = 4 + patchRequestBodyNewSplitHeaderField = 5 patchResponseBodyObjectIDField = 1 ) @@ -1372,7 +1373,8 @@ func (r *PatchRequestBody) StableMarshal(buf []byte) []byte { 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.NestedStructureMarshal(patchRequestBodyPatchField, buf[offset:], r.patch) + proto.NestedStructureMarshal(patchRequestBodyNewSplitHeaderField, buf[offset:], r.newSplitHeader) return buf } @@ -1389,6 +1391,7 @@ func (r *PatchRequestBody) StableSize() int { } size += proto.BoolSize(patchRequestBodyReplaceAttrField, r.replaceAttributes) size += proto.NestedStructureSize(patchRequestBodyPatchField, r.patch) + size += proto.NestedStructureSize(patchRequestBodyNewSplitHeaderField, r.newSplitHeader) return size } diff --git a/api/object/types.go b/api/object/types.go index 537fb02..57a93ce 100644 --- a/api/object/types.go +++ b/api/object/types.go @@ -360,6 +360,8 @@ type PatchRequestBody struct { newAttributes []Attribute + newSplitHeader *SplitHeader + replaceAttributes bool patch *PatchRequestBodyPatch @@ -1591,6 +1593,14 @@ func (r *PatchRequestBody) SetReplaceAttributes(replace bool) { r.replaceAttributes = replace } +func (r *PatchRequestBody) SetNewSplitHeader(newSplitHeader *SplitHeader) { + r.newSplitHeader = newSplitHeader +} + +func (r *PatchRequestBody) GetNewSplitHeader() *SplitHeader { + return r.newSplitHeader +} + func (r *PatchRequestBody) GetPatch() *PatchRequestBodyPatch { if r != nil { return r.patch From 76265fe9be7ff9e04fea173511205adf2426de4d Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Wed, 26 Mar 2025 13:10:54 +0300 Subject: [PATCH 178/197] [#349] object: Introduce `SplitHeader` type * Also introduce `SplitHeader` getter and `SetSplitHeader` setter for `Object` type. Signed-off-by: Airat Arifullin --- object/object.go | 26 +++++++++ object/split_header.go | 124 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 150 insertions(+) create mode 100644 object/split_header.go diff --git a/object/object.go b/object/object.go index b98685d..ed551b5 100644 --- a/object/object.go +++ b/object/object.go @@ -345,6 +345,32 @@ func (o *Object) SetAttributes(v ...Attribute) { }) } +// SplitHeader returns split header of the object. If it's set, then split header +// defines how the object relates to other objects in a split operation. +func (o *Object) SplitHeader() (splitHeader *SplitHeader) { + if v2 := (*object.Object)(o). + GetHeader(). + GetSplit(); v2 != nil { + splitHeader = NewSplitHeaderFromV2(v2) + } + + return +} + +// SetSplitHeader sets split header. +func (o *Object) SetSplitHeader(v *SplitHeader) { + o.setSplitFields(func(sh *object.SplitHeader) { + v2 := v.ToV2() + + sh.SetParent(v2.GetParent()) + sh.SetPrevious(v2.GetPrevious()) + sh.SetParentHeader(v2.GetParentHeader()) + sh.SetParentSignature(v2.GetParentSignature()) + sh.SetChildren(v2.GetChildren()) + sh.SetSplitID(v2.GetSplitID()) + }) +} + // PreviousID returns identifier of the previous sibling object. func (o *Object) PreviousID() (v oid.ID, isSet bool) { v2 := (*object.Object)(o) diff --git a/object/split_header.go b/object/split_header.go new file mode 100644 index 0000000..5cbc214 --- /dev/null +++ b/object/split_header.go @@ -0,0 +1,124 @@ +package object + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" + frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto" + oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" +) + +// SplitHeader is an object's header component that defines the relationship +// between this object and other objects if the object is part of a split operation. +type SplitHeader object.SplitHeader + +// NewSplitHeaderFromV2 wraps v2 SplitHeader message to SplitHeader. +func NewSplitHeaderFromV2(v2 *object.SplitHeader) *SplitHeader { + return (*SplitHeader)(v2) +} + +// NewSplitHeader creates blank SplitHeader instance. +func NewSplitHeader() *SplitHeader { + return NewSplitHeaderFromV2(new(object.SplitHeader)) +} + +func (sh *SplitHeader) ToV2() *object.SplitHeader { + return (*object.SplitHeader)(sh) +} + +func (sh *SplitHeader) ParentID() (v oid.ID, isSet bool) { + v2 := (*object.SplitHeader)(sh) + if id := v2.GetParent(); id != nil { + _ = v.ReadFromV2(*id) + isSet = true + } + + return +} + +func (sh *SplitHeader) SetParentID(v oid.ID) { + v2 := new(refs.ObjectID) + v.WriteToV2(v2) + (*object.SplitHeader)(sh).SetParent(v2) +} + +func (sh *SplitHeader) PreviousID() (v oid.ID, isSet bool) { + v2 := (*object.SplitHeader)(sh) + if id := v2.GetPrevious(); id != nil { + _ = v.ReadFromV2(*id) + isSet = true + } + + return +} + +func (sh *SplitHeader) SetPreviousID(v oid.ID) { + v2 := new(refs.ObjectID) + v.WriteToV2(v2) + (*object.SplitHeader)(sh).SetPrevious(v2) +} + +func (sh *SplitHeader) ParentSignature() *frostfscrypto.Signature { + v2 := (*object.SplitHeader)(sh) + if parSigV2 := v2.GetParentSignature(); parSigV2 != nil { + parSig := new(frostfscrypto.Signature) + _ = parSig.ReadFromV2(*parSigV2) + } + + return nil +} + +func (sh *SplitHeader) SetParentSignature(v *frostfscrypto.Signature) { + var parSigV2 *refs.Signature + + if v != nil { + parSigV2 = new(refs.Signature) + v.WriteToV2(parSigV2) + } + + (*object.SplitHeader)(sh).SetParentSignature(parSigV2) +} + +func (sh *SplitHeader) ParentHeader() (parentHeader *Object) { + v2 := (*object.SplitHeader)(sh) + + if parHdr := v2.GetParentHeader(); parHdr != nil { + parentHeader = New() + parentHeader.setHeaderField(func(h *object.Header) { + *h = *v2.GetParentHeader() + }) + } + + return +} + +func (sh *SplitHeader) SetParentHeader(parentHeader *Object) { + (*object.SplitHeader)(sh).SetParentHeader(parentHeader.ToV2().GetHeader()) +} + +func (sh *SplitHeader) Children() (res []oid.ID) { + v2 := (*object.SplitHeader)(sh) + if children := v2.GetChildren(); len(children) > 0 { + res = make([]oid.ID, len(children)) + for i := range children { + _ = res[i].ReadFromV2(children[i]) + } + } + + return +} + +func (sh *SplitHeader) SetChildren(children []oid.ID) { + v2Children := make([]refs.ObjectID, len(children)) + for i := range children { + children[i].WriteToV2(&v2Children[i]) + } + (*object.SplitHeader)(sh).SetChildren(v2Children) +} + +func (sh *SplitHeader) SplitID() *SplitID { + return NewSplitIDFromV2((*object.SplitHeader)(sh).GetSplitID()) +} + +func (sh *SplitHeader) SetSplitID(v *SplitID) { + (*object.SplitHeader)(sh).SetSplitID(v.ToV2()) +} From 4d36a49d3945937f55d1bbc94915f1e20cd27ed3 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Wed, 26 Mar 2025 13:11:41 +0300 Subject: [PATCH 179/197] [#349] object: Make patcher apply patching for split header * Change `PatchApplier` interface: `ApplyAttributesPatch` -> `ApplyHeaderPatch`. Make `ApplyHeaderPatch` receive `ApplyHeaderPatchPrm` as parameter; * Fix `patcher`: apply patch for split header; * Fix `patcher` unit-tests. Add test-case for split header; * Extend `Patch` struct with `NewSplitHeader`; * Change `ObjectPatcher` interface for client: `PatchAttributes` -> `PatchHeader`. Fix `objectPatcher`. * Fix object transformer: since object header sets `SplitHeader` if it's passed. Signed-off-by: Airat Arifullin --- client/object_patch.go | 27 ++++- client/object_patch_test.go | 2 +- object/patch.go | 8 ++ object/patcher/patcher.go | 68 +++++++++++-- object/patcher/patcher_test.go | 163 ++++++++++++++++++++++++++++-- object/transformer/transformer.go | 11 +- 6 files changed, 259 insertions(+), 20 deletions(-) diff --git a/client/object_patch.go b/client/object_patch.go index 6930644..87033c5 100644 --- a/client/object_patch.go +++ b/client/object_patch.go @@ -26,11 +26,19 @@ import ( // usage is unsafe. type ObjectPatcher interface { // PatchAttributes patches attributes. Attributes can be patched no more than once, - // otherwise, the server returns an error. + // otherwise, the server returns an error. `PatchAttributes` and `PatchHeader` are mutually + // exclusive - only one method can be used. // // Result means success. Failure reason can be received via Close. PatchAttributes(ctx context.Context, newAttrs []object.Attribute, replace bool) bool + // PatchHeader patches object's header. Header can be patched no more than once, + // otherwise, the server returns an error. `PatchAttributes` and `PatchHeader` are mutually + // exclusive - only one method can be used. + // + // Result means success. Failure reason can be received via Close. + PatchHeader(ctx context.Context, prm PatchHeaderPrm) bool + // PatchPayload patches the object's payload. // // PatchPayload receives `payloadReader` and thus the payload of the patch is read and sent by chunks of @@ -60,6 +68,14 @@ type ObjectPatcher interface { Close(_ context.Context) (*ResObjectPatch, error) } +type PatchHeaderPrm struct { + NewSplitHeader *object.SplitHeader + + NewAttributes []object.Attribute + + ReplaceAttributes bool +} + // ResObjectPatch groups resulting values of ObjectPatch operation. type ResObjectPatch struct { statusRes @@ -163,6 +179,15 @@ func (x *objectPatcher) PatchAttributes(_ context.Context, newAttrs []object.Att }) } +func (x *objectPatcher) PatchHeader(_ context.Context, prm PatchHeaderPrm) bool { + return x.patch(&object.Patch{ + Address: x.addr, + NewAttributes: prm.NewAttributes, + ReplaceAttributes: prm.ReplaceAttributes, + NewSplitHeader: prm.NewSplitHeader, + }) +} + func (x *objectPatcher) PatchPayload(_ context.Context, rng *object.Range, payloadReader io.Reader) bool { offset := rng.GetOffset() diff --git a/client/object_patch_test.go b/client/object_patch_test.go index 63996b6..3e801f3 100644 --- a/client/object_patch_test.go +++ b/client/object_patch_test.go @@ -177,7 +177,7 @@ func TestObjectPatcher(t *testing.T) { maxChunkLen: test.maxChunkLen, } - success := patcher.PatchAttributes(context.Background(), nil, false) + success := patcher.PatchHeader(context.Background(), PatchHeaderPrm{}) require.True(t, success) success = patcher.PatchPayload(context.Background(), test.rng, bytes.NewReader([]byte(test.patchPayload))) diff --git a/object/patch.go b/object/patch.go index 2a06674..9c6ddc4 100644 --- a/object/patch.go +++ b/object/patch.go @@ -18,6 +18,10 @@ type Patch struct { // filled with NewAttributes. Otherwise, the attributes are just merged. ReplaceAttributes bool + // A new split header which is set to object's header. If `nil`, then split header patching + // is ignored. + NewSplitHeader *SplitHeader + // Payload patch. If this field is not set, then it assumed such Patch patches only // header (see NewAttributes, ReplaceAttributes). PayloadPatch *PayloadPatch @@ -41,6 +45,8 @@ func (p *Patch) ToV2() *v2object.PatchRequestBody { v2.SetNewAttributes(attrs) v2.SetReplaceAttributes(p.ReplaceAttributes) + v2.SetNewSplitHeader(p.NewSplitHeader.ToV2()) + v2.SetPatch(p.PayloadPatch.ToV2()) return v2 @@ -63,6 +69,8 @@ func (p *Patch) FromV2(patch *v2object.PatchRequestBody) { p.ReplaceAttributes = patch.GetReplaceAttributes() + p.NewSplitHeader = NewSplitHeaderFromV2(patch.GetNewSplitHeader()) + if v2patch := patch.GetPatch(); v2patch != nil { p.PayloadPatch = new(PayloadPatch) p.PayloadPatch.FromV2(v2patch) diff --git a/object/patcher/patcher.go b/object/patcher/patcher.go index aad1f2a..66df9d3 100644 --- a/object/patcher/patcher.go +++ b/object/patcher/patcher.go @@ -11,10 +11,12 @@ import ( ) var ( - ErrOffsetExceedsSize = errors.New("patch offset exceeds object size") - ErrInvalidPatchOffsetOrder = errors.New("invalid patch offset order") - ErrPayloadPatchIsNil = errors.New("nil payload patch") - ErrAttrPatchAlreadyApplied = errors.New("attribute patch already applied") + ErrOffsetExceedsSize = errors.New("patch offset exceeds object size") + ErrInvalidPatchOffsetOrder = errors.New("invalid patch offset order") + ErrPayloadPatchIsNil = errors.New("nil payload patch") + ErrAttrPatchAlreadyApplied = errors.New("attribute patch already applied") + ErrHeaderPatchAlreadyApplied = errors.New("header patch already applied") + ErrSplitHeaderPatchAppliedWithPayloadPatch = errors.New("split header patch applied with payload patch") ) // PatchRes is the result of patch application. @@ -27,13 +29,24 @@ type PatchApplier interface { // ApplyAttributesPatch applies the patch only for the object's attributes. // // ApplyAttributesPatch can't be invoked few times, otherwise it returns `ErrAttrPatchAlreadyApplied` error. + // `ApplyHeaderPatch` and `ApplyAttributesPatch` are mutually exclusive - only one method can be used. // // The call is idempotent for the original header if it's invoked with empty `newAttrs` and // `replaceAttrs = false`. ApplyAttributesPatch(ctx context.Context, newAttrs []objectSDK.Attribute, replaceAttrs bool) error + // ApplyHeaderPatch applies the patch only for the object's attributes. + // + // ApplyHeaderPatch can't be invoked few times, otherwise it returns `ErrHeaderPatchAlreadyApplied` error. + // `ApplyHeaderPatch` and `ApplyAttributesPatch` are mutually exclusive - only one method can be used. + // + // The call is idempotent for the original header if it's invoked with `ApplyHeaderPatchPrm` with not set fields. + ApplyHeaderPatch(ctx context.Context, prm ApplyHeaderPatchPrm) error + // ApplyPayloadPatch applies the patch for the object's payload. // + // ApplyPayloadPatch returns `ErrSplitHeaderPatchAppliedWithPayloadPatch` when attempting to apply it with a split header patch. + // // ApplyPayloadPatch returns `ErrPayloadPatchIsNil` error if patch is nil. ApplyPayloadPatch(ctx context.Context, payloadPatch *objectSDK.PayloadPatch) error @@ -41,6 +54,14 @@ type PatchApplier interface { Close(context.Context) (PatchRes, error) } +type ApplyHeaderPatchPrm struct { + NewSplitHeader *objectSDK.SplitHeader + + NewAttributes []objectSDK.Attribute + + ReplaceAttributes bool +} + // RangeProvider is the interface that provides a method to get original object payload // by a given range. type RangeProvider interface { @@ -61,7 +82,9 @@ type patcher struct { hdr *objectSDK.Object - attrPatchAlreadyApplied bool + hdrPatchAlreadyApplied bool + + splitHeaderPatchAlreadyApplied bool readerBuffSize int } @@ -107,10 +130,10 @@ func New(prm Params) PatchApplier { func (p *patcher) ApplyAttributesPatch(ctx context.Context, newAttrs []objectSDK.Attribute, replaceAttrs bool) error { defer func() { - p.attrPatchAlreadyApplied = true + p.hdrPatchAlreadyApplied = true }() - if p.attrPatchAlreadyApplied { + if p.hdrPatchAlreadyApplied { return ErrAttrPatchAlreadyApplied } @@ -127,7 +150,38 @@ func (p *patcher) ApplyAttributesPatch(ctx context.Context, newAttrs []objectSDK return nil } +func (p *patcher) ApplyHeaderPatch(ctx context.Context, prm ApplyHeaderPatchPrm) error { + defer func() { + p.hdrPatchAlreadyApplied = true + }() + + if p.hdrPatchAlreadyApplied { + return ErrHeaderPatchAlreadyApplied + } + + if prm.NewSplitHeader != nil { + p.hdr.SetSplitHeader(prm.NewSplitHeader) + + p.splitHeaderPatchAlreadyApplied = true + } + + if prm.ReplaceAttributes { + p.hdr.SetAttributes(prm.NewAttributes...) + } else if len(prm.NewAttributes) > 0 { + mergedAttrs := mergeAttributes(prm.NewAttributes, p.hdr.Attributes()) + p.hdr.SetAttributes(mergedAttrs...) + } + + if err := p.objectWriter.WriteHeader(ctx, p.hdr); err != nil { + return fmt.Errorf("writer header: %w", err) + } + return nil +} + func (p *patcher) ApplyPayloadPatch(ctx context.Context, payloadPatch *objectSDK.PayloadPatch) error { + if p.splitHeaderPatchAlreadyApplied { + return ErrSplitHeaderPatchAppliedWithPayloadPatch + } if payloadPatch == nil { return ErrPayloadPatchIsNil } diff --git a/object/patcher/patcher_test.go b/object/patcher/patcher_test.go index 3abb939..4819b59 100644 --- a/object/patcher/patcher_test.go +++ b/object/patcher/patcher_test.go @@ -106,7 +106,11 @@ func TestPatchRevert(t *testing.T) { patcher := New(prm) - err := patcher.ApplyAttributesPatch(context.Background(), modifPatch.NewAttributes, modifPatch.ReplaceAttributes) + err := patcher.ApplyHeaderPatch(context.Background(), ApplyHeaderPatchPrm{ + NewSplitHeader: modifPatch.NewSplitHeader, + NewAttributes: modifPatch.NewAttributes, + ReplaceAttributes: modifPatch.ReplaceAttributes, + }) require.NoError(t, err) err = patcher.ApplyPayloadPatch(context.Background(), modifPatch.PayloadPatch) @@ -145,7 +149,11 @@ func TestPatchRevert(t *testing.T) { patcher = New(prm) - err = patcher.ApplyAttributesPatch(context.Background(), revertPatch.NewAttributes, revertPatch.ReplaceAttributes) + err = patcher.ApplyHeaderPatch(context.Background(), ApplyHeaderPatchPrm{ + NewSplitHeader: revertPatch.NewSplitHeader, + NewAttributes: revertPatch.NewAttributes, + ReplaceAttributes: revertPatch.ReplaceAttributes, + }) require.NoError(t, err) err = patcher.ApplyPayloadPatch(context.Background(), revertPatch.PayloadPatch) @@ -157,7 +165,7 @@ func TestPatchRevert(t *testing.T) { require.Equal(t, originalObjectPayload, patchedPatchedObj.Payload()) } -func TestPatchRepeatAttributePatch(t *testing.T) { +func TestPatchRepeatHeaderPatch(t *testing.T) { obj, _ := newTestObject() modifPatch := &objectSDK.Patch{} @@ -187,11 +195,142 @@ func TestPatchRepeatAttributePatch(t *testing.T) { patcher := New(prm) - err := patcher.ApplyAttributesPatch(context.Background(), modifPatch.NewAttributes, modifPatch.ReplaceAttributes) + err := patcher.ApplyHeaderPatch(context.Background(), ApplyHeaderPatchPrm{ + NewSplitHeader: modifPatch.NewSplitHeader, + NewAttributes: modifPatch.NewAttributes, + ReplaceAttributes: modifPatch.ReplaceAttributes, + }) require.NoError(t, err) - err = patcher.ApplyAttributesPatch(context.Background(), modifPatch.NewAttributes, modifPatch.ReplaceAttributes) - require.ErrorIs(t, err, ErrAttrPatchAlreadyApplied) + err = patcher.ApplyHeaderPatch(context.Background(), ApplyHeaderPatchPrm{ + NewSplitHeader: modifPatch.NewSplitHeader, + NewAttributes: modifPatch.NewAttributes, + ReplaceAttributes: modifPatch.ReplaceAttributes, + }) + require.ErrorIs(t, err, ErrHeaderPatchAlreadyApplied) +} + +func TestPatchSplitHeader(t *testing.T) { + obj, _ := newTestObject() + + const ( + splitIDStr = "a59c9f87-14bc-4a61-95d1-7eb10f036163" + parentStr = "9cRjAaPqUt5zaDAjBkSCqFfPdkE8dHJ7mtRupRjPWp6E" + previosStr = "6WaTd9HobT4Z52NnKWHAtjqtQu2Ww5xZwNdT4ptshkKE" + ) + + splitID := objectSDK.NewSplitID() + require.NoError(t, splitID.Parse(splitIDStr)) + + var par, prev oid.ID + require.NoError(t, par.DecodeString(parentStr)) + require.NoError(t, prev.DecodeString(previosStr)) + + splitHdr := objectSDK.NewSplitHeader() + splitHdr.SetSplitID(splitID) + splitHdr.SetParentID(par) + splitHdr.SetPreviousID(prev) + + originalObjectPayload := []byte("*******************") + + obj.SetPayload(originalObjectPayload) + obj.SetPayloadSize(uint64(len(originalObjectPayload))) + + rangeProvider := &mockRangeProvider{ + originalObjectPayload: originalObjectPayload, + } + + t.Run("no payload patch", func(t *testing.T) { + patchedObj, _ := newTestObject() + + wr := &mockPatchedObjectWriter{ + obj: patchedObj, + } + + modifPatch := &objectSDK.Patch{ + NewSplitHeader: splitHdr, + } + + prm := Params{ + Header: obj.CutPayload(), + + RangeProvider: rangeProvider, + + ObjectWriter: wr, + } + + patcher := New(prm) + + err := patcher.ApplyHeaderPatch(context.Background(), ApplyHeaderPatchPrm{ + NewSplitHeader: modifPatch.NewSplitHeader, + NewAttributes: modifPatch.NewAttributes, + ReplaceAttributes: modifPatch.ReplaceAttributes, + }) + require.NoError(t, err) + + splitHdrFromPatchedObj := patchedObj.SplitHeader() + require.NotNil(t, splitHdrFromPatchedObj) + + patchObjParID, isSet := splitHdrFromPatchedObj.ParentID() + require.True(t, isSet) + require.True(t, patchObjParID.Equals(par)) + + patchObjPrevID, isSet := splitHdrFromPatchedObj.PreviousID() + require.True(t, isSet) + require.True(t, patchObjPrevID.Equals(prev)) + + require.Equal(t, splitHdrFromPatchedObj.SplitID().String(), splitID.String()) + }) + + t.Run("with payload patch", func(t *testing.T) { + patchedObj, _ := newTestObject() + + wr := &mockPatchedObjectWriter{ + obj: patchedObj, + } + + modifPatch := &objectSDK.Patch{ + NewSplitHeader: splitHdr, + PayloadPatch: &objectSDK.PayloadPatch{ + Range: rangeWithOffestWithLength(10, 0), + Chunk: []byte(""), + }, + } + + prm := Params{ + Header: obj.CutPayload(), + + RangeProvider: rangeProvider, + + ObjectWriter: wr, + } + + patcher := New(prm) + + err := patcher.ApplyHeaderPatch(context.Background(), ApplyHeaderPatchPrm{ + NewSplitHeader: modifPatch.NewSplitHeader, + NewAttributes: modifPatch.NewAttributes, + ReplaceAttributes: modifPatch.ReplaceAttributes, + }) + require.NoError(t, err) + + splitHdrFromPatchedObj := patchedObj.SplitHeader() + require.NotNil(t, splitHdrFromPatchedObj) + + patchObjParID, isSet := splitHdrFromPatchedObj.ParentID() + require.True(t, isSet) + require.True(t, patchObjParID.Equals(par)) + + patchObjPrevID, isSet := splitHdrFromPatchedObj.PreviousID() + require.True(t, isSet) + require.True(t, patchObjPrevID.Equals(prev)) + + require.Equal(t, splitHdrFromPatchedObj.SplitID().String(), splitID.String()) + + err = patcher.ApplyPayloadPatch(context.Background(), modifPatch.PayloadPatch) + require.Error(t, err, ErrSplitHeaderPatchAppliedWithPayloadPatch) + }) + } func TestPatchEmptyPayloadPatch(t *testing.T) { @@ -224,7 +363,11 @@ func TestPatchEmptyPayloadPatch(t *testing.T) { patcher := New(prm) - err := patcher.ApplyAttributesPatch(context.Background(), modifPatch.NewAttributes, modifPatch.ReplaceAttributes) + err := patcher.ApplyHeaderPatch(context.Background(), ApplyHeaderPatchPrm{ + NewSplitHeader: modifPatch.NewSplitHeader, + NewAttributes: modifPatch.NewAttributes, + ReplaceAttributes: modifPatch.ReplaceAttributes, + }) require.NoError(t, err) err = patcher.ApplyPayloadPatch(context.Background(), nil) @@ -599,7 +742,11 @@ func TestPatch(t *testing.T) { for i, patch := range test.patches { if i == 0 { - _ = patcher.ApplyAttributesPatch(context.Background(), patch.NewAttributes, patch.ReplaceAttributes) + _ = patcher.ApplyHeaderPatch(context.Background(), ApplyHeaderPatchPrm{ + NewSplitHeader: patch.NewSplitHeader, + NewAttributes: patch.NewAttributes, + ReplaceAttributes: patch.ReplaceAttributes, + }) } if patch.PayloadPatch == nil { diff --git a/object/transformer/transformer.go b/object/transformer/transformer.go index ce5259f..b4695ee 100644 --- a/object/transformer/transformer.go +++ b/object/transformer/transformer.go @@ -116,9 +116,14 @@ func fromObject(obj *object.Object) *object.Object { res.SetAttributes(obj.Attributes()...) res.SetType(obj.Type()) - // obj.SetSplitID creates splitHeader but we don't need to do it in case - // of small objects, so we should make nil check. - if obj.SplitID() != nil { + // There are two ways to specify split information: + // 1. Using explicit SplitHeader. Thus, we only propagate whole split information + // if it's already set in the source object (use-case: Patch method). + // 2. Using SplitID - will automatically generate a SplitHeader, but this is not requiered for + // small objects. + if obj.SplitHeader() != nil { + res.SetSplitHeader(obj.SplitHeader()) + } else if obj.SplitID() != nil { res.SetSplitID(obj.SplitID()) } From 5be341596199704033746e1568922b85efb9f41e Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 4 Apr 2025 16:51:51 +0300 Subject: [PATCH 180/197] [#345] go.mod: Bump min go version to 1.23 Signed-off-by: Evgenii Stratonikov --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 1cca977..5ee242b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go -go 1.22 +go 1.23 require ( git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e From b27f172de9dbb3079c3106b41beac14c32071402 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 4 Apr 2025 17:14:27 +0300 Subject: [PATCH 181/197] [#345] netmap: Implement an iterator over node endpoints Signed-off-by: Evgenii Stratonikov --- api/netmap/types.go | 13 +++++++++++++ netmap/node_info.go | 17 ++++++++++++++++- netmap/node_info_test.go | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 1 deletion(-) diff --git a/api/netmap/types.go b/api/netmap/types.go index 38810ab..67c3e01 100644 --- a/api/netmap/types.go +++ b/api/netmap/types.go @@ -2,6 +2,7 @@ package netmap import ( "bytes" + "iter" "slices" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs" @@ -442,10 +443,22 @@ func (ni *NodeInfo) NumberOfAddresses() int { return 0 } +// Addresses returns an iterator over network addresses of the node. +func (ni NodeInfo) Addresses() iter.Seq[string] { + return func(yield func(string) bool) { + for i := range ni.addresses { + if !yield(ni.addresses[i]) { + break + } + } + } +} + // IterateAddresses iterates over network addresses of the node. // Breaks iteration on f's true return. // // Handler should not be nil. +// Deprecated: use [NodeInfo.Addresses] instead. func (ni *NodeInfo) IterateAddresses(f func(string) bool) { if ni != nil { for i := range ni.addresses { diff --git a/netmap/node_info.go b/netmap/node_info.go index a792337..a596b2b 100644 --- a/netmap/node_info.go +++ b/netmap/node_info.go @@ -3,6 +3,7 @@ package netmap import ( "errors" "fmt" + "iter" "slices" "strconv" "strings" @@ -200,12 +201,26 @@ func (x NodeInfo) NumberOfNetworkEndpoints() int { // FrostFS system requirements. // // See also SetNetworkEndpoints. +// Deprecated: use [NodeInfo.NetworkEndpoints] instead. func (x NodeInfo) IterateNetworkEndpoints(f func(string) bool) { - x.m.IterateAddresses(f) + for s := range x.NetworkEndpoints() { + if f(s) { + return + } + } +} + +// NetworkEndpoints returns an iterator over network endpoints announced by the +// node. +// +// See also SetNetworkEndpoints. +func (x NodeInfo) NetworkEndpoints() iter.Seq[string] { + return x.m.Addresses() } // IterateNetworkEndpoints is an extra-sugared function over IterateNetworkEndpoints // method which allows to unconditionally iterate over all node's network endpoints. +// Deprecated: use [NodeInfo.NetworkEndpoints] instead. func IterateNetworkEndpoints(node NodeInfo, f func(string)) { node.IterateNetworkEndpoints(func(addr string) bool { f(addr) diff --git a/netmap/node_info_test.go b/netmap/node_info_test.go index 965213e..8ef9516 100644 --- a/netmap/node_info_test.go +++ b/netmap/node_info_test.go @@ -7,6 +7,45 @@ import ( "github.com/stretchr/testify/require" ) +func TestNodeInfo_NetworkEndpoints(t *testing.T) { + t.Run("empty", func(t *testing.T) { + var n NodeInfo + for range n.NetworkEndpoints() { + t.Fatalf("handler is called, but it shouldn't") + } + }) + + var n NodeInfo + n.SetNetworkEndpoints("1", "2", "3") + + t.Run("break", func(t *testing.T) { + var res []string + for s := range n.NetworkEndpoints() { + if s == "2" { + break + } + res = append(res, s) + } + require.Equal(t, []string{"1"}, res) + }) + t.Run("continue", func(t *testing.T) { + var res []string + for s := range n.NetworkEndpoints() { + if s == "2" { + continue + } + res = append(res, s) + } + require.Equal(t, []string{"1", "3"}, res) + }) + + var res []string + for s := range n.NetworkEndpoints() { + res = append(res, s) + } + require.Equal(t, []string{"1", "2", "3"}, res) +} + func TestNodeInfo_SetAttribute(t *testing.T) { var n NodeInfo From 4b9b54a901742c8b15c36621f55fc1378509118e Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 4 Apr 2025 17:24:59 +0300 Subject: [PATCH 182/197] [#345] netmap: Implement an iterator over node attributes Signed-off-by: Evgenii Stratonikov --- netmap/node_info.go | 13 +++++++++++++ netmap/node_info_test.go | 41 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/netmap/node_info.go b/netmap/node_info.go index a596b2b..acbfaee 100644 --- a/netmap/node_info.go +++ b/netmap/node_info.go @@ -408,8 +408,21 @@ func (x NodeInfo) NumberOfAttributes() int { return len(x.m.GetAttributes()) } +// Attributes returns an iterator over node attributes. +func (x NodeInfo) Attributes() iter.Seq2[string, string] { + return func(yield func(string, string) bool) { + a := x.m.GetAttributes() + for i := range a { + if !yield(a[i].GetKey(), a[i].GetValue()) { + break + } + } + } +} + // IterateAttributes iterates over all node attributes and passes the into f. // Handler MUST NOT be nil. +// Deprecated: use [NodeInfo.Attributes] instead. func (x NodeInfo) IterateAttributes(f func(key, value string)) { a := x.m.GetAttributes() for i := range a { diff --git a/netmap/node_info_test.go b/netmap/node_info_test.go index 8ef9516..990cc26 100644 --- a/netmap/node_info_test.go +++ b/netmap/node_info_test.go @@ -46,6 +46,47 @@ func TestNodeInfo_NetworkEndpoints(t *testing.T) { require.Equal(t, []string{"1", "2", "3"}, res) } +func TestNodeInfo_Attributes(t *testing.T) { + t.Run("empty", func(t *testing.T) { + var n NodeInfo + for range n.Attributes() { + t.Fatalf("handler is called, but it shouldn't") + } + }) + + var n NodeInfo + n.SetAttribute("key1", "value1") + n.SetAttribute("key2", "value2") + n.SetAttribute("key3", "value3") + + t.Run("break", func(t *testing.T) { + var res [][2]string + for k, v := range n.Attributes() { + if k == "key2" { + break + } + res = append(res, [2]string{k, v}) + } + require.Equal(t, [][2]string{{"key1", "value1"}}, res) + }) + t.Run("continue", func(t *testing.T) { + var res [][2]string + for k, v := range n.Attributes() { + if k == "key2" { + continue + } + res = append(res, [2]string{k, v}) + } + require.Equal(t, [][2]string{{"key1", "value1"}, {"key3", "value3"}}, res) + }) + + var res [][2]string + for k, v := range n.Attributes() { + res = append(res, [2]string{k, v}) + } + require.Equal(t, [][2]string{{"key1", "value1"}, {"key2", "value2"}, {"key3", "value3"}}, res) +} + func TestNodeInfo_SetAttribute(t *testing.T) { var n NodeInfo From 6458c11e833d31950f9f490d5d50e155937226a2 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 4 Apr 2025 17:26:10 +0300 Subject: [PATCH 183/197] [#345] api/netmap: Drop deprecated single-address methods Signed-off-by: Evgenii Stratonikov --- api/netmap/types.go | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/api/netmap/types.go b/api/netmap/types.go index 67c3e01..9d9fa09 100644 --- a/api/netmap/types.go +++ b/api/netmap/types.go @@ -410,25 +410,6 @@ func (ni *NodeInfo) SetPublicKey(v []byte) { ni.publicKey = v } -// GetAddress returns node's network address. -// -// Deprecated: use IterateAddresses. -func (ni *NodeInfo) GetAddress() (addr string) { - ni.IterateAddresses(func(s string) bool { - addr = s - return true - }) - - return -} - -// SetAddress sets node's network address. -// -// Deprecated: use SetAddresses. -func (ni *NodeInfo) SetAddress(v string) { - ni.SetAddresses(v) -} - // SetAddresses sets list of network addresses of the node. func (ni *NodeInfo) SetAddresses(v ...string) { ni.addresses = v From fb999fecac413a63cd2d7fb3058db3dc913d705c Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Sat, 5 Apr 2025 11:35:42 +0300 Subject: [PATCH 184/197] [#357] netmap: Provide slice to append to in flattenNodes() 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-sdk-go/netmap cpu: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz │ old │ new │ │ sec/op │ sec/op vs base │ Netmap_ContainerNodes/REP_2-8 5.867µ ± 1% 5.821µ ± 0% -0.79% (p=0.000 n=10) Netmap_ContainerNodes/REP_2_IN_X_CBF_2_SELECT_2_FROM_*_AS_X-8 5.786µ ± 2% 5.810µ ± 1% ~ (p=1.000 n=10) geomean 5.826µ 5.815µ -0.19% │ old │ new │ │ B/op │ B/op vs base │ Netmap_ContainerNodes/REP_2-8 7.609Ki ± 0% 7.328Ki ± 0% -3.70% (p=0.000 n=10) Netmap_ContainerNodes/REP_2_IN_X_CBF_2_SELECT_2_FROM_*_AS_X-8 7.031Ki ± 0% 6.859Ki ± 0% -2.44% (p=0.000 n=10) geomean 7.315Ki 7.090Ki -3.07% │ old │ new │ │ allocs/op │ allocs/op vs base │ Netmap_ContainerNodes/REP_2-8 77.00 ± 0% 77.00 ± 0% ~ (p=1.000 n=10) ¹ Netmap_ContainerNodes/REP_2_IN_X_CBF_2_SELECT_2_FROM_*_AS_X-8 77.00 ± 0% 77.00 ± 0% ~ (p=1.000 n=10) ¹ geomean 77.00 77.00 +0.00% ¹ all samples are equal ``` Signed-off-by: Evgenii Stratonikov --- netmap/netmap.go | 22 +++++++--------------- netmap/selector_test.go | 2 +- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/netmap/netmap.go b/netmap/netmap.go index b119f07..a583455 100644 --- a/netmap/netmap.go +++ b/netmap/netmap.go @@ -139,20 +139,12 @@ func (n nodes) appendWeightsTo(wf weightFunc, w []float64) []float64 { return w } -func flattenNodes(ns []nodes) nodes { - var sz, i int - - for i = range ns { - sz += len(ns[i]) - } - - result := make(nodes, 0, sz) - +// flattenNodes flattens ns nested list and appends the result to the target slice. +func flattenNodes(target nodes, ns []nodes) nodes { for i := range ns { - result = append(result, ns[i]...) + target = append(target, ns[i]...) } - - return result + return target } // PlacementVectors sorts container nodes returned by ContainerNodes method @@ -287,7 +279,7 @@ func (m NetMap) ContainerNodes(p PlacementPolicy, pivot []byte) ([][]NodeInfo, e return nil, err } - result[i] = append(result[i], flattenNodes(nodes)...) + result[i] = flattenNodes(result[i], nodes) if unique { c.addUsedNodes(result[i]...) @@ -304,14 +296,14 @@ func (m NetMap) ContainerNodes(p PlacementPolicy, pivot []byte) ([][]NodeInfo, e if err != nil { return nil, err } - result[i] = append(result[i], flattenNodes(nodes)...) + result[i] = flattenNodes(result[i], nodes) c.addUsedNodes(result[i]...) } else { nodes, ok := c.selections[sName] if !ok { return nil, fmt.Errorf("selector not found: REPLICA '%s'", sName) } - result[i] = append(result[i], flattenNodes(nodes)...) + result[i] = flattenNodes(result[i], nodes) } } diff --git a/netmap/selector_test.go b/netmap/selector_test.go index ae996dd..a4ca774 100644 --- a/netmap/selector_test.go +++ b/netmap/selector_test.go @@ -191,7 +191,7 @@ func TestPlacementPolicy_DeterministicOrder(t *testing.T) { nss[i] = v[i] } - ns := flattenNodes(nss) + ns := flattenNodes(nil, nss) require.Equal(t, 2, len(ns)) return ns[0].Hash(), ns[1].Hash() } From 1b12c9beaed47d48601828f9efbdbbadeaefaec0 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Sat, 5 Apr 2025 10:15:12 +0300 Subject: [PATCH 185/197] [#356] netmap: Fix typo in NodeInfo.readFromV2() Signed-off-by: Evgenii Stratonikov --- netmap/node_info.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netmap/node_info.go b/netmap/node_info.go index acbfaee..ce3bdb9 100644 --- a/netmap/node_info.go +++ b/netmap/node_info.go @@ -50,7 +50,7 @@ func (x *NodeInfo) readFromV2(m netmap.NodeInfo, checkFieldPresence bool) error if key == "" { return fmt.Errorf("empty key of the attribute #%d", i) } else if _, ok := mAttr[key]; ok { - return fmt.Errorf("duplicated attbiuted %s", key) + return fmt.Errorf("duplicate attributes %s", key) } switch { From 684050b570fb45fe246ab5966c26066101eb6f6b Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Sat, 5 Apr 2025 10:29:01 +0300 Subject: [PATCH 186/197] [#356] netmap/test: Cover NodeInfo.ReadFromV2() with tests Untested code never works. Qed. Signed-off-by: Evgenii Stratonikov --- netmap/node_info_test.go | 85 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/netmap/node_info_test.go b/netmap/node_info_test.go index 990cc26..bf6e637 100644 --- a/netmap/node_info_test.go +++ b/netmap/node_info_test.go @@ -1,9 +1,11 @@ package netmap import ( + "fmt" "testing" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap" + "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "github.com/stretchr/testify/require" ) @@ -197,3 +199,86 @@ func TestNodeInfo_Clone(t *testing.T) { require.True(t, c != &ni) require.True(t, &(c.PublicKey()[0]) != &(ni.PublicKey()[0])) } + +func TestNodeInfo_Unmarshal(t *testing.T) { + pk, err := keys.NewPrivateKey() + require.NoError(t, err) + + attrs := make([]netmap.Attribute, 2) + for i := range attrs { + attrs[i].SetKey(fmt.Sprintf("key%d", i)) + attrs[i].SetValue(fmt.Sprintf("value%d", i)) + } + goodNodeInfo := func() netmap.NodeInfo { + var nodev2 netmap.NodeInfo + nodev2.SetPublicKey(pk.PublicKey().Bytes()) + nodev2.SetAddresses("127.0.0.1:2025") + nodev2.SetState(netmap.Online) + nodev2.SetAttributes(attrs) + return nodev2 + } + + // Check that goodNodeInfo indeed returns good node. + // Otherwise, the whole test is garbage. + require.NoError(t, new(NodeInfo).ReadFromV2(goodNodeInfo())) + + t.Run("empty public key", func(t *testing.T) { + n := goodNodeInfo() + n.SetPublicKey(nil) + require.ErrorContains(t, new(NodeInfo).ReadFromV2(n), "missing public key") + }) + t.Run("missing addresses", func(t *testing.T) { + n := goodNodeInfo() + n.SetAddresses() + require.ErrorContains(t, new(NodeInfo).ReadFromV2(n), "missing network endpoints") + }) + t.Run("empty attribute key", func(t *testing.T) { + n := goodNodeInfo() + + var a netmap.Attribute + a.SetValue("non-empty") + n.SetAttributes(append(attrs, a)) + require.ErrorContains(t, new(NodeInfo).ReadFromV2(n), + fmt.Sprintf("empty key of the attribute #%d", len(attrs))) + }) + t.Run("empty attribute value", func(t *testing.T) { + n := goodNodeInfo() + + var a netmap.Attribute + a.SetKey("non-empty-key") + n.SetAttributes(append(attrs, a)) + require.ErrorContains(t, new(NodeInfo).ReadFromV2(n), + "empty value of the attribute non-empty-key") + }) + t.Run("invalid price attribute", func(t *testing.T) { + n := goodNodeInfo() + + var a netmap.Attribute + a.SetKey(attrPrice) + a.SetValue("not a number") + n.SetAttributes(append(attrs, a)) + require.ErrorContains(t, new(NodeInfo).ReadFromV2(n), + fmt.Sprintf("invalid %s attribute", attrPrice)) + }) + t.Run("invalid capacity attribute", func(t *testing.T) { + n := goodNodeInfo() + + var a netmap.Attribute + a.SetKey(attrCapacity) + a.SetValue("not a number") + n.SetAttributes(append(attrs, a)) + require.ErrorContains(t, new(NodeInfo).ReadFromV2(n), + fmt.Sprintf("invalid %s attribute", attrCapacity)) + }) + t.Run("duplicate attributes", func(t *testing.T) { + t.Skip("FIXME") + n := goodNodeInfo() + + var a netmap.Attribute + a.SetKey("key1") + a.SetValue("value3") + n.SetAttributes(append(attrs, a)) + require.ErrorContains(t, new(NodeInfo).ReadFromV2(n), + "duplicate attributes key1") + }) +} From 88bc9eeb2638fb9142b04ea4f401814bce6b5270 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Sat, 5 Apr 2025 10:31:05 +0300 Subject: [PATCH 187/197] [#356] netmap: Check for attribute duplicates in NodeInfo.readFromV2() Signed-off-by: Evgenii Stratonikov --- netmap/node_info.go | 1 + netmap/node_info_test.go | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/netmap/node_info.go b/netmap/node_info.go index ce3bdb9..63fe047 100644 --- a/netmap/node_info.go +++ b/netmap/node_info.go @@ -52,6 +52,7 @@ func (x *NodeInfo) readFromV2(m netmap.NodeInfo, checkFieldPresence bool) error } else if _, ok := mAttr[key]; ok { return fmt.Errorf("duplicate attributes %s", key) } + mAttr[key] = struct{}{} switch { case key == attrCapacity: diff --git a/netmap/node_info_test.go b/netmap/node_info_test.go index bf6e637..65ea0e8 100644 --- a/netmap/node_info_test.go +++ b/netmap/node_info_test.go @@ -271,7 +271,6 @@ func TestNodeInfo_Unmarshal(t *testing.T) { fmt.Sprintf("invalid %s attribute", attrCapacity)) }) t.Run("duplicate attributes", func(t *testing.T) { - t.Skip("FIXME") n := goodNodeInfo() var a netmap.Attribute From a0e4d16dbbe96afdc8b1a43f251d9d50a30a966c Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Sat, 5 Apr 2025 07:51:32 +0300 Subject: [PATCH 188/197] [#352] container: Implement iterators over attributes Signed-off-by: Evgenii Stratonikov --- container/container.go | 34 +++++++++++++ container/container_test.go | 11 ++--- container/iterators_test.go | 95 +++++++++++++++++++++++++++++++++++++ 3 files changed, 133 insertions(+), 7 deletions(-) create mode 100644 container/iterators_test.go diff --git a/container/container.go b/container/container.go index ff63adb..f10c320 100644 --- a/container/container.go +++ b/container/container.go @@ -5,6 +5,7 @@ import ( "crypto/sha256" "errors" "fmt" + "iter" "strconv" "strings" "time" @@ -337,10 +338,41 @@ func (x Container) Attribute(key string) string { return "" } +// Attributes returns an iterator over all Container attributes. +// +// See also [Container.SetAttribute], [Container.UserAttributes]. +func (x Container) Attributes() iter.Seq2[string, string] { + return func(yield func(string, string) bool) { + attrs := x.v2.GetAttributes() + for i := range attrs { + if !yield(attrs[i].GetKey(), attrs[i].GetValue()) { + return + } + } + } +} + +// Attributes returns an iterator over all non-system Container attributes. +// +// See also [Container.SetAttribute], [Container.Attributes]. +func (x Container) UserAttributes() iter.Seq2[string, string] { + return func(yield func(string, string) bool) { + for key, value := range x.Attributes() { + if !strings.HasPrefix(key, container.SysAttributePrefix) { + if !yield(key, value) { + return + } + } + } + } +} + // IterateAttributes iterates over all Container attributes and passes them // into f. The handler MUST NOT be nil. // // See also SetAttribute, Attribute. +// +// Deprecated: use [Container.Attributes] instead. func (x Container) IterateAttributes(f func(key, val string)) { attrs := x.v2.GetAttributes() for i := range attrs { @@ -352,6 +384,8 @@ func (x Container) IterateAttributes(f func(key, val string)) { // into f. The handler MUST NOT be nil. // // See also SetAttribute, Attribute. +// +// Deprecated: use [Container.UserAttributes] instead. func (x Container) IterateUserAttributes(f func(key, val string)) { attrs := x.v2.GetAttributes() for _, attr := range attrs { diff --git a/container/container_test.go b/container/container_test.go index a66a866..62422ab 100644 --- a/container/container_test.go +++ b/container/container_test.go @@ -2,6 +2,7 @@ package container_test import ( "crypto/sha256" + "maps" "strconv" "testing" "time" @@ -159,9 +160,9 @@ func TestContainer_Attribute(t *testing.T) { val.SetAttribute(attrKey2, attrVal2) var i int - val.IterateUserAttributes(func(key, val string) { + for range val.UserAttributes() { i++ - }) + } require.Equal(t, 1, i) var msg v2container.Container @@ -177,11 +178,7 @@ func TestContainer_Attribute(t *testing.T) { require.Equal(t, attrVal1, val2.Attribute(attrKey1)) require.Equal(t, attrVal2, val2.Attribute(attrKey2)) - m := map[string]string{} - - val2.IterateAttributes(func(key, val string) { - m[key] = val - }) + m := maps.Collect(val2.Attributes()) require.GreaterOrEqual(t, len(m), 2) require.Equal(t, attrVal1, m[attrKey1]) diff --git a/container/iterators_test.go b/container/iterators_test.go new file mode 100644 index 0000000..00522a5 --- /dev/null +++ b/container/iterators_test.go @@ -0,0 +1,95 @@ +package container_test + +import ( + "testing" + + containerAPI "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container" + "github.com/stretchr/testify/require" +) + +func TestContainer_Attributes(t *testing.T) { + t.Run("empty", func(t *testing.T) { + var n container.Container + t.Run("attributes", func(t *testing.T) { + for range n.Attributes() { + t.Fatalf("handler is called, but it shouldn't") + } + }) + t.Run("user attributes", func(t *testing.T) { + for range n.UserAttributes() { + t.Fatalf("handler is called, but it shouldn't") + } + }) + }) + + var n container.Container + n.SetAttribute(containerAPI.SysAttributeName, "myname") + n.SetAttribute("key1", "value1") + n.SetAttribute("key2", "value2") + n.SetAttribute(containerAPI.SysAttributeZone, "test") + + t.Run("break", func(t *testing.T) { + t.Run("attributes", func(t *testing.T) { + var res [][2]string + for key, value := range n.Attributes() { + if key == "key2" { + break + } + res = append(res, [2]string{key, value}) + } + require.Equal(t, [][2]string{{containerAPI.SysAttributeName, "myname"}, {"key1", "value1"}}, res) + }) + t.Run("user attributes", func(t *testing.T) { + var res [][2]string + for key, value := range n.UserAttributes() { + if key == "key2" { + break + } + res = append(res, [2]string{key, value}) + } + require.Equal(t, [][2]string{{"key1", "value1"}}, res) + }) + }) + t.Run("continue", func(t *testing.T) { + t.Run("attributes", func(t *testing.T) { + var res [][2]string + for key, value := range n.Attributes() { + if key == "key2" { + continue + } + res = append(res, [2]string{key, value}) + } + require.Equal(t, [][2]string{{containerAPI.SysAttributeName, "myname"}, {"key1", "value1"}, {containerAPI.SysAttributeZone, "test"}}, res) + }) + t.Run("user attributes", func(t *testing.T) { + var res [][2]string + for key, value := range n.UserAttributes() { + if key == "key2" { + continue + } + res = append(res, [2]string{key, value}) + } + require.Equal(t, [][2]string{{"key1", "value1"}}, res) + }) + }) + t.Run("attributes", func(t *testing.T) { + var res [][2]string + for key, value := range n.Attributes() { + res = append(res, [2]string{key, value}) + } + require.Equal(t, [][2]string{ + {containerAPI.SysAttributeName, "myname"}, + {"key1", "value1"}, + {"key2", "value2"}, + {containerAPI.SysAttributeZone, "test"}, + }, res) + }) + t.Run("user attributes", func(t *testing.T) { + var res [][2]string + for key, value := range n.UserAttributes() { + res = append(res, [2]string{key, value}) + } + require.Equal(t, [][2]string{{"key1", "value1"}, {"key2", "value2"}}, res) + }) +} From f158a6b2e14b82c856d9c2c36fd92bc167d7fe6a Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Sat, 5 Apr 2025 08:40:41 +0300 Subject: [PATCH 189/197] [#353] pool: Remove deprecated IterateNetworkEndpoints() Signed-off-by: Evgenii Stratonikov --- pool/tree/pool.go | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/pool/tree/pool.go b/pool/tree/pool.go index dda74c1..dd5d826 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -1081,20 +1081,15 @@ func (p *Pool) deleteClientFromMap(hash uint64) { } func (p *Pool) getNewTreeClient(ctx context.Context, node netmap.NodeInfo) (*treeClient, error) { - var ( - treeCl *treeClient - err error - ) - - node.IterateNetworkEndpoints(func(endpoint string) bool { + for endpoint := range node.NetworkEndpoints() { var addr network.Address - if err = addr.FromString(endpoint); err != nil { + if err := addr.FromString(endpoint); err != nil { p.log(zap.WarnLevel, "can't parse endpoint", zap.String("endpoint", endpoint), zap.Error(err)) - return false + continue } newTreeCl := newTreeClient(addr.URIAddr(), p.dialOptions, p.nodeDialTimeout, p.streamTimeout) - if err = newTreeCl.dial(ctx); err != nil { + if err := newTreeCl.dial(ctx); err != nil { p.log(zap.WarnLevel, "failed to dial tree client", zap.Error(err)) // We have to close connection here after failed `dial()`. @@ -1106,18 +1101,13 @@ func (p *Pool) getNewTreeClient(ctx context.Context, node netmap.NodeInfo) (*tre p.log(zap.WarnLevel, "failed to close recently dialed tree client", zap.Error(err)) } - return false + continue } - treeCl = newTreeCl - return true - }) - - if treeCl == nil { - return nil, fmt.Errorf("tree client wasn't initialized") + return newTreeCl, nil } - return treeCl, nil + return nil, fmt.Errorf("tree client wasn't initialized") } func shouldTryAgain(err error) bool { From 661adf17bb54f2d3f9d16b790305876a208f5ff9 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Sat, 5 Apr 2025 08:03:56 +0300 Subject: [PATCH 190/197] [#353] Format deprecated notices properly They should be in a separate paragraph, otherwise they are not recognized. Signed-off-by: Evgenii Stratonikov --- api/netmap/types.go | 1 + netmap/node_info.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/api/netmap/types.go b/api/netmap/types.go index 9d9fa09..6dfe676 100644 --- a/api/netmap/types.go +++ b/api/netmap/types.go @@ -439,6 +439,7 @@ func (ni NodeInfo) Addresses() iter.Seq[string] { // Breaks iteration on f's true return. // // Handler should not be nil. +// // Deprecated: use [NodeInfo.Addresses] instead. func (ni *NodeInfo) IterateAddresses(f func(string) bool) { if ni != nil { diff --git a/netmap/node_info.go b/netmap/node_info.go index 63fe047..7edd05c 100644 --- a/netmap/node_info.go +++ b/netmap/node_info.go @@ -202,6 +202,7 @@ func (x NodeInfo) NumberOfNetworkEndpoints() int { // FrostFS system requirements. // // See also SetNetworkEndpoints. +// // Deprecated: use [NodeInfo.NetworkEndpoints] instead. func (x NodeInfo) IterateNetworkEndpoints(f func(string) bool) { for s := range x.NetworkEndpoints() { @@ -221,6 +222,7 @@ func (x NodeInfo) NetworkEndpoints() iter.Seq[string] { // IterateNetworkEndpoints is an extra-sugared function over IterateNetworkEndpoints // method which allows to unconditionally iterate over all node's network endpoints. +// // Deprecated: use [NodeInfo.NetworkEndpoints] instead. func IterateNetworkEndpoints(node NodeInfo, f func(string)) { node.IterateNetworkEndpoints(func(addr string) bool { @@ -423,6 +425,7 @@ func (x NodeInfo) Attributes() iter.Seq2[string, string] { // IterateAttributes iterates over all node attributes and passes the into f. // Handler MUST NOT be nil. +// // Deprecated: use [NodeInfo.Attributes] instead. func (x NodeInfo) IterateAttributes(f func(key, value string)) { a := x.m.GetAttributes() From 16fd3bafe047847e2ce697a276c5325af9da9240 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Sat, 5 Apr 2025 08:22:49 +0300 Subject: [PATCH 191/197] [#354] api/netmap: Return a slice of parameters directly `IterateParameters` does a poor job: - it doesn't encapsulate well, because it returns a pointer, - it has a clunky interface, compared to range loop. I have decided to return parameter slice and not `iter.Seq` for 2 reasons: 1. There already is `SetParameters`, so `NetworkConfig` struct is expected to be modified. 2. This iterator uses pointers, so even with this interface the slice can already be changed. Signed-off-by: Evgenii Stratonikov --- api/netmap/types.go | 12 +++++++ netmap/network_info.go | 65 +++++++++++++------------------------ netmap/network_info_test.go | 14 +++----- 3 files changed, 38 insertions(+), 53 deletions(-) diff --git a/api/netmap/types.go b/api/netmap/types.go index 6dfe676..b555972 100644 --- a/api/netmap/types.go +++ b/api/netmap/types.go @@ -577,6 +577,8 @@ type NetworkConfig struct { } // NumberOfParameters returns number of network parameters. +// +// Deprecated: use [NetworkConfig.Parameters] instead. func (x *NetworkConfig) NumberOfParameters() int { if x != nil { return len(x.ps) @@ -585,10 +587,20 @@ func (x *NetworkConfig) NumberOfParameters() int { return 0 } +// Parameters returns an iterator over network parameters. +func (x *NetworkConfig) Parameters() []NetworkParameter { + if x != nil { + return x.ps + } + return nil +} + // IterateParameters iterates over network parameters. // Breaks iteration on f's true return. // // Handler must not be nil. +// +// Deprecated: use [NetworkConfig.Parameters] instead. func (x *NetworkConfig) IterateParameters(f func(*NetworkParameter) bool) { if x != nil { for i := range x.ps { diff --git a/netmap/network_info.go b/netmap/network_info.go index 11b0f14..a270afe 100644 --- a/netmap/network_info.go +++ b/netmap/network_info.go @@ -30,20 +30,19 @@ func (x *NetworkInfo) readFromV2(m netmap.NetworkInfo, checkFieldPresence bool) return errors.New("missing network config") } - if checkFieldPresence && c.NumberOfParameters() <= 0 { + if checkFieldPresence && len(c.Parameters()) == 0 { return errors.New("missing network parameters") } var err error - mNames := make(map[string]struct{}, c.NumberOfParameters()) + mNames := make(map[string]struct{}, len(c.Parameters())) - c.IterateParameters(func(prm *netmap.NetworkParameter) bool { + for _, prm := range c.Parameters() { name := string(prm.GetKey()) _, was := mNames[name] if was { - err = fmt.Errorf("duplicated parameter name: %s", name) - return true + return fmt.Errorf("duplicated parameter name: %s", name) } mNames[name] = struct{}{} @@ -67,14 +66,8 @@ func (x *NetworkInfo) readFromV2(m netmap.NetworkInfo, checkFieldPresence bool) } if err != nil { - err = fmt.Errorf("invalid %s parameter: %w", name, err) + return fmt.Errorf("invalid %s parameter: %w", name, err) } - - return err != nil - }) - - if err != nil { - return err } x.m = m @@ -152,41 +145,29 @@ func (x *NetworkInfo) setConfig(name string, val []byte) { return } - found := false - prms := make([]netmap.NetworkParameter, 0, c.NumberOfParameters()) - - c.IterateParameters(func(prm *netmap.NetworkParameter) bool { - found = bytes.Equal(prm.GetKey(), []byte(name)) - if found { - prm.SetValue(val) - } else { - prms = append(prms, *prm) + prms := c.Parameters() + for i := range prms { + if bytes.Equal(prms[i].GetKey(), []byte(name)) { + prms[i].SetValue(val) + return } - - return found - }) - - if !found { - prms = append(prms, netmap.NetworkParameter{}) - prms[len(prms)-1].SetKey([]byte(name)) - prms[len(prms)-1].SetValue(val) - - c.SetParameters(prms...) } + + prms = append(prms, netmap.NetworkParameter{}) + prms[len(prms)-1].SetKey([]byte(name)) + prms[len(prms)-1].SetValue(val) + + c.SetParameters(prms...) } func (x NetworkInfo) configValue(name string) (res []byte) { - x.m.GetNetworkConfig().IterateParameters(func(prm *netmap.NetworkParameter) bool { + for _, prm := range x.m.GetNetworkConfig().Parameters() { if string(prm.GetKey()) == name { - res = prm.GetValue() - - return true + return prm.GetValue() } + } - return false - }) - - return + return nil } // SetRawNetworkParameter sets named FrostFS network parameter whose value is @@ -218,7 +199,7 @@ func (x *NetworkInfo) RawNetworkParameter(name string) []byte { func (x *NetworkInfo) IterateRawNetworkParameters(f func(name string, value []byte)) { c := x.m.GetNetworkConfig() - c.IterateParameters(func(prm *netmap.NetworkParameter) bool { + for _, prm := range c.Parameters() { name := string(prm.GetKey()) switch name { default: @@ -237,9 +218,7 @@ func (x *NetworkInfo) IterateRawNetworkParameters(f func(name string, value []by configHomomorphicHashingDisabled, configMaintenanceModeAllowed: } - - return false - }) + } } func (x *NetworkInfo) setConfigUint64(name string, num uint64) { diff --git a/netmap/network_info_test.go b/netmap/network_info_test.go index 7e6dc12..64abe5d 100644 --- a/netmap/network_info_test.go +++ b/netmap/network_info_test.go @@ -76,16 +76,10 @@ func testConfigValue(t *testing.T, var m netmap.NetworkInfo x.WriteToV2(&m) - require.EqualValues(t, 1, m.GetNetworkConfig().NumberOfParameters()) - found := false - m.GetNetworkConfig().IterateParameters(func(prm *netmap.NetworkParameter) bool { - require.False(t, found) - require.Equal(t, []byte(v2Key), prm.GetKey()) - require.Equal(t, v2Val(exp), prm.GetValue()) - found = true - return false - }) - require.True(t, found) + var p netmap.NetworkParameter + p.SetKey([]byte(v2Key)) + p.SetValue(v2Val(exp)) + require.Equal(t, []netmap.NetworkParameter{p}, m.GetNetworkConfig().Parameters()) } setter(&x, val1) From 338faaf3089b96e41ad87a735d8126455b359bce Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Sat, 5 Apr 2025 09:56:22 +0300 Subject: [PATCH 192/197] [#355] netmap: Remove unnecessary err declaration Signed-off-by: Evgenii Stratonikov --- netmap/node_info.go | 1 - 1 file changed, 1 deletion(-) diff --git a/netmap/node_info.go b/netmap/node_info.go index 7edd05c..40a9fd8 100644 --- a/netmap/node_info.go +++ b/netmap/node_info.go @@ -61,7 +61,6 @@ func (x *NodeInfo) readFromV2(m netmap.NodeInfo, checkFieldPresence bool) error return fmt.Errorf("invalid %s attribute: %w", attrCapacity, err) } case key == attrPrice: - var err error _, err = strconv.ParseUint(attributes[i].GetValue(), 10, 64) if err != nil { return fmt.Errorf("invalid %s attribute: %w", attrPrice, err) From d282cd094fb4c757b1ecb658f653e1ced482b158 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Sat, 5 Apr 2025 10:06:20 +0300 Subject: [PATCH 193/197] [#355] netmap: Cache price and capacity attributes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They are used by HRW sorting and it makes sense to store them separately instead of iterating over all attributes each time we need them. It also simplifies code: we already parse them in NodeInfo.readFromV2(), so just save the result. ``` goos: linux goarch: amd64 pkg: git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap cpu: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz │ old │ new │ │ sec/op │ sec/op vs base │ Netmap_ContainerNodes/REP_2-8 5.923µ ± 0% 5.209µ ± 1% -12.05% (p=0.000 n=10) Netmap_ContainerNodes/REP_2_IN_X_CBF_2_SELECT_2_FROM_*_AS_X-8 5.931µ ± 7% 5.088µ ± 1% -14.22% (p=0.000 n=10) geomean 5.927µ 5.148µ -13.14% │ old │ new │ │ B/op │ B/op vs base │ Netmap_ContainerNodes/REP_2-8 7.609Ki ± 0% 8.172Ki ± 0% +7.39% (p=0.000 n=10) Netmap_ContainerNodes/REP_2_IN_X_CBF_2_SELECT_2_FROM_*_AS_X-8 7.031Ki ± 0% 7.469Ki ± 0% +6.22% (p=0.000 n=10) geomean 7.315Ki 7.812Ki +6.81% │ old │ new │ │ allocs/op │ allocs/op vs base │ Netmap_ContainerNodes/REP_2-8 77.00 ± 0% 77.00 ± 0% ~ (p=1.000 n=10) ¹ Netmap_ContainerNodes/REP_2_IN_X_CBF_2_SELECT_2_FROM_*_AS_X-8 77.00 ± 0% 77.00 ± 0% ~ (p=1.000 n=10) ¹ geomean 77.00 77.00 +0.00% ¹ all samples are equal ``` Signed-off-by: Evgenii Stratonikov --- netmap/aggregator.go | 2 +- netmap/context.go | 4 ++-- netmap/filter.go | 4 ++-- netmap/node_info.go | 52 +++++++++++++++++++------------------------- 4 files changed, 27 insertions(+), 35 deletions(-) diff --git a/netmap/aggregator.go b/netmap/aggregator.go index 1faba9e..d0894f1 100644 --- a/netmap/aggregator.go +++ b/netmap/aggregator.go @@ -54,7 +54,7 @@ var ( // capacity and price. func newWeightFunc(capNorm, priceNorm normalizer) weightFunc { return func(n NodeInfo) float64 { - return capNorm.Normalize(float64(n.capacity())) * priceNorm.Normalize(float64(n.Price())) + return capNorm.Normalize(float64(n.capacity)) * priceNorm.Normalize(float64(n.price)) } } diff --git a/netmap/context.go b/netmap/context.go index 2772725..2d81999 100644 --- a/netmap/context.go +++ b/netmap/context.go @@ -97,8 +97,8 @@ func defaultWeightFunc(ns nodes) weightFunc { minV := newMinAgg() for i := range ns { - mean.Add(float64(ns[i].capacity())) - minV.Add(float64(ns[i].Price())) + mean.Add(float64(ns[i].capacity)) + minV.Add(float64(ns[i].price)) } return newWeightFunc( diff --git a/netmap/filter.go b/netmap/filter.go index 38230b7..9fe346c 100644 --- a/netmap/filter.go +++ b/netmap/filter.go @@ -133,9 +133,9 @@ func (c *context) matchKeyValue(f *netmap.Filter, b NodeInfo) bool { switch f.GetKey() { case attrPrice: - attr = b.Price() + attr = b.price case attrCapacity: - attr = b.capacity() + attr = b.capacity default: var err error diff --git a/netmap/node_info.go b/netmap/node_info.go index 40a9fd8..ba65daa 100644 --- a/netmap/node_info.go +++ b/netmap/node_info.go @@ -26,6 +26,9 @@ import ( type NodeInfo struct { m netmap.NodeInfo hash uint64 + + capacity uint64 + price uint64 } // reads NodeInfo from netmap.NodeInfo message. If checkFieldPresence is set, @@ -33,6 +36,7 @@ type NodeInfo struct { // presented field according to FrostFS API V2 protocol. func (x *NodeInfo) readFromV2(m netmap.NodeInfo, checkFieldPresence bool) error { var err error + var capacity, price uint64 binPublicKey := m.GetPublicKey() if checkFieldPresence && len(binPublicKey) == 0 { @@ -56,12 +60,12 @@ func (x *NodeInfo) readFromV2(m netmap.NodeInfo, checkFieldPresence bool) error switch { case key == attrCapacity: - _, err = strconv.ParseUint(attributes[i].GetValue(), 10, 64) + capacity, err = strconv.ParseUint(attributes[i].GetValue(), 10, 64) if err != nil { return fmt.Errorf("invalid %s attribute: %w", attrCapacity, err) } case key == attrPrice: - _, err = strconv.ParseUint(attributes[i].GetValue(), 10, 64) + price, err = strconv.ParseUint(attributes[i].GetValue(), 10, 64) if err != nil { return fmt.Errorf("invalid %s attribute: %w", attrPrice, err) } @@ -74,6 +78,8 @@ func (x *NodeInfo) readFromV2(m netmap.NodeInfo, checkFieldPresence bool) error x.m = m x.hash = hrw.Hash(binPublicKey) + x.capacity = capacity + x.price = price return nil } @@ -252,46 +258,21 @@ func (x *NodeInfo) setNumericAttribute(key string, num uint64) { // price is announced. func (x *NodeInfo) SetPrice(price uint64) { x.setNumericAttribute(attrPrice, price) + x.price = price } // Price returns price set using SetPrice. // // Zero NodeInfo has zero price. func (x NodeInfo) Price() uint64 { - val := x.Attribute(attrPrice) - if val == "" { - return 0 - } - - price, err := strconv.ParseUint(val, 10, 64) - if err != nil { - panic(fmt.Sprintf("unexpected price parsing error %s: %v", val, err)) - } - - return price + return x.price } // SetCapacity sets the storage capacity declared by the node. By default, zero // capacity is announced. func (x *NodeInfo) SetCapacity(capacity uint64) { x.setNumericAttribute(attrCapacity, capacity) -} - -// capacity returns capacity set using SetCapacity. -// -// Zero NodeInfo has zero capacity. -func (x NodeInfo) capacity() uint64 { - val := x.Attribute(attrCapacity) - if val == "" { - return 0 - } - - capacity, err := strconv.ParseUint(val, 10, 64) - if err != nil { - panic(fmt.Sprintf("unexpected capacity parsing error %s: %v", val, err)) - } - - return capacity + x.capacity = capacity } const attrUNLOCODE = "UN-LOCODE" @@ -442,6 +423,17 @@ func (x *NodeInfo) SetAttribute(key, value string) { panic("empty value in SetAttribute") } + // NodeInfo with non-numeric `Price`` or `Capacity` attributes + // is considered invalid by NodeInfo.readFromV2(). + // Here we have no way to signal an error, and panic seems an overkill. + // So, set cached fields only if we can parse the value and 0 parsing fails. + switch key { + case attrPrice: + x.price, _ = strconv.ParseUint(value, 10, 64) + case attrCapacity: + x.capacity, _ = strconv.ParseUint(value, 10, 64) + } + a := x.m.GetAttributes() for i := range a { if a[i].GetKey() == key { From fc8f9637fedbc9c07ed6e988f382ef3241499891 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 17 Mar 2025 15:13:11 +0300 Subject: [PATCH 194/197] [#35] go.mod: Update go-multiaddr to v0.15.0 New multiaddr release is incompatible with the old one: https://github.com/multiformats/go-multiaddr/releases/tag/v0.15.0 https://github.com/multiformats/go-multiaddr/blob/master/v015-MIGRATION.md Thankfully, it seems we are not affected by any breaking changes. Signed-off-by: Evgenii Stratonikov --- go.mod | 20 ++++++++++---------- go.sum | 59 ++++++++++++++++++++++++---------------------------------- 2 files changed, 34 insertions(+), 45 deletions(-) diff --git a/go.mod b/go.mod index 5ee242b..76ef49e 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go -go 1.23 +go 1.23.0 require ( git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e @@ -14,11 +14,11 @@ require ( github.com/klauspost/reedsolomon v1.12.1 github.com/mailru/easyjson v0.7.7 github.com/mr-tron/base58 v1.2.0 - github.com/multiformats/go-multiaddr v0.14.0 + github.com/multiformats/go-multiaddr v0.15.0 github.com/nspcc-dev/neo-go v0.106.2 github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.27.0 - golang.org/x/sync v0.10.0 + golang.org/x/sync v0.12.0 google.golang.org/grpc v1.69.2 google.golang.org/protobuf v1.36.1 gopkg.in/yaml.v3 v3.0.1 @@ -30,9 +30,9 @@ require ( github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/golang/snappy v0.0.1 // indirect github.com/gorilla/websocket v1.5.1 // indirect - github.com/ipfs/go-cid v0.0.7 // indirect + github.com/ipfs/go-cid v0.5.0 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/klauspost/cpuid/v2 v2.2.6 // indirect + github.com/klauspost/cpuid/v2 v2.2.10 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/minio/sha256-simd v1.0.1 // indirect github.com/multiformats/go-base32 v0.1.0 // indirect @@ -49,12 +49,12 @@ require ( github.com/twmb/murmur3 v1.1.8 // indirect go.etcd.io/bbolt v1.3.9 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.31.0 // indirect - golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect + golang.org/x/crypto v0.36.0 // indirect + golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect golang.org/x/net v0.30.0 // indirect - golang.org/x/sys v0.28.0 // indirect - golang.org/x/text v0.21.0 // indirect + golang.org/x/sys v0.31.0 // indirect + golang.org/x/text v0.23.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect - lukechampine.com/blake3 v1.2.1 // indirect + lukechampine.com/blake3 v1.4.0 // indirect ) diff --git a/go.sum b/go.sum index 0d898c1..1fd06ca 100644 --- a/go.sum +++ b/go.sum @@ -62,12 +62,12 @@ github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyf github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/ipfs/go-cid v0.0.7 h1:ysQJVJA3fNDF1qigJbsSQOdjhVLsOEoPdh0+R97k3jY= -github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= +github.com/ipfs/go-cid v0.5.0 h1:goEKKhaGm0ul11IHA7I6p1GmKz8kEYniqFopaB5Otwg= +github.com/ipfs/go-cid v0.5.0/go.mod h1:0L7vmeNXpQpUS9vt+yEARkJ8rOg43DF3iPgn4GIN0mk= 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/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= -github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= +github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= github.com/klauspost/reedsolomon v1.12.1 h1:NhWgum1efX1x58daOBGCFWcxtEhOhXKKl1HAPQUp03Q= github.com/klauspost/reedsolomon v1.12.1/go.mod h1:nEi5Kjb6QqtbofI6s+cbG/j1da11c96IBYBSnVGtuBs= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -76,31 +76,22 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= -github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= -github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= -github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= 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/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE= github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI= -github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0= github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= -github.com/multiformats/go-multiaddr v0.14.0 h1:bfrHrJhrRuh/NXH5mCnemjpbGjzRw/b+tJFOD41g2tU= -github.com/multiformats/go-multiaddr v0.14.0/go.mod h1:6EkVAxtznq2yC3QT5CM1UTAwG0GTP3EWAIcjHuzQ+r4= -github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= +github.com/multiformats/go-multiaddr v0.15.0 h1:zB/HeaI/apcZiTDwhY5YqMvNVl/oQYvs3XySU+qeAVo= +github.com/multiformats/go-multiaddr v0.15.0/go.mod h1:JSVUmXDjsVFiW7RjIFMP7+Ev+h1DTbiJgVeTV/tcmP0= github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk= -github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= github.com/multiformats/go-multihash v0.2.3 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U= github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM= -github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= github.com/nspcc-dev/go-ordered-json v0.0.0-20240301084351-0246b013f8b2 h1:mD9hU3v+zJcnHAVmHnZKt3I++tvn30gBj2rP2PocZMk= @@ -167,14 +158,13 @@ go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN8 go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= +golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= +golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 h1:nDVHiLt8aIbd/VzvPWN6kSOPE7+F/fNFDSXLVYkE/Iw= +golang.org/x/exp v0.0.0-20250305212735-054e65f0b394/go.mod h1:sIifuuw/Yco/y6yb6+bDNfyeQ/MdPUy/hKEMYQV17cM= +golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= +golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= @@ -182,8 +172,8 @@ golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= +golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/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= @@ -194,19 +184,18 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= -golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= +golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= +golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= +golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= golang.org/x/text v0.3.0/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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= +golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU= +golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ= 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= @@ -235,7 +224,7 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/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= -lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI= -lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= +lukechampine.com/blake3 v1.4.0 h1:xDbKOZCVbnZsfzM6mHSYcGRHZ3YrLDzqz8XnV4uaD5w= +lukechampine.com/blake3 v1.4.0/go.mod h1:MQJNQCTnR+kwOP/JEZSxj3MaQjp80FOFSNMMHXcSeX0= rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= From 971e740ea32b4f5a819e9ce904405c4954881b99 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 17 Mar 2025 15:24:15 +0300 Subject: [PATCH 195/197] [#35] network: Use AppendComponent() for TLS encapsulation As advocated explicitly in https://github.com/multiformats/go-multiaddr/blob/master/v015-MIGRATION.md Answering a question about safety: AppendComponent() appends to `a.ma`` in place. `a.ma` is created by FromString() function, so there is only a single goroutine appending to it. Thus, assuming `FromString()` itself is called from a single goroutine, no data race is introduced. Signed-off-by: Evgenii Stratonikov --- pkg/network/address.go | 2 +- pkg/network/tls.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/network/address.go b/pkg/network/address.go index 45d5939..dff8614 100644 --- a/pkg/network/address.go +++ b/pkg/network/address.go @@ -66,7 +66,7 @@ func (a *Address) FromString(s string) error { if err == nil { a.ma, err = multiaddr.NewMultiaddr(s) if err == nil && hasTLS { - a.ma = a.ma.Encapsulate(tls) + a.ma = a.ma.AppendComponent(tls) } } } diff --git a/pkg/network/tls.go b/pkg/network/tls.go index b3e9663..f30c99e 100644 --- a/pkg/network/tls.go +++ b/pkg/network/tls.go @@ -9,7 +9,7 @@ const ( ) // tls var is used for (un)wrapping other multiaddrs around TLS multiaddr. -var tls, _ = multiaddr.NewMultiaddr("/" + tlsProtocolName) +var tls, _ = multiaddr.NewComponent(tlsProtocolName, "") // IsTLSEnabled searches for wrapped TLS protocol in multiaddr. func (a Address) IsTLSEnabled() bool { From 715b1e41001d6a8196f32c765ad89f5b371f47ed Mon Sep 17 00:00:00 2001 From: Aleksey Kravchenko Date: Fri, 18 Apr 2025 17:43:23 +0300 Subject: [PATCH 196/197] [#358] pool: Add LatestReceivedEpoch to track latest response epoch Signed-off-by: Aleksey Kravchenko --- pool/pool.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pool/pool.go b/pool/pool.go index f6588c5..53bd587 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -1110,6 +1110,12 @@ func (p *Pool) PatchObject(ctx context.Context, prm PrmObjectPatch) (ResPatchObj return res, nil } +// LatestReceivedEpoch returns the epoch number extracted from the metadata +// of responses received from the client pool's most recent request. +func (p *Pool) LatestReceivedEpoch() uint64 { + return p.cache.Epoch() +} + // PutObject writes an object through a remote server using FrostFS API protocol. func (p *Pool) PutObject(ctx context.Context, prm PrmObjectPut) (ResPutObject, error) { cnr, _ := prm.hdr.ContainerID() From 8822aedbbbaa1d76e6b6ffff65cc097daf479469 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Mon, 28 Apr 2025 12:49:40 +0300 Subject: [PATCH 197/197] [#360] bearer: Change `APEOverride` method prototype * Make `APEOverride` also return flag that indicates whether bearer token sets ape override; * Fix unit-tests. Signed-off-by: Airat Arifullin --- bearer/bearer.go | 13 ++++--------- bearer/bearer_test.go | 15 ++++++++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/bearer/bearer.go b/bearer/bearer.go index d1b77ed..3c4e0e9 100644 --- a/bearer/bearer.go +++ b/bearer/bearer.go @@ -313,15 +313,10 @@ func (b *Token) SetAPEOverride(v APEOverride) { b.apeOverrideSet = true } -// APEOverride returns APE override set by SetAPEOverride. -// -// Zero Token has zero APEOverride. -func (b *Token) APEOverride() APEOverride { - if b.apeOverrideSet { - return b.apeOverride - } - - return APEOverride{} +// APEOverride returns APE override set by SetAPEOverride and a flag that indicates whether override +// is set for the token. +func (b *Token) APEOverride() (override APEOverride, isSet bool) { + return b.apeOverride, b.apeOverrideSet } // SetImpersonate mark token as impersonate to consider token signer as request owner. diff --git a/bearer/bearer_test.go b/bearer/bearer_test.go index 650dc82..cbba7c5 100644 --- a/bearer/bearer_test.go +++ b/bearer/bearer_test.go @@ -93,7 +93,8 @@ func TestToken_SetAPEOverrides(t *testing.T) { val2 := filled require.NoError(t, val2.Unmarshal(val.Marshal())) - require.Zero(t, val2.APEOverride()) + _, isSet := val2.APEOverride() + require.False(t, isSet) val2 = filled @@ -101,14 +102,16 @@ func TestToken_SetAPEOverrides(t *testing.T) { require.NoError(t, err) require.NoError(t, val2.UnmarshalJSON(jd)) - require.Zero(t, val2.APEOverride()) + _, isSet = val2.APEOverride() + require.False(t, isSet) // set value tApe := bearertest.APEOverride() val.SetAPEOverride(tApe) - require.Equal(t, tApe, val.APEOverride()) + _, isSet = val.APEOverride() + require.True(t, isSet) val.WriteToV2(&m) require.NotNil(t, m.GetBody().GetAPEOverride()) @@ -117,7 +120,8 @@ func TestToken_SetAPEOverrides(t *testing.T) { val2 = filled require.NoError(t, val2.Unmarshal(val.Marshal())) - apeOverride := val2.APEOverride() + apeOverride, isSet := val2.APEOverride() + require.True(t, isSet) require.True(t, tokenAPEOverridesEqual(tApe.ToV2(), apeOverride.ToV2())) val2 = filled @@ -126,7 +130,8 @@ func TestToken_SetAPEOverrides(t *testing.T) { require.NoError(t, err) require.NoError(t, val2.UnmarshalJSON(jd)) - apeOverride = val.APEOverride() + apeOverride, isSet = val.APEOverride() + require.True(t, isSet) require.True(t, tokenAPEOverridesEqual(tApe.ToV2(), apeOverride.ToV2())) }