From 0408acc40e3fa9455fb1a893a56811d1d46b0862 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 20 Jun 2022 13:24:30 +0300 Subject: [PATCH] services/control: Autogenerate stable marshalers Signed-off-by: Evgenii Stratonikov --- Makefile | 3 + .../modules/morph/internal/types.pb.go | Bin 6464 -> 6464 bytes go.mod | 4 +- go.sum | Bin 98718 -> 98968 bytes pkg/services/control/ir/service.go | 122 --- pkg/services/control/ir/service.pb.go | Bin 14528 -> 14528 bytes pkg/services/control/ir/service_grpc.pb.go | Bin 3728 -> 3853 bytes pkg/services/control/ir/service_neofs.pb.go | Bin 0 -> 5249 bytes pkg/services/control/ir/types.pb.go | Bin 7733 -> 7733 bytes pkg/services/control/ir/types_neofs.pb.go | Bin 0 -> 1055 bytes pkg/services/control/service.go | 961 +----------------- pkg/services/control/service.pb.go | Bin 89362 -> 89362 bytes pkg/services/control/service_grpc.pb.go | Bin 14980 -> 14980 bytes pkg/services/control/service_neofs.pb.go | Bin 0 -> 41905 bytes pkg/services/control/types.go | 225 ---- pkg/services/control/types.pb.go | Bin 26304 -> 26304 bytes pkg/services/control/types_neofs.pb.go | Bin 0 -> 5782 bytes 17 files changed, 6 insertions(+), 1309 deletions(-) create mode 100644 pkg/services/control/ir/service_neofs.pb.go create mode 100644 pkg/services/control/ir/types_neofs.pb.go create mode 100644 pkg/services/control/service_neofs.pb.go create mode 100644 pkg/services/control/types_neofs.pb.go diff --git a/Makefile b/Makefile index b8948376..676537f4 100644 --- a/Makefile +++ b/Makefile @@ -66,11 +66,14 @@ protoc: @GOPRIVATE=github.com/nspcc-dev go mod vendor # Install specific version for protobuf lib @go list -f '{{.Path}}/...@{{.Version}}' -m github.com/golang/protobuf | xargs go install -v + @GOBIN=$(abspath $(BIN)) go install -mod=mod -v github.com/nspcc-dev/neofs-api-go/v2/util/protogen # Protoc generate @for f in `find . -type f -name '*.proto' -not -path './vendor/*'`; do \ echo "⇒ Processing $$f "; \ protoc \ --proto_path=.:./vendor:/usr/local/include \ + --plugin=protoc-gen-go-neofs=$(BIN)/protogen \ + --go-neofs_out=. --go-neofs_opt=paths=source_relative \ --go_out=. --go_opt=paths=source_relative \ --go-grpc_opt=require_unimplemented_servers=false \ --go-grpc_out=. --go-grpc_opt=paths=source_relative $$f; \ diff --git a/cmd/neofs-adm/internal/modules/morph/internal/types.pb.go b/cmd/neofs-adm/internal/modules/morph/internal/types.pb.go index 03c18387734d7d6fef2091701a1da5af59fa06eb..e76a29ae52de34d8387ff76d2adba2f62bf34e30 100644 GIT binary patch delta 40 qcmX?Lbiimrh^(2O0hhkM0%t){eo20^0u+=P>ls?=nQSaPF987U8w*YV delta 40 qcmX?Lbiimrh^)DuA(y_s0%t){eo20^0u+=P>ls?=8Ez~*F987UObbl_ diff --git a/go.mod b/go.mod index 1c9484ef..8c8cb11a 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/nspcc-dev/hrw v1.0.9 github.com/nspcc-dev/neo-go v0.99.1-pre.0.20220609082921-2c9fb2044242 github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5 // indirect - github.com/nspcc-dev/neofs-api-go/v2 v2.12.2 + github.com/nspcc-dev/neofs-api-go/v2 v2.12.3-0.20220620114558-454b5c0ed7e9 github.com/nspcc-dev/neofs-contract v0.15.1 github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.4.0.20220616082321-e986f4780721 github.com/nspcc-dev/tzhash v1.5.2 @@ -34,7 +34,7 @@ require ( go.uber.org/zap v1.18.1 golang.org/x/term v0.0.0-20210429154555-c04ba851c2a4 google.golang.org/grpc v1.41.0 - google.golang.org/protobuf v1.27.1 + google.golang.org/protobuf v1.28.0 ) require ( diff --git a/go.sum b/go.sum index 895a5b6716a6009f49697d1fdcd10c3b667b186d..f2ff65ec27344928fd47dd64273f97f9ca48ab82 100644 GIT binary patch delta 269 zcmbQ&%r>KyZG-B}$xSnZCvTX+7ht4ktZSfWWME`uU}j`sXlP<;YN2alYLaA{Y>=8_ zo@%L(VQ7`-8x>Sx6zQC z78PMoWS&`&YUved7+9R-o9^s&q|ck&9&ao5)lDlH0}zOj%|ak^j$qwV(JC5&@<0eapseElqnt%n!5x0O_#{0RR91 delta 38 ocmX?5c%X1Xh_tz$A(y_s0%t){eo20^0u+=P>ls>Z%n!5x0O}753IG5A diff --git a/pkg/services/control/ir/service_grpc.pb.go b/pkg/services/control/ir/service_grpc.pb.go index bfdfc845d9aff904ccbb318212f49980e276fb26..edd84812717b57265f753eb0d1ab93f4bd26729d 100644 GIT binary patch delta 102 zcmbOr+bcK0EL>k-p)9qiI5R)5*oq6t(N!oY$}h=J)=f{%(@oFUO)n})Rwy&nGtx6a hmR3LpWyX3&hI)n|`QrT2qU2O7g~@4rsvAwC`2Y;_9Bu#r delta 10 RcmeB`n;<*EY~$uAJ^&T+1M2_) diff --git a/pkg/services/control/ir/service_neofs.pb.go b/pkg/services/control/ir/service_neofs.pb.go new file mode 100644 index 0000000000000000000000000000000000000000..77ce39f342072e51bd8d9322c53078ebe3400bbd GIT binary patch literal 5249 zcmeHLOHbQC5I)DhV#LXz#8&C8QZ5D5awtfI8$#8_9w#fD-E?=IM-l(Mvum$o2S^Z= zN?IaCa$?WS&f}Yz&xvC=ktxCm1uAARh2avWN*bB;=w5Fmdje&qBRIW;i_2>`J3YUS zf?&#$J2pZ{q%cb6LBJR*f7Td|AnB?6iR3?V+3t)$P5<1Md{SA$RLwy!c0VZrK&0tQb7%KI=a+j6NHRo zp2Cdf1w9(G8Ll1;xnOGP%tt|1hy=m~9DYNVoAJpQle;VYNm}N|7nv@*4e!D(gw820 zOc(BhPU)?)6g)IS`OcIcvm7SnRj-9mIZ#GY`mJ3GDzBwVQTYhZGoY|DRFI<>QHWgA zH*HhI1T3Oe^1|*B2%LLyl4E%;6I)hq?5avH6H7p)qyiL)EQCQtwV#i9GKQ3=Af$21 zbC@e`xEQ(YrOYrY`DB`-!F*|r!X;Ho&AG;-R_!X6sc@xHTTiD>URjd{h4*P-UR^?u zg_jnws!M2bbaOjg8thirMm6bStC%~7%Z-q9`25f>`z5*{7-L#z*oG2*JR;OMXa}9` z(#KYMz(<1FF6-_w{|{i^17tJYxt*;2J_w#$^!s5}_Qm}}(4h~>*j{N!xt}!H?l3GR z9X{#-9(D;Lq&Q=WMt7#s(C{`vr~3XJFukXQO*-JFl>U6%KBp#GD+)3j&L+Y)CRU9GiKcaK}c zO*Zj3dfy!cTZ<;1+eB>Gd6Zx@Hpgye6J;5}Vg1t`)fnl}w^{P3tsA*c>l-sMJ(WV^ zb}H81WM`t7xbCBYLfHCr94?}g;1OLig|<^_Pu_N!yggC(MjJfA-rjVbS-g4o9__F# z09-Aj6_wwu?(=-Yb=3MhP`mN=gfoVB^^#TgsYi(K0mAgIwdfi$y{C`5wSG6+GtQm= i8-R$5r+3dWu^OK((n$a0{BM-g2m1Fpr$6~Mr1Li(Jq}v{ literal 0 HcmV?d00001 diff --git a/pkg/services/control/ir/types.pb.go b/pkg/services/control/ir/types.pb.go index 4795b092c14d9bc002fabdc1b3c5bac0b2cf0c8e..13f4499ed6097b7223c3b3c7b8cd4518f3d1ff98 100644 GIT binary patch delta 38 ocmdmLv(;uoh_soW0hhkM0%t){eo20^0u+=P>lqnt%s(az0N82@+W-In delta 38 ocmdmLv(;uoh_tz$A(y_s0%t){eo20^0u+=P>ls>Z%s(az0NBV1k?4Ayufw)Ah?nyp6DxB_nX@N<6;-)`^j3&sX6o_LEO zjP}+j#$-Pj>*2bUz8kATn7-6*5Mo>7v5XR1K1k9lk2mG$r7Gho*Nl}V96YZS9^`KX zi+;4)f$tDp_+c72fz-)VH8#)~+jCzKFH!9%h=L9#Iy&)qkI+a|H5|DbX{+N$eBG*~ z=5~(q1#3nvAUnZ_gKRYqO8J?eEQc)GklN?)%&y|%<1X1LzRVt7@ST0yz^V9-bN)W$ zCP2a|gh|(o7TC+#41RFyIN!)L7_)A2T|Bl#CDPnHy5EVmMQTh8j29<UAt3N6p$vz~^=f~F?{*y&re9O9QChbx&{{W2@WljJ9 literal 0 HcmV?d00001 diff --git a/pkg/services/control/service.go b/pkg/services/control/service.go index fc0bee47..f120b388 100644 --- a/pkg/services/control/service.go +++ b/pkg/services/control/service.go @@ -1,30 +1,5 @@ package control -import ( - "github.com/nspcc-dev/neofs-api-go/v2/util/proto" -) - -// StableMarshal reads binary representation of health check request body -// in protobuf binary format. -// -// 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, error) { - return buf, nil -} - -// StableSize returns binary size of health check request body -// in protobuf binary format. -// -// Structures with the same field values have the same binary size. -func (x *HealthCheckRequest_Body) StableSize() int { - return 0 -} - // SetBody sets health check request body. func (x *HealthCheckRequest) SetBody(v *HealthCheckRequest_Body) { if x != nil { @@ -32,33 +7,6 @@ func (x *HealthCheckRequest) SetBody(v *HealthCheckRequest_Body) { } } -// SetSignature sets signature of the health check request body. -func (x *HealthCheckRequest) SetSignature(body *Signature) { - if x != nil { - x.Signature = body - } -} - -// ReadSignedData reads signed data of health check request to buf. -// -// 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) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf) -} - -// SignedDataSize returns binary size of the signed data -// of health check request. -// -// Structures with the same field values have the same signed data size. -func (x *HealthCheckRequest) SignedDataSize() int { - return x.GetBody().StableSize() -} - // SetNetmapStatus sets status of the storage node in NeoFS network map. func (x *HealthCheckResponse_Body) SetNetmapStatus(v NetmapStatus) { if x != nil { @@ -73,54 +21,6 @@ func (x *HealthCheckResponse_Body) SetHealthStatus(v HealthStatus) { } } -const ( - _ = iota - healthRespBodyStatusFNum - healthRespBodyHealthStatusFNum -) - -// StableMarshal reads binary representation of health check response body -// in protobuf binary format. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// 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 { - if x == nil { - return []byte{} - } - - if sz := x.StableSize(); len(buf) < sz { - buf = make([]byte, sz) - } - - var offset int - - offset = proto.EnumMarshal(healthRespBodyStatusFNum, buf[offset:], int32(x.NetmapStatus)) - proto.EnumMarshal(healthRespBodyHealthStatusFNum, buf[offset:], int32(x.HealthStatus)) - - return buf -} - -// StableSize returns binary size of health check response body -// in protobuf binary format. -// -// Structures with the same field values have the same binary size. -func (x *HealthCheckResponse_Body) StableSize() int { - if x == nil { - return 0 - } - - size := 0 - - size += proto.EnumSize(healthRespBodyStatusFNum, int32(x.NetmapStatus)) - size += proto.EnumSize(healthRespBodyHealthStatusFNum, int32(x.HealthStatus)) - - return size -} - // SetBody sets health check response body. func (x *HealthCheckResponse) SetBody(v *HealthCheckResponse_Body) { if x != nil { @@ -128,54 +28,6 @@ func (x *HealthCheckResponse) SetBody(v *HealthCheckResponse_Body) { } } -// SetSignature sets signature of the health check response body. -func (x *HealthCheckResponse) SetSignature(v *Signature) { - if x != nil { - x.Signature = v - } -} - -// ReadSignedData reads signed data of health check response to buf. -// -// 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) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -// SignedDataSize returns binary size of the signed data -// of health check response. -// -// Structures with the same field values have the same signed data size. -func (x *HealthCheckResponse) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// StableMarshal reads binary representation of netmap snapshot request body -// in protobuf binary format. -// -// 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 *NetmapSnapshotRequest_Body) StableMarshal(buf []byte) ([]byte, error) { - return buf, nil -} - -// StableSize returns binary size of netmap snapshot request body -// in protobuf binary format. -// -// Structures with the same field values have the same binary size. -func (x *NetmapSnapshotRequest_Body) StableSize() int { - return 0 -} - // SetBody sets get netmap snapshot request body. func (x *NetmapSnapshotRequest) SetBody(v *NetmapSnapshotRequest_Body) { if x != nil { @@ -183,33 +35,6 @@ func (x *NetmapSnapshotRequest) SetBody(v *NetmapSnapshotRequest_Body) { } } -// SetSignature sets signature of the netmap snapshot request body. -func (x *NetmapSnapshotRequest) SetSignature(body *Signature) { - if x != nil { - x.Signature = body - } -} - -// ReadSignedData reads signed data of netmap snapshot request to buf. -// -// 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) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf) -} - -// SignedDataSize returns binary size of the signed data -// of netmap snapshot request. -// -// Structures with the same field values have the same signed data size. -func (x *NetmapSnapshotRequest) SignedDataSize() int { - return x.GetBody().StableSize() -} - // SetNetmap sets structure of the current network map. func (x *NetmapSnapshotResponse_Body) SetNetmap(v *Netmap) { if x != nil { @@ -217,49 +42,6 @@ func (x *NetmapSnapshotResponse_Body) SetNetmap(v *Netmap) { } } -const ( - _ = iota - snapshotRespBodyNetmapFNum -) - -// StableMarshal reads binary representation of netmap snapshot response body -// in protobuf binary format. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *NetmapSnapshotResponse_Body) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - - if sz := x.StableSize(); len(buf) < sz { - buf = make([]byte, sz) - } - - proto.NestedStructureMarshal(snapshotRespBodyNetmapFNum, buf, x.Netmap) - - return buf -} - -// StableSize returns binary size of netmap snapshot response body -// in protobuf binary format. -// -// Structures with the same field values have the same binary size. -func (x *NetmapSnapshotResponse_Body) StableSize() int { - if x == nil { - return 0 - } - - size := 0 - - size += proto.NestedStructureSize(snapshotRespBodyNetmapFNum, x.Netmap) - - return size -} - // SetBody sets get netmap snapshot response body. func (x *NetmapSnapshotResponse) SetBody(v *NetmapSnapshotResponse_Body) { if x != nil { @@ -267,33 +49,6 @@ func (x *NetmapSnapshotResponse) SetBody(v *NetmapSnapshotResponse_Body) { } } -// SetSignature sets signature of the get netmap snapshot response body. -func (x *NetmapSnapshotResponse) SetSignature(v *Signature) { - if x != nil { - x.Signature = v - } -} - -// ReadSignedData reads signed data of netmap snapshot response to buf. -// -// 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) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -// SignedDataSize returns binary size of the signed data -// of netmap snapshot response. -// -// Structures with the same field values have the same signed data size. -func (x *NetmapSnapshotResponse) SignedDataSize() int { - return x.GetBody().StableSize() -} - // SetStatus sets new storage node status in NeoFS network map. func (x *SetNetmapStatusRequest_Body) SetStatus(v NetmapStatus) { if x != nil { @@ -301,49 +56,6 @@ func (x *SetNetmapStatusRequest_Body) SetStatus(v NetmapStatus) { } } -const ( - _ = iota - setNetmapStatusReqBodyStatusFNum -) - -// StableMarshal reads binary representation of set netmap status request body -// in protobuf binary format. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *SetNetmapStatusRequest_Body) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - - if sz := x.StableSize(); len(buf) < sz { - buf = make([]byte, sz) - } - - proto.EnumMarshal(setNetmapStatusReqBodyStatusFNum, buf, int32(x.Status)) - - return buf -} - -// StableSize returns binary size of netmap status response body -// in protobuf binary format. -// -// Structures with the same field values have the same binary size. -func (x *SetNetmapStatusRequest_Body) StableSize() int { - if x == nil { - return 0 - } - - size := 0 - - size += proto.EnumSize(setNetmapStatusReqBodyStatusFNum, int32(x.Status)) - - return size -} - // SetBody sets body of the set netmap status request . func (x *SetNetmapStatusRequest) SetBody(v *SetNetmapStatusRequest_Body) { if x != nil { @@ -351,53 +63,6 @@ func (x *SetNetmapStatusRequest) SetBody(v *SetNetmapStatusRequest_Body) { } } -// SetSignature sets signature of the set netmap status request body. -func (x *SetNetmapStatusRequest) SetSignature(body *Signature) { - if x != nil { - x.Signature = body - } -} - -// ReadSignedData reads signed data of set netmap status request to buf. -// -// 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 *SetNetmapStatusRequest) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -// SignedDataSize returns binary size of the signed data -// of set netmap status request. -// -// Structures with the same field values have the same signed data size. -func (x *SetNetmapStatusRequest) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// StableMarshal reads binary representation of set netmap status response body -// in protobuf binary format. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *SetNetmapStatusResponse_Body) StableMarshal(buf []byte) []byte { - return buf -} - -// StableSize returns binary size of set netmap status response body -// in protobuf binary format. -// -// Structures with the same field values have the same binary size. -func (x *SetNetmapStatusResponse_Body) StableSize() int { - return 0 -} - // SetBody sets set body of the netmap status response. func (x *SetNetmapStatusResponse) SetBody(v *SetNetmapStatusResponse_Body) { if x != nil { @@ -405,83 +70,13 @@ func (x *SetNetmapStatusResponse) SetBody(v *SetNetmapStatusResponse_Body) { } } -// SetSignature sets signature of the set netmap status response body. -func (x *SetNetmapStatusResponse) SetSignature(v *Signature) { - if x != nil { - x.Signature = v - } -} - -// ReadSignedData reads signed data of set netmap status response to buf. -// -// 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 *SetNetmapStatusResponse) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -// SignedDataSize returns binary size of the signed data -// of set netmap status response. -// -// Structures with the same field values have the same signed data size. -func (x *SetNetmapStatusResponse) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// SetAddressList sets a list of objects to be removed in NeoFS API binary format. +// SetAddressList sets list of objects to be removed in NeoFS API binary format. func (x *DropObjectsRequest_Body) SetAddressList(v [][]byte) { if x != nil { x.AddressList = v } } -const ( - _ = iota - addrListReqBodyStatusFNum -) - -// StableMarshal reads binary representation of "Drop objects" request body -// in protobuf binary format. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *DropObjectsRequest_Body) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - - if sz := x.StableSize(); len(buf) < sz { - buf = make([]byte, sz) - } - - proto.RepeatedBytesMarshal(addrListReqBodyStatusFNum, buf, x.AddressList) - - return buf -} - -// StableSize returns binary size of "Drop objects" response body -// in protobuf binary format. -// -// Structures with the same field values have the same binary size. -func (x *DropObjectsRequest_Body) StableSize() int { - if x == nil { - return 0 - } - - size := 0 - - size += proto.RepeatedBytesSize(addrListReqBodyStatusFNum, x.AddressList) - - return size -} - // SetBody sets body of the set "Drop objects" request. func (x *DropObjectsRequest) SetBody(v *DropObjectsRequest_Body) { if x != nil { @@ -489,52 +84,6 @@ func (x *DropObjectsRequest) SetBody(v *DropObjectsRequest_Body) { } } -// SetSignature sets signature of the "Drop objects" request body. -func (x *DropObjectsRequest) SetSignature(body *Signature) { - if x != nil { - x.Signature = body - } -} - -// ReadSignedData reads signed data of "Drop objects" request to buf. -// -// 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 *DropObjectsRequest) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -// SignedDataSize returns binary size of the signed data of "Drop objects" request. -// -// Structures with the same field values have the same signed data size. -func (x *DropObjectsRequest) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// StableMarshal reads binary representation of "Drop objects" response body -// in protobuf binary format. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *DropObjectsResponse_Body) StableMarshal(buf []byte) []byte { - return buf -} - -// StableSize returns binary size of "Drop objects" response body -// in protobuf binary format. -// -// Structures with the same field values have the same binary size. -func (x *DropObjectsResponse_Body) StableSize() int { - return 0 -} - // SetBody sets set body of the "Drop objects" response. func (x *DropObjectsResponse) SetBody(v *DropObjectsResponse_Body) { if x != nil { @@ -542,52 +91,6 @@ func (x *DropObjectsResponse) SetBody(v *DropObjectsResponse_Body) { } } -// SetSignature sets signature of the "Drop objects" response body. -func (x *DropObjectsResponse) SetSignature(v *Signature) { - if x != nil { - x.Signature = v - } -} - -// ReadSignedData reads signed data of "Drop objects" response to buf. -// -// 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 *DropObjectsResponse) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -// SignedDataSize returns binary size of the signed data of "Drop objects" response. -// -// Structures with the same field values have the same signed data size. -func (x *DropObjectsResponse) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// StableMarshal reads binary representation of list shards request body -// in protobuf binary format. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *ListShardsRequest_Body) StableMarshal(buf []byte) []byte { - return buf -} - -// StableSize returns binary size of list shards request body -// in protobuf binary format. -// -// Structures with the same field values have the same binary size. -func (x *ListShardsRequest_Body) StableSize() int { - return 0 -} - // SetBody sets list shards request body. func (x *ListShardsRequest) SetBody(v *ListShardsRequest_Body) { if x != nil { @@ -595,33 +98,6 @@ func (x *ListShardsRequest) SetBody(v *ListShardsRequest_Body) { } } -// SetSignature sets signature of the list shards request body. -func (x *ListShardsRequest) SetSignature(body *Signature) { - if x != nil { - x.Signature = body - } -} - -// ReadSignedData reads signed data of list shards request to buf. -// -// 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 *ListShardsRequest) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -// SignedDataSize returns binary size of the signed data -// of list shards request. -// -// Structures with the same field values have the same signed data size. -func (x *ListShardsRequest) SignedDataSize() int { - return x.GetBody().StableSize() -} - // SetShards sets shards of the storage node. func (x *ListShardsResponse_Body) SetShards(v []*ShardInfo) { if x != nil { @@ -629,55 +105,6 @@ func (x *ListShardsResponse_Body) SetShards(v []*ShardInfo) { } } -const ( - _ = iota - listShardsRespBodyShardsFNum -) - -// StableMarshal reads binary representation of list shards response body -// in protobuf binary format. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *ListShardsResponse_Body) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - - if sz := x.StableSize(); len(buf) < sz { - buf = make([]byte, sz) - } - - var offset int - - for i := range x.Shards { - offset += proto.NestedStructureMarshal(listShardsRespBodyShardsFNum, buf[offset:], x.Shards[i]) - } - - return buf -} - -// StableSize returns binary size of list shards response body -// in protobuf binary format. -// -// Structures with the same field values have the same binary size. -func (x *ListShardsResponse_Body) StableSize() int { - if x == nil { - return 0 - } - - size := 0 - - for i := range x.Shards { - size += proto.NestedStructureSize(listShardsRespBodyShardsFNum, x.Shards[i]) - } - - return size -} - // SetBody sets list shards response body. func (x *ListShardsResponse) SetBody(v *ListShardsResponse_Body) { if x != nil { @@ -685,33 +112,6 @@ func (x *ListShardsResponse) SetBody(v *ListShardsResponse_Body) { } } -// SetSignature sets signature of the list shards response body. -func (x *ListShardsResponse) SetSignature(v *Signature) { - if x != nil { - x.Signature = v - } -} - -// ReadSignedData reads signed data of list shards response to buf. -// -// 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 *ListShardsResponse) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -// SignedDataSize returns binary size of the signed data -// of list shards response. -// -// Structures with the same field values have the same signed data size. -func (x *ListShardsResponse) SignedDataSize() int { - return x.GetBody().StableSize() -} - // SetShardID sets shard ID whose mode is requested to be set. func (x *SetShardModeRequest_Body) SetShardID(v []byte) { if v != nil { @@ -729,55 +129,6 @@ func (x *SetShardModeRequest_Body) ClearErrorCounter(reset bool) { x.ResetErrorCounter = reset } -const ( - _ = iota - setShardModeReqBodyShardIDFNum - setShardModeReqBodyModeFNum - setShardModeReqBodyResetCounterFNum -) - -// StableMarshal reads binary representation of set shard mode request body -// in protobuf binary format. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *SetShardModeRequest_Body) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - - if sz := x.StableSize(); len(buf) < sz { - buf = make([]byte, sz) - } - - offset := proto.BytesMarshal(setShardModeReqBodyShardIDFNum, buf, x.Shard_ID) - offset += proto.EnumMarshal(setShardModeReqBodyModeFNum, buf[offset:], int32(x.Mode)) - proto.BoolMarshal(setShardModeReqBodyResetCounterFNum, buf[offset:], x.ResetErrorCounter) - - return buf -} - -// StableSize returns binary size of set shard mode response body -// in protobuf binary format. -// -// Structures with the same field values have the same binary size. -func (x *SetShardModeRequest_Body) StableSize() int { - if x == nil { - return 0 - } - - size := 0 - - size += proto.BytesSize(setShardModeReqBodyShardIDFNum, x.Shard_ID) - size += proto.EnumSize(setShardModeReqBodyModeFNum, int32(x.Mode)) - size += proto.BoolSize(setShardModeReqBodyResetCounterFNum, x.ResetErrorCounter) - - return size -} - // SetBody sets request body. func (x *SetShardModeRequest) SetBody(v *SetShardModeRequest_Body) { if x != nil { @@ -785,53 +136,6 @@ func (x *SetShardModeRequest) SetBody(v *SetShardModeRequest_Body) { } } -// SetSignature sets signature of the request body. -func (x *SetShardModeRequest) SetSignature(v *Signature) { - if x != nil { - x.Signature = v - } -} - -// ReadSignedData reads signed data of the set shard mode request to buf. -// -// 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 *SetShardModeRequest) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -// SignedDataSize returns binary size of the signed data -// of the set shard mode request. -// -// Structures with the same field values have the same signed data size. -func (x *SetShardModeRequest) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// StableMarshal reads binary representation of the set shard mode response body -// in protobuf binary format. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *SetShardModeResponse_Body) StableMarshal(buf []byte) []byte { - return buf -} - -// StableSize returns binary size of the set shard mode response body -// in protobuf binary format. -// -// Structures with the same field values have the same binary size. -func (x *SetShardModeResponse_Body) StableSize() int { - return 0 -} - // SetBody sets body of the set shard mode response. func (x *SetShardModeResponse) SetBody(v *SetShardModeResponse_Body) { if x != nil { @@ -839,33 +143,6 @@ func (x *SetShardModeResponse) SetBody(v *SetShardModeResponse_Body) { } } -// SetSignature sets signature of the set shard mode response body. -func (x *SetShardModeResponse) SetSignature(v *Signature) { - if x != nil { - x.Signature = v - } -} - -// ReadSignedData reads signed data of the set shard mode response to buf. -// -// 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 *SetShardModeResponse) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -// SignedDataSize returns binary size of the signed data -// of the set shard mode response. -// -// Structures with the same field values have the same signed data size. -func (x *SetShardModeResponse) SignedDataSize() int { - return x.GetBody().StableSize() -} - // SetShardID sets shard ID for the dump shard request. func (x *DumpShardRequest_Body) SetShardID(id []byte) { x.Shard_ID = id @@ -881,53 +158,6 @@ func (x *DumpShardRequest_Body) SetIgnoreErrors(ignore bool) { x.IgnoreErrors = ignore } -const ( - _ = iota - dumpShardReqBodyShardIDFNum - dumpShardReqBodyFilepathFNum - dumpShardReqBodyIgnoreErrorsFNum -) - -// StableMarshal reads binary representation of request body binary format. -// -// If buffer length is less than StableSize(), new buffer is allocated. -// -// Returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *DumpShardRequest_Body) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - - if sz := x.StableSize(); len(buf) < sz { - buf = make([]byte, sz) - } - - offset := proto.BytesMarshal(dumpShardReqBodyShardIDFNum, buf, x.Shard_ID) - offset += proto.StringMarshal(dumpShardReqBodyFilepathFNum, buf[offset:], x.Filepath) - proto.BoolMarshal(dumpShardReqBodyIgnoreErrorsFNum, buf[offset:], x.IgnoreErrors) - - return buf -} - -// StableSize returns binary size of the request body in protobuf binary format. -// -// Structures with the same field values have the same binary size. -func (x *DumpShardRequest_Body) StableSize() int { - if x == nil { - return 0 - } - - size := 0 - - size += proto.BytesSize(dumpShardReqBodyShardIDFNum, x.Shard_ID) - size += proto.StringSize(dumpShardReqBodyFilepathFNum, x.Filepath) - size += proto.BoolSize(dumpShardReqBodyIgnoreErrorsFNum, x.IgnoreErrors) - - return size -} - // SetBody sets request body. func (x *DumpShardRequest) SetBody(v *DumpShardRequest_Body) { if x != nil { @@ -935,51 +165,6 @@ func (x *DumpShardRequest) SetBody(v *DumpShardRequest_Body) { } } -// SetSignature sets body signature of the request. -func (x *DumpShardRequest) SetSignature(v *Signature) { - if x != nil { - x.Signature = v - } -} - -// ReadSignedData reads signed data from request to buf. -// -// 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 *DumpShardRequest) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -// SignedDataSize returns size of the request signed data in bytes. -// -// Structures with the same field values have the same signed data size. -func (x *DumpShardRequest) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// StableMarshal reads binary representation of the response body in protobuf binary format. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *DumpShardResponse_Body) StableMarshal(buf []byte) []byte { - return buf -} - -// StableSize returns binary size of the response body -// in protobuf binary format. -// -// Structures with the same field values have the same binary size. -func (x *DumpShardResponse_Body) StableSize() int { - return 0 -} - // SetBody sets response body. func (x *DumpShardResponse) SetBody(v *DumpShardResponse_Body) { if x != nil { @@ -987,32 +172,6 @@ func (x *DumpShardResponse) SetBody(v *DumpShardResponse_Body) { } } -// SetSignature sets response body signature. -func (x *DumpShardResponse) SetSignature(v *Signature) { - if x != nil { - x.Signature = v - } -} - -// ReadSignedData reads signed data from response to buf. -// -// If buffer length is less than 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 *DumpShardResponse) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -// SignedDataSize returns binary size of the signed data. -// -// Structures with the same field values have the same signed data size. -func (x *DumpShardResponse) SignedDataSize() int { - return x.GetBody().StableSize() -} - // SetShardID sets shard ID for the restore shard request. func (x *RestoreShardRequest_Body) SetShardID(id []byte) { x.Shard_ID = id @@ -1028,53 +187,6 @@ func (x *RestoreShardRequest_Body) SetIgnoreErrors(ignore bool) { x.IgnoreErrors = ignore } -const ( - _ = iota - restoreShardReqBodyShardIDFNum - restoreShardReqBodyFilepathFNum - restoreShardReqBodyIgnoreErrorsFNum -) - -// StableMarshal reads binary representation of request body binary format. -// -// If buffer length is less than StableSize(), new buffer is allocated. -// -// Returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *RestoreShardRequest_Body) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - - if sz := x.StableSize(); len(buf) < sz { - buf = make([]byte, sz) - } - - offset := proto.BytesMarshal(restoreShardReqBodyShardIDFNum, buf, x.Shard_ID) - offset += proto.StringMarshal(restoreShardReqBodyFilepathFNum, buf[offset:], x.Filepath) - proto.BoolMarshal(restoreShardReqBodyIgnoreErrorsFNum, buf[offset:], x.IgnoreErrors) - - return buf -} - -// StableSize returns binary size of the request body in protobuf binary format. -// -// Structures with the same field values have the same binary size. -func (x *RestoreShardRequest_Body) StableSize() int { - if x == nil { - return 0 - } - - size := 0 - - size += proto.BytesSize(restoreShardReqBodyShardIDFNum, x.Shard_ID) - size += proto.StringSize(restoreShardReqBodyFilepathFNum, x.Filepath) - size += proto.BoolSize(restoreShardReqBodyIgnoreErrorsFNum, x.IgnoreErrors) - - return size -} - // SetBody sets request body. func (x *RestoreShardRequest) SetBody(v *RestoreShardRequest_Body) { if x != nil { @@ -1082,80 +194,9 @@ func (x *RestoreShardRequest) SetBody(v *RestoreShardRequest_Body) { } } -// SetSignature sets body signature of the request. -func (x *RestoreShardRequest) SetSignature(v *Signature) { - if x != nil { - x.Signature = v - } -} - -// ReadSignedData reads signed data from request to buf. -// -// 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 *RestoreShardRequest) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -// SignedDataSize returns size of the request signed data in bytes. -// -// Structures with the same field values have the same signed data size. -func (x *RestoreShardRequest) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// StableMarshal reads binary representation of the response body in protobuf binary format. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *RestoreShardResponse_Body) StableMarshal(buf []byte) []byte { - return buf -} - -// StableSize returns binary size of the response body -// in protobuf binary format. -// -// Structures with the same field values have the same binary size. -func (x *RestoreShardResponse_Body) StableSize() int { - return 0 -} - // SetBody sets response body. func (x *RestoreShardResponse) SetBody(v *RestoreShardResponse_Body) { if x != nil { x.Body = v } } - -// SetSignature sets response body signature. -func (x *RestoreShardResponse) SetSignature(v *Signature) { - if x != nil { - x.Signature = v - } -} - -// ReadSignedData reads signed data from response to buf. -// -// If buffer length is less than 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 *RestoreShardResponse) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -// SignedDataSize returns binary size of the signed data. -// -// Structures with the same field values have the same signed data size. -func (x *RestoreShardResponse) SignedDataSize() int { - return x.GetBody().StableSize() -} diff --git a/pkg/services/control/service.pb.go b/pkg/services/control/service.pb.go index 87e8913a591042833014f06d276b38a763c30764..435cd25f3c17034fd84863f3af1c16b230378b48 100644 GIT binary patch delta 20 ccmbQVi*?d2)(N>RMuvKZjfGna85hO?08uLkd;kCd delta 20 ccmbQVi*?d2)(N>RhL(CJjfGna85hO?08xksh5!Hn diff --git a/pkg/services/control/service_grpc.pb.go b/pkg/services/control/service_grpc.pb.go index db08a63b5a10168bcab00a938dd0a3cf79f77f1f..5c088311a3e2e2aa92a6bc3a2cb19575515fe53e 100644 GIT binary patch delta 15 WcmZoEZ7H2l%VK1xXSlJE*$MzJ4h1y; delta 15 WcmZoEZ7H2l%VKD$XR@)8*$MzJO$9#y diff --git a/pkg/services/control/service_neofs.pb.go b/pkg/services/control/service_neofs.pb.go new file mode 100644 index 0000000000000000000000000000000000000000..3b4616e2fc58deb6e199e00640b5bfcae58c7449 GIT binary patch literal 41905 zcmeHQO>f&c5Ix7gg6PT4CN{QvE0Dvs>Fx&Dwm{Nb5fqF>+uF*MSEBN&?vLo1wH=kT;Rf$ck|mQ^9<4^FX$7BqHw=es;QwPC1K~$()>j zAn!kXByZ0zKF%kTE%m<86(e56MI42bNwC>Qu^=y2fmo+Eb1&K~c(V1pQ=i=~)FV#m zHh||XZeK1^5rhlX%8SWlu^?B1-h}Kb_>Ym8i8SU35o<;g`GaUl?n%J2PTizSvW(&l z6?3>RyERTdxP>L;4w}yHqZ>w+0SkR{OT!d?wWhbM{MAjsY5brbKc6g9?vd#|IsS{$ zP^{mqnfK+A{R?-A&#xo@VOHtgbVjDCQvnw<@^x~Q^;SJ;@~twIcQj7cG$fns@1!<_ zyaU-tvVJFO3i4h@vCm>X!iyz=VJ}%sLdI7x#2|rxC31==C-?Jm@}{#B!r7g^9Im5b z781REusDul!nhZuT(B6{{%#$3YvKn!;gL``-;ujG5CLDQ+4HHOu;iO< z$OH=?JkWBbCU*_8?(g#(|? z03vYXEseo-FB2xfd5g(W{_i$m>Yf5Np@C1?)vvBANZs=R0N45hEZ~JpaudH~)Rz}9 z|6Dq^We|pm8nTKeiTX|ExMUzw9&e{ZE*_`M?QooOWwtuwD!{WgMG_+w4}3rWlL_ge zrZXeFX}4_LU4$Lw%V3pcsEM-(4v|?dZ60|zkQ>30ABj8F=gIbVjMGGy5q1jeQDL~s zCYqzy)&a1UXbM6(5gjoPCYT91$I52|Wm%Eq;=ih?ic2SFa+dVe7KU6*>oYU4WE=5> z?WSU8Bzw!#jj}#)D1fcsUQX{J7K#ns0$mbmBE3}09pFLq9T_Do??AfeGTpNvrD8Z1 zzW1yFP$E=!uMzb$0PB#g2f^w?8j(*wqy@!g3@mpLZW+C%G0KqZTQAdkk>@VRLGA4_ zW7i1Lh6I>)&CYAc)IDvOe6b~~+jz?Z8s=UJ>E$l1G;))QAkqCvEU=9L7Wg!{DhNp6 zl}E*N^*~L0^+9!Y%Y){+d4%V5o2(;&!sAed$KC6wJ-r1J=T;keCfPEd)ZAmizWV=m@D&RW_Y6+O#1=l80S zHCLkoC-@mHNtW9+DQXx>Z0SxBgEe9$ZuI-mPEmAu|tB{V~!Ehmn- zZD&gv_gHj?Lt8a7-H=ptX1aks$JnQR2{f@#+c->1A9~4gH%J^d(V8lud)ly8%uElb zF5b>QTOm3^_SrVpUf5?_Skraq8V7D3(h)RxY{EO6o8$q%?KQxR9uo zMFg0rKHhr~h!9o)Iwlx4R{=RFa?naCT01~A^6mRBq@PGXf9eY~>_VXxo+D(QwsH1CI&BRD z5go2LXbcF2!GXRuXV)rr2PZeru2{x|WDLnz8yVBuLpDR*fJZilY^-lKR^W5&bW9Jl ze?F#L9yB470^QY`#{T~LALeNt%hPtRVRvkDlZ-V+gj5WvScQtU;-eevNW_qc^+3dI z=o}#pvkbEr5@u<4G!!i3l)G!?;7!IPAg|6yOgX$)8(!w5IGlPht9gv0R<>JaXtO&$ z1=o-n*Y@VFfy4jJ&{ zjT8?W59JdG_6)8So+Ia~+E4dRR&~RJW~;LEl54($@4!5=WUy8$s2=zE;v9IWNnMK* z$dz|&%VwKz<9;1Qp<=eb$=BpuvV@7Z^1W1VvTv1O1)_VOUfG2shr^@7ukK$PbIkx< zkF3>m&W%^{>T}K-*%5}2Q^!hg|$<&ZR}uQxvxTiVzfL9TR4EE@O9u zax>#@8x(RfXWh0VqM5_vDAB~knxpR zlOQ1>yl#?+HRbX&RD}+l9Qqe0b|J{&sE86Js00b!FsR{Tp-*mUn6iYd=`91O=fBFo zv@8|SO19Rr>ZnqpU)T>J4!eZfc~;$1OBptvO&a#uB)bP2Ayu{xv=_2$ZFxj=Iokp3 zK2DD{mX6g}n!vOyqxSpuRGOQ*rEO5i$&iz^aWMUlz2jW~a!Ijw?ATV?v&StyZ1k*5o1%%ZCp!AlGRcpqvHTyO4r@;U literal 0 HcmV?d00001 diff --git a/pkg/services/control/types.go b/pkg/services/control/types.go index 9c4fc09c..4d4c1119 100644 --- a/pkg/services/control/types.go +++ b/pkg/services/control/types.go @@ -1,7 +1,6 @@ package control import ( - "github.com/nspcc-dev/neofs-api-go/v2/util/proto" "google.golang.org/protobuf/encoding/protojson" ) @@ -40,62 +39,6 @@ func (x *NodeInfo_Attribute) SetParents(v []string) { } } -const ( - _ = iota - nodeAttrKeyFNum - nodeAttrValueFNum - nodeAttrParentsFNum -) - -// StableMarshal reads binary representation of node attribute -// in protobuf binary format. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *NodeInfo_Attribute) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - - if sz := x.StableSize(); len(buf) < sz { - buf = make([]byte, sz) - } - - offset := proto.StringMarshal(nodeAttrKeyFNum, buf, x.Key) - offset += proto.StringMarshal(nodeAttrValueFNum, buf[offset:], x.Value) - - for i := range x.Parents { - offset += proto.StringMarshal(nodeAttrParentsFNum, buf[offset:], x.Parents[i]) - } - - return buf -} - -// StableSize returns binary size of node attribute -// in protobuf binary format. -// -// Structures with the same field values have the same binary size. -func (x *NodeInfo_Attribute) StableSize() int { - if x == nil { - return 0 - } - - size := 0 - - size += proto.StringSize(nodeAttrKeyFNum, x.Key) - size += proto.StringSize(nodeAttrValueFNum, x.Value) - - parents := x.GetParents() - for i := range parents { - size += proto.StringSize(nodeAttrParentsFNum, parents[i]) - } - - return size -} - // SetPublicKey sets public key of the NeoFS node in a binary format. func (x *NodeInfo) SetPublicKey(v []byte) { if x != nil { @@ -124,66 +67,6 @@ func (x *NodeInfo) SetState(v NetmapStatus) { } } -const ( - _ = iota - nodePubKeyFNum - nodeAddrFNum - nodeAttrsFNum - nodeStateFNum -) - -// StableMarshal reads binary representation of node information -// in protobuf binary format. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *NodeInfo) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - - if sz := x.StableSize(); len(buf) < sz { - buf = make([]byte, sz) - } - - offset := proto.BytesMarshal(nodePubKeyFNum, buf, x.PublicKey) - offset += proto.RepeatedStringMarshal(nodeAddrFNum, buf[offset:], x.Addresses) - - for i := range x.Attributes { - offset += proto.NestedStructureMarshal(nodeAttrsFNum, buf[offset:], x.Attributes[i]) - } - - proto.EnumMarshal(nodeStateFNum, buf[offset:], int32(x.State)) - - return buf -} - -// StableSize returns binary size of node information -// in protobuf binary format. -// -// Structures with the same field values have the same binary size. -func (x *NodeInfo) StableSize() int { - if x == nil { - return 0 - } - - size := 0 - - size += proto.BytesSize(nodePubKeyFNum, x.PublicKey) - size += proto.RepeatedStringSize(nodeAddrFNum, x.Addresses) - - for i := range x.Attributes { - size += proto.NestedStructureSize(nodeAttrsFNum, x.Attributes[i]) - } - - size += proto.EnumSize(nodeStateFNum, int32(x.State)) - - return size -} - // SetEpoch sets revision number of the network map. func (x *Netmap) SetEpoch(v uint64) { if x != nil { @@ -198,56 +81,6 @@ func (x *Netmap) SetNodes(v []*NodeInfo) { } } -const ( - _ = iota - netmapEpochFNum - netmapNodesFNum -) - -// StableMarshal reads binary representation of netmap in protobuf binary format. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *Netmap) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - - if sz := x.StableSize(); len(buf) < sz { - buf = make([]byte, sz) - } - - offset := proto.UInt64Marshal(netmapEpochFNum, buf, x.Epoch) - - for i := range x.Nodes { - offset += proto.NestedStructureMarshal(netmapNodesFNum, buf[offset:], x.Nodes[i]) - } - - return buf -} - -// StableSize returns binary size of netmap in protobuf binary format. -// -// Structures with the same field values have the same binary size. -func (x *Netmap) StableSize() int { - if x == nil { - return 0 - } - - size := 0 - - size += proto.UInt64Size(netmapEpochFNum, x.Epoch) - - for i := range x.Nodes { - size += proto.NestedStructureSize(netmapNodesFNum, x.Nodes[i]) - } - - return size -} - func (x *Netmap) MarshalJSON() ([]byte, error) { return protojson.MarshalOptions{ EmitUnpopulated: true, @@ -283,61 +116,3 @@ func (x *ShardInfo) SetMode(v ShardMode) { func (x *ShardInfo) SetErrorCount(count uint32) { x.ErrorCount = count } - -const ( - _ = iota - shardInfoIDFNum - shardInfoMetabaseFNum - shardInfoBlobstorFNum - shardInfoWriteCacheFNum - shardInfoModeFNum - shardInfoErrorCountFNum -) - -// StableSize returns binary size of shard information -// in protobuf binary format. -// -// Structures with the same field values have the same binary size. -func (x *ShardInfo) StableSize() int { - if x == nil { - return 0 - } - - size := 0 - - size += proto.BytesSize(shardInfoIDFNum, x.Shard_ID) - size += proto.StringSize(shardInfoMetabaseFNum, x.MetabasePath) - size += proto.StringSize(shardInfoBlobstorFNum, x.BlobstorPath) - size += proto.StringSize(shardInfoWriteCacheFNum, x.WritecachePath) - size += proto.EnumSize(shardInfoModeFNum, int32(x.Mode)) - size += proto.UInt32Size(shardInfoErrorCountFNum, x.ErrorCount) - - return size -} - -// StableMarshal reads binary representation of shard information -// in protobuf binary format. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *ShardInfo) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - - if sz := x.StableSize(); len(buf) < sz { - buf = make([]byte, sz) - } - - offset := proto.BytesMarshal(shardInfoIDFNum, buf, x.Shard_ID) - offset += proto.StringMarshal(shardInfoMetabaseFNum, buf[offset:], x.MetabasePath) - offset += proto.StringMarshal(shardInfoBlobstorFNum, buf[offset:], x.BlobstorPath) - offset += proto.StringMarshal(shardInfoWriteCacheFNum, buf[offset:], x.WritecachePath) - offset += proto.EnumMarshal(shardInfoModeFNum, buf[offset:], int32(x.Mode)) - proto.EnumMarshal(shardInfoErrorCountFNum, buf[offset:], int32(x.ErrorCount)) - - return buf -} diff --git a/pkg/services/control/types.pb.go b/pkg/services/control/types.pb.go index 16a8b75b5fe0f35c6b033a5b20b77e2f5c865049..2b1ee90089f7c4f868015d624773e9f901a4139f 100644 GIT binary patch delta 17 YcmX?bmhr$@#tFGBMuvKZ8w>r@07FIww*UYD delta 17 YcmX?bmhr$@#tFGBhL(CJ8w>r@07Hca!2kdN diff --git a/pkg/services/control/types_neofs.pb.go b/pkg/services/control/types_neofs.pb.go new file mode 100644 index 0000000000000000000000000000000000000000..5fe19be943814df060243c61d213e9692976c14d GIT binary patch literal 5782 zcmeHLO>f&c5Isk~V$hS_#xk08dnk}Y+vH#r`9R(69)h5tq>)8bCJmDE#}@tXJ0wj< zQe-FDL!mO5#+`$3idCbd=$8>_Uv#f>XTl@?=~Y zUXI-=ucBx?hN)pmiBtYBfwat6*_88Xj7u*c@o19n^y9(L($8;$~ziTzPWJ(vTgt`CLt!Lk6?n~ew zSi9P7A6KdjRVd9Q2dY<&3Q80+stwolOWWEqVN=;veK0%*fvaFncC0LAYVi<)eckqj zi4CAqQUQuoR>Ghn(5woc7Lf4_gfz~11uMl37c*D(j2T8)nJ-E-SZ-`kxTY4X71wy& zX!bMVTf#BRJD;v_F2sus7|L%PN(f;mlJ29}3yS+=O(ZlVxg#ovyJUauyOM4mm z=?#DVj*jR3K6#{)8d#RXbc)T~c!#c!BGVe|{J`$z2k$O#Oxtn3-XJ-$MMPo{X&t%KtM)opEP z;ySEL&~A&w1EBX*C!V1Wtv&pvN=lw~?c~iOIXQ7s@iEJ2{LpCWPx}gR_;3b_2^x>q z@lLO_+b5iA?u7gbwHFgV!nlx5Pwu^L`JLYsnw}S;nmhA%$99i6JsG(DoMiDugZisM z0hNJZJyagYhLB%}@YLz?G!^NPq31BBy-15QA=M78>L5`&n59vOKul_?-9BFRP4dvp z*&;y8iNfJS%ij}W-oJB(?$mOzkZIASU3Tkys%$wWbPhYkdO73t?2L2OKuW-U4@Jl$ zG$h!eLQjBfo9cUXqeGoKQQR}qPYb3pdmwrS?^}b83-M!ePRwu47PZ5TWA!D{36*KQ zVaCeDUSl`8d@5z4jZ}{rliIH1f9O1qDNBp)*t;R;ulphAk~GQAIL$09U`|h*q`kL+ zFYFtN&-V2MnZD>y&vfVkcmvaWC`FIWLp2t)73a~@Sc_PP{W}Jn7S|5@KNxR1=+}-= gACHKG)SlXVrZ64_Mz)