diff --git a/Makefile b/Makefile index b894837626..676537f484 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 03c1838773..e76a29ae52 100644 Binary files a/cmd/neofs-adm/internal/modules/morph/internal/types.pb.go and b/cmd/neofs-adm/internal/modules/morph/internal/types.pb.go differ diff --git a/go.mod b/go.mod index 1c9484efed..8c8cb11a3b 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 895a5b6716..f2ff65ec27 100644 Binary files a/go.sum and b/go.sum differ diff --git a/pkg/services/control/ir/service.go b/pkg/services/control/ir/service.go index 8f61c0c7c4..dc04e49043 100644 --- a/pkg/services/control/ir/service.go +++ b/pkg/services/control/ir/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() -} - // SetHealthStatus sets health status of the IR application. func (x *HealthCheckResponse_Body) SetHealthStatus(v HealthStatus) { if x != nil { @@ -66,79 +14,9 @@ func (x *HealthCheckResponse_Body) SetHealthStatus(v HealthStatus) { } } -const ( - _ = iota - 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) - } - - proto.EnumMarshal(healthRespBodyHealthStatusFNum, buf, 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(healthRespBodyHealthStatusFNum, int32(x.HealthStatus)) - - return size -} - // SetBody sets health check response body. func (x *HealthCheckResponse) SetBody(v *HealthCheckResponse_Body) { if x != nil { x.Body = v } } - -// 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() -} diff --git a/pkg/services/control/ir/service.pb.go b/pkg/services/control/ir/service.pb.go index 26a6120d02..bd6d26de96 100644 Binary files a/pkg/services/control/ir/service.pb.go and b/pkg/services/control/ir/service.pb.go differ diff --git a/pkg/services/control/ir/service_grpc.pb.go b/pkg/services/control/ir/service_grpc.pb.go index bfdfc845d9..edd8481271 100644 Binary files a/pkg/services/control/ir/service_grpc.pb.go and b/pkg/services/control/ir/service_grpc.pb.go differ 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 0000000000..77ce39f342 Binary files /dev/null and b/pkg/services/control/ir/service_neofs.pb.go differ diff --git a/pkg/services/control/ir/types.pb.go b/pkg/services/control/ir/types.pb.go index 4795b092c1..13f4499ed6 100644 Binary files a/pkg/services/control/ir/types.pb.go and b/pkg/services/control/ir/types.pb.go differ diff --git a/pkg/services/control/ir/types_neofs.pb.go b/pkg/services/control/ir/types_neofs.pb.go new file mode 100644 index 0000000000..1eefff6deb Binary files /dev/null and b/pkg/services/control/ir/types_neofs.pb.go differ diff --git a/pkg/services/control/service.go b/pkg/services/control/service.go index fc0bee4721..f120b388e9 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 87e8913a59..435cd25f3c 100644 Binary files a/pkg/services/control/service.pb.go and b/pkg/services/control/service.pb.go differ diff --git a/pkg/services/control/service_grpc.pb.go b/pkg/services/control/service_grpc.pb.go index db08a63b5a..5c088311a3 100644 Binary files a/pkg/services/control/service_grpc.pb.go and b/pkg/services/control/service_grpc.pb.go differ diff --git a/pkg/services/control/service_neofs.pb.go b/pkg/services/control/service_neofs.pb.go new file mode 100644 index 0000000000..3b4616e2fc Binary files /dev/null and b/pkg/services/control/service_neofs.pb.go differ diff --git a/pkg/services/control/types.go b/pkg/services/control/types.go index 9c4fc09c75..4d4c11196f 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 16a8b75b5f..2b1ee90089 100644 Binary files a/pkg/services/control/types.pb.go and b/pkg/services/control/types.pb.go differ diff --git a/pkg/services/control/types_neofs.pb.go b/pkg/services/control/types_neofs.pb.go new file mode 100644 index 0000000000..5fe19be943 Binary files /dev/null and b/pkg/services/control/types_neofs.pb.go differ