forked from TrueCloudLab/frostfs-api-go
Compare commits
58 commits
support/v2
...
master
Author | SHA1 | Date | |
---|---|---|---|
f0fc40e116 | |||
29f2157563 | |||
29c522d5d8 | |||
3e705a3cbe | |||
d9a604fbc1 | |||
b06dad731c | |||
d94b9c6d0d | |||
eeb754c327 | |||
805da79319 | |||
f812b1ae5b | |||
287e98ad67 | |||
c3dbbc5eab | |||
13fa0da374 | |||
c9782cf3ef | |||
c49c482ba6 | |||
0484647aae | |||
9c0007fb1d | |||
bd588fa2e5 | |||
7d71556eee | |||
c11f50efec | |||
9c5e32a183 | |||
5e1c6a908f | |||
a2025376fc | |||
eba18f6e67 | |||
ca33fc4adb | |||
5fece80b42 | |||
11e194d274 | |||
9e82a5a31a | |||
981dc785f3 | |||
866db105ed | |||
937a53683a | |||
4a00ef946f | |||
f484ce6b0b | |||
61f6f0f4a2 | |||
c1b5f46f98 | |||
33653962b7 | |||
a43110e363 | |||
7be31eb847 | |||
adb7c602d7 | |||
a28ceb251a | |||
d112a28d38 | |||
47a48969b0 | |||
19247e8941 | |||
ff4f31b6f3 | |||
a0a9b765f3 | |||
280d052cef | |||
35e7397d48 | |||
174773454e | |||
b72aa14bab | |||
42e50c9633 | |||
611355510c | |||
ebaf78c8fa | |||
1473fa588f | |||
c27b978770 | |||
8609f29a60 | |||
8ce8cd6ec2 | |||
8580b49c8d | |||
9b90d139c5 |
164 changed files with 40841 additions and 21302 deletions
|
@ -13,7 +13,7 @@ jobs:
|
|||
- name: Setup Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '1.21'
|
||||
go-version: '1.23'
|
||||
|
||||
- name: Run commit format checker
|
||||
uses: https://git.frostfs.info/TrueCloudLab/dco-go@v3
|
||||
|
|
|
@ -11,7 +11,7 @@ jobs:
|
|||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '1.20'
|
||||
go-version: '1.23'
|
||||
cache: true
|
||||
|
||||
- name: golangci-lint
|
||||
|
@ -24,7 +24,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go_versions: [ '1.19', '1.20' ]
|
||||
go_versions: [ '1.22', '1.23' ]
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
@ -47,7 +47,7 @@ jobs:
|
|||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '1.20'
|
||||
go-version: '1.23'
|
||||
cache: true
|
||||
|
||||
- name: Run tests
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,4 +1,3 @@
|
|||
.idea
|
||||
bin
|
||||
temp
|
||||
/vendor/
|
||||
|
|
|
@ -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:
|
||||
|
@ -52,7 +50,7 @@ linters:
|
|||
- bidichk
|
||||
- durationcheck
|
||||
- exhaustive
|
||||
- exportloopref
|
||||
- copyloopvar
|
||||
- gofmt
|
||||
- goimports
|
||||
- misspell
|
||||
|
@ -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
|
||||
|
|
|
@ -37,6 +37,6 @@ repos:
|
|||
language: system
|
||||
|
||||
- repo: https://github.com/golangci/golangci-lint
|
||||
rev: v1.56.2
|
||||
rev: v1.60.3
|
||||
hooks:
|
||||
- id: golangci-lint
|
||||
|
|
|
@ -47,4 +47,4 @@ Initial public release.
|
|||
This project is a fork of [NeoFS](https://github.com/nspcc-dev/neofs-api-go) from version v2.14.0.
|
||||
To see CHANGELOG for older versions, refer to https://github.com/nspcc-dev/neofs-api-go/blob/master/CHANGELOG.md.
|
||||
|
||||
[Unreleased]: https://github.com/TrueCloudLab/compare/v2.15.0...master
|
||||
[Unreleased]: https://git.frostfs.info/TrueCloudLab/frostfs-api-go/compare/v2.16.0...master
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
First, thank you for contributing! We love and encourage pull requests from
|
||||
everyone. Please follow the guidelines:
|
||||
|
||||
- Check the open [issues](https://github.com/TrueCloudLab/frostfs-api-go/issues) and
|
||||
[pull requests](https://github.com/TrueCloudLab/frostfs-api-go/pulls) for existing
|
||||
- Check the open [issues](https://git.frostfs.info/TrueCloudLab/frostfs-api-go/issues) and
|
||||
[pull requests](https://git.frostfs.info/TrueCloudLab/frostfs-api-go/pulls) for existing
|
||||
discussions.
|
||||
|
||||
- Open an issue first, to discuss a new feature or enhancement.
|
||||
|
@ -26,18 +26,18 @@ send a pull request. We encourage pull requests to discuss code changes. Here
|
|||
are the steps in details:
|
||||
|
||||
### Set up your GitHub Repository
|
||||
Fork [FrostFS node upstream](https://github.com/TrueCloudLab/frostfs-api-go/fork) source
|
||||
Fork [FrostFS node upstream](https://git.frostfs.info/TrueCloudLab/frostfs-api-go/fork) source
|
||||
repository to your own personal repository. Copy the URL of your fork (you will
|
||||
need it for the `git clone` command below).
|
||||
|
||||
```sh
|
||||
$ git clone https://github.com/TrueCloudLab/frostfs-api-go
|
||||
$ git clone https://git.frostfs.info/TrueCloudLab/frostfs-api-go
|
||||
```
|
||||
|
||||
### Set up git remote as ``upstream``
|
||||
```sh
|
||||
$ cd frostfs-api-go
|
||||
$ git remote add upstream https://github.com/TrueCloudLab/frostfs-api-go
|
||||
$ git remote add upstream https://git.frostfs.info/TrueCloudLab/frostfs-api-go
|
||||
$ git fetch upstream
|
||||
$ git merge upstream/master
|
||||
...
|
||||
|
|
58
Makefile
58
Makefile
|
@ -2,8 +2,19 @@
|
|||
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
|
||||
|
||||
.PHONY: dep fmts fumpt imports protoc test lint version help
|
||||
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 $(BIN)/protogen protoc-test
|
||||
|
||||
# Pull go dependencies
|
||||
dep:
|
||||
|
@ -23,7 +34,7 @@ fmts: fumpt imports
|
|||
# Reformat imports
|
||||
imports:
|
||||
@echo "⇒ Processing goimports check"
|
||||
@for f in `find . -type f -name '*.go' -not -path './vendor/*' -not -name '*.pb.go' -prune`; do \
|
||||
@for f in `find . -type f -name '*.go' -not -name '*.pb.go' -prune`; do \
|
||||
goimports -w $$f; \
|
||||
done
|
||||
|
||||
|
@ -32,21 +43,48 @@ 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' -not -path './bin/*' -not -path './util/proto/test/*'`; do \
|
||||
echo "⇒ Processing $$f "; \
|
||||
protoc \
|
||||
--proto_path=.:./vendor:/usr/local/include \
|
||||
--go_out=. --go_opt=paths=source_relative \
|
||||
$(PROTOC_DIR)/bin/protoc \
|
||||
--proto_path=.:$(PROTOC_DIR)/include:/usr/local/include \
|
||||
--plugin=protoc-gen-go-frostfs=$(abspath ./bin/protogen) \
|
||||
--go-frostfs_out=fuzz=true:. \
|
||||
--go-frostfs_opt=paths=source_relative \
|
||||
--go-grpc_opt=require_unimplemented_servers=false \
|
||||
--go-grpc_out=. --go-grpc_opt=paths=source_relative $$f; \
|
||||
done
|
||||
rm -rf vendor
|
||||
|
||||
$(BIN)/protogen:
|
||||
@go build -v -trimpath \
|
||||
-o $(BIN)/protogen \
|
||||
./util/protogen
|
||||
|
||||
protoc-test: protoc $(BIN)/protogen
|
||||
@$(PROTOC_DIR)/bin/protoc \
|
||||
--go_out=. --go_opt=paths=source_relative \
|
||||
--plugin=protoc-gen-go-frostfs=$(abspath $(BIN)/protogen) \
|
||||
--go-frostfs_opt=Mutil/proto/test/test.proto=git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/test/custom \
|
||||
--go-frostfs_opt=module=git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 \
|
||||
--go-frostfs_out=. --go-frostfs_opt=paths=import \
|
||||
./util/proto/test/test.proto
|
||||
|
||||
# Run Unit Test with go test
|
||||
test: GOFLAGS ?= "-count=1"
|
||||
|
|
14
README.md
14
README.md
|
@ -6,22 +6,20 @@
|
|||
</p>
|
||||
|
||||
---
|
||||
![Tests](https://github.com/TrueCloudLab/frostfs-api-go/workflows/frostfs-api-go%20tests/badge.svg)
|
||||
[![codecov](https://codecov.io/gh/TrueCloudLab/frostfs-api-go/branch/master/graph/badge.svg)](https://codecov.io/gh/TrueCloudLab/frostfs-api-go)
|
||||
[![Report](https://goreportcard.com/badge/github.com/TrueCloudLab/frostfs-api-go)](https://goreportcard.com/report/github.com/TrueCloudLab/frostfs-api-go)
|
||||
[![GitHub release](https://img.shields.io/github/release/TrueCloudLab/frostfs-api-go.svg)](https://github.com/TrueCloudLab/frostfs-api-go)
|
||||
![GitHub license](https://img.shields.io/github/license/TrueCloudLab/frostfs-api-go.svg?style=popout)
|
||||
![Tests](https://git.frostfs.info/TrueCloudLab/frostfs-api-go/badges/workflows/tests.yml/badge.svg)
|
||||
[![Report](https://goreportcard.com/badge/git.frostfs.info/TrueCloudLab/frostfs-api-go)](https://goreportcard.com/report/git.frostfs.info/TrueCloudLab/frostfs-api-go)
|
||||
[![Release](https://git.frostfs.info/TrueCloudLab/frostfs-api-go/badges/release.svg)](https://git.frostfs.info/TrueCloudLab/frostfs-api-go)
|
||||
|
||||
# Overview
|
||||
|
||||
Go implementation of recent [FrostFS API](https://github.com/TrueCloudLab/frostfs-api)
|
||||
versions. For a more high-level SDK see [FrostFS SDK](https://github.com/TrueCloudLab/frostfs-sdk-go).
|
||||
Go implementation of recent [FrostFS API](https://git.frostfs.info/TrueCloudLab/frostfs-api)
|
||||
versions. For a more high-level SDK see [FrostFS SDK](https://git.frostfs.info/TrueCloudLab/frostfs-sdk-go).
|
||||
|
||||
## Frostfs-Api compatibility
|
||||
|
||||
|frostfs-api-go version|supported frostfs-api versions|
|
||||
|:------------------:|:--------------------------:|
|
||||
|v2.14.x|[v2.14.0](https://github.com/TrueCloudLab/frostfs-api/releases/tag/v2.14.0)|
|
||||
|v2.14.x|[v2.14.0](https://git.frostfs.info/TrueCloudLab/frostfs-api/releases/tag/v2.14.0)|
|
||||
|
||||
## Contributing
|
||||
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
package accounting
|
||||
|
||||
import (
|
||||
refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc"
|
||||
)
|
||||
|
||||
// SetOwnerId sets identifier of the account owner.
|
||||
func (m *BalanceRequest_Body) SetOwnerId(v *refs.OwnerID) {
|
||||
m.OwnerId = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *BalanceRequest) SetBody(v *BalanceRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *BalanceRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *BalanceRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetBalance sets balance value of the response.
|
||||
func (m *BalanceResponse_Body) SetBalance(v *Decimal) {
|
||||
m.Balance = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *BalanceResponse) SetBody(v *BalanceResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *BalanceResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *BalanceResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
451
accounting/grpc/service.pb.go
generated
451
accounting/grpc/service.pb.go
generated
|
@ -1,451 +0,0 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.2
|
||||
// source: accounting/grpc/service.proto
|
||||
|
||||
package accounting
|
||||
|
||||
import (
|
||||
grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// BalanceRequest message
|
||||
type BalanceRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Body of the balance request message.
|
||||
Body *BalanceRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
|
||||
// Carries request meta information. Header data is used only to regulate
|
||||
// message transport and does not affect request execution.
|
||||
MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"`
|
||||
// Carries request verification information. This header is used to
|
||||
// authenticate the nodes of the message route and check the correctness of
|
||||
// transmission.
|
||||
VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"`
|
||||
}
|
||||
|
||||
func (x *BalanceRequest) Reset() {
|
||||
*x = BalanceRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_accounting_grpc_service_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *BalanceRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*BalanceRequest) ProtoMessage() {}
|
||||
|
||||
func (x *BalanceRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_accounting_grpc_service_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use BalanceRequest.ProtoReflect.Descriptor instead.
|
||||
func (*BalanceRequest) Descriptor() ([]byte, []int) {
|
||||
return file_accounting_grpc_service_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *BalanceRequest) GetBody() *BalanceRequest_Body {
|
||||
if x != nil {
|
||||
return x.Body
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *BalanceRequest) GetMetaHeader() *grpc.RequestMetaHeader {
|
||||
if x != nil {
|
||||
return x.MetaHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *BalanceRequest) GetVerifyHeader() *grpc.RequestVerificationHeader {
|
||||
if x != nil {
|
||||
return x.VerifyHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// BalanceResponse message
|
||||
type BalanceResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Body of the balance response message.
|
||||
Body *BalanceResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
|
||||
// Carries response meta information. Header data is used only to regulate
|
||||
// message transport and does not affect request execution.
|
||||
MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"`
|
||||
// Carries response verification information. This header is used to
|
||||
// authenticate the nodes of the message route and check the correctness of
|
||||
// transmission.
|
||||
VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"`
|
||||
}
|
||||
|
||||
func (x *BalanceResponse) Reset() {
|
||||
*x = BalanceResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_accounting_grpc_service_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *BalanceResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*BalanceResponse) ProtoMessage() {}
|
||||
|
||||
func (x *BalanceResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_accounting_grpc_service_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use BalanceResponse.ProtoReflect.Descriptor instead.
|
||||
func (*BalanceResponse) Descriptor() ([]byte, []int) {
|
||||
return file_accounting_grpc_service_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *BalanceResponse) GetBody() *BalanceResponse_Body {
|
||||
if x != nil {
|
||||
return x.Body
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *BalanceResponse) GetMetaHeader() *grpc.ResponseMetaHeader {
|
||||
if x != nil {
|
||||
return x.MetaHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *BalanceResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader {
|
||||
if x != nil {
|
||||
return x.VerifyHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// To indicate the account for which the balance is requested, its identifier
|
||||
// is used. It can be any existing account in NeoFS sidechain `Balance` smart
|
||||
// contract. If omitted, client implementation MUST set it to the request's
|
||||
// signer `OwnerID`.
|
||||
type BalanceRequest_Body struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Valid user identifier in `OwnerID` format for which the balance is
|
||||
// requested. Required field.
|
||||
OwnerId *grpc1.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *BalanceRequest_Body) Reset() {
|
||||
*x = BalanceRequest_Body{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_accounting_grpc_service_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *BalanceRequest_Body) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*BalanceRequest_Body) ProtoMessage() {}
|
||||
|
||||
func (x *BalanceRequest_Body) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_accounting_grpc_service_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use BalanceRequest_Body.ProtoReflect.Descriptor instead.
|
||||
func (*BalanceRequest_Body) Descriptor() ([]byte, []int) {
|
||||
return file_accounting_grpc_service_proto_rawDescGZIP(), []int{0, 0}
|
||||
}
|
||||
|
||||
func (x *BalanceRequest_Body) GetOwnerId() *grpc1.OwnerID {
|
||||
if x != nil {
|
||||
return x.OwnerId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// The amount of funds in GAS token for the `OwnerID`'s account requested.
|
||||
// Balance is given in the `Decimal` format to avoid precision issues with
|
||||
// rounding.
|
||||
type BalanceResponse_Body struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Amount of funds in GAS token for the requested account.
|
||||
Balance *Decimal `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"`
|
||||
}
|
||||
|
||||
func (x *BalanceResponse_Body) Reset() {
|
||||
*x = BalanceResponse_Body{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_accounting_grpc_service_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *BalanceResponse_Body) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*BalanceResponse_Body) ProtoMessage() {}
|
||||
|
||||
func (x *BalanceResponse_Body) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_accounting_grpc_service_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use BalanceResponse_Body.ProtoReflect.Descriptor instead.
|
||||
func (*BalanceResponse_Body) Descriptor() ([]byte, []int) {
|
||||
return file_accounting_grpc_service_proto_rawDescGZIP(), []int{1, 0}
|
||||
}
|
||||
|
||||
func (x *BalanceResponse_Body) GetBalance() *Decimal {
|
||||
if x != nil {
|
||||
return x.Balance
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_accounting_grpc_service_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_accounting_grpc_service_proto_rawDesc = []byte{
|
||||
0x0a, 0x1d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x67, 0x72, 0x70,
|
||||
0x63, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x14, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75,
|
||||
0x6e, 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x1b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e,
|
||||
0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79,
|
||||
0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x73, 0x65, 0x73, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x22, 0xa5, 0x02, 0x0a, 0x0e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32,
|
||||
0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61,
|
||||
0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52,
|
||||
0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65,
|
||||
0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f,
|
||||
0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
|
||||
0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d,
|
||||
0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e,
|
||||
0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56,
|
||||
0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65,
|
||||
0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a,
|
||||
0x3a, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72,
|
||||
0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e,
|
||||
0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72,
|
||||
0x49, 0x44, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x22, 0xae, 0x02, 0x0a, 0x0f,
|
||||
0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
|
||||
0x3e, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e,
|
||||
0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e,
|
||||
0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12,
|
||||
0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32,
|
||||
0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74,
|
||||
0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66,
|
||||
0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d,
|
||||
0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66,
|
||||
0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76,
|
||||
0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x3f, 0x0a, 0x04, 0x42,
|
||||
0x6f, 0x64, 0x79, 0x12, 0x37, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32,
|
||||
0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x44, 0x65, 0x63, 0x69,
|
||||
0x6d, 0x61, 0x6c, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x32, 0x6b, 0x0a, 0x11,
|
||||
0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x12, 0x56, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x24, 0x2e, 0x6e,
|
||||
0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
|
||||
0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61,
|
||||
0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63,
|
||||
0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6d, 0x5a, 0x4a, 0x67, 0x69, 0x74,
|
||||
0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72,
|
||||
0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74,
|
||||
0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x63, 0x63,
|
||||
0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x63, 0x63,
|
||||
0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0xaa, 0x02, 0x1e, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69,
|
||||
0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x41, 0x63,
|
||||
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_accounting_grpc_service_proto_rawDescOnce sync.Once
|
||||
file_accounting_grpc_service_proto_rawDescData = file_accounting_grpc_service_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_accounting_grpc_service_proto_rawDescGZIP() []byte {
|
||||
file_accounting_grpc_service_proto_rawDescOnce.Do(func() {
|
||||
file_accounting_grpc_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_accounting_grpc_service_proto_rawDescData)
|
||||
})
|
||||
return file_accounting_grpc_service_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_accounting_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_accounting_grpc_service_proto_goTypes = []interface{}{
|
||||
(*BalanceRequest)(nil), // 0: neo.fs.v2.accounting.BalanceRequest
|
||||
(*BalanceResponse)(nil), // 1: neo.fs.v2.accounting.BalanceResponse
|
||||
(*BalanceRequest_Body)(nil), // 2: neo.fs.v2.accounting.BalanceRequest.Body
|
||||
(*BalanceResponse_Body)(nil), // 3: neo.fs.v2.accounting.BalanceResponse.Body
|
||||
(*grpc.RequestMetaHeader)(nil), // 4: neo.fs.v2.session.RequestMetaHeader
|
||||
(*grpc.RequestVerificationHeader)(nil), // 5: neo.fs.v2.session.RequestVerificationHeader
|
||||
(*grpc.ResponseMetaHeader)(nil), // 6: neo.fs.v2.session.ResponseMetaHeader
|
||||
(*grpc.ResponseVerificationHeader)(nil), // 7: neo.fs.v2.session.ResponseVerificationHeader
|
||||
(*grpc1.OwnerID)(nil), // 8: neo.fs.v2.refs.OwnerID
|
||||
(*Decimal)(nil), // 9: neo.fs.v2.accounting.Decimal
|
||||
}
|
||||
var file_accounting_grpc_service_proto_depIdxs = []int32{
|
||||
2, // 0: neo.fs.v2.accounting.BalanceRequest.body:type_name -> neo.fs.v2.accounting.BalanceRequest.Body
|
||||
4, // 1: neo.fs.v2.accounting.BalanceRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader
|
||||
5, // 2: neo.fs.v2.accounting.BalanceRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader
|
||||
3, // 3: neo.fs.v2.accounting.BalanceResponse.body:type_name -> neo.fs.v2.accounting.BalanceResponse.Body
|
||||
6, // 4: neo.fs.v2.accounting.BalanceResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader
|
||||
7, // 5: neo.fs.v2.accounting.BalanceResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader
|
||||
8, // 6: neo.fs.v2.accounting.BalanceRequest.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID
|
||||
9, // 7: neo.fs.v2.accounting.BalanceResponse.Body.balance:type_name -> neo.fs.v2.accounting.Decimal
|
||||
0, // 8: neo.fs.v2.accounting.AccountingService.Balance:input_type -> neo.fs.v2.accounting.BalanceRequest
|
||||
1, // 9: neo.fs.v2.accounting.AccountingService.Balance:output_type -> neo.fs.v2.accounting.BalanceResponse
|
||||
9, // [9:10] is the sub-list for method output_type
|
||||
8, // [8:9] is the sub-list for method input_type
|
||||
8, // [8:8] is the sub-list for extension type_name
|
||||
8, // [8:8] is the sub-list for extension extendee
|
||||
0, // [0:8] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_accounting_grpc_service_proto_init() }
|
||||
func file_accounting_grpc_service_proto_init() {
|
||||
if File_accounting_grpc_service_proto != nil {
|
||||
return
|
||||
}
|
||||
file_accounting_grpc_types_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_accounting_grpc_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*BalanceRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_accounting_grpc_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*BalanceResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_accounting_grpc_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*BalanceRequest_Body); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_accounting_grpc_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*BalanceResponse_Body); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_accounting_grpc_service_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_accounting_grpc_service_proto_goTypes,
|
||||
DependencyIndexes: file_accounting_grpc_service_proto_depIdxs,
|
||||
MessageInfos: file_accounting_grpc_service_proto_msgTypes,
|
||||
}.Build()
|
||||
File_accounting_grpc_service_proto = out.File
|
||||
file_accounting_grpc_service_proto_rawDesc = nil
|
||||
file_accounting_grpc_service_proto_goTypes = nil
|
||||
file_accounting_grpc_service_proto_depIdxs = nil
|
||||
}
|
768
accounting/grpc/service_frostfs.pb.go
generated
Normal file
768
accounting/grpc/service_frostfs.pb.go
generated
Normal file
|
@ -0,0 +1,768 @@
|
|||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package accounting
|
||||
|
||||
import (
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc"
|
||||
pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool"
|
||||
proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto"
|
||||
encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding"
|
||||
easyproto "github.com/VictoriaMetrics/easyproto"
|
||||
jlexer "github.com/mailru/easyjson/jlexer"
|
||||
jwriter "github.com/mailru/easyjson/jwriter"
|
||||
)
|
||||
|
||||
type BalanceRequest_Body struct {
|
||||
OwnerId *grpc.OwnerID `json:"ownerId"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*BalanceRequest_Body)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*BalanceRequest_Body)(nil)
|
||||
_ json.Marshaler = (*BalanceRequest_Body)(nil)
|
||||
_ json.Unmarshaler = (*BalanceRequest_Body)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *BalanceRequest_Body) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.NestedStructureSize(1, x.OwnerId)
|
||||
return size
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *BalanceRequest_Body) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *BalanceRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if x.OwnerId != nil {
|
||||
x.OwnerId.EmitProtobuf(mm.AppendMessage(1))
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *BalanceRequest_Body) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "BalanceRequest_Body")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // OwnerId
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "OwnerId")
|
||||
}
|
||||
x.OwnerId = new(grpc.OwnerID)
|
||||
if err := x.OwnerId.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceRequest_Body) GetOwnerId() *grpc.OwnerID {
|
||||
if x != nil {
|
||||
return x.OwnerId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceRequest_Body) SetOwnerId(v *grpc.OwnerID) {
|
||||
x.OwnerId = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *BalanceRequest_Body) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *BalanceRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
first := true
|
||||
out.RawByte('{')
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"ownerId\":"
|
||||
out.RawString(prefix)
|
||||
x.OwnerId.MarshalEasyJSON(out)
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *BalanceRequest_Body) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *BalanceRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "ownerId":
|
||||
{
|
||||
var f *grpc.OwnerID
|
||||
f = new(grpc.OwnerID)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.OwnerId = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
||||
|
||||
type BalanceRequest struct {
|
||||
Body *BalanceRequest_Body `json:"body"`
|
||||
MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"`
|
||||
VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*BalanceRequest)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*BalanceRequest)(nil)
|
||||
_ json.Marshaler = (*BalanceRequest)(nil)
|
||||
_ json.Unmarshaler = (*BalanceRequest)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *BalanceRequest) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.NestedStructureSize(1, x.Body)
|
||||
size += proto.NestedStructureSize(2, x.MetaHeader)
|
||||
size += proto.NestedStructureSize(3, x.VerifyHeader)
|
||||
return size
|
||||
}
|
||||
|
||||
// ReadSignedData fills buf with signed data of x.
|
||||
// If buffer length is less than x.SignedDataSize(), new buffer is allocated.
|
||||
//
|
||||
// Returns any error encountered which did not allow writing the data completely.
|
||||
// Otherwise, returns the buffer in which the data is written.
|
||||
//
|
||||
// Structures with the same field values have the same signed data.
|
||||
func (x *BalanceRequest) SignedDataSize() int {
|
||||
return x.GetBody().StableSize()
|
||||
}
|
||||
|
||||
// SignedDataSize returns size of the request signed data in bytes.
|
||||
//
|
||||
// Structures with the same field values have the same signed data size.
|
||||
func (x *BalanceRequest) ReadSignedData(buf []byte) ([]byte, error) {
|
||||
return x.GetBody().MarshalProtobuf(buf), nil
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *BalanceRequest) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *BalanceRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if x.Body != nil {
|
||||
x.Body.EmitProtobuf(mm.AppendMessage(1))
|
||||
}
|
||||
if x.MetaHeader != nil {
|
||||
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
|
||||
}
|
||||
if x.VerifyHeader != nil {
|
||||
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *BalanceRequest) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "BalanceRequest")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Body
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Body")
|
||||
}
|
||||
x.Body = new(BalanceRequest_Body)
|
||||
if err := x.Body.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
case 2: // MetaHeader
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "MetaHeader")
|
||||
}
|
||||
x.MetaHeader = new(grpc1.RequestMetaHeader)
|
||||
if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
case 3: // VerifyHeader
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader")
|
||||
}
|
||||
x.VerifyHeader = new(grpc1.RequestVerificationHeader)
|
||||
if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceRequest) GetBody() *BalanceRequest_Body {
|
||||
if x != nil {
|
||||
return x.Body
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceRequest) SetBody(v *BalanceRequest_Body) {
|
||||
x.Body = v
|
||||
}
|
||||
func (x *BalanceRequest) GetMetaHeader() *grpc1.RequestMetaHeader {
|
||||
if x != nil {
|
||||
return x.MetaHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) {
|
||||
x.MetaHeader = v
|
||||
}
|
||||
func (x *BalanceRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader {
|
||||
if x != nil {
|
||||
return x.VerifyHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) {
|
||||
x.VerifyHeader = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *BalanceRequest) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *BalanceRequest) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
first := true
|
||||
out.RawByte('{')
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"body\":"
|
||||
out.RawString(prefix)
|
||||
x.Body.MarshalEasyJSON(out)
|
||||
}
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"metaHeader\":"
|
||||
out.RawString(prefix)
|
||||
x.MetaHeader.MarshalEasyJSON(out)
|
||||
}
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"verifyHeader\":"
|
||||
out.RawString(prefix)
|
||||
x.VerifyHeader.MarshalEasyJSON(out)
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *BalanceRequest) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *BalanceRequest) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "body":
|
||||
{
|
||||
var f *BalanceRequest_Body
|
||||
f = new(BalanceRequest_Body)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.Body = f
|
||||
}
|
||||
case "metaHeader":
|
||||
{
|
||||
var f *grpc1.RequestMetaHeader
|
||||
f = new(grpc1.RequestMetaHeader)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.MetaHeader = f
|
||||
}
|
||||
case "verifyHeader":
|
||||
{
|
||||
var f *grpc1.RequestVerificationHeader
|
||||
f = new(grpc1.RequestVerificationHeader)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.VerifyHeader = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
||||
|
||||
type BalanceResponse_Body struct {
|
||||
Balance *Decimal `json:"balance"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*BalanceResponse_Body)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*BalanceResponse_Body)(nil)
|
||||
_ json.Marshaler = (*BalanceResponse_Body)(nil)
|
||||
_ json.Unmarshaler = (*BalanceResponse_Body)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *BalanceResponse_Body) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.NestedStructureSize(1, x.Balance)
|
||||
return size
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *BalanceResponse_Body) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *BalanceResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if x.Balance != nil {
|
||||
x.Balance.EmitProtobuf(mm.AppendMessage(1))
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *BalanceResponse_Body) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "BalanceResponse_Body")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Balance
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Balance")
|
||||
}
|
||||
x.Balance = new(Decimal)
|
||||
if err := x.Balance.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceResponse_Body) GetBalance() *Decimal {
|
||||
if x != nil {
|
||||
return x.Balance
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceResponse_Body) SetBalance(v *Decimal) {
|
||||
x.Balance = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *BalanceResponse_Body) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *BalanceResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
first := true
|
||||
out.RawByte('{')
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"balance\":"
|
||||
out.RawString(prefix)
|
||||
x.Balance.MarshalEasyJSON(out)
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *BalanceResponse_Body) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *BalanceResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "balance":
|
||||
{
|
||||
var f *Decimal
|
||||
f = new(Decimal)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.Balance = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
||||
|
||||
type BalanceResponse struct {
|
||||
Body *BalanceResponse_Body `json:"body"`
|
||||
MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"`
|
||||
VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*BalanceResponse)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*BalanceResponse)(nil)
|
||||
_ json.Marshaler = (*BalanceResponse)(nil)
|
||||
_ json.Unmarshaler = (*BalanceResponse)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *BalanceResponse) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.NestedStructureSize(1, x.Body)
|
||||
size += proto.NestedStructureSize(2, x.MetaHeader)
|
||||
size += proto.NestedStructureSize(3, x.VerifyHeader)
|
||||
return size
|
||||
}
|
||||
|
||||
// ReadSignedData fills buf with signed data of x.
|
||||
// If buffer length is less than x.SignedDataSize(), new buffer is allocated.
|
||||
//
|
||||
// Returns any error encountered which did not allow writing the data completely.
|
||||
// Otherwise, returns the buffer in which the data is written.
|
||||
//
|
||||
// Structures with the same field values have the same signed data.
|
||||
func (x *BalanceResponse) SignedDataSize() int {
|
||||
return x.GetBody().StableSize()
|
||||
}
|
||||
|
||||
// SignedDataSize returns size of the request signed data in bytes.
|
||||
//
|
||||
// Structures with the same field values have the same signed data size.
|
||||
func (x *BalanceResponse) ReadSignedData(buf []byte) ([]byte, error) {
|
||||
return x.GetBody().MarshalProtobuf(buf), nil
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *BalanceResponse) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *BalanceResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if x.Body != nil {
|
||||
x.Body.EmitProtobuf(mm.AppendMessage(1))
|
||||
}
|
||||
if x.MetaHeader != nil {
|
||||
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
|
||||
}
|
||||
if x.VerifyHeader != nil {
|
||||
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *BalanceResponse) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "BalanceResponse")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Body
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Body")
|
||||
}
|
||||
x.Body = new(BalanceResponse_Body)
|
||||
if err := x.Body.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
case 2: // MetaHeader
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "MetaHeader")
|
||||
}
|
||||
x.MetaHeader = new(grpc1.ResponseMetaHeader)
|
||||
if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
case 3: // VerifyHeader
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader")
|
||||
}
|
||||
x.VerifyHeader = new(grpc1.ResponseVerificationHeader)
|
||||
if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceResponse) GetBody() *BalanceResponse_Body {
|
||||
if x != nil {
|
||||
return x.Body
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceResponse) SetBody(v *BalanceResponse_Body) {
|
||||
x.Body = v
|
||||
}
|
||||
func (x *BalanceResponse) GetMetaHeader() *grpc1.ResponseMetaHeader {
|
||||
if x != nil {
|
||||
return x.MetaHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) {
|
||||
x.MetaHeader = v
|
||||
}
|
||||
func (x *BalanceResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader {
|
||||
if x != nil {
|
||||
return x.VerifyHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) {
|
||||
x.VerifyHeader = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *BalanceResponse) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *BalanceResponse) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
first := true
|
||||
out.RawByte('{')
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"body\":"
|
||||
out.RawString(prefix)
|
||||
x.Body.MarshalEasyJSON(out)
|
||||
}
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"metaHeader\":"
|
||||
out.RawString(prefix)
|
||||
x.MetaHeader.MarshalEasyJSON(out)
|
||||
}
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"verifyHeader\":"
|
||||
out.RawString(prefix)
|
||||
x.VerifyHeader.MarshalEasyJSON(out)
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *BalanceResponse) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *BalanceResponse) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "body":
|
||||
{
|
||||
var f *BalanceResponse_Body
|
||||
f = new(BalanceResponse_Body)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.Body = f
|
||||
}
|
||||
case "metaHeader":
|
||||
{
|
||||
var f *grpc1.ResponseMetaHeader
|
||||
f = new(grpc1.ResponseMetaHeader)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.MetaHeader = f
|
||||
}
|
||||
case "verifyHeader":
|
||||
{
|
||||
var f *grpc1.ResponseVerificationHeader
|
||||
f = new(grpc1.ResponseVerificationHeader)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.VerifyHeader = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
45
accounting/grpc/service_frostfs_fuzz.go
Normal file
45
accounting/grpc/service_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,45 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package accounting
|
||||
|
||||
func DoFuzzProtoBalanceRequest(data []byte) int {
|
||||
msg := new(BalanceRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONBalanceRequest(data []byte) int {
|
||||
msg := new(BalanceRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoBalanceResponse(data []byte) int {
|
||||
msg := new(BalanceResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONBalanceResponse(data []byte) int {
|
||||
msg := new(BalanceResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
31
accounting/grpc/service_frostfs_test.go
Normal file
31
accounting/grpc/service_frostfs_test.go
Normal file
|
@ -0,0 +1,31 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package accounting
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoBalanceRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoBalanceRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONBalanceRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONBalanceRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoBalanceResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoBalanceResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONBalanceResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONBalanceResponse(data)
|
||||
})
|
||||
}
|
4
accounting/grpc/service_grpc.pb.go
generated
4
accounting/grpc/service_grpc.pb.go
generated
|
@ -26,7 +26,7 @@ const (
|
|||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type AccountingServiceClient interface {
|
||||
// Returns the amount of funds in GAS token for the requested NeoFS account.
|
||||
// Returns the amount of funds in GAS token for the requested FrostFS account.
|
||||
//
|
||||
// Statuses:
|
||||
// - **OK** (0, SECTION_SUCCESS):
|
||||
|
@ -56,7 +56,7 @@ func (c *accountingServiceClient) Balance(ctx context.Context, in *BalanceReques
|
|||
// All implementations should embed UnimplementedAccountingServiceServer
|
||||
// for forward compatibility
|
||||
type AccountingServiceServer interface {
|
||||
// Returns the amount of funds in GAS token for the requested NeoFS account.
|
||||
// Returns the amount of funds in GAS token for the requested FrostFS account.
|
||||
//
|
||||
// Statuses:
|
||||
// - **OK** (0, SECTION_SUCCESS):
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
package accounting
|
||||
|
||||
// SetValue sets value of the decimal number.
|
||||
func (m *Decimal) SetValue(v int64) {
|
||||
m.Value = v
|
||||
}
|
||||
|
||||
// SetPrecision sets precision of the decimal number.
|
||||
func (m *Decimal) SetPrecision(v uint32) {
|
||||
m.Precision = v
|
||||
}
|
169
accounting/grpc/types.pb.go
generated
169
accounting/grpc/types.pb.go
generated
|
@ -1,169 +0,0 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.2
|
||||
// source: accounting/grpc/types.proto
|
||||
|
||||
package accounting
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// Standard floating point data type can't be used in NeoFS due to inexactness
|
||||
// of the result when doing lots of small number operations. To solve the lost
|
||||
// precision issue, special `Decimal` format is used for monetary computations.
|
||||
//
|
||||
// Please see [The General Decimal Arithmetic
|
||||
// Specification](http://speleotrove.com/decimal/) for detailed problem
|
||||
// description.
|
||||
type Decimal struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Number in the smallest Token fractions.
|
||||
Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
|
||||
// Precision value indicating how many smallest fractions can be in one
|
||||
// integer.
|
||||
Precision uint32 `protobuf:"varint,2,opt,name=precision,proto3" json:"precision,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Decimal) Reset() {
|
||||
*x = Decimal{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_accounting_grpc_types_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Decimal) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Decimal) ProtoMessage() {}
|
||||
|
||||
func (x *Decimal) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_accounting_grpc_types_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Decimal.ProtoReflect.Descriptor instead.
|
||||
func (*Decimal) Descriptor() ([]byte, []int) {
|
||||
return file_accounting_grpc_types_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Decimal) GetValue() int64 {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Decimal) GetPrecision() uint32 {
|
||||
if x != nil {
|
||||
return x.Precision
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_accounting_grpc_types_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_accounting_grpc_types_proto_rawDesc = []byte{
|
||||
0x0a, 0x1b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x67, 0x72, 0x70,
|
||||
0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x6e,
|
||||
0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
|
||||
0x69, 0x6e, 0x67, 0x22, 0x3d, 0x0a, 0x07, 0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x12, 0x14,
|
||||
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76,
|
||||
0x61, 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f,
|
||||
0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x42, 0x6d, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66,
|
||||
0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64,
|
||||
0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d,
|
||||
0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67,
|
||||
0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67,
|
||||
0xaa, 0x02, 0x1e, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61,
|
||||
0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e,
|
||||
0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_accounting_grpc_types_proto_rawDescOnce sync.Once
|
||||
file_accounting_grpc_types_proto_rawDescData = file_accounting_grpc_types_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_accounting_grpc_types_proto_rawDescGZIP() []byte {
|
||||
file_accounting_grpc_types_proto_rawDescOnce.Do(func() {
|
||||
file_accounting_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_accounting_grpc_types_proto_rawDescData)
|
||||
})
|
||||
return file_accounting_grpc_types_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_accounting_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_accounting_grpc_types_proto_goTypes = []interface{}{
|
||||
(*Decimal)(nil), // 0: neo.fs.v2.accounting.Decimal
|
||||
}
|
||||
var file_accounting_grpc_types_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_accounting_grpc_types_proto_init() }
|
||||
func file_accounting_grpc_types_proto_init() {
|
||||
if File_accounting_grpc_types_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_accounting_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Decimal); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_accounting_grpc_types_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_accounting_grpc_types_proto_goTypes,
|
||||
DependencyIndexes: file_accounting_grpc_types_proto_depIdxs,
|
||||
MessageInfos: file_accounting_grpc_types_proto_msgTypes,
|
||||
}.Build()
|
||||
File_accounting_grpc_types_proto = out.File
|
||||
file_accounting_grpc_types_proto_rawDesc = nil
|
||||
file_accounting_grpc_types_proto_goTypes = nil
|
||||
file_accounting_grpc_types_proto_depIdxs = nil
|
||||
}
|
204
accounting/grpc/types_frostfs.pb.go
generated
Normal file
204
accounting/grpc/types_frostfs.pb.go
generated
Normal file
|
@ -0,0 +1,204 @@
|
|||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package accounting
|
||||
|
||||
import (
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool"
|
||||
proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto"
|
||||
encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding"
|
||||
easyproto "github.com/VictoriaMetrics/easyproto"
|
||||
jlexer "github.com/mailru/easyjson/jlexer"
|
||||
jwriter "github.com/mailru/easyjson/jwriter"
|
||||
strconv "strconv"
|
||||
)
|
||||
|
||||
type Decimal struct {
|
||||
Value int64 `json:"value"`
|
||||
Precision uint32 `json:"precision"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*Decimal)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*Decimal)(nil)
|
||||
_ json.Marshaler = (*Decimal)(nil)
|
||||
_ json.Unmarshaler = (*Decimal)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *Decimal) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.Int64Size(1, x.Value)
|
||||
size += proto.UInt32Size(2, x.Precision)
|
||||
return size
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *Decimal) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *Decimal) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if x.Value != 0 {
|
||||
mm.AppendInt64(1, x.Value)
|
||||
}
|
||||
if x.Precision != 0 {
|
||||
mm.AppendUint32(2, x.Precision)
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *Decimal) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "Decimal")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Value
|
||||
data, ok := fc.Int64()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Value")
|
||||
}
|
||||
x.Value = data
|
||||
case 2: // Precision
|
||||
data, ok := fc.Uint32()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Precision")
|
||||
}
|
||||
x.Precision = data
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Decimal) GetValue() int64 {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return 0
|
||||
}
|
||||
func (x *Decimal) SetValue(v int64) {
|
||||
x.Value = v
|
||||
}
|
||||
func (x *Decimal) GetPrecision() uint32 {
|
||||
if x != nil {
|
||||
return x.Precision
|
||||
}
|
||||
return 0
|
||||
}
|
||||
func (x *Decimal) SetPrecision(v uint32) {
|
||||
x.Precision = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *Decimal) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *Decimal) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
first := true
|
||||
out.RawByte('{')
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"value\":"
|
||||
out.RawString(prefix)
|
||||
out.RawByte('"')
|
||||
out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.Value, 10)
|
||||
out.RawByte('"')
|
||||
}
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"precision\":"
|
||||
out.RawString(prefix)
|
||||
out.Uint32(x.Precision)
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *Decimal) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *Decimal) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "value":
|
||||
{
|
||||
var f int64
|
||||
r := in.JsonNumber()
|
||||
n := r.String()
|
||||
v, err := strconv.ParseInt(n, 10, 64)
|
||||
if err != nil {
|
||||
in.AddError(err)
|
||||
return
|
||||
}
|
||||
pv := int64(v)
|
||||
f = pv
|
||||
x.Value = f
|
||||
}
|
||||
case "precision":
|
||||
{
|
||||
var f uint32
|
||||
r := in.JsonNumber()
|
||||
n := r.String()
|
||||
v, err := strconv.ParseUint(n, 10, 32)
|
||||
if err != nil {
|
||||
in.AddError(err)
|
||||
return
|
||||
}
|
||||
pv := uint32(v)
|
||||
f = pv
|
||||
x.Precision = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
26
accounting/grpc/types_frostfs_fuzz.go
Normal file
26
accounting/grpc/types_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package accounting
|
||||
|
||||
func DoFuzzProtoDecimal(data []byte) int {
|
||||
msg := new(Decimal)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONDecimal(data []byte) int {
|
||||
msg := new(Decimal)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
21
accounting/grpc/types_frostfs_test.go
Normal file
21
accounting/grpc/types_frostfs_test.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package accounting
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoDecimal(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoDecimal(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONDecimal(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONDecimal(data)
|
||||
})
|
||||
}
|
|
@ -32,7 +32,7 @@ func BenchmarkTable_ToGRPCMessage(b *testing.B) {
|
|||
|
||||
b.Run("to grpc message", func(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for range b.N {
|
||||
raw := tb.ToGRPCMessage()
|
||||
if len(tb.GetRecords()) != len(raw.(*aclGrpc.EACLTable).Records) {
|
||||
b.FailNow()
|
||||
|
@ -41,7 +41,7 @@ func BenchmarkTable_ToGRPCMessage(b *testing.B) {
|
|||
})
|
||||
b.Run("from grpc message", func(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for range b.N {
|
||||
tb := new(acl.Table)
|
||||
if tb.FromGRPCMessage(raw) != nil {
|
||||
b.FailNow()
|
||||
|
|
|
@ -187,31 +187,29 @@ func (f *HeaderFilter) FromGRPCMessage(m grpc.Message) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func HeaderFiltersToGRPC(fs []HeaderFilter) (res []*acl.EACLRecord_Filter) {
|
||||
func HeaderFiltersToGRPC(fs []HeaderFilter) (res []acl.EACLRecord_Filter) {
|
||||
if fs != nil {
|
||||
res = make([]*acl.EACLRecord_Filter, 0, len(fs))
|
||||
res = make([]acl.EACLRecord_Filter, 0, len(fs))
|
||||
|
||||
for i := range fs {
|
||||
res = append(res, fs[i].ToGRPCMessage().(*acl.EACLRecord_Filter))
|
||||
res = append(res, *fs[i].ToGRPCMessage().(*acl.EACLRecord_Filter))
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func HeaderFiltersFromGRPC(fs []*acl.EACLRecord_Filter) (res []HeaderFilter, err error) {
|
||||
func HeaderFiltersFromGRPC(fs []acl.EACLRecord_Filter) (res []HeaderFilter, err error) {
|
||||
if fs != nil {
|
||||
res = make([]HeaderFilter, len(fs))
|
||||
|
||||
for i := range fs {
|
||||
if fs[i] != nil {
|
||||
err = res[i].FromGRPCMessage(fs[i])
|
||||
err = res[i].FromGRPCMessage(&fs[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -241,31 +239,29 @@ func (t *Target) FromGRPCMessage(m grpc.Message) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func TargetsToGRPC(ts []Target) (res []*acl.EACLRecord_Target) {
|
||||
func TargetsToGRPC(ts []Target) (res []acl.EACLRecord_Target) {
|
||||
if ts != nil {
|
||||
res = make([]*acl.EACLRecord_Target, 0, len(ts))
|
||||
res = make([]acl.EACLRecord_Target, 0, len(ts))
|
||||
|
||||
for i := range ts {
|
||||
res = append(res, ts[i].ToGRPCMessage().(*acl.EACLRecord_Target))
|
||||
res = append(res, *ts[i].ToGRPCMessage().(*acl.EACLRecord_Target))
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func TargetsFromGRPC(fs []*acl.EACLRecord_Target) (res []Target, err error) {
|
||||
func TargetsFromGRPC(fs []acl.EACLRecord_Target) (res []Target, err error) {
|
||||
if fs != nil {
|
||||
res = make([]Target, len(fs))
|
||||
|
||||
for i := range fs {
|
||||
if fs[i] != nil {
|
||||
err = res[i].FromGRPCMessage(fs[i])
|
||||
err = res[i].FromGRPCMessage(&fs[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -309,31 +305,29 @@ func (r *Record) FromGRPCMessage(m grpc.Message) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func RecordsToGRPC(ts []Record) (res []*acl.EACLRecord) {
|
||||
func RecordsToGRPC(ts []Record) (res []acl.EACLRecord) {
|
||||
if ts != nil {
|
||||
res = make([]*acl.EACLRecord, 0, len(ts))
|
||||
res = make([]acl.EACLRecord, 0, len(ts))
|
||||
|
||||
for i := range ts {
|
||||
res = append(res, ts[i].ToGRPCMessage().(*acl.EACLRecord))
|
||||
res = append(res, *ts[i].ToGRPCMessage().(*acl.EACLRecord))
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func RecordsFromGRPC(fs []*acl.EACLRecord) (res []Record, err error) {
|
||||
func RecordsFromGRPC(fs []acl.EACLRecord) (res []Record, err error) {
|
||||
if fs != nil {
|
||||
res = make([]Record, len(fs))
|
||||
|
||||
for i := range fs {
|
||||
if fs[i] != nil {
|
||||
err = res[i].FromGRPCMessage(fs[i])
|
||||
err = res[i].FromGRPCMessage(&fs[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -429,9 +423,9 @@ func (c *APEOverride) ToGRPCMessage() grpc.Message {
|
|||
m.SetTarget(c.target.ToGRPCMessage().(*apeGRPC.ChainTarget))
|
||||
|
||||
if len(c.chains) > 0 {
|
||||
apeChains := make([]*apeGRPC.Chain, len(c.chains))
|
||||
apeChains := make([]apeGRPC.Chain, len(c.chains))
|
||||
for i := range c.chains {
|
||||
apeChains[i] = c.chains[i].ToGRPCMessage().(*apeGRPC.Chain)
|
||||
apeChains[i] = *c.chains[i].ToGRPCMessage().(*apeGRPC.Chain)
|
||||
}
|
||||
m.SetChains(apeChains)
|
||||
}
|
||||
|
@ -459,7 +453,7 @@ func (c *APEOverride) FromGRPCMessage(m grpc.Message) error {
|
|||
c.chains = make([]*ape.Chain, len(apeChains))
|
||||
for i := range apeChains {
|
||||
c.chains[i] = new(ape.Chain)
|
||||
if err := c.chains[i].FromGRPCMessage(apeChains[i]); err != nil {
|
||||
if err := c.chains[i].FromGRPCMessage(&apeChains[i]); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
@ -478,7 +472,7 @@ func (bt *BearerTokenBody) ToGRPCMessage() grpc.Message {
|
|||
m.SetLifetime(bt.lifetime.ToGRPCMessage().(*acl.BearerToken_Body_TokenLifetime))
|
||||
m.SetEaclTable(bt.eacl.ToGRPCMessage().(*acl.EACLTable))
|
||||
m.SetAllowImpersonate(bt.impersonate)
|
||||
m.SetAPEOverride(bt.apeOverride.ToGRPCMessage().(*acl.BearerToken_Body_APEOverride))
|
||||
m.SetApeOverride(bt.apeOverride.ToGRPCMessage().(*acl.BearerToken_Body_APEOverride))
|
||||
}
|
||||
|
||||
return m
|
||||
|
|
|
@ -1,193 +0,0 @@
|
|||
package acl
|
||||
|
||||
import (
|
||||
ape "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/grpc"
|
||||
refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
)
|
||||
|
||||
// SetVersion sets version of EACL rules in table.
|
||||
func (m *EACLTable) SetVersion(v *refs.Version) {
|
||||
m.Version = v
|
||||
}
|
||||
|
||||
// SetContainerId sets container identifier of the eACL table.
|
||||
func (m *EACLTable) SetContainerId(v *refs.ContainerID) {
|
||||
m.ContainerId = v
|
||||
}
|
||||
|
||||
// SetRecords sets record list of the eACL table.
|
||||
func (m *EACLTable) SetRecords(v []*EACLRecord) {
|
||||
m.Records = v
|
||||
}
|
||||
|
||||
// SetOperation sets operation of the eACL record.
|
||||
func (m *EACLRecord) SetOperation(v Operation) {
|
||||
m.Operation = v
|
||||
}
|
||||
|
||||
// SetAction sets action of the eACL record.
|
||||
func (m *EACLRecord) SetAction(v Action) {
|
||||
m.Action = v
|
||||
}
|
||||
|
||||
// SetFilters sets filter list of the eACL record.
|
||||
func (m *EACLRecord) SetFilters(v []*EACLRecord_Filter) {
|
||||
m.Filters = v
|
||||
}
|
||||
|
||||
// SetTargets sets target list of the eACL record.
|
||||
func (m *EACLRecord) SetTargets(v []*EACLRecord_Target) {
|
||||
m.Targets = v
|
||||
}
|
||||
|
||||
// SetHeaderType sets header type of the eACL filter.
|
||||
func (m *EACLRecord_Filter) SetHeaderType(v HeaderType) {
|
||||
m.HeaderType = v
|
||||
}
|
||||
|
||||
// SetMatchType sets match type of the eACL filter.
|
||||
func (m *EACLRecord_Filter) SetMatchType(v MatchType) {
|
||||
m.MatchType = v
|
||||
}
|
||||
|
||||
// SetKey sets key of the eACL filter.
|
||||
func (m *EACLRecord_Filter) SetKey(v string) {
|
||||
m.Key = v
|
||||
}
|
||||
|
||||
// SetValue sets value of the eACL filter.
|
||||
func (m *EACLRecord_Filter) SetValue(v string) {
|
||||
m.Value = v
|
||||
}
|
||||
|
||||
// SetRole sets target group of the eACL target.
|
||||
func (m *EACLRecord_Target) SetRole(v Role) {
|
||||
m.Role = v
|
||||
}
|
||||
|
||||
// SetKeys of the eACL target.
|
||||
func (m *EACLRecord_Target) SetKeys(v [][]byte) {
|
||||
m.Keys = v
|
||||
}
|
||||
|
||||
// SetEaclTable sets eACL table of the bearer token.
|
||||
func (m *BearerToken_Body) SetEaclTable(v *EACLTable) {
|
||||
m.EaclTable = v
|
||||
}
|
||||
|
||||
func (m *BearerToken_Body) SetAPEOverride(v *BearerToken_Body_APEOverride) {
|
||||
m.ApeOverride = v
|
||||
}
|
||||
|
||||
func (m *BearerToken_Body_APEOverride) SetChains(v []*ape.Chain) {
|
||||
m.Chains = v
|
||||
}
|
||||
|
||||
func (m *BearerToken_Body_APEOverride) SetTarget(v *ape.ChainTarget) {
|
||||
m.Target = v
|
||||
}
|
||||
|
||||
// SetOwnerId sets identifier of the bearer token owner.
|
||||
func (m *BearerToken_Body) SetOwnerId(v *refs.OwnerID) {
|
||||
m.OwnerId = v
|
||||
}
|
||||
|
||||
// SetLifetime sets lifetime of the bearer token.
|
||||
func (m *BearerToken_Body) SetLifetime(v *BearerToken_Body_TokenLifetime) {
|
||||
m.Lifetime = v
|
||||
}
|
||||
|
||||
// SetAllowImpersonate allows impersonate.
|
||||
func (m *BearerToken_Body) SetAllowImpersonate(v bool) {
|
||||
m.AllowImpersonate = v
|
||||
}
|
||||
|
||||
// SetBody sets bearer token body.
|
||||
func (m *BearerToken) SetBody(v *BearerToken_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetSignature sets bearer token signature.
|
||||
func (m *BearerToken) SetSignature(v *refs.Signature) {
|
||||
m.Signature = v
|
||||
}
|
||||
|
||||
// SetExp sets epoch number of the token expiration.
|
||||
func (m *BearerToken_Body_TokenLifetime) SetExp(v uint64) {
|
||||
m.Exp = v
|
||||
}
|
||||
|
||||
// SetNbf sets starting epoch number of the token.
|
||||
func (m *BearerToken_Body_TokenLifetime) SetNbf(v uint64) {
|
||||
m.Nbf = v
|
||||
}
|
||||
|
||||
// SetIat sets the number of the epoch in which the token was issued.
|
||||
func (m *BearerToken_Body_TokenLifetime) SetIat(v uint64) {
|
||||
m.Iat = v
|
||||
}
|
||||
|
||||
// FromString parses Action from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *Action) FromString(s string) bool {
|
||||
i, ok := Action_value[s]
|
||||
if ok {
|
||||
*x = Action(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// FromString parses Role from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *Role) FromString(s string) bool {
|
||||
i, ok := Role_value[s]
|
||||
if ok {
|
||||
*x = Role(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// FromString parses Operation from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *Operation) FromString(s string) bool {
|
||||
i, ok := Operation_value[s]
|
||||
if ok {
|
||||
*x = Operation(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// FromString parses MatchType from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *MatchType) FromString(s string) bool {
|
||||
i, ok := MatchType_value[s]
|
||||
if ok {
|
||||
*x = MatchType(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// FromString parses HeaderType from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *HeaderType) FromString(s string) bool {
|
||||
i, ok := HeaderType_value[s]
|
||||
if ok {
|
||||
*x = HeaderType(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
1231
acl/grpc/types.pb.go
generated
1231
acl/grpc/types.pb.go
generated
File diff suppressed because it is too large
Load diff
2184
acl/grpc/types_frostfs.pb.go
generated
Normal file
2184
acl/grpc/types_frostfs.pb.go
generated
Normal file
File diff suppressed because it is too large
Load diff
64
acl/grpc/types_frostfs_fuzz.go
Normal file
64
acl/grpc/types_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,64 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package acl
|
||||
|
||||
func DoFuzzProtoEACLRecord(data []byte) int {
|
||||
msg := new(EACLRecord)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONEACLRecord(data []byte) int {
|
||||
msg := new(EACLRecord)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoEACLTable(data []byte) int {
|
||||
msg := new(EACLTable)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONEACLTable(data []byte) int {
|
||||
msg := new(EACLTable)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoBearerToken(data []byte) int {
|
||||
msg := new(BearerToken)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONBearerToken(data []byte) int {
|
||||
msg := new(BearerToken)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
41
acl/grpc/types_frostfs_test.go
Normal file
41
acl/grpc/types_frostfs_test.go
Normal file
|
@ -0,0 +1,41 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package acl
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoEACLRecord(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoEACLRecord(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONEACLRecord(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONEACLRecord(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoEACLTable(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoEACLTable(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONEACLTable(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONEACLTable(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoBearerToken(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoBearerToken(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONBearerToken(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONBearerToken(data)
|
||||
})
|
||||
}
|
|
@ -330,10 +330,18 @@ func (bt *BearerTokenBody) SetEACL(v *Table) {
|
|||
}
|
||||
|
||||
func (t *APEOverride) GetTarget() *ape.ChainTarget {
|
||||
if t == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return t.target
|
||||
}
|
||||
|
||||
func (t *APEOverride) GetChains() []*ape.Chain {
|
||||
if t == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return t.chains
|
||||
}
|
||||
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
package ape
|
||||
|
||||
func (t *ChainTarget) SetType(typ TargetType) {
|
||||
t.Type = typ
|
||||
}
|
||||
|
||||
func (t *ChainTarget) SetName(name string) {
|
||||
t.Name = name
|
||||
}
|
||||
|
||||
func (c *Chain) SetKind(kind isChain_Kind) {
|
||||
c.Kind = kind
|
||||
}
|
||||
|
||||
func (cr *Chain_Raw) SetRaw(raw []byte) {
|
||||
cr.Raw = raw
|
||||
}
|
||||
|
||||
func (cr *Chain_Raw) GetRaw() []byte {
|
||||
return cr.Raw
|
||||
}
|
310
ape/grpc/types.pb.go
generated
310
ape/grpc/types.pb.go
generated
|
@ -1,310 +0,0 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.2
|
||||
// source: ape/grpc/types.proto
|
||||
|
||||
package ape
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// TargetType is a type target to which a rule chain is defined.
|
||||
type TargetType int32
|
||||
|
||||
const (
|
||||
TargetType_UNDEFINED TargetType = 0
|
||||
TargetType_NAMESPACE TargetType = 1
|
||||
TargetType_CONTAINER TargetType = 2
|
||||
TargetType_USER TargetType = 3
|
||||
TargetType_GROUP TargetType = 4
|
||||
)
|
||||
|
||||
// Enum value maps for TargetType.
|
||||
var (
|
||||
TargetType_name = map[int32]string{
|
||||
0: "UNDEFINED",
|
||||
1: "NAMESPACE",
|
||||
2: "CONTAINER",
|
||||
3: "USER",
|
||||
4: "GROUP",
|
||||
}
|
||||
TargetType_value = map[string]int32{
|
||||
"UNDEFINED": 0,
|
||||
"NAMESPACE": 1,
|
||||
"CONTAINER": 2,
|
||||
"USER": 3,
|
||||
"GROUP": 4,
|
||||
}
|
||||
)
|
||||
|
||||
func (x TargetType) Enum() *TargetType {
|
||||
p := new(TargetType)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x TargetType) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (TargetType) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_ape_grpc_types_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (TargetType) Type() protoreflect.EnumType {
|
||||
return &file_ape_grpc_types_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x TargetType) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TargetType.Descriptor instead.
|
||||
func (TargetType) EnumDescriptor() ([]byte, []int) {
|
||||
return file_ape_grpc_types_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
// ChainTarget is an object to which a rule chain is defined.
|
||||
type ChainTarget struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Type TargetType `protobuf:"varint,1,opt,name=type,proto3,enum=frostfs.v2.ape.TargetType" json:"type,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ChainTarget) Reset() {
|
||||
*x = ChainTarget{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_ape_grpc_types_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ChainTarget) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ChainTarget) ProtoMessage() {}
|
||||
|
||||
func (x *ChainTarget) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_ape_grpc_types_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ChainTarget.ProtoReflect.Descriptor instead.
|
||||
func (*ChainTarget) Descriptor() ([]byte, []int) {
|
||||
return file_ape_grpc_types_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *ChainTarget) GetType() TargetType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return TargetType_UNDEFINED
|
||||
}
|
||||
|
||||
func (x *ChainTarget) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// Chain is a chain of rules defined for a specific target.
|
||||
type Chain struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Types that are assignable to Kind:
|
||||
//
|
||||
// *Chain_Raw
|
||||
Kind isChain_Kind `protobuf_oneof:"kind"`
|
||||
}
|
||||
|
||||
func (x *Chain) Reset() {
|
||||
*x = Chain{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_ape_grpc_types_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Chain) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Chain) ProtoMessage() {}
|
||||
|
||||
func (x *Chain) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_ape_grpc_types_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Chain.ProtoReflect.Descriptor instead.
|
||||
func (*Chain) Descriptor() ([]byte, []int) {
|
||||
return file_ape_grpc_types_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (m *Chain) GetKind() isChain_Kind {
|
||||
if m != nil {
|
||||
return m.Kind
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Chain) GetRaw() []byte {
|
||||
if x, ok := x.GetKind().(*Chain_Raw); ok {
|
||||
return x.Raw
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isChain_Kind interface {
|
||||
isChain_Kind()
|
||||
}
|
||||
|
||||
type Chain_Raw struct {
|
||||
// Raw representation of a serizalized rule chain.
|
||||
Raw []byte `protobuf:"bytes,1,opt,name=raw,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*Chain_Raw) isChain_Kind() {}
|
||||
|
||||
var File_ape_grpc_types_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_ape_grpc_types_proto_rawDesc = []byte{
|
||||
0x0a, 0x14, 0x61, 0x70, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e,
|
||||
0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x22, 0x51, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54,
|
||||
0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32,
|
||||
0x2e, 0x61, 0x70, 0x65, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52,
|
||||
0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x23, 0x0a, 0x05, 0x43, 0x68, 0x61,
|
||||
0x69, 0x6e, 0x12, 0x12, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48,
|
||||
0x00, 0x52, 0x03, 0x72, 0x61, 0x77, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x2a, 0x4e,
|
||||
0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0d, 0x0a, 0x09,
|
||||
0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4e,
|
||||
0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f,
|
||||
0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45,
|
||||
0x52, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x04, 0x42, 0x3e,
|
||||
0x5a, 0x3c, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e,
|
||||
0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f,
|
||||
0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76,
|
||||
0x32, 0x2f, 0x61, 0x70, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x70, 0x65, 0x62, 0x06,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_ape_grpc_types_proto_rawDescOnce sync.Once
|
||||
file_ape_grpc_types_proto_rawDescData = file_ape_grpc_types_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_ape_grpc_types_proto_rawDescGZIP() []byte {
|
||||
file_ape_grpc_types_proto_rawDescOnce.Do(func() {
|
||||
file_ape_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_ape_grpc_types_proto_rawDescData)
|
||||
})
|
||||
return file_ape_grpc_types_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_ape_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_ape_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_ape_grpc_types_proto_goTypes = []interface{}{
|
||||
(TargetType)(0), // 0: frostfs.v2.ape.TargetType
|
||||
(*ChainTarget)(nil), // 1: frostfs.v2.ape.ChainTarget
|
||||
(*Chain)(nil), // 2: frostfs.v2.ape.Chain
|
||||
}
|
||||
var file_ape_grpc_types_proto_depIdxs = []int32{
|
||||
0, // 0: frostfs.v2.ape.ChainTarget.type:type_name -> frostfs.v2.ape.TargetType
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_ape_grpc_types_proto_init() }
|
||||
func file_ape_grpc_types_proto_init() {
|
||||
if File_ape_grpc_types_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_ape_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ChainTarget); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_ape_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Chain); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_ape_grpc_types_proto_msgTypes[1].OneofWrappers = []interface{}{
|
||||
(*Chain_Raw)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_ape_grpc_types_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_ape_grpc_types_proto_goTypes,
|
||||
DependencyIndexes: file_ape_grpc_types_proto_depIdxs,
|
||||
EnumInfos: file_ape_grpc_types_proto_enumTypes,
|
||||
MessageInfos: file_ape_grpc_types_proto_msgTypes,
|
||||
}.Build()
|
||||
File_ape_grpc_types_proto = out.File
|
||||
file_ape_grpc_types_proto_rawDesc = nil
|
||||
file_ape_grpc_types_proto_goTypes = nil
|
||||
file_ape_grpc_types_proto_depIdxs = nil
|
||||
}
|
430
ape/grpc/types_frostfs.pb.go
generated
Normal file
430
ape/grpc/types_frostfs.pb.go
generated
Normal file
|
@ -0,0 +1,430 @@
|
|||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package ape
|
||||
|
||||
import (
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool"
|
||||
proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto"
|
||||
encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding"
|
||||
easyproto "github.com/VictoriaMetrics/easyproto"
|
||||
jlexer "github.com/mailru/easyjson/jlexer"
|
||||
jwriter "github.com/mailru/easyjson/jwriter"
|
||||
strconv "strconv"
|
||||
)
|
||||
|
||||
type TargetType int32
|
||||
|
||||
const (
|
||||
TargetType_UNDEFINED TargetType = 0
|
||||
TargetType_NAMESPACE TargetType = 1
|
||||
TargetType_CONTAINER TargetType = 2
|
||||
TargetType_USER TargetType = 3
|
||||
TargetType_GROUP TargetType = 4
|
||||
)
|
||||
|
||||
var (
|
||||
TargetType_name = map[int32]string{
|
||||
0: "UNDEFINED",
|
||||
1: "NAMESPACE",
|
||||
2: "CONTAINER",
|
||||
3: "USER",
|
||||
4: "GROUP",
|
||||
}
|
||||
TargetType_value = map[string]int32{
|
||||
"UNDEFINED": 0,
|
||||
"NAMESPACE": 1,
|
||||
"CONTAINER": 2,
|
||||
"USER": 3,
|
||||
"GROUP": 4,
|
||||
}
|
||||
)
|
||||
|
||||
func (x TargetType) String() string {
|
||||
if v, ok := TargetType_name[int32(x)]; ok {
|
||||
return v
|
||||
}
|
||||
return strconv.FormatInt(int64(x), 10)
|
||||
}
|
||||
func (x *TargetType) FromString(s string) bool {
|
||||
if v, ok := TargetType_value[s]; ok {
|
||||
*x = TargetType(v)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type ChainTarget struct {
|
||||
Type TargetType `json:"type"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*ChainTarget)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*ChainTarget)(nil)
|
||||
_ json.Marshaler = (*ChainTarget)(nil)
|
||||
_ json.Unmarshaler = (*ChainTarget)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *ChainTarget) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.EnumSize(1, int32(x.Type))
|
||||
size += proto.StringSize(2, x.Name)
|
||||
return size
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *ChainTarget) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *ChainTarget) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if int32(x.Type) != 0 {
|
||||
mm.AppendInt32(1, int32(x.Type))
|
||||
}
|
||||
if len(x.Name) != 0 {
|
||||
mm.AppendString(2, x.Name)
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *ChainTarget) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "ChainTarget")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Type
|
||||
data, ok := fc.Int32()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Type")
|
||||
}
|
||||
x.Type = TargetType(data)
|
||||
case 2: // Name
|
||||
data, ok := fc.String()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Name")
|
||||
}
|
||||
x.Name = data
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *ChainTarget) GetType() TargetType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return 0
|
||||
}
|
||||
func (x *ChainTarget) SetType(v TargetType) {
|
||||
x.Type = v
|
||||
}
|
||||
func (x *ChainTarget) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
func (x *ChainTarget) SetName(v string) {
|
||||
x.Name = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *ChainTarget) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *ChainTarget) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
first := true
|
||||
out.RawByte('{')
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"type\":"
|
||||
out.RawString(prefix)
|
||||
v := int32(x.Type)
|
||||
if vv, ok := TargetType_name[v]; ok {
|
||||
out.String(vv)
|
||||
} else {
|
||||
out.Int32(v)
|
||||
}
|
||||
}
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"name\":"
|
||||
out.RawString(prefix)
|
||||
out.String(x.Name)
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *ChainTarget) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *ChainTarget) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "type":
|
||||
{
|
||||
var f TargetType
|
||||
var parsedValue TargetType
|
||||
switch v := in.Interface().(type) {
|
||||
case string:
|
||||
if vv, ok := TargetType_value[v]; ok {
|
||||
parsedValue = TargetType(vv)
|
||||
break
|
||||
}
|
||||
vv, err := strconv.ParseInt(v, 10, 32)
|
||||
if err != nil {
|
||||
in.AddError(err)
|
||||
return
|
||||
}
|
||||
parsedValue = TargetType(vv)
|
||||
case float64:
|
||||
parsedValue = TargetType(v)
|
||||
}
|
||||
f = parsedValue
|
||||
x.Type = f
|
||||
}
|
||||
case "name":
|
||||
{
|
||||
var f string
|
||||
f = in.String()
|
||||
x.Name = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
||||
|
||||
type Chain struct {
|
||||
Kind isChain_Kind
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*Chain)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*Chain)(nil)
|
||||
_ json.Marshaler = (*Chain)(nil)
|
||||
_ json.Unmarshaler = (*Chain)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *Chain) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
if inner, ok := x.Kind.(*Chain_Raw); ok {
|
||||
size += proto.BytesSize(1, inner.Raw)
|
||||
}
|
||||
return size
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *Chain) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *Chain) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if inner, ok := x.Kind.(*Chain_Raw); ok {
|
||||
if len(inner.Raw) != 0 {
|
||||
mm.AppendBytes(1, inner.Raw)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *Chain) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "Chain")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Raw
|
||||
data, ok := fc.Bytes()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Raw")
|
||||
}
|
||||
x.Kind = &Chain_Raw{Raw: data}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Chain) GetKind() isChain_Kind {
|
||||
if x != nil {
|
||||
return x.Kind
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Chain) SetKind(v isChain_Kind) {
|
||||
x.Kind = v
|
||||
}
|
||||
func (x *Chain) GetRaw() []byte {
|
||||
if xx, ok := x.GetKind().(*Chain_Raw); ok {
|
||||
return xx.Raw
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Chain) SetRaw(v *Chain_Raw) {
|
||||
x.Kind = v
|
||||
}
|
||||
func (x *Chain_Raw) GetRaw() []byte {
|
||||
if x != nil {
|
||||
return x.Raw
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Chain_Raw) SetRaw(v []byte) {
|
||||
x.Raw = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *Chain) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *Chain) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
first := true
|
||||
out.RawByte('{')
|
||||
switch xx := x.Kind.(type) {
|
||||
case *Chain_Raw:
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"raw\":"
|
||||
out.RawString(prefix)
|
||||
if xx.Raw != nil {
|
||||
out.Base64Bytes(xx.Raw)
|
||||
} else {
|
||||
out.String("")
|
||||
}
|
||||
}
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *Chain) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *Chain) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "raw":
|
||||
xx := new(Chain_Raw)
|
||||
x.Kind = xx
|
||||
{
|
||||
var f []byte
|
||||
{
|
||||
tmp := in.Bytes()
|
||||
if len(tmp) == 0 {
|
||||
tmp = nil
|
||||
}
|
||||
f = tmp
|
||||
}
|
||||
xx.Raw = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
||||
|
||||
type isChain_Kind interface {
|
||||
isChain_Kind()
|
||||
}
|
||||
|
||||
type Chain_Raw struct {
|
||||
Raw []byte
|
||||
}
|
||||
|
||||
func (*Chain_Raw) isChain_Kind() {}
|
45
ape/grpc/types_frostfs_fuzz.go
Normal file
45
ape/grpc/types_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,45 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package ape
|
||||
|
||||
func DoFuzzProtoChainTarget(data []byte) int {
|
||||
msg := new(ChainTarget)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONChainTarget(data []byte) int {
|
||||
msg := new(ChainTarget)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoChain(data []byte) int {
|
||||
msg := new(Chain)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONChain(data []byte) int {
|
||||
msg := new(Chain)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
31
ape/grpc/types_frostfs_test.go
Normal file
31
ape/grpc/types_frostfs_test.go
Normal file
|
@ -0,0 +1,31 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package ape
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoChainTarget(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoChainTarget(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONChainTarget(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONChainTarget(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoChain(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoChain(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONChain(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONChain(data)
|
||||
})
|
||||
}
|
|
@ -53,6 +53,10 @@ func (c *Chain) SetKind(kind chainKind) {
|
|||
}
|
||||
|
||||
func (c *Chain) GetKind() chainKind {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return c.kind
|
||||
}
|
||||
|
||||
|
@ -67,5 +71,9 @@ func (c *ChainRaw) SetRaw(raw []byte) {
|
|||
}
|
||||
|
||||
func (c *ChainRaw) GetRaw() []byte {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return c.Raw
|
||||
}
|
||||
|
|
|
@ -296,9 +296,9 @@ func (respBody *ListChainsResponseBody) ToGRPCMessage() grpc.Message {
|
|||
if respBody != nil {
|
||||
respBodygrpc = new(apemanager.ListChainsResponse_Body)
|
||||
|
||||
chainsgrpc := make([]*apeGRPC.Chain, 0, len(respBody.GetChains()))
|
||||
chainsgrpc := make([]apeGRPC.Chain, 0, len(respBody.GetChains()))
|
||||
for _, chain := range respBody.GetChains() {
|
||||
chainsgrpc = append(chainsgrpc, chain.ToGRPCMessage().(*apeGRPC.Chain))
|
||||
chainsgrpc = append(chainsgrpc, *chain.ToGRPCMessage().(*apeGRPC.Chain))
|
||||
}
|
||||
|
||||
respBodygrpc.SetChains(chainsgrpc)
|
||||
|
@ -317,7 +317,7 @@ func (respBody *ListChainsResponseBody) FromGRPCMessage(m grpc.Message) error {
|
|||
|
||||
for _, chaingrpc := range respBodygrpc.GetChains() {
|
||||
chain := new(ape.Chain)
|
||||
if err := chain.FromGRPCMessage(chaingrpc); err != nil {
|
||||
if err := chain.FromGRPCMessage(&chaingrpc); err != nil {
|
||||
return err
|
||||
}
|
||||
chains = append(chains, chain)
|
||||
|
|
|
@ -1,106 +0,0 @@
|
|||
package apemanager
|
||||
|
||||
import (
|
||||
ape "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/grpc"
|
||||
session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc"
|
||||
)
|
||||
|
||||
func (rb *AddChainRequest_Body) SetTarget(t *ape.ChainTarget) {
|
||||
rb.Target = t
|
||||
}
|
||||
|
||||
func (rb *AddChainRequest_Body) SetChain(chain *ape.Chain) {
|
||||
rb.Chain = chain
|
||||
}
|
||||
|
||||
func (r *AddChainRequest) SetBody(rb *AddChainRequest_Body) {
|
||||
r.Body = rb
|
||||
}
|
||||
|
||||
func (r *AddChainRequest) SetMetaHeader(mh *session.RequestMetaHeader) {
|
||||
r.MetaHeader = mh
|
||||
}
|
||||
|
||||
func (r *AddChainRequest) SetVerifyHeader(vh *session.RequestVerificationHeader) {
|
||||
r.VerifyHeader = vh
|
||||
}
|
||||
|
||||
func (rb *AddChainResponse_Body) SetChainId(chainID []byte) {
|
||||
rb.ChainId = chainID
|
||||
}
|
||||
|
||||
func (r *AddChainResponse) SetBody(rb *AddChainResponse_Body) {
|
||||
r.Body = rb
|
||||
}
|
||||
|
||||
func (r *AddChainResponse) SetMetaHeader(mh *session.ResponseMetaHeader) {
|
||||
r.MetaHeader = mh
|
||||
}
|
||||
|
||||
func (r *AddChainResponse) SetVerifyHeader(vh *session.ResponseVerificationHeader) {
|
||||
r.VerifyHeader = vh
|
||||
}
|
||||
|
||||
func (rb *RemoveChainRequest_Body) SetTarget(t *ape.ChainTarget) {
|
||||
rb.Target = t
|
||||
}
|
||||
|
||||
func (rb *RemoveChainRequest_Body) SetChainId(chainID []byte) {
|
||||
rb.ChainId = chainID
|
||||
}
|
||||
|
||||
func (r *RemoveChainRequest) SetBody(rb *RemoveChainRequest_Body) {
|
||||
r.Body = rb
|
||||
}
|
||||
|
||||
func (r *RemoveChainRequest) SetMetaHeader(mh *session.RequestMetaHeader) {
|
||||
r.MetaHeader = mh
|
||||
}
|
||||
|
||||
func (r *RemoveChainRequest) SetVerifyHeader(vh *session.RequestVerificationHeader) {
|
||||
r.VerifyHeader = vh
|
||||
}
|
||||
|
||||
func (r *RemoveChainResponse) SetBody(rb *RemoveChainResponse_Body) {
|
||||
r.Body = rb
|
||||
}
|
||||
|
||||
func (r *RemoveChainResponse) SetMetaHeader(mh *session.ResponseMetaHeader) {
|
||||
r.MetaHeader = mh
|
||||
}
|
||||
|
||||
func (r *RemoveChainResponse) SetVerifyHeader(vh *session.ResponseVerificationHeader) {
|
||||
r.VerifyHeader = vh
|
||||
}
|
||||
|
||||
func (r *ListChainsRequest_Body) SetTarget(t *ape.ChainTarget) {
|
||||
r.Target = t
|
||||
}
|
||||
|
||||
func (r *ListChainsRequest) SetBody(rb *ListChainsRequest_Body) {
|
||||
r.Body = rb
|
||||
}
|
||||
|
||||
func (r *ListChainsRequest) SetMetaHeader(mh *session.RequestMetaHeader) {
|
||||
r.MetaHeader = mh
|
||||
}
|
||||
|
||||
func (r *ListChainsRequest) SetVerifyHeader(vh *session.RequestVerificationHeader) {
|
||||
r.VerifyHeader = vh
|
||||
}
|
||||
|
||||
func (rb *ListChainsResponse_Body) SetChains(chains []*ape.Chain) {
|
||||
rb.Chains = chains
|
||||
}
|
||||
|
||||
func (r *ListChainsResponse) SetBody(rb *ListChainsResponse_Body) {
|
||||
r.Body = rb
|
||||
}
|
||||
|
||||
func (r *ListChainsResponse) SetMetaHeader(mh *session.ResponseMetaHeader) {
|
||||
r.MetaHeader = mh
|
||||
}
|
||||
|
||||
func (r *ListChainsResponse) SetVerifyHeader(vh *session.ResponseVerificationHeader) {
|
||||
r.VerifyHeader = vh
|
||||
}
|
1129
apemanager/grpc/service.pb.go
generated
1129
apemanager/grpc/service.pb.go
generated
File diff suppressed because it is too large
Load diff
2337
apemanager/grpc/service_frostfs.pb.go
generated
Normal file
2337
apemanager/grpc/service_frostfs.pb.go
generated
Normal file
File diff suppressed because it is too large
Load diff
121
apemanager/grpc/service_frostfs_fuzz.go
Normal file
121
apemanager/grpc/service_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,121 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package apemanager
|
||||
|
||||
func DoFuzzProtoAddChainRequest(data []byte) int {
|
||||
msg := new(AddChainRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONAddChainRequest(data []byte) int {
|
||||
msg := new(AddChainRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoAddChainResponse(data []byte) int {
|
||||
msg := new(AddChainResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONAddChainResponse(data []byte) int {
|
||||
msg := new(AddChainResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoRemoveChainRequest(data []byte) int {
|
||||
msg := new(RemoveChainRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONRemoveChainRequest(data []byte) int {
|
||||
msg := new(RemoveChainRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoRemoveChainResponse(data []byte) int {
|
||||
msg := new(RemoveChainResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONRemoveChainResponse(data []byte) int {
|
||||
msg := new(RemoveChainResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoListChainsRequest(data []byte) int {
|
||||
msg := new(ListChainsRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONListChainsRequest(data []byte) int {
|
||||
msg := new(ListChainsRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoListChainsResponse(data []byte) int {
|
||||
msg := new(ListChainsResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONListChainsResponse(data []byte) int {
|
||||
msg := new(ListChainsResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
71
apemanager/grpc/service_frostfs_test.go
Normal file
71
apemanager/grpc/service_frostfs_test.go
Normal file
|
@ -0,0 +1,71 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package apemanager
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoAddChainRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoAddChainRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONAddChainRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONAddChainRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoAddChainResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoAddChainResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONAddChainResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONAddChainResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoRemoveChainRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoRemoveChainRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONRemoveChainRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONRemoveChainRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoRemoveChainResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoRemoveChainResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONRemoveChainResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONRemoveChainResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoListChainsRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoListChainsRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONListChainsRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONListChainsRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoListChainsResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoListChainsResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONListChainsResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONListChainsResponse(data)
|
||||
})
|
||||
}
|
|
@ -16,6 +16,10 @@ func (r *AddChainRequest) SetBody(body *AddChainRequestBody) {
|
|||
}
|
||||
|
||||
func (r *AddChainRequest) GetBody() *AddChainRequestBody {
|
||||
if r == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return r.body
|
||||
}
|
||||
|
||||
|
@ -30,6 +34,10 @@ func (rb *AddChainRequestBody) SetTarget(target *ape.ChainTarget) {
|
|||
}
|
||||
|
||||
func (rb *AddChainRequestBody) GetTarget() *ape.ChainTarget {
|
||||
if rb == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return rb.target
|
||||
}
|
||||
|
||||
|
@ -38,6 +46,10 @@ func (rb *AddChainRequestBody) SetChain(chain *ape.Chain) {
|
|||
}
|
||||
|
||||
func (rb *AddChainRequestBody) GetChain() *ape.Chain {
|
||||
if rb == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return rb.chain
|
||||
}
|
||||
|
||||
|
@ -52,6 +64,10 @@ func (r *AddChainResponse) SetBody(body *AddChainResponseBody) {
|
|||
}
|
||||
|
||||
func (r *AddChainResponse) GetBody() *AddChainResponseBody {
|
||||
if r == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return r.body
|
||||
}
|
||||
|
||||
|
@ -64,6 +80,10 @@ func (rb *AddChainResponseBody) SetChainID(chainID []byte) {
|
|||
}
|
||||
|
||||
func (rb *AddChainResponseBody) GetChainID() []byte {
|
||||
if rb == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return rb.chainID
|
||||
}
|
||||
|
||||
|
@ -78,6 +98,10 @@ func (r *RemoveChainRequest) SetBody(body *RemoveChainRequestBody) {
|
|||
}
|
||||
|
||||
func (r *RemoveChainRequest) GetBody() *RemoveChainRequestBody {
|
||||
if r == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return r.body
|
||||
}
|
||||
|
||||
|
@ -92,6 +116,10 @@ func (rb *RemoveChainRequestBody) SetTarget(target *ape.ChainTarget) {
|
|||
}
|
||||
|
||||
func (rb *RemoveChainRequestBody) GetTarget() *ape.ChainTarget {
|
||||
if rb == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return rb.target
|
||||
}
|
||||
|
||||
|
@ -100,6 +128,10 @@ func (rb *RemoveChainRequestBody) SetChainID(chainID []byte) {
|
|||
}
|
||||
|
||||
func (rb *RemoveChainRequestBody) GetChainID() []byte {
|
||||
if rb == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return rb.chainID
|
||||
}
|
||||
|
||||
|
@ -116,6 +148,10 @@ func (r *RemoveChainResponse) SetBody(body *RemoveChainResponseBody) {
|
|||
}
|
||||
|
||||
func (r *RemoveChainResponse) GetBody() *RemoveChainResponseBody {
|
||||
if r == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return r.body
|
||||
}
|
||||
|
||||
|
@ -130,6 +166,10 @@ func (r *ListChainsRequest) SetBody(body *ListChainsRequestBody) {
|
|||
}
|
||||
|
||||
func (r *ListChainsRequest) GetBody() *ListChainsRequestBody {
|
||||
if r == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return r.body
|
||||
}
|
||||
|
||||
|
@ -142,6 +182,10 @@ func (rb *ListChainsRequestBody) SetTarget(target *ape.ChainTarget) {
|
|||
}
|
||||
|
||||
func (rb *ListChainsRequestBody) GetTarget() *ape.ChainTarget {
|
||||
if rb == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return rb.target
|
||||
}
|
||||
|
||||
|
@ -156,6 +200,10 @@ func (r *ListChainsResponse) SetBody(body *ListChainsResponseBody) {
|
|||
}
|
||||
|
||||
func (r *ListChainsResponse) GetBody() *ListChainsResponseBody {
|
||||
if r == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return r.body
|
||||
}
|
||||
|
||||
|
@ -170,5 +218,9 @@ func (r *ListChainsResponseBody) SetChains(chains []*ape.Chain) {
|
|||
}
|
||||
|
||||
func (r *ListChainsResponseBody) GetChains() []*ape.Chain {
|
||||
if r == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return r.chains
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package container
|
||||
|
||||
import (
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl"
|
||||
aclGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc"
|
||||
container "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap"
|
||||
netmapGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc"
|
||||
|
@ -39,31 +37,29 @@ func (a *Attribute) FromGRPCMessage(m grpc.Message) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func AttributesToGRPC(xs []Attribute) (res []*container.Container_Attribute) {
|
||||
func AttributesToGRPC(xs []Attribute) (res []container.Container_Attribute) {
|
||||
if xs != nil {
|
||||
res = make([]*container.Container_Attribute, 0, len(xs))
|
||||
res = make([]container.Container_Attribute, 0, len(xs))
|
||||
|
||||
for i := range xs {
|
||||
res = append(res, xs[i].ToGRPCMessage().(*container.Container_Attribute))
|
||||
res = append(res, *xs[i].ToGRPCMessage().(*container.Container_Attribute))
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func AttributesFromGRPC(xs []*container.Container_Attribute) (res []Attribute, err error) {
|
||||
func AttributesFromGRPC(xs []container.Container_Attribute) (res []Attribute, err error) {
|
||||
if xs != nil {
|
||||
res = make([]Attribute, len(xs))
|
||||
|
||||
for i := range xs {
|
||||
if xs[i] != nil {
|
||||
err = res[i].FromGRPCMessage(xs[i])
|
||||
err = res[i].FromGRPCMessage(&xs[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -766,175 +762,3 @@ func (r *ListResponse) FromGRPCMessage(m grpc.Message) error {
|
|||
|
||||
return r.ResponseHeaders.FromMessage(v)
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLRequestBody) ToGRPCMessage() grpc.Message {
|
||||
var m *container.GetExtendedACLRequest_Body
|
||||
|
||||
if r != nil {
|
||||
m = new(container.GetExtendedACLRequest_Body)
|
||||
|
||||
m.SetContainerId(r.cid.ToGRPCMessage().(*refsGRPC.ContainerID))
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLRequestBody) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*container.GetExtendedACLRequest_Body)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
cid := v.GetContainerId()
|
||||
if cid == nil {
|
||||
r.cid = nil
|
||||
} else {
|
||||
if r.cid == nil {
|
||||
r.cid = new(refs.ContainerID)
|
||||
}
|
||||
|
||||
err = r.cid.FromGRPCMessage(cid)
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLRequest) ToGRPCMessage() grpc.Message {
|
||||
var m *container.GetExtendedACLRequest
|
||||
|
||||
if r != nil {
|
||||
m = new(container.GetExtendedACLRequest)
|
||||
|
||||
m.SetBody(r.body.ToGRPCMessage().(*container.GetExtendedACLRequest_Body))
|
||||
r.RequestHeaders.ToMessage(m)
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLRequest) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*container.GetExtendedACLRequest)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
body := v.GetBody()
|
||||
if body == nil {
|
||||
r.body = nil
|
||||
} else {
|
||||
if r.body == nil {
|
||||
r.body = new(GetExtendedACLRequestBody)
|
||||
}
|
||||
|
||||
err = r.body.FromGRPCMessage(body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return r.RequestHeaders.FromMessage(v)
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLResponseBody) ToGRPCMessage() grpc.Message {
|
||||
var m *container.GetExtendedACLResponse_Body
|
||||
|
||||
if r != nil {
|
||||
m = new(container.GetExtendedACLResponse_Body)
|
||||
|
||||
m.SetEacl(r.eacl.ToGRPCMessage().(*aclGRPC.EACLTable))
|
||||
m.SetSignature(toSignatureRFC6979(r.sig))
|
||||
m.SetSessionToken(r.token.ToGRPCMessage().(*sessionGRPC.SessionToken))
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLResponseBody) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*container.GetExtendedACLResponse_Body)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
eacl := v.GetEacl()
|
||||
if eacl == nil {
|
||||
r.eacl = nil
|
||||
} else {
|
||||
if r.eacl == nil {
|
||||
r.eacl = new(acl.Table)
|
||||
}
|
||||
|
||||
err = r.eacl.FromGRPCMessage(eacl)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
sig := v.GetSignature()
|
||||
if sig == nil {
|
||||
r.sig = nil
|
||||
} else {
|
||||
if r.sig == nil {
|
||||
r.sig = new(refs.Signature)
|
||||
}
|
||||
|
||||
r.sig.SetKey(sig.GetKey())
|
||||
r.sig.SetSign(sig.GetSign())
|
||||
}
|
||||
|
||||
token := v.GetSessionToken()
|
||||
if token == nil {
|
||||
r.token = nil
|
||||
} else {
|
||||
if r.token == nil {
|
||||
r.token = new(session.Token)
|
||||
}
|
||||
|
||||
err = r.token.FromGRPCMessage(token)
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLResponse) ToGRPCMessage() grpc.Message {
|
||||
var m *container.GetExtendedACLResponse
|
||||
|
||||
if r != nil {
|
||||
m = new(container.GetExtendedACLResponse)
|
||||
|
||||
m.SetBody(r.body.ToGRPCMessage().(*container.GetExtendedACLResponse_Body))
|
||||
r.ResponseHeaders.ToMessage(m)
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLResponse) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*container.GetExtendedACLResponse)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
body := v.GetBody()
|
||||
if body == nil {
|
||||
r.body = nil
|
||||
} else {
|
||||
if r.body == nil {
|
||||
r.body = new(GetExtendedACLResponseBody)
|
||||
}
|
||||
|
||||
err = r.body.FromGRPCMessage(body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return r.ResponseHeaders.FromMessage(v)
|
||||
}
|
||||
|
|
|
@ -1,234 +0,0 @@
|
|||
package container
|
||||
|
||||
import (
|
||||
acl "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc"
|
||||
refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc"
|
||||
)
|
||||
|
||||
// SetContainer sets container of the request.
|
||||
func (m *PutRequest_Body) SetContainer(v *Container) {
|
||||
m.Container = v
|
||||
}
|
||||
|
||||
// SetSignature sets signature of the container structure.
|
||||
func (m *PutRequest_Body) SetSignature(v *refs.SignatureRFC6979) {
|
||||
m.Signature = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *PutRequest) SetBody(v *PutRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *PutRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *PutRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetContainerId sets identifier of the container.
|
||||
func (m *PutResponse_Body) SetContainerId(v *refs.ContainerID) {
|
||||
m.ContainerId = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *PutResponse) SetBody(v *PutResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *PutResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *PutResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetContainerId sets identifier of the container.
|
||||
func (m *DeleteRequest_Body) SetContainerId(v *refs.ContainerID) {
|
||||
m.ContainerId = v
|
||||
}
|
||||
|
||||
// SetSignature sets signature of the container identifier.
|
||||
func (m *DeleteRequest_Body) SetSignature(v *refs.SignatureRFC6979) {
|
||||
m.Signature = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *DeleteRequest) SetBody(v *DeleteRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *DeleteRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *DeleteRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *DeleteResponse) SetBody(v *DeleteResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *DeleteResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *DeleteResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetContainerId sets identifier of the container.
|
||||
func (m *GetRequest_Body) SetContainerId(v *refs.ContainerID) {
|
||||
m.ContainerId = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *GetRequest) SetBody(v *GetRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *GetRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *GetRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetContainer sets the container structure.
|
||||
func (m *GetResponse_Body) SetContainer(v *Container) {
|
||||
m.Container = v
|
||||
}
|
||||
|
||||
// SetSessionToken sets token of the session within which requested
|
||||
// container was created.
|
||||
func (m *GetResponse_Body) SetSessionToken(v *session.SessionToken) {
|
||||
m.SessionToken = v
|
||||
}
|
||||
|
||||
// SetSignature sets signature of the container structure.
|
||||
func (m *GetResponse_Body) SetSignature(v *refs.SignatureRFC6979) {
|
||||
m.Signature = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *GetResponse) SetBody(v *GetResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *GetResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *GetResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetOwnerId sets identifier of the container owner.
|
||||
func (m *ListRequest_Body) SetOwnerId(v *refs.OwnerID) {
|
||||
m.OwnerId = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *ListRequest) SetBody(v *ListRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *ListRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *ListRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetContainerIds sets list of the container identifiers.
|
||||
func (m *ListResponse_Body) SetContainerIds(v []*refs.ContainerID) {
|
||||
m.ContainerIds = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *ListResponse) SetBody(v *ListResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *ListResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *ListResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetContainerId sets identifier of the container.
|
||||
func (m *GetExtendedACLRequest_Body) SetContainerId(v *refs.ContainerID) {
|
||||
m.ContainerId = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *GetExtendedACLRequest) SetBody(v *GetExtendedACLRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *GetExtendedACLRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *GetExtendedACLRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetEacl sets eACL table structure.
|
||||
func (m *GetExtendedACLResponse_Body) SetEacl(v *acl.EACLTable) {
|
||||
m.Eacl = v
|
||||
}
|
||||
|
||||
// SetSignature sets signature of the eACL table structure.
|
||||
func (m *GetExtendedACLResponse_Body) SetSignature(v *refs.SignatureRFC6979) {
|
||||
m.Signature = v
|
||||
}
|
||||
|
||||
// SetSessionToken sets token of the session within which requested
|
||||
// eACl table was set.
|
||||
func (m *GetExtendedACLResponse_Body) SetSessionToken(v *session.SessionToken) {
|
||||
m.SessionToken = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *GetExtendedACLResponse) SetBody(v *GetExtendedACLResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *GetExtendedACLResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *GetExtendedACLResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
1909
container/grpc/service.pb.go
generated
1909
container/grpc/service.pb.go
generated
File diff suppressed because it is too large
Load diff
3157
container/grpc/service_frostfs.pb.go
generated
Normal file
3157
container/grpc/service_frostfs.pb.go
generated
Normal file
File diff suppressed because it is too large
Load diff
159
container/grpc/service_frostfs_fuzz.go
Normal file
159
container/grpc/service_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,159 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package container
|
||||
|
||||
func DoFuzzProtoPutRequest(data []byte) int {
|
||||
msg := new(PutRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONPutRequest(data []byte) int {
|
||||
msg := new(PutRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoPutResponse(data []byte) int {
|
||||
msg := new(PutResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONPutResponse(data []byte) int {
|
||||
msg := new(PutResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoDeleteRequest(data []byte) int {
|
||||
msg := new(DeleteRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONDeleteRequest(data []byte) int {
|
||||
msg := new(DeleteRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoDeleteResponse(data []byte) int {
|
||||
msg := new(DeleteResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONDeleteResponse(data []byte) int {
|
||||
msg := new(DeleteResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoGetRequest(data []byte) int {
|
||||
msg := new(GetRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONGetRequest(data []byte) int {
|
||||
msg := new(GetRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoGetResponse(data []byte) int {
|
||||
msg := new(GetResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONGetResponse(data []byte) int {
|
||||
msg := new(GetResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoListRequest(data []byte) int {
|
||||
msg := new(ListRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONListRequest(data []byte) int {
|
||||
msg := new(ListRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoListResponse(data []byte) int {
|
||||
msg := new(ListResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONListResponse(data []byte) int {
|
||||
msg := new(ListResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
91
container/grpc/service_frostfs_test.go
Normal file
91
container/grpc/service_frostfs_test.go
Normal file
|
@ -0,0 +1,91 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package container
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoPutRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoPutRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONPutRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONPutRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoPutResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoPutResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONPutResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONPutResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoDeleteRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoDeleteRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONDeleteRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONDeleteRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoDeleteResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoDeleteResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONDeleteResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONDeleteResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoGetRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoGetRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONGetRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONGetRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoGetResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoGetResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONGetResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONGetResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoListRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoListRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONListRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONListRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoListResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoListResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONListResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONListResponse(data)
|
||||
})
|
||||
}
|
63
container/grpc/service_grpc.pb.go
generated
63
container/grpc/service_grpc.pb.go
generated
|
@ -23,7 +23,6 @@ const (
|
|||
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.
|
||||
|
@ -74,20 +73,6 @@ type ContainerServiceClient interface {
|
|||
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
||||
// container list access denied.
|
||||
List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
|
||||
// Returns Extended ACL table and signature from `Container` smart contract
|
||||
// storage.
|
||||
//
|
||||
// Statuses:
|
||||
// - **OK** (0, SECTION_SUCCESS): \
|
||||
// container eACL has been successfully read;
|
||||
// - Common failures (SECTION_FAILURE_COMMON);
|
||||
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
||||
// container not found;
|
||||
// - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \
|
||||
// eACL table not found;
|
||||
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
||||
// access to container eACL is denied.
|
||||
GetExtendedACL(ctx context.Context, in *GetExtendedACLRequest, opts ...grpc.CallOption) (*GetExtendedACLResponse, error)
|
||||
}
|
||||
|
||||
type containerServiceClient struct {
|
||||
|
@ -134,15 +119,6 @@ func (c *containerServiceClient) List(ctx context.Context, in *ListRequest, opts
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *containerServiceClient) GetExtendedACL(ctx context.Context, in *GetExtendedACLRequest, opts ...grpc.CallOption) (*GetExtendedACLResponse, error) {
|
||||
out := new(GetExtendedACLResponse)
|
||||
err := c.cc.Invoke(ctx, ContainerService_GetExtendedACL_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ContainerServiceServer is the server API for ContainerService service.
|
||||
// All implementations should embed UnimplementedContainerServiceServer
|
||||
// for forward compatibility
|
||||
|
@ -191,20 +167,6 @@ type ContainerServiceServer interface {
|
|||
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
||||
// container list access denied.
|
||||
List(context.Context, *ListRequest) (*ListResponse, error)
|
||||
// Returns Extended ACL table and signature from `Container` smart contract
|
||||
// storage.
|
||||
//
|
||||
// Statuses:
|
||||
// - **OK** (0, SECTION_SUCCESS): \
|
||||
// container eACL has been successfully read;
|
||||
// - Common failures (SECTION_FAILURE_COMMON);
|
||||
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
||||
// container not found;
|
||||
// - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \
|
||||
// eACL table not found;
|
||||
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
||||
// access to container eACL is denied.
|
||||
GetExtendedACL(context.Context, *GetExtendedACLRequest) (*GetExtendedACLResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedContainerServiceServer should be embedded to have forward compatible implementations.
|
||||
|
@ -223,9 +185,6 @@ func (UnimplementedContainerServiceServer) Get(context.Context, *GetRequest) (*G
|
|||
func (UnimplementedContainerServiceServer) List(context.Context, *ListRequest) (*ListResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
||||
}
|
||||
func (UnimplementedContainerServiceServer) GetExtendedACL(context.Context, *GetExtendedACLRequest) (*GetExtendedACLResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetExtendedACL not implemented")
|
||||
}
|
||||
|
||||
// UnsafeContainerServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ContainerServiceServer will
|
||||
|
@ -310,24 +269,6 @@ func _ContainerService_List_Handler(srv interface{}, ctx context.Context, dec fu
|
|||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ContainerService_GetExtendedACL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetExtendedACLRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ContainerServiceServer).GetExtendedACL(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ContainerService_GetExtendedACL_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ContainerServiceServer).GetExtendedACL(ctx, req.(*GetExtendedACLRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ContainerService_ServiceDesc is the grpc.ServiceDesc for ContainerService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
|
@ -351,10 +292,6 @@ var ContainerService_ServiceDesc = grpc.ServiceDesc{
|
|||
MethodName: "List",
|
||||
Handler: _ContainerService_List_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetExtendedACL",
|
||||
Handler: _ContainerService_GetExtendedACL_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "container/grpc/service.proto",
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
package container
|
||||
|
||||
import (
|
||||
netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc"
|
||||
refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
)
|
||||
|
||||
// SetKey sets key to the container attribute.
|
||||
func (m *Container_Attribute) SetKey(v string) {
|
||||
m.Key = v
|
||||
}
|
||||
|
||||
// SetValue sets value of the container attribute.
|
||||
func (m *Container_Attribute) SetValue(v string) {
|
||||
m.Value = v
|
||||
}
|
||||
|
||||
// SetOwnerId sets identifier of the container owner,
|
||||
func (m *Container) SetOwnerId(v *refs.OwnerID) {
|
||||
m.OwnerId = v
|
||||
}
|
||||
|
||||
// SetNonce sets nonce of the container structure.
|
||||
func (m *Container) SetNonce(v []byte) {
|
||||
m.Nonce = v
|
||||
}
|
||||
|
||||
// SetBasicAcl sets basic ACL of the container.
|
||||
func (m *Container) SetBasicAcl(v uint32) {
|
||||
m.BasicAcl = v
|
||||
}
|
||||
|
||||
// SetAttributes sets list of the container attributes.
|
||||
func (m *Container) SetAttributes(v []*Container_Attribute) {
|
||||
m.Attributes = v
|
||||
}
|
||||
|
||||
// SetPlacementPolicy sets placement policy of the container.
|
||||
func (m *Container) SetPlacementPolicy(v *netmap.PlacementPolicy) {
|
||||
m.PlacementPolicy = v
|
||||
}
|
||||
|
||||
// SetVersion sets version of the container.
|
||||
func (m *Container) SetVersion(v *refs.Version) {
|
||||
m.Version = v
|
||||
}
|
337
container/grpc/types.pb.go
generated
337
container/grpc/types.pb.go
generated
|
@ -1,337 +0,0 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.2
|
||||
// source: container/grpc/types.proto
|
||||
|
||||
package container
|
||||
|
||||
import (
|
||||
grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc"
|
||||
grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// Container is a structure that defines object placement behaviour. Objects can
|
||||
// be stored only within containers. They define placement rule, attributes and
|
||||
// access control information. An ID of a container is a 32 byte long SHA256
|
||||
// hash of stable-marshalled container message.
|
||||
type Container struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Container format version. Effectively, the version of API library used to
|
||||
// create the container.
|
||||
Version *grpc.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
|
||||
// Identifier of the container owner
|
||||
OwnerId *grpc.OwnerID `protobuf:"bytes,2,opt,name=owner_id,json=ownerID,proto3" json:"owner_id,omitempty"`
|
||||
// Nonce is a 16 byte UUIDv4, used to avoid collisions of `ContainerID`s
|
||||
Nonce []byte `protobuf:"bytes,3,opt,name=nonce,proto3" json:"nonce,omitempty"`
|
||||
// `BasicACL` contains access control rules for the owner, system and others
|
||||
// groups, as well as permission bits for `BearerToken` and `Extended ACL`
|
||||
BasicAcl uint32 `protobuf:"varint,4,opt,name=basic_acl,json=basicACL,proto3" json:"basic_acl,omitempty"`
|
||||
// Attributes represent immutable container's meta data
|
||||
Attributes []*Container_Attribute `protobuf:"bytes,5,rep,name=attributes,proto3" json:"attributes,omitempty"`
|
||||
// Placement policy for the object inside the container
|
||||
PlacementPolicy *grpc1.PlacementPolicy `protobuf:"bytes,6,opt,name=placement_policy,json=placementPolicy,proto3" json:"placement_policy,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Container) Reset() {
|
||||
*x = Container{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_container_grpc_types_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Container) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Container) ProtoMessage() {}
|
||||
|
||||
func (x *Container) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_container_grpc_types_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Container.ProtoReflect.Descriptor instead.
|
||||
func (*Container) Descriptor() ([]byte, []int) {
|
||||
return file_container_grpc_types_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Container) GetVersion() *grpc.Version {
|
||||
if x != nil {
|
||||
return x.Version
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Container) GetOwnerId() *grpc.OwnerID {
|
||||
if x != nil {
|
||||
return x.OwnerId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Container) GetNonce() []byte {
|
||||
if x != nil {
|
||||
return x.Nonce
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Container) GetBasicAcl() uint32 {
|
||||
if x != nil {
|
||||
return x.BasicAcl
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Container) GetAttributes() []*Container_Attribute {
|
||||
if x != nil {
|
||||
return x.Attributes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Container) GetPlacementPolicy() *grpc1.PlacementPolicy {
|
||||
if x != nil {
|
||||
return x.PlacementPolicy
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// `Attribute` is a user-defined Key-Value metadata pair attached to the
|
||||
// container. Container attributes are immutable. They are set at the moment
|
||||
// of container creation and can never be added or updated.
|
||||
//
|
||||
// Key name must be a container-unique valid UTF-8 string. Value can't be
|
||||
// empty. Containers with duplicated attribute names or attributes with empty
|
||||
// values will be considered invalid.
|
||||
//
|
||||
// There are some "well-known" attributes affecting system behaviour:
|
||||
//
|
||||
// - [ __SYSTEM__NAME ] \
|
||||
// (`__NEOFS__NAME` is deprecated) \
|
||||
// String of a human-friendly container name registered as a domain in
|
||||
// NNS contract.
|
||||
// - [ __SYSTEM__ZONE ] \
|
||||
// (`__NEOFS__ZONE` is deprecated) \
|
||||
// String of a zone for `__SYSTEM__NAME` (`__NEOFS__NAME` is deprecated).
|
||||
// Used as a TLD of a domain name in NNS contract. If no zone is specified,
|
||||
// use default zone: `container`.
|
||||
// - [ __SYSTEM__DISABLE_HOMOMORPHIC_HASHING ] \
|
||||
// (`__NEOFS__DISABLE_HOMOMORPHIC_HASHING` is deprecated) \
|
||||
// Disables homomorphic hashing for the container if the value equals "true"
|
||||
// string. Any other values are interpreted as missing attribute. Container
|
||||
// could be accepted in a NeoFS network only if the global network hashing
|
||||
// configuration value corresponds with that attribute's value. After
|
||||
// container inclusion, network setting is ignored.
|
||||
//
|
||||
// And some well-known attributes used by applications only:
|
||||
//
|
||||
// - Name \
|
||||
// Human-friendly name
|
||||
// - Timestamp \
|
||||
// User-defined local time of container creation in Unix Timestamp format
|
||||
type Container_Attribute struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Attribute name key
|
||||
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
|
||||
// Attribute value
|
||||
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Container_Attribute) Reset() {
|
||||
*x = Container_Attribute{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_container_grpc_types_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Container_Attribute) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Container_Attribute) ProtoMessage() {}
|
||||
|
||||
func (x *Container_Attribute) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_container_grpc_types_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Container_Attribute.ProtoReflect.Descriptor instead.
|
||||
func (*Container_Attribute) Descriptor() ([]byte, []int) {
|
||||
return file_container_grpc_types_proto_rawDescGZIP(), []int{0, 0}
|
||||
}
|
||||
|
||||
func (x *Container_Attribute) GetKey() string {
|
||||
if x != nil {
|
||||
return x.Key
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Container_Attribute) GetValue() string {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_container_grpc_types_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_container_grpc_types_proto_rawDesc = []byte{
|
||||
0x0a, 0x1a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63,
|
||||
0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x6e, 0x65,
|
||||
0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
||||
0x72, 0x1a, 0x17, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74,
|
||||
0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73,
|
||||
0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x22, 0xf2, 0x02, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12,
|
||||
0x31, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66,
|
||||
0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32,
|
||||
0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x07, 0x6f,
|
||||
0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09,
|
||||
0x62, 0x61, 0x73, 0x69, 0x63, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52,
|
||||
0x08, 0x62, 0x61, 0x73, 0x69, 0x63, 0x41, 0x43, 0x4c, 0x12, 0x48, 0x0a, 0x0a, 0x61, 0x74, 0x74,
|
||||
0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e,
|
||||
0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69,
|
||||
0x6e, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x74,
|
||||
0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75,
|
||||
0x74, 0x65, 0x73, 0x12, 0x4c, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74,
|
||||
0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e,
|
||||
0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70,
|
||||
0x2e, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
|
||||
0x52, 0x0f, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63,
|
||||
0x79, 0x1a, 0x33, 0x0a, 0x09, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x10,
|
||||
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79,
|
||||
0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x6a, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72,
|
||||
0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43,
|
||||
0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d,
|
||||
0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69,
|
||||
0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e,
|
||||
0x65, 0x72, 0xaa, 0x02, 0x1d, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f,
|
||||
0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e,
|
||||
0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_container_grpc_types_proto_rawDescOnce sync.Once
|
||||
file_container_grpc_types_proto_rawDescData = file_container_grpc_types_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_container_grpc_types_proto_rawDescGZIP() []byte {
|
||||
file_container_grpc_types_proto_rawDescOnce.Do(func() {
|
||||
file_container_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_container_grpc_types_proto_rawDescData)
|
||||
})
|
||||
return file_container_grpc_types_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_container_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_container_grpc_types_proto_goTypes = []interface{}{
|
||||
(*Container)(nil), // 0: neo.fs.v2.container.Container
|
||||
(*Container_Attribute)(nil), // 1: neo.fs.v2.container.Container.Attribute
|
||||
(*grpc.Version)(nil), // 2: neo.fs.v2.refs.Version
|
||||
(*grpc.OwnerID)(nil), // 3: neo.fs.v2.refs.OwnerID
|
||||
(*grpc1.PlacementPolicy)(nil), // 4: neo.fs.v2.netmap.PlacementPolicy
|
||||
}
|
||||
var file_container_grpc_types_proto_depIdxs = []int32{
|
||||
2, // 0: neo.fs.v2.container.Container.version:type_name -> neo.fs.v2.refs.Version
|
||||
3, // 1: neo.fs.v2.container.Container.owner_id:type_name -> neo.fs.v2.refs.OwnerID
|
||||
1, // 2: neo.fs.v2.container.Container.attributes:type_name -> neo.fs.v2.container.Container.Attribute
|
||||
4, // 3: neo.fs.v2.container.Container.placement_policy:type_name -> neo.fs.v2.netmap.PlacementPolicy
|
||||
4, // [4:4] is the sub-list for method output_type
|
||||
4, // [4:4] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_container_grpc_types_proto_init() }
|
||||
func file_container_grpc_types_proto_init() {
|
||||
if File_container_grpc_types_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_container_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Container); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_container_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Container_Attribute); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_container_grpc_types_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_container_grpc_types_proto_goTypes,
|
||||
DependencyIndexes: file_container_grpc_types_proto_depIdxs,
|
||||
MessageInfos: file_container_grpc_types_proto_msgTypes,
|
||||
}.Build()
|
||||
File_container_grpc_types_proto = out.File
|
||||
file_container_grpc_types_proto_rawDesc = nil
|
||||
file_container_grpc_types_proto_goTypes = nil
|
||||
file_container_grpc_types_proto_depIdxs = nil
|
||||
}
|
554
container/grpc/types_frostfs.pb.go
generated
Normal file
554
container/grpc/types_frostfs.pb.go
generated
Normal file
|
@ -0,0 +1,554 @@
|
|||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package container
|
||||
|
||||
import (
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc"
|
||||
grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool"
|
||||
proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto"
|
||||
encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding"
|
||||
easyproto "github.com/VictoriaMetrics/easyproto"
|
||||
jlexer "github.com/mailru/easyjson/jlexer"
|
||||
jwriter "github.com/mailru/easyjson/jwriter"
|
||||
strconv "strconv"
|
||||
)
|
||||
|
||||
type Container_Attribute struct {
|
||||
Key string `json:"key"`
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*Container_Attribute)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*Container_Attribute)(nil)
|
||||
_ json.Marshaler = (*Container_Attribute)(nil)
|
||||
_ json.Unmarshaler = (*Container_Attribute)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *Container_Attribute) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.StringSize(1, x.Key)
|
||||
size += proto.StringSize(2, x.Value)
|
||||
return size
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *Container_Attribute) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *Container_Attribute) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if len(x.Key) != 0 {
|
||||
mm.AppendString(1, x.Key)
|
||||
}
|
||||
if len(x.Value) != 0 {
|
||||
mm.AppendString(2, x.Value)
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *Container_Attribute) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "Container_Attribute")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Key
|
||||
data, ok := fc.String()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Key")
|
||||
}
|
||||
x.Key = data
|
||||
case 2: // Value
|
||||
data, ok := fc.String()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Value")
|
||||
}
|
||||
x.Value = data
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Container_Attribute) GetKey() string {
|
||||
if x != nil {
|
||||
return x.Key
|
||||
}
|
||||
return ""
|
||||
}
|
||||
func (x *Container_Attribute) SetKey(v string) {
|
||||
x.Key = v
|
||||
}
|
||||
func (x *Container_Attribute) GetValue() string {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return ""
|
||||
}
|
||||
func (x *Container_Attribute) SetValue(v string) {
|
||||
x.Value = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *Container_Attribute) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *Container_Attribute) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
first := true
|
||||
out.RawByte('{')
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"key\":"
|
||||
out.RawString(prefix)
|
||||
out.String(x.Key)
|
||||
}
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"value\":"
|
||||
out.RawString(prefix)
|
||||
out.String(x.Value)
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *Container_Attribute) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *Container_Attribute) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "key":
|
||||
{
|
||||
var f string
|
||||
f = in.String()
|
||||
x.Key = f
|
||||
}
|
||||
case "value":
|
||||
{
|
||||
var f string
|
||||
f = in.String()
|
||||
x.Value = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
||||
|
||||
type Container struct {
|
||||
Version *grpc.Version `json:"version"`
|
||||
OwnerId *grpc.OwnerID `json:"ownerID"`
|
||||
Nonce []byte `json:"nonce"`
|
||||
BasicAcl uint32 `json:"basicACL"`
|
||||
Attributes []Container_Attribute `json:"attributes"`
|
||||
PlacementPolicy *grpc1.PlacementPolicy `json:"placementPolicy"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*Container)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*Container)(nil)
|
||||
_ json.Marshaler = (*Container)(nil)
|
||||
_ json.Unmarshaler = (*Container)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *Container) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.NestedStructureSize(1, x.Version)
|
||||
size += proto.NestedStructureSize(2, x.OwnerId)
|
||||
size += proto.BytesSize(3, x.Nonce)
|
||||
size += proto.UInt32Size(4, x.BasicAcl)
|
||||
for i := range x.Attributes {
|
||||
size += proto.NestedStructureSizeUnchecked(5, &x.Attributes[i])
|
||||
}
|
||||
size += proto.NestedStructureSize(6, x.PlacementPolicy)
|
||||
return size
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *Container) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *Container) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if x.Version != nil {
|
||||
x.Version.EmitProtobuf(mm.AppendMessage(1))
|
||||
}
|
||||
if x.OwnerId != nil {
|
||||
x.OwnerId.EmitProtobuf(mm.AppendMessage(2))
|
||||
}
|
||||
if len(x.Nonce) != 0 {
|
||||
mm.AppendBytes(3, x.Nonce)
|
||||
}
|
||||
if x.BasicAcl != 0 {
|
||||
mm.AppendUint32(4, x.BasicAcl)
|
||||
}
|
||||
for i := range x.Attributes {
|
||||
x.Attributes[i].EmitProtobuf(mm.AppendMessage(5))
|
||||
}
|
||||
if x.PlacementPolicy != nil {
|
||||
x.PlacementPolicy.EmitProtobuf(mm.AppendMessage(6))
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *Container) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "Container")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Version
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Version")
|
||||
}
|
||||
x.Version = new(grpc.Version)
|
||||
if err := x.Version.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
case 2: // OwnerId
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "OwnerId")
|
||||
}
|
||||
x.OwnerId = new(grpc.OwnerID)
|
||||
if err := x.OwnerId.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
case 3: // Nonce
|
||||
data, ok := fc.Bytes()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Nonce")
|
||||
}
|
||||
x.Nonce = data
|
||||
case 4: // BasicAcl
|
||||
data, ok := fc.Uint32()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "BasicAcl")
|
||||
}
|
||||
x.BasicAcl = data
|
||||
case 5: // Attributes
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Attributes")
|
||||
}
|
||||
x.Attributes = append(x.Attributes, Container_Attribute{})
|
||||
ff := &x.Attributes[len(x.Attributes)-1]
|
||||
if err := ff.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
case 6: // PlacementPolicy
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "PlacementPolicy")
|
||||
}
|
||||
x.PlacementPolicy = new(grpc1.PlacementPolicy)
|
||||
if err := x.PlacementPolicy.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Container) GetVersion() *grpc.Version {
|
||||
if x != nil {
|
||||
return x.Version
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Container) SetVersion(v *grpc.Version) {
|
||||
x.Version = v
|
||||
}
|
||||
func (x *Container) GetOwnerId() *grpc.OwnerID {
|
||||
if x != nil {
|
||||
return x.OwnerId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Container) SetOwnerId(v *grpc.OwnerID) {
|
||||
x.OwnerId = v
|
||||
}
|
||||
func (x *Container) GetNonce() []byte {
|
||||
if x != nil {
|
||||
return x.Nonce
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Container) SetNonce(v []byte) {
|
||||
x.Nonce = v
|
||||
}
|
||||
func (x *Container) GetBasicAcl() uint32 {
|
||||
if x != nil {
|
||||
return x.BasicAcl
|
||||
}
|
||||
return 0
|
||||
}
|
||||
func (x *Container) SetBasicAcl(v uint32) {
|
||||
x.BasicAcl = v
|
||||
}
|
||||
func (x *Container) GetAttributes() []Container_Attribute {
|
||||
if x != nil {
|
||||
return x.Attributes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Container) SetAttributes(v []Container_Attribute) {
|
||||
x.Attributes = v
|
||||
}
|
||||
func (x *Container) GetPlacementPolicy() *grpc1.PlacementPolicy {
|
||||
if x != nil {
|
||||
return x.PlacementPolicy
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Container) SetPlacementPolicy(v *grpc1.PlacementPolicy) {
|
||||
x.PlacementPolicy = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *Container) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *Container) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
first := true
|
||||
out.RawByte('{')
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"version\":"
|
||||
out.RawString(prefix)
|
||||
x.Version.MarshalEasyJSON(out)
|
||||
}
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"ownerID\":"
|
||||
out.RawString(prefix)
|
||||
x.OwnerId.MarshalEasyJSON(out)
|
||||
}
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"nonce\":"
|
||||
out.RawString(prefix)
|
||||
if x.Nonce != nil {
|
||||
out.Base64Bytes(x.Nonce)
|
||||
} else {
|
||||
out.String("")
|
||||
}
|
||||
}
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"basicACL\":"
|
||||
out.RawString(prefix)
|
||||
out.Uint32(x.BasicAcl)
|
||||
}
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"attributes\":"
|
||||
out.RawString(prefix)
|
||||
out.RawByte('[')
|
||||
for i := range x.Attributes {
|
||||
if i != 0 {
|
||||
out.RawByte(',')
|
||||
}
|
||||
x.Attributes[i].MarshalEasyJSON(out)
|
||||
}
|
||||
out.RawByte(']')
|
||||
}
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"placementPolicy\":"
|
||||
out.RawString(prefix)
|
||||
x.PlacementPolicy.MarshalEasyJSON(out)
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *Container) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *Container) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "version":
|
||||
{
|
||||
var f *grpc.Version
|
||||
f = new(grpc.Version)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.Version = f
|
||||
}
|
||||
case "ownerID":
|
||||
{
|
||||
var f *grpc.OwnerID
|
||||
f = new(grpc.OwnerID)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.OwnerId = f
|
||||
}
|
||||
case "nonce":
|
||||
{
|
||||
var f []byte
|
||||
{
|
||||
tmp := in.Bytes()
|
||||
if len(tmp) == 0 {
|
||||
tmp = nil
|
||||
}
|
||||
f = tmp
|
||||
}
|
||||
x.Nonce = f
|
||||
}
|
||||
case "basicACL":
|
||||
{
|
||||
var f uint32
|
||||
r := in.JsonNumber()
|
||||
n := r.String()
|
||||
v, err := strconv.ParseUint(n, 10, 32)
|
||||
if err != nil {
|
||||
in.AddError(err)
|
||||
return
|
||||
}
|
||||
pv := uint32(v)
|
||||
f = pv
|
||||
x.BasicAcl = f
|
||||
}
|
||||
case "attributes":
|
||||
{
|
||||
var f Container_Attribute
|
||||
var list []Container_Attribute
|
||||
in.Delim('[')
|
||||
for !in.IsDelim(']') {
|
||||
f = Container_Attribute{}
|
||||
f.UnmarshalEasyJSON(in)
|
||||
list = append(list, f)
|
||||
in.WantComma()
|
||||
}
|
||||
x.Attributes = list
|
||||
in.Delim(']')
|
||||
}
|
||||
case "placementPolicy":
|
||||
{
|
||||
var f *grpc1.PlacementPolicy
|
||||
f = new(grpc1.PlacementPolicy)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.PlacementPolicy = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
26
container/grpc/types_frostfs_fuzz.go
Normal file
26
container/grpc/types_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package container
|
||||
|
||||
func DoFuzzProtoContainer(data []byte) int {
|
||||
msg := new(Container)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONContainer(data []byte) int {
|
||||
msg := new(Container)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
21
container/grpc/types_frostfs_test.go
Normal file
21
container/grpc/types_frostfs_test.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package container
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoContainer(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoContainer(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONContainer(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONContainer(data)
|
||||
})
|
||||
}
|
|
@ -34,12 +34,6 @@ const (
|
|||
listReqBodyOwnerField = 1
|
||||
|
||||
listRespBodyIDsField = 1
|
||||
|
||||
getEACLReqBodyIDField = 1
|
||||
|
||||
getEACLRespBodyTableField = 1
|
||||
getEACLRespBodySignatureField = 2
|
||||
getEACLRespBodyTokenField = 3
|
||||
)
|
||||
|
||||
func (a *Attribute) StableMarshal(buf []byte) []byte {
|
||||
|
@ -349,65 +343,3 @@ func (r *ListResponseBody) StableSize() (size int) {
|
|||
func (r *ListResponseBody) Unmarshal(data []byte) error {
|
||||
return message.Unmarshal(r, data, new(container.ListResponse_Body))
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLRequestBody) StableMarshal(buf []byte) []byte {
|
||||
if r == nil {
|
||||
return []byte{}
|
||||
}
|
||||
|
||||
if buf == nil {
|
||||
buf = make([]byte, r.StableSize())
|
||||
}
|
||||
|
||||
protoutil.NestedStructureMarshal(getEACLReqBodyIDField, buf, r.cid)
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLRequestBody) StableSize() (size int) {
|
||||
if r == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
size += protoutil.NestedStructureSize(getEACLReqBodyIDField, r.cid)
|
||||
|
||||
return size
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLRequestBody) Unmarshal(data []byte) error {
|
||||
return message.Unmarshal(r, data, new(container.GetExtendedACLRequest_Body))
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLResponseBody) StableMarshal(buf []byte) []byte {
|
||||
if r == nil {
|
||||
return []byte{}
|
||||
}
|
||||
|
||||
if buf == nil {
|
||||
buf = make([]byte, r.StableSize())
|
||||
}
|
||||
|
||||
var offset int
|
||||
|
||||
offset += protoutil.NestedStructureMarshal(getEACLRespBodyTableField, buf[offset:], r.eacl)
|
||||
offset += protoutil.NestedStructureMarshal(getEACLRespBodySignatureField, buf[offset:], r.sig)
|
||||
protoutil.NestedStructureMarshal(getEACLRespBodyTokenField, buf[offset:], r.token)
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLResponseBody) StableSize() (size int) {
|
||||
if r == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
size += protoutil.NestedStructureSize(getEACLRespBodyTableField, r.eacl)
|
||||
size += protoutil.NestedStructureSize(getEACLRespBodySignatureField, r.sig)
|
||||
size += protoutil.NestedStructureSize(getEACLRespBodyTokenField, r.token)
|
||||
|
||||
return size
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLResponseBody) Unmarshal(data []byte) error {
|
||||
return message.Unmarshal(r, data, new(container.GetExtendedACLResponse_Body))
|
||||
}
|
||||
|
|
|
@ -32,9 +32,5 @@ func TestMessageConvert(t *testing.T) {
|
|||
func(empty bool) message.Message { return containertest.GenerateGetRequest(empty) },
|
||||
func(empty bool) message.Message { return containertest.GenerateGetResponseBody(empty) },
|
||||
func(empty bool) message.Message { return containertest.GenerateGetResponse(empty) },
|
||||
func(empty bool) message.Message { return containertest.GenerateGetExtendedACLRequestBody(empty) },
|
||||
func(empty bool) message.Message { return containertest.GenerateGetExtendedACLRequest(empty) },
|
||||
func(empty bool) message.Message { return containertest.GenerateGetExtendedACLResponseBody(empty) },
|
||||
func(empty bool) message.Message { return containertest.GenerateGetExtendedACLResponse(empty) },
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package containertest
|
||||
|
||||
import (
|
||||
acltest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/test"
|
||||
"crypto/rand"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container"
|
||||
netmaptest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/test"
|
||||
refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test"
|
||||
|
@ -36,8 +37,11 @@ func GenerateContainer(empty bool) *container.Container {
|
|||
m := new(container.Container)
|
||||
|
||||
if !empty {
|
||||
nonce := make([]byte, 16)
|
||||
_, _ = rand.Read(nonce)
|
||||
|
||||
m.SetBasicACL(12)
|
||||
m.SetNonce([]byte{1, 2, 3})
|
||||
m.SetNonce(nonce)
|
||||
m.SetOwnerID(refstest.GenerateOwnerID(false))
|
||||
m.SetAttributes(GenerateAttributes(false))
|
||||
m.SetPlacementPolicy(netmaptest.GeneratePlacementPolicy(false))
|
||||
|
@ -234,52 +238,3 @@ func GenerateListResponse(empty bool) *container.ListResponse {
|
|||
|
||||
return m
|
||||
}
|
||||
|
||||
func GenerateGetExtendedACLRequestBody(empty bool) *container.GetExtendedACLRequestBody {
|
||||
m := new(container.GetExtendedACLRequestBody)
|
||||
|
||||
if !empty {
|
||||
m.SetContainerID(refstest.GenerateContainerID(false))
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func GenerateGetExtendedACLRequest(empty bool) *container.GetExtendedACLRequest {
|
||||
m := new(container.GetExtendedACLRequest)
|
||||
|
||||
if !empty {
|
||||
m.SetBody(GenerateGetExtendedACLRequestBody(false))
|
||||
}
|
||||
|
||||
m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty))
|
||||
m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty))
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func GenerateGetExtendedACLResponseBody(empty bool) *container.GetExtendedACLResponseBody {
|
||||
m := new(container.GetExtendedACLResponseBody)
|
||||
|
||||
if !empty {
|
||||
m.SetEACL(acltest.GenerateTable(false))
|
||||
}
|
||||
|
||||
m.SetSignature(refstest.GenerateSignature(empty))
|
||||
m.SetSessionToken(sessiontest.GenerateSessionToken(empty))
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func GenerateGetExtendedACLResponse(empty bool) *container.GetExtendedACLResponse {
|
||||
m := new(container.GetExtendedACLResponse)
|
||||
|
||||
if !empty {
|
||||
m.SetBody(GenerateGetExtendedACLResponseBody(false))
|
||||
}
|
||||
|
||||
m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty))
|
||||
m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty))
|
||||
|
||||
return m
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package container
|
||||
|
||||
import (
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session"
|
||||
|
@ -110,30 +109,6 @@ type ListResponse struct {
|
|||
session.ResponseHeaders
|
||||
}
|
||||
|
||||
type GetExtendedACLRequestBody struct {
|
||||
cid *refs.ContainerID
|
||||
}
|
||||
|
||||
type GetExtendedACLRequest struct {
|
||||
body *GetExtendedACLRequestBody
|
||||
|
||||
session.RequestHeaders
|
||||
}
|
||||
|
||||
type GetExtendedACLResponseBody struct {
|
||||
eacl *acl.Table
|
||||
|
||||
sig *refs.Signature
|
||||
|
||||
token *session.Token
|
||||
}
|
||||
|
||||
type GetExtendedACLResponse struct {
|
||||
body *GetExtendedACLResponseBody
|
||||
|
||||
session.ResponseHeaders
|
||||
}
|
||||
|
||||
func (a *Attribute) GetKey() string {
|
||||
if a != nil {
|
||||
return a.key
|
||||
|
@ -469,81 +444,3 @@ func (r *ListResponse) GetBody() *ListResponseBody {
|
|||
func (r *ListResponse) SetBody(v *ListResponseBody) {
|
||||
r.body = v
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLRequestBody) GetContainerID() *refs.ContainerID {
|
||||
if r != nil {
|
||||
return r.cid
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLRequestBody) SetContainerID(v *refs.ContainerID) {
|
||||
r.cid = v
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLRequest) GetBody() *GetExtendedACLRequestBody {
|
||||
if r != nil {
|
||||
return r.body
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLRequest) SetBody(v *GetExtendedACLRequestBody) {
|
||||
r.body = v
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLResponseBody) GetEACL() *acl.Table {
|
||||
if r != nil {
|
||||
return r.eacl
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLResponseBody) SetEACL(v *acl.Table) {
|
||||
r.eacl = v
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLResponseBody) GetSignature() *refs.Signature {
|
||||
if r != nil {
|
||||
return r.sig
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLResponseBody) SetSignature(v *refs.Signature) {
|
||||
// TODO: (neofs-api-go#381) avoid this hack (e.g. create refs.SignatureRFC6979 type)
|
||||
v.SetScheme(0)
|
||||
r.sig = v
|
||||
}
|
||||
|
||||
// GetSessionToken returns token of the session within which requested
|
||||
// eACL table was set.
|
||||
func (r *GetExtendedACLResponseBody) GetSessionToken() *session.Token {
|
||||
if r != nil {
|
||||
return r.token
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetSessionToken sets token of the session within which requested
|
||||
// eACL table was set.
|
||||
func (r *GetExtendedACLResponseBody) SetSessionToken(v *session.Token) {
|
||||
r.token = v
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLResponse) GetBody() *GetExtendedACLResponseBody {
|
||||
if r != nil {
|
||||
return r.body
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *GetExtendedACLResponse) SetBody(v *GetExtendedACLResponseBody) {
|
||||
r.body = v
|
||||
}
|
||||
|
|
20
go.mod
20
go.mod
|
@ -1,26 +1,28 @@
|
|||
module git.frostfs.info/TrueCloudLab/frostfs-api-go/v2
|
||||
|
||||
go 1.20
|
||||
go 1.22
|
||||
|
||||
require (
|
||||
git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0
|
||||
github.com/VictoriaMetrics/easyproto v0.1.4
|
||||
github.com/mailru/easyjson v0.7.7
|
||||
github.com/stretchr/testify v1.8.3
|
||||
golang.org/x/sync v0.2.0
|
||||
google.golang.org/grpc v1.55.0
|
||||
google.golang.org/protobuf v1.33.0
|
||||
golang.org/x/sync v0.7.0
|
||||
google.golang.org/grpc v1.66.2
|
||||
google.golang.org/protobuf v1.34.1
|
||||
)
|
||||
|
||||
require (
|
||||
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/josharian/intern v1.0.0 // indirect
|
||||
github.com/kr/pretty v0.1.0 // indirect
|
||||
github.com/mr-tron/base58 v1.2.0 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
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.26.0 // indirect
|
||||
golang.org/x/sys v0.21.0 // indirect
|
||||
golang.org/x/text v0.16.0 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
|
44
go.sum
44
go.sum
|
@ -2,19 +2,22 @@ git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSV
|
|||
git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0/go.mod h1:RUIKZATQLJ+TaYQa60X2fTDwfuhMfm8Ar60bQ5fr+vU=
|
||||
git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 h1:M2KR3iBj7WpY3hP10IevfIB9MURr4O9mwVfJ+SjT3HA=
|
||||
git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0/go.mod h1:okpbKfVYf/BpejtfFTfhZqFP+sZ8rsHrP8Rr/jYPNRc=
|
||||
github.com/VictoriaMetrics/easyproto v0.1.4 h1:r8cNvo8o6sR4QShBXQd1bKw/VVLSQma/V2KhTBPf+Sc=
|
||||
github.com/VictoriaMetrics/easyproto v0.1.4/go.mod h1:QlGlzaJnDfFd8Lk6Ci/fuLxfTo3/GThPs2KH23mv710=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/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/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
|
||||
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
|
||||
github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
|
@ -23,23 +26,20 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
|
|||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
|
||||
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
golang.org/x/net v0.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=
|
||||
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
|
||||
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||
golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ=
|
||||
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
|
||||
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
|
||||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
|
||||
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
|
||||
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
|
||||
google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo=
|
||||
google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y=
|
||||
google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
|
||||
google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
package lock
|
||||
|
||||
import refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
|
||||
// SetMembers sets `members` field.
|
||||
func (x *Lock) SetMembers(ids []*refs.ObjectID) {
|
||||
x.Members = ids
|
||||
}
|
160
lock/grpc/types.pb.go
generated
160
lock/grpc/types.pb.go
generated
|
@ -1,160 +0,0 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.2
|
||||
// source: lock/grpc/types.proto
|
||||
|
||||
package lock
|
||||
|
||||
import (
|
||||
grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// Lock objects protects a list of objects from being deleted. The lifetime of a
|
||||
// lock object is limited similar to regular objects in
|
||||
// `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated)
|
||||
// attribute. Lock object MUST have expiration epoch. It is impossible to delete
|
||||
// a lock object via ObjectService.Delete RPC call.
|
||||
type Lock struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// List of objects to lock. Must not be empty or carry empty IDs.
|
||||
// All members must be of the `REGULAR` type.
|
||||
Members []*grpc.ObjectID `protobuf:"bytes,1,rep,name=members,proto3" json:"members,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Lock) Reset() {
|
||||
*x = Lock{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_lock_grpc_types_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Lock) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Lock) ProtoMessage() {}
|
||||
|
||||
func (x *Lock) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_lock_grpc_types_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Lock.ProtoReflect.Descriptor instead.
|
||||
func (*Lock) Descriptor() ([]byte, []int) {
|
||||
return file_lock_grpc_types_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Lock) GetMembers() []*grpc.ObjectID {
|
||||
if x != nil {
|
||||
return x.Members
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_lock_grpc_types_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_lock_grpc_types_proto_rawDesc = []byte{
|
||||
0x0a, 0x15, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65,
|
||||
0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e,
|
||||
0x76, 0x32, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72,
|
||||
0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3a,
|
||||
0x0a, 0x04, 0x4c, 0x6f, 0x63, 0x6b, 0x12, 0x32, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72,
|
||||
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73,
|
||||
0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49,
|
||||
0x44, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x42, 0x5b, 0x5a, 0x3e, 0x67, 0x69,
|
||||
0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54,
|
||||
0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73,
|
||||
0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6c, 0x6f,
|
||||
0x63, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6c, 0x6f, 0x63, 0x6b, 0xaa, 0x02, 0x18, 0x4e,
|
||||
0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41,
|
||||
0x50, 0x49, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_lock_grpc_types_proto_rawDescOnce sync.Once
|
||||
file_lock_grpc_types_proto_rawDescData = file_lock_grpc_types_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_lock_grpc_types_proto_rawDescGZIP() []byte {
|
||||
file_lock_grpc_types_proto_rawDescOnce.Do(func() {
|
||||
file_lock_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_lock_grpc_types_proto_rawDescData)
|
||||
})
|
||||
return file_lock_grpc_types_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_lock_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_lock_grpc_types_proto_goTypes = []interface{}{
|
||||
(*Lock)(nil), // 0: neo.fs.v2.lock.Lock
|
||||
(*grpc.ObjectID)(nil), // 1: neo.fs.v2.refs.ObjectID
|
||||
}
|
||||
var file_lock_grpc_types_proto_depIdxs = []int32{
|
||||
1, // 0: neo.fs.v2.lock.Lock.members:type_name -> neo.fs.v2.refs.ObjectID
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_lock_grpc_types_proto_init() }
|
||||
func file_lock_grpc_types_proto_init() {
|
||||
if File_lock_grpc_types_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_lock_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Lock); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_lock_grpc_types_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_lock_grpc_types_proto_goTypes,
|
||||
DependencyIndexes: file_lock_grpc_types_proto_depIdxs,
|
||||
MessageInfos: file_lock_grpc_types_proto_msgTypes,
|
||||
}.Build()
|
||||
File_lock_grpc_types_proto = out.File
|
||||
file_lock_grpc_types_proto_rawDesc = nil
|
||||
file_lock_grpc_types_proto_goTypes = nil
|
||||
file_lock_grpc_types_proto_depIdxs = nil
|
||||
}
|
171
lock/grpc/types_frostfs.pb.go
generated
Normal file
171
lock/grpc/types_frostfs.pb.go
generated
Normal file
|
@ -0,0 +1,171 @@
|
|||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package lock
|
||||
|
||||
import (
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool"
|
||||
proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto"
|
||||
encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding"
|
||||
easyproto "github.com/VictoriaMetrics/easyproto"
|
||||
jlexer "github.com/mailru/easyjson/jlexer"
|
||||
jwriter "github.com/mailru/easyjson/jwriter"
|
||||
)
|
||||
|
||||
type Lock struct {
|
||||
Members []grpc.ObjectID `json:"members"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*Lock)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*Lock)(nil)
|
||||
_ json.Marshaler = (*Lock)(nil)
|
||||
_ json.Unmarshaler = (*Lock)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *Lock) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
for i := range x.Members {
|
||||
size += proto.NestedStructureSizeUnchecked(1, &x.Members[i])
|
||||
}
|
||||
return size
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *Lock) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *Lock) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
for i := range x.Members {
|
||||
x.Members[i].EmitProtobuf(mm.AppendMessage(1))
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *Lock) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "Lock")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Members
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Members")
|
||||
}
|
||||
x.Members = append(x.Members, grpc.ObjectID{})
|
||||
ff := &x.Members[len(x.Members)-1]
|
||||
if err := ff.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Lock) GetMembers() []grpc.ObjectID {
|
||||
if x != nil {
|
||||
return x.Members
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Lock) SetMembers(v []grpc.ObjectID) {
|
||||
x.Members = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *Lock) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *Lock) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
first := true
|
||||
out.RawByte('{')
|
||||
{
|
||||
if !first {
|
||||
out.RawByte(',')
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
const prefix string = "\"members\":"
|
||||
out.RawString(prefix)
|
||||
out.RawByte('[')
|
||||
for i := range x.Members {
|
||||
if i != 0 {
|
||||
out.RawByte(',')
|
||||
}
|
||||
x.Members[i].MarshalEasyJSON(out)
|
||||
}
|
||||
out.RawByte(']')
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *Lock) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *Lock) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "members":
|
||||
{
|
||||
var f grpc.ObjectID
|
||||
var list []grpc.ObjectID
|
||||
in.Delim('[')
|
||||
for !in.IsDelim(']') {
|
||||
f = grpc.ObjectID{}
|
||||
f.UnmarshalEasyJSON(in)
|
||||
list = append(list, f)
|
||||
in.WantComma()
|
||||
}
|
||||
x.Members = list
|
||||
in.Delim(']')
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
26
lock/grpc/types_frostfs_fuzz.go
Normal file
26
lock/grpc/types_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package lock
|
||||
|
||||
func DoFuzzProtoLock(data []byte) int {
|
||||
msg := new(Lock)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONLock(data []byte) int {
|
||||
msg := new(Lock)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
21
lock/grpc/types_frostfs_test.go
Normal file
21
lock/grpc/types_frostfs_test.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package lock
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoLock(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoLock(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONLock(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONLock(data)
|
||||
})
|
||||
}
|
|
@ -45,31 +45,29 @@ func (f *Filter) FromGRPCMessage(m grpc.Message) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func FiltersToGRPC(fs []Filter) (res []*netmap.Filter) {
|
||||
func FiltersToGRPC(fs []Filter) (res []netmap.Filter) {
|
||||
if fs != nil {
|
||||
res = make([]*netmap.Filter, 0, len(fs))
|
||||
res = make([]netmap.Filter, 0, len(fs))
|
||||
|
||||
for i := range fs {
|
||||
res = append(res, fs[i].ToGRPCMessage().(*netmap.Filter))
|
||||
res = append(res, *fs[i].ToGRPCMessage().(*netmap.Filter))
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func FiltersFromGRPC(fs []*netmap.Filter) (res []Filter, err error) {
|
||||
func FiltersFromGRPC(fs []netmap.Filter) (res []Filter, err error) {
|
||||
if fs != nil {
|
||||
res = make([]Filter, len(fs))
|
||||
|
||||
for i := range fs {
|
||||
if fs[i] != nil {
|
||||
err = res[i].FromGRPCMessage(fs[i])
|
||||
err = res[i].FromGRPCMessage(&fs[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -105,31 +103,29 @@ func (s *Selector) FromGRPCMessage(m grpc.Message) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func SelectorsToGRPC(ss []Selector) (res []*netmap.Selector) {
|
||||
func SelectorsToGRPC(ss []Selector) (res []netmap.Selector) {
|
||||
if ss != nil {
|
||||
res = make([]*netmap.Selector, 0, len(ss))
|
||||
res = make([]netmap.Selector, 0, len(ss))
|
||||
|
||||
for i := range ss {
|
||||
res = append(res, ss[i].ToGRPCMessage().(*netmap.Selector))
|
||||
res = append(res, *ss[i].ToGRPCMessage().(*netmap.Selector))
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func SelectorsFromGRPC(ss []*netmap.Selector) (res []Selector, err error) {
|
||||
func SelectorsFromGRPC(ss []netmap.Selector) (res []Selector, err error) {
|
||||
if ss != nil {
|
||||
res = make([]Selector, len(ss))
|
||||
|
||||
for i := range ss {
|
||||
if ss[i] != nil {
|
||||
err = res[i].FromGRPCMessage(ss[i])
|
||||
err = res[i].FromGRPCMessage(&ss[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -163,31 +159,29 @@ func (r *Replica) FromGRPCMessage(m grpc.Message) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func ReplicasToGRPC(rs []Replica) (res []*netmap.Replica) {
|
||||
func ReplicasToGRPC(rs []Replica) (res []netmap.Replica) {
|
||||
if rs != nil {
|
||||
res = make([]*netmap.Replica, 0, len(rs))
|
||||
res = make([]netmap.Replica, 0, len(rs))
|
||||
|
||||
for i := range rs {
|
||||
res = append(res, rs[i].ToGRPCMessage().(*netmap.Replica))
|
||||
res = append(res, *rs[i].ToGRPCMessage().(*netmap.Replica))
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func ReplicasFromGRPC(rs []*netmap.Replica) (res []Replica, err error) {
|
||||
func ReplicasFromGRPC(rs []netmap.Replica) (res []Replica, err error) {
|
||||
if rs != nil {
|
||||
res = make([]Replica, len(rs))
|
||||
|
||||
for i := range rs {
|
||||
if rs[i] != nil {
|
||||
err = res[i].FromGRPCMessage(rs[i])
|
||||
err = res[i].FromGRPCMessage(&rs[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -289,31 +283,29 @@ func (a *Attribute) FromGRPCMessage(m grpc.Message) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func AttributesToGRPC(as []Attribute) (res []*netmap.NodeInfo_Attribute) {
|
||||
func AttributesToGRPC(as []Attribute) (res []netmap.NodeInfo_Attribute) {
|
||||
if as != nil {
|
||||
res = make([]*netmap.NodeInfo_Attribute, 0, len(as))
|
||||
res = make([]netmap.NodeInfo_Attribute, 0, len(as))
|
||||
|
||||
for i := range as {
|
||||
res = append(res, as[i].ToGRPCMessage().(*netmap.NodeInfo_Attribute))
|
||||
res = append(res, *as[i].ToGRPCMessage().(*netmap.NodeInfo_Attribute))
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func AttributesFromGRPC(as []*netmap.NodeInfo_Attribute) (res []Attribute, err error) {
|
||||
func AttributesFromGRPC(as []netmap.NodeInfo_Attribute) (res []Attribute, err error) {
|
||||
if as != nil {
|
||||
res = make([]Attribute, len(as))
|
||||
|
||||
for i := range as {
|
||||
if as[i] != nil {
|
||||
err = res[i].FromGRPCMessage(as[i])
|
||||
err = res[i].FromGRPCMessage(&as[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -528,13 +520,13 @@ func (x *NetworkConfig) ToGRPCMessage() grpc.Message {
|
|||
if x != nil {
|
||||
m = new(netmap.NetworkConfig)
|
||||
|
||||
var ps []*netmap.NetworkConfig_Parameter
|
||||
var ps []netmap.NetworkConfig_Parameter
|
||||
|
||||
if ln := len(x.ps); ln > 0 {
|
||||
ps = make([]*netmap.NetworkConfig_Parameter, 0, ln)
|
||||
ps = make([]netmap.NetworkConfig_Parameter, 0, ln)
|
||||
|
||||
for i := 0; i < ln; i++ {
|
||||
ps = append(ps, x.ps[i].ToGRPCMessage().(*netmap.NetworkConfig_Parameter))
|
||||
for i := range ln {
|
||||
ps = append(ps, *x.ps[i].ToGRPCMessage().(*netmap.NetworkConfig_Parameter))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -560,14 +552,12 @@ func (x *NetworkConfig) FromGRPCMessage(m grpc.Message) error {
|
|||
|
||||
ps = make([]NetworkParameter, ln)
|
||||
|
||||
for i := 0; i < ln; i++ {
|
||||
if psV2[i] != nil {
|
||||
if err := ps[i].FromGRPCMessage(psV2[i]); err != nil {
|
||||
for i := range ln {
|
||||
if err := ps[i].FromGRPCMessage(&psV2[i]); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
x.ps = ps
|
||||
|
||||
|
@ -756,10 +746,10 @@ func (x *NetMap) ToGRPCMessage() grpc.Message {
|
|||
m.SetEpoch(x.epoch)
|
||||
|
||||
if x.nodes != nil {
|
||||
nodes := make([]*netmap.NodeInfo, len(x.nodes))
|
||||
nodes := make([]netmap.NodeInfo, len(x.nodes))
|
||||
|
||||
for i := range x.nodes {
|
||||
nodes[i] = x.nodes[i].ToGRPCMessage().(*netmap.NodeInfo)
|
||||
nodes[i] = *x.nodes[i].ToGRPCMessage().(*netmap.NodeInfo)
|
||||
}
|
||||
|
||||
m.SetNodes(nodes)
|
||||
|
@ -784,7 +774,7 @@ func (x *NetMap) FromGRPCMessage(m grpc.Message) error {
|
|||
x.nodes = make([]NodeInfo, len(nodes))
|
||||
|
||||
for i := range nodes {
|
||||
err = x.nodes[i].FromGRPCMessage(nodes[i])
|
||||
err = x.nodes[i].FromGRPCMessage(&nodes[i])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -1,116 +0,0 @@
|
|||
package netmap
|
||||
|
||||
import (
|
||||
refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc"
|
||||
)
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *LocalNodeInfoRequest) SetBody(v *LocalNodeInfoRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *LocalNodeInfoRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *LocalNodeInfoRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetVersion sets version of response body.
|
||||
func (m *LocalNodeInfoResponse_Body) SetVersion(v *refs.Version) {
|
||||
m.Version = v
|
||||
}
|
||||
|
||||
// SetNodeInfo sets node info of response body.
|
||||
func (m *LocalNodeInfoResponse_Body) SetNodeInfo(v *NodeInfo) {
|
||||
m.NodeInfo = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *LocalNodeInfoResponse) SetBody(v *LocalNodeInfoResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *LocalNodeInfoResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *LocalNodeInfoResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (x *NetworkInfoRequest) SetBody(v *NetworkInfoRequest_Body) {
|
||||
x.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (x *NetworkInfoRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
x.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (x *NetworkInfoRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
x.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetNetworkInfo sets information about the network.
|
||||
func (x *NetworkInfoResponse_Body) SetNetworkInfo(v *NetworkInfo) {
|
||||
x.NetworkInfo = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (x *NetworkInfoResponse) SetBody(v *NetworkInfoResponse_Body) {
|
||||
x.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (x *NetworkInfoResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
x.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (x *NetworkInfoResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
x.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (x *NetmapSnapshotRequest) SetBody(v *NetmapSnapshotRequest_Body) {
|
||||
x.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (x *NetmapSnapshotRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
x.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (x *NetmapSnapshotRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
x.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetNetmap sets current Netmap.
|
||||
func (x *NetmapSnapshotResponse_Body) SetNetmap(v *Netmap) {
|
||||
x.Netmap = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (x *NetmapSnapshotResponse) SetBody(v *NetmapSnapshotResponse_Body) {
|
||||
x.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (x *NetmapSnapshotResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
x.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (x *NetmapSnapshotResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
x.VerifyHeader = v
|
||||
}
|
1108
netmap/grpc/service.pb.go
generated
1108
netmap/grpc/service.pb.go
generated
File diff suppressed because it is too large
Load diff
2180
netmap/grpc/service_frostfs.pb.go
generated
Normal file
2180
netmap/grpc/service_frostfs.pb.go
generated
Normal file
File diff suppressed because it is too large
Load diff
121
netmap/grpc/service_frostfs_fuzz.go
Normal file
121
netmap/grpc/service_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,121 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package netmap
|
||||
|
||||
func DoFuzzProtoLocalNodeInfoRequest(data []byte) int {
|
||||
msg := new(LocalNodeInfoRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONLocalNodeInfoRequest(data []byte) int {
|
||||
msg := new(LocalNodeInfoRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoLocalNodeInfoResponse(data []byte) int {
|
||||
msg := new(LocalNodeInfoResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONLocalNodeInfoResponse(data []byte) int {
|
||||
msg := new(LocalNodeInfoResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNetworkInfoRequest(data []byte) int {
|
||||
msg := new(NetworkInfoRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNetworkInfoRequest(data []byte) int {
|
||||
msg := new(NetworkInfoRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNetworkInfoResponse(data []byte) int {
|
||||
msg := new(NetworkInfoResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNetworkInfoResponse(data []byte) int {
|
||||
msg := new(NetworkInfoResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNetmapSnapshotRequest(data []byte) int {
|
||||
msg := new(NetmapSnapshotRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNetmapSnapshotRequest(data []byte) int {
|
||||
msg := new(NetmapSnapshotRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNetmapSnapshotResponse(data []byte) int {
|
||||
msg := new(NetmapSnapshotResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNetmapSnapshotResponse(data []byte) int {
|
||||
msg := new(NetmapSnapshotResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
71
netmap/grpc/service_frostfs_test.go
Normal file
71
netmap/grpc/service_frostfs_test.go
Normal file
|
@ -0,0 +1,71 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package netmap
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoLocalNodeInfoRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoLocalNodeInfoRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONLocalNodeInfoRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONLocalNodeInfoRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoLocalNodeInfoResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoLocalNodeInfoResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONLocalNodeInfoResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONLocalNodeInfoResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNetworkInfoRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNetworkInfoRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNetworkInfoRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNetworkInfoRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNetworkInfoResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNetworkInfoResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNetworkInfoResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNetworkInfoResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNetmapSnapshotRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNetmapSnapshotRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNetmapSnapshotRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNetmapSnapshotRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNetmapSnapshotResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNetmapSnapshotResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNetmapSnapshotResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNetmapSnapshotResponse(data)
|
||||
})
|
||||
}
|
8
netmap/grpc/service_grpc.pb.go
generated
8
netmap/grpc/service_grpc.pb.go
generated
|
@ -40,14 +40,14 @@ type NetmapServiceClient interface {
|
|||
// information about the server has been successfully read;
|
||||
// - Common failures (SECTION_FAILURE_COMMON).
|
||||
LocalNodeInfo(ctx context.Context, in *LocalNodeInfoRequest, opts ...grpc.CallOption) (*LocalNodeInfoResponse, error)
|
||||
// Read recent information about the NeoFS network.
|
||||
// Read recent information about the FrostFS network.
|
||||
//
|
||||
// Statuses:
|
||||
// - **OK** (0, SECTION_SUCCESS):
|
||||
// information about the current network state has been successfully read;
|
||||
// - Common failures (SECTION_FAILURE_COMMON).
|
||||
NetworkInfo(ctx context.Context, in *NetworkInfoRequest, opts ...grpc.CallOption) (*NetworkInfoResponse, error)
|
||||
// Returns network map snapshot of the current NeoFS epoch.
|
||||
// Returns network map snapshot of the current FrostFS epoch.
|
||||
//
|
||||
// Statuses:
|
||||
// - **OK** (0, SECTION_SUCCESS):
|
||||
|
@ -107,14 +107,14 @@ type NetmapServiceServer interface {
|
|||
// information about the server has been successfully read;
|
||||
// - Common failures (SECTION_FAILURE_COMMON).
|
||||
LocalNodeInfo(context.Context, *LocalNodeInfoRequest) (*LocalNodeInfoResponse, error)
|
||||
// Read recent information about the NeoFS network.
|
||||
// Read recent information about the FrostFS network.
|
||||
//
|
||||
// Statuses:
|
||||
// - **OK** (0, SECTION_SUCCESS):
|
||||
// information about the current network state has been successfully read;
|
||||
// - Common failures (SECTION_FAILURE_COMMON).
|
||||
NetworkInfo(context.Context, *NetworkInfoRequest) (*NetworkInfoResponse, error)
|
||||
// Returns network map snapshot of the current NeoFS epoch.
|
||||
// Returns network map snapshot of the current FrostFS epoch.
|
||||
//
|
||||
// Statuses:
|
||||
// - **OK** (0, SECTION_SUCCESS):
|
||||
|
|
|
@ -1,212 +0,0 @@
|
|||
package netmap
|
||||
|
||||
// SetReplicas of placement policy.
|
||||
func (m *PlacementPolicy) SetReplicas(v []*Replica) {
|
||||
m.Replicas = v
|
||||
}
|
||||
|
||||
// SetContainerBackupFactor of placement policy.
|
||||
func (m *PlacementPolicy) SetContainerBackupFactor(v uint32) {
|
||||
m.ContainerBackupFactor = v
|
||||
}
|
||||
|
||||
// SetSelectors of placement policy.
|
||||
func (m *PlacementPolicy) SetSelectors(v []*Selector) {
|
||||
m.Selectors = v
|
||||
}
|
||||
|
||||
// SetFilters of placement policy.
|
||||
func (m *PlacementPolicy) SetFilters(v []*Filter) {
|
||||
m.Filters = v
|
||||
}
|
||||
|
||||
// SetUnique of placement policy.
|
||||
func (m *PlacementPolicy) SetUnique(unique bool) {
|
||||
m.Unique = unique
|
||||
}
|
||||
|
||||
// SetName of placement filter.
|
||||
func (m *Filter) SetName(v string) {
|
||||
m.Name = v
|
||||
}
|
||||
|
||||
// SetKey of placement filter.
|
||||
func (m *Filter) SetKey(v string) {
|
||||
m.Key = v
|
||||
}
|
||||
|
||||
// SetOperation of placement filter.
|
||||
func (m *Filter) SetOp(v Operation) {
|
||||
m.Op = v
|
||||
}
|
||||
|
||||
// SetValue of placement filter.
|
||||
func (m *Filter) SetValue(v string) {
|
||||
m.Value = v
|
||||
}
|
||||
|
||||
// SetFilters sets sub-filters of placement filter.
|
||||
func (m *Filter) SetFilters(v []*Filter) {
|
||||
m.Filters = v
|
||||
}
|
||||
|
||||
// SetName of placement selector.
|
||||
func (m *Selector) SetName(v string) {
|
||||
m.Name = v
|
||||
}
|
||||
|
||||
// SetCount of nodes of placement selector.
|
||||
func (m *Selector) SetCount(v uint32) {
|
||||
m.Count = v
|
||||
}
|
||||
|
||||
// SetAttribute of nodes of placement selector.
|
||||
func (m *Selector) SetAttribute(v string) {
|
||||
m.Attribute = v
|
||||
}
|
||||
|
||||
// SetFilter of placement selector.
|
||||
func (m *Selector) SetFilter(v string) {
|
||||
m.Filter = v
|
||||
}
|
||||
|
||||
// SetClause of placement selector.
|
||||
func (m *Selector) SetClause(v Clause) {
|
||||
m.Clause = v
|
||||
}
|
||||
|
||||
// SetCount of object replica.
|
||||
func (m *Replica) SetCount(v uint32) {
|
||||
m.Count = v
|
||||
}
|
||||
|
||||
// SetSelector of object replica.
|
||||
func (m *Replica) SetSelector(v string) {
|
||||
m.Selector = v
|
||||
}
|
||||
|
||||
// SetKey sets key to the node attribute.
|
||||
func (m *NodeInfo_Attribute) SetKey(v string) {
|
||||
m.Key = v
|
||||
}
|
||||
|
||||
// SetValue sets value of the node attribute.
|
||||
func (m *NodeInfo_Attribute) SetValue(v string) {
|
||||
m.Value = v
|
||||
}
|
||||
|
||||
// SetParent sets value of the node parents.
|
||||
func (m *NodeInfo_Attribute) SetParents(v []string) {
|
||||
m.Parents = v
|
||||
}
|
||||
|
||||
// SetAddress sets node network address.
|
||||
//
|
||||
// Deprecated: use SetAddresses.
|
||||
func (m *NodeInfo) SetAddress(v string) {
|
||||
m.SetAddresses([]string{v})
|
||||
}
|
||||
|
||||
// SetAddresses sets list of network addresses of the node.
|
||||
func (m *NodeInfo) SetAddresses(v []string) {
|
||||
m.Addresses = v
|
||||
}
|
||||
|
||||
// SetPublicKey sets node public key in a binary format.
|
||||
func (m *NodeInfo) SetPublicKey(v []byte) {
|
||||
m.PublicKey = v
|
||||
}
|
||||
|
||||
// SetAttributes sets list of the node attributes.
|
||||
func (m *NodeInfo) SetAttributes(v []*NodeInfo_Attribute) {
|
||||
m.Attributes = v
|
||||
}
|
||||
|
||||
// SetState sets node state.
|
||||
func (m *NodeInfo) SetState(v NodeInfo_State) {
|
||||
m.State = v
|
||||
}
|
||||
|
||||
// SetCurrentEpoch sets number of the current epoch.
|
||||
func (x *NetworkInfo) SetCurrentEpoch(v uint64) {
|
||||
x.CurrentEpoch = v
|
||||
}
|
||||
|
||||
// SetMagicNumber sets magic number of the sidechain.
|
||||
func (x *NetworkInfo) SetMagicNumber(v uint64) {
|
||||
x.MagicNumber = v
|
||||
}
|
||||
|
||||
// SetMsPerBlock sets MillisecondsPerBlock network parameter.
|
||||
func (x *NetworkInfo) SetMsPerBlock(v int64) {
|
||||
x.MsPerBlock = v
|
||||
}
|
||||
|
||||
// SetNetworkConfig sets NeoFS network configuration.
|
||||
func (x *NetworkInfo) SetNetworkConfig(v *NetworkConfig) {
|
||||
x.NetworkConfig = v
|
||||
}
|
||||
|
||||
// FromString parses Clause from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *Clause) FromString(s string) bool {
|
||||
i, ok := Clause_value[s]
|
||||
if ok {
|
||||
*x = Clause(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// FromString parses Operation from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *Operation) FromString(s string) bool {
|
||||
i, ok := Operation_value[s]
|
||||
if ok {
|
||||
*x = Operation(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// FromString parses NodeInfo_State from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *NodeInfo_State) FromString(s string) bool {
|
||||
i, ok := NodeInfo_State_value[s]
|
||||
if ok {
|
||||
*x = NodeInfo_State(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetKey sets parameter key.
|
||||
func (x *NetworkConfig_Parameter) SetKey(v []byte) {
|
||||
x.Key = v
|
||||
}
|
||||
|
||||
// SetValue sets parameter value.
|
||||
func (x *NetworkConfig_Parameter) SetValue(v []byte) {
|
||||
x.Value = v
|
||||
}
|
||||
|
||||
// SetParameters sets NeoFS network parameters.
|
||||
func (x *NetworkConfig) SetParameters(v []*NetworkConfig_Parameter) {
|
||||
x.Parameters = v
|
||||
}
|
||||
|
||||
// SetEpoch sets revision number of the Netmap.
|
||||
func (x *Netmap) SetEpoch(v uint64) {
|
||||
x.Epoch = v
|
||||
}
|
||||
|
||||
// SetNodes sets nodes presented in the Netmap.
|
||||
func (x *Netmap) SetNodes(v []*NodeInfo) {
|
||||
x.Nodes = v
|
||||
}
|
1366
netmap/grpc/types.pb.go
generated
1366
netmap/grpc/types.pb.go
generated
File diff suppressed because it is too large
Load diff
2749
netmap/grpc/types_frostfs.pb.go
generated
Normal file
2749
netmap/grpc/types_frostfs.pb.go
generated
Normal file
File diff suppressed because it is too large
Load diff
159
netmap/grpc/types_frostfs_fuzz.go
Normal file
159
netmap/grpc/types_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,159 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package netmap
|
||||
|
||||
func DoFuzzProtoFilter(data []byte) int {
|
||||
msg := new(Filter)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONFilter(data []byte) int {
|
||||
msg := new(Filter)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoSelector(data []byte) int {
|
||||
msg := new(Selector)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONSelector(data []byte) int {
|
||||
msg := new(Selector)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoReplica(data []byte) int {
|
||||
msg := new(Replica)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONReplica(data []byte) int {
|
||||
msg := new(Replica)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoPlacementPolicy(data []byte) int {
|
||||
msg := new(PlacementPolicy)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONPlacementPolicy(data []byte) int {
|
||||
msg := new(PlacementPolicy)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNodeInfo(data []byte) int {
|
||||
msg := new(NodeInfo)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNodeInfo(data []byte) int {
|
||||
msg := new(NodeInfo)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNetmap(data []byte) int {
|
||||
msg := new(Netmap)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNetmap(data []byte) int {
|
||||
msg := new(Netmap)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNetworkConfig(data []byte) int {
|
||||
msg := new(NetworkConfig)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNetworkConfig(data []byte) int {
|
||||
msg := new(NetworkConfig)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNetworkInfo(data []byte) int {
|
||||
msg := new(NetworkInfo)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNetworkInfo(data []byte) int {
|
||||
msg := new(NetworkInfo)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
91
netmap/grpc/types_frostfs_test.go
Normal file
91
netmap/grpc/types_frostfs_test.go
Normal file
|
@ -0,0 +1,91 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package netmap
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoFilter(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoFilter(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONFilter(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONFilter(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoSelector(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoSelector(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONSelector(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONSelector(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoReplica(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoReplica(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONReplica(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONReplica(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoPlacementPolicy(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoPlacementPolicy(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONPlacementPolicy(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONPlacementPolicy(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNodeInfo(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNodeInfo(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNodeInfo(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNodeInfo(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNetmap(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNetmap(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNetmap(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNetmap(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNetworkConfig(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNetworkConfig(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNetworkConfig(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNetworkConfig(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNetworkInfo(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNetworkInfo(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNetworkInfo(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNetworkInfo(data)
|
||||
})
|
||||
}
|
|
@ -111,6 +111,7 @@ const (
|
|||
OR
|
||||
AND
|
||||
NOT
|
||||
LIKE
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -334,6 +335,10 @@ func (p *PlacementPolicy) SetContainerBackupFactor(backupFactor uint32) {
|
|||
}
|
||||
|
||||
func (p *PlacementPolicy) GetReplicas() []Replica {
|
||||
if p == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return p.replicas
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ func BenchmarkAttributesMarshal(b *testing.B) {
|
|||
|
||||
b.Run("marshal", func(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for range b.N {
|
||||
res := AttributesToGRPC(attrs)
|
||||
if len(res) != len(raw) {
|
||||
b.FailNow()
|
||||
|
@ -35,7 +35,7 @@ func BenchmarkAttributesMarshal(b *testing.B) {
|
|||
})
|
||||
b.Run("unmarshal", func(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for range b.N {
|
||||
res, err := AttributesFromGRPC(raw)
|
||||
if err != nil || len(res) != len(raw) {
|
||||
b.FailNow()
|
||||
|
|
|
@ -142,31 +142,29 @@ func (a *Attribute) FromGRPCMessage(m grpc.Message) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func AttributesToGRPC(xs []Attribute) (res []*object.Header_Attribute) {
|
||||
func AttributesToGRPC(xs []Attribute) (res []object.Header_Attribute) {
|
||||
if xs != nil {
|
||||
res = make([]*object.Header_Attribute, 0, len(xs))
|
||||
res = make([]object.Header_Attribute, 0, len(xs))
|
||||
|
||||
for i := range xs {
|
||||
res = append(res, xs[i].ToGRPCMessage().(*object.Header_Attribute))
|
||||
res = append(res, *xs[i].ToGRPCMessage().(*object.Header_Attribute))
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func AttributesFromGRPC(xs []*object.Header_Attribute) (res []Attribute, err error) {
|
||||
func AttributesFromGRPC(xs []object.Header_Attribute) (res []Attribute, err error) {
|
||||
if xs != nil {
|
||||
res = make([]Attribute, len(xs))
|
||||
|
||||
for i := range xs {
|
||||
if xs[i] != nil {
|
||||
err = res[i].FromGRPCMessage(xs[i])
|
||||
err = res[i].FromGRPCMessage(&xs[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -683,9 +681,9 @@ func (s *ECInfo) ToGRPCMessage() grpc.Message {
|
|||
m = new(object.ECInfo)
|
||||
|
||||
if s.Chunks != nil {
|
||||
chunks := make([]*object.ECInfo_Chunk, len(s.Chunks))
|
||||
chunks := make([]object.ECInfo_Chunk, len(s.Chunks))
|
||||
for i := range chunks {
|
||||
chunks[i] = s.Chunks[i].ToGRPCMessage().(*object.ECInfo_Chunk)
|
||||
chunks[i] = *s.Chunks[i].ToGRPCMessage().(*object.ECInfo_Chunk)
|
||||
}
|
||||
m.Chunks = chunks
|
||||
}
|
||||
|
@ -706,7 +704,7 @@ func (s *ECInfo) FromGRPCMessage(m grpc.Message) error {
|
|||
} else {
|
||||
s.Chunks = make([]ECChunk, len(chunks))
|
||||
for i := range chunks {
|
||||
if err := s.Chunks[i].FromGRPCMessage(chunks[i]); err != nil {
|
||||
if err := s.Chunks[i].FromGRPCMessage(&chunks[i]); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
@ -1626,31 +1624,29 @@ func (f *SearchFilter) FromGRPCMessage(m grpc.Message) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func SearchFiltersToGRPC(fs []SearchFilter) (res []*object.SearchRequest_Body_Filter) {
|
||||
func SearchFiltersToGRPC(fs []SearchFilter) (res []object.SearchRequest_Body_Filter) {
|
||||
if fs != nil {
|
||||
res = make([]*object.SearchRequest_Body_Filter, 0, len(fs))
|
||||
res = make([]object.SearchRequest_Body_Filter, 0, len(fs))
|
||||
|
||||
for i := range fs {
|
||||
res = append(res, fs[i].ToGRPCMessage().(*object.SearchRequest_Body_Filter))
|
||||
res = append(res, *fs[i].ToGRPCMessage().(*object.SearchRequest_Body_Filter))
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func SearchFiltersFromGRPC(fs []*object.SearchRequest_Body_Filter) (res []SearchFilter, err error) {
|
||||
func SearchFiltersFromGRPC(fs []object.SearchRequest_Body_Filter) (res []SearchFilter, err error) {
|
||||
if fs != nil {
|
||||
res = make([]SearchFilter, len(fs))
|
||||
|
||||
for i := range fs {
|
||||
if fs[i] != nil {
|
||||
err = res[i].FromGRPCMessage(fs[i])
|
||||
err = res[i].FromGRPCMessage(&fs[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -1827,31 +1823,29 @@ func (r *Range) FromGRPCMessage(m grpc.Message) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func RangesToGRPC(rs []Range) (res []*object.Range) {
|
||||
func RangesToGRPC(rs []Range) (res []object.Range) {
|
||||
if rs != nil {
|
||||
res = make([]*object.Range, 0, len(rs))
|
||||
res = make([]object.Range, 0, len(rs))
|
||||
|
||||
for i := range rs {
|
||||
res = append(res, rs[i].ToGRPCMessage().(*object.Range))
|
||||
res = append(res, *rs[i].ToGRPCMessage().(*object.Range))
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func RangesFromGRPC(rs []*object.Range) (res []Range, err error) {
|
||||
func RangesFromGRPC(rs []object.Range) (res []Range, err error) {
|
||||
if rs != nil {
|
||||
res = make([]Range, len(rs))
|
||||
|
||||
for i := range rs {
|
||||
if rs[i] != nil {
|
||||
err = res[i].FromGRPCMessage(rs[i])
|
||||
err = res[i].FromGRPCMessage(&rs[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -2345,3 +2339,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.GetRange().ToGRPCMessage().(*object.Range))
|
||||
m.SetChunk(r.GetChunk())
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *PatchRequestBodyPatch) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*object.PatchRequest_Body_Patch)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
srcRange := v.GetSourceRange()
|
||||
if srcRange == nil {
|
||||
r.Range = nil
|
||||
} else {
|
||||
if r.Range == nil {
|
||||
r.Range = new(Range)
|
||||
}
|
||||
|
||||
err = r.Range.FromGRPCMessage(srcRange)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
r.Chunk = v.GetChunk()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) ToGRPCMessage() grpc.Message {
|
||||
var m *object.PatchRequest_Body
|
||||
|
||||
if r != nil {
|
||||
m = new(object.PatchRequest_Body)
|
||||
|
||||
m.SetAddress(r.address.ToGRPCMessage().(*refsGRPC.Address))
|
||||
m.SetNewAttributes(AttributesToGRPC(r.newAttributes))
|
||||
m.SetReplaceAttributes(r.replaceAttributes)
|
||||
m.SetPatch(r.patch.ToGRPCMessage().(*object.PatchRequest_Body_Patch))
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*object.PatchRequest_Body)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
addr := v.GetAddress()
|
||||
if addr == nil {
|
||||
r.address = nil
|
||||
} else {
|
||||
if r.address == nil {
|
||||
r.address = new(refs.Address)
|
||||
}
|
||||
|
||||
err = r.address.FromGRPCMessage(addr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
r.newAttributes, err = AttributesFromGRPC(v.GetNewAttributes())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
r.replaceAttributes = v.GetReplaceAttributes()
|
||||
|
||||
patch := v.GetPatch()
|
||||
if patch == nil {
|
||||
r.patch = nil
|
||||
} else {
|
||||
if r.patch == nil {
|
||||
r.patch = new(PatchRequestBodyPatch)
|
||||
}
|
||||
|
||||
err = r.patch.FromGRPCMessage(patch)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *PatchRequest) ToGRPCMessage() grpc.Message {
|
||||
var m *object.PatchRequest
|
||||
|
||||
if r != nil {
|
||||
m = new(object.PatchRequest)
|
||||
|
||||
m.SetBody(r.body.ToGRPCMessage().(*object.PatchRequest_Body))
|
||||
r.RequestHeaders.ToMessage(m)
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *PatchRequest) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*object.PatchRequest)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
body := v.GetBody()
|
||||
if body == nil {
|
||||
r.body = nil
|
||||
} else {
|
||||
if r.body == nil {
|
||||
r.body = new(PatchRequestBody)
|
||||
}
|
||||
|
||||
err = r.body.FromGRPCMessage(body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return r.RequestHeaders.FromMessage(v)
|
||||
}
|
||||
|
||||
func (r *PatchResponseBody) ToGRPCMessage() grpc.Message {
|
||||
var m *object.PatchResponse_Body
|
||||
|
||||
if r != nil {
|
||||
m = new(object.PatchResponse_Body)
|
||||
|
||||
m.SetObjectId(r.ObjectID.ToGRPCMessage().(*refsGRPC.ObjectID))
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *PatchResponseBody) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*object.PatchResponse_Body)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
objID := v.GetObjectId()
|
||||
if objID == nil {
|
||||
r.ObjectID = nil
|
||||
} else {
|
||||
if r.ObjectID == nil {
|
||||
r.ObjectID = new(refs.ObjectID)
|
||||
}
|
||||
|
||||
err = r.ObjectID.FromGRPCMessage(objID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *PatchResponse) ToGRPCMessage() grpc.Message {
|
||||
var m *object.PatchResponse
|
||||
|
||||
if r != nil {
|
||||
m = new(object.PatchResponse)
|
||||
|
||||
m.SetBody(r.Body.ToGRPCMessage().(*object.PatchResponse_Body))
|
||||
r.ResponseHeaders.ToMessage(m)
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *PatchResponse) FromGRPCMessage(m grpc.Message) error {
|
||||
v, ok := m.(*object.PatchResponse)
|
||||
if !ok {
|
||||
return message.NewUnexpectedMessageType(m, v)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
body := v.GetBody()
|
||||
if body == nil {
|
||||
r.Body = nil
|
||||
} else {
|
||||
if r.Body == nil {
|
||||
r.Body = new(PatchResponseBody)
|
||||
}
|
||||
|
||||
err = r.Body.FromGRPCMessage(body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return r.ResponseHeaders.FromMessage(v)
|
||||
}
|
||||
|
|
|
@ -1,558 +0,0 @@
|
|||
package object
|
||||
|
||||
import (
|
||||
refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc"
|
||||
)
|
||||
|
||||
// SetAddress sets address of the requested object.
|
||||
func (m *GetRequest_Body) SetAddress(v *refs.Address) {
|
||||
m.Address = v
|
||||
}
|
||||
|
||||
// SetRaw sets raw flag of the request.
|
||||
func (m *GetRequest_Body) SetRaw(v bool) {
|
||||
m.Raw = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *GetRequest) SetBody(v *GetRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *GetRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *GetRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetObjectId sets identifier of the object.
|
||||
func (m *GetResponse_Body_Init) SetObjectId(v *refs.ObjectID) {
|
||||
m.ObjectId = v
|
||||
}
|
||||
|
||||
// SetSignature sets signature of the object identifier.
|
||||
func (m *GetResponse_Body_Init) SetSignature(v *refs.Signature) {
|
||||
m.Signature = v
|
||||
}
|
||||
|
||||
// SetHeader sets header of the object.
|
||||
func (m *GetResponse_Body_Init) SetHeader(v *Header) {
|
||||
m.Header = v
|
||||
}
|
||||
|
||||
// GetChunk returns chunk of the object payload bytes.
|
||||
func (m *GetResponse_Body_Chunk) GetChunk() []byte {
|
||||
if m != nil {
|
||||
return m.Chunk
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetChunk sets chunk of the object payload bytes.
|
||||
func (m *GetResponse_Body_Chunk) SetChunk(v []byte) {
|
||||
m.Chunk = v
|
||||
}
|
||||
|
||||
// SetInit sets initial part of the object.
|
||||
func (m *GetResponse_Body) SetInit(v *GetResponse_Body_Init) {
|
||||
m.ObjectPart = &GetResponse_Body_Init_{
|
||||
Init: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetChunk sets part of the object payload.
|
||||
func (m *GetResponse_Body) SetChunk(v *GetResponse_Body_Chunk) {
|
||||
m.ObjectPart = v
|
||||
}
|
||||
|
||||
// SetSplitInfo sets part of the object payload.
|
||||
func (m *GetResponse_Body) SetSplitInfo(v *SplitInfo) {
|
||||
m.ObjectPart = &GetResponse_Body_SplitInfo{
|
||||
SplitInfo: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetEcInfo sets part of the object payload.
|
||||
func (m *GetResponse_Body) SetEcInfo(v *ECInfo) {
|
||||
m.ObjectPart = &GetResponse_Body_EcInfo{
|
||||
EcInfo: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *GetResponse) SetBody(v *GetResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *GetResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *GetResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetObjectId sets identifier of the object.
|
||||
func (m *PutRequest_Body_Init) SetObjectId(v *refs.ObjectID) {
|
||||
m.ObjectId = v
|
||||
}
|
||||
|
||||
// SetSignature sets signature of the object identifier.
|
||||
func (m *PutRequest_Body_Init) SetSignature(v *refs.Signature) {
|
||||
m.Signature = v
|
||||
}
|
||||
|
||||
// SetHeader sets header of the object.
|
||||
func (m *PutRequest_Body_Init) SetHeader(v *Header) {
|
||||
m.Header = v
|
||||
}
|
||||
|
||||
// SetCopiesNumber sets number of the copies to save.
|
||||
func (m *PutRequest_Body_Init) SetCopiesNumber(v []uint32) {
|
||||
m.CopiesNumber = v
|
||||
}
|
||||
|
||||
// GetChunk returns chunk of the object payload bytes.
|
||||
func (m *PutRequest_Body_Chunk) GetChunk() []byte {
|
||||
if m != nil {
|
||||
return m.Chunk
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetChunk sets chunk of the object payload bytes.
|
||||
func (m *PutRequest_Body_Chunk) SetChunk(v []byte) {
|
||||
m.Chunk = v
|
||||
}
|
||||
|
||||
// SetInit sets initial part of the object.
|
||||
func (m *PutRequest_Body) SetInit(v *PutRequest_Body_Init) {
|
||||
m.ObjectPart = &PutRequest_Body_Init_{
|
||||
Init: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetChunk sets part of the object payload.
|
||||
func (m *PutRequest_Body) SetChunk(v *PutRequest_Body_Chunk) {
|
||||
m.ObjectPart = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *PutRequest) SetBody(v *PutRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *PutRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *PutRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetObjectId sets identifier of the saved object.
|
||||
func (m *PutResponse_Body) SetObjectId(v *refs.ObjectID) {
|
||||
m.ObjectId = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *PutResponse) SetBody(v *PutResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *PutResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *PutResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetAddress sets address of the object to delete.
|
||||
func (m *DeleteRequest_Body) SetAddress(v *refs.Address) {
|
||||
m.Address = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *DeleteRequest) SetBody(v *DeleteRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *DeleteRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *DeleteRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetTombstone sets tombstone address.
|
||||
func (x *DeleteResponse_Body) SetTombstone(v *refs.Address) {
|
||||
x.Tombstone = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *DeleteResponse) SetBody(v *DeleteResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *DeleteResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *DeleteResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetAddress sets address of the object with the requested header.
|
||||
func (m *HeadRequest_Body) SetAddress(v *refs.Address) {
|
||||
m.Address = v
|
||||
}
|
||||
|
||||
// SetMainOnly sets flag to return the minimal header subset.
|
||||
func (m *HeadRequest_Body) SetMainOnly(v bool) {
|
||||
m.MainOnly = v
|
||||
}
|
||||
|
||||
// SetRaw sets raw flag of the request.
|
||||
func (m *HeadRequest_Body) SetRaw(v bool) {
|
||||
m.Raw = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *HeadRequest) SetBody(v *HeadRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *HeadRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *HeadRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetHeader sets object header.
|
||||
func (m *HeaderWithSignature) SetHeader(v *Header) {
|
||||
m.Header = v
|
||||
}
|
||||
|
||||
// SetSignature of the header.
|
||||
func (m *HeaderWithSignature) SetSignature(v *refs.Signature) {
|
||||
m.Signature = v
|
||||
}
|
||||
|
||||
// SetHeader sets full header of the object.
|
||||
func (m *HeadResponse_Body) SetHeader(v *HeaderWithSignature) {
|
||||
m.Head = &HeadResponse_Body_Header{
|
||||
Header: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetShortHeader sets short header of the object.
|
||||
func (m *HeadResponse_Body) SetShortHeader(v *ShortHeader) {
|
||||
m.Head = &HeadResponse_Body_ShortHeader{
|
||||
ShortHeader: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetSplitInfo sets meta info about split hierarchy of the object.
|
||||
func (m *HeadResponse_Body) SetSplitInfo(v *SplitInfo) {
|
||||
m.Head = &HeadResponse_Body_SplitInfo{
|
||||
SplitInfo: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetEcInfo sets meta info about the erasure coded object.
|
||||
func (m *HeadResponse_Body) SetEcInfo(v *ECInfo) {
|
||||
m.Head = &HeadResponse_Body_EcInfo{
|
||||
EcInfo: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *HeadResponse) SetBody(v *HeadResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *HeadResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *HeadResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetMatchType sets match type of the filter.
|
||||
func (m *SearchRequest_Body_Filter) SetMatchType(v MatchType) {
|
||||
m.MatchType = v
|
||||
}
|
||||
|
||||
// SetKey sets key to the filtering header.
|
||||
func (m *SearchRequest_Body_Filter) SetKey(v string) {
|
||||
m.Key = v
|
||||
}
|
||||
|
||||
// SetValue sets value of the filtering header.
|
||||
func (m *SearchRequest_Body_Filter) SetValue(v string) {
|
||||
m.Value = v
|
||||
}
|
||||
|
||||
// SetVersion sets version of the search query.
|
||||
func (m *SearchRequest_Body) SetVersion(v uint32) {
|
||||
m.Version = v
|
||||
}
|
||||
|
||||
// SetFilters sets list of the query filters.
|
||||
func (m *SearchRequest_Body) SetFilters(v []*SearchRequest_Body_Filter) {
|
||||
m.Filters = v
|
||||
}
|
||||
|
||||
// SetContainerId sets container ID of the search requets.
|
||||
func (m *SearchRequest_Body) SetContainerId(v *refs.ContainerID) {
|
||||
m.ContainerId = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *SearchRequest) SetBody(v *SearchRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *SearchRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *SearchRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetIdList sets list of the identifiers of the matched objects.
|
||||
func (m *SearchResponse_Body) SetIdList(v []*refs.ObjectID) {
|
||||
m.IdList = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *SearchResponse) SetBody(v *SearchResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *SearchResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *SearchResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetOffset sets offset of the payload range.
|
||||
func (m *Range) SetOffset(v uint64) {
|
||||
m.Offset = v
|
||||
}
|
||||
|
||||
// SetLength sets length of the payload range.
|
||||
func (m *Range) SetLength(v uint64) {
|
||||
m.Length = v
|
||||
}
|
||||
|
||||
// SetAddress sets address of the object with the request payload range.
|
||||
func (m *GetRangeRequest_Body) SetAddress(v *refs.Address) {
|
||||
m.Address = v
|
||||
}
|
||||
|
||||
// SetRange sets range of the object payload.
|
||||
func (m *GetRangeRequest_Body) SetRange(v *Range) {
|
||||
m.Range = v
|
||||
}
|
||||
|
||||
// SetRaw sets raw flag of the request.
|
||||
func (m *GetRangeRequest_Body) SetRaw(v bool) {
|
||||
m.Raw = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *GetRangeRequest) SetBody(v *GetRangeRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *GetRangeRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *GetRangeRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// GetChunk returns chunk of the object payload range bytes.
|
||||
func (m *GetRangeResponse_Body_Chunk) GetChunk() []byte {
|
||||
if m != nil {
|
||||
return m.Chunk
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetChunk sets chunk of the object payload range bytes.
|
||||
func (m *GetRangeResponse_Body_Chunk) SetChunk(v []byte) {
|
||||
m.Chunk = v
|
||||
}
|
||||
|
||||
// SetChunk sets chunk of the object payload.
|
||||
func (m *GetRangeResponse_Body) SetChunk(v *GetRangeResponse_Body_Chunk) {
|
||||
m.RangePart = v
|
||||
}
|
||||
|
||||
// SetSplitInfo sets meta info about split hierarchy of the object.
|
||||
func (m *GetRangeResponse_Body) SetSplitInfo(v *SplitInfo) {
|
||||
m.RangePart = &GetRangeResponse_Body_SplitInfo{
|
||||
SplitInfo: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetEcInfo sets meta info about the erasure-coded object.
|
||||
func (m *GetRangeResponse_Body) SetEcInfo(v *ECInfo) {
|
||||
m.RangePart = &GetRangeResponse_Body_EcInfo{
|
||||
EcInfo: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *GetRangeResponse) SetBody(v *GetRangeResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *GetRangeResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *GetRangeResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetAddress sets address of the object with the request payload range.
|
||||
func (m *GetRangeHashRequest_Body) SetAddress(v *refs.Address) {
|
||||
m.Address = v
|
||||
}
|
||||
|
||||
// SetRanges sets list of the ranges of the object payload.
|
||||
func (m *GetRangeHashRequest_Body) SetRanges(v []*Range) {
|
||||
m.Ranges = v
|
||||
}
|
||||
|
||||
// SetSalt sets salt for the object payload ranges.
|
||||
func (m *GetRangeHashRequest_Body) SetSalt(v []byte) {
|
||||
m.Salt = v
|
||||
}
|
||||
|
||||
// Set sets salt for the object payload ranges.
|
||||
func (m *GetRangeHashRequest_Body) SetType(v refs.ChecksumType) {
|
||||
m.Type = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *GetRangeHashRequest) SetBody(v *GetRangeHashRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *GetRangeHashRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *GetRangeHashRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetHashList returns list of the range hashes.
|
||||
func (m *GetRangeHashResponse_Body) SetHashList(v [][]byte) {
|
||||
m.HashList = v
|
||||
}
|
||||
|
||||
// SetHashList returns list of the range hashes.
|
||||
func (m *GetRangeHashResponse_Body) SetType(v refs.ChecksumType) {
|
||||
m.Type = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *GetRangeHashResponse) SetBody(v *GetRangeHashResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *GetRangeHashResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *GetRangeHashResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetObject set object of the body.
|
||||
func (m *PutSingleRequest_Body) SetObject(o *Object) {
|
||||
m.Object = o
|
||||
}
|
||||
|
||||
// SetCopiesNumber sets copies number of the body.
|
||||
func (m *PutSingleRequest_Body) SetCopiesNumber(v []uint32) {
|
||||
m.CopiesNumber = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *PutSingleRequest) SetBody(b *PutSingleRequest_Body) {
|
||||
m.Body = b
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *PutSingleRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *PutSingleRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *PutSingleResponse) SetBody(b *PutSingleResponse_Body) {
|
||||
m.Body = b
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *PutSingleResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *PutSingleResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
3777
object/grpc/service.pb.go
generated
3777
object/grpc/service.pb.go
generated
File diff suppressed because it is too large
Load diff
9389
object/grpc/service_frostfs.pb.go
generated
Normal file
9389
object/grpc/service_frostfs.pb.go
generated
Normal file
File diff suppressed because it is too large
Load diff
387
object/grpc/service_frostfs_fuzz.go
Normal file
387
object/grpc/service_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,387 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package object
|
||||
|
||||
func DoFuzzProtoGetRequest(data []byte) int {
|
||||
msg := new(GetRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONGetRequest(data []byte) int {
|
||||
msg := new(GetRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoGetResponse(data []byte) int {
|
||||
msg := new(GetResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONGetResponse(data []byte) int {
|
||||
msg := new(GetResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoPutRequest(data []byte) int {
|
||||
msg := new(PutRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONPutRequest(data []byte) int {
|
||||
msg := new(PutRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoPutResponse(data []byte) int {
|
||||
msg := new(PutResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONPutResponse(data []byte) int {
|
||||
msg := new(PutResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoDeleteRequest(data []byte) int {
|
||||
msg := new(DeleteRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONDeleteRequest(data []byte) int {
|
||||
msg := new(DeleteRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoDeleteResponse(data []byte) int {
|
||||
msg := new(DeleteResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONDeleteResponse(data []byte) int {
|
||||
msg := new(DeleteResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoHeadRequest(data []byte) int {
|
||||
msg := new(HeadRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONHeadRequest(data []byte) int {
|
||||
msg := new(HeadRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoHeaderWithSignature(data []byte) int {
|
||||
msg := new(HeaderWithSignature)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONHeaderWithSignature(data []byte) int {
|
||||
msg := new(HeaderWithSignature)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoHeadResponse(data []byte) int {
|
||||
msg := new(HeadResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONHeadResponse(data []byte) int {
|
||||
msg := new(HeadResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoSearchRequest(data []byte) int {
|
||||
msg := new(SearchRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONSearchRequest(data []byte) int {
|
||||
msg := new(SearchRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoSearchResponse(data []byte) int {
|
||||
msg := new(SearchResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONSearchResponse(data []byte) int {
|
||||
msg := new(SearchResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoRange(data []byte) int {
|
||||
msg := new(Range)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONRange(data []byte) int {
|
||||
msg := new(Range)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoGetRangeRequest(data []byte) int {
|
||||
msg := new(GetRangeRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONGetRangeRequest(data []byte) int {
|
||||
msg := new(GetRangeRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoGetRangeResponse(data []byte) int {
|
||||
msg := new(GetRangeResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONGetRangeResponse(data []byte) int {
|
||||
msg := new(GetRangeResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoGetRangeHashRequest(data []byte) int {
|
||||
msg := new(GetRangeHashRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONGetRangeHashRequest(data []byte) int {
|
||||
msg := new(GetRangeHashRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoGetRangeHashResponse(data []byte) int {
|
||||
msg := new(GetRangeHashResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONGetRangeHashResponse(data []byte) int {
|
||||
msg := new(GetRangeHashResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoPutSingleRequest(data []byte) int {
|
||||
msg := new(PutSingleRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONPutSingleRequest(data []byte) int {
|
||||
msg := new(PutSingleRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoPutSingleResponse(data []byte) int {
|
||||
msg := new(PutSingleResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONPutSingleResponse(data []byte) int {
|
||||
msg := new(PutSingleResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoPatchRequest(data []byte) int {
|
||||
msg := new(PatchRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONPatchRequest(data []byte) int {
|
||||
msg := new(PatchRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoPatchResponse(data []byte) int {
|
||||
msg := new(PatchResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONPatchResponse(data []byte) int {
|
||||
msg := new(PatchResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
211
object/grpc/service_frostfs_test.go
Normal file
211
object/grpc/service_frostfs_test.go
Normal file
|
@ -0,0 +1,211 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package object
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoGetRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoGetRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONGetRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONGetRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoGetResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoGetResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONGetResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONGetResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoPutRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoPutRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONPutRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONPutRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoPutResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoPutResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONPutResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONPutResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoDeleteRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoDeleteRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONDeleteRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONDeleteRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoDeleteResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoDeleteResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONDeleteResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONDeleteResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoHeadRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoHeadRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONHeadRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONHeadRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoHeaderWithSignature(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoHeaderWithSignature(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONHeaderWithSignature(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONHeaderWithSignature(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoHeadResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoHeadResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONHeadResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONHeadResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoSearchRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoSearchRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONSearchRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONSearchRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoSearchResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoSearchResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONSearchResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONSearchResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoRange(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoRange(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONRange(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONRange(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoGetRangeRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoGetRangeRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONGetRangeRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONGetRangeRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoGetRangeResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoGetRangeResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONGetRangeResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONGetRangeResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoGetRangeHashRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoGetRangeHashRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONGetRangeHashRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONGetRangeHashRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoGetRangeHashResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoGetRangeHashResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONGetRangeHashResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONGetRangeHashResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoPutSingleRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoPutSingleRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONPutSingleRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONPutSingleRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoPutSingleResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoPutSingleResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONPutSingleResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONPutSingleResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoPatchRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoPatchRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONPatchRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONPatchRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoPatchResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoPatchResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONPatchResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONPatchResponse(data)
|
||||
})
|
||||
}
|
169
object/grpc/service_grpc.pb.go
generated
169
object/grpc/service_grpc.pb.go
generated
|
@ -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.
|
||||
|
@ -169,7 +170,7 @@ type ObjectServiceClient interface {
|
|||
// provided session token has expired.
|
||||
Head(ctx context.Context, in *HeadRequest, opts ...grpc.CallOption) (*HeadResponse, error)
|
||||
// Search objects in container. Search query allows to match by Object
|
||||
// Header's filed values. Please see the corresponding NeoFS Technical
|
||||
// Header's filed values. Please see the corresponding FrostFS Technical
|
||||
// Specification section for more details.
|
||||
//
|
||||
// Extended headers can change `Search` behaviour:
|
||||
|
@ -299,6 +300,54 @@ 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 +524,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
|
||||
|
@ -615,7 +698,7 @@ type ObjectServiceServer interface {
|
|||
// provided session token has expired.
|
||||
Head(context.Context, *HeadRequest) (*HeadResponse, error)
|
||||
// Search objects in container. Search query allows to match by Object
|
||||
// Header's filed values. Please see the corresponding NeoFS Technical
|
||||
// Header's filed values. Please see the corresponding FrostFS Technical
|
||||
// Specification section for more details.
|
||||
//
|
||||
// Extended headers can change `Search` behaviour:
|
||||
|
@ -745,6 +828,54 @@ 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 +906,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 +1082,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 +1153,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",
|
||||
}
|
||||
|
|
251
object/grpc/status.pb.go
generated
251
object/grpc/status.pb.go
generated
|
@ -1,251 +0,0 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc v3.18.0
|
||||
// source: v2/object/grpc/status.proto
|
||||
|
||||
package object
|
||||
|
||||
import (
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
|
||||
grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type StatusCommon int32
|
||||
|
||||
const (
|
||||
StatusCommon_ACCESS_DENIED StatusCommon = 0
|
||||
)
|
||||
|
||||
// Enum value maps for StatusCommon.
|
||||
var (
|
||||
StatusCommon_name = map[int32]string{
|
||||
0: "ACCESS_DENIED",
|
||||
}
|
||||
StatusCommon_value = map[string]int32{
|
||||
"ACCESS_DENIED": 0,
|
||||
}
|
||||
)
|
||||
|
||||
func (x StatusCommon) Enum() *StatusCommon {
|
||||
p := new(StatusCommon)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x StatusCommon) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (StatusCommon) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_v2_object_grpc_status_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (StatusCommon) Type() protoreflect.EnumType {
|
||||
return &file_v2_object_grpc_status_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x StatusCommon) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StatusCommon.Descriptor instead.
|
||||
func (StatusCommon) EnumDescriptor() ([]byte, []int) {
|
||||
return file_v2_object_grpc_status_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type StatusPut int32
|
||||
|
||||
const (
|
||||
StatusPut_STATUS_PUT_INCOMPLETE StatusPut = 0
|
||||
)
|
||||
|
||||
// Enum value maps for StatusPut.
|
||||
var (
|
||||
StatusPut_name = map[int32]string{
|
||||
0: "STATUS_PUT_INCOMPLETE",
|
||||
}
|
||||
StatusPut_value = map[string]int32{
|
||||
"STATUS_PUT_INCOMPLETE": 0,
|
||||
}
|
||||
)
|
||||
|
||||
func (x StatusPut) Enum() *StatusPut {
|
||||
p := new(StatusPut)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x StatusPut) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (StatusPut) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_v2_object_grpc_status_proto_enumTypes[1].Descriptor()
|
||||
}
|
||||
|
||||
func (StatusPut) Type() protoreflect.EnumType {
|
||||
return &file_v2_object_grpc_status_proto_enumTypes[1]
|
||||
}
|
||||
|
||||
func (x StatusPut) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StatusPut.Descriptor instead.
|
||||
func (StatusPut) EnumDescriptor() ([]byte, []int) {
|
||||
return file_v2_object_grpc_status_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
type PutIncompleteDetail struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Statuses []*grpc.Status `protobuf:"bytes,1,rep,name=statuses,proto3" json:"statuses,omitempty"`
|
||||
}
|
||||
|
||||
func (x *PutIncompleteDetail) Reset() {
|
||||
*x = PutIncompleteDetail{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_v2_object_grpc_status_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PutIncompleteDetail) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PutIncompleteDetail) ProtoMessage() {}
|
||||
|
||||
func (x *PutIncompleteDetail) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_v2_object_grpc_status_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use PutIncompleteDetail.ProtoReflect.Descriptor instead.
|
||||
func (*PutIncompleteDetail) Descriptor() ([]byte, []int) {
|
||||
return file_v2_object_grpc_status_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *PutIncompleteDetail) GetStatuses() []*grpc.Status {
|
||||
if x != nil {
|
||||
return x.Statuses
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_v2_object_grpc_status_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_v2_object_grpc_status_proto_rawDesc = []byte{
|
||||
0x0a, 0x1b, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63,
|
||||
0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6e,
|
||||
0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x1a,
|
||||
0x1a, 0x76, 0x32, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f,
|
||||
0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4b, 0x0a, 0x13, 0x50,
|
||||
0x75, 0x74, 0x49, 0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x65, 0x74, 0x61,
|
||||
0x69, 0x6c, 0x12, 0x34, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x01,
|
||||
0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32,
|
||||
0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x08,
|
||||
0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x2a, 0x21, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74,
|
||||
0x75, 0x73, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x43, 0x43, 0x45,
|
||||
0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x00, 0x2a, 0x26, 0x0a, 0x09, 0x53,
|
||||
0x74, 0x61, 0x74, 0x75, 0x73, 0x50, 0x75, 0x74, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x54, 0x41, 0x54,
|
||||
0x55, 0x53, 0x5f, 0x50, 0x55, 0x54, 0x5f, 0x49, 0x4e, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54,
|
||||
0x45, 0x10, 0x00, 0x42, 0x56, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
||||
0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x6e, 0x65, 0x6f, 0x66,
|
||||
0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65,
|
||||
0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02,
|
||||
0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65,
|
||||
0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_v2_object_grpc_status_proto_rawDescOnce sync.Once
|
||||
file_v2_object_grpc_status_proto_rawDescData = file_v2_object_grpc_status_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_v2_object_grpc_status_proto_rawDescGZIP() []byte {
|
||||
file_v2_object_grpc_status_proto_rawDescOnce.Do(func() {
|
||||
file_v2_object_grpc_status_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2_object_grpc_status_proto_rawDescData)
|
||||
})
|
||||
return file_v2_object_grpc_status_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_v2_object_grpc_status_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
||||
var file_v2_object_grpc_status_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_v2_object_grpc_status_proto_goTypes = []interface{}{
|
||||
(StatusCommon)(0), // 0: neo.fs.v2.object.StatusCommon
|
||||
(StatusPut)(0), // 1: neo.fs.v2.object.StatusPut
|
||||
(*PutIncompleteDetail)(nil), // 2: neo.fs.v2.object.PutIncompleteDetail
|
||||
(*grpc.Status)(nil), // 3: neo.fs.v2.status.Status
|
||||
}
|
||||
var file_v2_object_grpc_status_proto_depIdxs = []int32{
|
||||
3, // 0: neo.fs.v2.object.PutIncompleteDetail.statuses:type_name -> neo.fs.v2.status.Status
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_v2_object_grpc_status_proto_init() }
|
||||
func file_v2_object_grpc_status_proto_init() {
|
||||
if File_v2_object_grpc_status_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_v2_object_grpc_status_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PutIncompleteDetail); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_v2_object_grpc_status_proto_rawDesc,
|
||||
NumEnums: 2,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_v2_object_grpc_status_proto_goTypes,
|
||||
DependencyIndexes: file_v2_object_grpc_status_proto_depIdxs,
|
||||
EnumInfos: file_v2_object_grpc_status_proto_enumTypes,
|
||||
MessageInfos: file_v2_object_grpc_status_proto_msgTypes,
|
||||
}.Build()
|
||||
File_v2_object_grpc_status_proto = out.File
|
||||
file_v2_object_grpc_status_proto_rawDesc = nil
|
||||
file_v2_object_grpc_status_proto_goTypes = nil
|
||||
file_v2_object_grpc_status_proto_depIdxs = nil
|
||||
}
|
|
@ -1,197 +0,0 @@
|
|||
package object
|
||||
|
||||
import (
|
||||
refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc"
|
||||
)
|
||||
|
||||
// SetKey sets key to the object attribute.
|
||||
func (m *Header_Attribute) SetKey(v string) {
|
||||
m.Key = v
|
||||
}
|
||||
|
||||
// SetValue sets value of the object attribute.
|
||||
func (m *Header_Attribute) SetValue(v string) {
|
||||
m.Value = v
|
||||
}
|
||||
|
||||
// SetParent sets identifier of the parent object.
|
||||
func (m *Header_Split) SetParent(v *refs.ObjectID) {
|
||||
m.Parent = v
|
||||
}
|
||||
|
||||
// SetPrevious sets identifier of the previous object in split-chain.
|
||||
func (m *Header_Split) SetPrevious(v *refs.ObjectID) {
|
||||
m.Previous = v
|
||||
}
|
||||
|
||||
// SetParentSignature sets signature of the parent object header.
|
||||
func (m *Header_Split) SetParentSignature(v *refs.Signature) {
|
||||
m.ParentSignature = v
|
||||
}
|
||||
|
||||
// SetParentHeader sets parent header structure.
|
||||
func (m *Header_Split) SetParentHeader(v *Header) {
|
||||
m.ParentHeader = v
|
||||
}
|
||||
|
||||
// SetChildren sets list of the identifiers of the child objects.
|
||||
func (m *Header_Split) SetChildren(v []*refs.ObjectID) {
|
||||
m.Children = v
|
||||
}
|
||||
|
||||
// SetSplitId sets split ID of the object.
|
||||
func (m *Header_Split) SetSplitId(v []byte) {
|
||||
m.SplitId = v
|
||||
}
|
||||
|
||||
// SetContainerId sets identifier of the container.
|
||||
func (m *Header) SetContainerId(v *refs.ContainerID) {
|
||||
m.ContainerId = v
|
||||
}
|
||||
|
||||
// SetOwnerId sets identifier of the object owner.
|
||||
func (m *Header) SetOwnerId(v *refs.OwnerID) {
|
||||
m.OwnerId = v
|
||||
}
|
||||
|
||||
// SetCreationEpoch sets creation epoch number.
|
||||
func (m *Header) SetCreationEpoch(v uint64) {
|
||||
m.CreationEpoch = v
|
||||
}
|
||||
|
||||
// SetVersion sets version of the object format.
|
||||
func (m *Header) SetVersion(v *refs.Version) {
|
||||
m.Version = v
|
||||
}
|
||||
|
||||
// SetPayloadLength sets length of the object payload.
|
||||
func (m *Header) SetPayloadLength(v uint64) {
|
||||
m.PayloadLength = v
|
||||
}
|
||||
|
||||
// SetPayloadHash sets hash of the object payload.
|
||||
func (m *Header) SetPayloadHash(v *refs.Checksum) {
|
||||
m.PayloadHash = v
|
||||
}
|
||||
|
||||
// SetObjectType sets type of the object.
|
||||
func (m *Header) SetObjectType(v ObjectType) {
|
||||
m.ObjectType = v
|
||||
}
|
||||
|
||||
// SetHomomorphicHash sets homomorphic hash of the object payload.
|
||||
func (m *Header) SetHomomorphicHash(v *refs.Checksum) {
|
||||
m.HomomorphicHash = v
|
||||
}
|
||||
|
||||
// SetSessionToken sets session token.
|
||||
func (m *Header) SetSessionToken(v *session.SessionToken) {
|
||||
m.SessionToken = v
|
||||
}
|
||||
|
||||
// SetAttributes sets list of the object attributes.
|
||||
func (m *Header) SetAttributes(v []*Header_Attribute) {
|
||||
m.Attributes = v
|
||||
}
|
||||
|
||||
// SetSplit sets split header.
|
||||
func (m *Header) SetSplit(v *Header_Split) {
|
||||
m.Split = v
|
||||
}
|
||||
|
||||
// SetObjectId sets identifier of the object.
|
||||
func (m *Object) SetObjectId(v *refs.ObjectID) {
|
||||
m.ObjectId = v
|
||||
}
|
||||
|
||||
// SetSignature sets signature of the object identifier.
|
||||
func (m *Object) SetSignature(v *refs.Signature) {
|
||||
m.Signature = v
|
||||
}
|
||||
|
||||
// SetHeader sets header of the object.
|
||||
func (m *Object) SetHeader(v *Header) {
|
||||
m.Header = v
|
||||
}
|
||||
|
||||
// SetPayload sets payload bytes of the object.
|
||||
func (m *Object) SetPayload(v []byte) {
|
||||
m.Payload = v
|
||||
}
|
||||
|
||||
// SetVersion sets version of the object.
|
||||
func (m *ShortHeader) SetVersion(v *refs.Version) {
|
||||
m.Version = v
|
||||
}
|
||||
|
||||
// SetCreationEpoch sets creation epoch number.
|
||||
func (m *ShortHeader) SetCreationEpoch(v uint64) {
|
||||
m.CreationEpoch = v
|
||||
}
|
||||
|
||||
// SetOwnerId sets identifier of the object owner.
|
||||
func (m *ShortHeader) SetOwnerId(v *refs.OwnerID) {
|
||||
m.OwnerId = v
|
||||
}
|
||||
|
||||
// SetObjectType sets type of the object.
|
||||
func (m *ShortHeader) SetObjectType(v ObjectType) {
|
||||
m.ObjectType = v
|
||||
}
|
||||
|
||||
// SetPayloadLength sets length of the object payload.
|
||||
func (m *ShortHeader) SetPayloadLength(v uint64) {
|
||||
m.PayloadLength = v
|
||||
}
|
||||
|
||||
// SetPayloadHash sets hash of the object payload.
|
||||
func (m *ShortHeader) SetPayloadHash(v *refs.Checksum) {
|
||||
m.PayloadHash = v
|
||||
}
|
||||
|
||||
// SetHomomorphicHash sets homomorphic hash of the object payload.
|
||||
func (m *ShortHeader) SetHomomorphicHash(v *refs.Checksum) {
|
||||
m.HomomorphicHash = v
|
||||
}
|
||||
|
||||
// SetSplitId sets id of split hierarchy.
|
||||
func (m *SplitInfo) SetSplitId(v []byte) {
|
||||
m.SplitId = v
|
||||
}
|
||||
|
||||
// SetLastPart sets id of most right child in split hierarchy.
|
||||
func (m *SplitInfo) SetLastPart(v *refs.ObjectID) {
|
||||
m.LastPart = v
|
||||
}
|
||||
|
||||
// SetLink sets id of linking object in split hierarchy.
|
||||
func (m *SplitInfo) SetLink(v *refs.ObjectID) {
|
||||
m.Link = v
|
||||
}
|
||||
|
||||
// FromString parses ObjectType from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *ObjectType) FromString(s string) bool {
|
||||
i, ok := ObjectType_value[s]
|
||||
if ok {
|
||||
*x = ObjectType(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// FromString parses MatchType from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *MatchType) FromString(s string) bool {
|
||||
i, ok := MatchType_value[s]
|
||||
if ok {
|
||||
*x = MatchType(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
1373
object/grpc/types.pb.go
generated
1373
object/grpc/types.pb.go
generated
File diff suppressed because it is too large
Load diff
2992
object/grpc/types_frostfs.pb.go
generated
Normal file
2992
object/grpc/types_frostfs.pb.go
generated
Normal file
File diff suppressed because it is too large
Load diff
102
object/grpc/types_frostfs_fuzz.go
Normal file
102
object/grpc/types_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,102 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package object
|
||||
|
||||
func DoFuzzProtoShortHeader(data []byte) int {
|
||||
msg := new(ShortHeader)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONShortHeader(data []byte) int {
|
||||
msg := new(ShortHeader)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoHeader(data []byte) int {
|
||||
msg := new(Header)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONHeader(data []byte) int {
|
||||
msg := new(Header)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoObject(data []byte) int {
|
||||
msg := new(Object)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONObject(data []byte) int {
|
||||
msg := new(Object)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoSplitInfo(data []byte) int {
|
||||
msg := new(SplitInfo)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONSplitInfo(data []byte) int {
|
||||
msg := new(SplitInfo)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoECInfo(data []byte) int {
|
||||
msg := new(ECInfo)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONECInfo(data []byte) int {
|
||||
msg := new(ECInfo)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
61
object/grpc/types_frostfs_test.go
Normal file
61
object/grpc/types_frostfs_test.go
Normal file
|
@ -0,0 +1,61 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package object
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoShortHeader(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoShortHeader(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONShortHeader(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONShortHeader(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoHeader(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoHeader(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONHeader(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONHeader(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoObject(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoObject(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONObject(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONObject(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoSplitInfo(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoSplitInfo(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONSplitInfo(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONSplitInfo(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoECInfo(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoECInfo(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONECInfo(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONECInfo(data)
|
||||
})
|
||||
}
|
|
@ -89,13 +89,13 @@ func (x *Lock) ToGRPCMessage() grpc.Message {
|
|||
if x != nil {
|
||||
m = new(lock.Lock)
|
||||
|
||||
var members []*refsGRPC.ObjectID
|
||||
var members []refsGRPC.ObjectID
|
||||
|
||||
if x.members != nil {
|
||||
members = make([]*refsGRPC.ObjectID, len(x.members))
|
||||
members = make([]refsGRPC.ObjectID, len(x.members))
|
||||
|
||||
for i := range x.members {
|
||||
members[i] = x.members[i].ToGRPCMessage().(*refsGRPC.ObjectID)
|
||||
members[i] = *x.members[i].ToGRPCMessage().(*refsGRPC.ObjectID)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ func (x *Lock) FromGRPCMessage(m grpc.Message) error {
|
|||
var err error
|
||||
|
||||
for i := range x.members {
|
||||
err = x.members[i].FromGRPCMessage(members[i])
|
||||
err = x.members[i].FromGRPCMessage(&members[i])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -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.GetRange())
|
||||
proto.BytesMarshal(patchRequestBodyPatchChunkField, buf[offset:], r.GetChunk())
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
func (r *PatchRequestBodyPatch) StableSize() int {
|
||||
if r == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
var size int
|
||||
size += proto.NestedStructureSize(patchRequestBodyPatchRangeField, r.GetRange())
|
||||
size += proto.BytesSize(patchRequestBodyPatchChunkField, r.GetChunk())
|
||||
|
||||
return size
|
||||
}
|
||||
|
||||
func (r *PatchRequestBodyPatch) Unmarshal(data []byte) error {
|
||||
return message.Unmarshal(r, data, new(object.PatchRequest_Body_Patch))
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) StableMarshal(buf []byte) []byte {
|
||||
if r == nil {
|
||||
return []byte{}
|
||||
}
|
||||
|
||||
if buf == nil {
|
||||
buf = make([]byte, r.StableSize())
|
||||
}
|
||||
|
||||
var offset int
|
||||
offset += proto.NestedStructureMarshal(patchRequestBodyAddrField, buf[offset:], r.address)
|
||||
for i := range r.newAttributes {
|
||||
offset += proto.NestedStructureMarshal(patchRequestBodyNewAttrsField, buf[offset:], &r.newAttributes[i])
|
||||
}
|
||||
offset += proto.BoolMarshal(patchRequestBodyReplaceAttrField, buf[offset:], r.replaceAttributes)
|
||||
proto.NestedStructureMarshal(patchRequestBodyPatchField, buf[offset:], r.patch)
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) StableSize() int {
|
||||
if r == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
var size int
|
||||
size += proto.NestedStructureSize(patchRequestBodyAddrField, r.address)
|
||||
for i := range r.newAttributes {
|
||||
size += proto.NestedStructureSize(patchRequestBodyNewAttrsField, &r.newAttributes[i])
|
||||
}
|
||||
size += proto.BoolSize(patchRequestBodyReplaceAttrField, r.replaceAttributes)
|
||||
size += proto.NestedStructureSize(patchRequestBodyPatchField, r.patch)
|
||||
|
||||
return size
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) Unmarshal(data []byte) error {
|
||||
return message.Unmarshal(r, data, new(object.PatchRequest_Body))
|
||||
}
|
||||
|
||||
func (r *PatchResponseBody) StableSize() int {
|
||||
if r == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
var size int
|
||||
size += proto.NestedStructureSize(patchResponseBodyObjectIDField, r.ObjectID)
|
||||
|
||||
return size
|
||||
}
|
||||
|
||||
func (r *PatchResponseBody) StableMarshal(buf []byte) []byte {
|
||||
if r == nil {
|
||||
return []byte{}
|
||||
}
|
||||
|
||||
if buf == nil {
|
||||
buf = make([]byte, r.StableSize())
|
||||
}
|
||||
|
||||
var offset int
|
||||
proto.NestedStructureMarshal(patchResponseBodyObjectIDField, buf[offset:], r.ObjectID)
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
func (r *PatchResponseBody) Unmarshal(data []byte) error {
|
||||
return message.Unmarshal(r, data, new(object.PatchResponse_Body))
|
||||
}
|
||||
|
|
|
@ -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) },
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package objecttest
|
||||
|
||||
import (
|
||||
crand "crypto/rand"
|
||||
"math/rand"
|
||||
"time"
|
||||
|
||||
|
@ -59,7 +60,10 @@ func generateSplitHeader(empty, withPar bool) *object.SplitHeader {
|
|||
m := new(object.SplitHeader)
|
||||
|
||||
if !empty {
|
||||
m.SetSplitID([]byte{1, 3, 5})
|
||||
id := make([]byte, 16)
|
||||
_, _ = crand.Read(id)
|
||||
|
||||
m.SetSplitID(id)
|
||||
m.SetParent(refstest.GenerateObjectID(false))
|
||||
m.SetPrevious(refstest.GenerateObjectID(false))
|
||||
m.SetChildren(refstest.GenerateObjectIDs(false))
|
||||
|
@ -91,7 +95,10 @@ func GenerateECHeader(empty bool) *object.ECHeader {
|
|||
|
||||
if !empty {
|
||||
ech.Parent = refstest.GenerateObjectID(empty)
|
||||
ech.ParentSplitID = []byte{1, 2, 3}
|
||||
|
||||
ech.ParentSplitID = make([]byte, 16)
|
||||
_, _ = crand.Read(ech.ParentSplitID)
|
||||
|
||||
ech.ParentSplitParentID = refstest.GenerateObjectID(empty)
|
||||
ech.ParentAttributes = GenerateAttributes(empty)
|
||||
ech.Index = 0
|
||||
|
@ -150,7 +157,10 @@ func GenerateSplitInfo(empty bool) *object.SplitInfo {
|
|||
m := new(object.SplitInfo)
|
||||
|
||||
if !empty {
|
||||
m.SetSplitID([]byte("splitID"))
|
||||
id := make([]byte, 16)
|
||||
_, _ = crand.Read(id)
|
||||
|
||||
m.SetSplitID(id)
|
||||
m.SetLastPart(refstest.GenerateObjectID(false))
|
||||
m.SetLink(refstest.GenerateObjectID(false))
|
||||
}
|
||||
|
@ -627,7 +637,10 @@ func GenerateGetRangeHashResponseBody(empty bool) *object.GetRangeHashResponseBo
|
|||
|
||||
if !empty {
|
||||
m.SetType(678)
|
||||
m.SetHashList([][]byte{{1}, {2}})
|
||||
m.SetHashList([][]byte{
|
||||
refstest.GenerateChecksum(false).GetSum(),
|
||||
refstest.GenerateChecksum(false).GetSum(),
|
||||
})
|
||||
}
|
||||
|
||||
return m
|
||||
|
@ -691,6 +704,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)
|
||||
}
|
||||
|
|
132
object/types.go
132
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,106 @@ func (r *PutSingleResponse) SetBody(v *PutSingleResponseBody) {
|
|||
r.body = v
|
||||
}
|
||||
|
||||
func (r *PatchRequest) GetBody() *PatchRequestBody {
|
||||
if r != nil {
|
||||
return r.body
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *PatchRequest) SetBody(v *PatchRequestBody) {
|
||||
r.body = v
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) GetAddress() *refs.Address {
|
||||
if r != nil {
|
||||
return r.address
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) SetAddress(addr *refs.Address) {
|
||||
r.address = addr
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) GetNewAttributes() []Attribute {
|
||||
if r != nil {
|
||||
return r.newAttributes
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) SetNewAttributes(attrs []Attribute) {
|
||||
r.newAttributes = attrs
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) GetReplaceAttributes() bool {
|
||||
if r != nil {
|
||||
return r.replaceAttributes
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) SetReplaceAttributes(replace bool) {
|
||||
r.replaceAttributes = replace
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) GetPatch() *PatchRequestBodyPatch {
|
||||
if r != nil {
|
||||
return r.patch
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *PatchRequestBody) SetPatch(patch *PatchRequestBodyPatch) {
|
||||
r.patch = patch
|
||||
}
|
||||
|
||||
func (r *PatchResponse) GetBody() *PatchResponseBody {
|
||||
if r != nil {
|
||||
return r.Body
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *PatchResponse) SetBody(v *PatchResponseBody) {
|
||||
r.Body = v
|
||||
}
|
||||
|
||||
func (r *PatchResponseBody) GetObjectID() *refs.ObjectID {
|
||||
if r != nil {
|
||||
return r.ObjectID
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *PatchResponseBody) SetObjectID(objectID *refs.ObjectID) {
|
||||
r.ObjectID = objectID
|
||||
}
|
||||
|
||||
func (r *PatchRequestBodyPatch) GetChunk() []byte {
|
||||
if r != nil {
|
||||
return r.Chunk
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *PatchRequestBodyPatch) GetRange() *Range {
|
||||
if r != nil {
|
||||
return r.Range
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *ECInfo) getObjectPart() {}
|
||||
|
||||
func (s *ECInfo) getHeaderPart() {}
|
||||
|
|
|
@ -10,7 +10,7 @@ API_PATH=$1
|
|||
|
||||
# MOVE FILES FROM API REPO
|
||||
cd "$API_PATH" || exit 1
|
||||
ARGS=$(find ./ -name '*.proto' -not -path './vendor/*')
|
||||
ARGS=$(find ./ -name '*.proto' -not -path './bin/*')
|
||||
for file in $ARGS; do
|
||||
dir=$(dirname "$file")
|
||||
mkdir -p "$API_GO_PATH/$dir/grpc"
|
||||
|
@ -19,7 +19,7 @@ done
|
|||
|
||||
# MODIFY FILES
|
||||
cd "$API_GO_PATH" || exit 1
|
||||
ARGS2=$(find ./ -name '*.proto')
|
||||
ARGS2=$(find ./ -name '*.proto' -not -path './bin/*')
|
||||
for file in $ARGS2; do
|
||||
echo "$file"
|
||||
sed -i "s/import\ \"\(.*\)\/\(.*\)\.proto\";/import\ \"\1\/grpc\/\2\.proto\";/" $file
|
||||
|
@ -30,7 +30,7 @@ cd "$API_GO_PATH" || exit 1
|
|||
make protoc
|
||||
|
||||
# REMOVE PROTO DEFINITIONS
|
||||
ARGS=$(find ./$prefix -name '*.proto' -not -path './vendor/*' -not -path './util/*')
|
||||
ARGS=$(find ./$prefix -name '*.proto' -not -path './util/*' -not -path './bin/*')
|
||||
for file in $ARGS; do
|
||||
rm "$file"
|
||||
done
|
||||
|
|
|
@ -24,7 +24,7 @@ func benchmarkObjectIDSlice(b *testing.B, size int) {
|
|||
|
||||
b.Run("to grpc message", func(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for range b.N {
|
||||
raw := ObjectIDListToGRPCMessage(ids)
|
||||
if len(raw) != len(ids) {
|
||||
b.FailNow()
|
||||
|
@ -33,7 +33,7 @@ func benchmarkObjectIDSlice(b *testing.B, size int) {
|
|||
})
|
||||
b.Run("from grpc message", func(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for range b.N {
|
||||
ids, err := ObjectIDListFromGRPCMessage(raw)
|
||||
if err != nil || len(raw) != len(ids) {
|
||||
b.FailNow()
|
||||
|
@ -42,7 +42,7 @@ func benchmarkObjectIDSlice(b *testing.B, size int) {
|
|||
})
|
||||
b.Run("marshal", func(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for range b.N {
|
||||
buf := make([]byte, ObjectIDNestedListSize(1, ids))
|
||||
n := ObjectIDNestedListMarshal(1, buf, ids)
|
||||
if n != len(buf) {
|
||||
|
|
|
@ -52,31 +52,29 @@ func (c *ContainerID) FromGRPCMessage(m grpc.Message) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func ContainerIDsToGRPCMessage(ids []ContainerID) (res []*refs.ContainerID) {
|
||||
func ContainerIDsToGRPCMessage(ids []ContainerID) (res []refs.ContainerID) {
|
||||
if ids != nil {
|
||||
res = make([]*refs.ContainerID, 0, len(ids))
|
||||
res = make([]refs.ContainerID, 0, len(ids))
|
||||
|
||||
for i := range ids {
|
||||
res = append(res, ids[i].ToGRPCMessage().(*refs.ContainerID))
|
||||
res = append(res, *ids[i].ToGRPCMessage().(*refs.ContainerID))
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func ContainerIDsFromGRPCMessage(idsV2 []*refs.ContainerID) (res []ContainerID, err error) {
|
||||
func ContainerIDsFromGRPCMessage(idsV2 []refs.ContainerID) (res []ContainerID, err error) {
|
||||
if idsV2 != nil {
|
||||
res = make([]ContainerID, len(idsV2))
|
||||
|
||||
for i := range idsV2 {
|
||||
if idsV2[i] != nil {
|
||||
err = res[i].FromGRPCMessage(idsV2[i])
|
||||
err = res[i].FromGRPCMessage(&idsV2[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -104,31 +102,29 @@ func (o *ObjectID) FromGRPCMessage(m grpc.Message) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func ObjectIDListToGRPCMessage(ids []ObjectID) (res []*refs.ObjectID) {
|
||||
func ObjectIDListToGRPCMessage(ids []ObjectID) (res []refs.ObjectID) {
|
||||
if ids != nil {
|
||||
res = make([]*refs.ObjectID, 0, len(ids))
|
||||
res = make([]refs.ObjectID, 0, len(ids))
|
||||
|
||||
for i := range ids {
|
||||
res = append(res, ids[i].ToGRPCMessage().(*refs.ObjectID))
|
||||
res = append(res, *ids[i].ToGRPCMessage().(*refs.ObjectID))
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func ObjectIDListFromGRPCMessage(idsV2 []*refs.ObjectID) (res []ObjectID, err error) {
|
||||
func ObjectIDListFromGRPCMessage(idsV2 []refs.ObjectID) (res []ObjectID, err error) {
|
||||
if idsV2 != nil {
|
||||
res = make([]ObjectID, len(idsV2))
|
||||
|
||||
for i := range idsV2 {
|
||||
if idsV2[i] != nil {
|
||||
err = res[i].FromGRPCMessage(idsV2[i])
|
||||
err = res[i].FromGRPCMessage(&idsV2[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
|
|
@ -1,97 +0,0 @@
|
|||
package refs
|
||||
|
||||
// SetValue sets container identifier in a binary format.
|
||||
func (x *ContainerID) SetValue(v []byte) {
|
||||
x.Value = v
|
||||
}
|
||||
|
||||
// SetValue sets object identifier in a binary format.
|
||||
func (x *ObjectID) SetValue(v []byte) {
|
||||
x.Value = v
|
||||
}
|
||||
|
||||
// SetValue sets owner identifier in a binary format.
|
||||
func (x *OwnerID) SetValue(v []byte) {
|
||||
x.Value = v
|
||||
}
|
||||
|
||||
// SetContainerId sets container identifier of the address.
|
||||
func (x *Address) SetContainerId(v *ContainerID) {
|
||||
x.ContainerId = v
|
||||
}
|
||||
|
||||
// SetObjectId sets object identifier of the address.
|
||||
func (x *Address) SetObjectId(v *ObjectID) {
|
||||
x.ObjectId = v
|
||||
}
|
||||
|
||||
// SetType in generic checksum structure.
|
||||
func (x *Checksum) SetType(v ChecksumType) {
|
||||
x.Type = v
|
||||
}
|
||||
|
||||
// SetSum in generic checksum structure.
|
||||
func (x *Checksum) SetSum(v []byte) {
|
||||
x.Sum = v
|
||||
}
|
||||
|
||||
// SetMajor sets major version number.
|
||||
func (x *Version) SetMajor(v uint32) {
|
||||
x.Major = v
|
||||
}
|
||||
|
||||
// SetMinor sets minor version number.
|
||||
func (x *Version) SetMinor(v uint32) {
|
||||
x.Minor = v
|
||||
}
|
||||
|
||||
// SetKey sets public key in a binary format.
|
||||
func (x *Signature) SetKey(v []byte) {
|
||||
x.Key = v
|
||||
}
|
||||
|
||||
// SetSign sets signature.
|
||||
func (x *Signature) SetSign(v []byte) {
|
||||
x.Sign = v
|
||||
}
|
||||
|
||||
// SetScheme sets signature scheme.
|
||||
func (x *Signature) SetScheme(s SignatureScheme) {
|
||||
x.Scheme = s
|
||||
}
|
||||
|
||||
// SetKey sets public key in a binary format.
|
||||
func (x *SignatureRFC6979) SetKey(v []byte) {
|
||||
x.Key = v
|
||||
}
|
||||
|
||||
// SetSign sets signature.
|
||||
func (x *SignatureRFC6979) SetSign(v []byte) {
|
||||
x.Sign = v
|
||||
}
|
||||
|
||||
// FromString parses SignatureScheme from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *SignatureScheme) FromString(s string) bool {
|
||||
i, ok := SignatureScheme_value[s]
|
||||
if ok {
|
||||
*x = SignatureScheme(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// FromString parses ChecksumType from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *ChecksumType) FromString(s string) bool {
|
||||
i, ok := ChecksumType_value[s]
|
||||
if ok {
|
||||
*x = ChecksumType(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue