Compare commits
17 commits
master
...
feature/po
Author | SHA1 | Date | |
---|---|---|---|
35e7397d48 | |||
174773454e | |||
b72aa14bab | |||
42e50c9633 | |||
611355510c | |||
ebaf78c8fa | |||
1473fa588f | |||
c27b978770 | |||
8609f29a60 | |||
8ce8cd6ec2 | |||
8580b49c8d | |||
9b90d139c5 | |||
3dfa2f4fd6 | |||
f517e39491 | |||
3639563d80 | |||
610c450a65 | |||
3f92d7bfb0 |
52 changed files with 2090 additions and 2514 deletions
|
@ -9,13 +9,11 @@ run:
|
|||
# include test files or not, default is true
|
||||
tests: false
|
||||
|
||||
skip-files:
|
||||
- (^|.*/)grpc/(.*)
|
||||
|
||||
# output configuration options
|
||||
output:
|
||||
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
|
||||
format: tab
|
||||
formats:
|
||||
- format: tab
|
||||
|
||||
# all available settings of specific linters
|
||||
linters-settings:
|
||||
|
@ -67,6 +65,9 @@ linters:
|
|||
fast: false
|
||||
|
||||
issues:
|
||||
exclude-files:
|
||||
- (^|.*/)grpc/(.*)
|
||||
|
||||
# Excluding configuration per-path, per-linter, per-text and per-source
|
||||
exclude-rules:
|
||||
- path: v2 # ignore stutters in universal structures due to protobuf compatibility
|
||||
|
|
34
Makefile
34
Makefile
|
@ -2,6 +2,17 @@
|
|||
SHELL = bash
|
||||
|
||||
VERSION ?= $(shell git describe --tags --match "v*" --abbrev=8 --dirty --always)
|
||||
PROTOC_VERSION ?= 27.2
|
||||
PROTOC_GEN_GO_VERSION ?= $(shell go list -f '{{.Version}}' -m google.golang.org/protobuf)
|
||||
PROTOC_OS_VERSION=osx-x86_64
|
||||
ifeq ($(shell uname), Linux)
|
||||
PROTOC_OS_VERSION=linux-x86_64
|
||||
endif
|
||||
|
||||
BIN = bin
|
||||
PROTOBUF_DIR ?= $(abspath $(BIN))/protobuf
|
||||
PROTOC_DIR ?= $(PROTOBUF_DIR)/protoc-v$(PROTOC_VERSION)
|
||||
PROTOC_GEN_GO_DIR ?= $(PROTOBUF_DIR)/protoc-gen-go-$(PROTOC_GEN_GO_VERSION)
|
||||
|
||||
.PHONY: dep fmts fumpt imports protoc test lint version help
|
||||
|
||||
|
@ -32,16 +43,29 @@ fumpt:
|
|||
@echo "⇒ Processing gofumpt check"
|
||||
@gofumpt -l -w .
|
||||
|
||||
# Install protoc
|
||||
protoc-install:
|
||||
@rm -rf $(PROTOBUF_DIR)
|
||||
@mkdir -p $(PROTOBUF_DIR)
|
||||
@echo "⇒ Installing protoc... "
|
||||
@wget -q -O $(PROTOBUF_DIR)/protoc-$(PROTOC_VERSION).zip 'https://github.com/protocolbuffers/protobuf/releases/download/v$(PROTOC_VERSION)/protoc-$(PROTOC_VERSION)-$(PROTOC_OS_VERSION).zip'
|
||||
@unzip -q -o $(PROTOBUF_DIR)/protoc-$(PROTOC_VERSION).zip -d $(PROTOC_DIR)
|
||||
@rm $(PROTOBUF_DIR)/protoc-$(PROTOC_VERSION).zip
|
||||
@echo "⇒ Installing protoc-gen-go..."
|
||||
@GOBIN=$(PROTOC_GEN_GO_DIR) go install -v google.golang.org/protobuf/...@$(PROTOC_GEN_GO_VERSION)
|
||||
|
||||
|
||||
# Regenerate code for proto files
|
||||
protoc:
|
||||
@GOPRIVATE=github.com/TrueCloudLab go mod vendor
|
||||
# Install specific version for protobuf lib
|
||||
@go list -f '{{.Path}}/...@{{.Version}}' -m google.golang.org/protobuf | xargs go install -v
|
||||
@if [ ! -d "$(PROTOC_DIR)" ] || [ ! -d "$(PROTOC_GEN_GO_DIR)" ]; then \
|
||||
make protoc-install; \
|
||||
fi
|
||||
# Protoc generate
|
||||
@for f in `find . -type f -name '*.proto' -not -path './vendor/*'`; do \
|
||||
@for f in `find . -type f -name '*.proto'`; do \
|
||||
echo "⇒ Processing $$f "; \
|
||||
protoc \
|
||||
$(PROTOC_DIR)/bin/protoc \
|
||||
--proto_path=.:./vendor:/usr/local/include \
|
||||
--plugin=protoc-gen-go=$(PROTOC_GEN_GO_DIR)/protoc-gen-go \
|
||||
--go_out=. --go_opt=paths=source_relative \
|
||||
--go-grpc_opt=require_unimplemented_servers=false \
|
||||
--go-grpc_out=. --go-grpc_opt=paths=source_relative $$f; \
|
||||
|
|
2
accounting/grpc/service.pb.go
generated
2
accounting/grpc/service.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v4.25.3
|
||||
// protoc v5.27.2
|
||||
// source: accounting/grpc/service.proto
|
||||
|
||||
package accounting
|
||||
|
|
2
accounting/grpc/service_grpc.pb.go
generated
2
accounting/grpc/service_grpc.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc v4.25.3
|
||||
// - protoc v5.27.2
|
||||
// source: accounting/grpc/service.proto
|
||||
|
||||
package accounting
|
||||
|
|
2
accounting/grpc/types.pb.go
generated
2
accounting/grpc/types.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v4.25.3
|
||||
// protoc v5.27.2
|
||||
// source: accounting/grpc/types.proto
|
||||
|
||||
package accounting
|
||||
|
|
14
acl/grpc/types.pb.go
generated
14
acl/grpc/types.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v4.25.3
|
||||
// protoc v5.27.2
|
||||
// source: acl/grpc/types.proto
|
||||
|
||||
package acl
|
||||
|
@ -709,7 +709,8 @@ type BearerToken_Body struct {
|
|||
// valid for this specific container. Otherwise, any container of the same
|
||||
// owner is allowed.
|
||||
//
|
||||
// Deprecated: eACL tables are no longer relevant - `APEOverrides` should be used instead.
|
||||
// Deprecated: eACL tables are no longer relevant - `APEOverrides` should be
|
||||
// used instead.
|
||||
EaclTable *EACLTable `protobuf:"bytes,1,opt,name=eacl_table,json=eaclTable,proto3" json:"eacl_table,omitempty"`
|
||||
// `OwnerID` defines to whom the token was issued. It must match the request
|
||||
// originator's `OwnerID`. If empty, any token bearer will be accepted.
|
||||
|
@ -859,11 +860,12 @@ func (x *BearerToken_Body_TokenLifetime) GetIat() uint64 {
|
|||
}
|
||||
|
||||
// APEOverride is the list of APE chains defined for a target.
|
||||
// These chains are meant to serve as overrides to the already defined (or even undefined)
|
||||
// APE chains for the target (see contract `Policy`).
|
||||
// These chains are meant to serve as overrides to the already defined (or
|
||||
// even undefined) APE chains for the target (see contract `Policy`).
|
||||
//
|
||||
// The server-side processing of the bearer token with set APE overrides must verify if a client is permitted
|
||||
// to override chains for the target, preventing unauthorized access through the APE mechanism.
|
||||
// The server-side processing of the bearer token with set APE overrides
|
||||
// must verify if a client is permitted to override chains for the target,
|
||||
// preventing unauthorized access through the APE mechanism.
|
||||
type BearerToken_Body_APEOverride struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
|
|
2
ape/grpc/types.pb.go
generated
2
ape/grpc/types.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v4.25.3
|
||||
// protoc v5.27.2
|
||||
// source: ape/grpc/types.proto
|
||||
|
||||
package ape
|
||||
|
|
2
apemanager/grpc/service.pb.go
generated
2
apemanager/grpc/service.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v4.25.3
|
||||
// protoc v5.27.2
|
||||
// source: apemanager/grpc/service.proto
|
||||
|
||||
package apemanager
|
||||
|
|
2
apemanager/grpc/service_grpc.pb.go
generated
2
apemanager/grpc/service_grpc.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc v4.25.3
|
||||
// - protoc v5.27.2
|
||||
// source: apemanager/grpc/service.proto
|
||||
|
||||
package apemanager
|
||||
|
|
|
@ -109,8 +109,7 @@ type RemoveChainResponse struct {
|
|||
session.ResponseHeaders
|
||||
}
|
||||
|
||||
type RemoveChainResponseBody struct {
|
||||
}
|
||||
type RemoveChainResponseBody struct{}
|
||||
|
||||
func (r *RemoveChainResponse) SetBody(body *RemoveChainResponseBody) {
|
||||
r.body = body
|
||||
|
|
|
@ -767,151 +767,6 @@ func (r *ListResponse) FromGRPCMessage(m grpc.Message) error {
|
|||
return r.ResponseHeaders.FromMessage(v)
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLRequestBody) ToGRPCMessage() grpc.Message {
|
||||
var m *container.SetExtendedACLRequest_Body
|
||||
|
||||
if r != nil {
|
||||
m = new(container.SetExtendedACLRequest_Body)
|
||||
|
||||
m.SetEacl(r.eacl.ToGRPCMessage().(*aclGRPC.EACLTable))
|
||||
m.SetSignature(toSignatureRFC6979(r.sig))
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLRequestBody) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*container.SetExtendedACLRequest_Body)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
eacl := v.GetEacl()
|
||||
if eacl == nil {
|
||||
r.eacl = nil
|
||||
} else {
|
||||
if r.eacl == nil {
|
||||
r.eacl = new(acl.Table)
|
||||
}
|
||||
|
||||
err = r.eacl.FromGRPCMessage(eacl)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
sig := v.GetSignature()
|
||||
if sig == nil {
|
||||
r.sig = nil
|
||||
} else {
|
||||
if r.sig == nil {
|
||||
r.sig = new(refs.Signature)
|
||||
}
|
||||
|
||||
r.sig.SetKey(sig.GetKey())
|
||||
r.sig.SetSign(sig.GetSign())
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLRequest) ToGRPCMessage() grpc.Message {
|
||||
var m *container.SetExtendedACLRequest
|
||||
|
||||
if r != nil {
|
||||
m = new(container.SetExtendedACLRequest)
|
||||
|
||||
m.SetBody(r.body.ToGRPCMessage().(*container.SetExtendedACLRequest_Body))
|
||||
r.RequestHeaders.ToMessage(m)
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLRequest) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*container.SetExtendedACLRequest)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
body := v.GetBody()
|
||||
if body == nil {
|
||||
r.body = nil
|
||||
} else {
|
||||
if r.body == nil {
|
||||
r.body = new(SetExtendedACLRequestBody)
|
||||
}
|
||||
|
||||
err = r.body.FromGRPCMessage(body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return r.RequestHeaders.FromMessage(v)
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLResponseBody) ToGRPCMessage() grpc.Message {
|
||||
var m *container.SetExtendedACLResponse_Body
|
||||
|
||||
if r != nil {
|
||||
m = new(container.SetExtendedACLResponse_Body)
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLResponseBody) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*container.SetExtendedACLResponse_Body)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLResponse) ToGRPCMessage() grpc.Message {
|
||||
var m *container.SetExtendedACLResponse
|
||||
|
||||
if r != nil {
|
||||
m = new(container.SetExtendedACLResponse)
|
||||
|
||||
m.SetBody(r.body.ToGRPCMessage().(*container.SetExtendedACLResponse_Body))
|
||||
r.ResponseHeaders.ToMessage(m)
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLResponse) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*container.SetExtendedACLResponse)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
body := v.GetBody()
|
||||
if body == nil {
|
||||
r.body = nil
|
||||
} else {
|
||||
if r.body == nil {
|
||||
r.body = new(SetExtendedACLResponseBody)
|
||||
}
|
||||
|
||||
err = r.body.FromGRPCMessage(body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return r.ResponseHeaders.FromMessage(v)
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLRequestBody) ToGRPCMessage() grpc.Message {
|
||||
var m *container.GetExtendedACLRequest_Body
|
||||
|
||||
|
@ -1083,198 +938,3 @@ func (r *GetExtendedACLResponse) FromGRPCMessage(m grpc.Message) error {
|
|||
|
||||
return r.ResponseHeaders.FromMessage(v)
|
||||
}
|
||||
|
||||
func (a *UsedSpaceAnnouncement) ToGRPCMessage() grpc.Message {
|
||||
var m *container.AnnounceUsedSpaceRequest_Body_Announcement
|
||||
|
||||
if a != nil {
|
||||
m = new(container.AnnounceUsedSpaceRequest_Body_Announcement)
|
||||
|
||||
m.SetContainerId(a.cid.ToGRPCMessage().(*refsGRPC.ContainerID))
|
||||
m.SetEpoch(a.epoch)
|
||||
m.SetUsedSpace(a.usedSpace)
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (a *UsedSpaceAnnouncement) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*container.AnnounceUsedSpaceRequest_Body_Announcement)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
cid := v.GetContainerId()
|
||||
if cid == nil {
|
||||
a.cid = nil
|
||||
} else {
|
||||
if a.cid == nil {
|
||||
a.cid = new(refs.ContainerID)
|
||||
}
|
||||
|
||||
err = a.cid.FromGRPCMessage(cid)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
a.epoch = v.GetEpoch()
|
||||
a.usedSpace = v.GetUsedSpace()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func UsedSpaceAnnouncementsToGRPCMessage(
|
||||
ids []UsedSpaceAnnouncement,
|
||||
) (res []*container.AnnounceUsedSpaceRequest_Body_Announcement) {
|
||||
if ids != nil {
|
||||
res = make([]*container.AnnounceUsedSpaceRequest_Body_Announcement, 0, len(ids))
|
||||
|
||||
for i := range ids {
|
||||
res = append(res, ids[i].ToGRPCMessage().(*container.AnnounceUsedSpaceRequest_Body_Announcement))
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func UsedSpaceAnnouncementssFromGRPCMessage(
|
||||
asV2 []*container.AnnounceUsedSpaceRequest_Body_Announcement,
|
||||
) (res []UsedSpaceAnnouncement, err error) {
|
||||
if asV2 != nil {
|
||||
res = make([]UsedSpaceAnnouncement, len(asV2))
|
||||
|
||||
for i := range asV2 {
|
||||
if asV2[i] != nil {
|
||||
err = res[i].FromGRPCMessage(asV2[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (r *AnnounceUsedSpaceRequestBody) ToGRPCMessage() grpc.Message {
|
||||
var m *container.AnnounceUsedSpaceRequest_Body
|
||||
|
||||
if r != nil {
|
||||
m = new(container.AnnounceUsedSpaceRequest_Body)
|
||||
|
||||
m.SetAnnouncements(UsedSpaceAnnouncementsToGRPCMessage(r.announcements))
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *AnnounceUsedSpaceRequestBody) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*container.AnnounceUsedSpaceRequest_Body)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
r.announcements, err = UsedSpaceAnnouncementssFromGRPCMessage(v.GetAnnouncements())
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (r *AnnounceUsedSpaceRequest) ToGRPCMessage() grpc.Message {
|
||||
var m *container.AnnounceUsedSpaceRequest
|
||||
|
||||
if r != nil {
|
||||
m = new(container.AnnounceUsedSpaceRequest)
|
||||
|
||||
m.SetBody(r.body.ToGRPCMessage().(*container.AnnounceUsedSpaceRequest_Body))
|
||||
r.RequestHeaders.ToMessage(m)
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *AnnounceUsedSpaceRequest) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*container.AnnounceUsedSpaceRequest)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
body := v.GetBody()
|
||||
if body == nil {
|
||||
r.body = nil
|
||||
} else {
|
||||
if r.body == nil {
|
||||
r.body = new(AnnounceUsedSpaceRequestBody)
|
||||
}
|
||||
|
||||
err = r.body.FromGRPCMessage(body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return r.RequestHeaders.FromMessage(v)
|
||||
}
|
||||
|
||||
func (r *AnnounceUsedSpaceResponseBody) ToGRPCMessage() grpc.Message {
|
||||
var m *container.AnnounceUsedSpaceResponse_Body
|
||||
|
||||
if r != nil {
|
||||
m = new(container.AnnounceUsedSpaceResponse_Body)
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *AnnounceUsedSpaceResponseBody) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*container.AnnounceUsedSpaceResponse_Body)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *AnnounceUsedSpaceResponse) ToGRPCMessage() grpc.Message {
|
||||
var m *container.AnnounceUsedSpaceResponse
|
||||
|
||||
if r != nil {
|
||||
m = new(container.AnnounceUsedSpaceResponse)
|
||||
|
||||
m.SetBody(r.body.ToGRPCMessage().(*container.AnnounceUsedSpaceResponse_Body))
|
||||
r.ResponseHeaders.ToMessage(m)
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *AnnounceUsedSpaceResponse) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*container.AnnounceUsedSpaceResponse)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
body := v.GetBody()
|
||||
if body == nil {
|
||||
r.body = nil
|
||||
} else {
|
||||
if r.body == nil {
|
||||
r.body = new(AnnounceUsedSpaceResponseBody)
|
||||
}
|
||||
|
||||
err = r.body.FromGRPCMessage(body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return r.ResponseHeaders.FromMessage(v)
|
||||
}
|
||||
|
|
|
@ -182,46 +182,6 @@ func (m *ListResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
|||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetEacl sets eACL table structure.
|
||||
func (m *SetExtendedACLRequest_Body) SetEacl(v *acl.EACLTable) {
|
||||
m.Eacl = v
|
||||
}
|
||||
|
||||
// SetSignature sets signature of the eACL table structure.
|
||||
func (m *SetExtendedACLRequest_Body) SetSignature(v *refs.SignatureRFC6979) {
|
||||
m.Signature = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *SetExtendedACLRequest) SetBody(v *SetExtendedACLRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *SetExtendedACLRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *SetExtendedACLRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *SetExtendedACLResponse) SetBody(v *SetExtendedACLResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *SetExtendedACLResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *SetExtendedACLResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetContainerId sets identifier of the container.
|
||||
func (m *GetExtendedACLRequest_Body) SetContainerId(v *refs.ContainerID) {
|
||||
m.ContainerId = v
|
||||
|
@ -272,53 +232,3 @@ func (m *GetExtendedACLResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
|||
func (m *GetExtendedACLResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetEpoch sets epoch of the size estimation.
|
||||
func (m *AnnounceUsedSpaceRequest_Body_Announcement) SetEpoch(v uint64) {
|
||||
m.Epoch = v
|
||||
}
|
||||
|
||||
// SetContainerId sets identifier of the container.
|
||||
func (m *AnnounceUsedSpaceRequest_Body_Announcement) SetContainerId(v *refs.ContainerID) {
|
||||
m.ContainerId = v
|
||||
}
|
||||
|
||||
// SetUsedSpace sets used space value of the container.
|
||||
func (m *AnnounceUsedSpaceRequest_Body_Announcement) SetUsedSpace(v uint64) {
|
||||
m.UsedSpace = v
|
||||
}
|
||||
|
||||
// SetAnnouncements sets list of announcement for shared containers between nodes.
|
||||
func (m *AnnounceUsedSpaceRequest_Body) SetAnnouncements(v []*AnnounceUsedSpaceRequest_Body_Announcement) {
|
||||
m.Announcements = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *AnnounceUsedSpaceRequest) SetBody(v *AnnounceUsedSpaceRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *AnnounceUsedSpaceRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *AnnounceUsedSpaceRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *AnnounceUsedSpaceResponse) SetBody(v *AnnounceUsedSpaceResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *AnnounceUsedSpaceResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *AnnounceUsedSpaceResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
|
1164
container/grpc/service.pb.go
generated
1164
container/grpc/service.pb.go
generated
File diff suppressed because it is too large
Load diff
118
container/grpc/service_grpc.pb.go
generated
118
container/grpc/service_grpc.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc v4.25.3
|
||||
// - protoc v5.27.2
|
||||
// source: container/grpc/service.proto
|
||||
|
||||
package container
|
||||
|
@ -19,13 +19,11 @@ import (
|
|||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
ContainerService_Put_FullMethodName = "/neo.fs.v2.container.ContainerService/Put"
|
||||
ContainerService_Delete_FullMethodName = "/neo.fs.v2.container.ContainerService/Delete"
|
||||
ContainerService_Get_FullMethodName = "/neo.fs.v2.container.ContainerService/Get"
|
||||
ContainerService_List_FullMethodName = "/neo.fs.v2.container.ContainerService/List"
|
||||
ContainerService_SetExtendedACL_FullMethodName = "/neo.fs.v2.container.ContainerService/SetExtendedACL"
|
||||
ContainerService_GetExtendedACL_FullMethodName = "/neo.fs.v2.container.ContainerService/GetExtendedACL"
|
||||
ContainerService_AnnounceUsedSpace_FullMethodName = "/neo.fs.v2.container.ContainerService/AnnounceUsedSpace"
|
||||
ContainerService_Put_FullMethodName = "/neo.fs.v2.container.ContainerService/Put"
|
||||
ContainerService_Delete_FullMethodName = "/neo.fs.v2.container.ContainerService/Delete"
|
||||
ContainerService_Get_FullMethodName = "/neo.fs.v2.container.ContainerService/Get"
|
||||
ContainerService_List_FullMethodName = "/neo.fs.v2.container.ContainerService/List"
|
||||
ContainerService_GetExtendedACL_FullMethodName = "/neo.fs.v2.container.ContainerService/GetExtendedACL"
|
||||
)
|
||||
|
||||
// ContainerServiceClient is the client API for ContainerService service.
|
||||
|
@ -76,17 +74,6 @@ type ContainerServiceClient interface {
|
|||
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
||||
// container list access denied.
|
||||
List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
|
||||
// Invokes 'SetEACL' method of 'Container` smart contract and returns response
|
||||
// immediately. After one more block in sidechain, changes in an Extended ACL
|
||||
// are added into smart contract storage.
|
||||
//
|
||||
// Statuses:
|
||||
// - **OK** (0, SECTION_SUCCESS): \
|
||||
// request to save container eACL has been sent to the sidechain;
|
||||
// - Common failures (SECTION_FAILURE_COMMON);
|
||||
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
||||
// set container eACL access denied.
|
||||
SetExtendedACL(ctx context.Context, in *SetExtendedACLRequest, opts ...grpc.CallOption) (*SetExtendedACLResponse, error)
|
||||
// Returns Extended ACL table and signature from `Container` smart contract
|
||||
// storage.
|
||||
//
|
||||
|
@ -101,13 +88,6 @@ type ContainerServiceClient interface {
|
|||
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
||||
// access to container eACL is denied.
|
||||
GetExtendedACL(ctx context.Context, in *GetExtendedACLRequest, opts ...grpc.CallOption) (*GetExtendedACLResponse, error)
|
||||
// Announces the space values used by the container for P2P synchronization.
|
||||
//
|
||||
// Statuses:
|
||||
// - **OK** (0, SECTION_SUCCESS): \
|
||||
// estimation of used space has been successfully announced;
|
||||
// - Common failures (SECTION_FAILURE_COMMON).
|
||||
AnnounceUsedSpace(ctx context.Context, in *AnnounceUsedSpaceRequest, opts ...grpc.CallOption) (*AnnounceUsedSpaceResponse, error)
|
||||
}
|
||||
|
||||
type containerServiceClient struct {
|
||||
|
@ -154,15 +134,6 @@ func (c *containerServiceClient) List(ctx context.Context, in *ListRequest, opts
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *containerServiceClient) SetExtendedACL(ctx context.Context, in *SetExtendedACLRequest, opts ...grpc.CallOption) (*SetExtendedACLResponse, error) {
|
||||
out := new(SetExtendedACLResponse)
|
||||
err := c.cc.Invoke(ctx, ContainerService_SetExtendedACL_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *containerServiceClient) GetExtendedACL(ctx context.Context, in *GetExtendedACLRequest, opts ...grpc.CallOption) (*GetExtendedACLResponse, error) {
|
||||
out := new(GetExtendedACLResponse)
|
||||
err := c.cc.Invoke(ctx, ContainerService_GetExtendedACL_FullMethodName, in, out, opts...)
|
||||
|
@ -172,15 +143,6 @@ func (c *containerServiceClient) GetExtendedACL(ctx context.Context, in *GetExte
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *containerServiceClient) AnnounceUsedSpace(ctx context.Context, in *AnnounceUsedSpaceRequest, opts ...grpc.CallOption) (*AnnounceUsedSpaceResponse, error) {
|
||||
out := new(AnnounceUsedSpaceResponse)
|
||||
err := c.cc.Invoke(ctx, ContainerService_AnnounceUsedSpace_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ContainerServiceServer is the server API for ContainerService service.
|
||||
// All implementations should embed UnimplementedContainerServiceServer
|
||||
// for forward compatibility
|
||||
|
@ -229,17 +191,6 @@ type ContainerServiceServer interface {
|
|||
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
||||
// container list access denied.
|
||||
List(context.Context, *ListRequest) (*ListResponse, error)
|
||||
// Invokes 'SetEACL' method of 'Container` smart contract and returns response
|
||||
// immediately. After one more block in sidechain, changes in an Extended ACL
|
||||
// are added into smart contract storage.
|
||||
//
|
||||
// Statuses:
|
||||
// - **OK** (0, SECTION_SUCCESS): \
|
||||
// request to save container eACL has been sent to the sidechain;
|
||||
// - Common failures (SECTION_FAILURE_COMMON);
|
||||
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
||||
// set container eACL access denied.
|
||||
SetExtendedACL(context.Context, *SetExtendedACLRequest) (*SetExtendedACLResponse, error)
|
||||
// Returns Extended ACL table and signature from `Container` smart contract
|
||||
// storage.
|
||||
//
|
||||
|
@ -254,13 +205,6 @@ type ContainerServiceServer interface {
|
|||
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
||||
// access to container eACL is denied.
|
||||
GetExtendedACL(context.Context, *GetExtendedACLRequest) (*GetExtendedACLResponse, error)
|
||||
// Announces the space values used by the container for P2P synchronization.
|
||||
//
|
||||
// Statuses:
|
||||
// - **OK** (0, SECTION_SUCCESS): \
|
||||
// estimation of used space has been successfully announced;
|
||||
// - Common failures (SECTION_FAILURE_COMMON).
|
||||
AnnounceUsedSpace(context.Context, *AnnounceUsedSpaceRequest) (*AnnounceUsedSpaceResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedContainerServiceServer should be embedded to have forward compatible implementations.
|
||||
|
@ -279,15 +223,9 @@ func (UnimplementedContainerServiceServer) Get(context.Context, *GetRequest) (*G
|
|||
func (UnimplementedContainerServiceServer) List(context.Context, *ListRequest) (*ListResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
||||
}
|
||||
func (UnimplementedContainerServiceServer) SetExtendedACL(context.Context, *SetExtendedACLRequest) (*SetExtendedACLResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SetExtendedACL not implemented")
|
||||
}
|
||||
func (UnimplementedContainerServiceServer) GetExtendedACL(context.Context, *GetExtendedACLRequest) (*GetExtendedACLResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetExtendedACL not implemented")
|
||||
}
|
||||
func (UnimplementedContainerServiceServer) AnnounceUsedSpace(context.Context, *AnnounceUsedSpaceRequest) (*AnnounceUsedSpaceResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method AnnounceUsedSpace not implemented")
|
||||
}
|
||||
|
||||
// UnsafeContainerServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ContainerServiceServer will
|
||||
|
@ -372,24 +310,6 @@ func _ContainerService_List_Handler(srv interface{}, ctx context.Context, dec fu
|
|||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ContainerService_SetExtendedACL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetExtendedACLRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ContainerServiceServer).SetExtendedACL(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ContainerService_SetExtendedACL_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ContainerServiceServer).SetExtendedACL(ctx, req.(*SetExtendedACLRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ContainerService_GetExtendedACL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetExtendedACLRequest)
|
||||
if err := dec(in); err != nil {
|
||||
|
@ -408,24 +328,6 @@ func _ContainerService_GetExtendedACL_Handler(srv interface{}, ctx context.Conte
|
|||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ContainerService_AnnounceUsedSpace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AnnounceUsedSpaceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ContainerServiceServer).AnnounceUsedSpace(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ContainerService_AnnounceUsedSpace_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ContainerServiceServer).AnnounceUsedSpace(ctx, req.(*AnnounceUsedSpaceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ContainerService_ServiceDesc is the grpc.ServiceDesc for ContainerService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
|
@ -449,18 +351,10 @@ var ContainerService_ServiceDesc = grpc.ServiceDesc{
|
|||
MethodName: "List",
|
||||
Handler: _ContainerService_List_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetExtendedACL",
|
||||
Handler: _ContainerService_SetExtendedACL_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetExtendedACL",
|
||||
Handler: _ContainerService_GetExtendedACL_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AnnounceUsedSpace",
|
||||
Handler: _ContainerService_AnnounceUsedSpace_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "container/grpc/service.proto",
|
||||
|
|
2
container/grpc/types.pb.go
generated
2
container/grpc/types.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v4.25.3
|
||||
// protoc v5.27.2
|
||||
// source: container/grpc/types.proto
|
||||
|
||||
package container
|
||||
|
|
|
@ -35,20 +35,11 @@ const (
|
|||
|
||||
listRespBodyIDsField = 1
|
||||
|
||||
setEACLReqBodyTableField = 1
|
||||
setEACLReqBodySignatureField = 2
|
||||
|
||||
getEACLReqBodyIDField = 1
|
||||
|
||||
getEACLRespBodyTableField = 1
|
||||
getEACLRespBodySignatureField = 2
|
||||
getEACLRespBodyTokenField = 3
|
||||
|
||||
usedSpaceAnnounceEpochField = 1
|
||||
usedSpaceAnnounceCIDField = 2
|
||||
usedSpaceAnnounceUsedSpaceField = 3
|
||||
|
||||
usedSpaceReqBodyAnnouncementsField = 1
|
||||
)
|
||||
|
||||
func (a *Attribute) StableMarshal(buf []byte) []byte {
|
||||
|
@ -359,50 +350,6 @@ func (r *ListResponseBody) Unmarshal(data []byte) error {
|
|||
return message.Unmarshal(r, data, new(container.ListResponse_Body))
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLRequestBody) StableMarshal(buf []byte) []byte {
|
||||
if r == nil {
|
||||
return []byte{}
|
||||
}
|
||||
|
||||
if buf == nil {
|
||||
buf = make([]byte, r.StableSize())
|
||||
}
|
||||
|
||||
var offset int
|
||||
|
||||
offset += protoutil.NestedStructureMarshal(setEACLReqBodyTableField, buf[offset:], r.eacl)
|
||||
protoutil.NestedStructureMarshal(setEACLReqBodySignatureField, buf[offset:], r.sig)
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLRequestBody) StableSize() (size int) {
|
||||
if r == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
size += protoutil.NestedStructureSize(setEACLReqBodyTableField, r.eacl)
|
||||
size += protoutil.NestedStructureSize(setEACLReqBodySignatureField, r.sig)
|
||||
|
||||
return size
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLRequestBody) Unmarshal(data []byte) error {
|
||||
return message.Unmarshal(r, data, new(container.SetExtendedACLRequest_Body))
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLResponseBody) StableMarshal(_ []byte) []byte {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLResponseBody) StableSize() (size int) {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLResponseBody) Unmarshal([]byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLRequestBody) StableMarshal(buf []byte) []byte {
|
||||
if r == nil {
|
||||
return []byte{}
|
||||
|
@ -464,83 +411,3 @@ func (r *GetExtendedACLResponseBody) StableSize() (size int) {
|
|||
func (r *GetExtendedACLResponseBody) Unmarshal(data []byte) error {
|
||||
return message.Unmarshal(r, data, new(container.GetExtendedACLResponse_Body))
|
||||
}
|
||||
|
||||
func (a *UsedSpaceAnnouncement) StableMarshal(buf []byte) []byte {
|
||||
if a == nil {
|
||||
return []byte{}
|
||||
}
|
||||
|
||||
if buf == nil {
|
||||
buf = make([]byte, a.StableSize())
|
||||
}
|
||||
|
||||
var offset int
|
||||
|
||||
offset += protoutil.UInt64Marshal(usedSpaceAnnounceEpochField, buf[offset:], a.epoch)
|
||||
offset += protoutil.NestedStructureMarshal(usedSpaceAnnounceCIDField, buf[offset:], a.cid)
|
||||
protoutil.UInt64Marshal(usedSpaceAnnounceUsedSpaceField, buf[offset:], a.usedSpace)
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
func (a *UsedSpaceAnnouncement) StableSize() (size int) {
|
||||
if a == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
size += protoutil.UInt64Size(usedSpaceAnnounceEpochField, a.epoch)
|
||||
size += protoutil.NestedStructureSize(usedSpaceAnnounceCIDField, a.cid)
|
||||
size += protoutil.UInt64Size(usedSpaceAnnounceUsedSpaceField, a.usedSpace)
|
||||
|
||||
return size
|
||||
}
|
||||
|
||||
func (a *UsedSpaceAnnouncement) Unmarshal(data []byte) error {
|
||||
return message.Unmarshal(a, data, new(container.AnnounceUsedSpaceRequest_Body_Announcement))
|
||||
}
|
||||
|
||||
func (r *AnnounceUsedSpaceRequestBody) StableMarshal(buf []byte) []byte {
|
||||
if r == nil {
|
||||
return []byte{}
|
||||
}
|
||||
|
||||
if buf == nil {
|
||||
buf = make([]byte, r.StableSize())
|
||||
}
|
||||
|
||||
var offset int
|
||||
|
||||
for i := range r.announcements {
|
||||
offset += protoutil.NestedStructureMarshal(usedSpaceReqBodyAnnouncementsField, buf[offset:], &r.announcements[i])
|
||||
}
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
func (r *AnnounceUsedSpaceRequestBody) StableSize() (size int) {
|
||||
if r == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
for i := range r.announcements {
|
||||
size += protoutil.NestedStructureSize(usedSpaceReqBodyAnnouncementsField, &r.announcements[i])
|
||||
}
|
||||
|
||||
return size
|
||||
}
|
||||
|
||||
func (r *AnnounceUsedSpaceRequestBody) Unmarshal(data []byte) error {
|
||||
return message.Unmarshal(r, data, new(container.AnnounceUsedSpaceRequest_Body))
|
||||
}
|
||||
|
||||
func (r *AnnounceUsedSpaceResponseBody) StableMarshal(_ []byte) []byte {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *AnnounceUsedSpaceResponseBody) StableSize() (size int) {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (r *AnnounceUsedSpaceResponseBody) Unmarshal([]byte) error {
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -28,8 +28,6 @@ func TestMessageConvert(t *testing.T) {
|
|||
func(empty bool) message.Message { return containertest.GenerateListRequest(empty) },
|
||||
func(empty bool) message.Message { return containertest.GenerateListResponseBody(empty) },
|
||||
func(empty bool) message.Message { return containertest.GenerateListResponse(empty) },
|
||||
func(empty bool) message.Message { return containertest.GenerateSetExtendedACLRequestBody(empty) },
|
||||
func(empty bool) message.Message { return containertest.GenerateSetExtendedACLRequest(empty) },
|
||||
func(empty bool) message.Message { return containertest.GenerateGetRequestBody(empty) },
|
||||
func(empty bool) message.Message { return containertest.GenerateGetRequest(empty) },
|
||||
func(empty bool) message.Message { return containertest.GenerateGetResponseBody(empty) },
|
||||
|
@ -38,10 +36,5 @@ func TestMessageConvert(t *testing.T) {
|
|||
func(empty bool) message.Message { return containertest.GenerateGetExtendedACLRequest(empty) },
|
||||
func(empty bool) message.Message { return containertest.GenerateGetExtendedACLResponseBody(empty) },
|
||||
func(empty bool) message.Message { return containertest.GenerateGetExtendedACLResponse(empty) },
|
||||
func(empty bool) message.Message { return containertest.GenerateUsedSpaceAnnouncement(empty) },
|
||||
func(empty bool) message.Message { return containertest.GenerateAnnounceUsedSpaceRequestBody(empty) },
|
||||
func(empty bool) message.Message { return containertest.GenerateAnnounceUsedSpaceRequest(empty) },
|
||||
func(empty bool) message.Message { return containertest.GenerateAnnounceUsedSpaceResponseBody(empty) },
|
||||
func(empty bool) message.Message { return containertest.GenerateAnnounceUsedSpaceResponse(empty) },
|
||||
)
|
||||
}
|
||||
|
|
|
@ -235,50 +235,6 @@ func GenerateListResponse(empty bool) *container.ListResponse {
|
|||
return m
|
||||
}
|
||||
|
||||
func GenerateSetExtendedACLRequestBody(empty bool) *container.SetExtendedACLRequestBody {
|
||||
m := new(container.SetExtendedACLRequestBody)
|
||||
|
||||
if !empty {
|
||||
m.SetEACL(acltest.GenerateTable(false))
|
||||
}
|
||||
|
||||
m.SetSignature(refstest.GenerateSignature(empty))
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func GenerateSetExtendedACLRequest(empty bool) *container.SetExtendedACLRequest {
|
||||
m := new(container.SetExtendedACLRequest)
|
||||
|
||||
if !empty {
|
||||
m.SetBody(GenerateSetExtendedACLRequestBody(false))
|
||||
}
|
||||
|
||||
m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty))
|
||||
m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty))
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func GenerateSetExtendedACLResponseBody(_ bool) *container.SetExtendedACLResponseBody {
|
||||
m := new(container.SetExtendedACLResponseBody)
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func GenerateSetExtendedACLResponse(empty bool) *container.SetExtendedACLResponse {
|
||||
m := new(container.SetExtendedACLResponse)
|
||||
|
||||
if !empty {
|
||||
m.SetBody(GenerateSetExtendedACLResponseBody(false))
|
||||
}
|
||||
|
||||
m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty))
|
||||
m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty))
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func GenerateGetExtendedACLRequestBody(empty bool) *container.GetExtendedACLRequestBody {
|
||||
m := new(container.GetExtendedACLRequestBody)
|
||||
|
||||
|
@ -327,70 +283,3 @@ func GenerateGetExtendedACLResponse(empty bool) *container.GetExtendedACLRespons
|
|||
|
||||
return m
|
||||
}
|
||||
|
||||
func GenerateUsedSpaceAnnouncement(empty bool) *container.UsedSpaceAnnouncement {
|
||||
m := new(container.UsedSpaceAnnouncement)
|
||||
|
||||
if !empty {
|
||||
m.SetContainerID(refstest.GenerateContainerID(false))
|
||||
m.SetEpoch(1)
|
||||
m.SetUsedSpace(2)
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func GenerateUsedSpaceAnnouncements(empty bool) []container.UsedSpaceAnnouncement {
|
||||
var res []container.UsedSpaceAnnouncement
|
||||
|
||||
if !empty {
|
||||
res = append(res,
|
||||
*GenerateUsedSpaceAnnouncement(false),
|
||||
*GenerateUsedSpaceAnnouncement(false),
|
||||
)
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
func GenerateAnnounceUsedSpaceRequestBody(empty bool) *container.AnnounceUsedSpaceRequestBody {
|
||||
m := new(container.AnnounceUsedSpaceRequestBody)
|
||||
|
||||
if !empty {
|
||||
m.SetAnnouncements(GenerateUsedSpaceAnnouncements(false))
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func GenerateAnnounceUsedSpaceRequest(empty bool) *container.AnnounceUsedSpaceRequest {
|
||||
m := new(container.AnnounceUsedSpaceRequest)
|
||||
|
||||
if !empty {
|
||||
m.SetBody(GenerateAnnounceUsedSpaceRequestBody(false))
|
||||
}
|
||||
|
||||
m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty))
|
||||
m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty))
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func GenerateAnnounceUsedSpaceResponseBody(_ bool) *container.AnnounceUsedSpaceResponseBody {
|
||||
m := new(container.AnnounceUsedSpaceResponseBody)
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func GenerateAnnounceUsedSpaceResponse(empty bool) *container.AnnounceUsedSpaceResponse {
|
||||
m := new(container.AnnounceUsedSpaceResponse)
|
||||
|
||||
if !empty {
|
||||
m.SetBody(GenerateAnnounceUsedSpaceResponseBody(false))
|
||||
}
|
||||
|
||||
m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty))
|
||||
m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty))
|
||||
|
||||
return m
|
||||
}
|
||||
|
|
|
@ -110,26 +110,6 @@ type ListResponse struct {
|
|||
session.ResponseHeaders
|
||||
}
|
||||
|
||||
type SetExtendedACLRequestBody struct {
|
||||
eacl *acl.Table
|
||||
|
||||
sig *refs.Signature
|
||||
}
|
||||
|
||||
type SetExtendedACLRequest struct {
|
||||
body *SetExtendedACLRequestBody
|
||||
|
||||
session.RequestHeaders
|
||||
}
|
||||
|
||||
type SetExtendedACLResponseBody struct{}
|
||||
|
||||
type SetExtendedACLResponse struct {
|
||||
body *SetExtendedACLResponseBody
|
||||
|
||||
session.ResponseHeaders
|
||||
}
|
||||
|
||||
type GetExtendedACLRequestBody struct {
|
||||
cid *refs.ContainerID
|
||||
}
|
||||
|
@ -154,32 +134,6 @@ type GetExtendedACLResponse struct {
|
|||
session.ResponseHeaders
|
||||
}
|
||||
|
||||
type UsedSpaceAnnouncement struct {
|
||||
epoch uint64
|
||||
|
||||
cid *refs.ContainerID
|
||||
|
||||
usedSpace uint64
|
||||
}
|
||||
|
||||
type AnnounceUsedSpaceRequestBody struct {
|
||||
announcements []UsedSpaceAnnouncement
|
||||
}
|
||||
|
||||
type AnnounceUsedSpaceRequest struct {
|
||||
body *AnnounceUsedSpaceRequestBody
|
||||
|
||||
session.RequestHeaders
|
||||
}
|
||||
|
||||
type AnnounceUsedSpaceResponseBody struct{}
|
||||
|
||||
type AnnounceUsedSpaceResponse struct {
|
||||
body *AnnounceUsedSpaceResponseBody
|
||||
|
||||
session.ResponseHeaders
|
||||
}
|
||||
|
||||
func (a *Attribute) GetKey() string {
|
||||
if a != nil {
|
||||
return a.key
|
||||
|
@ -516,56 +470,6 @@ func (r *ListResponse) SetBody(v *ListResponseBody) {
|
|||
r.body = v
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLRequestBody) GetEACL() *acl.Table {
|
||||
if r != nil {
|
||||
return r.eacl
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLRequestBody) SetEACL(v *acl.Table) {
|
||||
r.eacl = v
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLRequestBody) GetSignature() *refs.Signature {
|
||||
if r != nil {
|
||||
return r.sig
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLRequestBody) SetSignature(v *refs.Signature) {
|
||||
// TODO: (neofs-api-go#381) avoid this hack (e.g. create refs.SignatureRFC6979 type)
|
||||
v.SetScheme(0)
|
||||
r.sig = v
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLRequest) GetBody() *SetExtendedACLRequestBody {
|
||||
if r != nil {
|
||||
return r.body
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLRequest) SetBody(v *SetExtendedACLRequestBody) {
|
||||
r.body = v
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLResponse) GetBody() *SetExtendedACLResponseBody {
|
||||
if r != nil {
|
||||
return r.body
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *SetExtendedACLResponse) SetBody(v *SetExtendedACLResponseBody) {
|
||||
r.body = v
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLRequestBody) GetContainerID() *refs.ContainerID {
|
||||
if r != nil {
|
||||
return r.cid
|
||||
|
@ -643,75 +547,3 @@ func (r *GetExtendedACLResponse) GetBody() *GetExtendedACLResponseBody {
|
|||
func (r *GetExtendedACLResponse) SetBody(v *GetExtendedACLResponseBody) {
|
||||
r.body = v
|
||||
}
|
||||
|
||||
func (a *UsedSpaceAnnouncement) GetEpoch() uint64 {
|
||||
if a != nil {
|
||||
return a.epoch
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
func (a *UsedSpaceAnnouncement) SetEpoch(v uint64) {
|
||||
a.epoch = v
|
||||
}
|
||||
|
||||
func (a *UsedSpaceAnnouncement) GetUsedSpace() uint64 {
|
||||
if a != nil {
|
||||
return a.usedSpace
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
func (a *UsedSpaceAnnouncement) SetUsedSpace(v uint64) {
|
||||
a.usedSpace = v
|
||||
}
|
||||
|
||||
func (a *UsedSpaceAnnouncement) GetContainerID() *refs.ContainerID {
|
||||
if a != nil {
|
||||
return a.cid
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *UsedSpaceAnnouncement) SetContainerID(v *refs.ContainerID) {
|
||||
a.cid = v
|
||||
}
|
||||
|
||||
func (r *AnnounceUsedSpaceRequestBody) GetAnnouncements() []UsedSpaceAnnouncement {
|
||||
if r != nil {
|
||||
return r.announcements
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *AnnounceUsedSpaceRequestBody) SetAnnouncements(v []UsedSpaceAnnouncement) {
|
||||
r.announcements = v
|
||||
}
|
||||
|
||||
func (r *AnnounceUsedSpaceRequest) GetBody() *AnnounceUsedSpaceRequestBody {
|
||||
if r != nil {
|
||||
return r.body
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *AnnounceUsedSpaceRequest) SetBody(v *AnnounceUsedSpaceRequestBody) {
|
||||
r.body = v
|
||||
}
|
||||
|
||||
func (r *AnnounceUsedSpaceResponse) GetBody() *AnnounceUsedSpaceResponseBody {
|
||||
if r != nil {
|
||||
return r.body
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *AnnounceUsedSpaceResponse) SetBody(v *AnnounceUsedSpaceResponseBody) {
|
||||
r.body = v
|
||||
}
|
||||
|
|
13
go.mod
13
go.mod
|
@ -5,22 +5,21 @@ go 1.20
|
|||
require (
|
||||
git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0
|
||||
github.com/stretchr/testify v1.8.3
|
||||
golang.org/x/sync v0.2.0
|
||||
google.golang.org/grpc v1.55.0
|
||||
golang.org/x/sync v0.6.0
|
||||
google.golang.org/grpc v1.63.2
|
||||
google.golang.org/protobuf v1.33.0
|
||||
)
|
||||
|
||||
require (
|
||||
git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/golang/protobuf v1.5.3 // indirect
|
||||
github.com/kr/pretty v0.1.0 // indirect
|
||||
github.com/mr-tron/base58 v1.2.0 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
golang.org/x/net v0.10.0 // indirect
|
||||
golang.org/x/sys v0.8.0 // indirect
|
||||
golang.org/x/text v0.9.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
|
||||
golang.org/x/net v0.21.0 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
|
33
go.sum
33
go.sum
|
@ -5,11 +5,7 @@ git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0/go.mod h1:okpbKfVYf/BpejtfFTfhZqFP+
|
|||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
||||
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
|
@ -23,21 +19,18 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
|
|||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
|
||||
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
|
||||
golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A=
|
||||
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU=
|
||||
google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag=
|
||||
google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
|
||||
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
|
||||
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de h1:cZGRis4/ot9uVm639a+rHCUaG0JJHEsdyzSQTMX+suY=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY=
|
||||
google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM=
|
||||
google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA=
|
||||
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
|
||||
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
|
|
2
lock/grpc/types.pb.go
generated
2
lock/grpc/types.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v4.25.3
|
||||
// protoc v5.27.2
|
||||
// source: lock/grpc/types.proto
|
||||
|
||||
package lock
|
||||
|
|
2
netmap/grpc/service.pb.go
generated
2
netmap/grpc/service.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v4.25.3
|
||||
// protoc v5.27.2
|
||||
// source: netmap/grpc/service.proto
|
||||
|
||||
package netmap
|
||||
|
|
2
netmap/grpc/service_grpc.pb.go
generated
2
netmap/grpc/service_grpc.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc v4.25.3
|
||||
// - protoc v5.27.2
|
||||
// source: netmap/grpc/service.proto
|
||||
|
||||
package netmap
|
||||
|
|
51
netmap/grpc/types.pb.go
generated
51
netmap/grpc/types.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v4.25.3
|
||||
// protoc v5.27.2
|
||||
// source: netmap/grpc/types.proto
|
||||
|
||||
package netmap
|
||||
|
@ -44,21 +44,24 @@ const (
|
|||
Operation_AND Operation = 8
|
||||
// Logical negation
|
||||
Operation_NOT Operation = 9
|
||||
// Matches pattern
|
||||
Operation_LIKE Operation = 10
|
||||
)
|
||||
|
||||
// Enum value maps for Operation.
|
||||
var (
|
||||
Operation_name = map[int32]string{
|
||||
0: "OPERATION_UNSPECIFIED",
|
||||
1: "EQ",
|
||||
2: "NE",
|
||||
3: "GT",
|
||||
4: "GE",
|
||||
5: "LT",
|
||||
6: "LE",
|
||||
7: "OR",
|
||||
8: "AND",
|
||||
9: "NOT",
|
||||
0: "OPERATION_UNSPECIFIED",
|
||||
1: "EQ",
|
||||
2: "NE",
|
||||
3: "GT",
|
||||
4: "GE",
|
||||
5: "LT",
|
||||
6: "LE",
|
||||
7: "OR",
|
||||
8: "AND",
|
||||
9: "NOT",
|
||||
10: "LIKE",
|
||||
}
|
||||
Operation_value = map[string]int32{
|
||||
"OPERATION_UNSPECIFIED": 0,
|
||||
|
@ -71,6 +74,7 @@ var (
|
|||
"OR": 7,
|
||||
"AND": 8,
|
||||
"NOT": 9,
|
||||
"LIKE": 10,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -1149,24 +1153,25 @@ var file_netmap_grpc_types_proto_rawDesc = []byte{
|
|||
0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e,
|
||||
0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72,
|
||||
0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b,
|
||||
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2a, 0x70, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74,
|
||||
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2a, 0x7a, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e,
|
||||
0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x06,
|
||||
0x0a, 0x02, 0x45, 0x51, 0x10, 0x01, 0x12, 0x06, 0x0a, 0x02, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x06,
|
||||
0x0a, 0x02, 0x47, 0x54, 0x10, 0x03, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x45, 0x10, 0x04, 0x12, 0x06,
|
||||
0x0a, 0x02, 0x4c, 0x54, 0x10, 0x05, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x45, 0x10, 0x06, 0x12, 0x06,
|
||||
0x0a, 0x02, 0x4f, 0x52, 0x10, 0x07, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x44, 0x10, 0x08, 0x12,
|
||||
0x07, 0x0a, 0x03, 0x4e, 0x4f, 0x54, 0x10, 0x09, 0x2a, 0x38, 0x0a, 0x06, 0x43, 0x6c, 0x61, 0x75,
|
||||
0x73, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4c, 0x41, 0x55, 0x53, 0x45, 0x5f, 0x55, 0x4e, 0x53,
|
||||
0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x41,
|
||||
0x4d, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x53, 0x54, 0x49, 0x4e, 0x43, 0x54,
|
||||
0x10, 0x02, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66,
|
||||
0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64,
|
||||
0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d,
|
||||
0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70,
|
||||
0x63, 0x3b, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46,
|
||||
0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4e,
|
||||
0x65, 0x74, 0x6d, 0x61, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x07, 0x0a, 0x03, 0x4e, 0x4f, 0x54, 0x10, 0x09, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x49, 0x4b, 0x45,
|
||||
0x10, 0x0a, 0x2a, 0x38, 0x0a, 0x06, 0x43, 0x6c, 0x61, 0x75, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x12,
|
||||
0x43, 0x4c, 0x41, 0x55, 0x53, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49,
|
||||
0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x41, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x0c,
|
||||
0x0a, 0x08, 0x44, 0x49, 0x53, 0x54, 0x49, 0x4e, 0x43, 0x54, 0x10, 0x02, 0x42, 0x61, 0x5a, 0x42,
|
||||
0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f,
|
||||
0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72,
|
||||
0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f,
|
||||
0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6e, 0x65, 0x74, 0x6d,
|
||||
0x61, 0x70, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f,
|
||||
0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
|
@ -111,6 +111,7 @@ const (
|
|||
OR
|
||||
AND
|
||||
NOT
|
||||
LIKE
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -2345,3 +2345,217 @@ func (r *PutSingleResponse) FromGRPCMessage(m grpc.Message) error {
|
|||
|
||||
return r.ResponseHeaders.FromMessage(v)
|
||||
}
|
||||
|
||||
func (r *PatchRequestBodyPatch) ToGRPCMessage() grpc.Message {
|
||||
var m *object.PatchRequest_Body_Patch
|
||||
|
||||
if r != nil {
|
||||
m = new(object.PatchRequest_Body_Patch)
|
||||
|
||||
m.SetSourceRange(r.Range.ToGRPCMessage().(*object.Range))
|
||||
m.SetChunk(r.Chunk)
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *PatchRequestBodyPatch) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*object.PatchRequest_Body_Patch)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
srcRange := v.GetSourceRange()
|
||||
if srcRange == nil {
|
||||
r.Range = nil
|
||||
} else {
|
||||
if r.Range == nil {
|
||||
r.Range = new(Range)
|
||||
}
|
||||
|
||||
err = r.Range.FromGRPCMessage(srcRange)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
r.Chunk = v.GetChunk()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) ToGRPCMessage() grpc.Message {
|
||||
var m *object.PatchRequest_Body
|
||||
|
||||
if r != nil {
|
||||
m = new(object.PatchRequest_Body)
|
||||
|
||||
m.SetAddress(r.address.ToGRPCMessage().(*refsGRPC.Address))
|
||||
m.SetNewAttributes(AttributesToGRPC(r.newAttributes))
|
||||
m.SetReplaceAttributes(r.replaceAttributes)
|
||||
m.SetPatch(r.patch.ToGRPCMessage().(*object.PatchRequest_Body_Patch))
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*object.PatchRequest_Body)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
addr := v.GetAddress()
|
||||
if addr == nil {
|
||||
r.address = nil
|
||||
} else {
|
||||
if r.address == nil {
|
||||
r.address = new(refs.Address)
|
||||
}
|
||||
|
||||
err = r.address.FromGRPCMessage(addr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
r.newAttributes, err = AttributesFromGRPC(v.GetNewAttributes())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
r.replaceAttributes = v.GetReplaceAttributes()
|
||||
|
||||
patch := v.GetPatch()
|
||||
if patch == nil {
|
||||
r.patch = nil
|
||||
} else {
|
||||
if r.patch == nil {
|
||||
r.patch = new(PatchRequestBodyPatch)
|
||||
}
|
||||
|
||||
err = r.patch.FromGRPCMessage(patch)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *PatchRequest) ToGRPCMessage() grpc.Message {
|
||||
var m *object.PatchRequest
|
||||
|
||||
if r != nil {
|
||||
m = new(object.PatchRequest)
|
||||
|
||||
m.SetBody(r.body.ToGRPCMessage().(*object.PatchRequest_Body))
|
||||
r.RequestHeaders.ToMessage(m)
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *PatchRequest) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*object.PatchRequest)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
body := v.GetBody()
|
||||
if body == nil {
|
||||
r.body = nil
|
||||
} else {
|
||||
if r.body == nil {
|
||||
r.body = new(PatchRequestBody)
|
||||
}
|
||||
|
||||
err = r.body.FromGRPCMessage(body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return r.RequestHeaders.FromMessage(v)
|
||||
}
|
||||
|
||||
func (r *PatchResponseBody) ToGRPCMessage() grpc.Message {
|
||||
var m *object.PatchResponse_Body
|
||||
|
||||
if r != nil {
|
||||
m = new(object.PatchResponse_Body)
|
||||
|
||||
m.SetObjectID(r.ObjectID.ToGRPCMessage().(*refsGRPC.ObjectID))
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *PatchResponseBody) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*object.PatchResponse_Body)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
objID := v.GetObjectId()
|
||||
if objID == nil {
|
||||
r.ObjectID = nil
|
||||
} else {
|
||||
if r.ObjectID == nil {
|
||||
r.ObjectID = new(refs.ObjectID)
|
||||
}
|
||||
|
||||
err = r.ObjectID.FromGRPCMessage(objID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *PatchResponse) ToGRPCMessage() grpc.Message {
|
||||
var m *object.PatchResponse
|
||||
|
||||
if r != nil {
|
||||
m = new(object.PatchResponse)
|
||||
|
||||
m.SetBody(r.Body.ToGRPCMessage().(*object.PatchResponse_Body))
|
||||
r.ResponseHeaders.ToMessage(m)
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *PatchResponse) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*object.PatchResponse)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
body := v.GetBody()
|
||||
if body == nil {
|
||||
r.Body = nil
|
||||
} else {
|
||||
if r.Body == nil {
|
||||
r.Body = new(PatchResponseBody)
|
||||
}
|
||||
|
||||
err = r.Body.FromGRPCMessage(body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return r.ResponseHeaders.FromMessage(v)
|
||||
}
|
||||
|
|
|
@ -556,3 +556,55 @@ func (m *PutSingleResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
|||
func (m *PutSingleResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
func (m *PatchRequest_Body) SetAddress(addr *refs.Address) {
|
||||
m.Address = addr
|
||||
}
|
||||
|
||||
func (m *PatchRequest_Body) SetNewAttributes(attrs []*Header_Attribute) {
|
||||
m.NewAttributes = attrs
|
||||
}
|
||||
|
||||
func (m *PatchRequest_Body) SetReplaceAttributes(replaceAttributes bool) {
|
||||
m.ReplaceAttributes = replaceAttributes
|
||||
}
|
||||
|
||||
func (m *PatchRequest_Body) SetPatch(patch *PatchRequest_Body_Patch) {
|
||||
m.Patch = patch
|
||||
}
|
||||
|
||||
func (m *PatchRequest_Body_Patch) SetSourceRange(r *Range) {
|
||||
m.SourceRange = r
|
||||
}
|
||||
|
||||
func (m *PatchRequest_Body_Patch) SetChunk(chunk []byte) {
|
||||
m.Chunk = chunk
|
||||
}
|
||||
|
||||
func (m *PatchRequest) SetBody(b *PatchRequest_Body) {
|
||||
m.Body = b
|
||||
}
|
||||
|
||||
func (m *PatchRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
func (m *PatchRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
func (m *PatchResponse_Body) SetObjectID(objectID *refs.ObjectID) {
|
||||
m.ObjectId = objectID
|
||||
}
|
||||
|
||||
func (m *PatchResponse) SetBody(b *PatchResponse_Body) {
|
||||
m.Body = b
|
||||
}
|
||||
|
||||
func (m *PatchResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
func (m *PatchResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
|
961
object/grpc/service.pb.go
generated
961
object/grpc/service.pb.go
generated
File diff suppressed because it is too large
Load diff
159
object/grpc/service_grpc.pb.go
generated
159
object/grpc/service_grpc.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc v4.25.3
|
||||
// - protoc v5.27.2
|
||||
// source: object/grpc/service.proto
|
||||
|
||||
package object
|
||||
|
@ -27,6 +27,7 @@ const (
|
|||
ObjectService_GetRange_FullMethodName = "/neo.fs.v2.object.ObjectService/GetRange"
|
||||
ObjectService_GetRangeHash_FullMethodName = "/neo.fs.v2.object.ObjectService/GetRangeHash"
|
||||
ObjectService_PutSingle_FullMethodName = "/neo.fs.v2.object.ObjectService/PutSingle"
|
||||
ObjectService_Patch_FullMethodName = "/neo.fs.v2.object.ObjectService/Patch"
|
||||
)
|
||||
|
||||
// ObjectServiceClient is the client API for ObjectService service.
|
||||
|
@ -299,6 +300,50 @@ type ObjectServiceClient interface {
|
|||
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
||||
// provided session token has expired.
|
||||
PutSingle(ctx context.Context, in *PutSingleRequest, opts ...grpc.CallOption) (*PutSingleResponse, error)
|
||||
// Patch the object. Request uses gRPC stream. First message must set
|
||||
// the address of the object that is going to get patched. If the object's attributes
|
||||
// are patched, then these attrubutes must be set only within the first stream message.
|
||||
//
|
||||
// If the patch request is performed by NOT the object's owner but if the actor has the permission
|
||||
// to perform the patch, then `OwnerID` of the object is changed. In this case the object's owner
|
||||
// loses the object's ownership after the patch request is successfully done.
|
||||
//
|
||||
// As objects are content-addressable the patching causes new object ID generation for the patched object.
|
||||
// This object id is set witihn `PatchResponse`. But the object id may remain unchanged in such cases:
|
||||
// 1. The chunk of the applying patch contains the same value as the object's payload within the same range;
|
||||
// 2. The patch that reverts the changes applied by preceding patch;
|
||||
// 3. The application of the same patches for the object a few times.
|
||||
//
|
||||
// Extended headers can change `Patch` behaviour:
|
||||
// - [ __SYSTEM__NETMAP_EPOCH \
|
||||
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
||||
// Will use the requsted version of Network Map for object placement
|
||||
// calculation.
|
||||
//
|
||||
// Please refer to detailed `XHeader` description.
|
||||
//
|
||||
// Statuses:
|
||||
// - **OK** (0, SECTION_SUCCESS): \
|
||||
// object has been successfully patched and saved in the container;
|
||||
// - Common failures (SECTION_FAILURE_COMMON);
|
||||
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
|
||||
// write access to the container is denied;
|
||||
// - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \
|
||||
// object not found in container;
|
||||
// - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \
|
||||
// the requested object has been marked as deleted;
|
||||
// - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \
|
||||
// the requested range is out of bounds;
|
||||
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
||||
// object storage container not found;
|
||||
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
||||
// access to container is denied;
|
||||
// - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \
|
||||
// (for trusted object preparation) session private key does not exist or
|
||||
// has been deleted;
|
||||
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
||||
// provided session token has expired.
|
||||
Patch(ctx context.Context, opts ...grpc.CallOption) (ObjectService_PatchClient, error)
|
||||
}
|
||||
|
||||
type objectServiceClient struct {
|
||||
|
@ -475,6 +520,40 @@ func (c *objectServiceClient) PutSingle(ctx context.Context, in *PutSingleReques
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *objectServiceClient) Patch(ctx context.Context, opts ...grpc.CallOption) (ObjectService_PatchClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[4], ObjectService_Patch_FullMethodName, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &objectServicePatchClient{stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type ObjectService_PatchClient interface {
|
||||
Send(*PatchRequest) error
|
||||
CloseAndRecv() (*PatchResponse, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type objectServicePatchClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *objectServicePatchClient) Send(m *PatchRequest) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *objectServicePatchClient) CloseAndRecv() (*PatchResponse, error) {
|
||||
if err := x.ClientStream.CloseSend(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
m := new(PatchResponse)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// ObjectServiceServer is the server API for ObjectService service.
|
||||
// All implementations should embed UnimplementedObjectServiceServer
|
||||
// for forward compatibility
|
||||
|
@ -745,6 +824,50 @@ type ObjectServiceServer interface {
|
|||
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
||||
// provided session token has expired.
|
||||
PutSingle(context.Context, *PutSingleRequest) (*PutSingleResponse, error)
|
||||
// Patch the object. Request uses gRPC stream. First message must set
|
||||
// the address of the object that is going to get patched. If the object's attributes
|
||||
// are patched, then these attrubutes must be set only within the first stream message.
|
||||
//
|
||||
// If the patch request is performed by NOT the object's owner but if the actor has the permission
|
||||
// to perform the patch, then `OwnerID` of the object is changed. In this case the object's owner
|
||||
// loses the object's ownership after the patch request is successfully done.
|
||||
//
|
||||
// As objects are content-addressable the patching causes new object ID generation for the patched object.
|
||||
// This object id is set witihn `PatchResponse`. But the object id may remain unchanged in such cases:
|
||||
// 1. The chunk of the applying patch contains the same value as the object's payload within the same range;
|
||||
// 2. The patch that reverts the changes applied by preceding patch;
|
||||
// 3. The application of the same patches for the object a few times.
|
||||
//
|
||||
// Extended headers can change `Patch` behaviour:
|
||||
// - [ __SYSTEM__NETMAP_EPOCH \
|
||||
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
||||
// Will use the requsted version of Network Map for object placement
|
||||
// calculation.
|
||||
//
|
||||
// Please refer to detailed `XHeader` description.
|
||||
//
|
||||
// Statuses:
|
||||
// - **OK** (0, SECTION_SUCCESS): \
|
||||
// object has been successfully patched and saved in the container;
|
||||
// - Common failures (SECTION_FAILURE_COMMON);
|
||||
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
|
||||
// write access to the container is denied;
|
||||
// - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \
|
||||
// object not found in container;
|
||||
// - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \
|
||||
// the requested object has been marked as deleted;
|
||||
// - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \
|
||||
// the requested range is out of bounds;
|
||||
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
||||
// object storage container not found;
|
||||
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
||||
// access to container is denied;
|
||||
// - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \
|
||||
// (for trusted object preparation) session private key does not exist or
|
||||
// has been deleted;
|
||||
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
||||
// provided session token has expired.
|
||||
Patch(ObjectService_PatchServer) error
|
||||
}
|
||||
|
||||
// UnimplementedObjectServiceServer should be embedded to have forward compatible implementations.
|
||||
|
@ -775,6 +898,9 @@ func (UnimplementedObjectServiceServer) GetRangeHash(context.Context, *GetRangeH
|
|||
func (UnimplementedObjectServiceServer) PutSingle(context.Context, *PutSingleRequest) (*PutSingleResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method PutSingle not implemented")
|
||||
}
|
||||
func (UnimplementedObjectServiceServer) Patch(ObjectService_PatchServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method Patch not implemented")
|
||||
}
|
||||
|
||||
// UnsafeObjectServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ObjectServiceServer will
|
||||
|
@ -948,6 +1074,32 @@ func _ObjectService_PutSingle_Handler(srv interface{}, ctx context.Context, dec
|
|||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ObjectService_Patch_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(ObjectServiceServer).Patch(&objectServicePatchServer{stream})
|
||||
}
|
||||
|
||||
type ObjectService_PatchServer interface {
|
||||
SendAndClose(*PatchResponse) error
|
||||
Recv() (*PatchRequest, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type objectServicePatchServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *objectServicePatchServer) SendAndClose(m *PatchResponse) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *objectServicePatchServer) Recv() (*PatchRequest, error) {
|
||||
m := new(PatchRequest)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// ObjectService_ServiceDesc is the grpc.ServiceDesc for ObjectService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
|
@ -993,6 +1145,11 @@ var ObjectService_ServiceDesc = grpc.ServiceDesc{
|
|||
Handler: _ObjectService_GetRange_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
{
|
||||
StreamName: "Patch",
|
||||
Handler: _ObjectService_Patch_Handler,
|
||||
ClientStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "object/grpc/service.proto",
|
||||
}
|
||||
|
|
13
object/grpc/types.pb.go
generated
13
object/grpc/types.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v4.25.3
|
||||
// protoc v5.27.2
|
||||
// source: object/grpc/types.proto
|
||||
|
||||
package object
|
||||
|
@ -824,12 +824,13 @@ type Header_EC struct {
|
|||
// Chunk of a parent header.
|
||||
Header []byte `protobuf:"bytes,5,opt,name=header,proto3" json:"header,omitempty"`
|
||||
// As the origin object is EC-splitted its identifier is known to all
|
||||
// chunks as parent. But parent itself can be a part of Split (does not relate to EC-split).
|
||||
// In this case parent_split_id should be set.
|
||||
// chunks as parent. But parent itself can be a part of Split (does not
|
||||
// relate to EC-split). In this case parent_split_id should be set.
|
||||
ParentSplitId []byte `protobuf:"bytes,6,opt,name=parent_split_id,json=parentSplitID,proto3" json:"parent_split_id,omitempty"`
|
||||
// EC-parent's parent ID. parent_split_parent_id is set if EC-parent, itself, is a part of Split and
|
||||
// if an object ID of its parent is presented. The field allows to determine how EC-chunk is placed
|
||||
// in Split hierarchy.
|
||||
// EC-parent's parent ID. parent_split_parent_id is set if EC-parent,
|
||||
// itself, is a part of Split and if an object ID of its parent is
|
||||
// presented. The field allows to determine how EC-chunk is placed in Split
|
||||
// hierarchy.
|
||||
ParentSplitParentId *grpc.ObjectID `protobuf:"bytes,7,opt,name=parent_split_parent_id,json=parentSplitParentID,proto3" json:"parent_split_parent_id,omitempty"`
|
||||
// EC parent's attributes.
|
||||
ParentAttributes []*Header_Attribute `protobuf:"bytes,8,rep,name=parent_attributes,json=parentAttributes,proto3" json:"parent_attributes,omitempty"`
|
||||
|
|
|
@ -132,6 +132,16 @@ const (
|
|||
|
||||
putSingleReqObjectField = 1
|
||||
putSingleReqCopiesNumberField = 2
|
||||
|
||||
patchRequestBodyPatchRangeField = 1
|
||||
patchRequestBodyPatchChunkField = 2
|
||||
|
||||
patchRequestBodyAddrField = 1
|
||||
patchRequestBodyNewAttrsField = 2
|
||||
patchRequestBodyReplaceAttrField = 3
|
||||
patchRequestBodyPatchField = 4
|
||||
|
||||
patchResponseBodyObjectIDField = 1
|
||||
)
|
||||
|
||||
func (h *ShortHeader) StableMarshal(buf []byte) []byte {
|
||||
|
@ -1314,3 +1324,105 @@ func (r *PutSingleResponseBody) StableSize() int {
|
|||
func (r *PutSingleResponseBody) Unmarshal(data []byte) error {
|
||||
return message.Unmarshal(r, data, new(object.PutSingleResponse_Body))
|
||||
}
|
||||
|
||||
func (r *PatchRequestBodyPatch) StableMarshal(buf []byte) []byte {
|
||||
if r == nil {
|
||||
return []byte{}
|
||||
}
|
||||
|
||||
if buf == nil {
|
||||
buf = make([]byte, r.StableSize())
|
||||
}
|
||||
|
||||
var offset int
|
||||
offset += proto.NestedStructureMarshal(patchRequestBodyPatchRangeField, buf[offset:], r.Range)
|
||||
proto.BytesMarshal(patchRequestBodyPatchChunkField, buf[offset:], r.Chunk)
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
func (r *PatchRequestBodyPatch) StableSize() int {
|
||||
if r == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
var size int
|
||||
size += proto.NestedStructureSize(patchRequestBodyPatchRangeField, r.Range)
|
||||
size += proto.BytesSize(patchRequestBodyPatchChunkField, r.Chunk)
|
||||
|
||||
return size
|
||||
}
|
||||
|
||||
func (r *PatchRequestBodyPatch) Unmarshal(data []byte) error {
|
||||
return message.Unmarshal(r, data, new(object.PatchRequest_Body_Patch))
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) StableMarshal(buf []byte) []byte {
|
||||
if r == nil {
|
||||
return []byte{}
|
||||
}
|
||||
|
||||
if buf == nil {
|
||||
buf = make([]byte, r.StableSize())
|
||||
}
|
||||
|
||||
var offset int
|
||||
offset += proto.NestedStructureMarshal(patchRequestBodyAddrField, buf[offset:], r.address)
|
||||
for i := range r.newAttributes {
|
||||
offset += proto.NestedStructureMarshal(patchRequestBodyNewAttrsField, buf[offset:], &r.newAttributes[i])
|
||||
}
|
||||
offset += proto.BoolMarshal(patchRequestBodyReplaceAttrField, buf[offset:], r.replaceAttributes)
|
||||
proto.NestedStructureMarshal(patchRequestBodyPatchField, buf[offset:], r.patch)
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) StableSize() int {
|
||||
if r == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
var size int
|
||||
size += proto.NestedStructureSize(patchRequestBodyAddrField, r.address)
|
||||
for i := range r.newAttributes {
|
||||
size += proto.NestedStructureSize(patchRequestBodyNewAttrsField, &r.newAttributes[i])
|
||||
}
|
||||
size += proto.BoolSize(patchRequestBodyReplaceAttrField, r.replaceAttributes)
|
||||
size += proto.NestedStructureSize(patchRequestBodyPatchField, r.patch)
|
||||
|
||||
return size
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) Unmarshal(data []byte) error {
|
||||
return message.Unmarshal(r, data, new(object.PatchRequest_Body))
|
||||
}
|
||||
|
||||
func (r *PatchResponseBody) StableSize() int {
|
||||
if r == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
var size int
|
||||
size += proto.NestedStructureSize(patchResponseBodyObjectIDField, r.ObjectID)
|
||||
|
||||
return size
|
||||
}
|
||||
|
||||
func (r *PatchResponseBody) StableMarshal(buf []byte) []byte {
|
||||
if r == nil {
|
||||
return []byte{}
|
||||
}
|
||||
|
||||
if buf == nil {
|
||||
buf = make([]byte, r.StableSize())
|
||||
}
|
||||
|
||||
var offset int
|
||||
proto.NestedStructureMarshal(patchResponseBodyObjectIDField, buf[offset:], r.ObjectID)
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
func (r *PatchResponseBody) Unmarshal(data []byte) error {
|
||||
return message.Unmarshal(r, data, new(object.PatchResponse_Body))
|
||||
}
|
||||
|
|
|
@ -56,5 +56,10 @@ func TestMessageConvert(t *testing.T) {
|
|||
func(empty bool) message.Message { return objecttest.GenerateLock(empty) },
|
||||
func(empty bool) message.Message { return objecttest.GeneratePutSingleRequest(empty) },
|
||||
func(empty bool) message.Message { return objecttest.GeneratePutSingleResponse(empty) },
|
||||
func(empty bool) message.Message { return objecttest.GeneratePatchRequestBodyPatch(empty) },
|
||||
func(empty bool) message.Message { return objecttest.GeneratePatchRequestBody(empty) },
|
||||
func(empty bool) message.Message { return objecttest.GeneratePatchRequest(empty) },
|
||||
func(empty bool) message.Message { return objecttest.GeneratePatchResponseBody(empty) },
|
||||
func(empty bool) message.Message { return objecttest.GeneratePatchResponse(empty) },
|
||||
)
|
||||
}
|
||||
|
|
|
@ -691,6 +691,63 @@ func GeneratePutSingleResponse(empty bool) *object.PutSingleResponse {
|
|||
return m
|
||||
}
|
||||
|
||||
func GeneratePatchRequestBodyPatch(empty bool) *object.PatchRequestBodyPatch {
|
||||
m := new(object.PatchRequestBodyPatch)
|
||||
|
||||
if !empty {
|
||||
m.Range = GenerateRange(false)
|
||||
m.Chunk = []byte("GeneratePatchRequestBodyPatch")
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func GeneratePatchRequestBody(empty bool) *object.PatchRequestBody {
|
||||
m := new(object.PatchRequestBody)
|
||||
|
||||
if !empty {
|
||||
m.SetAddress(refstest.GenerateAddress(empty))
|
||||
m.SetNewAttributes(GenerateAttributes(empty))
|
||||
m.SetReplaceAttributes(false)
|
||||
m.SetPatch(GeneratePatchRequestBodyPatch(empty))
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func GeneratePatchRequest(empty bool) *object.PatchRequest {
|
||||
m := new(object.PatchRequest)
|
||||
|
||||
if !empty {
|
||||
m.SetBody(GeneratePatchRequestBody(empty))
|
||||
}
|
||||
|
||||
m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty))
|
||||
m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty))
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func GeneratePatchResponseBody(empty bool) *object.PatchResponseBody {
|
||||
m := new(object.PatchResponseBody)
|
||||
|
||||
if !empty {
|
||||
m.ObjectID = refstest.GenerateObjectID(empty)
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func GeneratePatchResponse(empty bool) *object.PatchResponse {
|
||||
m := new(object.PatchResponse)
|
||||
|
||||
if !empty {
|
||||
m.Body = GeneratePatchResponseBody(empty)
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func randomInt(n int) int {
|
||||
return rand.New(rand.NewSource(time.Now().UnixNano())).Intn(n)
|
||||
}
|
||||
|
|
104
object/types.go
104
object/types.go
|
@ -349,6 +349,38 @@ type PutSingleResponse struct {
|
|||
session.ResponseHeaders
|
||||
}
|
||||
|
||||
type PatchRequestBodyPatch struct {
|
||||
Range *Range
|
||||
|
||||
Chunk []byte
|
||||
}
|
||||
|
||||
type PatchRequestBody struct {
|
||||
address *refs.Address
|
||||
|
||||
newAttributes []Attribute
|
||||
|
||||
replaceAttributes bool
|
||||
|
||||
patch *PatchRequestBodyPatch
|
||||
}
|
||||
|
||||
type PatchRequest struct {
|
||||
body *PatchRequestBody
|
||||
|
||||
session.RequestHeaders
|
||||
}
|
||||
|
||||
type PatchResponseBody struct {
|
||||
ObjectID *refs.ObjectID
|
||||
}
|
||||
|
||||
type PatchResponse struct {
|
||||
Body *PatchResponseBody
|
||||
|
||||
session.ResponseHeaders
|
||||
}
|
||||
|
||||
const (
|
||||
TypeRegular Type = iota
|
||||
TypeTombstone
|
||||
|
@ -1511,6 +1543,78 @@ func (r *PutSingleResponse) SetBody(v *PutSingleResponseBody) {
|
|||
r.body = v
|
||||
}
|
||||
|
||||
func (r *PatchRequest) GetBody() *PatchRequestBody {
|
||||
if r != nil {
|
||||
return r.body
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *PatchRequest) SetBody(v *PatchRequestBody) {
|
||||
r.body = v
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) GetAddress() *refs.Address {
|
||||
if r != nil {
|
||||
return r.address
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) SetAddress(addr *refs.Address) {
|
||||
r.address = addr
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) GetNewAttributes() []Attribute {
|
||||
if r != nil {
|
||||
return r.newAttributes
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) SetNewAttributes(attrs []Attribute) {
|
||||
r.newAttributes = attrs
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) GetReplaceAttributes() bool {
|
||||
if r != nil {
|
||||
return r.replaceAttributes
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) SetReplaceAttributes(replace bool) {
|
||||
r.replaceAttributes = replace
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) GetPatch() *PatchRequestBodyPatch {
|
||||
if r != nil {
|
||||
return r.patch
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) SetPatch(patch *PatchRequestBodyPatch) {
|
||||
r.patch = patch
|
||||
}
|
||||
|
||||
func (r *PatchResponse) GetBody() *PatchResponseBody {
|
||||
if r != nil {
|
||||
return r.Body
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *PatchResponse) SetBody(v *PatchResponseBody) {
|
||||
r.Body = v
|
||||
}
|
||||
|
||||
func (s *ECInfo) getObjectPart() {}
|
||||
|
||||
func (s *ECInfo) getHeaderPart() {}
|
||||
|
|
2
refs/grpc/types.pb.go
generated
2
refs/grpc/types.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v4.25.3
|
||||
// protoc v5.27.2
|
||||
// source: refs/grpc/types.proto
|
||||
|
||||
package refs
|
||||
|
|
|
@ -2,8 +2,16 @@ package client
|
|||
|
||||
import (
|
||||
"io"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
// Conn is an interface for grpc client connection.
|
||||
type Conn interface {
|
||||
grpc.ClientConnInterface
|
||||
io.Closer
|
||||
}
|
||||
|
||||
// Conn returns underlying connection.
|
||||
//
|
||||
// Returns non-nil result after the first Init() call
|
||||
|
|
|
@ -25,7 +25,7 @@ type cfg struct {
|
|||
tlsCfg *tls.Config
|
||||
grpcDialOpts []grpc.DialOption
|
||||
|
||||
conn *grpc.ClientConn
|
||||
conn Conn
|
||||
}
|
||||
|
||||
const (
|
||||
|
@ -114,7 +114,7 @@ func WithTLSCfg(v *tls.Config) Option {
|
|||
|
||||
// WithGRPCConn returns option to specify
|
||||
// gRPC virtual connection.
|
||||
func WithGRPCConn(v *grpc.ClientConn) Option {
|
||||
func WithGRPCConn(v Conn) Option {
|
||||
return func(c *cfg) {
|
||||
if v != nil {
|
||||
c.conn = v
|
||||
|
|
|
@ -13,7 +13,6 @@ const (
|
|||
rpcContainerGet = "Get"
|
||||
rpcContainerDel = "Delete"
|
||||
rpcContainerList = "List"
|
||||
rpcContainerSetEACL = "SetExtendedACL"
|
||||
rpcContainerGetEACL = "GetExtendedACL"
|
||||
rpcContainerUsedSpace = "AnnounceUsedSpace"
|
||||
)
|
||||
|
@ -82,22 +81,6 @@ func ListContainers(
|
|||
return resp, nil
|
||||
}
|
||||
|
||||
// SetEACL executes ContainerService.SetExtendedACL RPC.
|
||||
func SetEACL(
|
||||
cli *client.Client,
|
||||
req *container.SetExtendedACLRequest,
|
||||
opts ...client.CallOption,
|
||||
) (*container.PutResponse, error) {
|
||||
resp := new(container.PutResponse)
|
||||
|
||||
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceContainer, rpcContainerSetEACL), req, resp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
// GetEACL executes ContainerService.GetExtendedACL RPC.
|
||||
func GetEACL(
|
||||
cli *client.Client,
|
||||
|
@ -113,19 +96,3 @@ func GetEACL(
|
|||
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
// AnnounceUsedSpace executes ContainerService.AnnounceUsedSpace RPC.
|
||||
func AnnounceUsedSpace(
|
||||
cli *client.Client,
|
||||
req *container.AnnounceUsedSpaceRequest,
|
||||
opts ...client.CallOption,
|
||||
) (*container.PutResponse, error) {
|
||||
resp := new(container.PutResponse)
|
||||
|
||||
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceContainer, rpcContainerUsedSpace), req, resp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ const (
|
|||
rpcObjectHead = "Head"
|
||||
rpcObjectDelete = "Delete"
|
||||
rpcObjectPutSingle = "PutSingle"
|
||||
rpcObjectPatch = "Patch"
|
||||
)
|
||||
|
||||
// PutRequestWriter is an object.PutRequest
|
||||
|
@ -205,3 +206,38 @@ func PutSingleObject(
|
|||
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
// PatchRequestWriter is an object.PatchRequest
|
||||
// message streaming component.
|
||||
type PatchRequestWriter struct {
|
||||
wc client.MessageWriterCloser
|
||||
|
||||
resp message.Message
|
||||
}
|
||||
|
||||
// Write writes req to the stream.
|
||||
func (w *PatchRequestWriter) Write(req *object.PatchRequest) error {
|
||||
return w.wc.WriteMessage(req)
|
||||
}
|
||||
|
||||
// Close closes the stream.
|
||||
func (w *PatchRequestWriter) Close() error {
|
||||
return w.wc.Close()
|
||||
}
|
||||
|
||||
// Patch executes ObjectService.Patch RPC.
|
||||
func Patch(
|
||||
cli *client.Client,
|
||||
resp *object.PatchResponse,
|
||||
opts ...client.CallOption,
|
||||
) (*PatchRequestWriter, error) {
|
||||
wc, err := client.OpenClientStream(cli, common.CallMethodInfoClientStream(serviceObject, rpcObjectPatch), resp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &PatchRequestWriter{
|
||||
wc: wc,
|
||||
resp: resp,
|
||||
}, nil
|
||||
}
|
||||
|
|
|
@ -641,6 +641,8 @@ func ObjectSessionVerbToGRPCField(v ObjectSessionVerb) session.ObjectSessionCont
|
|||
return session.ObjectSessionContext_RANGE
|
||||
case ObjectVerbRangeHash:
|
||||
return session.ObjectSessionContext_RANGEHASH
|
||||
case ObjectVerbPatch:
|
||||
return session.ObjectSessionContext_PATCH
|
||||
default:
|
||||
return session.ObjectSessionContext_VERB_UNSPECIFIED
|
||||
}
|
||||
|
@ -662,6 +664,8 @@ func ObjectSessionVerbFromGRPCField(v session.ObjectSessionContext_Verb) ObjectS
|
|||
return ObjectVerbRange
|
||||
case session.ObjectSessionContext_RANGEHASH:
|
||||
return ObjectVerbRangeHash
|
||||
case session.ObjectSessionContext_PATCH:
|
||||
return ObjectVerbPatch
|
||||
default:
|
||||
return ObjectVerbUnknown
|
||||
}
|
||||
|
|
2
session/grpc/service.pb.go
generated
2
session/grpc/service.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v4.25.3
|
||||
// protoc v5.27.2
|
||||
// source: session/grpc/service.proto
|
||||
|
||||
package session
|
||||
|
|
2
session/grpc/service_grpc.pb.go
generated
2
session/grpc/service_grpc.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc v4.25.3
|
||||
// - protoc v5.27.2
|
||||
// source: session/grpc/service.proto
|
||||
|
||||
package session
|
||||
|
|
291
session/grpc/types.pb.go
generated
291
session/grpc/types.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v4.25.3
|
||||
// protoc v5.27.2
|
||||
// source: session/grpc/types.proto
|
||||
|
||||
package session
|
||||
|
@ -43,6 +43,8 @@ const (
|
|||
ObjectSessionContext_RANGE ObjectSessionContext_Verb = 6
|
||||
// Refers to object.GetRangeHash RPC call
|
||||
ObjectSessionContext_RANGEHASH ObjectSessionContext_Verb = 7
|
||||
// Refers to object.Patch RPC call
|
||||
ObjectSessionContext_PATCH ObjectSessionContext_Verb = 8
|
||||
)
|
||||
|
||||
// Enum value maps for ObjectSessionContext_Verb.
|
||||
|
@ -56,6 +58,7 @@ var (
|
|||
5: "DELETE",
|
||||
6: "RANGE",
|
||||
7: "RANGEHASH",
|
||||
8: "PATCH",
|
||||
}
|
||||
ObjectSessionContext_Verb_value = map[string]int32{
|
||||
"VERB_UNSPECIFIED": 0,
|
||||
|
@ -66,6 +69,7 @@ var (
|
|||
"DELETE": 5,
|
||||
"RANGE": 6,
|
||||
"RANGEHASH": 7,
|
||||
"PATCH": 8,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -1040,7 +1044,7 @@ var file_session_grpc_types_proto_rawDesc = []byte{
|
|||
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x61, 0x63, 0x6c, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74,
|
||||
0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x73, 0x74, 0x61, 0x74,
|
||||
0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x22, 0x85, 0x03, 0x0a, 0x14, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65,
|
||||
0x6f, 0x74, 0x6f, 0x22, 0x90, 0x03, 0x0a, 0x14, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65,
|
||||
0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x40, 0x0a, 0x04,
|
||||
0x76, 0x65, 0x72, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f,
|
||||
0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x4f,
|
||||
|
@ -1058,154 +1062,155 @@ var file_session_grpc_types_proto_rawDesc = []byte{
|
|||
0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e,
|
||||
0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62,
|
||||
0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x22,
|
||||
0x6a, 0x0a, 0x04, 0x56, 0x65, 0x72, 0x62, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x45, 0x52, 0x42, 0x5f,
|
||||
0x75, 0x0a, 0x04, 0x56, 0x65, 0x72, 0x62, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x45, 0x52, 0x42, 0x5f,
|
||||
0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a,
|
||||
0x03, 0x50, 0x55, 0x54, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x47, 0x45, 0x54, 0x10, 0x02, 0x12,
|
||||
0x08, 0x0a, 0x04, 0x48, 0x45, 0x41, 0x44, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x45, 0x41,
|
||||
0x52, 0x43, 0x48, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10,
|
||||
0x05, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x06, 0x12, 0x0d, 0x0a, 0x09,
|
||||
0x52, 0x41, 0x4e, 0x47, 0x45, 0x48, 0x41, 0x53, 0x48, 0x10, 0x07, 0x22, 0xfa, 0x01, 0x0a, 0x17,
|
||||
0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e,
|
||||
0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x43, 0x0a, 0x04, 0x76, 0x65, 0x72, 0x62, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76,
|
||||
0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69,
|
||||
0x6e, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78,
|
||||
0x74, 0x2e, 0x56, 0x65, 0x72, 0x62, 0x52, 0x04, 0x76, 0x65, 0x72, 0x62, 0x12, 0x1a, 0x0a, 0x08,
|
||||
0x77, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08,
|
||||
0x77, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74,
|
||||
0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b,
|
||||
0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e,
|
||||
0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e,
|
||||
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x22, 0x3e, 0x0a, 0x04, 0x56, 0x65, 0x72, 0x62,
|
||||
0x12, 0x14, 0x0a, 0x10, 0x56, 0x45, 0x52, 0x42, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49,
|
||||
0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x55, 0x54, 0x10, 0x01, 0x12,
|
||||
0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53,
|
||||
0x45, 0x54, 0x45, 0x41, 0x43, 0x4c, 0x10, 0x03, 0x22, 0xa0, 0x04, 0x0a, 0x0c, 0x53, 0x65, 0x73,
|
||||
0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x38, 0x0a, 0x04, 0x62, 0x6f, 0x64,
|
||||
0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73,
|
||||
0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73,
|
||||
0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62,
|
||||
0x6f, 0x64, 0x79, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e,
|
||||
0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72,
|
||||
0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x9c, 0x03, 0x0a,
|
||||
0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69,
|
||||
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73,
|
||||
0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44,
|
||||
0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x4e, 0x0a, 0x08, 0x6c, 0x69, 0x66,
|
||||
0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6e, 0x65,
|
||||
0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e,
|
||||
0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x6f, 0x64,
|
||||
0x79, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x52,
|
||||
0x08, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x73,
|
||||
0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a,
|
||||
0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x41, 0x0a, 0x06, 0x6f, 0x62,
|
||||
0x6a, 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, 0x65, 0x6f,
|
||||
0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x4f,
|
||||
0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74,
|
||||
0x65, 0x78, 0x74, 0x48, 0x00, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x4a, 0x0a,
|
||||
0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x2a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73,
|
||||
0x52, 0x41, 0x4e, 0x47, 0x45, 0x48, 0x41, 0x53, 0x48, 0x10, 0x07, 0x12, 0x09, 0x0a, 0x05, 0x50,
|
||||
0x41, 0x54, 0x43, 0x48, 0x10, 0x08, 0x22, 0xfa, 0x01, 0x0a, 0x17, 0x43, 0x6f, 0x6e, 0x74, 0x61,
|
||||
0x69, 0x6e, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65,
|
||||
0x78, 0x74, 0x12, 0x43, 0x0a, 0x04, 0x76, 0x65, 0x72, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
|
||||
0x32, 0x2f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73,
|
||||
0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x65,
|
||||
0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x48, 0x00, 0x52, 0x09,
|
||||
0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x1a, 0x45, 0x0a, 0x0d, 0x54, 0x6f, 0x6b,
|
||||
0x65, 0x6e, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78,
|
||||
0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x10, 0x0a, 0x03,
|
||||
0x6e, 0x62, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6e, 0x62, 0x66, 0x12, 0x10,
|
||||
0x0a, 0x03, 0x69, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x69, 0x61, 0x74,
|
||||
0x42, 0x09, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x31, 0x0a, 0x07, 0x58,
|
||||
0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75,
|
||||
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x8d,
|
||||
0x03, 0x0a, 0x11, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65,
|
||||
0x61, 0x64, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76,
|
||||
0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07,
|
||||
0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x10, 0x0a,
|
||||
0x03, 0x74, 0x74, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x74, 0x74, 0x6c, 0x12,
|
||||
0x37, 0x0a, 0x09, 0x78, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03,
|
||||
0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73,
|
||||
0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x58, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x08,
|
||||
0x78, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x44, 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73,
|
||||
0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73,
|
||||
0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
|
||||
0x52, 0x0c, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3d,
|
||||
0x0a, 0x0c, 0x62, 0x65, 0x61, 0x72, 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32,
|
||||
0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
|
||||
0x52, 0x0b, 0x62, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3c, 0x0a,
|
||||
0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e,
|
||||
0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f,
|
||||
0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61,
|
||||
0x64, 0x65, 0x72, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x6d,
|
||||
0x61, 0x67, 0x69, 0x63, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28,
|
||||
0x04, 0x52, 0x0b, 0x6d, 0x61, 0x67, 0x69, 0x63, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x99,
|
||||
0x02, 0x0a, 0x12, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48,
|
||||
0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e,
|
||||
0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52,
|
||||
0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63,
|
||||
0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x10,
|
||||
0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x74, 0x74, 0x6c,
|
||||
0x12, 0x37, 0x0a, 0x09, 0x78, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20,
|
||||
0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e,
|
||||
0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x58, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52,
|
||||
0x08, 0x78, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x3d, 0x0a, 0x06, 0x6f, 0x72, 0x69,
|
||||
0x67, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e,
|
||||
0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
|
||||
0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74,
|
||||
0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66,
|
||||
0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74,
|
||||
0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xab, 0x02, 0x0a, 0x19, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x0e, 0x62, 0x6f, 0x64, 0x79,
|
||||
0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66,
|
||||
0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x62, 0x6f, 0x64,
|
||||
0x79, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x6d, 0x65,
|
||||
0x74, 0x61, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72,
|
||||
0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x6d,
|
||||
0x65, 0x74, 0x61, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x44, 0x0a, 0x10,
|
||||
0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65,
|
||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e,
|
||||
0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72,
|
||||
0x65, 0x52, 0x0f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75,
|
||||
0x72, 0x65, 0x12, 0x44, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73,
|
||||
0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65,
|
||||
0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
|
||||
0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x22, 0xad, 0x02, 0x0a, 0x1a, 0x52, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x0e, 0x62, 0x6f, 0x64, 0x79, 0x5f,
|
||||
0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73,
|
||||
0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x62, 0x6f, 0x64, 0x79,
|
||||
0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x6d, 0x65, 0x74,
|
||||
0x61, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x56, 0x65, 0x72,
|
||||
0x62, 0x52, 0x04, 0x76, 0x65, 0x72, 0x62, 0x12, 0x1a, 0x0a, 0x08, 0x77, 0x69, 0x6c, 0x64, 0x63,
|
||||
0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x77, 0x69, 0x6c, 0x64, 0x63,
|
||||
0x61, 0x72, 0x64, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72,
|
||||
0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e,
|
||||
0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61,
|
||||
0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
||||
0x72, 0x49, 0x44, 0x22, 0x3e, 0x0a, 0x04, 0x56, 0x65, 0x72, 0x62, 0x12, 0x14, 0x0a, 0x10, 0x56,
|
||||
0x45, 0x52, 0x42, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10,
|
||||
0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x55, 0x54, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45,
|
||||
0x4c, 0x45, 0x54, 0x45, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x54, 0x45, 0x41, 0x43,
|
||||
0x4c, 0x10, 0x03, 0x22, 0xa0, 0x04, 0x0a, 0x0c, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54,
|
||||
0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x38, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73,
|
||||
0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f,
|
||||
0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x37,
|
||||
0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65,
|
||||
0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x6d, 0x65,
|
||||
0x74, 0x61, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x44, 0x0a, 0x10, 0x6f,
|
||||
0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76,
|
||||
0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65,
|
||||
0x52, 0x0f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72,
|
||||
0x65, 0x12, 0x45, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65,
|
||||
0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65,
|
||||
0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
|
||||
0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x42, 0x64, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x2e,
|
||||
0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75,
|
||||
0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66,
|
||||
0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x65, 0x73, 0x73,
|
||||
0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e,
|
||||
0xaa, 0x02, 0x1b, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61,
|
||||
0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69,
|
||||
0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x9c, 0x03, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79,
|
||||
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64,
|
||||
0x12, 0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72,
|
||||
0x65, 0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x07, 0x6f, 0x77, 0x6e,
|
||||
0x65, 0x72, 0x49, 0x44, 0x12, 0x4e, 0x0a, 0x08, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65,
|
||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e,
|
||||
0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x54, 0x6f, 0x6b,
|
||||
0x65, 0x6e, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x08, 0x6c, 0x69, 0x66, 0x65,
|
||||
0x74, 0x69, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f,
|
||||
0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x41, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18,
|
||||
0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76,
|
||||
0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74,
|
||||
0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x48, 0x00,
|
||||
0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x4a, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74,
|
||||
0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6e, 0x65,
|
||||
0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e,
|
||||
0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e,
|
||||
0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x48, 0x00, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61,
|
||||
0x69, 0x6e, 0x65, 0x72, 0x1a, 0x45, 0x0a, 0x0d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, 0x66,
|
||||
0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x04, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x62, 0x66, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6e, 0x62, 0x66, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x61, 0x74,
|
||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x69, 0x61, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x63,
|
||||
0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x31, 0x0a, 0x07, 0x58, 0x48, 0x65, 0x61, 0x64, 0x65,
|
||||
0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
|
||||
0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x8d, 0x03, 0x0a, 0x11, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12,
|
||||
0x31, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66,
|
||||
0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x74, 0x74, 0x6c, 0x12, 0x37, 0x0a, 0x09, 0x78, 0x5f,
|
||||
0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
|
||||
0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f,
|
||||
0x6e, 0x2e, 0x58, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x08, 0x78, 0x48, 0x65, 0x61, 0x64,
|
||||
0x65, 0x72, 0x73, 0x12, 0x44, 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74,
|
||||
0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f,
|
||||
0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53,
|
||||
0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0c, 0x73, 0x65, 0x73,
|
||||
0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3d, 0x0a, 0x0c, 0x62, 0x65, 0x61,
|
||||
0x72, 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e,
|
||||
0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0b, 0x62, 0x65, 0x61,
|
||||
0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3c, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67,
|
||||
0x69, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66,
|
||||
0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71,
|
||||
0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06,
|
||||
0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x67, 0x69, 0x63, 0x5f,
|
||||
0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6d, 0x61,
|
||||
0x67, 0x69, 0x63, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x99, 0x02, 0x0a, 0x12, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
|
||||
0x12, 0x31, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65,
|
||||
0x66, 0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73,
|
||||
0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74, 0x6c,
|
||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x74, 0x74, 0x6c, 0x12, 0x37, 0x0a, 0x09, 0x78,
|
||||
0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a,
|
||||
0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x2e, 0x58, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x08, 0x78, 0x48, 0x65, 0x61,
|
||||
0x64, 0x65, 0x72, 0x73, 0x12, 0x3d, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x05,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32,
|
||||
0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x6f, 0x72, 0x69,
|
||||
0x67, 0x69, 0x6e, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e,
|
||||
0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73,
|
||||
0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xab, 0x02, 0x0a, 0x19, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61,
|
||||
0x64, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x0e, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x73, 0x69, 0x67, 0x6e,
|
||||
0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65,
|
||||
0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67,
|
||||
0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x62, 0x6f, 0x64, 0x79, 0x53, 0x69, 0x67, 0x6e,
|
||||
0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x73, 0x69,
|
||||
0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e,
|
||||
0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53,
|
||||
0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x6d, 0x65, 0x74, 0x61, 0x53, 0x69,
|
||||
0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x44, 0x0a, 0x10, 0x6f, 0x72, 0x69, 0x67, 0x69,
|
||||
0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65,
|
||||
0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0f, 0x6f, 0x72,
|
||||
0x69, 0x67, 0x69, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x44, 0x0a,
|
||||
0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e,
|
||||
0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f,
|
||||
0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63,
|
||||
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x6f, 0x72, 0x69,
|
||||
0x67, 0x69, 0x6e, 0x22, 0xad, 0x02, 0x0a, 0x1a, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64,
|
||||
0x65, 0x72, 0x12, 0x40, 0x0a, 0x0e, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61,
|
||||
0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f,
|
||||
0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e,
|
||||
0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x62, 0x6f, 0x64, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x61,
|
||||
0x74, 0x75, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x73, 0x69, 0x67,
|
||||
0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e,
|
||||
0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69,
|
||||
0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x6d, 0x65, 0x74, 0x61, 0x53, 0x69, 0x67,
|
||||
0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x44, 0x0a, 0x10, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e,
|
||||
0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66,
|
||||
0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0f, 0x6f, 0x72, 0x69,
|
||||
0x67, 0x69, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x45, 0x0a, 0x06,
|
||||
0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e,
|
||||
0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e,
|
||||
0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63,
|
||||
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x6f, 0x72, 0x69,
|
||||
0x67, 0x69, 0x6e, 0x42, 0x64, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74,
|
||||
0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75,
|
||||
0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69,
|
||||
0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67,
|
||||
0x72, 0x70, 0x63, 0x3b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0xaa, 0x02, 0x1b, 0x4e, 0x65,
|
||||
0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50,
|
||||
0x49, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
|
@ -175,6 +175,7 @@ const (
|
|||
ObjectVerbDelete
|
||||
ObjectVerbRange
|
||||
ObjectVerbRangeHash
|
||||
ObjectVerbPatch
|
||||
)
|
||||
|
||||
func (c *CreateRequestBody) GetOwnerID() *refs.OwnerID {
|
||||
|
|
|
@ -46,18 +46,10 @@ func serviceMessageBody(req any) stableMarshaler {
|
|||
return v.GetBody()
|
||||
case *container.ListResponse:
|
||||
return v.GetBody()
|
||||
case *container.SetExtendedACLRequest:
|
||||
return v.GetBody()
|
||||
case *container.SetExtendedACLResponse:
|
||||
return v.GetBody()
|
||||
case *container.GetExtendedACLRequest:
|
||||
return v.GetBody()
|
||||
case *container.GetExtendedACLResponse:
|
||||
return v.GetBody()
|
||||
case *container.AnnounceUsedSpaceRequest:
|
||||
return v.GetBody()
|
||||
case *container.AnnounceUsedSpaceResponse:
|
||||
return v.GetBody()
|
||||
|
||||
/* Object */
|
||||
case *object.PutRequest:
|
||||
|
@ -92,6 +84,10 @@ func serviceMessageBody(req any) stableMarshaler {
|
|||
return v.GetBody()
|
||||
case *object.PutSingleResponse:
|
||||
return v.GetBody()
|
||||
case *object.PatchRequest:
|
||||
return v.GetBody()
|
||||
case *object.PatchResponse:
|
||||
return v.GetBody()
|
||||
|
||||
/* Netmap */
|
||||
case *netmap.LocalNodeInfoRequest:
|
||||
|
|
5
status/grpc/types.pb.go
generated
5
status/grpc/types.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v4.25.3
|
||||
// protoc v5.27.2
|
||||
// source: status/grpc/types.proto
|
||||
|
||||
package status
|
||||
|
@ -150,7 +150,8 @@ const (
|
|||
// [**1027**] Node is under maintenance.
|
||||
CommonFail_NODE_UNDER_MAINTENANCE CommonFail = 3
|
||||
// [**1028**] Invalid argument error. If the server fails on validation of a
|
||||
// request parameter as the client sent it incorrectly, then this code should be used.
|
||||
// request parameter as the client sent it incorrectly, then this code should
|
||||
// be used.
|
||||
CommonFail_INVALID_ARGUMENT CommonFail = 4
|
||||
)
|
||||
|
||||
|
|
2
tombstone/grpc/types.pb.go
generated
2
tombstone/grpc/types.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v4.25.3
|
||||
// protoc v5.27.2
|
||||
// source: tombstone/grpc/types.proto
|
||||
|
||||
package tombstone
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
package proto_test
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"math"
|
||||
"testing"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/test"
|
||||
"github.com/stretchr/testify/require"
|
||||
"google.golang.org/protobuf/encoding/protowire"
|
||||
goproto "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
|
@ -33,6 +35,8 @@ type stableRepPrimitives struct {
|
|||
FieldD []uint32
|
||||
FieldE []int64
|
||||
FieldF []uint64
|
||||
|
||||
FieldFu []uint64
|
||||
}
|
||||
|
||||
const (
|
||||
|
@ -185,6 +189,20 @@ func (s *stableRepPrimitives) stableMarshal(buf []byte, wrongField bool) ([]byte
|
|||
}
|
||||
i += proto.RepeatedUInt64Marshal(fieldNum, buf, s.FieldF)
|
||||
|
||||
fieldNum = 7
|
||||
if wrongField {
|
||||
fieldNum++
|
||||
}
|
||||
for j := range s.FieldFu {
|
||||
{
|
||||
prefix := protowire.EncodeTag(
|
||||
protowire.Number(fieldNum),
|
||||
protowire.VarintType)
|
||||
i += binary.PutUvarint(buf[i:], uint64(prefix))
|
||||
i += binary.PutUvarint(buf[i:], s.FieldFu[j])
|
||||
}
|
||||
}
|
||||
|
||||
return buf, nil
|
||||
}
|
||||
|
||||
|
@ -196,7 +214,12 @@ func (s *stableRepPrimitives) stableSize() int {
|
|||
f5, _ := proto.RepeatedInt64Size(5, s.FieldE)
|
||||
f6, _ := proto.RepeatedUInt64Size(6, s.FieldF)
|
||||
|
||||
return f1 + f2 + f3 + f4 + f5 + f6
|
||||
var f7 int
|
||||
for i := range s.FieldFu {
|
||||
f7 += protowire.SizeGroup(protowire.Number(7), protowire.SizeVarint(s.FieldFu[i]))
|
||||
}
|
||||
|
||||
return f1 + f2 + f3 + f4 + f5 + f6 + f7
|
||||
}
|
||||
|
||||
func TestBytesMarshal(t *testing.T) {
|
||||
|
@ -404,6 +427,22 @@ func TestRepeatedUInt64Marshal(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func TestRepeatedUInt64MarshalUnpacked(t *testing.T) {
|
||||
t.Run("not empty", func(t *testing.T) {
|
||||
data := []uint64{0, 1, 2, 3, 4, 5}
|
||||
testRepeatedUInt64MarshalUnpacked(t, data, false)
|
||||
testRepeatedUInt64MarshalUnpacked(t, data, true)
|
||||
})
|
||||
|
||||
t.Run("empty", func(t *testing.T) {
|
||||
testRepeatedUInt64MarshalUnpacked(t, []uint64{}, false)
|
||||
})
|
||||
|
||||
t.Run("nil", func(t *testing.T) {
|
||||
testRepeatedUInt64MarshalUnpacked(t, nil, false)
|
||||
})
|
||||
}
|
||||
|
||||
func TestFixed64Marshal(t *testing.T) {
|
||||
t.Run("zero", func(t *testing.T) {
|
||||
testFixed64Marshal(t, 0, false)
|
||||
|
@ -439,7 +478,7 @@ func TestFixed32Marshal(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func testMarshal(t *testing.T, c stablePrimitives, tr test.Primitives, wrongField bool) *test.Primitives {
|
||||
func testMarshal(t *testing.T, c stablePrimitives, tr *test.Primitives, wrongField bool) *test.Primitives {
|
||||
var (
|
||||
wire []byte
|
||||
err error
|
||||
|
@ -447,7 +486,7 @@ func testMarshal(t *testing.T, c stablePrimitives, tr test.Primitives, wrongFiel
|
|||
wire, err = c.stableMarshal(nil, wrongField)
|
||||
require.NoError(t, err)
|
||||
|
||||
wireGen, err := goproto.Marshal(&tr)
|
||||
wireGen, err := goproto.Marshal(tr)
|
||||
require.NoError(t, err)
|
||||
|
||||
if !wrongField {
|
||||
|
@ -470,7 +509,7 @@ func testBytesMarshal(t *testing.T, data []byte, wrongField bool) {
|
|||
transport = test.Primitives{FieldA: data}
|
||||
)
|
||||
|
||||
result := testMarshal(t, custom, transport, wrongField)
|
||||
result := testMarshal(t, custom, &transport, wrongField)
|
||||
|
||||
if !wrongField {
|
||||
require.Len(t, result.FieldA, len(data))
|
||||
|
@ -488,7 +527,7 @@ func testStringMarshal(t *testing.T, s string, wrongField bool) {
|
|||
transport = test.Primitives{FieldB: s}
|
||||
)
|
||||
|
||||
result := testMarshal(t, custom, transport, wrongField)
|
||||
result := testMarshal(t, custom, &transport, wrongField)
|
||||
|
||||
if !wrongField {
|
||||
require.Len(t, result.FieldB, len(s))
|
||||
|
@ -506,7 +545,7 @@ func testBoolMarshal(t *testing.T, b bool, wrongField bool) {
|
|||
transport = test.Primitives{FieldC: b}
|
||||
)
|
||||
|
||||
result := testMarshal(t, custom, transport, wrongField)
|
||||
result := testMarshal(t, custom, &transport, wrongField)
|
||||
|
||||
if !wrongField {
|
||||
require.Equal(t, b, result.FieldC)
|
||||
|
@ -521,7 +560,7 @@ func testInt32Marshal(t *testing.T, n int32, wrongField bool) {
|
|||
transport = test.Primitives{FieldD: n}
|
||||
)
|
||||
|
||||
result := testMarshal(t, custom, transport, wrongField)
|
||||
result := testMarshal(t, custom, &transport, wrongField)
|
||||
|
||||
if !wrongField {
|
||||
require.Equal(t, n, result.FieldD)
|
||||
|
@ -536,7 +575,7 @@ func testUInt32Marshal(t *testing.T, n uint32, wrongField bool) {
|
|||
transport = test.Primitives{FieldE: n}
|
||||
)
|
||||
|
||||
result := testMarshal(t, custom, transport, wrongField)
|
||||
result := testMarshal(t, custom, &transport, wrongField)
|
||||
|
||||
if !wrongField {
|
||||
require.Equal(t, n, result.FieldE)
|
||||
|
@ -551,7 +590,7 @@ func testInt64Marshal(t *testing.T, n int64, wrongField bool) {
|
|||
transport = test.Primitives{FieldF: n}
|
||||
)
|
||||
|
||||
result := testMarshal(t, custom, transport, wrongField)
|
||||
result := testMarshal(t, custom, &transport, wrongField)
|
||||
|
||||
if !wrongField {
|
||||
require.Equal(t, n, result.FieldF)
|
||||
|
@ -566,7 +605,7 @@ func testUInt64Marshal(t *testing.T, n uint64, wrongField bool) {
|
|||
transport = test.Primitives{FieldG: n}
|
||||
)
|
||||
|
||||
result := testMarshal(t, custom, transport, wrongField)
|
||||
result := testMarshal(t, custom, &transport, wrongField)
|
||||
|
||||
if !wrongField {
|
||||
require.Equal(t, n, result.FieldG)
|
||||
|
@ -581,7 +620,7 @@ func testFloat64Marshal(t *testing.T, n float64, wrongField bool) {
|
|||
transport = test.Primitives{FieldJ: n}
|
||||
)
|
||||
|
||||
result := testMarshal(t, custom, transport, wrongField)
|
||||
result := testMarshal(t, custom, &transport, wrongField)
|
||||
|
||||
if !wrongField {
|
||||
require.Equal(t, n, result.FieldJ)
|
||||
|
@ -596,7 +635,7 @@ func testEnumMarshal(t *testing.T, e SomeEnum, wrongField bool) {
|
|||
transport = test.Primitives{FieldH: test.Primitives_SomeEnum(e)}
|
||||
)
|
||||
|
||||
result := testMarshal(t, custom, transport, wrongField)
|
||||
result := testMarshal(t, custom, &transport, wrongField)
|
||||
|
||||
if !wrongField {
|
||||
require.EqualValues(t, custom.FieldH, result.FieldH)
|
||||
|
@ -605,7 +644,7 @@ func testEnumMarshal(t *testing.T, e SomeEnum, wrongField bool) {
|
|||
}
|
||||
}
|
||||
|
||||
func testRepMarshal(t *testing.T, c stableRepPrimitives, tr test.RepPrimitives, wrongField bool) *test.RepPrimitives {
|
||||
func testRepMarshal(t *testing.T, c stableRepPrimitives, tr *test.RepPrimitives, wrongField bool) *test.RepPrimitives {
|
||||
var (
|
||||
wire []byte
|
||||
err error
|
||||
|
@ -613,7 +652,7 @@ func testRepMarshal(t *testing.T, c stableRepPrimitives, tr test.RepPrimitives,
|
|||
wire, err = c.stableMarshal(nil, wrongField)
|
||||
require.NoError(t, err)
|
||||
|
||||
wireGen, err := goproto.Marshal(&tr)
|
||||
wireGen, err := goproto.Marshal(tr)
|
||||
require.NoError(t, err)
|
||||
|
||||
if !wrongField {
|
||||
|
@ -636,7 +675,7 @@ func testRepeatedBytesMarshal(t *testing.T, data [][]byte, wrongField bool) {
|
|||
transport = test.RepPrimitives{FieldA: data}
|
||||
)
|
||||
|
||||
result := testRepMarshal(t, custom, transport, wrongField)
|
||||
result := testRepMarshal(t, custom, &transport, wrongField)
|
||||
|
||||
if !wrongField {
|
||||
require.Len(t, result.FieldA, len(data))
|
||||
|
@ -654,7 +693,7 @@ func testRepeatedStringMarshal(t *testing.T, s []string, wrongField bool) {
|
|||
transport = test.RepPrimitives{FieldB: s}
|
||||
)
|
||||
|
||||
result := testRepMarshal(t, custom, transport, wrongField)
|
||||
result := testRepMarshal(t, custom, &transport, wrongField)
|
||||
|
||||
if !wrongField {
|
||||
require.Len(t, result.FieldB, len(s))
|
||||
|
@ -672,7 +711,7 @@ func testRepeatedInt32Marshal(t *testing.T, n []int32, wrongField bool) {
|
|||
transport = test.RepPrimitives{FieldC: n}
|
||||
)
|
||||
|
||||
result := testRepMarshal(t, custom, transport, wrongField)
|
||||
result := testRepMarshal(t, custom, &transport, wrongField)
|
||||
|
||||
if !wrongField {
|
||||
require.Len(t, result.FieldC, len(n))
|
||||
|
@ -690,7 +729,7 @@ func testRepeatedUInt32Marshal(t *testing.T, n []uint32, wrongField bool) {
|
|||
transport = test.RepPrimitives{FieldD: n}
|
||||
)
|
||||
|
||||
result := testRepMarshal(t, custom, transport, wrongField)
|
||||
result := testRepMarshal(t, custom, &transport, wrongField)
|
||||
|
||||
if !wrongField {
|
||||
require.Len(t, result.FieldD, len(n))
|
||||
|
@ -708,7 +747,7 @@ func testRepeatedInt64Marshal(t *testing.T, n []int64, wrongField bool) {
|
|||
transport = test.RepPrimitives{FieldE: n}
|
||||
)
|
||||
|
||||
result := testRepMarshal(t, custom, transport, wrongField)
|
||||
result := testRepMarshal(t, custom, &transport, wrongField)
|
||||
|
||||
if !wrongField {
|
||||
require.Len(t, result.FieldE, len(n))
|
||||
|
@ -726,7 +765,7 @@ func testRepeatedUInt64Marshal(t *testing.T, n []uint64, wrongField bool) {
|
|||
transport = test.RepPrimitives{FieldF: n}
|
||||
)
|
||||
|
||||
result := testRepMarshal(t, custom, transport, wrongField)
|
||||
result := testRepMarshal(t, custom, &transport, wrongField)
|
||||
|
||||
if !wrongField {
|
||||
require.Len(t, result.FieldF, len(n))
|
||||
|
@ -738,13 +777,31 @@ func testRepeatedUInt64Marshal(t *testing.T, n []uint64, wrongField bool) {
|
|||
}
|
||||
}
|
||||
|
||||
func testRepeatedUInt64MarshalUnpacked(t *testing.T, n []uint64, wrongField bool) {
|
||||
var (
|
||||
custom = stableRepPrimitives{FieldFu: n}
|
||||
transport = test.RepPrimitives{FieldFu: n}
|
||||
)
|
||||
|
||||
result := testRepMarshal(t, custom, &transport, wrongField)
|
||||
|
||||
if !wrongField {
|
||||
require.Len(t, result.FieldFu, len(n))
|
||||
if len(n) > 0 {
|
||||
require.Equal(t, n, result.FieldFu)
|
||||
}
|
||||
} else {
|
||||
require.Len(t, result.FieldFu, 0)
|
||||
}
|
||||
}
|
||||
|
||||
func testFixed64Marshal(t *testing.T, n uint64, wrongField bool) {
|
||||
var (
|
||||
custom = stablePrimitives{FieldI: n}
|
||||
transport = test.Primitives{FieldI: n}
|
||||
)
|
||||
|
||||
result := testMarshal(t, custom, transport, wrongField)
|
||||
result := testMarshal(t, custom, &transport, wrongField)
|
||||
|
||||
if !wrongField {
|
||||
require.Equal(t, n, result.FieldI)
|
||||
|
@ -759,7 +816,7 @@ func testFixed32Marshal(t *testing.T, n uint32, wrongField bool) {
|
|||
transport = test.Primitives{FieldK: n}
|
||||
)
|
||||
|
||||
result := testMarshal(t, custom, transport, wrongField)
|
||||
result := testMarshal(t, custom, &transport, wrongField)
|
||||
|
||||
if !wrongField {
|
||||
require.Equal(t, n, result.FieldK)
|
||||
|
|
32
util/proto/test/test.pb.go
generated
32
util/proto/test/test.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v4.25.3
|
||||
// protoc v5.27.2
|
||||
// source: util/proto/test/test.proto
|
||||
|
||||
package test
|
||||
|
@ -201,12 +201,13 @@ type RepPrimitives struct {
|
|||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
FieldA [][]byte `protobuf:"bytes,1,rep,name=field_a,json=fieldA,proto3" json:"field_a,omitempty"`
|
||||
FieldB []string `protobuf:"bytes,2,rep,name=field_b,json=fieldB,proto3" json:"field_b,omitempty"`
|
||||
FieldC []int32 `protobuf:"varint,3,rep,packed,name=field_c,json=fieldC,proto3" json:"field_c,omitempty"`
|
||||
FieldD []uint32 `protobuf:"varint,4,rep,packed,name=field_d,json=fieldD,proto3" json:"field_d,omitempty"`
|
||||
FieldE []int64 `protobuf:"varint,5,rep,packed,name=field_e,json=fieldE,proto3" json:"field_e,omitempty"`
|
||||
FieldF []uint64 `protobuf:"varint,6,rep,packed,name=field_f,json=fieldF,proto3" json:"field_f,omitempty"`
|
||||
FieldA [][]byte `protobuf:"bytes,1,rep,name=field_a,json=fieldA,proto3" json:"field_a,omitempty"`
|
||||
FieldB []string `protobuf:"bytes,2,rep,name=field_b,json=fieldB,proto3" json:"field_b,omitempty"`
|
||||
FieldC []int32 `protobuf:"varint,3,rep,packed,name=field_c,json=fieldC,proto3" json:"field_c,omitempty"`
|
||||
FieldD []uint32 `protobuf:"varint,4,rep,packed,name=field_d,json=fieldD,proto3" json:"field_d,omitempty"`
|
||||
FieldE []int64 `protobuf:"varint,5,rep,packed,name=field_e,json=fieldE,proto3" json:"field_e,omitempty"`
|
||||
FieldF []uint64 `protobuf:"varint,6,rep,packed,name=field_f,json=fieldF,proto3" json:"field_f,omitempty"`
|
||||
FieldFu []uint64 `protobuf:"varint,7,rep,name=field_fu,json=fieldFu,proto3" json:"field_fu,omitempty"`
|
||||
}
|
||||
|
||||
func (x *RepPrimitives) Reset() {
|
||||
|
@ -283,6 +284,13 @@ func (x *RepPrimitives) GetFieldF() []uint64 {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (x *RepPrimitives) GetFieldFu() []uint64 {
|
||||
if x != nil {
|
||||
return x.FieldFu
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_util_proto_test_test_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_util_proto_test_test_proto_rawDesc = []byte{
|
||||
|
@ -312,7 +320,7 @@ var file_util_proto_test_test_proto_rawDesc = []byte{
|
|||
0x45, 0x6e, 0x75, 0x6d, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10,
|
||||
0x00, 0x12, 0x0c, 0x0a, 0x08, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12,
|
||||
0x15, 0x0a, 0x08, 0x4e, 0x45, 0x47, 0x41, 0x54, 0x49, 0x56, 0x45, 0x10, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x22, 0xa5, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x70, 0x50, 0x72,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x22, 0xc4, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x70, 0x50, 0x72,
|
||||
0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c,
|
||||
0x64, 0x5f, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64,
|
||||
0x41, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x18, 0x02, 0x20, 0x03,
|
||||
|
@ -322,9 +330,11 @@ var file_util_proto_test_test_proto_rawDesc = []byte{
|
|||
0x20, 0x03, 0x28, 0x0d, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x12, 0x17, 0x0a, 0x07,
|
||||
0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x03, 0x52, 0x06, 0x66,
|
||||
0x69, 0x65, 0x6c, 0x64, 0x45, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x66,
|
||||
0x18, 0x06, 0x20, 0x03, 0x28, 0x04, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x46, 0x42, 0x11,
|
||||
0x5a, 0x0f, 0x75, 0x74, 0x69, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x65, 0x73,
|
||||
0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x18, 0x06, 0x20, 0x03, 0x28, 0x04, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x46, 0x12, 0x1d,
|
||||
0x0a, 0x08, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x66, 0x75, 0x18, 0x07, 0x20, 0x03, 0x28, 0x04,
|
||||
0x42, 0x02, 0x10, 0x00, 0x52, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x46, 0x75, 0x42, 0x11, 0x5a,
|
||||
0x0f, 0x75, 0x74, 0x69, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
|
@ -5,30 +5,31 @@ package test;
|
|||
option go_package = "util/proto/test";
|
||||
|
||||
message Primitives {
|
||||
bytes field_a = 1;
|
||||
string field_b = 2;
|
||||
bool field_c = 200;
|
||||
int32 field_d = 201;
|
||||
uint32 field_e = 202;
|
||||
int64 field_f = 203;
|
||||
uint64 field_g = 204;
|
||||
fixed64 field_i = 205;
|
||||
double field_j = 206;
|
||||
fixed32 field_k = 207;
|
||||
bytes field_a = 1;
|
||||
string field_b = 2;
|
||||
bool field_c = 200;
|
||||
int32 field_d = 201;
|
||||
uint32 field_e = 202;
|
||||
int64 field_f = 203;
|
||||
uint64 field_g = 204;
|
||||
fixed64 field_i = 205;
|
||||
double field_j = 206;
|
||||
fixed32 field_k = 207;
|
||||
|
||||
enum SomeEnum {
|
||||
UNKNOWN = 0;
|
||||
POSITIVE = 1;
|
||||
NEGATIVE = -1;
|
||||
}
|
||||
SomeEnum field_h = 300;
|
||||
enum SomeEnum {
|
||||
UNKNOWN = 0;
|
||||
POSITIVE = 1;
|
||||
NEGATIVE = -1;
|
||||
}
|
||||
SomeEnum field_h = 300;
|
||||
}
|
||||
|
||||
message RepPrimitives {
|
||||
repeated bytes field_a = 1;
|
||||
repeated string field_b = 2;
|
||||
repeated int32 field_c = 3;
|
||||
repeated uint32 field_d = 4;
|
||||
repeated int64 field_e = 5;
|
||||
repeated uint64 field_f = 6;
|
||||
repeated bytes field_a = 1;
|
||||
repeated string field_b = 2;
|
||||
repeated int32 field_c = 3;
|
||||
repeated uint32 field_d = 4;
|
||||
repeated int64 field_e = 5;
|
||||
repeated uint64 field_f = 6;
|
||||
repeated uint64 field_fu = 7 [ packed = false ];
|
||||
}
|
||||
|
|
|
@ -8,6 +8,11 @@ import (
|
|||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
var (
|
||||
protowirePackage = protogen.GoImportPath("google.golang.org/protobuf/encoding/protowire")
|
||||
binaryPackage = protogen.GoImportPath("encoding/binary")
|
||||
)
|
||||
|
||||
func main() {
|
||||
protogen.Options{}.Run(func(gen *protogen.Plugin) error {
|
||||
for _, f := range gen.Files {
|
||||
|
@ -62,7 +67,7 @@ func emitMessage(g *protogen.GeneratedFile, msg *protogen.Message) {
|
|||
g.P("if x == nil { return 0 }")
|
||||
if len(fs) != 0 {
|
||||
for _, f := range fs {
|
||||
if f.Desc.IsList() && marshalers[f.Desc.Kind()].RepeatedDouble {
|
||||
if f.Desc.IsList() && marshalers[f.Desc.Kind()].RepeatedDouble && !(f.Desc.Kind() == protoreflect.Uint64Kind && !f.Desc.IsPacked()) {
|
||||
g.P("var n int")
|
||||
break
|
||||
}
|
||||
|
@ -140,9 +145,19 @@ func emitFieldSize(g *protogen.GeneratedFile, f *protogen.Field) {
|
|||
}
|
||||
|
||||
switch {
|
||||
case f.Desc.IsList() && f.Desc.Kind() == protoreflect.MessageKind:
|
||||
case f.Desc.IsList() && (f.Desc.Kind() == protoreflect.MessageKind || f.Desc.Kind() == protoreflect.Uint64Kind && !f.Desc.IsPacked()):
|
||||
g.P("for i := range ", name, "{")
|
||||
g.P("size += proto.NestedStructureSize(", f.Desc.Number(), ", ", name, "[i])")
|
||||
if f.Desc.Kind() == protoreflect.MessageKind {
|
||||
g.P("size += proto.NestedStructureSize(", f.Desc.Number(), ", ", name, "[i])")
|
||||
} else {
|
||||
if f.Desc.Kind() != protoreflect.Uint64Kind {
|
||||
panic("only uint64 unpacked primitive is supported")
|
||||
}
|
||||
|
||||
g.P("size += ", protowirePackage.Ident("SizeGroup"), "(",
|
||||
protowirePackage.Ident("Number"), "(", f.Desc.Number(), "), ",
|
||||
protowirePackage.Ident("SizeVarint"), "(", name, "[i]))")
|
||||
}
|
||||
g.P("}")
|
||||
case f.Desc.IsList():
|
||||
if m.RepeatedDouble {
|
||||
|
@ -177,9 +192,22 @@ func emitFieldMarshal(g *protogen.GeneratedFile, f *protogen.Field) {
|
|||
prefix = "Repeated" + m.Prefix
|
||||
}
|
||||
switch {
|
||||
case f.Desc.IsList() && f.Desc.Kind() == protoreflect.MessageKind:
|
||||
case f.Desc.IsList() && (f.Desc.Kind() == protoreflect.MessageKind || f.Desc.Kind() == protoreflect.Uint64Kind && !f.Desc.IsPacked()):
|
||||
g.P("for i := range ", name, "{")
|
||||
g.P("offset += proto.NestedStructureMarshal(", f.Desc.Number(), ", buf[offset:], ", name, "[i])")
|
||||
if f.Desc.Kind() == protoreflect.MessageKind {
|
||||
g.P("offset += proto.NestedStructureMarshal(", f.Desc.Number(), ", buf[offset:], ", name, "[i])")
|
||||
} else {
|
||||
if f.Desc.Kind() != protoreflect.Uint64Kind {
|
||||
panic("only uint64 unpacked primitive is supported")
|
||||
}
|
||||
g.P("{")
|
||||
g.P("prefix := ", protowirePackage.Ident("EncodeTag"), "(",
|
||||
protowirePackage.Ident("Number"), "(", f.Desc.Number(), "), ",
|
||||
protowirePackage.Ident("VarintType"), ")")
|
||||
g.P("offset += ", binaryPackage.Ident("PutUvarint"), "(buf[offset:], uint64(prefix))")
|
||||
g.P("offset += ", binaryPackage.Ident("PutUvarint"), "(buf[offset:], ", name, "[i])")
|
||||
g.P("}")
|
||||
}
|
||||
g.P("}")
|
||||
case f.Desc.IsList():
|
||||
g.P("offset += proto.Repeated", m.Prefix, "Marshal(", f.Desc.Number(), ", buf[offset:], ", name, ")")
|
||||
|
|
Loading…
Add table
Reference in a new issue