forked from TrueCloudLab/frostfs-api-go
Compare commits
60 commits
fix/client
...
master
Author | SHA1 | Date | |
---|---|---|---|
557267a07b | |||
2bdee4c9e6 | |||
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 |
169 changed files with 5313 additions and 4148 deletions
70
.forgejo/logo.svg
Normal file
70
.forgejo/logo.svg
Normal file
|
@ -0,0 +1,70 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 25.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Слой_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 184.2 51.8" style="enable-background:new 0 0 184.2 51.8;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{display:none;}
|
||||
.st1{display:inline;}
|
||||
.st2{fill:#01E397;}
|
||||
.st3{display:inline;fill:#010032;}
|
||||
.st4{display:inline;fill:#00E599;}
|
||||
.st5{display:inline;fill:#00AF92;}
|
||||
.st6{fill:#00C3E5;}
|
||||
</style>
|
||||
<g id="Layer_2">
|
||||
<g id="Layer_1-2" class="st0">
|
||||
<g class="st1">
|
||||
<path class="st2" d="M146.6,18.3v7.2h10.9V29h-10.9v10.7h-4V14.8h18v3.5H146.6z"/>
|
||||
<path class="st2" d="M180,15.7c1.7,0.9,3,2.2,4,3.8l-3,2.7c-0.6-1.3-1.5-2.4-2.6-3.3c-1.3-0.7-2.8-1-4.3-1
|
||||
c-1.4-0.1-2.8,0.3-4,1.1c-0.9,0.5-1.5,1.5-1.4,2.6c0,1,0.5,1.9,1.4,2.4c1.5,0.8,3.2,1.3,4.9,1.5c1.9,0.3,3.7,0.8,5.4,1.6
|
||||
c1.2,0.5,2.2,1.3,2.9,2.3c0.6,1,1,2.2,0.9,3.4c0,1.4-0.5,2.7-1.3,3.8c-0.9,1.2-2.1,2.1-3.5,2.6c-1.7,0.6-3.4,0.9-5.2,0.8
|
||||
c-5,0-8.6-1.6-10.7-5l2.9-2.8c0.7,1.4,1.8,2.5,3.1,3.3c1.5,0.7,3.1,1.1,4.7,1c1.5,0.1,2.9-0.2,4.2-0.9c0.9-0.5,1.5-1.5,1.5-2.6
|
||||
c0-0.9-0.5-1.8-1.3-2.2c-1.5-0.7-3.1-1.2-4.8-1.5c-1.9-0.3-3.7-0.8-5.5-1.5c-1.2-0.5-2.2-1.4-3-2.4c-0.6-1-1-2.2-0.9-3.4
|
||||
c0-1.4,0.4-2.7,1.2-3.8c0.8-1.2,2-2.2,3.3-2.8c1.6-0.7,3.4-1.1,5.2-1C176.1,14.3,178.2,14.8,180,15.7z"/>
|
||||
</g>
|
||||
<path class="st3" d="M73.3,16.3c1.9,1.9,2.9,4.5,2.7,7.1v15.9h-4V24.8c0-2.6-0.5-4.5-1.6-5.7c-1.2-1.2-2.8-1.8-4.5-1.7
|
||||
c-1.3,0-2.5,0.3-3.7,0.8c-1.2,0.7-2.2,1.7-2.9,2.9c-0.8,1.5-1.1,3.2-1.1,4.9v13.3h-4V15.1l3.6,1.5v1.7c0.8-1.5,2.1-2.6,3.6-3.3
|
||||
c1.5-0.8,3.2-1.2,4.9-1.1C68.9,13.8,71.3,14.7,73.3,16.3z"/>
|
||||
<path class="st3" d="M104.4,28.3H85.6c0.1,2.2,1,4.3,2.5,5.9c1.5,1.4,3.5,2.2,5.6,2.1c1.6,0.1,3.2-0.2,4.6-0.9
|
||||
c1.1-0.6,2-1.6,2.5-2.8l3.3,1.8c-0.9,1.7-2.3,3.1-4,4c-2,1-4.2,1.5-6.4,1.4c-3.7,0-6.7-1.1-8.8-3.4s-3.2-5.5-3.2-9.6s1-7.2,3-9.5
|
||||
s5-3.4,8.7-3.4c2.1-0.1,4.2,0.5,6.1,1.5c1.6,1,3,2.5,3.8,4.2c0.9,1.8,1.3,3.9,1.3,5.9C104.6,26.4,104.6,27.4,104.4,28.3z
|
||||
M88.1,19.3c-1.4,1.5-2.2,3.4-2.4,5.5h15.1c-0.2-2-1-3.9-2.3-5.5c-1.4-1.3-3.2-2-5.1-1.9C91.5,17.3,89.6,18,88.1,19.3z"/>
|
||||
<path class="st3" d="M131,17.3c2.2,2.3,3.2,5.5,3.2,9.5s-1,7.3-3.2,9.6s-5.1,3.4-8.8,3.4s-6.7-1.1-8.9-3.4s-3.2-5.5-3.2-9.6
|
||||
s1.1-7.2,3.2-9.5s5.1-3.4,8.9-3.4S128.9,15,131,17.3z M116.2,19.9c-1.5,2-2.2,4.4-2.1,6.9c-0.2,2.5,0.6,5,2.1,7
|
||||
c1.5,1.7,3.7,2.7,6,2.6c2.3,0.1,4.4-0.9,5.9-2.6c1.5-2,2.3-4.5,2.1-7c0.1-2.5-0.6-4.9-2.1-6.9c-1.5-1.7-3.6-2.7-5.9-2.6
|
||||
C119.9,17.2,117.7,18.2,116.2,19.9z"/>
|
||||
<polygon class="st4" points="0,9.1 0,43.7 22.5,51.8 22.5,16.9 46.8,7.9 24.8,0 "/>
|
||||
<polygon class="st5" points="24.3,17.9 24.3,36.8 46.8,44.9 46.8,9.6 "/>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st6" d="M41.6,17.5H28.2v6.9h10.4v3.3H28.2v10.2h-3.9V14.2h17.2V17.5z"/>
|
||||
<path class="st6" d="M45.8,37.9v-18h3.3l0.4,3.2c0.5-1.2,1.2-2.1,2.1-2.7c0.9-0.6,2.1-0.9,3.5-0.9c0.4,0,0.7,0,1.1,0.1
|
||||
c0.4,0.1,0.7,0.2,0.9,0.3l-0.5,3.4c-0.3-0.1-0.6-0.2-0.9-0.2C55.4,23,54.9,23,54.4,23c-0.7,0-1.5,0.2-2.2,0.6
|
||||
c-0.7,0.4-1.3,1-1.8,1.8s-0.7,1.8-0.7,3v9.5H45.8z"/>
|
||||
<path class="st6" d="M68.6,19.6c1.8,0,3.3,0.4,4.6,1.1c1.3,0.7,2.4,1.8,3.1,3.2s1.1,3.1,1.1,5c0,1.9-0.4,3.6-1.1,5
|
||||
c-0.8,1.4-1.8,2.5-3.1,3.2c-1.3,0.7-2.9,1.1-4.6,1.1s-3.3-0.4-4.6-1.1c-1.3-0.7-2.4-1.8-3.2-3.2c-0.8-1.4-1.2-3.1-1.2-5
|
||||
c0-1.9,0.4-3.6,1.2-5s1.8-2.5,3.2-3.2C65.3,19.9,66.8,19.6,68.6,19.6z M68.6,22.6c-1.1,0-2,0.2-2.8,0.7c-0.8,0.5-1.3,1.2-1.7,2.1
|
||||
s-0.6,2.1-0.6,3.5c0,1.3,0.2,2.5,0.6,3.4s1,1.7,1.7,2.2s1.7,0.7,2.8,0.7c1.1,0,2-0.2,2.7-0.7c0.7-0.5,1.3-1.2,1.7-2.2
|
||||
s0.6-2.1,0.6-3.4c0-1.4-0.2-2.5-0.6-3.5s-1-1.6-1.7-2.1C70.6,22.8,69.6,22.6,68.6,22.6z"/>
|
||||
<path class="st6" d="M89.2,38.3c-1.8,0-3.4-0.3-4.9-1c-1.5-0.7-2.7-1.7-3.5-3l2.7-2.3c0.5,1,1.3,1.8,2.3,2.4
|
||||
c1,0.6,2.2,0.9,3.6,0.9c1.1,0,2-0.2,2.6-0.6c0.6-0.4,1-0.9,1-1.6c0-0.5-0.2-0.9-0.5-1.2s-0.9-0.6-1.7-0.8l-3.8-0.8
|
||||
c-1.9-0.4-3.3-1-4.1-1.9c-0.8-0.9-1.2-1.9-1.2-3.3c0-1,0.3-1.9,0.9-2.7c0.6-0.8,1.4-1.5,2.5-2s2.5-0.8,4-0.8c1.8,0,3.3,0.3,4.6,1
|
||||
c1.3,0.6,2.2,1.5,2.9,2.7l-2.7,2.2c-0.5-1-1.1-1.7-2-2.1c-0.9-0.5-1.8-0.7-2.8-0.7c-0.8,0-1.4,0.1-2,0.3c-0.6,0.2-1,0.5-1.3,0.8
|
||||
c-0.3,0.3-0.4,0.7-0.4,1.2c0,0.5,0.2,0.9,0.5,1.3s1,0.6,1.9,0.8l4.1,0.9c1.7,0.3,2.9,0.9,3.7,1.7c0.7,0.8,1.1,1.8,1.1,2.9
|
||||
c0,1.2-0.3,2.2-0.9,3c-0.6,0.9-1.5,1.6-2.6,2C92.1,38.1,90.7,38.3,89.2,38.3z"/>
|
||||
<path class="st6" d="M112.8,19.9v3H99.3v-3H112.8z M106.6,14.6v17.9c0,0.9,0.2,1.5,0.7,1.9c0.5,0.4,1.1,0.6,1.9,0.6
|
||||
c0.6,0,1.2-0.1,1.7-0.3c0.5-0.2,0.9-0.5,1.3-0.8l0.9,2.8c-0.6,0.5-1.2,0.9-2,1.1c-0.8,0.3-1.7,0.4-2.7,0.4c-1,0-2-0.2-2.8-0.5
|
||||
s-1.5-0.9-2-1.6c-0.5-0.8-0.7-1.7-0.8-3V15.7L106.6,14.6z"/>
|
||||
<path d="M137.9,17.5h-13.3v6.9h10.4v3.3h-10.4v10.2h-3.9V14.2h17.2V17.5z"/>
|
||||
<path d="M150.9,13.8c2.1,0,4,0.4,5.5,1.2c1.6,0.8,2.9,2,4,3.5l-2.6,2.5c-0.9-1.4-1.9-2.4-3.1-3c-1.1-0.6-2.5-0.9-4-0.9
|
||||
c-1.2,0-2.1,0.2-2.8,0.5c-0.7,0.3-1.3,0.7-1.6,1.2c-0.3,0.5-0.5,1.1-0.5,1.7c0,0.7,0.3,1.4,0.8,1.9c0.5,0.6,1.5,1,2.9,1.3
|
||||
l4.8,1.1c2.3,0.5,3.9,1.3,4.9,2.3c1,1,1.4,2.3,1.4,3.9c0,1.5-0.4,2.7-1.2,3.8c-0.8,1.1-1.9,1.9-3.3,2.5s-3.1,0.9-5,0.9
|
||||
c-1.7,0-3.2-0.2-4.5-0.6c-1.3-0.4-2.5-1-3.5-1.8c-1-0.7-1.8-1.6-2.5-2.6l2.7-2.7c0.5,0.8,1.1,1.6,1.9,2.2
|
||||
c0.8,0.7,1.7,1.2,2.7,1.5c1,0.4,2.2,0.5,3.4,0.5c1.1,0,2.1-0.1,2.9-0.4c0.8-0.3,1.4-0.7,1.8-1.2c0.4-0.5,0.6-1.1,0.6-1.9
|
||||
c0-0.7-0.2-1.3-0.7-1.8c-0.5-0.5-1.3-0.9-2.6-1.2l-5.2-1.2c-1.4-0.3-2.6-0.8-3.6-1.3c-0.9-0.6-1.6-1.3-2.1-2.1s-0.7-1.8-0.7-2.8
|
||||
c0-1.3,0.4-2.6,1.1-3.7c0.7-1.1,1.8-2,3.2-2.6C147.3,14.1,148.9,13.8,150.9,13.8z"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 5.5 KiB |
1
.github/CODEOWNERS
vendored
1
.github/CODEOWNERS
vendored
|
@ -1 +0,0 @@
|
|||
* @TrueCloudLab/storage-core @TrueCloudLab/storage-services @TrueCloudLab/committers
|
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
|
||||
|
@ -81,4 +82,4 @@ issues:
|
|||
|
||||
- linters: # ignore SA6002 since we use pool of []byte, however we can switch to *bytes.Buffer
|
||||
- staticcheck
|
||||
text: "SA6002:|SA1019:"
|
||||
text: "SA6002:"
|
||||
|
|
|
@ -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
|
||||
|
|
2
CODEOWNERS
Normal file
2
CODEOWNERS
Normal file
|
@ -0,0 +1,2 @@
|
|||
.* @TrueCloudLab/storage-core-committers @TrueCloudLab/storage-core-developers @TrueCloudLab/storage-services-committers @TrueCloudLab/storage-services-developers
|
||||
.forgejo/.* @potyarkin
|
|
@ -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.
|
||||
|
@ -25,19 +25,20 @@ Start by forking the `frostfs-api-go` repository, make changes in a branch and t
|
|||
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
|
||||
### Set up your repository
|
||||
|
||||
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
|
||||
...
|
||||
|
@ -86,7 +87,7 @@ $ git push origin feature/123-something_awesome
|
|||
```
|
||||
|
||||
### Create a Pull Request
|
||||
Pull requests can be created via GitHub. Refer to [this
|
||||
Pull requests can be created via git.frostfs.info. Refer to [this
|
||||
document](https://help.github.com/articles/creating-a-pull-request/) for
|
||||
detailed steps on how to create a pull request. After a Pull Request gets peer
|
||||
reviewed and approved, it will be merged.
|
||||
|
|
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"
|
||||
|
|
16
README.md
16
README.md
|
@ -1,27 +1,25 @@
|
|||
<p align="center">
|
||||
<img src="./.github/logo.svg" width="500px" alt="FrostFS">
|
||||
<img src="./.forgejo/logo.svg" width="500px" alt="FrostFS">
|
||||
</p>
|
||||
<p align="center">
|
||||
Low-level Golang API for <a href="https://frostfs.info">FrostFS</a>
|
||||
</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
|
||||
}
|
BIN
accounting/grpc/service.pb.go
generated
BIN
accounting/grpc/service.pb.go
generated
Binary file not shown.
BIN
accounting/grpc/service_frostfs.pb.go
generated
Normal file
BIN
accounting/grpc/service_frostfs.pb.go
generated
Normal file
Binary file not shown.
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)
|
||||
})
|
||||
}
|
BIN
accounting/grpc/service_grpc.pb.go
generated
BIN
accounting/grpc/service_grpc.pb.go
generated
Binary file not shown.
|
@ -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
|
||||
}
|
BIN
accounting/grpc/types.pb.go
generated
BIN
accounting/grpc/types.pb.go
generated
Binary file not shown.
BIN
accounting/grpc/types_frostfs.pb.go
generated
Normal file
BIN
accounting/grpc/types_frostfs.pb.go
generated
Normal file
Binary file not shown.
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,28 +187,26 @@ 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])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = res[i].FromGRPCMessage(&fs[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -241,28 +239,26 @@ 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])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = res[i].FromGRPCMessage(&fs[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -309,28 +305,26 @@ 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])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = res[i].FromGRPCMessage(&fs[i])
|
||||
if err != nil {
|
||||
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
|
||||
}
|
BIN
acl/grpc/types.pb.go
generated
BIN
acl/grpc/types.pb.go
generated
Binary file not shown.
BIN
acl/grpc/types_frostfs.pb.go
generated
Normal file
BIN
acl/grpc/types_frostfs.pb.go
generated
Normal file
Binary file not shown.
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
|
||||
}
|
BIN
ape/grpc/types.pb.go
generated
BIN
ape/grpc/types.pb.go
generated
Binary file not shown.
BIN
ape/grpc/types_frostfs.pb.go
generated
Normal file
BIN
ape/grpc/types_frostfs.pb.go
generated
Normal file
Binary file not shown.
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
|
||||
}
|
BIN
apemanager/grpc/service.pb.go
generated
BIN
apemanager/grpc/service.pb.go
generated
Binary file not shown.
BIN
apemanager/grpc/service_frostfs.pb.go
generated
Normal file
BIN
apemanager/grpc/service_frostfs.pb.go
generated
Normal file
Binary file not shown.
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,28 +37,26 @@ 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])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = res[i].FromGRPCMessage(&xs[i])
|
||||
if err != nil {
|
||||
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
|
||||
}
|
BIN
container/grpc/service.pb.go
generated
BIN
container/grpc/service.pb.go
generated
Binary file not shown.
BIN
container/grpc/service_frostfs.pb.go
generated
Normal file
BIN
container/grpc/service_frostfs.pb.go
generated
Normal file
Binary file not shown.
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)
|
||||
})
|
||||
}
|
BIN
container/grpc/service_grpc.pb.go
generated
BIN
container/grpc/service_grpc.pb.go
generated
Binary file not shown.
|
@ -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
|
||||
}
|
BIN
container/grpc/types.pb.go
generated
BIN
container/grpc/types.pb.go
generated
Binary file not shown.
BIN
container/grpc/types_frostfs.pb.go
generated
Normal file
BIN
container/grpc/types_frostfs.pb.go
generated
Normal file
Binary file not shown.
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
|
||||
}
|
||||
|
|
|
@ -35,11 +35,11 @@ Tag a release (must be signed) and push it:
|
|||
$ git tag -s vX.Y.Z[-rc.N] && git push origin vX.Y.Z[-rc.N]
|
||||
```
|
||||
|
||||
## Make a Github release
|
||||
## Make a proper release
|
||||
|
||||
Using Github's web interface create a new release based on just created tag
|
||||
Using git.frostfs.info web interface create a new release based on just created tag
|
||||
with the same changes from changelog and publish it.
|
||||
|
||||
## Close github milestone
|
||||
## Close milestone
|
||||
|
||||
Close corresponding vX.Y.Z github milestone.
|
||||
Close corresponding vX.Y.Z milestone.
|
||||
|
|
43
go.mod
43
go.mod
|
@ -1,43 +1,28 @@
|
|||
module git.frostfs.info/TrueCloudLab/frostfs-api-go/v2
|
||||
|
||||
go 1.21
|
||||
go 1.22
|
||||
|
||||
require (
|
||||
git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0
|
||||
github.com/nspcc-dev/neo-go v0.106.3
|
||||
github.com/stretchr/testify v1.9.0
|
||||
golang.org/x/sync v0.8.0
|
||||
google.golang.org/grpc v1.66.0
|
||||
google.golang.org/protobuf v1.34.2
|
||||
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.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/beorn7/perks v1.0.1 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
|
||||
github.com/golang/snappy v0.0.1 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
|
||||
github.com/holiman/uint256 v1.2.4 // 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/nspcc-dev/go-ordered-json v0.0.0-20240301084351-0246b013f8b2 // indirect
|
||||
github.com/nspcc-dev/rfc6979 v0.2.1 // indirect
|
||||
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/prometheus/client_golang v1.19.0 // indirect
|
||||
github.com/prometheus/client_model v0.5.0 // indirect
|
||||
github.com/prometheus/common v0.48.0 // indirect
|
||||
github.com/prometheus/procfs v0.12.0 // indirect
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954 // indirect
|
||||
go.etcd.io/bbolt v1.3.9 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.uber.org/zap v1.27.0 // indirect
|
||||
golang.org/x/crypto v0.27.0 // indirect
|
||||
golang.org/x/net v0.29.0 // indirect
|
||||
golang.org/x/sys v0.25.0 // indirect
|
||||
golang.org/x/text v0.18.0 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // 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
|
||||
)
|
||||
|
|
172
go.sum
172
go.sum
|
@ -2,161 +2,47 @@ 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/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c=
|
||||
github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
|
||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ=
|
||||
github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI=
|
||||
github.com/consensys/gnark-crypto v0.12.2-0.20231013160410-1f65e75b6dfb h1:f0BMgIjhZy4lSRHCXFbQst85f5agZAjtDMixQqBWNpc=
|
||||
github.com/consensys/gnark-crypto v0.12.2-0.20231013160410-1f65e75b6dfb/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY=
|
||||
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/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs=
|
||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
|
||||
github.com/frankban/quicktest v1.14.5 h1:dfYrrRyLtiqT9GyKXgdh+k4inNeTvmGbuSgZ3lx3GhA=
|
||||
github.com/frankban/quicktest v1.14.5/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
|
||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
|
||||
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
|
||||
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
|
||||
github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU=
|
||||
github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY=
|
||||
github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU=
|
||||
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/nspcc-dev/dbft v0.2.0 h1:sDwsQES600OSIMncV176t2SX5OvB14lzeOAyKFOkbMI=
|
||||
github.com/nspcc-dev/dbft v0.2.0/go.mod h1:oFE6paSC/yfFh9mcNU6MheMGOYXK9+sPiRk3YMoz49o=
|
||||
github.com/nspcc-dev/go-ordered-json v0.0.0-20240301084351-0246b013f8b2 h1:mD9hU3v+zJcnHAVmHnZKt3I++tvn30gBj2rP2PocZMk=
|
||||
github.com/nspcc-dev/go-ordered-json v0.0.0-20240301084351-0246b013f8b2/go.mod h1:U5VfmPNM88P4RORFb6KSUVBdJBDhlqggJZYGXGPxOcc=
|
||||
github.com/nspcc-dev/neo-go v0.106.3 h1:HEyhgkjQY+HfBzotMJ12xx2VuOUphkngZ4kEkjvXDtE=
|
||||
github.com/nspcc-dev/neo-go v0.106.3/go.mod h1:3vEwJ2ld12N7HRGCaH/l/7EwopplC/+8XdIdPDNmD/M=
|
||||
github.com/nspcc-dev/rfc6979 v0.2.1 h1:8wWxkamHWFmO790GsewSoKUSJjVnL1fmdRpokU/RgRM=
|
||||
github.com/nspcc-dev/rfc6979 v0.2.1/go.mod h1:Tk7h5kyUWkhjyO3zUgFFhy1v2vQv3BvQEntakdtqrWc=
|
||||
github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
|
||||
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
|
||||
github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA=
|
||||
github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
|
||||
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
||||
github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE=
|
||||
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
||||
github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM=
|
||||
github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
|
||||
github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
|
||||
github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
|
||||
github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
|
||||
github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
|
||||
github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
|
||||
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
|
||||
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
|
||||
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
|
||||
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954 h1:xQdMZ1WLrgkkvOZ/LDQxjVxMLdby7osSh4ZEVa5sIjs=
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM=
|
||||
github.com/twmb/murmur3 v1.1.8 h1:8Yt9taO/WN3l08xErzjeschgZU2QSrwm1kclYq+0aRg=
|
||||
github.com/twmb/murmur3 v1.1.8/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ=
|
||||
go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI=
|
||||
go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
|
||||
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
|
||||
golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
|
||||
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
|
||||
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
|
||||
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
|
||||
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
|
||||
google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c=
|
||||
google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
|
||||
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
|
||||
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.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-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU=
|
||||
rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA=
|
||||
|
|
|
@ -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
|
||||
}
|
BIN
lock/grpc/types.pb.go
generated
BIN
lock/grpc/types.pb.go
generated
Binary file not shown.
BIN
lock/grpc/types_frostfs.pb.go
generated
Normal file
BIN
lock/grpc/types_frostfs.pb.go
generated
Normal file
Binary file not shown.
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,28 +45,26 @@ 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])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = res[i].FromGRPCMessage(&fs[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -105,28 +103,26 @@ 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])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = res[i].FromGRPCMessage(&ss[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -163,28 +159,26 @@ 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])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = res[i].FromGRPCMessage(&rs[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -289,28 +283,26 @@ 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])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = res[i].FromGRPCMessage(&as[i])
|
||||
if err != nil {
|
||||
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,11 +552,9 @@ 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 {
|
||||
return err
|
||||
}
|
||||
for i := range ln {
|
||||
if err := ps[i].FromGRPCMessage(&psV2[i]); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
}
|
BIN
netmap/grpc/service.pb.go
generated
BIN
netmap/grpc/service.pb.go
generated
Binary file not shown.
BIN
netmap/grpc/service_frostfs.pb.go
generated
Normal file
BIN
netmap/grpc/service_frostfs.pb.go
generated
Normal file
Binary file not shown.
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)
|
||||
})
|
||||
}
|
BIN
netmap/grpc/service_grpc.pb.go
generated
BIN
netmap/grpc/service_grpc.pb.go
generated
Binary file not shown.
|
@ -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
|
||||
}
|
BIN
netmap/grpc/types.pb.go
generated
BIN
netmap/grpc/types.pb.go
generated
Binary file not shown.
BIN
netmap/grpc/types_frostfs.pb.go
generated
Normal file
BIN
netmap/grpc/types_frostfs.pb.go
generated
Normal file
Binary file not shown.
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,28 +142,26 @@ 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])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = res[i].FromGRPCMessage(&xs[i])
|
||||
if err != nil {
|
||||
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,28 +1624,26 @@ 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])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = res[i].FromGRPCMessage(&fs[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1827,28 +1823,26 @@ 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])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = res[i].FromGRPCMessage(&rs[i])
|
||||
if err != nil {
|
||||
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
|
||||
}
|
BIN
object/grpc/service.pb.go
generated
BIN
object/grpc/service.pb.go
generated
Binary file not shown.
BIN
object/grpc/service_frostfs.pb.go
generated
Normal file
BIN
object/grpc/service_frostfs.pb.go
generated
Normal file
Binary file not shown.
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)
|
||||
})
|
||||
}
|
BIN
object/grpc/service_grpc.pb.go
generated
BIN
object/grpc/service_grpc.pb.go
generated
Binary file not shown.
BIN
object/grpc/status.pb.go
generated
BIN
object/grpc/status.pb.go
generated
Binary file not shown.
|
@ -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
|
||||
}
|
BIN
object/grpc/types.pb.go
generated
BIN
object/grpc/types.pb.go
generated
Binary file not shown.
BIN
object/grpc/types_frostfs.pb.go
generated
Normal file
BIN
object/grpc/types_frostfs.pb.go
generated
Normal file
Binary file not shown.
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)
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue