Compare commits

..

No commits in common. "main" and "v1.5.8" have entirely different histories.
main ... v1.5.8

81 changed files with 31893 additions and 36552 deletions

View File

@ -22,15 +22,15 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v3
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v2

View File

@ -13,14 +13,12 @@ jobs:
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: '0'
uses: actions/checkout@v3
- name: Golangci lint
uses: golangci/golangci-lint-action@v8
uses: golangci/golangci-lint-action@v3
with:
version: v2.1.6
version: v1.46.2
rust-lint:
name: Rust Lint
@ -28,7 +26,7 @@ jobs:
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: Install protobuf-compiler
run: sudo apt-get install protobuf-compiler
@ -57,7 +55,7 @@ jobs:
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: Markdown lint
uses: docker://avtodev/markdown-lint:v1

4
.gitignore vendored
View File

@ -67,6 +67,10 @@ artifacts
# will have compiled files and executables
/target/
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk

View File

@ -1,53 +1,37 @@
version: "2"
run:
deadline: 3m
modules-download-mode: readonly
linters:
default: none
enable:
- errcheck
- goconst
- gocyclo
- govet
- misspell
- staticcheck
settings:
gocyclo:
min-complexity: 60
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- staticcheck
text: 'SA1019:'
paths:
- third_party$
- builtin$
- examples$
linters-settings:
gocyclo:
min-complexity: 60
gci:
sections:
- standard
- default
issues:
new: true
formatters:
exclude-rules:
- linters:
- staticcheck
text: "SA1019:"
linters:
disable-all: true
enable:
- gci
- gofmt
settings:
gci:
sections:
- standard
- default
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
- golint
- misspell
- govet
- goconst
- deadcode
- gocyclo
- staticcheck
- errcheck
output:
formats:
text:
path: stdout
print-linter-name: true
print-issued-lines: true
format: colored-line-number
print-issued-lines: true
print-linter-name: true

1314
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +1,19 @@
[package]
name = "dragonfly-api"
version = "2.1.47"
name = "api"
version = "0.1.0"
authors = ["Gaius <gaius.qi@gmail.com>"]
edition = "2021"
license = "Apache-2.0"
homepage = "https://d7y.io"
repository = "https://github.com/dragonflyoss/api"
description = "Canonical location of the Dragonfly API definition"
readme = "README.md"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
tonic = "0.12.3"
prost = "0.13.5"
prost-types = "0.14.1"
tokio = { version = "1.46.1", features = ["rt-multi-thread", "macros"] }
serde = { version = "1.0", features = ["derive"] }
prost-wkt-types = "0.6"
tonic = "0.8.3"
prost = "0.11"
prost-types = "0.11"
tokio = { version = "1.8.2", features = ["rt-multi-thread", "macros"] }
[build-dependencies]
tonic-build = "0.12.1"
tonic-build = "0.8.3"

View File

@ -17,7 +17,7 @@ all: help
# Run code lint
lint: markdownlint
@echo "Begin to golangci-lint."
@./hack/golanglint.sh
@golangci-lint run
.PHONY: lint
# Run markdown lint

View File

@ -1,6 +1,6 @@
# api
[![Discussions](https://img.shields.io/badge/discussions-on%20github-blue?style=flat-square)](https://github.com/dragonflyoss/dragonfly/discussions)
[![Discussions](https://img.shields.io/badge/discussions-on%20github-blue?style=flat-square)](https://github.com/dragonflyoss/Dragonfly2/discussions)
[![LICENSE](https://img.shields.io/github/license/dragonflyoss/api.svg?style=flat-square)](https://github.com/dragonflyoss/api/blob/main/LICENSE)
Canonical location of the Dragonfly API definition.
@ -9,24 +9,26 @@ The project includes the api definitions of dragonfly services and the mocks of
## Note to developers
If developers need to change dragonfly api definition,
please contact [dragonfly maintainers](https://github.com/dragonflyoss/dragonfly/blob/main/MAINTAINERS.md).
please contact [dragonfly maintainers](https://github.com/dragonflyoss/Dragonfly2/blob/main/MAINTAINERS.md).
## Community
Join the conversation and help the community.
Welcome developers to actively participate in community discussions
and contribute code to Dragonfly. We will remain
concerned about the issues discussed in the community and respond quickly.
- **Slack Channel**: [#dragonfly](https://cloud-native.slack.com/messages/dragonfly/) on [CNCF Slack](https://slack.cncf.io/)
- **Github Discussions**: [Dragonfly Discussion Forum](https://github.com/dragonflyoss/dragonfly/discussions)
- **Discussion Group**: <dragonfly-discuss@googlegroups.com>
- **Developer Group**: <dragonfly-developers@googlegroups.com>
- **Maintainer Group**: <dragonfly-maintainers@googlegroups.com>
- **Github Discussions**: [Dragonfly Discussion Forum][discussion]
- **Twitter**: [@dragonfly_oss](https://twitter.com/dragonfly_oss)
- **DingTalk**: [22880028764](https://qr.dingtalk.com/action/joingroup?code=v1,k1,pkV9IbsSyDusFQdByPSK3HfCG61ZCLeb8b/lpQ3uUqI=&_dt_no_comment=1&origin=11)
- **DingTalk**: [23304666](https://h5.dingtalk.com/circle/healthCheckin.html?dtaction=os&corpId=ding0ba5f94d8290b9f7f235fbadcd45de0c&f4462ef5-a7d=9bec3e94-b34&cbdbhh=qwertyuiop)
## Contributing
You should check out our
[CONTRIBUTING](https://github.com/dragonflyoss/dragonfly/blob/main/CONTRIBUTING.md) and develop the project together.
[CONTRIBUTING](https://github.com/dragonflyoss/Dragonfly2/blob/main/CONTRIBUTING.md) and develop the project together.
## Code of Conduct
Please refer to our [Code of Conduct](https://github.com/dragonflyoss/dragonfly/blob/main/CODE_OF_CONDUCT.md).
Please refer to our [Code of Conduct](https://github.com/dragonflyoss/Dragonfly2/blob/main/CODE_OF_CONDUCT.md).

View File

@ -1,18 +1,12 @@
fn main() -> Result<(), Box<dyn std::error::Error>> {
tonic_build::configure()
.file_descriptor_set_path("src/descriptor.bin")
.protoc_arg("--experimental_allow_proto3_optional")
.type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]")
.type_attribute(
"scheduler.v2.AnnouncePeerRequest.request",
"#[allow(clippy::large_enum_variant)]",
)
.extern_path(".google.protobuf.Timestamp", "::prost_wkt_types::Timestamp")
.extern_path(".google.protobuf.Duration", "::prost_wkt_types::Duration")
.build_client(true)
.build_server(true)
.out_dir("src")
.compile(
&[
"proto/common.proto",
"proto/security.proto",
"proto/errordetails.proto",
"proto/dfdaemon.proto",
"proto/manager.proto",

21
go.mod
View File

@ -1,17 +1,18 @@
module d7y.io/api/v2
module d7y.io/api
go 1.23.8
go 1.19
require (
github.com/envoyproxy/protoc-gen-validate v1.2.1
go.uber.org/mock v0.5.2
google.golang.org/grpc v1.73.0
google.golang.org/protobuf v1.36.6
github.com/envoyproxy/protoc-gen-validate v0.9.1
github.com/golang/mock v1.6.0
google.golang.org/grpc v1.53.0
google.golang.org/protobuf v1.28.1
)
require (
golang.org/x/net v0.38.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/text v0.23.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect
github.com/golang/protobuf v1.5.2 // indirect
golang.org/x/net v0.5.0 // indirect
golang.org/x/sys v0.4.0 // indirect
golang.org/x/text v0.6.0 // indirect
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
)

85
go.sum
View File

@ -1,38 +1,47 @@
github.com/envoyproxy/protoc-gen-validate v1.2.1 h1:DEo3O99U8j4hBFwbJfrz9VtgcDfUKS7KJ7spH3d86P8=
github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2TmLfsJ31lvEjwamM4DxlWXU=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
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=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ=
go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y=
go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M=
go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE=
go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY=
go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg=
go.opentelemetry.io/otel/sdk/metric v1.35.0 h1:1RriWBmCKgkeHEhM7a2uMjMUfP7MsOF5JpUCaEqEI9o=
go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w=
go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs=
go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc=
go.uber.org/mock v0.5.2 h1:LbtPTcP8A5k9WPXj54PPPbjcI4Y6lhyOZXn+VS7wNko=
go.uber.org/mock v0.5.2/go.mod h1:wLlUxC2vVTPTaE3UD51E0BGOAElKrILxhVSDYQLld5o=
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 h1:e0AIkUUhxyBKh6ssZNrAMeqhA7RKUj42346d1y02i2g=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok=
google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc=
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
github.com/envoyproxy/protoc-gen-validate v0.9.1 h1:PS7VIOgmSVhWUEeZwTe7z7zouA22Cr590PzXKbZHOVY=
github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw=
golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
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-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k=
golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w=
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc=
google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=

View File

@ -1,11 +0,0 @@
#!/bin/bash
LINT_DIR=/data
GOLANGCI_IMAGE=golangci/golangci-lint:v1.54
docker run --rm \
-w "${LINT_DIR}" \
-v "$(pwd):${LINT_DIR}:ro" \
${GOLANGCI_IMAGE} \
golangci-lint \
run -v

View File

@ -1,11 +1,10 @@
#!/bin/bash
PROTOC_ALL_IMAGE=${PROTOC_ALL_IMAGE:-"namely/protoc-all:1.51_2"}
PROTOC_ALL_IMAGE=${PROTOC_ALL_IMAGE:-"namely/protoc-all:1.51_1"}
PROTO_PATH=pkg/apis
LANGUAGE=go
proto_modules="common/v1 common/v2 cdnsystem/v1 dfdaemon/v1 dfdaemon/v2
errordetails/v1 errordetails/v2 manager/v1 manager/v2 scheduler/v1 scheduler/v2"
proto_modules="common/v1 common/v2 cdnsystem/v1 dfdaemon/v1 dfdaemon/v2 errordetails/v1 errordetails/v2 manager/v1 manager/v2 scheduler/v1 scheduler/v2 security/v1"
echo "generate protos..."

View File

@ -22,7 +22,7 @@
package cdnsystem
import (
v1 "d7y.io/api/v2/pkg/apis/common/v1"
v1 "d7y.io/api/pkg/apis/common/v1"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
@ -285,10 +285,10 @@ var file_pkg_apis_cdnsystem_v1_cdnsystem_proto_rawDesc = []byte{
0x12, 0x18, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x54,
0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x63, 0x6f, 0x6d,
0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x28,
0x01, 0x30, 0x01, 0x42, 0x2f, 0x5a, 0x2d, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x63, 0x64,
0x6e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x64, 0x6e, 0x73, 0x79,
0x73, 0x74, 0x65, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x01, 0x30, 0x01, 0x42, 0x2c, 0x5a, 0x2a, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x63, 0x64, 0x6e, 0x73, 0x79,
0x73, 0x74, 0x65, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x64, 0x6e, 0x73, 0x79, 0x73, 0x74, 0x65,
0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -21,7 +21,7 @@ package cdnsystem;
import "pkg/apis/common/v1/common.proto";
import "validate/validate.proto";
option go_package = "d7y.io/api/v2/pkg/apis/cdnsystem/v1;cdnsystem";
option go_package = "d7y.io/api/pkg/apis/cdnsystem/v1;cdnsystem";
message SeedRequest{
string task_id = 1 [(validate.rules).string.min_len = 1];

View File

@ -8,7 +8,7 @@ package cdnsystem
import (
context "context"
v1 "d7y.io/api/v2/pkg/apis/common/v1"
v1 "d7y.io/api/pkg/apis/common/v1"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"

View File

@ -1,10 +1,5 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: ../cdnsystem_grpc.pb.go
//
// Generated by this command:
//
// mockgen -destination cdnsystem_mock.go -source ../cdnsystem_grpc.pb.go -package mocks
//
// Package mocks is a generated GoMock package.
package mocks
@ -13,9 +8,9 @@ import (
context "context"
reflect "reflect"
cdnsystem "d7y.io/api/v2/pkg/apis/cdnsystem/v1"
common "d7y.io/api/v2/pkg/apis/common/v1"
gomock "go.uber.org/mock/gomock"
cdnsystem "d7y.io/api/pkg/apis/cdnsystem/v1"
common "d7y.io/api/pkg/apis/common/v1"
gomock "github.com/golang/mock/gomock"
grpc "google.golang.org/grpc"
metadata "google.golang.org/grpc/metadata"
)
@ -24,7 +19,6 @@ import (
type MockSeederClient struct {
ctrl *gomock.Controller
recorder *MockSeederClientMockRecorder
isgomock struct{}
}
// MockSeederClientMockRecorder is the mock recorder for MockSeederClient.
@ -47,7 +41,7 @@ func (m *MockSeederClient) EXPECT() *MockSeederClientMockRecorder {
// GetPieceTasks mocks base method.
func (m *MockSeederClient) GetPieceTasks(ctx context.Context, in *common.PieceTaskRequest, opts ...grpc.CallOption) (*common.PiecePacket, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -58,16 +52,16 @@ func (m *MockSeederClient) GetPieceTasks(ctx context.Context, in *common.PieceTa
}
// GetPieceTasks indicates an expected call of GetPieceTasks.
func (mr *MockSeederClientMockRecorder) GetPieceTasks(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockSeederClientMockRecorder) GetPieceTasks(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPieceTasks", reflect.TypeOf((*MockSeederClient)(nil).GetPieceTasks), varargs...)
}
// ObtainSeeds mocks base method.
func (m *MockSeederClient) ObtainSeeds(ctx context.Context, in *cdnsystem.SeedRequest, opts ...grpc.CallOption) (cdnsystem.Seeder_ObtainSeedsClient, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -78,16 +72,16 @@ func (m *MockSeederClient) ObtainSeeds(ctx context.Context, in *cdnsystem.SeedRe
}
// ObtainSeeds indicates an expected call of ObtainSeeds.
func (mr *MockSeederClientMockRecorder) ObtainSeeds(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockSeederClientMockRecorder) ObtainSeeds(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ObtainSeeds", reflect.TypeOf((*MockSeederClient)(nil).ObtainSeeds), varargs...)
}
// SyncPieceTasks mocks base method.
func (m *MockSeederClient) SyncPieceTasks(ctx context.Context, opts ...grpc.CallOption) (cdnsystem.Seeder_SyncPieceTasksClient, error) {
m.ctrl.T.Helper()
varargs := []any{ctx}
varargs := []interface{}{ctx}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -98,9 +92,9 @@ func (m *MockSeederClient) SyncPieceTasks(ctx context.Context, opts ...grpc.Call
}
// SyncPieceTasks indicates an expected call of SyncPieceTasks.
func (mr *MockSeederClientMockRecorder) SyncPieceTasks(ctx any, opts ...any) *gomock.Call {
func (mr *MockSeederClientMockRecorder) SyncPieceTasks(ctx interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx}, opts...)
varargs := append([]interface{}{ctx}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncPieceTasks", reflect.TypeOf((*MockSeederClient)(nil).SyncPieceTasks), varargs...)
}
@ -108,7 +102,6 @@ func (mr *MockSeederClientMockRecorder) SyncPieceTasks(ctx any, opts ...any) *go
type MockSeeder_ObtainSeedsClient struct {
ctrl *gomock.Controller
recorder *MockSeeder_ObtainSeedsClientMockRecorder
isgomock struct{}
}
// MockSeeder_ObtainSeedsClientMockRecorder is the mock recorder for MockSeeder_ObtainSeedsClient.
@ -187,7 +180,7 @@ func (mr *MockSeeder_ObtainSeedsClientMockRecorder) Recv() *gomock.Call {
}
// RecvMsg mocks base method.
func (m_2 *MockSeeder_ObtainSeedsClient) RecvMsg(m any) error {
func (m_2 *MockSeeder_ObtainSeedsClient) RecvMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
@ -195,13 +188,13 @@ func (m_2 *MockSeeder_ObtainSeedsClient) RecvMsg(m any) error {
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockSeeder_ObtainSeedsClientMockRecorder) RecvMsg(m any) *gomock.Call {
func (mr *MockSeeder_ObtainSeedsClientMockRecorder) RecvMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockSeeder_ObtainSeedsClient)(nil).RecvMsg), m)
}
// SendMsg mocks base method.
func (m_2 *MockSeeder_ObtainSeedsClient) SendMsg(m any) error {
func (m_2 *MockSeeder_ObtainSeedsClient) SendMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
@ -209,7 +202,7 @@ func (m_2 *MockSeeder_ObtainSeedsClient) SendMsg(m any) error {
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockSeeder_ObtainSeedsClientMockRecorder) SendMsg(m any) *gomock.Call {
func (mr *MockSeeder_ObtainSeedsClientMockRecorder) SendMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockSeeder_ObtainSeedsClient)(nil).SendMsg), m)
}
@ -232,7 +225,6 @@ func (mr *MockSeeder_ObtainSeedsClientMockRecorder) Trailer() *gomock.Call {
type MockSeeder_SyncPieceTasksClient struct {
ctrl *gomock.Controller
recorder *MockSeeder_SyncPieceTasksClientMockRecorder
isgomock struct{}
}
// MockSeeder_SyncPieceTasksClientMockRecorder is the mock recorder for MockSeeder_SyncPieceTasksClient.
@ -311,7 +303,7 @@ func (mr *MockSeeder_SyncPieceTasksClientMockRecorder) Recv() *gomock.Call {
}
// RecvMsg mocks base method.
func (m_2 *MockSeeder_SyncPieceTasksClient) RecvMsg(m any) error {
func (m_2 *MockSeeder_SyncPieceTasksClient) RecvMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
@ -319,7 +311,7 @@ func (m_2 *MockSeeder_SyncPieceTasksClient) RecvMsg(m any) error {
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockSeeder_SyncPieceTasksClientMockRecorder) RecvMsg(m any) *gomock.Call {
func (mr *MockSeeder_SyncPieceTasksClientMockRecorder) RecvMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockSeeder_SyncPieceTasksClient)(nil).RecvMsg), m)
}
@ -333,13 +325,13 @@ func (m *MockSeeder_SyncPieceTasksClient) Send(arg0 *common.PieceTaskRequest) er
}
// Send indicates an expected call of Send.
func (mr *MockSeeder_SyncPieceTasksClientMockRecorder) Send(arg0 any) *gomock.Call {
func (mr *MockSeeder_SyncPieceTasksClientMockRecorder) Send(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockSeeder_SyncPieceTasksClient)(nil).Send), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockSeeder_SyncPieceTasksClient) SendMsg(m any) error {
func (m_2 *MockSeeder_SyncPieceTasksClient) SendMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
@ -347,7 +339,7 @@ func (m_2 *MockSeeder_SyncPieceTasksClient) SendMsg(m any) error {
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockSeeder_SyncPieceTasksClientMockRecorder) SendMsg(m any) *gomock.Call {
func (mr *MockSeeder_SyncPieceTasksClientMockRecorder) SendMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockSeeder_SyncPieceTasksClient)(nil).SendMsg), m)
}
@ -370,7 +362,6 @@ func (mr *MockSeeder_SyncPieceTasksClientMockRecorder) Trailer() *gomock.Call {
type MockSeederServer struct {
ctrl *gomock.Controller
recorder *MockSeederServerMockRecorder
isgomock struct{}
}
// MockSeederServerMockRecorder is the mock recorder for MockSeederServer.
@ -400,7 +391,7 @@ func (m *MockSeederServer) GetPieceTasks(arg0 context.Context, arg1 *common.Piec
}
// GetPieceTasks indicates an expected call of GetPieceTasks.
func (mr *MockSeederServerMockRecorder) GetPieceTasks(arg0, arg1 any) *gomock.Call {
func (mr *MockSeederServerMockRecorder) GetPieceTasks(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPieceTasks", reflect.TypeOf((*MockSeederServer)(nil).GetPieceTasks), arg0, arg1)
}
@ -414,7 +405,7 @@ func (m *MockSeederServer) ObtainSeeds(arg0 *cdnsystem.SeedRequest, arg1 cdnsyst
}
// ObtainSeeds indicates an expected call of ObtainSeeds.
func (mr *MockSeederServerMockRecorder) ObtainSeeds(arg0, arg1 any) *gomock.Call {
func (mr *MockSeederServerMockRecorder) ObtainSeeds(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ObtainSeeds", reflect.TypeOf((*MockSeederServer)(nil).ObtainSeeds), arg0, arg1)
}
@ -428,7 +419,7 @@ func (m *MockSeederServer) SyncPieceTasks(arg0 cdnsystem.Seeder_SyncPieceTasksSe
}
// SyncPieceTasks indicates an expected call of SyncPieceTasks.
func (mr *MockSeederServerMockRecorder) SyncPieceTasks(arg0 any) *gomock.Call {
func (mr *MockSeederServerMockRecorder) SyncPieceTasks(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncPieceTasks", reflect.TypeOf((*MockSeederServer)(nil).SyncPieceTasks), arg0)
}
@ -437,7 +428,6 @@ func (mr *MockSeederServerMockRecorder) SyncPieceTasks(arg0 any) *gomock.Call {
type MockUnsafeSeederServer struct {
ctrl *gomock.Controller
recorder *MockUnsafeSeederServerMockRecorder
isgomock struct{}
}
// MockUnsafeSeederServerMockRecorder is the mock recorder for MockUnsafeSeederServer.
@ -473,7 +463,6 @@ func (mr *MockUnsafeSeederServerMockRecorder) mustEmbedUnimplementedSeederServer
type MockSeeder_ObtainSeedsServer struct {
ctrl *gomock.Controller
recorder *MockSeeder_ObtainSeedsServerMockRecorder
isgomock struct{}
}
// MockSeeder_ObtainSeedsServerMockRecorder is the mock recorder for MockSeeder_ObtainSeedsServer.
@ -508,7 +497,7 @@ func (mr *MockSeeder_ObtainSeedsServerMockRecorder) Context() *gomock.Call {
}
// RecvMsg mocks base method.
func (m_2 *MockSeeder_ObtainSeedsServer) RecvMsg(m any) error {
func (m_2 *MockSeeder_ObtainSeedsServer) RecvMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
@ -516,7 +505,7 @@ func (m_2 *MockSeeder_ObtainSeedsServer) RecvMsg(m any) error {
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockSeeder_ObtainSeedsServerMockRecorder) RecvMsg(m any) *gomock.Call {
func (mr *MockSeeder_ObtainSeedsServerMockRecorder) RecvMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockSeeder_ObtainSeedsServer)(nil).RecvMsg), m)
}
@ -530,7 +519,7 @@ func (m *MockSeeder_ObtainSeedsServer) Send(arg0 *cdnsystem.PieceSeed) error {
}
// Send indicates an expected call of Send.
func (mr *MockSeeder_ObtainSeedsServerMockRecorder) Send(arg0 any) *gomock.Call {
func (mr *MockSeeder_ObtainSeedsServerMockRecorder) Send(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockSeeder_ObtainSeedsServer)(nil).Send), arg0)
}
@ -544,13 +533,13 @@ func (m *MockSeeder_ObtainSeedsServer) SendHeader(arg0 metadata.MD) error {
}
// SendHeader indicates an expected call of SendHeader.
func (mr *MockSeeder_ObtainSeedsServerMockRecorder) SendHeader(arg0 any) *gomock.Call {
func (mr *MockSeeder_ObtainSeedsServerMockRecorder) SendHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockSeeder_ObtainSeedsServer)(nil).SendHeader), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockSeeder_ObtainSeedsServer) SendMsg(m any) error {
func (m_2 *MockSeeder_ObtainSeedsServer) SendMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
@ -558,7 +547,7 @@ func (m_2 *MockSeeder_ObtainSeedsServer) SendMsg(m any) error {
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockSeeder_ObtainSeedsServerMockRecorder) SendMsg(m any) *gomock.Call {
func (mr *MockSeeder_ObtainSeedsServerMockRecorder) SendMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockSeeder_ObtainSeedsServer)(nil).SendMsg), m)
}
@ -572,7 +561,7 @@ func (m *MockSeeder_ObtainSeedsServer) SetHeader(arg0 metadata.MD) error {
}
// SetHeader indicates an expected call of SetHeader.
func (mr *MockSeeder_ObtainSeedsServerMockRecorder) SetHeader(arg0 any) *gomock.Call {
func (mr *MockSeeder_ObtainSeedsServerMockRecorder) SetHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockSeeder_ObtainSeedsServer)(nil).SetHeader), arg0)
}
@ -584,7 +573,7 @@ func (m *MockSeeder_ObtainSeedsServer) SetTrailer(arg0 metadata.MD) {
}
// SetTrailer indicates an expected call of SetTrailer.
func (mr *MockSeeder_ObtainSeedsServerMockRecorder) SetTrailer(arg0 any) *gomock.Call {
func (mr *MockSeeder_ObtainSeedsServerMockRecorder) SetTrailer(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockSeeder_ObtainSeedsServer)(nil).SetTrailer), arg0)
}
@ -593,7 +582,6 @@ func (mr *MockSeeder_ObtainSeedsServerMockRecorder) SetTrailer(arg0 any) *gomock
type MockSeeder_SyncPieceTasksServer struct {
ctrl *gomock.Controller
recorder *MockSeeder_SyncPieceTasksServerMockRecorder
isgomock struct{}
}
// MockSeeder_SyncPieceTasksServerMockRecorder is the mock recorder for MockSeeder_SyncPieceTasksServer.
@ -643,7 +631,7 @@ func (mr *MockSeeder_SyncPieceTasksServerMockRecorder) Recv() *gomock.Call {
}
// RecvMsg mocks base method.
func (m_2 *MockSeeder_SyncPieceTasksServer) RecvMsg(m any) error {
func (m_2 *MockSeeder_SyncPieceTasksServer) RecvMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
@ -651,7 +639,7 @@ func (m_2 *MockSeeder_SyncPieceTasksServer) RecvMsg(m any) error {
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockSeeder_SyncPieceTasksServerMockRecorder) RecvMsg(m any) *gomock.Call {
func (mr *MockSeeder_SyncPieceTasksServerMockRecorder) RecvMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockSeeder_SyncPieceTasksServer)(nil).RecvMsg), m)
}
@ -665,7 +653,7 @@ func (m *MockSeeder_SyncPieceTasksServer) Send(arg0 *common.PiecePacket) error {
}
// Send indicates an expected call of Send.
func (mr *MockSeeder_SyncPieceTasksServerMockRecorder) Send(arg0 any) *gomock.Call {
func (mr *MockSeeder_SyncPieceTasksServerMockRecorder) Send(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockSeeder_SyncPieceTasksServer)(nil).Send), arg0)
}
@ -679,13 +667,13 @@ func (m *MockSeeder_SyncPieceTasksServer) SendHeader(arg0 metadata.MD) error {
}
// SendHeader indicates an expected call of SendHeader.
func (mr *MockSeeder_SyncPieceTasksServerMockRecorder) SendHeader(arg0 any) *gomock.Call {
func (mr *MockSeeder_SyncPieceTasksServerMockRecorder) SendHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockSeeder_SyncPieceTasksServer)(nil).SendHeader), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockSeeder_SyncPieceTasksServer) SendMsg(m any) error {
func (m_2 *MockSeeder_SyncPieceTasksServer) SendMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
@ -693,7 +681,7 @@ func (m_2 *MockSeeder_SyncPieceTasksServer) SendMsg(m any) error {
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockSeeder_SyncPieceTasksServerMockRecorder) SendMsg(m any) *gomock.Call {
func (mr *MockSeeder_SyncPieceTasksServerMockRecorder) SendMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockSeeder_SyncPieceTasksServer)(nil).SendMsg), m)
}
@ -707,7 +695,7 @@ func (m *MockSeeder_SyncPieceTasksServer) SetHeader(arg0 metadata.MD) error {
}
// SetHeader indicates an expected call of SetHeader.
func (mr *MockSeeder_SyncPieceTasksServerMockRecorder) SetHeader(arg0 any) *gomock.Call {
func (mr *MockSeeder_SyncPieceTasksServerMockRecorder) SetHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockSeeder_SyncPieceTasksServer)(nil).SetHeader), arg0)
}
@ -719,7 +707,7 @@ func (m *MockSeeder_SyncPieceTasksServer) SetTrailer(arg0 metadata.MD) {
}
// SetTrailer indicates an expected call of SetTrailer.
func (mr *MockSeeder_SyncPieceTasksServerMockRecorder) SetTrailer(arg0 any) *gomock.Call {
func (mr *MockSeeder_SyncPieceTasksServerMockRecorder) SetTrailer(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockSeeder_SyncPieceTasksServer)(nil).SetTrailer), arg0)
}

View File

@ -233,16 +233,14 @@ func (PieceStyle) EnumDescriptor() ([]byte, []int) {
type SizeScope int32
const (
// NORMAL task has pieces is more than one piece.
// size > one piece size.
SizeScope_NORMAL SizeScope = 0
// SMALL task's content length is more than 128 byte and has only one piece.
// 128 byte < size <= one piece size and be plain type.
SizeScope_SMALL SizeScope = 1
// TINY task's content length is less than 128 byte.
// size <= 128 byte and be plain type.
SizeScope_TINY SizeScope = 2
// EMPTY task's content length is equal to zero.
// size == 0 byte and be plain type.
SizeScope_EMPTY SizeScope = 3
// UNKNOW task has invalid size scope.
SizeScope_UNKNOW SizeScope = 4
)
// Enum value maps for SizeScope.
@ -252,14 +250,12 @@ var (
1: "SMALL",
2: "TINY",
3: "EMPTY",
4: "UNKNOW",
}
SizeScope_value = map[string]int32{
"NORMAL": 0,
"SMALL": 1,
"TINY": 2,
"EMPTY": 3,
"UNKNOW": 4,
}
)
@ -959,6 +955,8 @@ type Host struct {
Port int32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"`
// Port of download server.
DownloadPort int32 `protobuf:"varint,5,opt,name=download_port,json=downloadPort,proto3" json:"download_port,omitempty"`
// Security domain for network.
SecurityDomain string `protobuf:"bytes,6,opt,name=security_domain,json=securityDomain,proto3" json:"security_domain,omitempty"`
// Host location, eg: area|country|province|city.
Location string `protobuf:"bytes,7,opt,name=location,proto3" json:"location,omitempty"`
// IDC where the peer host is located.
@ -1032,6 +1030,13 @@ func (x *Host) GetDownloadPort() int32 {
return 0
}
func (x *Host) GetSecurityDomain() string {
if x != nil {
return x.SecurityDomain
}
return ""
}
func (x *Host) GetLocation() string {
if x != nil {
return x.Location
@ -1057,182 +1062,180 @@ var file_pkg_apis_common_v1_common_proto_rawDesc = []byte{
0x72, 0x12, 0x20, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x0c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63,
0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xa3, 0x03,
0x0a, 0x07, 0x55, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x7d, 0x0a, 0x06, 0x64, 0x69, 0x67,
0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x65, 0xfa, 0x42, 0x62, 0x72, 0x60,
0x32, 0x5b, 0x5e, 0x28, 0x6d, 0x64, 0x35, 0x3a, 0x5b, 0x61, 0x2d, 0x66, 0x41, 0x2d, 0x46, 0x30,
0x2d, 0x39, 0x5d, 0x7b, 0x33, 0x32, 0x7d, 0x7c, 0x73, 0x68, 0x61, 0x31, 0x3a, 0x5b, 0x61, 0x2d,
0x66, 0x41, 0x2d, 0x46, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x34, 0x30, 0x7d, 0x7c, 0x73, 0x68, 0x61,
0x32, 0x35, 0x36, 0x3a, 0x5b, 0x61, 0x2d, 0x66, 0x41, 0x2d, 0x46, 0x30, 0x2d, 0x39, 0x5d, 0x7b,
0x36, 0x34, 0x7d, 0x7c, 0x73, 0x68, 0x61, 0x35, 0x31, 0x32, 0x3a, 0x5b, 0x61, 0x2d, 0x66, 0x41,
0x2d, 0x46, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x31, 0x32, 0x38, 0x7d, 0x29, 0x24, 0xd0, 0x01, 0x01,
0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x2f, 0x0a, 0x05, 0x72, 0x61,
0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xfa, 0x42, 0x16, 0x72, 0x14,
0x32, 0x0f, 0x5e, 0x5b, 0x30, 0x2d, 0x39, 0x5d, 0x2b, 0x2d, 0x5b, 0x30, 0x2d, 0x39, 0x5d, 0x2a,
0x24, 0xd0, 0x01, 0x01, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66,
0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c,
0x74, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x72, 0x6c,
0x4d, 0x65, 0x74, 0x61, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79,
0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x6c,
0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61,
0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x08, 0x70, 0x72,
0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x63,
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x52, 0x08,
0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x1a, 0x39, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64,
0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
0x02, 0x38, 0x01, 0x22, 0xbd, 0x01, 0x0a, 0x10, 0x50, 0x69, 0x65, 0x63, 0x65, 0x54, 0x61, 0x73,
0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b,
0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02,
0x10, 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x07, 0x73, 0x72,
0x63, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04,
0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x73, 0x72, 0x63, 0x50, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x07,
0x64, 0x73, 0x74, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa,
0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x64, 0x73, 0x74, 0x50, 0x69, 0x64, 0x12, 0x24,
0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28,
0x0d, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x2a, 0x02, 0x28, 0x00, 0x52, 0x08, 0x73, 0x74, 0x61, 0x72,
0x74, 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20,
0x01, 0x28, 0x0d, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x2a, 0x02, 0x28, 0x00, 0x52, 0x05, 0x6c, 0x69,
0x6d, 0x69, 0x74, 0x22, 0xe3, 0x02, 0x0a, 0x09, 0x50, 0x69, 0x65, 0x63, 0x65, 0x49, 0x6e, 0x66,
0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01,
0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x28,
0x0a, 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20,
0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x00, 0x52, 0x0a, 0x72, 0x61,
0x6e, 0x67, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x72, 0x61, 0x6e, 0x67,
0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x07, 0xfa, 0x42,
0x04, 0x2a, 0x02, 0x28, 0x00, 0x52, 0x09, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65,
0x12, 0x58, 0x0a, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6d, 0x64, 0x35, 0x18, 0x04, 0x20,
0x01, 0x28, 0x09, 0x42, 0x3b, 0xfa, 0x42, 0x38, 0x72, 0x36, 0x32, 0x31, 0x28, 0x5b, 0x61, 0x2d,
0x66, 0x5c, 0x64, 0x5d, 0x7b, 0x33, 0x32, 0x7d, 0x7c, 0x5b, 0x41, 0x2d, 0x46, 0x5c, 0x64, 0x5d,
0x7b, 0x33, 0x32, 0x7d, 0x7c, 0x5b, 0x61, 0x2d, 0x66, 0x5c, 0x64, 0x5d, 0x7b, 0x31, 0x36, 0x7d,
0x7c, 0x5b, 0x41, 0x2d, 0x46, 0x5c, 0x64, 0x5d, 0x7b, 0x31, 0x36, 0x7d, 0x29, 0xd0, 0x01, 0x01,
0x52, 0x08, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4d, 0x64, 0x35, 0x12, 0x2a, 0x0a, 0x0c, 0x70, 0x69,
0x65, 0x63, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04,
0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x00, 0x52, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65,
0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x33, 0x0a, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f,
0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x63, 0x6f,
0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52,
0x0a, 0x70, 0x69, 0x65, 0x63, 0x65, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x2c, 0x0a, 0x0d, 0x64,
0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x63, 0x6f, 0x73, 0x74, 0x18, 0x07, 0x20, 0x01,
0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x00, 0x52, 0x0c, 0x64, 0x6f, 0x77,
0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x73, 0x74, 0x22, 0xc2, 0x01, 0x0a, 0x0f, 0x45, 0x78,
0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x3b, 0x0a,
0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e,
0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74,
0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74,
0x72, 0x79, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74,
0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73,
0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61,
0x74, 0x75, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74,
0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xdb,
0x02, 0x0a, 0x0b, 0x50, 0x69, 0x65, 0x63, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x20,
0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42,
0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64,
0x12, 0x20, 0x0a, 0x07, 0x64, 0x73, 0x74, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x64, 0x73, 0x74, 0x50,
0x69, 0x64, 0x12, 0x22, 0x0a, 0x08, 0x64, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x04,
0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x64,
0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x12, 0x32, 0x0a, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f,
0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x63, 0x6f,
0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a,
0x70, 0x69, 0x65, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f,
0x74, 0x61, 0x6c, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52,
0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x69, 0x65, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63,
0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x07, 0x20,
0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x6e, 0x67,
0x74, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6d, 0x64, 0x35, 0x5f,
0x73, 0x69, 0x67, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x65, 0x63,
0x65, 0x4d, 0x64, 0x35, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x42, 0x0a, 0x10, 0x65, 0x78, 0x74, 0x65,
0x6e, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x74, 0x65,
0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x0f, 0x65, 0x78, 0x74,
0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, 0xf8, 0x01, 0x0a,
0x04, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17,
0x0a, 0x02, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72,
0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x70, 0x12, 0x23, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02,
0x68, 0x01, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x04,
0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x1a,
0x07, 0x10, 0xff, 0xff, 0x03, 0x28, 0x80, 0x08, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x31,
0x0a, 0x0d, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18,
0x05, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x1a, 0x07, 0x10, 0xff, 0xff, 0x03,
0x28, 0x80, 0x08, 0x52, 0x0c, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x6f, 0x72,
0x74, 0x12, 0x26, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20,
0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0xd0, 0x01, 0x01, 0x52,
0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x03, 0x69, 0x64, 0x63,
0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0xd0,
0x01, 0x01, 0x52, 0x03, 0x69, 0x64, 0x63, 0x2a, 0xd9, 0x05, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65,
0x12, 0x11, 0x0a, 0x0d, 0x58, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,
0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0xc8,
0x01, 0x12, 0x16, 0x0a, 0x11, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55, 0x6e, 0x61, 0x76, 0x61,
0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x10, 0xf4, 0x03, 0x12, 0x13, 0x0a, 0x0e, 0x52, 0x65, 0x73,
0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x10, 0xe8, 0x07, 0x12, 0x18,
0x0a, 0x13, 0x42, 0x61, 0x63, 0x6b, 0x54, 0x6f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x62,
0x6f, 0x72, 0x74, 0x65, 0x64, 0x10, 0xe9, 0x07, 0x12, 0x0f, 0x0a, 0x0a, 0x42, 0x61, 0x64, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x10, 0xf8, 0x0a, 0x12, 0x15, 0x0a, 0x10, 0x50, 0x65, 0x65,
0x72, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xfc, 0x0a,
0x12, 0x11, 0x0a, 0x0c, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72,
0x10, 0xdc, 0x0b, 0x12, 0x13, 0x0a, 0x0e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x69,
0x6d, 0x65, 0x4f, 0x75, 0x74, 0x10, 0xe0, 0x0b, 0x12, 0x10, 0x0a, 0x0b, 0x43, 0x6c, 0x69, 0x65,
0x6e, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xa0, 0x1f, 0x12, 0x1b, 0x0a, 0x16, 0x43, 0x6c,
0x69, 0x65, 0x6e, 0x74, 0x50, 0x69, 0x65, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x46, 0x61, 0x69, 0x6c, 0x10, 0xa1, 0x1f, 0x12, 0x1a, 0x0a, 0x15, 0x43, 0x6c, 0x69, 0x65, 0x6e,
0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74,
0x10, 0xa2, 0x1f, 0x12, 0x1a, 0x0a, 0x15, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e,
0x74, 0x65, 0x78, 0x74, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x10, 0xa3, 0x1f, 0x12,
0x19, 0x0a, 0x14, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x57, 0x61, 0x69, 0x74, 0x50, 0x69, 0x65,
0x63, 0x65, 0x52, 0x65, 0x61, 0x64, 0x79, 0x10, 0xa4, 0x1f, 0x12, 0x1c, 0x0a, 0x17, 0x43, 0x6c,
0x69, 0x65, 0x6e, 0x74, 0x50, 0x69, 0x65, 0x63, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61,
0x64, 0x46, 0x61, 0x69, 0x6c, 0x10, 0xa5, 0x1f, 0x12, 0x1b, 0x0a, 0x16, 0x43, 0x6c, 0x69, 0x65,
0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x46, 0x61,
0x69, 0x6c, 0x10, 0xa6, 0x1f, 0x12, 0x1a, 0x0a, 0x15, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43,
0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xa7,
0x1f, 0x12, 0x1a, 0x0a, 0x15, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x53,
0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xa8, 0x1f, 0x12, 0x18, 0x0a,
0x13, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x69, 0x65, 0x63, 0x65, 0x4e, 0x6f, 0x74, 0x46,
0x6f, 0x75, 0x6e, 0x64, 0x10, 0xb4, 0x22, 0x12, 0x0f, 0x0a, 0x0a, 0x53, 0x63, 0x68, 0x65, 0x64,
0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x88, 0x27, 0x12, 0x18, 0x0a, 0x13, 0x53, 0x63, 0x68, 0x65,
0x64, 0x4e, 0x65, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x10,
0x89, 0x27, 0x12, 0x12, 0x0a, 0x0d, 0x53, 0x63, 0x68, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x47,
0x6f, 0x6e, 0x65, 0x10, 0x8a, 0x27, 0x12, 0x16, 0x0a, 0x11, 0x53, 0x63, 0x68, 0x65, 0x64, 0x50,
0x65, 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0x8c, 0x27, 0x12, 0x23,
0x0a, 0x1e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x50, 0x69, 0x65, 0x63, 0x65,
0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x46, 0x61, 0x69, 0x6c,
0x10, 0x8d, 0x27, 0x12, 0x19, 0x0a, 0x14, 0x53, 0x63, 0x68, 0x65, 0x64, 0x54, 0x61, 0x73, 0x6b,
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x8e, 0x27, 0x12, 0x14,
0x0a, 0x0f, 0x53, 0x63, 0x68, 0x65, 0x64, 0x52, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65,
0x72, 0x10, 0x8f, 0x27, 0x12, 0x13, 0x0a, 0x0e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x46, 0x6f, 0x72,
0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x10, 0x90, 0x27, 0x12, 0x18, 0x0a, 0x13, 0x43, 0x44, 0x4e,
0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x46, 0x61, 0x69, 0x6c,
0x10, 0xf1, 0x2e, 0x12, 0x14, 0x0a, 0x0f, 0x43, 0x44, 0x4e, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f,
0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0x84, 0x32, 0x12, 0x18, 0x0a, 0x13, 0x49, 0x6e, 0x76,
0x61, 0x6c, 0x69, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65,
0x10, 0xd9, 0x36, 0x2a, 0x17, 0x0a, 0x0a, 0x50, 0x69, 0x65, 0x63, 0x65, 0x53, 0x74, 0x79, 0x6c,
0x65, 0x12, 0x09, 0x0a, 0x05, 0x50, 0x4c, 0x41, 0x49, 0x4e, 0x10, 0x00, 0x2a, 0x43, 0x0a, 0x09,
0x53, 0x69, 0x7a, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x52,
0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x4d, 0x41, 0x4c, 0x4c, 0x10, 0x01,
0x12, 0x08, 0x0a, 0x04, 0x54, 0x49, 0x4e, 0x59, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x4d,
0x50, 0x54, 0x59, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x10,
0x04, 0x2a, 0x30, 0x0a, 0x08, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a,
0x06, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x66, 0x43,
0x61, 0x63, 0x68, 0x65, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x66, 0x53, 0x74, 0x6f, 0x72,
0x65, 0x10, 0x02, 0x2a, 0x5e, 0x0a, 0x08, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12,
0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x30, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4c,
0x45, 0x56, 0x45, 0x4c, 0x31, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c,
0x32, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x33, 0x10, 0x03, 0x12,
0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x34, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x4c,
0x45, 0x56, 0x45, 0x4c, 0x35, 0x10, 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c,
0x36, 0x10, 0x06, 0x42, 0x29, 0x5a, 0x27, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x63, 0x6f,
0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xe5, 0x02,
0x0a, 0x07, 0x55, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x3f, 0x0a, 0x06, 0x64, 0x69, 0x67,
0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xfa, 0x42, 0x24, 0x72, 0x22,
0x32, 0x1d, 0x5e, 0x28, 0x6d, 0x64, 0x35, 0x29, 0x7c, 0x28, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36,
0x29, 0x3a, 0x5b, 0x41, 0x2d, 0x46, 0x61, 0x2d, 0x66, 0x30, 0x2d, 0x39, 0x5d, 0x2b, 0x24, 0xd0,
0x01, 0x01, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61,
0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x2f, 0x0a, 0x05,
0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xfa, 0x42, 0x16,
0x72, 0x14, 0x32, 0x0f, 0x5e, 0x5b, 0x30, 0x2d, 0x39, 0x5d, 0x2b, 0x2d, 0x5b, 0x30, 0x2d, 0x39,
0x5d, 0x2a, 0x24, 0xd0, 0x01, 0x01, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a,
0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66,
0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18,
0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55,
0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74,
0x72, 0x79, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x70,
0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x08,
0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10,
0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79,
0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x1a, 0x39, 0x0a, 0x0b, 0x48, 0x65,
0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xbd, 0x01, 0x0a, 0x10, 0x50, 0x69, 0x65, 0x63, 0x65, 0x54,
0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x61,
0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04,
0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x07,
0x73, 0x72, 0x63, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa,
0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x73, 0x72, 0x63, 0x50, 0x69, 0x64, 0x12, 0x20,
0x0a, 0x07, 0x64, 0x73, 0x74, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42,
0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x64, 0x73, 0x74, 0x50, 0x69, 0x64,
0x12, 0x24, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20,
0x01, 0x28, 0x0d, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x2a, 0x02, 0x28, 0x00, 0x52, 0x08, 0x73, 0x74,
0x61, 0x72, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18,
0x05, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x2a, 0x02, 0x28, 0x00, 0x52, 0x05,
0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0xe3, 0x02, 0x0a, 0x09, 0x50, 0x69, 0x65, 0x63, 0x65, 0x49,
0x6e, 0x66, 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4e, 0x75, 0x6d,
0x12, 0x28, 0x0a, 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18,
0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x00, 0x52, 0x0a,
0x72, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x72, 0x61,
0x6e, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x07,
0xfa, 0x42, 0x04, 0x2a, 0x02, 0x28, 0x00, 0x52, 0x09, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x69,
0x7a, 0x65, 0x12, 0x58, 0x0a, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6d, 0x64, 0x35, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3b, 0xfa, 0x42, 0x38, 0x72, 0x36, 0x32, 0x31, 0x28, 0x5b,
0x61, 0x2d, 0x66, 0x5c, 0x64, 0x5d, 0x7b, 0x33, 0x32, 0x7d, 0x7c, 0x5b, 0x41, 0x2d, 0x46, 0x5c,
0x64, 0x5d, 0x7b, 0x33, 0x32, 0x7d, 0x7c, 0x5b, 0x61, 0x2d, 0x66, 0x5c, 0x64, 0x5d, 0x7b, 0x31,
0x36, 0x7d, 0x7c, 0x5b, 0x41, 0x2d, 0x46, 0x5c, 0x64, 0x5d, 0x7b, 0x31, 0x36, 0x7d, 0x29, 0xd0,
0x01, 0x01, 0x52, 0x08, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4d, 0x64, 0x35, 0x12, 0x2a, 0x0a, 0x0c,
0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01,
0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x00, 0x52, 0x0b, 0x70, 0x69, 0x65,
0x63, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x33, 0x0a, 0x0b, 0x70, 0x69, 0x65, 0x63,
0x65, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e,
0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x53, 0x74, 0x79, 0x6c,
0x65, 0x52, 0x0a, 0x70, 0x69, 0x65, 0x63, 0x65, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x2c, 0x0a,
0x0d, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x63, 0x6f, 0x73, 0x74, 0x18, 0x07,
0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x00, 0x52, 0x0c, 0x64,
0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x73, 0x74, 0x22, 0xc2, 0x01, 0x0a, 0x0f,
0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12,
0x3b, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x23, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x41,
0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45,
0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b,
0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a,
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73,
0x74, 0x61, 0x74, 0x75, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45,
0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01,
0x22, 0xdb, 0x02, 0x0a, 0x0b, 0x50, 0x69, 0x65, 0x63, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74,
0x12, 0x20, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b,
0x49, 0x64, 0x12, 0x20, 0x0a, 0x07, 0x64, 0x73, 0x74, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x64, 0x73,
0x74, 0x50, 0x69, 0x64, 0x12, 0x22, 0x0a, 0x08, 0x64, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72,
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52,
0x07, 0x64, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x12, 0x32, 0x0a, 0x0b, 0x70, 0x69, 0x65, 0x63,
0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e,
0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f,
0x52, 0x0a, 0x70, 0x69, 0x65, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x1f, 0x0a, 0x0b,
0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28,
0x05, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x69, 0x65, 0x63, 0x65, 0x12, 0x25, 0x0a,
0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18,
0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x65,
0x6e, 0x67, 0x74, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6d, 0x64,
0x35, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69,
0x65, 0x63, 0x65, 0x4d, 0x64, 0x35, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x42, 0x0a, 0x10, 0x65, 0x78,
0x74, 0x65, 0x6e, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x09,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x78,
0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x0f, 0x65,
0x78, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, 0xad,
0x02, 0x0a, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64,
0x12, 0x17, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42,
0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x70, 0x12, 0x23, 0x0a, 0x08, 0x68, 0x6f, 0x73,
0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04,
0x72, 0x02, 0x68, 0x01, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20,
0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0c, 0xfa, 0x42,
0x09, 0x1a, 0x07, 0x10, 0xff, 0xff, 0x03, 0x28, 0x80, 0x08, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74,
0x12, 0x31, 0x0a, 0x0d, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x70, 0x6f, 0x72,
0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x1a, 0x07, 0x10, 0xff,
0xff, 0x03, 0x28, 0x80, 0x08, 0x52, 0x0c, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50,
0x6f, 0x72, 0x74, 0x12, 0x33, 0x0a, 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f,
0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42,
0x07, 0x72, 0x05, 0x10, 0x01, 0xd0, 0x01, 0x01, 0x52, 0x0e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69,
0x74, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x26, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72,
0x05, 0x10, 0x01, 0xd0, 0x01, 0x01, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x12, 0x1c, 0x0a, 0x03, 0x69, 0x64, 0x63, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa,
0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0xd0, 0x01, 0x01, 0x52, 0x03, 0x69, 0x64, 0x63, 0x2a, 0xd9,
0x05, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x11, 0x0a, 0x0d, 0x58, 0x5f, 0x55, 0x4e, 0x53,
0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x07, 0x53, 0x75,
0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0xc8, 0x01, 0x12, 0x16, 0x0a, 0x11, 0x53, 0x65, 0x72, 0x76,
0x65, 0x72, 0x55, 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x10, 0xf4, 0x03,
0x12, 0x13, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x61, 0x63, 0x6b,
0x65, 0x64, 0x10, 0xe8, 0x07, 0x12, 0x18, 0x0a, 0x13, 0x42, 0x61, 0x63, 0x6b, 0x54, 0x6f, 0x53,
0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x62, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x10, 0xe9, 0x07, 0x12,
0x0f, 0x0a, 0x0a, 0x42, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x10, 0xf8, 0x0a,
0x12, 0x15, 0x0a, 0x10, 0x50, 0x65, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x74, 0x46,
0x6f, 0x75, 0x6e, 0x64, 0x10, 0xfc, 0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x55, 0x6e, 0x6b, 0x6e, 0x6f,
0x77, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xdc, 0x0b, 0x12, 0x13, 0x0a, 0x0e, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x4f, 0x75, 0x74, 0x10, 0xe0, 0x0b, 0x12,
0x10, 0x0a, 0x0b, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xa0,
0x1f, 0x12, 0x1b, 0x0a, 0x16, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x69, 0x65, 0x63, 0x65,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x10, 0xa1, 0x1f, 0x12, 0x1a,
0x0a, 0x15, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65,
0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x10, 0xa2, 0x1f, 0x12, 0x1a, 0x0a, 0x15, 0x43, 0x6c,
0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x43, 0x61, 0x6e, 0x63, 0x65,
0x6c, 0x65, 0x64, 0x10, 0xa3, 0x1f, 0x12, 0x19, 0x0a, 0x14, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74,
0x57, 0x61, 0x69, 0x74, 0x50, 0x69, 0x65, 0x63, 0x65, 0x52, 0x65, 0x61, 0x64, 0x79, 0x10, 0xa4,
0x1f, 0x12, 0x1c, 0x0a, 0x17, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x69, 0x65, 0x63, 0x65,
0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x46, 0x61, 0x69, 0x6c, 0x10, 0xa5, 0x1f, 0x12,
0x1b, 0x0a, 0x16, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x4c, 0x69, 0x6d, 0x69, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x10, 0xa6, 0x1f, 0x12, 0x1a, 0x0a, 0x15,
0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xa7, 0x1f, 0x12, 0x1a, 0x0a, 0x15, 0x43, 0x6c, 0x69, 0x65,
0x6e, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x72, 0x72, 0x6f,
0x72, 0x10, 0xa8, 0x1f, 0x12, 0x18, 0x0a, 0x13, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x69,
0x65, 0x63, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xb4, 0x22, 0x12, 0x0f,
0x0a, 0x0a, 0x53, 0x63, 0x68, 0x65, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x88, 0x27, 0x12,
0x18, 0x0a, 0x13, 0x53, 0x63, 0x68, 0x65, 0x64, 0x4e, 0x65, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b,
0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x10, 0x89, 0x27, 0x12, 0x12, 0x0a, 0x0d, 0x53, 0x63, 0x68,
0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x47, 0x6f, 0x6e, 0x65, 0x10, 0x8a, 0x27, 0x12, 0x16, 0x0a,
0x11, 0x53, 0x63, 0x68, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75,
0x6e, 0x64, 0x10, 0x8c, 0x27, 0x12, 0x23, 0x0a, 0x1e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x50, 0x65,
0x65, 0x72, 0x50, 0x69, 0x65, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x70,
0x6f, 0x72, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x10, 0x8d, 0x27, 0x12, 0x19, 0x0a, 0x14, 0x53, 0x63,
0x68, 0x65, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x45, 0x72, 0x72,
0x6f, 0x72, 0x10, 0x8e, 0x27, 0x12, 0x14, 0x0a, 0x0f, 0x53, 0x63, 0x68, 0x65, 0x64, 0x52, 0x65,
0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x10, 0x8f, 0x27, 0x12, 0x13, 0x0a, 0x0e, 0x53,
0x63, 0x68, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x10, 0x90, 0x27,
0x12, 0x18, 0x0a, 0x13, 0x43, 0x44, 0x4e, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x67, 0x69, 0x73,
0x74, 0x72, 0x79, 0x46, 0x61, 0x69, 0x6c, 0x10, 0xf1, 0x2e, 0x12, 0x14, 0x0a, 0x0f, 0x43, 0x44,
0x4e, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0x84, 0x32,
0x12, 0x18, 0x0a, 0x13, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75,
0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x10, 0xd9, 0x36, 0x2a, 0x17, 0x0a, 0x0a, 0x50, 0x69,
0x65, 0x63, 0x65, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x50, 0x4c, 0x41, 0x49,
0x4e, 0x10, 0x00, 0x2a, 0x37, 0x0a, 0x09, 0x53, 0x69, 0x7a, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65,
0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05,
0x53, 0x4d, 0x41, 0x4c, 0x4c, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x49, 0x4e, 0x59, 0x10,
0x02, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x4d, 0x50, 0x54, 0x59, 0x10, 0x03, 0x2a, 0x30, 0x0a, 0x08,
0x54, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x6f, 0x72, 0x6d,
0x61, 0x6c, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x66, 0x43, 0x61, 0x63, 0x68, 0x65, 0x10,
0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x66, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x10, 0x02, 0x2a, 0x5e,
0x0a, 0x08, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45,
0x56, 0x45, 0x4c, 0x30, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x31,
0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x32, 0x10, 0x02, 0x12, 0x0a,
0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x33, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45,
0x56, 0x45, 0x4c, 0x34, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x35,
0x10, 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x36, 0x10, 0x06, 0x42, 0x26,
0x5a, 0x24, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6b, 0x67,
0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b,
0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -164,7 +164,7 @@ func (m *UrlMeta) validate(all bool) error {
if !_UrlMeta_Digest_Pattern.MatchString(m.GetDigest()) {
err := UrlMetaValidationError{
field: "Digest",
reason: "value does not match regex pattern \"^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128})$\"",
reason: "value does not match regex pattern \"^(md5)|(sha256):[A-Fa-f0-9]+$\"",
}
if !all {
return err
@ -276,7 +276,7 @@ var _ interface {
ErrorName() string
} = UrlMetaValidationError{}
var _UrlMeta_Digest_Pattern = regexp.MustCompile("^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128})$")
var _UrlMeta_Digest_Pattern = regexp.MustCompile("^(md5)|(sha256):[A-Fa-f0-9]+$")
var _UrlMeta_Range_Pattern = regexp.MustCompile("^[0-9]+-[0-9]*$")
@ -983,6 +983,21 @@ func (m *Host) validate(all bool) error {
errors = append(errors, err)
}
if m.GetSecurityDomain() != "" {
if utf8.RuneCountInString(m.GetSecurityDomain()) < 1 {
err := HostValidationError{
field: "SecurityDomain",
reason: "value length must be at least 1 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
}
if m.GetLocation() != "" {
if utf8.RuneCountInString(m.GetLocation()) < 1 {

View File

@ -20,7 +20,7 @@ package common;
import "validate/validate.proto";
option go_package = "d7y.io/api/v2/pkg/apis/common/v1;common";
option go_package = "d7y.io/api/pkg/apis/common/v1;common";
// Code represents the code of the grpc api.
enum Code {
@ -163,7 +163,7 @@ message GrpcDfError {
// UrlMeta describes url meta info.
message UrlMeta {
// Digest checks integrity of url content, for example md5:xxx or sha256:yyy.
string digest = 1 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128})$", ignore_empty:true}];
string digest = 1 [(validate.rules).string = {pattern: "^(md5)|(sha256):[A-Fa-f0-9]+$", ignore_empty:true}];
// URL tag identifies different task for same url, conflict with digest.
string tag = 2;
// Content range for url.
@ -241,6 +241,8 @@ message Host {
int32 port = 4 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
// Port of download server.
int32 download_port = 5 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
// Security domain for network.
string security_domain = 6 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Host location, eg: area|country|province|city.
string location = 7 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// IDC where the peer host is located.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,7 @@ import "validate/validate.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
option go_package = "d7y.io/api/v2/pkg/apis/common/v2;common";
option go_package = "d7y.io/api/pkg/apis/common/v2;common";
// SizeScope represents size scope of task.
enum SizeScope {
@ -44,24 +44,18 @@ enum SizeScope {
// TaskType represents type of task.
enum TaskType {
// STANDARD is standard type of task, it can download from source, remote peer and
// local peer(local cache). When the standard task is never downloaded in the
// P2P cluster, dfdaemon will download the task from the source. When the standard
// task is downloaded in the P2P cluster, dfdaemon will download the task from
// the remote peer or local peer(local cache).
STANDARD = 0;
// DFDAEMON is dfdeamon type of task,
// dfdeamon task is a normal p2p task.
DFDAEMON = 0;
// PERSISTENT is persistent type of task, it can import file and export file in P2P cluster.
// When the persistent task is imported into the P2P cluster, dfdaemon will store
// the task in the peer's disk and copy multiple replicas to remote peers to
// prevent data loss.
PERSISTENT = 1;
// DFCACHE is dfcache type of task,
// dfcache task is a cache task, and the task url is fake url.
// It can only be used for caching and cannot be downloaded back to source.
DFCACHE = 1;
// PERSIST_CACHE is persistent cache type of task, it can import file and export file in P2P cluster.
// When the persistent cache task is imported into the P2P cluster, dfdaemon will store
// the task in the peer's disk and copy multiple replicas to remote peers to prevent data loss.
// When the expiration time is reached, task will be deleted in the P2P cluster.
PERSISTENT_CACHE = 2;
// DFSTORE is dfstore type of task,
// dfstore task is a persistent task in backend.
DFSTORE = 2;
}
// TrafficType represents type of traffic.
@ -117,7 +111,7 @@ message Peer {
// Peer id.
string id = 1 [(validate.rules).string.min_len = 1];
// Range is url range of request.
optional Range range = 2;
Range range = 2;
// Peer priority.
Priority priority = 3 [(validate.rules).enum.defined_only = true];
// Pieces of peer.
@ -138,29 +132,6 @@ message Peer {
google.protobuf.Timestamp updated_at = 11 [(validate.rules).timestamp.required = true];
}
// PersistentCachePeer metadata.
message PersistentCachePeer {
// Peer id.
string id = 1 [(validate.rules).string.min_len = 1];
// Persistent represents whether the persistent cache peer is persistent.
// If the persistent cache peer is persistent, the persistent cache peer will
// not be deleted when dfdaemon runs garbage collection. It only be deleted
// when the task is deleted by the user.
bool persistent = 2;
// Peer downloads costs time.
google.protobuf.Duration cost = 3 [(validate.rules).duration.required = true];
// Peer state.
string state = 4 [(validate.rules).string.min_len = 1];
// Task info.
PersistentCacheTask task = 5 [(validate.rules).message.required = true];
// Host info.
Host host = 6 [(validate.rules).message.required = true];
// Peer create time.
google.protobuf.Timestamp created_at = 7 [(validate.rules).timestamp.required = true];
// Peer update time.
google.protobuf.Timestamp updated_at = 8 [(validate.rules).timestamp.required = true];
}
// Task metadata.
message Task {
// Task id.
@ -169,351 +140,124 @@ message Task {
TaskType type = 2 [(validate.rules).enum.defined_only = true];
// Download url.
string url = 3 [(validate.rules).string.uri = true];
// Verifies task data integrity after download using a digest. Supports CRC32, SHA256, and SHA512 algorithms.
// Format: `<algorithm>:<hash>`, e.g., `crc32:xxx`, `sha256:yyy`, `sha512:zzz`.
// Returns an error if the computed digest mismatches the expected value.
//
// Performance
// Digest calculation increases processing time. Enable only when data integrity verification is critical.
optional string digest = 4 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]+)$", ignore_empty: true}];
// Digest of the pieces digest, for example md5:xxx or sha256:yyy.
string digest = 4 [(validate.rules).string = {pattern: "^(md5)|(sha256):[A-Fa-f0-9]+$", ignore_empty: true}];
// URL tag identifies different task for same url.
optional string tag = 5;
string tag = 5;
// Application of task.
optional string application = 6;
// Filtered query params to generate the task id.
// When filter is ["Signature", "Expires", "ns"], for example:
// http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io and http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io
// will generate the same task id.
// Default value includes the filtered query params of s3, gcs, oss, obs, cos.
repeated string filtered_query_params = 7;
string application = 6;
// Filter url used to generate task id.
repeated string filters = 7;
// Task request headers.
map<string, string> request_header = 8;
// Task content length.
uint64 content_length = 9;
// Task piece count.
uint32 piece_count = 10;
// Task size scope.
SizeScope size_scope = 11;
// Pieces of task.
repeated Piece pieces = 12 [(validate.rules).repeated = {min_items: 1, ignore_empty: true}];
// Task state.
string state = 13 [(validate.rules).string.min_len = 1];
// Task peer count.
uint32 peer_count = 14;
// Task contains available peer.
bool has_available_peer = 15;
// Task create time.
google.protobuf.Timestamp created_at = 16 [(validate.rules).timestamp.required = true];
// Task update time.
google.protobuf.Timestamp updated_at = 17 [(validate.rules).timestamp.required = true];
}
// PersistentCacheTask metadata.
message PersistentCacheTask {
// Task id.
string id = 1 [(validate.rules).string.min_len = 1];
// Replica count of the persistent cache task. The persistent cache task will
// not be deleted when dfdamon runs garbage collection. It only be deleted
// when the task is deleted by the user.
uint64 persistent_replica_count = 2 [(validate.rules).uint64.gte = 1];
// Current replica count of the persistent cache task. The persistent cache task
// will not be deleted when dfdaemon runs garbage collection. It only be deleted
// when the task is deleted by the user.
uint64 current_persistent_replica_count = 3;
// Current replica count of the cache task. If cache task is not persistent,
// the persistent cache task will be deleted when dfdaemon runs garbage collection.
uint64 current_replica_count = 4;
// Tag is used to distinguish different persistent cache tasks.
optional string tag = 5;
// Application of task.
optional string application = 6;
map<string, string> header = 8;
// Task piece length.
uint64 piece_length = 7 [(validate.rules).uint64.gte = 4194304];
int32 piece_length = 9 [(validate.rules).int32.gte = 1];
// Task content length.
uint64 content_length = 8;
int64 content_length = 10 [(validate.rules).int64.gte = 1];
// Task piece count.
uint32 piece_count = 9;
int64 piece_count = 11 [(validate.rules).int64.gte = 0];
// Task size scope.
SizeScope size_scope = 12;
// Pieces of task.
repeated Piece pieces = 13 [(validate.rules).repeated = {min_items: 1, ignore_empty: true}];
// Task state.
string state = 10 [(validate.rules).string.min_len = 1];
// TTL of the persistent cache task.
google.protobuf.Duration ttl = 11 [(validate.rules).duration.required = true];
string state = 14 [(validate.rules).string.min_len = 1];
// Task peer count.
int32 peer_count = 15 [(validate.rules).int32.gte = 0];
// Task contains available peer.
bool hasAvailablePeer = 16;
// Task create time.
google.protobuf.Timestamp created_at = 12 [(validate.rules).timestamp.required = true];
google.protobuf.Timestamp created_at = 17 [(validate.rules).timestamp.required = true];
// Task update time.
google.protobuf.Timestamp updated_at = 13 [(validate.rules).timestamp.required = true];
google.protobuf.Timestamp updated_at = 18 [(validate.rules).timestamp.required = true];
}
// Host metadata.
message Host {
// Host id.
string id = 1 [(validate.rules).string.min_len = 1];
// Host type.
uint32 type = 2 [(validate.rules).uint32.lte = 3];
// Hostname.
string hostname = 3 [(validate.rules).string.min_len = 1];
// Host ip.
string ip = 4 [(validate.rules).string.ip = true];
string ip = 2 [(validate.rules).string.min_len = 1];
// Peer hostname.
string hostname = 3 [(validate.rules).string.hostname = true];
// Port of grpc service.
int32 port = 5 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
// Port of download server.
int32 download_port = 6 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
// Host OS.
string os = 7;
// Host platform.
string platform = 8;
// Host platform family.
string platform_family = 9;
// Host platform version.
string platform_version = 10;
// Host kernel version.
string kernel_version = 11;
// CPU Stat.
optional CPU cpu = 12;
// Memory Stat.
optional Memory memory = 13;
// Network Stat.
optional Network network = 14;
// Disk Stat.
optional Disk disk = 15;
// Build information.
optional Build build = 16;
// ID of the cluster to which the host belongs.
uint64 scheduler_cluster_id = 17;
// Disable shared data for other peers.
bool disable_shared = 18;
int32 port = 4 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
// Port of download server.
int32 download_port = 5 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
// Security domain for network.
string security_domain = 6 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Host location, eg: area|country|province|city.
string location = 7 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// IDC where the peer host is located.
string idc = 8 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
}
// CPU Stat.
message CPU {
// Number of logical cores in the system.
uint32 logical_count = 1;
// Number of physical cores in the system
uint32 physical_count = 2;
// Percent calculates the percentage of cpu used.
double percent = 3 [(validate.rules).double.gte = 0];
// Calculates the percentage of cpu used by process.
double process_percent = 4 [(validate.rules).double.gte = 0];
// CPUTimes contains the amounts of time the CPU has spent performing different kinds of work.
optional CPUTimes times = 5;
}
// CPUTimes contains the amounts of time the CPU has spent performing different
// kinds of work. Time units are in seconds.
message CPUTimes {
// CPU time of user.
double user = 1 [(validate.rules).double.gte = 0];
// CPU time of system.
double system = 2 [(validate.rules).double.gte = 0];
// CPU time of idle.
double idle = 3 [(validate.rules).double.gte = 0];
// CPU time of nice.
double nice = 4 [(validate.rules).double.gte = 0];
// CPU time of iowait.
double iowait = 5 [(validate.rules).double.gte = 0];
// CPU time of irq.
double irq = 6 [(validate.rules).double.gte = 0];
// CPU time of softirq.
double softirq = 7 [(validate.rules).double.gte = 0];
// CPU time of steal.
double steal = 8 [(validate.rules).double.gte = 0];
// CPU time of guest.
double guest = 9 [(validate.rules).double.gte = 0];
// CPU time of guest nice.
double guest_nice = 10 [(validate.rules).double.gte = 0];
}
// Memory Stat.
message Memory {
// Total amount of RAM on this system.
uint64 total = 1;
// RAM available for programs to allocate.
uint64 available = 2;
// RAM used by programs.
uint64 used = 3;
// Percentage of RAM used by programs.
double used_percent = 4 [(validate.rules).double = {gte: 0, lte: 100}];
// Calculates the percentage of memory used by process.
double process_used_percent = 5 [(validate.rules).double = {gte: 0, lte: 100}];
// This is the kernel's notion of free memory.
uint64 free = 6;
}
// Network Stat.
message Network {
// Return count of tcp connections opened and status is ESTABLISHED.
uint32 tcp_connection_count = 1;
// Return count of upload tcp connections opened and status is ESTABLISHED.
uint32 upload_tcp_connection_count = 2;
// Location path(area|country|province|city|...).
optional string location = 3;
// IDC where the peer host is located
optional string idc = 4;
// Download rate is received bytes per second.
uint64 download_rate = 5;
// Download rate is the limit of received bytes per second.
uint64 download_rate_limit = 6;
// Upload rate is transmitted bytes per second.
uint64 upload_rate = 7;
// Upload rate is the limit of transmitted bytes per second.
uint64 upload_rate_limit = 8;
}
// Disk Stat.
message Disk {
// Total amount of disk on the data path of dragonfly.
uint64 total = 1;
// Free amount of disk on the data path of dragonfly.
uint64 free = 2;
// Used amount of disk on the data path of dragonfly.
uint64 used = 3;
// Used percent of disk on the data path of dragonfly directory.
double used_percent = 4 [(validate.rules).double = {gte: 0, lte: 100}];
// Total amount of indoes on the data path of dragonfly directory.
uint64 inodes_total = 5;
// Used amount of indoes on the data path of dragonfly directory.
uint64 inodes_used = 6;
// Free amount of indoes on the data path of dragonfly directory.
uint64 inodes_free = 7;
// Used percent of indoes on the data path of dragonfly directory.
double inodes_used_percent = 8 [(validate.rules).double = {gte: 0, lte: 100}];
// Disk read bandwidth, in bytes per second.
uint64 read_bandwidth = 9;
// Disk write bandwidth, in bytes per second.
uint64 write_bandwidth = 10;
}
// Build information.
message Build {
// Git version.
string git_version = 1;
// Git commit.
optional string git_commit = 2;
// Golang version.
optional string go_version = 3;
// Rust version.
optional string rust_version = 4;
// Build platform.
optional string platform = 5;
// Range represents download range.
message Range {
// Start of range.
int64 start = 1;
// Length of range.
int64 length = 2;
}
// Download information.
message Download {
// Download url.
string url = 1 [(validate.rules).string.uri = true];
// Digest of the task digest, for example blake3:xxx or sha256:yyy.
optional string digest = 2 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]+)$", ignore_empty: true}];
// Range is url range of request. If protocol is http, range
// will set in request header. If protocol is others, range
// will set in range field.
optional Range range = 3;
// Digest of the pieces digest, for example md5:xxx or sha256:yyy.
string digest = 2 [(validate.rules).string = {pattern: "^(md5)|(sha256):[A-Fa-f0-9]+$", ignore_empty: true}];
// Range is url range of request.
Range range = 3;
// Task type.
TaskType type = 4 [(validate.rules).enum.defined_only = true];
// URL tag identifies different task for same url.
optional string tag = 5;
string tag = 5;
// Application of task.
optional string application = 6;
string application = 6;
// Peer priority.
Priority priority = 7 [(validate.rules).enum.defined_only = true];
// Filtered query params to generate the task id.
// When filter is ["Signature", "Expires", "ns"], for example:
// http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io and http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io
// will generate the same task id.
// Default value includes the filtered query params of s3, gcs, oss, obs, cos.
repeated string filtered_query_params = 8;
// Filter url used to generate task id.
repeated string filters = 8;
// Task request headers.
map<string, string> request_header = 9;
// Task piece length, the value needs to be greater than or equal to 4194304(4MiB).
optional uint64 piece_length = 10 [(validate.rules).uint64 = {gte: 4194304, ignore_empty: true}];
// File path to be downloaded. If output_path is set, the downloaded file will be saved to the specified path.
// Dfdaemon will try to create hard link to the output path before starting the download. If hard link creation fails,
// it will copy the file to the output path after the download is completed.
// For more details refer to https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.
optional string output_path = 11 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
map<string, string> header = 9;
// Task piece length.
int32 piece_length = 10 [(validate.rules).int32.gte = 1];
// File path to be exported.
string output_path = 11 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Download timeout.
optional google.protobuf.Duration timeout = 12;
// Dfdaemon cannot download the task from the source if disable_back_to_source is true.
bool disable_back_to_source = 13;
// Scheduler needs to schedule the task downloads from the source if need_back_to_source is true.
google.protobuf.Duration timeout = 12 [(validate.rules).duration.required = true];
// Download rate limit in bytes per second.
double download_rate_limit = 13 [(validate.rules).double.gte = 0];
// NeedBackToSource needs downloaded from source.
bool need_back_to_source = 14;
// certificate_chain is the client certs with DER format for the backend client to download back-to-source.
repeated bytes certificate_chain = 15;
// Prefetch pre-downloads all pieces of the task when the download task request is a range request.
bool prefetch = 16;
// Object storage protocol information.
optional ObjectStorage object_storage = 17;
// HDFS protocol information.
optional HDFS hdfs = 18;
// is_prefetch is the flag to indicate whether the request is a prefetch request.
bool is_prefetch = 19;
// need_piece_content is the flag to indicate whether the response needs to return piece content.
bool need_piece_content = 20;
// load_to_cache indicates whether the content downloaded will be stored in the cache storage.
// Cache storage is designed to store downloaded piece content from preheat tasks,
// allowing other peers to access the content from memory instead of disk.
bool load_to_cache = 21;
// force_hard_link is the flag to indicate whether the download file must be hard linked to the output path.
// For more details refer to https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.
bool force_hard_link = 22;
// content_for_calculating_task_id is the content used to calculate the task id.
// If content_for_calculating_task_id is set, use its value to calculate the task ID.
// Otherwise, calculate the task ID based on url, piece_length, tag, application, and filtered_query_params.
optional string content_for_calculating_task_id = 23;
// remote_ip represents the IP address of the client initiating the download request.
// For proxy requests, it is set to the IP address of the request source.
// For dfget requests, it is set to the IP address of the dfget.
optional string remote_ip = 24 [(validate.rules).string = {ip: true, ignore_empty: true}];
}
// Object Storage related information.
message ObjectStorage {
// Region is the region of the object storage service.
optional string region = 1 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Endpoint is the endpoint of the object storage service.
optional string endpoint = 2 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Access key that used to access the object storage service.
optional string access_key_id = 3 [(validate.rules).string.min_len = 1];
// Access secret that used to access the object storage service.
optional string access_key_secret = 4 [(validate.rules).string.min_len = 1];
// Session token that used to access s3 storage service.
optional string session_token = 5 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Local path to credential file for Google Cloud Storage service OAuth2 authentication.
optional string credential_path = 6 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Predefined ACL that used for the Google Cloud Storage service.
optional string predefined_acl = 7 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
}
// HDFS related information.
message HDFS {
// Delegation token for Web HDFS operator.
optional string delegation_token = 1 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
}
// Range represents download range.
message Range {
// Start of range.
uint64 start = 1;
// Length of range.
uint64 length = 2;
}
// Piece represents information of piece.
message Piece {
// Piece number.
uint32 number = 1;
int32 number = 1 [(validate.rules).int32.gte = 0];
// Parent peer id.
optional string parent_id = 2 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
string parent_id = 2 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Piece offset.
uint64 offset = 3;
uint64 offset = 3 [(validate.rules).uint64.gte = 0];
// Piece length.
uint64 length = 4;
// Digest of the piece data, for example blake3:xxx or sha256:yyy.
string digest = 5 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]+)$", ignore_empty: true}];
// Piece content.
optional bytes content = 6 [(validate.rules).bytes = {min_len: 1, ignore_empty: true}];
uint64 length = 4 [(validate.rules).uint64.gt = 0];
// Digest of the piece data, for example md5:xxx or sha256:yyy.
string digest = 5 [(validate.rules).string = {pattern: "^(md5)|(sha256):[A-Fa-f0-9]+$", ignore_empty: true}];
// Traffic type.
optional TrafficType traffic_type = 7;
TrafficType traffic_type = 6;
// Downloading piece costs time.
google.protobuf.Duration cost = 8 [(validate.rules).duration.required = true];
google.protobuf.Duration cost = 7 [(validate.rules).duration.required = true];
// Piece create time.
google.protobuf.Timestamp created_at = 9 [(validate.rules).timestamp.required = true];
google.protobuf.Timestamp created_at = 8 [(validate.rules).timestamp.required = true];
}
// ExtendAttribute represents extend of attribution.
message ExtendAttribute {
// Task response header, eg: HTTP Response Header
map<string, string> header = 1;
// Task response code, eg: HTTP Status Code
int32 status_code = 2 [(validate.rules).int32 = {gte: 100, lt: 599}];
// Task response status, eg: HTTP Status
string status = 3 [(validate.rules).string.min_len = 1];
}

View File

@ -22,7 +22,7 @@
package dfdaemon
import (
v1 "d7y.io/api/v2/pkg/apis/common/v1"
v1 "d7y.io/api/pkg/apis/common/v1"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
@ -38,62 +38,6 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// PeerState represents state of peer task.
type PeerState int32
const (
PeerState_Unknown PeerState = 0
PeerState_Running PeerState = 1
PeerState_Success PeerState = 2
PeerState_Failed PeerState = 3
PeerState_Deleted PeerState = 4
)
// Enum value maps for PeerState.
var (
PeerState_name = map[int32]string{
0: "Unknown",
1: "Running",
2: "Success",
3: "Failed",
4: "Deleted",
}
PeerState_value = map[string]int32{
"Unknown": 0,
"Running": 1,
"Success": 2,
"Failed": 3,
"Deleted": 4,
}
)
func (x PeerState) Enum() *PeerState {
p := new(PeerState)
*p = x
return p
}
func (x PeerState) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (PeerState) Descriptor() protoreflect.EnumDescriptor {
return file_pkg_apis_dfdaemon_v1_dfdaemon_proto_enumTypes[0].Descriptor()
}
func (PeerState) Type() protoreflect.EnumType {
return &file_pkg_apis_dfdaemon_v1_dfdaemon_proto_enumTypes[0]
}
func (x PeerState) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use PeerState.Descriptor instead.
func (PeerState) EnumDescriptor() ([]byte, []int) {
return file_pkg_apis_dfdaemon_v1_dfdaemon_proto_rawDescGZIP(), []int{0}
}
type DownRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -627,118 +571,6 @@ func (x *DeleteTaskRequest) GetUrlMeta() *v1.UrlMeta {
return nil
}
// PeerMetadata represents metadata of a peer task.
type PeerMetadata struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
PeerId string `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
State PeerState `protobuf:"varint,3,opt,name=state,proto3,enum=dfdaemon.PeerState" json:"state,omitempty"`
}
func (x *PeerMetadata) Reset() {
*x = PeerMetadata{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_dfdaemon_v1_dfdaemon_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PeerMetadata) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PeerMetadata) ProtoMessage() {}
func (x *PeerMetadata) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_dfdaemon_v1_dfdaemon_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PeerMetadata.ProtoReflect.Descriptor instead.
func (*PeerMetadata) Descriptor() ([]byte, []int) {
return file_pkg_apis_dfdaemon_v1_dfdaemon_proto_rawDescGZIP(), []int{6}
}
func (x *PeerMetadata) GetTaskId() string {
if x != nil {
return x.TaskId
}
return ""
}
func (x *PeerMetadata) GetPeerId() string {
if x != nil {
return x.PeerId
}
return ""
}
func (x *PeerMetadata) GetState() PeerState {
if x != nil {
return x.State
}
return PeerState_Unknown
}
// PeerExchangeData represents metadata of peer tasks.
type PeerExchangeData struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
PeerMetadatas []*PeerMetadata `protobuf:"bytes,1,rep,name=PeerMetadatas,proto3" json:"PeerMetadatas,omitempty"`
}
func (x *PeerExchangeData) Reset() {
*x = PeerExchangeData{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_dfdaemon_v1_dfdaemon_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PeerExchangeData) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PeerExchangeData) ProtoMessage() {}
func (x *PeerExchangeData) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_dfdaemon_v1_dfdaemon_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PeerExchangeData.ProtoReflect.Descriptor instead.
func (*PeerExchangeData) Descriptor() ([]byte, []int) {
return file_pkg_apis_dfdaemon_v1_dfdaemon_proto_rawDescGZIP(), []int{7}
}
func (x *PeerExchangeData) GetPeerMetadatas() []*PeerMetadata {
if x != nil {
return x.PeerMetadatas
}
return nil
}
var File_pkg_apis_dfdaemon_v1_dfdaemon_proto protoreflect.FileDescriptor
var file_pkg_apis_dfdaemon_v1_dfdaemon_proto_rawDesc = []byte{
@ -750,7 +582,7 @@ var file_pkg_apis_dfdaemon_v1_dfdaemon_proto_rawDesc = []byte{
0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76,
0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x81, 0x03, 0x0a, 0x0b, 0x44, 0x6f, 0x77, 0x6e, 0x52,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf7, 0x02, 0x0a, 0x0b, 0x44, 0x6f, 0x77, 0x6e, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x03, 0x75, 0x72,
0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0x88, 0x01,
@ -764,133 +596,104 @@ var file_pkg_apis_dfdaemon_v1_dfdaemon_proto_rawDesc = []byte{
0x12, 0x2e, 0x0a, 0x13, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b,
0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x64,
0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65,
0x12, 0x34, 0x0a, 0x08, 0x75, 0x72, 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01,
0x12, 0x2a, 0x0a, 0x08, 0x75, 0x72, 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x72, 0x6c, 0x4d,
0x65, 0x74, 0x61, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x07, 0x75,
0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x0a, 0x20,
0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18,
0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x67, 0x69, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x6b, 0x65,
0x65, 0x70, 0x5f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x6f, 0x66, 0x66, 0x73,
0x65, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x6b, 0x65, 0x65, 0x70, 0x4f, 0x72,
0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1c, 0x0a, 0x09,
0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52,
0x09, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x22, 0xb0, 0x01, 0x0a, 0x0a, 0x44,
0x6f, 0x77, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x61, 0x73,
0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72,
0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x07, 0x70,
0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42,
0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x32, 0x0a,
0x10, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74,
0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x00,
0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x4c, 0x65, 0x6e, 0x67, 0x74,
0x68, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52,
0x04, 0x64, 0x6f, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18,
0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x22, 0x81, 0x01,
0x0a, 0x0f, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x19, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07,
0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x34, 0x0a, 0x08,
0x75, 0x72, 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f,
0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x42,
0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x07, 0x75, 0x72, 0x6c, 0x4d, 0x65,
0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x6f, 0x6e, 0x6c, 0x79,
0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x4f, 0x6e, 0x6c,
0x79, 0x22, 0xa7, 0x01, 0x0a, 0x11, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x73, 0x6b,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x03, 0x75,
0x72, 0x6c, 0x12, 0x34, 0x0a, 0x08, 0x75, 0x72, 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x72,
0x6c, 0x4d, 0x65, 0x74, 0x61, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52,
0x07, 0x75, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52,
0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x24, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20,
0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x54, 0x61, 0x73,
0x6b, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x91, 0x02, 0x0a, 0x11,
0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x19, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07,
0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1f, 0x0a, 0x06,
0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42,
0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x21, 0x0a,
0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07,
0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x00, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74,
0x12, 0x24, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x42,
0x0e, 0xfa, 0x42, 0x0b, 0x12, 0x09, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52,
0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x34, 0x0a, 0x08, 0x75, 0x72, 0x6c, 0x5f, 0x6d, 0x65,
0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x2e, 0x55, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01,
0x02, 0x10, 0x01, 0x52, 0x07, 0x75, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03,
0x75, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10,
0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x67, 0x69, 0x64,
0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x09,
0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x4f, 0x6e, 0x6c, 0x79, 0x22,
0x64, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12,
0x34, 0x0a, 0x08, 0x75, 0x72, 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x72, 0x6c, 0x4d, 0x65,
0x74, 0x61, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x07, 0x75, 0x72,
0x6c, 0x4d, 0x65, 0x74, 0x61, 0x22, 0x6b, 0x0a, 0x0c, 0x50, 0x65, 0x65, 0x72, 0x4d, 0x65, 0x74,
0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x17,
0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65,
0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f,
0x6e, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61,
0x74, 0x65, 0x22, 0x50, 0x0a, 0x10, 0x50, 0x65, 0x65, 0x72, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e,
0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x3c, 0x0a, 0x0d, 0x50, 0x65, 0x65, 0x72, 0x4d, 0x65,
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e,
0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x4d, 0x65, 0x74,
0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0d, 0x50, 0x65, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64,
0x61, 0x74, 0x61, 0x73, 0x2a, 0x4b, 0x0a, 0x09, 0x50, 0x65, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74,
0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x0b,
0x0a, 0x07, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x53,
0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x61, 0x69, 0x6c,
0x65, 0x64, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x10,
0x04, 0x32, 0x98, 0x05, 0x0a, 0x06, 0x44, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x08,
0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x15, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65,
0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x14, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x52,
0x65, 0x73, 0x75, 0x6c, 0x74, 0x30, 0x01, 0x12, 0x3e, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x50, 0x69,
0x65, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x18, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x69, 0x65, 0x63,
0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x3d, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b,
0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x43, 0x0a, 0x0e, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69,
0x65, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x18, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x69, 0x65, 0x63,
0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x28, 0x01, 0x30, 0x01, 0x12, 0x3d, 0x0a, 0x08, 0x53,
0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x19, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d,
0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x41, 0x0a, 0x0a, 0x49, 0x6d,
0x70, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1b, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65,
0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x41, 0x0a,
0x0a, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1b, 0x2e, 0x64, 0x66,
0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x73,
0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
0x12, 0x41, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1b,
0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d,
0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x09, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x48, 0x6f, 0x73, 0x74,
0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
0x12, 0x4a, 0x0a, 0x0c, 0x50, 0x65, 0x65, 0x72, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65,
0x12, 0x1a, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x65, 0x72,
0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x1a, 0x2e, 0x64,
0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x45, 0x78, 0x63, 0x68,
0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x28, 0x01, 0x30, 0x01, 0x42, 0x2d, 0x5a, 0x2b,
0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x6b,
0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2f,
0x76, 0x31, 0x3b, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
0x65, 0x74, 0x61, 0x52, 0x07, 0x75, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03,
0x75, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10,
0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x67, 0x69, 0x64,
0x12, 0x30, 0x0a, 0x14, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61,
0x6c, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12,
0x6b, 0x65, 0x65, 0x70, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x4f, 0x66, 0x66, 0x73,
0x65, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x18,
0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65,
0x22, 0xb0, 0x01, 0x0a, 0x0a, 0x44, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12,
0x20, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49,
0x64, 0x12, 0x20, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x70, 0x65, 0x65,
0x72, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64,
0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa,
0x42, 0x04, 0x32, 0x02, 0x28, 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65,
0x64, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x18,
0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f,
0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74,
0x70, 0x75, 0x74, 0x22, 0x77, 0x0a, 0x0f, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x03, 0x75, 0x72,
0x6c, 0x12, 0x2a, 0x0a, 0x08, 0x75, 0x72, 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x02, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x72, 0x6c,
0x4d, 0x65, 0x74, 0x61, 0x52, 0x07, 0x75, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x1d, 0x0a,
0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28,
0x08, 0x52, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x4f, 0x6e, 0x6c, 0x79, 0x22, 0x9d, 0x01, 0x0a,
0x11, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x19, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x2a, 0x0a,
0x08, 0x75, 0x72, 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61,
0x52, 0x07, 0x75, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x04, 0x70, 0x61, 0x74,
0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01,
0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x24, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04,
0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x54, 0x61,
0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x87, 0x02, 0x0a,
0x11, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x19, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1f, 0x0a,
0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa,
0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x21,
0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42,
0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x00, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75,
0x74, 0x12, 0x24, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01,
0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x12, 0x09, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x2a, 0x0a, 0x08, 0x75, 0x72, 0x6c, 0x5f, 0x6d,
0x65, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
0x6f, 0x6e, 0x2e, 0x55, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x07, 0x75, 0x72, 0x6c, 0x4d,
0x65, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03,
0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01,
0x28, 0x03, 0x52, 0x03, 0x67, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c,
0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6c, 0x6f, 0x63,
0x61, 0x6c, 0x4f, 0x6e, 0x6c, 0x79, 0x22, 0x5a, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x03, 0x75,
0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10,
0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x2a, 0x0a, 0x08, 0x75, 0x72, 0x6c, 0x5f, 0x6d, 0x65,
0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x2e, 0x55, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x07, 0x75, 0x72, 0x6c, 0x4d, 0x65,
0x74, 0x61, 0x32, 0x8f, 0x04, 0x0a, 0x06, 0x44, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x12, 0x39, 0x0a,
0x08, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x15, 0x2e, 0x64, 0x66, 0x64, 0x61,
0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x14, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x6f, 0x77, 0x6e,
0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x30, 0x01, 0x12, 0x3e, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x50,
0x69, 0x65, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x18, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
0x6f, 0x6e, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x69, 0x65,
0x63, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x3d, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63,
0x6b, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a,
0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x43, 0x0a, 0x0e, 0x53, 0x79, 0x6e, 0x63, 0x50,
0x69, 0x65, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x18, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
0x6f, 0x6e, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x69, 0x65,
0x63, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x28, 0x01, 0x30, 0x01, 0x12, 0x3d, 0x0a, 0x08,
0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x19, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65,
0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x41, 0x0a, 0x0a, 0x49,
0x6d, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1b, 0x2e, 0x64, 0x66, 0x64, 0x61,
0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x41,
0x0a, 0x0a, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1b, 0x2e, 0x64,
0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x61,
0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74,
0x79, 0x12, 0x41, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12,
0x1b, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74,
0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45,
0x6d, 0x70, 0x74, 0x79, 0x42, 0x2a, 0x5a, 0x28, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61,
0x70, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x64, 0x66, 0x64, 0x61,
0x65, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -905,58 +708,48 @@ func file_pkg_apis_dfdaemon_v1_dfdaemon_proto_rawDescGZIP() []byte {
return file_pkg_apis_dfdaemon_v1_dfdaemon_proto_rawDescData
}
var file_pkg_apis_dfdaemon_v1_dfdaemon_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_pkg_apis_dfdaemon_v1_dfdaemon_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_pkg_apis_dfdaemon_v1_dfdaemon_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_pkg_apis_dfdaemon_v1_dfdaemon_proto_goTypes = []interface{}{
(PeerState)(0), // 0: dfdaemon.PeerState
(*DownRequest)(nil), // 1: dfdaemon.DownRequest
(*DownResult)(nil), // 2: dfdaemon.DownResult
(*StatTaskRequest)(nil), // 3: dfdaemon.StatTaskRequest
(*ImportTaskRequest)(nil), // 4: dfdaemon.ImportTaskRequest
(*ExportTaskRequest)(nil), // 5: dfdaemon.ExportTaskRequest
(*DeleteTaskRequest)(nil), // 6: dfdaemon.DeleteTaskRequest
(*PeerMetadata)(nil), // 7: dfdaemon.PeerMetadata
(*PeerExchangeData)(nil), // 8: dfdaemon.PeerExchangeData
(*v1.UrlMeta)(nil), // 9: common.UrlMeta
(v1.TaskType)(0), // 10: common.TaskType
(*v1.PieceTaskRequest)(nil), // 11: common.PieceTaskRequest
(*emptypb.Empty)(nil), // 12: google.protobuf.Empty
(*v1.PiecePacket)(nil), // 13: common.PiecePacket
(*DownRequest)(nil), // 0: dfdaemon.DownRequest
(*DownResult)(nil), // 1: dfdaemon.DownResult
(*StatTaskRequest)(nil), // 2: dfdaemon.StatTaskRequest
(*ImportTaskRequest)(nil), // 3: dfdaemon.ImportTaskRequest
(*ExportTaskRequest)(nil), // 4: dfdaemon.ExportTaskRequest
(*DeleteTaskRequest)(nil), // 5: dfdaemon.DeleteTaskRequest
(*v1.UrlMeta)(nil), // 6: common.UrlMeta
(v1.TaskType)(0), // 7: common.TaskType
(*v1.PieceTaskRequest)(nil), // 8: common.PieceTaskRequest
(*emptypb.Empty)(nil), // 9: google.protobuf.Empty
(*v1.PiecePacket)(nil), // 10: common.PiecePacket
}
var file_pkg_apis_dfdaemon_v1_dfdaemon_proto_depIdxs = []int32{
9, // 0: dfdaemon.DownRequest.url_meta:type_name -> common.UrlMeta
9, // 1: dfdaemon.StatTaskRequest.url_meta:type_name -> common.UrlMeta
9, // 2: dfdaemon.ImportTaskRequest.url_meta:type_name -> common.UrlMeta
10, // 3: dfdaemon.ImportTaskRequest.type:type_name -> common.TaskType
9, // 4: dfdaemon.ExportTaskRequest.url_meta:type_name -> common.UrlMeta
9, // 5: dfdaemon.DeleteTaskRequest.url_meta:type_name -> common.UrlMeta
0, // 6: dfdaemon.PeerMetadata.state:type_name -> dfdaemon.PeerState
7, // 7: dfdaemon.PeerExchangeData.PeerMetadatas:type_name -> dfdaemon.PeerMetadata
1, // 8: dfdaemon.Daemon.Download:input_type -> dfdaemon.DownRequest
11, // 9: dfdaemon.Daemon.GetPieceTasks:input_type -> common.PieceTaskRequest
12, // 10: dfdaemon.Daemon.CheckHealth:input_type -> google.protobuf.Empty
11, // 11: dfdaemon.Daemon.SyncPieceTasks:input_type -> common.PieceTaskRequest
3, // 12: dfdaemon.Daemon.StatTask:input_type -> dfdaemon.StatTaskRequest
4, // 13: dfdaemon.Daemon.ImportTask:input_type -> dfdaemon.ImportTaskRequest
5, // 14: dfdaemon.Daemon.ExportTask:input_type -> dfdaemon.ExportTaskRequest
6, // 15: dfdaemon.Daemon.DeleteTask:input_type -> dfdaemon.DeleteTaskRequest
12, // 16: dfdaemon.Daemon.LeaveHost:input_type -> google.protobuf.Empty
8, // 17: dfdaemon.Daemon.PeerExchange:input_type -> dfdaemon.PeerExchangeData
2, // 18: dfdaemon.Daemon.Download:output_type -> dfdaemon.DownResult
13, // 19: dfdaemon.Daemon.GetPieceTasks:output_type -> common.PiecePacket
12, // 20: dfdaemon.Daemon.CheckHealth:output_type -> google.protobuf.Empty
13, // 21: dfdaemon.Daemon.SyncPieceTasks:output_type -> common.PiecePacket
12, // 22: dfdaemon.Daemon.StatTask:output_type -> google.protobuf.Empty
12, // 23: dfdaemon.Daemon.ImportTask:output_type -> google.protobuf.Empty
12, // 24: dfdaemon.Daemon.ExportTask:output_type -> google.protobuf.Empty
12, // 25: dfdaemon.Daemon.DeleteTask:output_type -> google.protobuf.Empty
12, // 26: dfdaemon.Daemon.LeaveHost:output_type -> google.protobuf.Empty
8, // 27: dfdaemon.Daemon.PeerExchange:output_type -> dfdaemon.PeerExchangeData
18, // [18:28] is the sub-list for method output_type
8, // [8:18] is the sub-list for method input_type
8, // [8:8] is the sub-list for extension type_name
8, // [8:8] is the sub-list for extension extendee
0, // [0:8] is the sub-list for field type_name
6, // 0: dfdaemon.DownRequest.url_meta:type_name -> common.UrlMeta
6, // 1: dfdaemon.StatTaskRequest.url_meta:type_name -> common.UrlMeta
6, // 2: dfdaemon.ImportTaskRequest.url_meta:type_name -> common.UrlMeta
7, // 3: dfdaemon.ImportTaskRequest.type:type_name -> common.TaskType
6, // 4: dfdaemon.ExportTaskRequest.url_meta:type_name -> common.UrlMeta
6, // 5: dfdaemon.DeleteTaskRequest.url_meta:type_name -> common.UrlMeta
0, // 6: dfdaemon.Daemon.Download:input_type -> dfdaemon.DownRequest
8, // 7: dfdaemon.Daemon.GetPieceTasks:input_type -> common.PieceTaskRequest
9, // 8: dfdaemon.Daemon.CheckHealth:input_type -> google.protobuf.Empty
8, // 9: dfdaemon.Daemon.SyncPieceTasks:input_type -> common.PieceTaskRequest
2, // 10: dfdaemon.Daemon.StatTask:input_type -> dfdaemon.StatTaskRequest
3, // 11: dfdaemon.Daemon.ImportTask:input_type -> dfdaemon.ImportTaskRequest
4, // 12: dfdaemon.Daemon.ExportTask:input_type -> dfdaemon.ExportTaskRequest
5, // 13: dfdaemon.Daemon.DeleteTask:input_type -> dfdaemon.DeleteTaskRequest
1, // 14: dfdaemon.Daemon.Download:output_type -> dfdaemon.DownResult
10, // 15: dfdaemon.Daemon.GetPieceTasks:output_type -> common.PiecePacket
9, // 16: dfdaemon.Daemon.CheckHealth:output_type -> google.protobuf.Empty
10, // 17: dfdaemon.Daemon.SyncPieceTasks:output_type -> common.PiecePacket
9, // 18: dfdaemon.Daemon.StatTask:output_type -> google.protobuf.Empty
9, // 19: dfdaemon.Daemon.ImportTask:output_type -> google.protobuf.Empty
9, // 20: dfdaemon.Daemon.ExportTask:output_type -> google.protobuf.Empty
9, // 21: dfdaemon.Daemon.DeleteTask:output_type -> google.protobuf.Empty
14, // [14:22] is the sub-list for method output_type
6, // [6:14] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
6, // [6:6] is the sub-list for extension extendee
0, // [0:6] is the sub-list for field type_name
}
func init() { file_pkg_apis_dfdaemon_v1_dfdaemon_proto_init() }
@ -1037,44 +830,19 @@ func file_pkg_apis_dfdaemon_v1_dfdaemon_proto_init() {
return nil
}
}
file_pkg_apis_dfdaemon_v1_dfdaemon_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PeerMetadata); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_apis_dfdaemon_v1_dfdaemon_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PeerExchangeData); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_pkg_apis_dfdaemon_v1_dfdaemon_proto_rawDesc,
NumEnums: 1,
NumMessages: 8,
NumEnums: 0,
NumMessages: 6,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_pkg_apis_dfdaemon_v1_dfdaemon_proto_goTypes,
DependencyIndexes: file_pkg_apis_dfdaemon_v1_dfdaemon_proto_depIdxs,
EnumInfos: file_pkg_apis_dfdaemon_v1_dfdaemon_proto_enumTypes,
MessageInfos: file_pkg_apis_dfdaemon_v1_dfdaemon_proto_msgTypes,
}.Build()
File_pkg_apis_dfdaemon_v1_dfdaemon_proto = out.File

View File

@ -18,7 +18,7 @@ import (
"google.golang.org/protobuf/types/known/anypb"
common "d7y.io/api/v2/pkg/apis/common/v1"
common "d7y.io/api/pkg/apis/common/v1"
)
// ensure the imports are used
@ -119,17 +119,6 @@ func (m *DownRequest) validate(all bool) error {
// no validation rules for DisableBackSource
if m.GetUrlMeta() == nil {
err := DownRequestValidationError{
field: "UrlMeta",
reason: "value is required",
}
if !all {
return err
}
errors = append(errors, err)
}
if all {
switch v := interface{}(m.GetUrlMeta()).(type) {
case interface{ ValidateAll() error }:
@ -413,17 +402,6 @@ func (m *StatTaskRequest) validate(all bool) error {
errors = append(errors, err)
}
if m.GetUrlMeta() == nil {
err := StatTaskRequestValidationError{
field: "UrlMeta",
reason: "value is required",
}
if !all {
return err
}
errors = append(errors, err)
}
if all {
switch v := interface{}(m.GetUrlMeta()).(type) {
case interface{ ValidateAll() error }:
@ -566,17 +544,6 @@ func (m *ImportTaskRequest) validate(all bool) error {
errors = append(errors, err)
}
if m.GetUrlMeta() == nil {
err := ImportTaskRequestValidationError{
field: "UrlMeta",
reason: "value is required",
}
if !all {
return err
}
errors = append(errors, err)
}
if all {
switch v := interface{}(m.GetUrlMeta()).(type) {
case interface{ ValidateAll() error }:
@ -765,17 +732,6 @@ func (m *ExportTaskRequest) validate(all bool) error {
errors = append(errors, err)
}
if m.GetUrlMeta() == nil {
err := ExportTaskRequestValidationError{
field: "UrlMeta",
reason: "value is required",
}
if !all {
return err
}
errors = append(errors, err)
}
if all {
switch v := interface{}(m.GetUrlMeta()).(type) {
case interface{ ValidateAll() error }:
@ -924,17 +880,6 @@ func (m *DeleteTaskRequest) validate(all bool) error {
errors = append(errors, err)
}
if m.GetUrlMeta() == nil {
err := DeleteTaskRequestValidationError{
field: "UrlMeta",
reason: "value is required",
}
if !all {
return err
}
errors = append(errors, err)
}
if all {
switch v := interface{}(m.GetUrlMeta()).(type) {
case interface{ ValidateAll() error }:
@ -1043,242 +988,3 @@ var _ interface {
Cause() error
ErrorName() string
} = DeleteTaskRequestValidationError{}
// Validate checks the field values on PeerMetadata with the rules defined in
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *PeerMetadata) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on PeerMetadata with the rules defined
// in the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in PeerMetadataMultiError, or
// nil if none found.
func (m *PeerMetadata) ValidateAll() error {
return m.validate(true)
}
func (m *PeerMetadata) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for TaskId
// no validation rules for PeerId
// no validation rules for State
if len(errors) > 0 {
return PeerMetadataMultiError(errors)
}
return nil
}
// PeerMetadataMultiError is an error wrapping multiple validation errors
// returned by PeerMetadata.ValidateAll() if the designated constraints aren't met.
type PeerMetadataMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m PeerMetadataMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m PeerMetadataMultiError) AllErrors() []error { return m }
// PeerMetadataValidationError is the validation error returned by
// PeerMetadata.Validate if the designated constraints aren't met.
type PeerMetadataValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e PeerMetadataValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e PeerMetadataValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e PeerMetadataValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e PeerMetadataValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e PeerMetadataValidationError) ErrorName() string { return "PeerMetadataValidationError" }
// Error satisfies the builtin error interface
func (e PeerMetadataValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sPeerMetadata.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = PeerMetadataValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = PeerMetadataValidationError{}
// Validate checks the field values on PeerExchangeData with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *PeerExchangeData) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on PeerExchangeData with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// PeerExchangeDataMultiError, or nil if none found.
func (m *PeerExchangeData) ValidateAll() error {
return m.validate(true)
}
func (m *PeerExchangeData) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
for idx, item := range m.GetPeerMetadatas() {
_, _ = idx, item
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, PeerExchangeDataValidationError{
field: fmt.Sprintf("PeerMetadatas[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, PeerExchangeDataValidationError{
field: fmt.Sprintf("PeerMetadatas[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return PeerExchangeDataValidationError{
field: fmt.Sprintf("PeerMetadatas[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
if len(errors) > 0 {
return PeerExchangeDataMultiError(errors)
}
return nil
}
// PeerExchangeDataMultiError is an error wrapping multiple validation errors
// returned by PeerExchangeData.ValidateAll() if the designated constraints
// aren't met.
type PeerExchangeDataMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m PeerExchangeDataMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m PeerExchangeDataMultiError) AllErrors() []error { return m }
// PeerExchangeDataValidationError is the validation error returned by
// PeerExchangeData.Validate if the designated constraints aren't met.
type PeerExchangeDataValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e PeerExchangeDataValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e PeerExchangeDataValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e PeerExchangeDataValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e PeerExchangeDataValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e PeerExchangeDataValidationError) ErrorName() string { return "PeerExchangeDataValidationError" }
// Error satisfies the builtin error interface
func (e PeerExchangeDataValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sPeerExchangeData.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = PeerExchangeDataValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = PeerExchangeDataValidationError{}

View File

@ -22,7 +22,7 @@ import "pkg/apis/common/v1/common.proto";
import "google/protobuf/empty.proto";
import "validate/validate.proto";
option go_package = "d7y.io/api/v2/pkg/apis/dfdaemon/v1;dfdaemon";
option go_package = "d7y.io/api/pkg/apis/dfdaemon/v1;dfdaemon";
message DownRequest{
// Identify one downloading, the framework will fill it automatically.
@ -40,7 +40,7 @@ message DownRequest{
// Disable back-to-source.
bool disable_back_source = 6;
// URL meta info.
common.UrlMeta url_meta = 7 [(validate.rules).message.required = true];
common.UrlMeta url_meta = 7;
// User id.
int64 uid = 10;
// Group id.
@ -68,7 +68,7 @@ message StatTaskRequest{
// Download url.
string url = 1 [(validate.rules).string.min_len = 1];
// URL meta info.
common.UrlMeta url_meta = 2 [(validate.rules).message.required = true];
common.UrlMeta url_meta = 2;
// Check local cache only.
bool local_only = 3;
}
@ -77,7 +77,7 @@ message ImportTaskRequest{
// Download url.
string url = 1 [(validate.rules).string.min_len = 1];
// URL meta info.
common.UrlMeta url_meta = 2 [(validate.rules).message.required = true];
common.UrlMeta url_meta = 2;
// File to be imported.
string path = 3 [(validate.rules).string.min_len = 1];
// Task type.
@ -94,7 +94,7 @@ message ExportTaskRequest{
// Rate limit in bytes per second.
double limit = 4 [(validate.rules).double.gte = 0];
// URL meta info.
common.UrlMeta url_meta = 5 [(validate.rules).message.required = true];
common.UrlMeta url_meta = 5;
// User id.
int64 uid = 7;
// Group id.
@ -107,28 +107,7 @@ message DeleteTaskRequest{
// Download url.
string url = 1 [(validate.rules).string.min_len = 1];
// URL meta info.
common.UrlMeta url_meta = 2 [(validate.rules).message.required = true];
}
// PeerState represents state of peer task.
enum PeerState {
Unknown = 0;
Running = 1;
Success = 2;
Failed = 3;
Deleted = 4;
}
// PeerMetadata represents metadata of a peer task.
message PeerMetadata {
string task_id = 1;
string peer_id = 2;
PeerState state = 3;
}
// PeerExchangeData represents metadata of peer tasks.
message PeerExchangeData {
repeated PeerMetadata PeerMetadatas= 1;
common.UrlMeta url_meta = 2;
}
// Daemon Client RPC Service
@ -149,8 +128,4 @@ service Daemon{
rpc ExportTask(ExportTaskRequest) returns(google.protobuf.Empty);
// Delete file from P2P cache system
rpc DeleteTask(DeleteTaskRequest) returns(google.protobuf.Empty);
// LeaveHost releases host in scheduler.
rpc LeaveHost(google.protobuf.Empty)returns(google.protobuf.Empty);
// Exchange peers between daemons
rpc PeerExchange(stream PeerExchangeData)returns(stream PeerExchangeData);
}

View File

@ -8,7 +8,7 @@ package dfdaemon
import (
context "context"
v1 "d7y.io/api/v2/pkg/apis/common/v1"
v1 "d7y.io/api/pkg/apis/common/v1"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
@ -40,10 +40,6 @@ type DaemonClient interface {
ExportTask(ctx context.Context, in *ExportTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// Delete file from P2P cache system
DeleteTask(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// LeaveHost releases host in scheduler.
LeaveHost(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
// Exchange peers between daemons
PeerExchange(ctx context.Context, opts ...grpc.CallOption) (Daemon_PeerExchangeClient, error)
}
type daemonClient struct {
@ -171,46 +167,6 @@ func (c *daemonClient) DeleteTask(ctx context.Context, in *DeleteTaskRequest, op
return out, nil
}
func (c *daemonClient) LeaveHost(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/dfdaemon.Daemon/LeaveHost", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *daemonClient) PeerExchange(ctx context.Context, opts ...grpc.CallOption) (Daemon_PeerExchangeClient, error) {
stream, err := c.cc.NewStream(ctx, &Daemon_ServiceDesc.Streams[2], "/dfdaemon.Daemon/PeerExchange", opts...)
if err != nil {
return nil, err
}
x := &daemonPeerExchangeClient{stream}
return x, nil
}
type Daemon_PeerExchangeClient interface {
Send(*PeerExchangeData) error
Recv() (*PeerExchangeData, error)
grpc.ClientStream
}
type daemonPeerExchangeClient struct {
grpc.ClientStream
}
func (x *daemonPeerExchangeClient) Send(m *PeerExchangeData) error {
return x.ClientStream.SendMsg(m)
}
func (x *daemonPeerExchangeClient) Recv() (*PeerExchangeData, error) {
m := new(PeerExchangeData)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// DaemonServer is the server API for Daemon service.
// All implementations should embed UnimplementedDaemonServer
// for forward compatibility
@ -231,10 +187,6 @@ type DaemonServer interface {
ExportTask(context.Context, *ExportTaskRequest) (*emptypb.Empty, error)
// Delete file from P2P cache system
DeleteTask(context.Context, *DeleteTaskRequest) (*emptypb.Empty, error)
// LeaveHost releases host in scheduler.
LeaveHost(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
// Exchange peers between daemons
PeerExchange(Daemon_PeerExchangeServer) error
}
// UnimplementedDaemonServer should be embedded to have forward compatible implementations.
@ -265,12 +217,6 @@ func (UnimplementedDaemonServer) ExportTask(context.Context, *ExportTaskRequest)
func (UnimplementedDaemonServer) DeleteTask(context.Context, *DeleteTaskRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteTask not implemented")
}
func (UnimplementedDaemonServer) LeaveHost(context.Context, *emptypb.Empty) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method LeaveHost not implemented")
}
func (UnimplementedDaemonServer) PeerExchange(Daemon_PeerExchangeServer) error {
return status.Errorf(codes.Unimplemented, "method PeerExchange not implemented")
}
// UnsafeDaemonServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to DaemonServer will
@ -438,50 +384,6 @@ func _Daemon_DeleteTask_Handler(srv interface{}, ctx context.Context, dec func(i
return interceptor(ctx, in, info, handler)
}
func _Daemon_LeaveHost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DaemonServer).LeaveHost(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/dfdaemon.Daemon/LeaveHost",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DaemonServer).LeaveHost(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _Daemon_PeerExchange_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(DaemonServer).PeerExchange(&daemonPeerExchangeServer{stream})
}
type Daemon_PeerExchangeServer interface {
Send(*PeerExchangeData) error
Recv() (*PeerExchangeData, error)
grpc.ServerStream
}
type daemonPeerExchangeServer struct {
grpc.ServerStream
}
func (x *daemonPeerExchangeServer) Send(m *PeerExchangeData) error {
return x.ServerStream.SendMsg(m)
}
func (x *daemonPeerExchangeServer) Recv() (*PeerExchangeData, error) {
m := new(PeerExchangeData)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// Daemon_ServiceDesc is the grpc.ServiceDesc for Daemon service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@ -513,10 +415,6 @@ var Daemon_ServiceDesc = grpc.ServiceDesc{
MethodName: "DeleteTask",
Handler: _Daemon_DeleteTask_Handler,
},
{
MethodName: "LeaveHost",
Handler: _Daemon_LeaveHost_Handler,
},
},
Streams: []grpc.StreamDesc{
{
@ -530,12 +428,6 @@ var Daemon_ServiceDesc = grpc.ServiceDesc{
ServerStreams: true,
ClientStreams: true,
},
{
StreamName: "PeerExchange",
Handler: _Daemon_PeerExchange_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "pkg/apis/dfdaemon/v1/dfdaemon.proto",
}

View File

@ -1,10 +1,5 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: ../dfdaemon_grpc.pb.go
//
// Generated by this command:
//
// mockgen -destination dfdaemon_mock.go -source ../dfdaemon_grpc.pb.go -package mocks
//
// Package mocks is a generated GoMock package.
package mocks
@ -13,9 +8,9 @@ import (
context "context"
reflect "reflect"
common "d7y.io/api/v2/pkg/apis/common/v1"
dfdaemon "d7y.io/api/v2/pkg/apis/dfdaemon/v1"
gomock "go.uber.org/mock/gomock"
common "d7y.io/api/pkg/apis/common/v1"
dfdaemon "d7y.io/api/pkg/apis/dfdaemon/v1"
gomock "github.com/golang/mock/gomock"
grpc "google.golang.org/grpc"
metadata "google.golang.org/grpc/metadata"
emptypb "google.golang.org/protobuf/types/known/emptypb"
@ -25,7 +20,6 @@ import (
type MockDaemonClient struct {
ctrl *gomock.Controller
recorder *MockDaemonClientMockRecorder
isgomock struct{}
}
// MockDaemonClientMockRecorder is the mock recorder for MockDaemonClient.
@ -48,7 +42,7 @@ func (m *MockDaemonClient) EXPECT() *MockDaemonClientMockRecorder {
// CheckHealth mocks base method.
func (m *MockDaemonClient) CheckHealth(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -59,16 +53,16 @@ func (m *MockDaemonClient) CheckHealth(ctx context.Context, in *emptypb.Empty, o
}
// CheckHealth indicates an expected call of CheckHealth.
func (mr *MockDaemonClientMockRecorder) CheckHealth(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockDaemonClientMockRecorder) CheckHealth(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckHealth", reflect.TypeOf((*MockDaemonClient)(nil).CheckHealth), varargs...)
}
// DeleteTask mocks base method.
func (m *MockDaemonClient) DeleteTask(ctx context.Context, in *dfdaemon.DeleteTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -79,16 +73,16 @@ func (m *MockDaemonClient) DeleteTask(ctx context.Context, in *dfdaemon.DeleteTa
}
// DeleteTask indicates an expected call of DeleteTask.
func (mr *MockDaemonClientMockRecorder) DeleteTask(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockDaemonClientMockRecorder) DeleteTask(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteTask", reflect.TypeOf((*MockDaemonClient)(nil).DeleteTask), varargs...)
}
// Download mocks base method.
func (m *MockDaemonClient) Download(ctx context.Context, in *dfdaemon.DownRequest, opts ...grpc.CallOption) (dfdaemon.Daemon_DownloadClient, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -99,16 +93,16 @@ func (m *MockDaemonClient) Download(ctx context.Context, in *dfdaemon.DownReques
}
// Download indicates an expected call of Download.
func (mr *MockDaemonClientMockRecorder) Download(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockDaemonClientMockRecorder) Download(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Download", reflect.TypeOf((*MockDaemonClient)(nil).Download), varargs...)
}
// ExportTask mocks base method.
func (m *MockDaemonClient) ExportTask(ctx context.Context, in *dfdaemon.ExportTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -119,16 +113,16 @@ func (m *MockDaemonClient) ExportTask(ctx context.Context, in *dfdaemon.ExportTa
}
// ExportTask indicates an expected call of ExportTask.
func (mr *MockDaemonClientMockRecorder) ExportTask(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockDaemonClientMockRecorder) ExportTask(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportTask", reflect.TypeOf((*MockDaemonClient)(nil).ExportTask), varargs...)
}
// GetPieceTasks mocks base method.
func (m *MockDaemonClient) GetPieceTasks(ctx context.Context, in *common.PieceTaskRequest, opts ...grpc.CallOption) (*common.PiecePacket, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -139,16 +133,16 @@ func (m *MockDaemonClient) GetPieceTasks(ctx context.Context, in *common.PieceTa
}
// GetPieceTasks indicates an expected call of GetPieceTasks.
func (mr *MockDaemonClientMockRecorder) GetPieceTasks(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockDaemonClientMockRecorder) GetPieceTasks(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPieceTasks", reflect.TypeOf((*MockDaemonClient)(nil).GetPieceTasks), varargs...)
}
// ImportTask mocks base method.
func (m *MockDaemonClient) ImportTask(ctx context.Context, in *dfdaemon.ImportTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -159,56 +153,16 @@ func (m *MockDaemonClient) ImportTask(ctx context.Context, in *dfdaemon.ImportTa
}
// ImportTask indicates an expected call of ImportTask.
func (mr *MockDaemonClientMockRecorder) ImportTask(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockDaemonClientMockRecorder) ImportTask(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImportTask", reflect.TypeOf((*MockDaemonClient)(nil).ImportTask), varargs...)
}
// LeaveHost mocks base method.
func (m *MockDaemonClient) LeaveHost(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "LeaveHost", varargs...)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LeaveHost indicates an expected call of LeaveHost.
func (mr *MockDaemonClientMockRecorder) LeaveHost(ctx, in any, opts ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeaveHost", reflect.TypeOf((*MockDaemonClient)(nil).LeaveHost), varargs...)
}
// PeerExchange mocks base method.
func (m *MockDaemonClient) PeerExchange(ctx context.Context, opts ...grpc.CallOption) (dfdaemon.Daemon_PeerExchangeClient, error) {
m.ctrl.T.Helper()
varargs := []any{ctx}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "PeerExchange", varargs...)
ret0, _ := ret[0].(dfdaemon.Daemon_PeerExchangeClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// PeerExchange indicates an expected call of PeerExchange.
func (mr *MockDaemonClientMockRecorder) PeerExchange(ctx any, opts ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeerExchange", reflect.TypeOf((*MockDaemonClient)(nil).PeerExchange), varargs...)
}
// StatTask mocks base method.
func (m *MockDaemonClient) StatTask(ctx context.Context, in *dfdaemon.StatTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -219,16 +173,16 @@ func (m *MockDaemonClient) StatTask(ctx context.Context, in *dfdaemon.StatTaskRe
}
// StatTask indicates an expected call of StatTask.
func (mr *MockDaemonClientMockRecorder) StatTask(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockDaemonClientMockRecorder) StatTask(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StatTask", reflect.TypeOf((*MockDaemonClient)(nil).StatTask), varargs...)
}
// SyncPieceTasks mocks base method.
func (m *MockDaemonClient) SyncPieceTasks(ctx context.Context, opts ...grpc.CallOption) (dfdaemon.Daemon_SyncPieceTasksClient, error) {
m.ctrl.T.Helper()
varargs := []any{ctx}
varargs := []interface{}{ctx}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -239,9 +193,9 @@ func (m *MockDaemonClient) SyncPieceTasks(ctx context.Context, opts ...grpc.Call
}
// SyncPieceTasks indicates an expected call of SyncPieceTasks.
func (mr *MockDaemonClientMockRecorder) SyncPieceTasks(ctx any, opts ...any) *gomock.Call {
func (mr *MockDaemonClientMockRecorder) SyncPieceTasks(ctx interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx}, opts...)
varargs := append([]interface{}{ctx}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncPieceTasks", reflect.TypeOf((*MockDaemonClient)(nil).SyncPieceTasks), varargs...)
}
@ -249,7 +203,6 @@ func (mr *MockDaemonClientMockRecorder) SyncPieceTasks(ctx any, opts ...any) *go
type MockDaemon_DownloadClient struct {
ctrl *gomock.Controller
recorder *MockDaemon_DownloadClientMockRecorder
isgomock struct{}
}
// MockDaemon_DownloadClientMockRecorder is the mock recorder for MockDaemon_DownloadClient.
@ -328,7 +281,7 @@ func (mr *MockDaemon_DownloadClientMockRecorder) Recv() *gomock.Call {
}
// RecvMsg mocks base method.
func (m_2 *MockDaemon_DownloadClient) RecvMsg(m any) error {
func (m_2 *MockDaemon_DownloadClient) RecvMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
@ -336,13 +289,13 @@ func (m_2 *MockDaemon_DownloadClient) RecvMsg(m any) error {
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockDaemon_DownloadClientMockRecorder) RecvMsg(m any) *gomock.Call {
func (mr *MockDaemon_DownloadClientMockRecorder) RecvMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockDaemon_DownloadClient)(nil).RecvMsg), m)
}
// SendMsg mocks base method.
func (m_2 *MockDaemon_DownloadClient) SendMsg(m any) error {
func (m_2 *MockDaemon_DownloadClient) SendMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
@ -350,7 +303,7 @@ func (m_2 *MockDaemon_DownloadClient) SendMsg(m any) error {
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockDaemon_DownloadClientMockRecorder) SendMsg(m any) *gomock.Call {
func (mr *MockDaemon_DownloadClientMockRecorder) SendMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockDaemon_DownloadClient)(nil).SendMsg), m)
}
@ -373,7 +326,6 @@ func (mr *MockDaemon_DownloadClientMockRecorder) Trailer() *gomock.Call {
type MockDaemon_SyncPieceTasksClient struct {
ctrl *gomock.Controller
recorder *MockDaemon_SyncPieceTasksClientMockRecorder
isgomock struct{}
}
// MockDaemon_SyncPieceTasksClientMockRecorder is the mock recorder for MockDaemon_SyncPieceTasksClient.
@ -452,7 +404,7 @@ func (mr *MockDaemon_SyncPieceTasksClientMockRecorder) Recv() *gomock.Call {
}
// RecvMsg mocks base method.
func (m_2 *MockDaemon_SyncPieceTasksClient) RecvMsg(m any) error {
func (m_2 *MockDaemon_SyncPieceTasksClient) RecvMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
@ -460,7 +412,7 @@ func (m_2 *MockDaemon_SyncPieceTasksClient) RecvMsg(m any) error {
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockDaemon_SyncPieceTasksClientMockRecorder) RecvMsg(m any) *gomock.Call {
func (mr *MockDaemon_SyncPieceTasksClientMockRecorder) RecvMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockDaemon_SyncPieceTasksClient)(nil).RecvMsg), m)
}
@ -474,13 +426,13 @@ func (m *MockDaemon_SyncPieceTasksClient) Send(arg0 *common.PieceTaskRequest) er
}
// Send indicates an expected call of Send.
func (mr *MockDaemon_SyncPieceTasksClientMockRecorder) Send(arg0 any) *gomock.Call {
func (mr *MockDaemon_SyncPieceTasksClientMockRecorder) Send(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockDaemon_SyncPieceTasksClient)(nil).Send), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockDaemon_SyncPieceTasksClient) SendMsg(m any) error {
func (m_2 *MockDaemon_SyncPieceTasksClient) SendMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
@ -488,7 +440,7 @@ func (m_2 *MockDaemon_SyncPieceTasksClient) SendMsg(m any) error {
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockDaemon_SyncPieceTasksClientMockRecorder) SendMsg(m any) *gomock.Call {
func (mr *MockDaemon_SyncPieceTasksClientMockRecorder) SendMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockDaemon_SyncPieceTasksClient)(nil).SendMsg), m)
}
@ -507,149 +459,10 @@ func (mr *MockDaemon_SyncPieceTasksClientMockRecorder) Trailer() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockDaemon_SyncPieceTasksClient)(nil).Trailer))
}
// MockDaemon_PeerExchangeClient is a mock of Daemon_PeerExchangeClient interface.
type MockDaemon_PeerExchangeClient struct {
ctrl *gomock.Controller
recorder *MockDaemon_PeerExchangeClientMockRecorder
isgomock struct{}
}
// MockDaemon_PeerExchangeClientMockRecorder is the mock recorder for MockDaemon_PeerExchangeClient.
type MockDaemon_PeerExchangeClientMockRecorder struct {
mock *MockDaemon_PeerExchangeClient
}
// NewMockDaemon_PeerExchangeClient creates a new mock instance.
func NewMockDaemon_PeerExchangeClient(ctrl *gomock.Controller) *MockDaemon_PeerExchangeClient {
mock := &MockDaemon_PeerExchangeClient{ctrl: ctrl}
mock.recorder = &MockDaemon_PeerExchangeClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockDaemon_PeerExchangeClient) EXPECT() *MockDaemon_PeerExchangeClientMockRecorder {
return m.recorder
}
// CloseSend mocks base method.
func (m *MockDaemon_PeerExchangeClient) CloseSend() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CloseSend")
ret0, _ := ret[0].(error)
return ret0
}
// CloseSend indicates an expected call of CloseSend.
func (mr *MockDaemon_PeerExchangeClientMockRecorder) CloseSend() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseSend", reflect.TypeOf((*MockDaemon_PeerExchangeClient)(nil).CloseSend))
}
// Context mocks base method.
func (m *MockDaemon_PeerExchangeClient) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockDaemon_PeerExchangeClientMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockDaemon_PeerExchangeClient)(nil).Context))
}
// Header mocks base method.
func (m *MockDaemon_PeerExchangeClient) Header() (metadata.MD, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Header")
ret0, _ := ret[0].(metadata.MD)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Header indicates an expected call of Header.
func (mr *MockDaemon_PeerExchangeClientMockRecorder) Header() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Header", reflect.TypeOf((*MockDaemon_PeerExchangeClient)(nil).Header))
}
// Recv mocks base method.
func (m *MockDaemon_PeerExchangeClient) Recv() (*dfdaemon.PeerExchangeData, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*dfdaemon.PeerExchangeData)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Recv indicates an expected call of Recv.
func (mr *MockDaemon_PeerExchangeClientMockRecorder) Recv() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockDaemon_PeerExchangeClient)(nil).Recv))
}
// RecvMsg mocks base method.
func (m_2 *MockDaemon_PeerExchangeClient) RecvMsg(m any) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockDaemon_PeerExchangeClientMockRecorder) RecvMsg(m any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockDaemon_PeerExchangeClient)(nil).RecvMsg), m)
}
// Send mocks base method.
func (m *MockDaemon_PeerExchangeClient) Send(arg0 *dfdaemon.PeerExchangeData) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Send indicates an expected call of Send.
func (mr *MockDaemon_PeerExchangeClientMockRecorder) Send(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockDaemon_PeerExchangeClient)(nil).Send), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockDaemon_PeerExchangeClient) SendMsg(m any) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockDaemon_PeerExchangeClientMockRecorder) SendMsg(m any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockDaemon_PeerExchangeClient)(nil).SendMsg), m)
}
// Trailer mocks base method.
func (m *MockDaemon_PeerExchangeClient) Trailer() metadata.MD {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Trailer")
ret0, _ := ret[0].(metadata.MD)
return ret0
}
// Trailer indicates an expected call of Trailer.
func (mr *MockDaemon_PeerExchangeClientMockRecorder) Trailer() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockDaemon_PeerExchangeClient)(nil).Trailer))
}
// MockDaemonServer is a mock of DaemonServer interface.
type MockDaemonServer struct {
ctrl *gomock.Controller
recorder *MockDaemonServerMockRecorder
isgomock struct{}
}
// MockDaemonServerMockRecorder is the mock recorder for MockDaemonServer.
@ -679,7 +492,7 @@ func (m *MockDaemonServer) CheckHealth(arg0 context.Context, arg1 *emptypb.Empty
}
// CheckHealth indicates an expected call of CheckHealth.
func (mr *MockDaemonServerMockRecorder) CheckHealth(arg0, arg1 any) *gomock.Call {
func (mr *MockDaemonServerMockRecorder) CheckHealth(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckHealth", reflect.TypeOf((*MockDaemonServer)(nil).CheckHealth), arg0, arg1)
}
@ -694,7 +507,7 @@ func (m *MockDaemonServer) DeleteTask(arg0 context.Context, arg1 *dfdaemon.Delet
}
// DeleteTask indicates an expected call of DeleteTask.
func (mr *MockDaemonServerMockRecorder) DeleteTask(arg0, arg1 any) *gomock.Call {
func (mr *MockDaemonServerMockRecorder) DeleteTask(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteTask", reflect.TypeOf((*MockDaemonServer)(nil).DeleteTask), arg0, arg1)
}
@ -708,7 +521,7 @@ func (m *MockDaemonServer) Download(arg0 *dfdaemon.DownRequest, arg1 dfdaemon.Da
}
// Download indicates an expected call of Download.
func (mr *MockDaemonServerMockRecorder) Download(arg0, arg1 any) *gomock.Call {
func (mr *MockDaemonServerMockRecorder) Download(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Download", reflect.TypeOf((*MockDaemonServer)(nil).Download), arg0, arg1)
}
@ -723,7 +536,7 @@ func (m *MockDaemonServer) ExportTask(arg0 context.Context, arg1 *dfdaemon.Expor
}
// ExportTask indicates an expected call of ExportTask.
func (mr *MockDaemonServerMockRecorder) ExportTask(arg0, arg1 any) *gomock.Call {
func (mr *MockDaemonServerMockRecorder) ExportTask(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportTask", reflect.TypeOf((*MockDaemonServer)(nil).ExportTask), arg0, arg1)
}
@ -738,7 +551,7 @@ func (m *MockDaemonServer) GetPieceTasks(arg0 context.Context, arg1 *common.Piec
}
// GetPieceTasks indicates an expected call of GetPieceTasks.
func (mr *MockDaemonServerMockRecorder) GetPieceTasks(arg0, arg1 any) *gomock.Call {
func (mr *MockDaemonServerMockRecorder) GetPieceTasks(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPieceTasks", reflect.TypeOf((*MockDaemonServer)(nil).GetPieceTasks), arg0, arg1)
}
@ -753,40 +566,11 @@ func (m *MockDaemonServer) ImportTask(arg0 context.Context, arg1 *dfdaemon.Impor
}
// ImportTask indicates an expected call of ImportTask.
func (mr *MockDaemonServerMockRecorder) ImportTask(arg0, arg1 any) *gomock.Call {
func (mr *MockDaemonServerMockRecorder) ImportTask(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImportTask", reflect.TypeOf((*MockDaemonServer)(nil).ImportTask), arg0, arg1)
}
// LeaveHost mocks base method.
func (m *MockDaemonServer) LeaveHost(arg0 context.Context, arg1 *emptypb.Empty) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LeaveHost", arg0, arg1)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LeaveHost indicates an expected call of LeaveHost.
func (mr *MockDaemonServerMockRecorder) LeaveHost(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeaveHost", reflect.TypeOf((*MockDaemonServer)(nil).LeaveHost), arg0, arg1)
}
// PeerExchange mocks base method.
func (m *MockDaemonServer) PeerExchange(arg0 dfdaemon.Daemon_PeerExchangeServer) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PeerExchange", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// PeerExchange indicates an expected call of PeerExchange.
func (mr *MockDaemonServerMockRecorder) PeerExchange(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeerExchange", reflect.TypeOf((*MockDaemonServer)(nil).PeerExchange), arg0)
}
// StatTask mocks base method.
func (m *MockDaemonServer) StatTask(arg0 context.Context, arg1 *dfdaemon.StatTaskRequest) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
@ -797,7 +581,7 @@ func (m *MockDaemonServer) StatTask(arg0 context.Context, arg1 *dfdaemon.StatTas
}
// StatTask indicates an expected call of StatTask.
func (mr *MockDaemonServerMockRecorder) StatTask(arg0, arg1 any) *gomock.Call {
func (mr *MockDaemonServerMockRecorder) StatTask(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StatTask", reflect.TypeOf((*MockDaemonServer)(nil).StatTask), arg0, arg1)
}
@ -811,7 +595,7 @@ func (m *MockDaemonServer) SyncPieceTasks(arg0 dfdaemon.Daemon_SyncPieceTasksSer
}
// SyncPieceTasks indicates an expected call of SyncPieceTasks.
func (mr *MockDaemonServerMockRecorder) SyncPieceTasks(arg0 any) *gomock.Call {
func (mr *MockDaemonServerMockRecorder) SyncPieceTasks(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncPieceTasks", reflect.TypeOf((*MockDaemonServer)(nil).SyncPieceTasks), arg0)
}
@ -820,7 +604,6 @@ func (mr *MockDaemonServerMockRecorder) SyncPieceTasks(arg0 any) *gomock.Call {
type MockUnsafeDaemonServer struct {
ctrl *gomock.Controller
recorder *MockUnsafeDaemonServerMockRecorder
isgomock struct{}
}
// MockUnsafeDaemonServerMockRecorder is the mock recorder for MockUnsafeDaemonServer.
@ -856,7 +639,6 @@ func (mr *MockUnsafeDaemonServerMockRecorder) mustEmbedUnimplementedDaemonServer
type MockDaemon_DownloadServer struct {
ctrl *gomock.Controller
recorder *MockDaemon_DownloadServerMockRecorder
isgomock struct{}
}
// MockDaemon_DownloadServerMockRecorder is the mock recorder for MockDaemon_DownloadServer.
@ -891,7 +673,7 @@ func (mr *MockDaemon_DownloadServerMockRecorder) Context() *gomock.Call {
}
// RecvMsg mocks base method.
func (m_2 *MockDaemon_DownloadServer) RecvMsg(m any) error {
func (m_2 *MockDaemon_DownloadServer) RecvMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
@ -899,7 +681,7 @@ func (m_2 *MockDaemon_DownloadServer) RecvMsg(m any) error {
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockDaemon_DownloadServerMockRecorder) RecvMsg(m any) *gomock.Call {
func (mr *MockDaemon_DownloadServerMockRecorder) RecvMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockDaemon_DownloadServer)(nil).RecvMsg), m)
}
@ -913,7 +695,7 @@ func (m *MockDaemon_DownloadServer) Send(arg0 *dfdaemon.DownResult) error {
}
// Send indicates an expected call of Send.
func (mr *MockDaemon_DownloadServerMockRecorder) Send(arg0 any) *gomock.Call {
func (mr *MockDaemon_DownloadServerMockRecorder) Send(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockDaemon_DownloadServer)(nil).Send), arg0)
}
@ -927,13 +709,13 @@ func (m *MockDaemon_DownloadServer) SendHeader(arg0 metadata.MD) error {
}
// SendHeader indicates an expected call of SendHeader.
func (mr *MockDaemon_DownloadServerMockRecorder) SendHeader(arg0 any) *gomock.Call {
func (mr *MockDaemon_DownloadServerMockRecorder) SendHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockDaemon_DownloadServer)(nil).SendHeader), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockDaemon_DownloadServer) SendMsg(m any) error {
func (m_2 *MockDaemon_DownloadServer) SendMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
@ -941,7 +723,7 @@ func (m_2 *MockDaemon_DownloadServer) SendMsg(m any) error {
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockDaemon_DownloadServerMockRecorder) SendMsg(m any) *gomock.Call {
func (mr *MockDaemon_DownloadServerMockRecorder) SendMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockDaemon_DownloadServer)(nil).SendMsg), m)
}
@ -955,7 +737,7 @@ func (m *MockDaemon_DownloadServer) SetHeader(arg0 metadata.MD) error {
}
// SetHeader indicates an expected call of SetHeader.
func (mr *MockDaemon_DownloadServerMockRecorder) SetHeader(arg0 any) *gomock.Call {
func (mr *MockDaemon_DownloadServerMockRecorder) SetHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockDaemon_DownloadServer)(nil).SetHeader), arg0)
}
@ -967,7 +749,7 @@ func (m *MockDaemon_DownloadServer) SetTrailer(arg0 metadata.MD) {
}
// SetTrailer indicates an expected call of SetTrailer.
func (mr *MockDaemon_DownloadServerMockRecorder) SetTrailer(arg0 any) *gomock.Call {
func (mr *MockDaemon_DownloadServerMockRecorder) SetTrailer(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockDaemon_DownloadServer)(nil).SetTrailer), arg0)
}
@ -976,7 +758,6 @@ func (mr *MockDaemon_DownloadServerMockRecorder) SetTrailer(arg0 any) *gomock.Ca
type MockDaemon_SyncPieceTasksServer struct {
ctrl *gomock.Controller
recorder *MockDaemon_SyncPieceTasksServerMockRecorder
isgomock struct{}
}
// MockDaemon_SyncPieceTasksServerMockRecorder is the mock recorder for MockDaemon_SyncPieceTasksServer.
@ -1026,7 +807,7 @@ func (mr *MockDaemon_SyncPieceTasksServerMockRecorder) Recv() *gomock.Call {
}
// RecvMsg mocks base method.
func (m_2 *MockDaemon_SyncPieceTasksServer) RecvMsg(m any) error {
func (m_2 *MockDaemon_SyncPieceTasksServer) RecvMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
@ -1034,7 +815,7 @@ func (m_2 *MockDaemon_SyncPieceTasksServer) RecvMsg(m any) error {
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockDaemon_SyncPieceTasksServerMockRecorder) RecvMsg(m any) *gomock.Call {
func (mr *MockDaemon_SyncPieceTasksServerMockRecorder) RecvMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockDaemon_SyncPieceTasksServer)(nil).RecvMsg), m)
}
@ -1048,7 +829,7 @@ func (m *MockDaemon_SyncPieceTasksServer) Send(arg0 *common.PiecePacket) error {
}
// Send indicates an expected call of Send.
func (mr *MockDaemon_SyncPieceTasksServerMockRecorder) Send(arg0 any) *gomock.Call {
func (mr *MockDaemon_SyncPieceTasksServerMockRecorder) Send(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockDaemon_SyncPieceTasksServer)(nil).Send), arg0)
}
@ -1062,13 +843,13 @@ func (m *MockDaemon_SyncPieceTasksServer) SendHeader(arg0 metadata.MD) error {
}
// SendHeader indicates an expected call of SendHeader.
func (mr *MockDaemon_SyncPieceTasksServerMockRecorder) SendHeader(arg0 any) *gomock.Call {
func (mr *MockDaemon_SyncPieceTasksServerMockRecorder) SendHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockDaemon_SyncPieceTasksServer)(nil).SendHeader), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockDaemon_SyncPieceTasksServer) SendMsg(m any) error {
func (m_2 *MockDaemon_SyncPieceTasksServer) SendMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
@ -1076,7 +857,7 @@ func (m_2 *MockDaemon_SyncPieceTasksServer) SendMsg(m any) error {
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockDaemon_SyncPieceTasksServerMockRecorder) SendMsg(m any) *gomock.Call {
func (mr *MockDaemon_SyncPieceTasksServerMockRecorder) SendMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockDaemon_SyncPieceTasksServer)(nil).SendMsg), m)
}
@ -1090,7 +871,7 @@ func (m *MockDaemon_SyncPieceTasksServer) SetHeader(arg0 metadata.MD) error {
}
// SetHeader indicates an expected call of SetHeader.
func (mr *MockDaemon_SyncPieceTasksServerMockRecorder) SetHeader(arg0 any) *gomock.Call {
func (mr *MockDaemon_SyncPieceTasksServerMockRecorder) SetHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockDaemon_SyncPieceTasksServer)(nil).SetHeader), arg0)
}
@ -1102,142 +883,7 @@ func (m *MockDaemon_SyncPieceTasksServer) SetTrailer(arg0 metadata.MD) {
}
// SetTrailer indicates an expected call of SetTrailer.
func (mr *MockDaemon_SyncPieceTasksServerMockRecorder) SetTrailer(arg0 any) *gomock.Call {
func (mr *MockDaemon_SyncPieceTasksServerMockRecorder) SetTrailer(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockDaemon_SyncPieceTasksServer)(nil).SetTrailer), arg0)
}
// MockDaemon_PeerExchangeServer is a mock of Daemon_PeerExchangeServer interface.
type MockDaemon_PeerExchangeServer struct {
ctrl *gomock.Controller
recorder *MockDaemon_PeerExchangeServerMockRecorder
isgomock struct{}
}
// MockDaemon_PeerExchangeServerMockRecorder is the mock recorder for MockDaemon_PeerExchangeServer.
type MockDaemon_PeerExchangeServerMockRecorder struct {
mock *MockDaemon_PeerExchangeServer
}
// NewMockDaemon_PeerExchangeServer creates a new mock instance.
func NewMockDaemon_PeerExchangeServer(ctrl *gomock.Controller) *MockDaemon_PeerExchangeServer {
mock := &MockDaemon_PeerExchangeServer{ctrl: ctrl}
mock.recorder = &MockDaemon_PeerExchangeServerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockDaemon_PeerExchangeServer) EXPECT() *MockDaemon_PeerExchangeServerMockRecorder {
return m.recorder
}
// Context mocks base method.
func (m *MockDaemon_PeerExchangeServer) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockDaemon_PeerExchangeServerMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockDaemon_PeerExchangeServer)(nil).Context))
}
// Recv mocks base method.
func (m *MockDaemon_PeerExchangeServer) Recv() (*dfdaemon.PeerExchangeData, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*dfdaemon.PeerExchangeData)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Recv indicates an expected call of Recv.
func (mr *MockDaemon_PeerExchangeServerMockRecorder) Recv() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockDaemon_PeerExchangeServer)(nil).Recv))
}
// RecvMsg mocks base method.
func (m_2 *MockDaemon_PeerExchangeServer) RecvMsg(m any) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockDaemon_PeerExchangeServerMockRecorder) RecvMsg(m any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockDaemon_PeerExchangeServer)(nil).RecvMsg), m)
}
// Send mocks base method.
func (m *MockDaemon_PeerExchangeServer) Send(arg0 *dfdaemon.PeerExchangeData) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Send indicates an expected call of Send.
func (mr *MockDaemon_PeerExchangeServerMockRecorder) Send(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockDaemon_PeerExchangeServer)(nil).Send), arg0)
}
// SendHeader mocks base method.
func (m *MockDaemon_PeerExchangeServer) SendHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendHeader indicates an expected call of SendHeader.
func (mr *MockDaemon_PeerExchangeServerMockRecorder) SendHeader(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockDaemon_PeerExchangeServer)(nil).SendHeader), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockDaemon_PeerExchangeServer) SendMsg(m any) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockDaemon_PeerExchangeServerMockRecorder) SendMsg(m any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockDaemon_PeerExchangeServer)(nil).SendMsg), m)
}
// SetHeader mocks base method.
func (m *MockDaemon_PeerExchangeServer) SetHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SetHeader indicates an expected call of SetHeader.
func (mr *MockDaemon_PeerExchangeServerMockRecorder) SetHeader(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockDaemon_PeerExchangeServer)(nil).SetHeader), arg0)
}
// SetTrailer mocks base method.
func (m *MockDaemon_PeerExchangeServer) SetTrailer(arg0 metadata.MD) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "SetTrailer", arg0)
}
// SetTrailer indicates an expected call of SetTrailer.
func (mr *MockDaemon_PeerExchangeServerMockRecorder) SetTrailer(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockDaemon_PeerExchangeServer)(nil).SetTrailer), arg0)
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -19,11 +19,50 @@ syntax = "proto3";
package dfdaemon.v2;
import "pkg/apis/common/v2/common.proto";
import "google/protobuf/duration.proto";
import "pkg/apis/errordetails/v2/errordetails.proto";
import "google/protobuf/empty.proto";
import "validate/validate.proto";
option go_package = "d7y.io/api/v2/pkg/apis/dfdaemon/v2;dfdaemon";
option go_package = "d7y.io/api/pkg/apis/dfdaemon/v2;dfdaemon";
// InterestedAllPiecesRequest represents interested all pieces request of SyncPiecesRequest.
message InterestedAllPiecesRequest {
}
// InterestedPiecesRequest represents interested pieces request of SyncPiecesRequest.
message InterestedPiecesRequest {
// Interested piece numbers.
repeated uint32 piece_numbers = 1 [(validate.rules).repeated = {min_items: 1}];
}
// SyncPiecesRequest represents request of AnnouncePeer.
message SyncPiecesRequest{
oneof request {
option (validate.required) = true;
InterestedAllPiecesRequest interested_all_pieces_request = 1;
InterestedPiecesRequest interested_pieces_request = 2;
}
}
// InterestedPiecesResponse represents interested pieces response of SyncPiecesResponse.
message InterestedPiecesResponse {
// Interested pieces of task.
repeated common.v2.Piece pieces = 1 [(validate.rules).repeated = {min_items: 1, ignore_empty: true}];
}
// SyncPiecesResponse represents response of SyncPieces.
message SyncPiecesResponse {
oneof response {
option (validate.required) = true;
InterestedPiecesResponse interested_pieces_response = 1;
}
oneof errordetails {
errordetails.v2.SyncPiecesFailed sync_pieces_failed = 3;
}
}
// DownloadTaskRequest represents request of DownloadTask.
message DownloadTaskRequest {
@ -31,386 +70,44 @@ message DownloadTaskRequest {
common.v2.Download download = 1 [(validate.rules).message.required = true];
}
// DownloadTaskStartedResponse represents task download started response of DownloadTaskResponse.
message DownloadTaskStartedResponse {
// Task content length.
uint64 content_length = 1;
// Range is url range of request. If protocol is http, range
// is parsed from http header. If other protocol, range comes
// from download range field.
optional common.v2.Range range = 2;
// Task response headers.
map<string, string> response_header = 3;
// Need to download pieces.
repeated common.v2.Piece pieces = 4;
}
// DownloadPieceFinishedResponse represents piece download finished response of DownloadTaskResponse.
message DownloadPieceFinishedResponse {
// Finished piece of task.
common.v2.Piece piece = 1 [(validate.rules).message.required = true];
}
// DownloadTaskResponse represents response of DownloadTask.
message DownloadTaskResponse {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 3 [(validate.rules).string.min_len = 1];
oneof response {
option (validate.required) = true;
DownloadTaskStartedResponse download_task_started_response = 4;
DownloadPieceFinishedResponse download_piece_finished_response = 5;
}
}
// SyncPiecesRequest represents request of SyncPieces.
message SyncPiecesRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Interested piece numbers.
repeated uint32 interested_piece_numbers = 3 [(validate.rules).repeated = {min_items: 1}];
}
// SyncPiecesResponse represents response of SyncPieces.
message SyncPiecesResponse {
// Exist piece number.
uint32 number = 1;
// Piece offset.
uint64 offset = 2;
// Piece length.
uint64 length = 3;
}
// DownloadPieceRequest represents request of DownloadPiece.
message DownloadPieceRequest{
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Piece number.
uint32 piece_number = 3;
}
// DownloadPieceResponse represents response of DownloadPieces.
message DownloadPieceResponse {
// Piece information.
common.v2.Piece piece = 1 [(validate.rules).message.required = true];
// Piece metadata digest, it is used to verify the integrity of the piece metadata.
optional string digest = 2 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]+)$", ignore_empty: true}];
// UploadTaskRequest represents request of UploadTask.
message UploadTaskRequest {
// Task metadata.
common.v2.Task task = 1 [(validate.rules).message.required = true];
}
// StatTaskRequest represents request of StatTask.
message StatTaskRequest {
// Task id.
string task_id = 1 [(validate.rules).string.min_len = 1];
// Remote IP represents the IP address of the client initiating the stat request.
optional string remote_ip = 2 [(validate.rules).string = {ip: true, ignore_empty: true}];
}
// ListTaskEntriesRequest represents request of ListTaskEntries.
message ListTaskEntriesRequest {
// Task id.
string task_id = 1 [(validate.rules).string.min_len = 1];
// URL to be listed the entries.
string url = 2;
// HTTP header to be sent with the request.
map<string, string> request_header = 3;
// List timeout.
optional google.protobuf.Duration timeout = 4;
// certificate_chain is the client certs with DER format for the backend client to list the entries.
repeated bytes certificate_chain = 5;
// Object storage protocol information.
optional common.v2.ObjectStorage object_storage = 6;
// HDFS protocol information.
optional common.v2.HDFS hdfs = 7;
// Remote IP represents the IP address of the client initiating the list request.
optional string remote_ip = 8 [(validate.rules).string = {ip: true, ignore_empty: true}];
}
// ListTaskEntriesResponse represents response of ListTaskEntries.
message ListTaskEntriesResponse {
// Content length is the content length of the response
uint64 content_length = 1;
// HTTP header to be sent with the request.
map<string, string> response_header = 2;
// Backend HTTP status code.
optional int32 status_code = 3 [(validate.rules).int32 = {gte: 100, lt: 599, ignore_empty: true}];
/// Entries is the information of the entries in the directory.
repeated Entry entries = 4;
}
// Entry represents an entry in a directory.
message Entry {
// URL of the entry.
string url = 1;
// Size of the entry.
uint64 content_length = 2;
// Is directory or not.
bool is_dir = 3;
// StatTaskResponse represents response of StatTask.
message StatTaskResponse {
// Task metadata.
common.v2.Task task = 1 [(validate.rules).message.required = true];
}
// DeleteTaskRequest represents request of DeleteTask.
message DeleteTaskRequest {
// Task id.
string task_id = 1 [(validate.rules).string.min_len = 1];
// Remote IP represents the IP address of the client initiating the delete request.
optional string remote_ip = 2 [(validate.rules).string = {ip: true, ignore_empty: true}];
}
// DownloadPersistentCacheTaskRequest represents request of DownloadPersistentCacheTask.
message DownloadPersistentCacheTaskRequest {
// Task id.
string task_id = 1 [(validate.rules).string.min_len = 1];
// Persistent represents whether the persistent cache task is persistent.
// If the persistent cache task is persistent, the persistent cache peer will
// not be deleted when dfdaemon runs garbage collection.
bool persistent = 2;
// Tag is used to distinguish different persistent cache tasks.
optional string tag = 3;
// Application of task.
optional string application = 4;
// File path to be exported. If output_path is set, the exported file will be saved to the specified path.
// Dfdaemon will try to create hard link to the output path before starting the export. If hard link creation fails,
// it will copy the file to the output path after the export is completed.
// For more details refer to https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.
optional string output_path = 5 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Download timeout.
optional google.protobuf.Duration timeout = 6;
// need_piece_content is the flag to indicate whether the response needs to return piece content.
bool need_piece_content = 7;
// force_hard_link is the flag to indicate whether the exported file must be hard linked to the output path.
// For more details refer to https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.
bool force_hard_link = 8;
// Verifies task data integrity after download using a digest. Supports CRC32, SHA256, and SHA512 algorithms.
// Format: `<algorithm>:<hash>`, e.g., `crc32:xxx`, `sha256:yyy`, `sha512:zzz`.
// Returns an error if the computed digest mismatches the expected value.
//
// Performance
// Digest calculation increases processing time. Enable only when data integrity verification is critical.
optional string digest = 9;
// Remote IP represents the IP address of the client initiating the download request.
optional string remote_ip = 10 [(validate.rules).string = {ip: true, ignore_empty: true}];
}
// Dfdaemon RPC Service.
service Dfdaemon{
// SyncPieces syncs pieces from the other peers.
rpc SyncPieces(stream SyncPiecesRequest)returns(stream SyncPiecesResponse);
// DownloadPersistentCacheTaskStartedResponse represents task download started response of DownloadPersistentCacheTaskResponse.
message DownloadPersistentCacheTaskStartedResponse {
// Task content length.
uint64 content_length = 1;
}
// DownloadTask downloads task back-to-source.
rpc DownloadTask(DownloadTaskRequest) returns(google.protobuf.Empty);
// DownloadPersistentCacheTaskResponse represents response of DownloadPersistentCacheTask.
message DownloadPersistentCacheTaskResponse {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 3 [(validate.rules).string.min_len = 1];
oneof response {
option (validate.required) = true;
DownloadPersistentCacheTaskStartedResponse download_persistent_cache_task_started_response = 4;
DownloadPieceFinishedResponse download_piece_finished_response = 5;
}
}
// UploadPersistentCacheTaskRequest represents request of UploadPersistentCacheTask.
message UploadPersistentCacheTaskRequest {
// content_for_calculating_task_id is the content used to calculate the task id.
// If content_for_calculating_task_id is set, use its value to calculate the task ID.
// Otherwise, calculate the task ID based on the file content, tag and application by crc32 algorithm`.
optional string content_for_calculating_task_id = 1;
// Upload file path of persistent cache task.
string path = 2 [(validate.rules).string = {min_len: 1}];
// Replica count of the persistent persistent cache task.
uint64 persistent_replica_count = 3 [(validate.rules).uint64 = {gte: 1, lte: 5}];
// Tag is used to distinguish different persistent cache tasks.
optional string tag = 4;
// Application of the persistent cache task.
optional string application = 5;
// Piece length of the persistent cache task, the value needs to be greater than or equal to 4194304(4MiB).
optional uint64 piece_length = 6 [(validate.rules).uint64 = {gte: 4194304, ignore_empty: true}];
// TTL of the persistent cache task.
google.protobuf.Duration ttl = 7 [(validate.rules).duration = {gte:{seconds: 60}, lte:{seconds: 604800}}];
// Download timeout.
optional google.protobuf.Duration timeout = 8;
// Remote IP represents the IP address of the client initiating the upload request.
optional string remote_ip = 9 [(validate.rules).string = {ip: true, ignore_empty: true}];
}
// UpdatePersistentCacheTaskRequest represents request of UpdatePersistentCacheTask.
message UpdatePersistentCacheTaskRequest {
// Task id.
string task_id = 1 [(validate.rules).string.min_len = 1];
// Persistent represents whether the persistent cache peer is persistent.
// If the persistent cache peer is persistent, the persistent cache peer will
// not be deleted when dfdaemon runs garbage collection. It only be deleted
// when the task is deleted by the user.
bool persistent = 2;
// Remote IP represents the IP address of the client initiating the update request.
optional string remote_ip = 3 [(validate.rules).string = {ip: true, ignore_empty: true}];
}
// StatPersistentCacheTaskRequest represents request of StatPersistentCacheTask.
message StatPersistentCacheTaskRequest {
// Task id.
string task_id = 1 [(validate.rules).string.min_len = 1];
// Remote IP represents the IP address of the client initiating the stat request.
optional string remote_ip = 2 [(validate.rules).string = {ip: true, ignore_empty: true}];
}
// DeletePersistentCacheTaskRequest represents request of DeletePersistentCacheTask.
message DeletePersistentCacheTaskRequest {
// Task id.
string task_id = 1 [(validate.rules).string.min_len = 1];
// Remote IP represents the IP address of the client initiating the delete request.
optional string remote_ip = 2 [(validate.rules).string = {ip: true, ignore_empty: true}];
}
// SyncPersistentCachePiecesRequest represents request of SyncPersistentCachePieces.
message SyncPersistentCachePiecesRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Interested piece numbers.
repeated uint32 interested_piece_numbers = 3 [(validate.rules).repeated = {min_items: 1}];
}
// SyncPersistentCachePiecesResponse represents response of SyncPersistentCachePieces.
message SyncPersistentCachePiecesResponse {
// Exist piece number.
uint32 number = 1;
// Piece offset.
uint64 offset = 2;
// Piece length.
uint64 length = 3;
}
// DownloadPersistentCachePieceRequest represents request of DownloadPersistentCachePiece.
message DownloadPersistentCachePieceRequest{
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Piece number.
uint32 piece_number = 3;
}
// DownloadPersistentCachePieceResponse represents response of DownloadPersistentCachePieces.
message DownloadPersistentCachePieceResponse {
// Piece information.
common.v2.Piece piece = 1 [(validate.rules).message.required = true];
// Piece metadata digest, it is used to verify the integrity of the piece metadata.
optional string digest = 2 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]+)$", ignore_empty: true}];
}
// SyncHostRequest represents request of SyncHost.
message SyncHostRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 2 [(validate.rules).string.min_len = 1];
}
// IBVerbsQueuePairEndpoint represents queue pair endpoint of IBVerbs.
message IBVerbsQueuePairEndpoint {
// Number of the queue pair.
uint32 num = 1;
// Local identifier of the context.
uint32 lid = 2;
// Global identifier of the context.
bytes gid = 3 [(validate.rules).bytes.len = 16];
}
// ExchangeIBVerbsQueuePairEndpointRequest represents request of ExchangeIBVerbsQueuePairEndpoint.
message ExchangeIBVerbsQueuePairEndpointRequest {
// Information of the source's queue pair endpoint of IBVerbs.
IBVerbsQueuePairEndpoint endpoint = 1 [(validate.rules).message.required = true];
}
// ExchangeIBVerbsQueuePairEndpointResponse represents response of ExchangeIBVerbsQueuePairEndpoint.
message ExchangeIBVerbsQueuePairEndpointResponse {
// Information of the destination's queue pair endpoint of IBVerbs.
IBVerbsQueuePairEndpoint endpoint = 1 [(validate.rules).message.required = true];
}
// DfdaemonUpload represents dfdaemon upload service.
service DfdaemonUpload {
// DownloadTask downloads task from p2p network.
rpc DownloadTask(DownloadTaskRequest) returns(stream DownloadTaskResponse);
// UploadTask uploads task to p2p network.
rpc UploadTask(UploadTaskRequest) returns(google.protobuf.Empty);
// StatTask stats task information.
rpc StatTask(StatTaskRequest) returns(common.v2.Task);
// DeleteTask deletes task from p2p network.
rpc DeleteTask(DeleteTaskRequest) returns(google.protobuf.Empty);
// SyncPieces syncs piece metadatas from remote peer.
rpc SyncPieces(SyncPiecesRequest) returns(stream SyncPiecesResponse);
// DownloadPiece downloads piece from the remote peer.
rpc DownloadPiece(DownloadPieceRequest)returns(DownloadPieceResponse);
// DownloadPersistentCacheTask downloads persistent cache task from p2p network.
rpc DownloadPersistentCacheTask(DownloadPersistentCacheTaskRequest) returns(stream DownloadPersistentCacheTaskResponse);
// UpdatePersistentCacheTask updates metadate of thr persistent cache task in p2p network.
rpc UpdatePersistentCacheTask(UpdatePersistentCacheTaskRequest) returns(google.protobuf.Empty);
// StatPersistentCacheTask stats persistent cache task information.
rpc StatPersistentCacheTask(StatPersistentCacheTaskRequest) returns(common.v2.PersistentCacheTask);
// DeletePersistentCacheTask deletes persistent cache task from p2p network.
rpc DeletePersistentCacheTask(DeletePersistentCacheTaskRequest) returns(google.protobuf.Empty);
// SyncPersistentCachePieces syncs persistent cache pieces from remote peer.
rpc SyncPersistentCachePieces(SyncPersistentCachePiecesRequest) returns(stream SyncPersistentCachePiecesResponse);
// DownloadPersistentCachePiece downloads persistent cache piece from the remote peer.
rpc DownloadPersistentCachePiece(DownloadPersistentCachePieceRequest)returns(DownloadPersistentCachePieceResponse);
// SyncHost sync host info from parents.
rpc SyncHost(SyncHostRequest) returns (stream common.v2.Host);
// ExchangeIBVerbsQueuePairEndpoint exchanges queue pair endpoint of IBVerbs with remote peer.
rpc ExchangeIBVerbsQueuePairEndpoint(ExchangeIBVerbsQueuePairEndpointRequest) returns(ExchangeIBVerbsQueuePairEndpointResponse);
}
// DfdaemonDownload represents dfdaemon download service.
service DfdaemonDownload {
// DownloadTask downloads task from p2p network.
rpc DownloadTask(DownloadTaskRequest) returns(stream DownloadTaskResponse);
// StatTask stats task information.
rpc StatTask(StatTaskRequest) returns(common.v2.Task);
// ListTaskEntries lists task entries for downloading directory.
rpc ListTaskEntries(ListTaskEntriesRequest) returns(ListTaskEntriesResponse);
// DeleteTask deletes task from p2p network.
rpc DeleteTask(DeleteTaskRequest) returns(google.protobuf.Empty);
// DeleteHost releases host in scheduler.
rpc DeleteHost(google.protobuf.Empty)returns(google.protobuf.Empty);
// DownloadPersistentCacheTask downloads persistent cache task from p2p network.
rpc DownloadPersistentCacheTask(DownloadPersistentCacheTaskRequest) returns(stream DownloadPersistentCacheTaskResponse);
// UploadPersistentCacheTask uploads persistent cache task to p2p network.
rpc UploadPersistentCacheTask(UploadPersistentCacheTaskRequest) returns(common.v2.PersistentCacheTask);
// StatPersistentCacheTask stats persistent cache task information.
rpc StatPersistentCacheTask(StatPersistentCacheTaskRequest) returns(common.v2.PersistentCacheTask);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,7 @@
package errordetails
import (
v1 "d7y.io/api/v2/pkg/apis/common/v1"
v1 "d7y.io/api/pkg/apis/common/v1"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
@ -106,11 +106,11 @@ var file_pkg_apis_errordetails_v1_errordetails_proto_rawDesc = []byte{
0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, 0x79, 0x12, 0x33, 0x0a, 0x08, 0x6d, 0x65, 0x74,
0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f,
0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69,
0x62, 0x75, 0x74, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x35,
0x5a, 0x33, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f,
0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x64, 0x65,
0x74, 0x61, 0x69, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x64, 0x65,
0x74, 0x61, 0x69, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x62, 0x75, 0x74, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x32,
0x5a, 0x30, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6b, 0x67,
0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x64, 0x65, 0x74, 0x61, 0x69,
0x6c, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x64, 0x65, 0x74, 0x61, 0x69,
0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -20,7 +20,7 @@ package errordetails;
import "pkg/apis/common/v1/common.proto";
option go_package = "d7y.io/api/v2/pkg/apis/errordetails/v1;errordetails";
option go_package = "d7y.io/api/pkg/apis/errordetails/v1;errordetails";
message SourceError {
bool temporary = 1;

View File

@ -1,5 +1,5 @@
//
// Copyright 2024 The Dragonfly Authors
// Copyright 2022 The Dragonfly Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -22,6 +22,7 @@
package errordetails
import (
v2 "d7y.io/api/pkg/apis/common/v2"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
@ -36,22 +37,18 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Backend is error detail for Backend.
type Backend struct {
// DownloadPeerBackToSourceFailed is error detail of downloading peer back-to-source.
type DownloadPeerBackToSourceFailed struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Backend error message.
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
// Backend HTTP response header.
Header map[string]string `protobuf:"bytes,2,rep,name=header,proto3" json:"header,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// Backend HTTP status code.
StatusCode *int32 `protobuf:"varint,3,opt,name=status_code,json=statusCode,proto3,oneof" json:"status_code,omitempty"`
// The description of the error.
Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
}
func (x *Backend) Reset() {
*x = Backend{}
func (x *DownloadPeerBackToSourceFailed) Reset() {
*x = DownloadPeerBackToSourceFailed{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -59,13 +56,13 @@ func (x *Backend) Reset() {
}
}
func (x *Backend) String() string {
func (x *DownloadPeerBackToSourceFailed) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Backend) ProtoMessage() {}
func (*DownloadPeerBackToSourceFailed) ProtoMessage() {}
func (x *Backend) ProtoReflect() protoreflect.Message {
func (x *DownloadPeerBackToSourceFailed) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -77,44 +74,36 @@ func (x *Backend) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use Backend.ProtoReflect.Descriptor instead.
func (*Backend) Descriptor() ([]byte, []int) {
// Deprecated: Use DownloadPeerBackToSourceFailed.ProtoReflect.Descriptor instead.
func (*DownloadPeerBackToSourceFailed) Descriptor() ([]byte, []int) {
return file_pkg_apis_errordetails_v2_errordetails_proto_rawDescGZIP(), []int{0}
}
func (x *Backend) GetMessage() string {
func (x *DownloadPeerBackToSourceFailed) GetDescription() string {
if x != nil {
return x.Message
return x.Description
}
return ""
}
func (x *Backend) GetHeader() map[string]string {
if x != nil {
return x.Header
}
return nil
}
func (x *Backend) GetStatusCode() int32 {
if x != nil && x.StatusCode != nil {
return *x.StatusCode
}
return 0
}
// Unknown is error detail for Unknown.
type Unknown struct {
// DownloadPieceBackToSourceFailed is error detail of downloading piece back-to-source.
type DownloadPieceBackToSourceFailed struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Unknown error message.
Message *string `protobuf:"bytes,1,opt,name=message,proto3,oneof" json:"message,omitempty"`
// Temporary recoverable error of source.
Temporary bool `protobuf:"varint,1,opt,name=temporary,proto3" json:"temporary,omitempty"`
// Source response metadata, eg: HTTP Status Code, HTTP Status, HTTP Header
ExtendAttribute *v2.ExtendAttribute `protobuf:"bytes,2,opt,name=extend_attribute,json=extendAttribute,proto3" json:"extend_attribute,omitempty"`
// The number of piece.
PieceNumber uint32 `protobuf:"varint,3,opt,name=piece_number,json=pieceNumber,proto3" json:"piece_number,omitempty"`
// The description of the error.
Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
}
func (x *Unknown) Reset() {
*x = Unknown{}
func (x *DownloadPieceBackToSourceFailed) Reset() {
*x = DownloadPieceBackToSourceFailed{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -122,13 +111,13 @@ func (x *Unknown) Reset() {
}
}
func (x *Unknown) String() string {
func (x *DownloadPieceBackToSourceFailed) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Unknown) ProtoMessage() {}
func (*DownloadPieceBackToSourceFailed) ProtoMessage() {}
func (x *Unknown) ProtoReflect() protoreflect.Message {
func (x *DownloadPieceBackToSourceFailed) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -140,14 +129,285 @@ func (x *Unknown) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use Unknown.ProtoReflect.Descriptor instead.
func (*Unknown) Descriptor() ([]byte, []int) {
// Deprecated: Use DownloadPieceBackToSourceFailed.ProtoReflect.Descriptor instead.
func (*DownloadPieceBackToSourceFailed) Descriptor() ([]byte, []int) {
return file_pkg_apis_errordetails_v2_errordetails_proto_rawDescGZIP(), []int{1}
}
func (x *Unknown) GetMessage() string {
if x != nil && x.Message != nil {
return *x.Message
func (x *DownloadPieceBackToSourceFailed) GetTemporary() bool {
if x != nil {
return x.Temporary
}
return false
}
func (x *DownloadPieceBackToSourceFailed) GetExtendAttribute() *v2.ExtendAttribute {
if x != nil {
return x.ExtendAttribute
}
return nil
}
func (x *DownloadPieceBackToSourceFailed) GetPieceNumber() uint32 {
if x != nil {
return x.PieceNumber
}
return 0
}
func (x *DownloadPieceBackToSourceFailed) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
// DownloadPieceFailed is error detail of downloading piece.
type DownloadPieceFailed struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Temporary recoverable error of parent peer.
Temporary bool `protobuf:"varint,1,opt,name=temporary,proto3" json:"temporary,omitempty"`
// Source response metadata, eg: HTTP Status Code, HTTP Status, HTTP Header
ExtendAttribute *v2.ExtendAttribute `protobuf:"bytes,2,opt,name=extend_attribute,json=extendAttribute,proto3" json:"extend_attribute,omitempty"`
// Piece is information of piece.
ParentId string `protobuf:"bytes,3,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"`
// The number of piece.
PieceNumber uint32 `protobuf:"varint,4,opt,name=piece_number,json=pieceNumber,proto3" json:"piece_number,omitempty"`
// The description of the error.
Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
}
func (x *DownloadPieceFailed) Reset() {
*x = DownloadPieceFailed{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DownloadPieceFailed) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DownloadPieceFailed) ProtoMessage() {}
func (x *DownloadPieceFailed) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DownloadPieceFailed.ProtoReflect.Descriptor instead.
func (*DownloadPieceFailed) Descriptor() ([]byte, []int) {
return file_pkg_apis_errordetails_v2_errordetails_proto_rawDescGZIP(), []int{2}
}
func (x *DownloadPieceFailed) GetTemporary() bool {
if x != nil {
return x.Temporary
}
return false
}
func (x *DownloadPieceFailed) GetExtendAttribute() *v2.ExtendAttribute {
if x != nil {
return x.ExtendAttribute
}
return nil
}
func (x *DownloadPieceFailed) GetParentId() string {
if x != nil {
return x.ParentId
}
return ""
}
func (x *DownloadPieceFailed) GetPieceNumber() uint32 {
if x != nil {
return x.PieceNumber
}
return 0
}
func (x *DownloadPieceFailed) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
// SchedulePeerForbidden is error detail of forbidden.
type SchedulePeerForbidden struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The description of the error.
Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
}
func (x *SchedulePeerForbidden) Reset() {
*x = SchedulePeerForbidden{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SchedulePeerForbidden) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SchedulePeerForbidden) ProtoMessage() {}
func (x *SchedulePeerForbidden) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SchedulePeerForbidden.ProtoReflect.Descriptor instead.
func (*SchedulePeerForbidden) Descriptor() ([]byte, []int) {
return file_pkg_apis_errordetails_v2_errordetails_proto_rawDescGZIP(), []int{3}
}
func (x *SchedulePeerForbidden) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
// SchedulePeerFailed is error detail of scheduling.
type SchedulePeerFailed struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The description of the error.
Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
}
func (x *SchedulePeerFailed) Reset() {
*x = SchedulePeerFailed{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SchedulePeerFailed) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SchedulePeerFailed) ProtoMessage() {}
func (x *SchedulePeerFailed) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SchedulePeerFailed.ProtoReflect.Descriptor instead.
func (*SchedulePeerFailed) Descriptor() ([]byte, []int) {
return file_pkg_apis_errordetails_v2_errordetails_proto_rawDescGZIP(), []int{4}
}
func (x *SchedulePeerFailed) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
// SyncPiecesFailed is error detail of syncing pieces.
type SyncPiecesFailed struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Temporary recoverable error of parent peer.
Temporary bool `protobuf:"varint,1,opt,name=temporary,proto3" json:"temporary,omitempty"`
// Parent peer id.
ParentId string `protobuf:"bytes,2,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"`
// The description of the error.
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
}
func (x *SyncPiecesFailed) Reset() {
*x = SyncPiecesFailed{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SyncPiecesFailed) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SyncPiecesFailed) ProtoMessage() {}
func (x *SyncPiecesFailed) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SyncPiecesFailed.ProtoReflect.Descriptor instead.
func (*SyncPiecesFailed) Descriptor() ([]byte, []int) {
return file_pkg_apis_errordetails_v2_errordetails_proto_rawDescGZIP(), []int{5}
}
func (x *SyncPiecesFailed) GetTemporary() bool {
if x != nil {
return x.Temporary
}
return false
}
func (x *SyncPiecesFailed) GetParentId() string {
if x != nil {
return x.ParentId
}
return ""
}
func (x *SyncPiecesFailed) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
@ -160,28 +420,62 @@ var file_pkg_apis_errordetails_v2_errordetails_proto_rawDesc = []byte{
0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x65,
0x72, 0x72, 0x6f, 0x72, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x76, 0x32, 0x1a, 0x17,
0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe0, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x63, 0x6b,
0x65, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3c, 0x0a,
0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e,
0x65, 0x72, 0x72, 0x6f, 0x72, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x76, 0x32, 0x2e,
0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e,
0x74, 0x72, 0x79, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x0b, 0x73,
0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
0x42, 0x0c, 0xfa, 0x42, 0x09, 0x1a, 0x07, 0x10, 0xd7, 0x04, 0x28, 0x64, 0x40, 0x01, 0x48, 0x00,
0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x88, 0x01, 0x01, 0x1a,
0x39, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79,
0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x73,
0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x34, 0x0a, 0x07, 0x55, 0x6e,
0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x12, 0x1d, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x42, 0x35, 0x5a, 0x33, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76,
0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72,
0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x3b, 0x65, 0x72, 0x72, 0x6f, 0x72,
0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69,
0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d,
0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x42, 0x0a, 0x1e, 0x44, 0x6f, 0x77, 0x6e,
0x6c, 0x6f, 0x61, 0x64, 0x50, 0x65, 0x65, 0x72, 0x42, 0x61, 0x63, 0x6b, 0x54, 0x6f, 0x53, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65,
0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xde, 0x01, 0x0a,
0x1f, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x42, 0x61,
0x63, 0x6b, 0x54, 0x6f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64,
0x12, 0x1c, 0x0a, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, 0x79, 0x18, 0x01, 0x20,
0x01, 0x28, 0x08, 0x52, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, 0x79, 0x12, 0x4f,
0x0a, 0x10, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75,
0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69,
0x62, 0x75, 0x74, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0f,
0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12,
0x2a, 0x0a, 0x0c, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18,
0x03, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x2a, 0x02, 0x28, 0x00, 0x52, 0x0b,
0x70, 0x69, 0x65, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x64,
0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xf8, 0x01,
0x0a, 0x13, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x46,
0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61,
0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72,
0x61, 0x72, 0x79, 0x12, 0x4f, 0x0a, 0x10, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x5f, 0x61, 0x74,
0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64,
0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01,
0x02, 0x10, 0x01, 0x52, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69,
0x62, 0x75, 0x74, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69,
0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01,
0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x0c, 0x70, 0x69,
0x65, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d,
0x42, 0x07, 0xfa, 0x42, 0x04, 0x2a, 0x02, 0x28, 0x00, 0x52, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65,
0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73,
0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x39, 0x0a, 0x15, 0x53, 0x63, 0x68, 0x65,
0x64, 0x75, 0x6c, 0x65, 0x50, 0x65, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65,
0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x69, 0x6f, 0x6e, 0x22, 0x36, 0x0a, 0x12, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x50,
0x65, 0x65, 0x72, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73,
0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x78, 0x0a, 0x10, 0x53,
0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12,
0x1c, 0x0a, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01,
0x28, 0x08, 0x52, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, 0x79, 0x12, 0x24, 0x0a,
0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e,
0x74, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69,
0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x32, 0x5a, 0x30, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f,
0x61, 0x70, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x65, 0x72, 0x72,
0x6f, 0x72, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x3b, 0x65, 0x72, 0x72,
0x6f, 0x72, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
@ -196,19 +490,24 @@ func file_pkg_apis_errordetails_v2_errordetails_proto_rawDescGZIP() []byte {
return file_pkg_apis_errordetails_v2_errordetails_proto_rawDescData
}
var file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_pkg_apis_errordetails_v2_errordetails_proto_goTypes = []interface{}{
(*Backend)(nil), // 0: errordetails.v2.Backend
(*Unknown)(nil), // 1: errordetails.v2.Unknown
nil, // 2: errordetails.v2.Backend.HeaderEntry
(*DownloadPeerBackToSourceFailed)(nil), // 0: errordetails.v2.DownloadPeerBackToSourceFailed
(*DownloadPieceBackToSourceFailed)(nil), // 1: errordetails.v2.DownloadPieceBackToSourceFailed
(*DownloadPieceFailed)(nil), // 2: errordetails.v2.DownloadPieceFailed
(*SchedulePeerForbidden)(nil), // 3: errordetails.v2.SchedulePeerForbidden
(*SchedulePeerFailed)(nil), // 4: errordetails.v2.SchedulePeerFailed
(*SyncPiecesFailed)(nil), // 5: errordetails.v2.SyncPiecesFailed
(*v2.ExtendAttribute)(nil), // 6: common.v2.ExtendAttribute
}
var file_pkg_apis_errordetails_v2_errordetails_proto_depIdxs = []int32{
2, // 0: errordetails.v2.Backend.header:type_name -> errordetails.v2.Backend.HeaderEntry
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
6, // 0: errordetails.v2.DownloadPieceBackToSourceFailed.extend_attribute:type_name -> common.v2.ExtendAttribute
6, // 1: errordetails.v2.DownloadPieceFailed.extend_attribute:type_name -> common.v2.ExtendAttribute
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_pkg_apis_errordetails_v2_errordetails_proto_init() }
@ -218,7 +517,7 @@ func file_pkg_apis_errordetails_v2_errordetails_proto_init() {
}
if !protoimpl.UnsafeEnabled {
file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Backend); i {
switch v := v.(*DownloadPeerBackToSourceFailed); i {
case 0:
return &v.state
case 1:
@ -230,7 +529,55 @@ func file_pkg_apis_errordetails_v2_errordetails_proto_init() {
}
}
file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Unknown); i {
switch v := v.(*DownloadPieceBackToSourceFailed); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DownloadPieceFailed); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SchedulePeerForbidden); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SchedulePeerFailed); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SyncPiecesFailed); i {
case 0:
return &v.state
case 1:
@ -242,15 +589,13 @@ func file_pkg_apis_errordetails_v2_errordetails_proto_init() {
}
}
}
file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[0].OneofWrappers = []interface{}{}
file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[1].OneofWrappers = []interface{}{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_pkg_apis_errordetails_v2_errordetails_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumMessages: 6,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -35,63 +35,202 @@ var (
_ = sort.Sort
)
// Validate checks the field values on Backend with the rules defined in the
// proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *Backend) Validate() error {
// Validate checks the field values on DownloadPeerBackToSourceFailed with the
// rules defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *DownloadPeerBackToSourceFailed) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on Backend with the rules defined in the
// proto definition for this message. If any rules are violated, the result is
// a list of violation errors wrapped in BackendMultiError, or nil if none found.
func (m *Backend) ValidateAll() error {
// ValidateAll checks the field values on DownloadPeerBackToSourceFailed with
// the rules defined in the proto definition for this message. If any rules
// are violated, the result is a list of violation errors wrapped in
// DownloadPeerBackToSourceFailedMultiError, or nil if none found.
func (m *DownloadPeerBackToSourceFailed) ValidateAll() error {
return m.validate(true)
}
func (m *Backend) validate(all bool) error {
func (m *DownloadPeerBackToSourceFailed) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Message
// no validation rules for Description
// no validation rules for Header
if len(errors) > 0 {
return DownloadPeerBackToSourceFailedMultiError(errors)
}
if m.StatusCode != nil {
return nil
}
if m.GetStatusCode() != 0 {
// DownloadPeerBackToSourceFailedMultiError is an error wrapping multiple
// validation errors returned by DownloadPeerBackToSourceFailed.ValidateAll()
// if the designated constraints aren't met.
type DownloadPeerBackToSourceFailedMultiError []error
if val := m.GetStatusCode(); val < 100 || val >= 599 {
err := BackendValidationError{
field: "StatusCode",
reason: "value must be inside range [100, 599)",
}
if !all {
return err
}
errors = append(errors, err)
}
// Error returns a concatenation of all the error messages it wraps.
func (m DownloadPeerBackToSourceFailedMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m DownloadPeerBackToSourceFailedMultiError) AllErrors() []error { return m }
// DownloadPeerBackToSourceFailedValidationError is the validation error
// returned by DownloadPeerBackToSourceFailed.Validate if the designated
// constraints aren't met.
type DownloadPeerBackToSourceFailedValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e DownloadPeerBackToSourceFailedValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e DownloadPeerBackToSourceFailedValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e DownloadPeerBackToSourceFailedValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e DownloadPeerBackToSourceFailedValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e DownloadPeerBackToSourceFailedValidationError) ErrorName() string {
return "DownloadPeerBackToSourceFailedValidationError"
}
// Error satisfies the builtin error interface
func (e DownloadPeerBackToSourceFailedValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sDownloadPeerBackToSourceFailed.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = DownloadPeerBackToSourceFailedValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = DownloadPeerBackToSourceFailedValidationError{}
// Validate checks the field values on DownloadPieceBackToSourceFailed with the
// rules defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *DownloadPieceBackToSourceFailed) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on DownloadPieceBackToSourceFailed with
// the rules defined in the proto definition for this message. If any rules
// are violated, the result is a list of violation errors wrapped in
// DownloadPieceBackToSourceFailedMultiError, or nil if none found.
func (m *DownloadPieceBackToSourceFailed) ValidateAll() error {
return m.validate(true)
}
func (m *DownloadPieceBackToSourceFailed) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Temporary
if m.GetExtendAttribute() == nil {
err := DownloadPieceBackToSourceFailedValidationError{
field: "ExtendAttribute",
reason: "value is required",
}
if !all {
return err
}
errors = append(errors, err)
}
if all {
switch v := interface{}(m.GetExtendAttribute()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, DownloadPieceBackToSourceFailedValidationError{
field: "ExtendAttribute",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, DownloadPieceBackToSourceFailedValidationError{
field: "ExtendAttribute",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetExtendAttribute()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DownloadPieceBackToSourceFailedValidationError{
field: "ExtendAttribute",
reason: "embedded message failed validation",
cause: err,
}
}
}
if m.GetPieceNumber() < 0 {
err := DownloadPieceBackToSourceFailedValidationError{
field: "PieceNumber",
reason: "value must be greater than or equal to 0",
}
if !all {
return err
}
errors = append(errors, err)
}
// no validation rules for Description
if len(errors) > 0 {
return BackendMultiError(errors)
return DownloadPieceBackToSourceFailedMultiError(errors)
}
return nil
}
// BackendMultiError is an error wrapping multiple validation errors returned
// by Backend.ValidateAll() if the designated constraints aren't met.
type BackendMultiError []error
// DownloadPieceBackToSourceFailedMultiError is an error wrapping multiple
// validation errors returned by DownloadPieceBackToSourceFailed.ValidateAll()
// if the designated constraints aren't met.
type DownloadPieceBackToSourceFailedMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m BackendMultiError) Error() string {
func (m DownloadPieceBackToSourceFailedMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
@ -100,11 +239,12 @@ func (m BackendMultiError) Error() string {
}
// AllErrors returns a list of validation violation errors.
func (m BackendMultiError) AllErrors() []error { return m }
func (m DownloadPieceBackToSourceFailedMultiError) AllErrors() []error { return m }
// BackendValidationError is the validation error returned by Backend.Validate
// if the designated constraints aren't met.
type BackendValidationError struct {
// DownloadPieceBackToSourceFailedValidationError is the validation error
// returned by DownloadPieceBackToSourceFailed.Validate if the designated
// constraints aren't met.
type DownloadPieceBackToSourceFailedValidationError struct {
field string
reason string
cause error
@ -112,22 +252,24 @@ type BackendValidationError struct {
}
// Field function returns field value.
func (e BackendValidationError) Field() string { return e.field }
func (e DownloadPieceBackToSourceFailedValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e BackendValidationError) Reason() string { return e.reason }
func (e DownloadPieceBackToSourceFailedValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e BackendValidationError) Cause() error { return e.cause }
func (e DownloadPieceBackToSourceFailedValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e BackendValidationError) Key() bool { return e.key }
func (e DownloadPieceBackToSourceFailedValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e BackendValidationError) ErrorName() string { return "BackendValidationError" }
func (e DownloadPieceBackToSourceFailedValidationError) ErrorName() string {
return "DownloadPieceBackToSourceFailedValidationError"
}
// Error satisfies the builtin error interface
func (e BackendValidationError) Error() string {
func (e DownloadPieceBackToSourceFailedValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
@ -139,14 +281,14 @@ func (e BackendValidationError) Error() string {
}
return fmt.Sprintf(
"invalid %sBackend.%s: %s%s",
"invalid %sDownloadPieceBackToSourceFailed.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = BackendValidationError{}
var _ error = DownloadPieceBackToSourceFailedValidationError{}
var _ interface {
Field() string
@ -154,46 +296,110 @@ var _ interface {
Key() bool
Cause() error
ErrorName() string
} = BackendValidationError{}
} = DownloadPieceBackToSourceFailedValidationError{}
// Validate checks the field values on Unknown with the rules defined in the
// proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *Unknown) Validate() error {
// Validate checks the field values on DownloadPieceFailed with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *DownloadPieceFailed) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on Unknown with the rules defined in the
// proto definition for this message. If any rules are violated, the result is
// a list of violation errors wrapped in UnknownMultiError, or nil if none found.
func (m *Unknown) ValidateAll() error {
// ValidateAll checks the field values on DownloadPieceFailed with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// DownloadPieceFailedMultiError, or nil if none found.
func (m *DownloadPieceFailed) ValidateAll() error {
return m.validate(true)
}
func (m *Unknown) validate(all bool) error {
func (m *DownloadPieceFailed) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if m.Message != nil {
// no validation rules for Message
// no validation rules for Temporary
if m.GetExtendAttribute() == nil {
err := DownloadPieceFailedValidationError{
field: "ExtendAttribute",
reason: "value is required",
}
if !all {
return err
}
errors = append(errors, err)
}
if all {
switch v := interface{}(m.GetExtendAttribute()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, DownloadPieceFailedValidationError{
field: "ExtendAttribute",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, DownloadPieceFailedValidationError{
field: "ExtendAttribute",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetExtendAttribute()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DownloadPieceFailedValidationError{
field: "ExtendAttribute",
reason: "embedded message failed validation",
cause: err,
}
}
}
if utf8.RuneCountInString(m.GetParentId()) < 1 {
err := DownloadPieceFailedValidationError{
field: "ParentId",
reason: "value length must be at least 1 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if m.GetPieceNumber() < 0 {
err := DownloadPieceFailedValidationError{
field: "PieceNumber",
reason: "value must be greater than or equal to 0",
}
if !all {
return err
}
errors = append(errors, err)
}
// no validation rules for Description
if len(errors) > 0 {
return UnknownMultiError(errors)
return DownloadPieceFailedMultiError(errors)
}
return nil
}
// UnknownMultiError is an error wrapping multiple validation errors returned
// by Unknown.ValidateAll() if the designated constraints aren't met.
type UnknownMultiError []error
// DownloadPieceFailedMultiError is an error wrapping multiple validation
// errors returned by DownloadPieceFailed.ValidateAll() if the designated
// constraints aren't met.
type DownloadPieceFailedMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m UnknownMultiError) Error() string {
func (m DownloadPieceFailedMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
@ -202,11 +408,11 @@ func (m UnknownMultiError) Error() string {
}
// AllErrors returns a list of validation violation errors.
func (m UnknownMultiError) AllErrors() []error { return m }
func (m DownloadPieceFailedMultiError) AllErrors() []error { return m }
// UnknownValidationError is the validation error returned by Unknown.Validate
// if the designated constraints aren't met.
type UnknownValidationError struct {
// DownloadPieceFailedValidationError is the validation error returned by
// DownloadPieceFailed.Validate if the designated constraints aren't met.
type DownloadPieceFailedValidationError struct {
field string
reason string
cause error
@ -214,22 +420,24 @@ type UnknownValidationError struct {
}
// Field function returns field value.
func (e UnknownValidationError) Field() string { return e.field }
func (e DownloadPieceFailedValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e UnknownValidationError) Reason() string { return e.reason }
func (e DownloadPieceFailedValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e UnknownValidationError) Cause() error { return e.cause }
func (e DownloadPieceFailedValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e UnknownValidationError) Key() bool { return e.key }
func (e DownloadPieceFailedValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e UnknownValidationError) ErrorName() string { return "UnknownValidationError" }
func (e DownloadPieceFailedValidationError) ErrorName() string {
return "DownloadPieceFailedValidationError"
}
// Error satisfies the builtin error interface
func (e UnknownValidationError) Error() string {
func (e DownloadPieceFailedValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
@ -241,14 +449,14 @@ func (e UnknownValidationError) Error() string {
}
return fmt.Sprintf(
"invalid %sUnknown.%s: %s%s",
"invalid %sDownloadPieceFailed.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = UnknownValidationError{}
var _ error = DownloadPieceFailedValidationError{}
var _ interface {
Field() string
@ -256,4 +464,327 @@ var _ interface {
Key() bool
Cause() error
ErrorName() string
} = UnknownValidationError{}
} = DownloadPieceFailedValidationError{}
// Validate checks the field values on SchedulePeerForbidden with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *SchedulePeerForbidden) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on SchedulePeerForbidden with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// SchedulePeerForbiddenMultiError, or nil if none found.
func (m *SchedulePeerForbidden) ValidateAll() error {
return m.validate(true)
}
func (m *SchedulePeerForbidden) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Description
if len(errors) > 0 {
return SchedulePeerForbiddenMultiError(errors)
}
return nil
}
// SchedulePeerForbiddenMultiError is an error wrapping multiple validation
// errors returned by SchedulePeerForbidden.ValidateAll() if the designated
// constraints aren't met.
type SchedulePeerForbiddenMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m SchedulePeerForbiddenMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m SchedulePeerForbiddenMultiError) AllErrors() []error { return m }
// SchedulePeerForbiddenValidationError is the validation error returned by
// SchedulePeerForbidden.Validate if the designated constraints aren't met.
type SchedulePeerForbiddenValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e SchedulePeerForbiddenValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e SchedulePeerForbiddenValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e SchedulePeerForbiddenValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e SchedulePeerForbiddenValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e SchedulePeerForbiddenValidationError) ErrorName() string {
return "SchedulePeerForbiddenValidationError"
}
// Error satisfies the builtin error interface
func (e SchedulePeerForbiddenValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sSchedulePeerForbidden.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = SchedulePeerForbiddenValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = SchedulePeerForbiddenValidationError{}
// Validate checks the field values on SchedulePeerFailed with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *SchedulePeerFailed) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on SchedulePeerFailed with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// SchedulePeerFailedMultiError, or nil if none found.
func (m *SchedulePeerFailed) ValidateAll() error {
return m.validate(true)
}
func (m *SchedulePeerFailed) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Description
if len(errors) > 0 {
return SchedulePeerFailedMultiError(errors)
}
return nil
}
// SchedulePeerFailedMultiError is an error wrapping multiple validation errors
// returned by SchedulePeerFailed.ValidateAll() if the designated constraints
// aren't met.
type SchedulePeerFailedMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m SchedulePeerFailedMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m SchedulePeerFailedMultiError) AllErrors() []error { return m }
// SchedulePeerFailedValidationError is the validation error returned by
// SchedulePeerFailed.Validate if the designated constraints aren't met.
type SchedulePeerFailedValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e SchedulePeerFailedValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e SchedulePeerFailedValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e SchedulePeerFailedValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e SchedulePeerFailedValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e SchedulePeerFailedValidationError) ErrorName() string {
return "SchedulePeerFailedValidationError"
}
// Error satisfies the builtin error interface
func (e SchedulePeerFailedValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sSchedulePeerFailed.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = SchedulePeerFailedValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = SchedulePeerFailedValidationError{}
// Validate checks the field values on SyncPiecesFailed with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *SyncPiecesFailed) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on SyncPiecesFailed with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// SyncPiecesFailedMultiError, or nil if none found.
func (m *SyncPiecesFailed) ValidateAll() error {
return m.validate(true)
}
func (m *SyncPiecesFailed) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Temporary
if utf8.RuneCountInString(m.GetParentId()) < 1 {
err := SyncPiecesFailedValidationError{
field: "ParentId",
reason: "value length must be at least 1 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
// no validation rules for Description
if len(errors) > 0 {
return SyncPiecesFailedMultiError(errors)
}
return nil
}
// SyncPiecesFailedMultiError is an error wrapping multiple validation errors
// returned by SyncPiecesFailed.ValidateAll() if the designated constraints
// aren't met.
type SyncPiecesFailedMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m SyncPiecesFailedMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m SyncPiecesFailedMultiError) AllErrors() []error { return m }
// SyncPiecesFailedValidationError is the validation error returned by
// SyncPiecesFailed.Validate if the designated constraints aren't met.
type SyncPiecesFailedValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e SyncPiecesFailedValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e SyncPiecesFailedValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e SyncPiecesFailedValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e SyncPiecesFailedValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e SyncPiecesFailedValidationError) ErrorName() string { return "SyncPiecesFailedValidationError" }
// Error satisfies the builtin error interface
func (e SyncPiecesFailedValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sSyncPiecesFailed.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = SyncPiecesFailedValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = SyncPiecesFailedValidationError{}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2024 The Dragonfly Authors
* Copyright 2022 The Dragonfly Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -19,21 +19,60 @@ syntax = "proto3";
package errordetails.v2;
import "validate/validate.proto";
import "pkg/apis/common/v2/common.proto";
option go_package = "d7y.io/api/v2/pkg/apis/errordetails/v2;errordetails";
option go_package = "d7y.io/api/pkg/apis/errordetails/v2;errordetails";
// Backend is error detail for Backend.
message Backend {
// Backend error message.
string message = 1;
// Backend HTTP response header.
map<string, string> header = 2;
// Backend HTTP status code.
optional int32 status_code = 3 [(validate.rules).int32 = {gte: 100, lt: 599, ignore_empty: true}];
// DownloadPeerBackToSourceFailed is error detail of downloading peer back-to-source.
message DownloadPeerBackToSourceFailed {
// The description of the error.
string description = 1;
}
// Unknown is error detail for Unknown.
message Unknown {
// Unknown error message.
optional string message = 1;
// DownloadPieceBackToSourceFailed is error detail of downloading piece back-to-source.
message DownloadPieceBackToSourceFailed {
// Temporary recoverable error of source.
bool temporary = 1;
// Source response metadata, eg: HTTP Status Code, HTTP Status, HTTP Header
common.v2.ExtendAttribute extend_attribute = 2 [(validate.rules).message.required = true];
// The number of piece.
uint32 piece_number = 3 [(validate.rules).uint32.gte = 0];
// The description of the error.
string description = 4;
}
// DownloadPieceFailed is error detail of downloading piece.
message DownloadPieceFailed {
// Temporary recoverable error of parent peer.
bool temporary = 1;
// Source response metadata, eg: HTTP Status Code, HTTP Status, HTTP Header
common.v2.ExtendAttribute extend_attribute = 2 [(validate.rules).message.required = true];
// Piece is information of piece.
string parent_id = 3 [(validate.rules).string.min_len = 1];
// The number of piece.
uint32 piece_number = 4 [(validate.rules).uint32.gte = 0];
// The description of the error.
string description = 5;
}
// SchedulePeerForbidden is error detail of forbidden.
message SchedulePeerForbidden {
// The description of the error.
string description = 1;
}
// SchedulePeerFailed is error detail of scheduling.
message SchedulePeerFailed {
// The description of the error.
string description = 1;
}
// SyncPiecesFailed is error detail of syncing pieces.
message SyncPiecesFailed {
// Temporary recoverable error of parent peer.
bool temporary = 1;
// Parent peer id.
string parent_id = 2 [(validate.rules).string.min_len = 1];
// The description of the error.
string description = 3;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -21,8 +21,9 @@ package manager;
import "pkg/apis/common/v1/common.proto";
import "google/protobuf/empty.proto";
import "validate/validate.proto";
import "google/protobuf/timestamp.proto";
option go_package = "d7y.io/api/v2/pkg/apis/manager/v1;manager";
option go_package = "d7y.io/api/pkg/apis/manager/v1;manager";
// Request source type.
enum SourceType {
@ -34,6 +35,20 @@ enum SourceType {
SEED_PEER_SOURCE = 2;
}
// SecurityGroup represents security group of cluster.
message SecurityGroup {
// Group id.
uint64 id = 1;
// Group name.
string name = 2;
// Group biography.
string bio = 3;
// Group domain.
string domain = 4;
// Group proxy domain.
string proxy_domain = 5;
}
// SeedPeerCluster represents cluster of seed peer.
message SeedPeerCluster {
// Cluster id.
@ -44,6 +59,10 @@ message SeedPeerCluster {
string bio = 3;
// Cluster configuration.
bytes config = 4;
// Cluster scopes.
bytes scopes = 5;
// Security group to which the seed peer cluster belongs.
SecurityGroup security_group = 6;
}
// SeedPeer represents seed peer for network.
@ -51,7 +70,7 @@ message SeedPeer {
// Seed peer id.
uint64 id = 1;
// Seed peer hostname.
string hostname = 2;
string host_name = 2;
// Seed peer type.
string type = 3;
// Seed peer idc.
@ -81,39 +100,19 @@ message GetSeedPeerRequest {
// Request source type.
SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
// Seed peer hostname.
string hostname = 2 [(validate.rules).string.hostname = true];
string host_name = 2 [(validate.rules).string.hostname = true];
// ID of the cluster to which the seed peer belongs.
uint64 seed_peer_cluster_id = 3 [(validate.rules).uint64 = {gte: 1}];
// Seed peer ip.
string ip = 4 [(validate.rules).string = {ip: true, ignore_empty: true}];
}
// ListSeedPeersRequest represents request of ListSeedPeers.
message ListSeedPeersRequest {
// Request source type.
SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
// Source service hostname.
string hostname = 2 [(validate.rules).string.hostname = true];
// Source service ip.
string ip = 3 [(validate.rules).string.ip = true];
// Dfdaemon version.
string version = 4 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
// Dfdaemon commit.
string commit = 5 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
}
// ListSeedPeersResponse represents response of ListSeedPeers.
message ListSeedPeersResponse {
// Seed peers to which the source service belongs.
repeated SeedPeer seed_peers = 1;
}
// UpdateSeedPeerRequest represents request of UpdateSeedPeer.
message UpdateSeedPeerRequest {
// Request source type.
SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
// Seed peer hostname.
string hostname = 2 [(validate.rules).string.hostname = true];
string host_name = 2 [(validate.rules).string.hostname = true];
// Seed peer type.
string type = 3 [(validate.rules).string = {in: ["super", "strong", "weak"]}];
// Seed peer idc.
@ -146,14 +145,16 @@ message SchedulerCluster {
bytes client_config = 5;
// Cluster scopes.
bytes scopes = 6;
// Security group to which the scheduler cluster belongs.
SecurityGroup security_group = 7;
}
// Scheduler represents scheduler for network.
// SeedPeerCluster represents scheduler for network.
message Scheduler {
// Scheduler id.
uint64 id = 1;
// Scheduler hostname.
string hostname = 2;
string host_name = 2;
// Deprecated: Do not use.
string vips = 3;
// Scheduler idc.
@ -172,8 +173,6 @@ message Scheduler {
SchedulerCluster scheduler_cluster = 11;
// Seed peers to which the scheduler belongs.
repeated SeedPeer seed_peers = 13;
// Feature flags of scheduler.
bytes features = 14;
}
// GetSchedulerRequest represents request of GetScheduler.
@ -181,7 +180,7 @@ message GetSchedulerRequest {
// Request source type.
SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
// Scheduler hostname.
string hostname = 2 [(validate.rules).string.hostname = true];
string host_name = 2 [(validate.rules).string.hostname = true];
// ID of the cluster to which the scheduler belongs.
uint64 scheduler_cluster_id = 3 [(validate.rules).uint64 = {gte: 1}];
// Scheduler ip.
@ -193,7 +192,7 @@ message UpdateSchedulerRequest {
// Request source type.
SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
// Scheduler hostname.
string hostname = 2 [(validate.rules).string.hostname = true];
string host_name = 2 [(validate.rules).string.hostname = true];
// ID of the cluster to which the scheduler belongs.
uint64 scheduler_cluster_id = 3 [(validate.rules).uint64 = {gte: 1}];
// Deprecated: Do not use.
@ -215,7 +214,7 @@ message ListSchedulersRequest {
// Request source type.
SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
// Source service hostname.
string hostname = 2 [(validate.rules).string.hostname = true];
string host_name = 2 [(validate.rules).string.hostname = true];
// Source service ip.
string ip = 3 [(validate.rules).string.ip = true];
// Source service host information.
@ -251,8 +250,6 @@ message ObjectStorage {
// (`http://BUCKET.s3.amazonaws.com/KEY`).
// Refer to https://github.com/aws/aws-sdk-go/blob/main/aws/config.go#L118.
bool s3_force_path_style = 6;
// Scheme is the scheme of the http client.
string scheme = 7 [(validate.rules).string = {in: ["http", "https"]}];
}
// GetObjectStorageRequest represents request of GetObjectStorage.
@ -260,7 +257,7 @@ message GetObjectStorageRequest {
// Request source type.
SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
// Source service hostname.
string hostname = 2 [(validate.rules).string.hostname = true];
string host_name = 2 [(validate.rules).string.hostname = true];
// Source service ip.
string ip = 3 [(validate.rules).string.ip = true];
}
@ -276,7 +273,7 @@ message ListBucketsRequest {
// Request source type.
SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
// Source service hostname.
string hostname = 2 [(validate.rules).string.hostname = true];
string host_name = 2 [(validate.rules).string.hostname = true];
// Source service ip.
string ip = 3 [(validate.rules).string.ip = true];
}
@ -287,6 +284,178 @@ message ListBucketsResponse {
repeated Bucket buckets = 1;
}
// Model represents information of model.
message Model {
// Model id.
string model_id = 1 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Model name.
string name = 2 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Model version id.
string version_id = 3 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Scheduler id.
uint64 scheduler_id = 4 [(validate.rules).uint64 = {gte: 1}];
// Scheduler hostname.
string host_name = 5 [(validate.rules).string.hostname = true];
// Scheduler ip.
string ip = 6 [(validate.rules).string.ip = true];
// Model create time.
google.protobuf.Timestamp created_at = 7 [(validate.rules).timestamp.required = true];
// Model update time.
google.protobuf.Timestamp updated_at = 8 [(validate.rules).timestamp.required = true];
}
// ListModelsRequest represents request of ListModels.
message ListModelsRequest {
// Scheduler id.
uint64 scheduler_id = 1 [(validate.rules).uint64 = {gte: 1}];
}
// ListModelsResponse represents response of ListModels.
message ListModelsResponse {
// Model informations.
repeated Model models = 1;
}
// GetModelRequest represents request of GetModel.
message GetModelRequest {
// Scheduler id.
uint64 scheduler_id = 1 [(validate.rules).uint64 = {gte: 1}];
// Model id.
string model_id = 2 [(validate.rules).string = {min_len: 1, max_len: 1024}];
}
// CreateModelRequest represents request of CreateModel.
message CreateModelRequest {
// Model id.
string model_id = 1 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Model name.
string name = 2 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Model version id.
string version_id = 3 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Scheduler id.
uint64 scheduler_id = 4 [(validate.rules).uint64 = {gte: 1}];
// Scheduler hostname.
string host_name = 5 [(validate.rules).string.hostname = true];
// Scheduler ip.
string ip = 6 [(validate.rules).string.ip = true];
}
// UpdateModelRequest represents request of UpdateModel.
message UpdateModelRequest {
// Model id.
string model_id = 1 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Model name.
string name = 2 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
// Model version id.
string version_id = 3 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
// Scheduler id.
uint64 scheduler_id = 4 [(validate.rules).uint64 = {gte: 1}];
// Scheduler hostname.
string host_name = 5 [(validate.rules).string = {hostname: true, ignore_empty: true}];
// Scheduler ip.
string ip = 6 [(validate.rules).string = {ip: true, ignore_empty: true}];
}
// DeleteModelRequest represents request of DeleteModel.
message DeleteModelRequest {
// Scheduler id.
uint64 scheduler_id = 1 [(validate.rules).uint64 = {gte: 1}];
// Model id.
string model_id = 2 [(validate.rules).string = {min_len: 1, max_len: 1024}];
}
// ModelVersion represents information of model version.
message ModelVersion {
// Model version id.
string version_id = 1 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Model version data.
bytes data = 2 [(validate.rules).bytes.min_len = 1];
// Model version mae.
double mae = 3 [(validate.rules).double.gte = 0];
// Model version mse.
double mse = 4 [(validate.rules).double.gte = 0];
// Model version rmse.
double rmse = 5 [(validate.rules).double.gte = 0];
// Model version r^2.
double r2 = 6;
// Model create time.
google.protobuf.Timestamp created_at = 7 [(validate.rules).timestamp.required = true];
// Model update time.
google.protobuf.Timestamp updated_at = 8 [(validate.rules).timestamp.required = true];
}
// ListModelVersionsRequest represents request of ListModelVersions.
message ListModelVersionsRequest {
// Scheduler id.
uint64 scheduler_id = 1 [(validate.rules).uint64 = {gte: 1}];
// Model id.
string model_id = 2 [(validate.rules).string = {min_len: 1, max_len: 1024}];
}
// ListModelVersionsResponse represents response of ListModelVersions.
message ListModelVersionsResponse {
// Model version informations.
repeated ModelVersion model_versions = 1;
}
// GetModelVersionRequest represents request of GetModelVersion.
message GetModelVersionRequest {
// Scheduler id.
uint64 scheduler_id = 1 [(validate.rules).uint64 = {gte: 1}];
// Model id.
string model_id = 2 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Model version id.
string version_id = 3 [(validate.rules).string = {min_len: 1, max_len: 1024}];
}
// CreateModelVersionRequest represents request of CreateModelVersion.
message CreateModelVersionRequest {
// Scheduler id.
uint64 scheduler_id = 1 [(validate.rules).uint64 = {gte: 1}];
// Model id.
string model_id = 2 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Model version data.
bytes data = 3 [(validate.rules).bytes.min_len = 1];
// Model version mae.
double mae = 4 [(validate.rules).double.gte = 0];
// Model version mse.
double mse = 5 [(validate.rules).double.gte = 0];
// Model version rmse.
double rmse = 6 [(validate.rules).double.gte = 0];
// Model version r^2.
double r2 = 7;
}
// UpdateModelVersionRequest represents request of UpdateModelVersion.
message UpdateModelVersionRequest {
// Model version id.
string version_id = 1 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Scheduler id.
uint64 scheduler_id = 2 [(validate.rules).uint64 = {gte: 1}];
// Model id.
string model_id = 3 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Model version data.
bytes data = 4 [(validate.rules).bytes = {min_len: 1, ignore_empty: true}];
// Model version mae.
double mae = 5 [(validate.rules).double = {gte: 0, ignore_empty: true}];
// Model version mse.
double mse = 6 [(validate.rules).double = {gte: 0, ignore_empty: true}];
// Model version rmse.
double rmse = 7 [(validate.rules).double = {gte: 0, ignore_empty: true}];
// Model version r^2.
double r2 = 8 [(validate.rules).double = {ignore_empty: true}];
}
// DeleteModelVersionRequest represents request of DeleteModelVersion.
message DeleteModelVersionRequest {
// Scheduler id.
uint64 scheduler_id = 1 [(validate.rules).uint64 = {gte: 1}];
// Model id.
string model_id = 2 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Model version id.
string version_id = 3 [(validate.rules).string = {min_len: 1, max_len: 1024}];
}
// URLPriority represents config of url priority.
message URLPriority {
// URL regex.
@ -322,7 +491,7 @@ message ListApplicationsRequest {
// Request source type.
SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
// Source service hostname.
string hostname = 2 [(validate.rules).string.hostname = true];
string host_name = 2 [(validate.rules).string.hostname = true];
// Source service ip.
string ip = 3 [(validate.rules).string.ip = true];
}
@ -338,7 +507,7 @@ message KeepAliveRequest {
// Request source type.
SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
// Source service hostname.
string hostname = 2 [(validate.rules).string.hostname = true];
string host_name = 2 [(validate.rules).string.hostname = true];
// ID of the cluster to which the source service belongs.
uint64 cluster_id = 3 [(validate.rules).uint64 = {gte: 1}];
// Source service ip.
@ -350,9 +519,6 @@ service Manager {
// Get SeedPeer and SeedPeer cluster configuration.
rpc GetSeedPeer(GetSeedPeerRequest) returns(SeedPeer);
// List acitve schedulers configuration.
rpc ListSeedPeers(ListSeedPeersRequest)returns(ListSeedPeersResponse);
// Update SeedPeer configuration.
rpc UpdateSeedPeer(UpdateSeedPeerRequest) returns(SeedPeer);
@ -371,6 +537,36 @@ service Manager {
// List buckets configuration.
rpc ListBuckets(ListBucketsRequest)returns(ListBucketsResponse);
// List models information.
rpc ListModels(ListModelsRequest)returns(ListModelsResponse);
// Get model information.
rpc GetModel(GetModelRequest)returns(Model);
// Create model information.
rpc CreateModel(CreateModelRequest)returns(Model);
// Update model information.
rpc UpdateModel(UpdateModelRequest)returns(Model);
// Delete model information.
rpc DeleteModel(DeleteModelRequest)returns(google.protobuf.Empty);
// List model versions information.
rpc ListModelVersions(ListModelVersionsRequest)returns(ListModelVersionsResponse);
// Get model version information.
rpc GetModelVersion(GetModelVersionRequest)returns(ModelVersion);
// Create model version information.
rpc CreateModelVersion(CreateModelVersionRequest)returns(ModelVersion);
// Update model version information.
rpc UpdateModelVersion(UpdateModelVersionRequest)returns(ModelVersion);
// Delete model version information.
rpc DeleteModelVersion(DeleteModelVersionRequest)returns(google.protobuf.Empty);
// List applications configuration.
rpc ListApplications(ListApplicationsRequest)returns(ListApplicationsResponse);

View File

@ -25,8 +25,6 @@ const _ = grpc.SupportPackageIsVersion7
type ManagerClient interface {
// Get SeedPeer and SeedPeer cluster configuration.
GetSeedPeer(ctx context.Context, in *GetSeedPeerRequest, opts ...grpc.CallOption) (*SeedPeer, error)
// List acitve schedulers configuration.
ListSeedPeers(ctx context.Context, in *ListSeedPeersRequest, opts ...grpc.CallOption) (*ListSeedPeersResponse, error)
// Update SeedPeer configuration.
UpdateSeedPeer(ctx context.Context, in *UpdateSeedPeerRequest, opts ...grpc.CallOption) (*SeedPeer, error)
// Get Scheduler and Scheduler cluster configuration.
@ -39,6 +37,26 @@ type ManagerClient interface {
GetObjectStorage(ctx context.Context, in *GetObjectStorageRequest, opts ...grpc.CallOption) (*ObjectStorage, error)
// List buckets configuration.
ListBuckets(ctx context.Context, in *ListBucketsRequest, opts ...grpc.CallOption) (*ListBucketsResponse, error)
// List models information.
ListModels(ctx context.Context, in *ListModelsRequest, opts ...grpc.CallOption) (*ListModelsResponse, error)
// Get model information.
GetModel(ctx context.Context, in *GetModelRequest, opts ...grpc.CallOption) (*Model, error)
// Create model information.
CreateModel(ctx context.Context, in *CreateModelRequest, opts ...grpc.CallOption) (*Model, error)
// Update model information.
UpdateModel(ctx context.Context, in *UpdateModelRequest, opts ...grpc.CallOption) (*Model, error)
// Delete model information.
DeleteModel(ctx context.Context, in *DeleteModelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// List model versions information.
ListModelVersions(ctx context.Context, in *ListModelVersionsRequest, opts ...grpc.CallOption) (*ListModelVersionsResponse, error)
// Get model version information.
GetModelVersion(ctx context.Context, in *GetModelVersionRequest, opts ...grpc.CallOption) (*ModelVersion, error)
// Create model version information.
CreateModelVersion(ctx context.Context, in *CreateModelVersionRequest, opts ...grpc.CallOption) (*ModelVersion, error)
// Update model version information.
UpdateModelVersion(ctx context.Context, in *UpdateModelVersionRequest, opts ...grpc.CallOption) (*ModelVersion, error)
// Delete model version information.
DeleteModelVersion(ctx context.Context, in *DeleteModelVersionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// List applications configuration.
ListApplications(ctx context.Context, in *ListApplicationsRequest, opts ...grpc.CallOption) (*ListApplicationsResponse, error)
// KeepAlive with manager.
@ -62,15 +80,6 @@ func (c *managerClient) GetSeedPeer(ctx context.Context, in *GetSeedPeerRequest,
return out, nil
}
func (c *managerClient) ListSeedPeers(ctx context.Context, in *ListSeedPeersRequest, opts ...grpc.CallOption) (*ListSeedPeersResponse, error) {
out := new(ListSeedPeersResponse)
err := c.cc.Invoke(ctx, "/manager.Manager/ListSeedPeers", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) UpdateSeedPeer(ctx context.Context, in *UpdateSeedPeerRequest, opts ...grpc.CallOption) (*SeedPeer, error) {
out := new(SeedPeer)
err := c.cc.Invoke(ctx, "/manager.Manager/UpdateSeedPeer", in, out, opts...)
@ -125,6 +134,96 @@ func (c *managerClient) ListBuckets(ctx context.Context, in *ListBucketsRequest,
return out, nil
}
func (c *managerClient) ListModels(ctx context.Context, in *ListModelsRequest, opts ...grpc.CallOption) (*ListModelsResponse, error) {
out := new(ListModelsResponse)
err := c.cc.Invoke(ctx, "/manager.Manager/ListModels", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) GetModel(ctx context.Context, in *GetModelRequest, opts ...grpc.CallOption) (*Model, error) {
out := new(Model)
err := c.cc.Invoke(ctx, "/manager.Manager/GetModel", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) CreateModel(ctx context.Context, in *CreateModelRequest, opts ...grpc.CallOption) (*Model, error) {
out := new(Model)
err := c.cc.Invoke(ctx, "/manager.Manager/CreateModel", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) UpdateModel(ctx context.Context, in *UpdateModelRequest, opts ...grpc.CallOption) (*Model, error) {
out := new(Model)
err := c.cc.Invoke(ctx, "/manager.Manager/UpdateModel", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) DeleteModel(ctx context.Context, in *DeleteModelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/manager.Manager/DeleteModel", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) ListModelVersions(ctx context.Context, in *ListModelVersionsRequest, opts ...grpc.CallOption) (*ListModelVersionsResponse, error) {
out := new(ListModelVersionsResponse)
err := c.cc.Invoke(ctx, "/manager.Manager/ListModelVersions", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) GetModelVersion(ctx context.Context, in *GetModelVersionRequest, opts ...grpc.CallOption) (*ModelVersion, error) {
out := new(ModelVersion)
err := c.cc.Invoke(ctx, "/manager.Manager/GetModelVersion", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) CreateModelVersion(ctx context.Context, in *CreateModelVersionRequest, opts ...grpc.CallOption) (*ModelVersion, error) {
out := new(ModelVersion)
err := c.cc.Invoke(ctx, "/manager.Manager/CreateModelVersion", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) UpdateModelVersion(ctx context.Context, in *UpdateModelVersionRequest, opts ...grpc.CallOption) (*ModelVersion, error) {
out := new(ModelVersion)
err := c.cc.Invoke(ctx, "/manager.Manager/UpdateModelVersion", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) DeleteModelVersion(ctx context.Context, in *DeleteModelVersionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/manager.Manager/DeleteModelVersion", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) ListApplications(ctx context.Context, in *ListApplicationsRequest, opts ...grpc.CallOption) (*ListApplicationsResponse, error) {
out := new(ListApplicationsResponse)
err := c.cc.Invoke(ctx, "/manager.Manager/ListApplications", in, out, opts...)
@ -174,8 +273,6 @@ func (x *managerKeepAliveClient) CloseAndRecv() (*emptypb.Empty, error) {
type ManagerServer interface {
// Get SeedPeer and SeedPeer cluster configuration.
GetSeedPeer(context.Context, *GetSeedPeerRequest) (*SeedPeer, error)
// List acitve schedulers configuration.
ListSeedPeers(context.Context, *ListSeedPeersRequest) (*ListSeedPeersResponse, error)
// Update SeedPeer configuration.
UpdateSeedPeer(context.Context, *UpdateSeedPeerRequest) (*SeedPeer, error)
// Get Scheduler and Scheduler cluster configuration.
@ -188,6 +285,26 @@ type ManagerServer interface {
GetObjectStorage(context.Context, *GetObjectStorageRequest) (*ObjectStorage, error)
// List buckets configuration.
ListBuckets(context.Context, *ListBucketsRequest) (*ListBucketsResponse, error)
// List models information.
ListModels(context.Context, *ListModelsRequest) (*ListModelsResponse, error)
// Get model information.
GetModel(context.Context, *GetModelRequest) (*Model, error)
// Create model information.
CreateModel(context.Context, *CreateModelRequest) (*Model, error)
// Update model information.
UpdateModel(context.Context, *UpdateModelRequest) (*Model, error)
// Delete model information.
DeleteModel(context.Context, *DeleteModelRequest) (*emptypb.Empty, error)
// List model versions information.
ListModelVersions(context.Context, *ListModelVersionsRequest) (*ListModelVersionsResponse, error)
// Get model version information.
GetModelVersion(context.Context, *GetModelVersionRequest) (*ModelVersion, error)
// Create model version information.
CreateModelVersion(context.Context, *CreateModelVersionRequest) (*ModelVersion, error)
// Update model version information.
UpdateModelVersion(context.Context, *UpdateModelVersionRequest) (*ModelVersion, error)
// Delete model version information.
DeleteModelVersion(context.Context, *DeleteModelVersionRequest) (*emptypb.Empty, error)
// List applications configuration.
ListApplications(context.Context, *ListApplicationsRequest) (*ListApplicationsResponse, error)
// KeepAlive with manager.
@ -201,9 +318,6 @@ type UnimplementedManagerServer struct {
func (UnimplementedManagerServer) GetSeedPeer(context.Context, *GetSeedPeerRequest) (*SeedPeer, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetSeedPeer not implemented")
}
func (UnimplementedManagerServer) ListSeedPeers(context.Context, *ListSeedPeersRequest) (*ListSeedPeersResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListSeedPeers not implemented")
}
func (UnimplementedManagerServer) UpdateSeedPeer(context.Context, *UpdateSeedPeerRequest) (*SeedPeer, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateSeedPeer not implemented")
}
@ -222,6 +336,36 @@ func (UnimplementedManagerServer) GetObjectStorage(context.Context, *GetObjectSt
func (UnimplementedManagerServer) ListBuckets(context.Context, *ListBucketsRequest) (*ListBucketsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListBuckets not implemented")
}
func (UnimplementedManagerServer) ListModels(context.Context, *ListModelsRequest) (*ListModelsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListModels not implemented")
}
func (UnimplementedManagerServer) GetModel(context.Context, *GetModelRequest) (*Model, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetModel not implemented")
}
func (UnimplementedManagerServer) CreateModel(context.Context, *CreateModelRequest) (*Model, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateModel not implemented")
}
func (UnimplementedManagerServer) UpdateModel(context.Context, *UpdateModelRequest) (*Model, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateModel not implemented")
}
func (UnimplementedManagerServer) DeleteModel(context.Context, *DeleteModelRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteModel not implemented")
}
func (UnimplementedManagerServer) ListModelVersions(context.Context, *ListModelVersionsRequest) (*ListModelVersionsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListModelVersions not implemented")
}
func (UnimplementedManagerServer) GetModelVersion(context.Context, *GetModelVersionRequest) (*ModelVersion, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetModelVersion not implemented")
}
func (UnimplementedManagerServer) CreateModelVersion(context.Context, *CreateModelVersionRequest) (*ModelVersion, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateModelVersion not implemented")
}
func (UnimplementedManagerServer) UpdateModelVersion(context.Context, *UpdateModelVersionRequest) (*ModelVersion, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateModelVersion not implemented")
}
func (UnimplementedManagerServer) DeleteModelVersion(context.Context, *DeleteModelVersionRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteModelVersion not implemented")
}
func (UnimplementedManagerServer) ListApplications(context.Context, *ListApplicationsRequest) (*ListApplicationsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListApplications not implemented")
}
@ -258,24 +402,6 @@ func _Manager_GetSeedPeer_Handler(srv interface{}, ctx context.Context, dec func
return interceptor(ctx, in, info, handler)
}
func _Manager_ListSeedPeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListSeedPeersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).ListSeedPeers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.Manager/ListSeedPeers",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).ListSeedPeers(ctx, req.(*ListSeedPeersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_UpdateSeedPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateSeedPeerRequest)
if err := dec(in); err != nil {
@ -384,6 +510,186 @@ func _Manager_ListBuckets_Handler(srv interface{}, ctx context.Context, dec func
return interceptor(ctx, in, info, handler)
}
func _Manager_ListModels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListModelsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).ListModels(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.Manager/ListModels",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).ListModels(ctx, req.(*ListModelsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_GetModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetModelRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).GetModel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.Manager/GetModel",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).GetModel(ctx, req.(*GetModelRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_CreateModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateModelRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).CreateModel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.Manager/CreateModel",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).CreateModel(ctx, req.(*CreateModelRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_UpdateModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateModelRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).UpdateModel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.Manager/UpdateModel",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).UpdateModel(ctx, req.(*UpdateModelRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_DeleteModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteModelRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).DeleteModel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.Manager/DeleteModel",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).DeleteModel(ctx, req.(*DeleteModelRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_ListModelVersions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListModelVersionsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).ListModelVersions(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.Manager/ListModelVersions",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).ListModelVersions(ctx, req.(*ListModelVersionsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_GetModelVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetModelVersionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).GetModelVersion(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.Manager/GetModelVersion",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).GetModelVersion(ctx, req.(*GetModelVersionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_CreateModelVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateModelVersionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).CreateModelVersion(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.Manager/CreateModelVersion",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).CreateModelVersion(ctx, req.(*CreateModelVersionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_UpdateModelVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateModelVersionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).UpdateModelVersion(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.Manager/UpdateModelVersion",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).UpdateModelVersion(ctx, req.(*UpdateModelVersionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_DeleteModelVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteModelVersionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).DeleteModelVersion(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.Manager/DeleteModelVersion",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).DeleteModelVersion(ctx, req.(*DeleteModelVersionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_ListApplications_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListApplicationsRequest)
if err := dec(in); err != nil {
@ -439,10 +745,6 @@ var Manager_ServiceDesc = grpc.ServiceDesc{
MethodName: "GetSeedPeer",
Handler: _Manager_GetSeedPeer_Handler,
},
{
MethodName: "ListSeedPeers",
Handler: _Manager_ListSeedPeers_Handler,
},
{
MethodName: "UpdateSeedPeer",
Handler: _Manager_UpdateSeedPeer_Handler,
@ -467,6 +769,46 @@ var Manager_ServiceDesc = grpc.ServiceDesc{
MethodName: "ListBuckets",
Handler: _Manager_ListBuckets_Handler,
},
{
MethodName: "ListModels",
Handler: _Manager_ListModels_Handler,
},
{
MethodName: "GetModel",
Handler: _Manager_GetModel_Handler,
},
{
MethodName: "CreateModel",
Handler: _Manager_CreateModel_Handler,
},
{
MethodName: "UpdateModel",
Handler: _Manager_UpdateModel_Handler,
},
{
MethodName: "DeleteModel",
Handler: _Manager_DeleteModel_Handler,
},
{
MethodName: "ListModelVersions",
Handler: _Manager_ListModelVersions_Handler,
},
{
MethodName: "GetModelVersion",
Handler: _Manager_GetModelVersion_Handler,
},
{
MethodName: "CreateModelVersion",
Handler: _Manager_CreateModelVersion_Handler,
},
{
MethodName: "UpdateModelVersion",
Handler: _Manager_UpdateModelVersion_Handler,
},
{
MethodName: "DeleteModelVersion",
Handler: _Manager_DeleteModelVersion_Handler,
},
{
MethodName: "ListApplications",
Handler: _Manager_ListApplications_Handler,

View File

@ -1,10 +1,5 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: ../manager_grpc.pb.go
//
// Generated by this command:
//
// mockgen -destination manager_mock.go -source ../manager_grpc.pb.go -package mocks
//
// Package mocks is a generated GoMock package.
package mocks
@ -13,8 +8,8 @@ import (
context "context"
reflect "reflect"
manager "d7y.io/api/v2/pkg/apis/manager/v1"
gomock "go.uber.org/mock/gomock"
manager "d7y.io/api/pkg/apis/manager/v1"
gomock "github.com/golang/mock/gomock"
grpc "google.golang.org/grpc"
metadata "google.golang.org/grpc/metadata"
emptypb "google.golang.org/protobuf/types/known/emptypb"
@ -24,7 +19,6 @@ import (
type MockManagerClient struct {
ctrl *gomock.Controller
recorder *MockManagerClientMockRecorder
isgomock struct{}
}
// MockManagerClientMockRecorder is the mock recorder for MockManagerClient.
@ -44,10 +38,130 @@ func (m *MockManagerClient) EXPECT() *MockManagerClientMockRecorder {
return m.recorder
}
// CreateModel mocks base method.
func (m *MockManagerClient) CreateModel(ctx context.Context, in *manager.CreateModelRequest, opts ...grpc.CallOption) (*manager.Model, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "CreateModel", varargs...)
ret0, _ := ret[0].(*manager.Model)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CreateModel indicates an expected call of CreateModel.
func (mr *MockManagerClientMockRecorder) CreateModel(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateModel", reflect.TypeOf((*MockManagerClient)(nil).CreateModel), varargs...)
}
// CreateModelVersion mocks base method.
func (m *MockManagerClient) CreateModelVersion(ctx context.Context, in *manager.CreateModelVersionRequest, opts ...grpc.CallOption) (*manager.ModelVersion, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "CreateModelVersion", varargs...)
ret0, _ := ret[0].(*manager.ModelVersion)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CreateModelVersion indicates an expected call of CreateModelVersion.
func (mr *MockManagerClientMockRecorder) CreateModelVersion(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateModelVersion", reflect.TypeOf((*MockManagerClient)(nil).CreateModelVersion), varargs...)
}
// DeleteModel mocks base method.
func (m *MockManagerClient) DeleteModel(ctx context.Context, in *manager.DeleteModelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "DeleteModel", varargs...)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// DeleteModel indicates an expected call of DeleteModel.
func (mr *MockManagerClientMockRecorder) DeleteModel(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteModel", reflect.TypeOf((*MockManagerClient)(nil).DeleteModel), varargs...)
}
// DeleteModelVersion mocks base method.
func (m *MockManagerClient) DeleteModelVersion(ctx context.Context, in *manager.DeleteModelVersionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "DeleteModelVersion", varargs...)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// DeleteModelVersion indicates an expected call of DeleteModelVersion.
func (mr *MockManagerClientMockRecorder) DeleteModelVersion(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteModelVersion", reflect.TypeOf((*MockManagerClient)(nil).DeleteModelVersion), varargs...)
}
// GetModel mocks base method.
func (m *MockManagerClient) GetModel(ctx context.Context, in *manager.GetModelRequest, opts ...grpc.CallOption) (*manager.Model, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetModel", varargs...)
ret0, _ := ret[0].(*manager.Model)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetModel indicates an expected call of GetModel.
func (mr *MockManagerClientMockRecorder) GetModel(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModel", reflect.TypeOf((*MockManagerClient)(nil).GetModel), varargs...)
}
// GetModelVersion mocks base method.
func (m *MockManagerClient) GetModelVersion(ctx context.Context, in *manager.GetModelVersionRequest, opts ...grpc.CallOption) (*manager.ModelVersion, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetModelVersion", varargs...)
ret0, _ := ret[0].(*manager.ModelVersion)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetModelVersion indicates an expected call of GetModelVersion.
func (mr *MockManagerClientMockRecorder) GetModelVersion(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModelVersion", reflect.TypeOf((*MockManagerClient)(nil).GetModelVersion), varargs...)
}
// GetObjectStorage mocks base method.
func (m *MockManagerClient) GetObjectStorage(ctx context.Context, in *manager.GetObjectStorageRequest, opts ...grpc.CallOption) (*manager.ObjectStorage, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -58,16 +172,16 @@ func (m *MockManagerClient) GetObjectStorage(ctx context.Context, in *manager.Ge
}
// GetObjectStorage indicates an expected call of GetObjectStorage.
func (mr *MockManagerClientMockRecorder) GetObjectStorage(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockManagerClientMockRecorder) GetObjectStorage(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetObjectStorage", reflect.TypeOf((*MockManagerClient)(nil).GetObjectStorage), varargs...)
}
// GetScheduler mocks base method.
func (m *MockManagerClient) GetScheduler(ctx context.Context, in *manager.GetSchedulerRequest, opts ...grpc.CallOption) (*manager.Scheduler, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -78,16 +192,16 @@ func (m *MockManagerClient) GetScheduler(ctx context.Context, in *manager.GetSch
}
// GetScheduler indicates an expected call of GetScheduler.
func (mr *MockManagerClientMockRecorder) GetScheduler(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockManagerClientMockRecorder) GetScheduler(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetScheduler", reflect.TypeOf((*MockManagerClient)(nil).GetScheduler), varargs...)
}
// GetSeedPeer mocks base method.
func (m *MockManagerClient) GetSeedPeer(ctx context.Context, in *manager.GetSeedPeerRequest, opts ...grpc.CallOption) (*manager.SeedPeer, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -98,16 +212,16 @@ func (m *MockManagerClient) GetSeedPeer(ctx context.Context, in *manager.GetSeed
}
// GetSeedPeer indicates an expected call of GetSeedPeer.
func (mr *MockManagerClientMockRecorder) GetSeedPeer(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockManagerClientMockRecorder) GetSeedPeer(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSeedPeer", reflect.TypeOf((*MockManagerClient)(nil).GetSeedPeer), varargs...)
}
// KeepAlive mocks base method.
func (m *MockManagerClient) KeepAlive(ctx context.Context, opts ...grpc.CallOption) (manager.Manager_KeepAliveClient, error) {
m.ctrl.T.Helper()
varargs := []any{ctx}
varargs := []interface{}{ctx}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -118,16 +232,16 @@ func (m *MockManagerClient) KeepAlive(ctx context.Context, opts ...grpc.CallOpti
}
// KeepAlive indicates an expected call of KeepAlive.
func (mr *MockManagerClientMockRecorder) KeepAlive(ctx any, opts ...any) *gomock.Call {
func (mr *MockManagerClientMockRecorder) KeepAlive(ctx interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx}, opts...)
varargs := append([]interface{}{ctx}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "KeepAlive", reflect.TypeOf((*MockManagerClient)(nil).KeepAlive), varargs...)
}
// ListApplications mocks base method.
func (m *MockManagerClient) ListApplications(ctx context.Context, in *manager.ListApplicationsRequest, opts ...grpc.CallOption) (*manager.ListApplicationsResponse, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -138,16 +252,16 @@ func (m *MockManagerClient) ListApplications(ctx context.Context, in *manager.Li
}
// ListApplications indicates an expected call of ListApplications.
func (mr *MockManagerClientMockRecorder) ListApplications(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockManagerClientMockRecorder) ListApplications(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListApplications", reflect.TypeOf((*MockManagerClient)(nil).ListApplications), varargs...)
}
// ListBuckets mocks base method.
func (m *MockManagerClient) ListBuckets(ctx context.Context, in *manager.ListBucketsRequest, opts ...grpc.CallOption) (*manager.ListBucketsResponse, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -158,16 +272,56 @@ func (m *MockManagerClient) ListBuckets(ctx context.Context, in *manager.ListBuc
}
// ListBuckets indicates an expected call of ListBuckets.
func (mr *MockManagerClientMockRecorder) ListBuckets(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockManagerClientMockRecorder) ListBuckets(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListBuckets", reflect.TypeOf((*MockManagerClient)(nil).ListBuckets), varargs...)
}
// ListModelVersions mocks base method.
func (m *MockManagerClient) ListModelVersions(ctx context.Context, in *manager.ListModelVersionsRequest, opts ...grpc.CallOption) (*manager.ListModelVersionsResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ListModelVersions", varargs...)
ret0, _ := ret[0].(*manager.ListModelVersionsResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListModelVersions indicates an expected call of ListModelVersions.
func (mr *MockManagerClientMockRecorder) ListModelVersions(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListModelVersions", reflect.TypeOf((*MockManagerClient)(nil).ListModelVersions), varargs...)
}
// ListModels mocks base method.
func (m *MockManagerClient) ListModels(ctx context.Context, in *manager.ListModelsRequest, opts ...grpc.CallOption) (*manager.ListModelsResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ListModels", varargs...)
ret0, _ := ret[0].(*manager.ListModelsResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListModels indicates an expected call of ListModels.
func (mr *MockManagerClientMockRecorder) ListModels(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListModels", reflect.TypeOf((*MockManagerClient)(nil).ListModels), varargs...)
}
// ListSchedulers mocks base method.
func (m *MockManagerClient) ListSchedulers(ctx context.Context, in *manager.ListSchedulersRequest, opts ...grpc.CallOption) (*manager.ListSchedulersResponse, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -178,36 +332,56 @@ func (m *MockManagerClient) ListSchedulers(ctx context.Context, in *manager.List
}
// ListSchedulers indicates an expected call of ListSchedulers.
func (mr *MockManagerClientMockRecorder) ListSchedulers(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockManagerClientMockRecorder) ListSchedulers(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListSchedulers", reflect.TypeOf((*MockManagerClient)(nil).ListSchedulers), varargs...)
}
// ListSeedPeers mocks base method.
func (m *MockManagerClient) ListSeedPeers(ctx context.Context, in *manager.ListSeedPeersRequest, opts ...grpc.CallOption) (*manager.ListSeedPeersResponse, error) {
// UpdateModel mocks base method.
func (m *MockManagerClient) UpdateModel(ctx context.Context, in *manager.UpdateModelRequest, opts ...grpc.CallOption) (*manager.Model, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ListSeedPeers", varargs...)
ret0, _ := ret[0].(*manager.ListSeedPeersResponse)
ret := m.ctrl.Call(m, "UpdateModel", varargs...)
ret0, _ := ret[0].(*manager.Model)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListSeedPeers indicates an expected call of ListSeedPeers.
func (mr *MockManagerClientMockRecorder) ListSeedPeers(ctx, in any, opts ...any) *gomock.Call {
// UpdateModel indicates an expected call of UpdateModel.
func (mr *MockManagerClientMockRecorder) UpdateModel(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListSeedPeers", reflect.TypeOf((*MockManagerClient)(nil).ListSeedPeers), varargs...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateModel", reflect.TypeOf((*MockManagerClient)(nil).UpdateModel), varargs...)
}
// UpdateModelVersion mocks base method.
func (m *MockManagerClient) UpdateModelVersion(ctx context.Context, in *manager.UpdateModelVersionRequest, opts ...grpc.CallOption) (*manager.ModelVersion, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "UpdateModelVersion", varargs...)
ret0, _ := ret[0].(*manager.ModelVersion)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// UpdateModelVersion indicates an expected call of UpdateModelVersion.
func (mr *MockManagerClientMockRecorder) UpdateModelVersion(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateModelVersion", reflect.TypeOf((*MockManagerClient)(nil).UpdateModelVersion), varargs...)
}
// UpdateScheduler mocks base method.
func (m *MockManagerClient) UpdateScheduler(ctx context.Context, in *manager.UpdateSchedulerRequest, opts ...grpc.CallOption) (*manager.Scheduler, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -218,16 +392,16 @@ func (m *MockManagerClient) UpdateScheduler(ctx context.Context, in *manager.Upd
}
// UpdateScheduler indicates an expected call of UpdateScheduler.
func (mr *MockManagerClientMockRecorder) UpdateScheduler(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockManagerClientMockRecorder) UpdateScheduler(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateScheduler", reflect.TypeOf((*MockManagerClient)(nil).UpdateScheduler), varargs...)
}
// UpdateSeedPeer mocks base method.
func (m *MockManagerClient) UpdateSeedPeer(ctx context.Context, in *manager.UpdateSeedPeerRequest, opts ...grpc.CallOption) (*manager.SeedPeer, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -238,9 +412,9 @@ func (m *MockManagerClient) UpdateSeedPeer(ctx context.Context, in *manager.Upda
}
// UpdateSeedPeer indicates an expected call of UpdateSeedPeer.
func (mr *MockManagerClientMockRecorder) UpdateSeedPeer(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockManagerClientMockRecorder) UpdateSeedPeer(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSeedPeer", reflect.TypeOf((*MockManagerClient)(nil).UpdateSeedPeer), varargs...)
}
@ -248,7 +422,6 @@ func (mr *MockManagerClientMockRecorder) UpdateSeedPeer(ctx, in any, opts ...any
type MockManager_KeepAliveClient struct {
ctrl *gomock.Controller
recorder *MockManager_KeepAliveClientMockRecorder
isgomock struct{}
}
// MockManager_KeepAliveClientMockRecorder is the mock recorder for MockManager_KeepAliveClient.
@ -327,7 +500,7 @@ func (mr *MockManager_KeepAliveClientMockRecorder) Header() *gomock.Call {
}
// RecvMsg mocks base method.
func (m_2 *MockManager_KeepAliveClient) RecvMsg(m any) error {
func (m_2 *MockManager_KeepAliveClient) RecvMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
@ -335,7 +508,7 @@ func (m_2 *MockManager_KeepAliveClient) RecvMsg(m any) error {
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockManager_KeepAliveClientMockRecorder) RecvMsg(m any) *gomock.Call {
func (mr *MockManager_KeepAliveClientMockRecorder) RecvMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockManager_KeepAliveClient)(nil).RecvMsg), m)
}
@ -349,13 +522,13 @@ func (m *MockManager_KeepAliveClient) Send(arg0 *manager.KeepAliveRequest) error
}
// Send indicates an expected call of Send.
func (mr *MockManager_KeepAliveClientMockRecorder) Send(arg0 any) *gomock.Call {
func (mr *MockManager_KeepAliveClientMockRecorder) Send(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockManager_KeepAliveClient)(nil).Send), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockManager_KeepAliveClient) SendMsg(m any) error {
func (m_2 *MockManager_KeepAliveClient) SendMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
@ -363,7 +536,7 @@ func (m_2 *MockManager_KeepAliveClient) SendMsg(m any) error {
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockManager_KeepAliveClientMockRecorder) SendMsg(m any) *gomock.Call {
func (mr *MockManager_KeepAliveClientMockRecorder) SendMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockManager_KeepAliveClient)(nil).SendMsg), m)
}
@ -386,7 +559,6 @@ func (mr *MockManager_KeepAliveClientMockRecorder) Trailer() *gomock.Call {
type MockManagerServer struct {
ctrl *gomock.Controller
recorder *MockManagerServerMockRecorder
isgomock struct{}
}
// MockManagerServerMockRecorder is the mock recorder for MockManagerServer.
@ -406,6 +578,96 @@ func (m *MockManagerServer) EXPECT() *MockManagerServerMockRecorder {
return m.recorder
}
// CreateModel mocks base method.
func (m *MockManagerServer) CreateModel(arg0 context.Context, arg1 *manager.CreateModelRequest) (*manager.Model, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CreateModel", arg0, arg1)
ret0, _ := ret[0].(*manager.Model)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CreateModel indicates an expected call of CreateModel.
func (mr *MockManagerServerMockRecorder) CreateModel(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateModel", reflect.TypeOf((*MockManagerServer)(nil).CreateModel), arg0, arg1)
}
// CreateModelVersion mocks base method.
func (m *MockManagerServer) CreateModelVersion(arg0 context.Context, arg1 *manager.CreateModelVersionRequest) (*manager.ModelVersion, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CreateModelVersion", arg0, arg1)
ret0, _ := ret[0].(*manager.ModelVersion)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CreateModelVersion indicates an expected call of CreateModelVersion.
func (mr *MockManagerServerMockRecorder) CreateModelVersion(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateModelVersion", reflect.TypeOf((*MockManagerServer)(nil).CreateModelVersion), arg0, arg1)
}
// DeleteModel mocks base method.
func (m *MockManagerServer) DeleteModel(arg0 context.Context, arg1 *manager.DeleteModelRequest) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DeleteModel", arg0, arg1)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// DeleteModel indicates an expected call of DeleteModel.
func (mr *MockManagerServerMockRecorder) DeleteModel(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteModel", reflect.TypeOf((*MockManagerServer)(nil).DeleteModel), arg0, arg1)
}
// DeleteModelVersion mocks base method.
func (m *MockManagerServer) DeleteModelVersion(arg0 context.Context, arg1 *manager.DeleteModelVersionRequest) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DeleteModelVersion", arg0, arg1)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// DeleteModelVersion indicates an expected call of DeleteModelVersion.
func (mr *MockManagerServerMockRecorder) DeleteModelVersion(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteModelVersion", reflect.TypeOf((*MockManagerServer)(nil).DeleteModelVersion), arg0, arg1)
}
// GetModel mocks base method.
func (m *MockManagerServer) GetModel(arg0 context.Context, arg1 *manager.GetModelRequest) (*manager.Model, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetModel", arg0, arg1)
ret0, _ := ret[0].(*manager.Model)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetModel indicates an expected call of GetModel.
func (mr *MockManagerServerMockRecorder) GetModel(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModel", reflect.TypeOf((*MockManagerServer)(nil).GetModel), arg0, arg1)
}
// GetModelVersion mocks base method.
func (m *MockManagerServer) GetModelVersion(arg0 context.Context, arg1 *manager.GetModelVersionRequest) (*manager.ModelVersion, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetModelVersion", arg0, arg1)
ret0, _ := ret[0].(*manager.ModelVersion)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetModelVersion indicates an expected call of GetModelVersion.
func (mr *MockManagerServerMockRecorder) GetModelVersion(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModelVersion", reflect.TypeOf((*MockManagerServer)(nil).GetModelVersion), arg0, arg1)
}
// GetObjectStorage mocks base method.
func (m *MockManagerServer) GetObjectStorage(arg0 context.Context, arg1 *manager.GetObjectStorageRequest) (*manager.ObjectStorage, error) {
m.ctrl.T.Helper()
@ -416,7 +678,7 @@ func (m *MockManagerServer) GetObjectStorage(arg0 context.Context, arg1 *manager
}
// GetObjectStorage indicates an expected call of GetObjectStorage.
func (mr *MockManagerServerMockRecorder) GetObjectStorage(arg0, arg1 any) *gomock.Call {
func (mr *MockManagerServerMockRecorder) GetObjectStorage(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetObjectStorage", reflect.TypeOf((*MockManagerServer)(nil).GetObjectStorage), arg0, arg1)
}
@ -431,7 +693,7 @@ func (m *MockManagerServer) GetScheduler(arg0 context.Context, arg1 *manager.Get
}
// GetScheduler indicates an expected call of GetScheduler.
func (mr *MockManagerServerMockRecorder) GetScheduler(arg0, arg1 any) *gomock.Call {
func (mr *MockManagerServerMockRecorder) GetScheduler(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetScheduler", reflect.TypeOf((*MockManagerServer)(nil).GetScheduler), arg0, arg1)
}
@ -446,7 +708,7 @@ func (m *MockManagerServer) GetSeedPeer(arg0 context.Context, arg1 *manager.GetS
}
// GetSeedPeer indicates an expected call of GetSeedPeer.
func (mr *MockManagerServerMockRecorder) GetSeedPeer(arg0, arg1 any) *gomock.Call {
func (mr *MockManagerServerMockRecorder) GetSeedPeer(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSeedPeer", reflect.TypeOf((*MockManagerServer)(nil).GetSeedPeer), arg0, arg1)
}
@ -460,7 +722,7 @@ func (m *MockManagerServer) KeepAlive(arg0 manager.Manager_KeepAliveServer) erro
}
// KeepAlive indicates an expected call of KeepAlive.
func (mr *MockManagerServerMockRecorder) KeepAlive(arg0 any) *gomock.Call {
func (mr *MockManagerServerMockRecorder) KeepAlive(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "KeepAlive", reflect.TypeOf((*MockManagerServer)(nil).KeepAlive), arg0)
}
@ -475,7 +737,7 @@ func (m *MockManagerServer) ListApplications(arg0 context.Context, arg1 *manager
}
// ListApplications indicates an expected call of ListApplications.
func (mr *MockManagerServerMockRecorder) ListApplications(arg0, arg1 any) *gomock.Call {
func (mr *MockManagerServerMockRecorder) ListApplications(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListApplications", reflect.TypeOf((*MockManagerServer)(nil).ListApplications), arg0, arg1)
}
@ -490,11 +752,41 @@ func (m *MockManagerServer) ListBuckets(arg0 context.Context, arg1 *manager.List
}
// ListBuckets indicates an expected call of ListBuckets.
func (mr *MockManagerServerMockRecorder) ListBuckets(arg0, arg1 any) *gomock.Call {
func (mr *MockManagerServerMockRecorder) ListBuckets(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListBuckets", reflect.TypeOf((*MockManagerServer)(nil).ListBuckets), arg0, arg1)
}
// ListModelVersions mocks base method.
func (m *MockManagerServer) ListModelVersions(arg0 context.Context, arg1 *manager.ListModelVersionsRequest) (*manager.ListModelVersionsResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListModelVersions", arg0, arg1)
ret0, _ := ret[0].(*manager.ListModelVersionsResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListModelVersions indicates an expected call of ListModelVersions.
func (mr *MockManagerServerMockRecorder) ListModelVersions(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListModelVersions", reflect.TypeOf((*MockManagerServer)(nil).ListModelVersions), arg0, arg1)
}
// ListModels mocks base method.
func (m *MockManagerServer) ListModels(arg0 context.Context, arg1 *manager.ListModelsRequest) (*manager.ListModelsResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListModels", arg0, arg1)
ret0, _ := ret[0].(*manager.ListModelsResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListModels indicates an expected call of ListModels.
func (mr *MockManagerServerMockRecorder) ListModels(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListModels", reflect.TypeOf((*MockManagerServer)(nil).ListModels), arg0, arg1)
}
// ListSchedulers mocks base method.
func (m *MockManagerServer) ListSchedulers(arg0 context.Context, arg1 *manager.ListSchedulersRequest) (*manager.ListSchedulersResponse, error) {
m.ctrl.T.Helper()
@ -505,24 +797,39 @@ func (m *MockManagerServer) ListSchedulers(arg0 context.Context, arg1 *manager.L
}
// ListSchedulers indicates an expected call of ListSchedulers.
func (mr *MockManagerServerMockRecorder) ListSchedulers(arg0, arg1 any) *gomock.Call {
func (mr *MockManagerServerMockRecorder) ListSchedulers(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListSchedulers", reflect.TypeOf((*MockManagerServer)(nil).ListSchedulers), arg0, arg1)
}
// ListSeedPeers mocks base method.
func (m *MockManagerServer) ListSeedPeers(arg0 context.Context, arg1 *manager.ListSeedPeersRequest) (*manager.ListSeedPeersResponse, error) {
// UpdateModel mocks base method.
func (m *MockManagerServer) UpdateModel(arg0 context.Context, arg1 *manager.UpdateModelRequest) (*manager.Model, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListSeedPeers", arg0, arg1)
ret0, _ := ret[0].(*manager.ListSeedPeersResponse)
ret := m.ctrl.Call(m, "UpdateModel", arg0, arg1)
ret0, _ := ret[0].(*manager.Model)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListSeedPeers indicates an expected call of ListSeedPeers.
func (mr *MockManagerServerMockRecorder) ListSeedPeers(arg0, arg1 any) *gomock.Call {
// UpdateModel indicates an expected call of UpdateModel.
func (mr *MockManagerServerMockRecorder) UpdateModel(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListSeedPeers", reflect.TypeOf((*MockManagerServer)(nil).ListSeedPeers), arg0, arg1)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateModel", reflect.TypeOf((*MockManagerServer)(nil).UpdateModel), arg0, arg1)
}
// UpdateModelVersion mocks base method.
func (m *MockManagerServer) UpdateModelVersion(arg0 context.Context, arg1 *manager.UpdateModelVersionRequest) (*manager.ModelVersion, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "UpdateModelVersion", arg0, arg1)
ret0, _ := ret[0].(*manager.ModelVersion)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// UpdateModelVersion indicates an expected call of UpdateModelVersion.
func (mr *MockManagerServerMockRecorder) UpdateModelVersion(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateModelVersion", reflect.TypeOf((*MockManagerServer)(nil).UpdateModelVersion), arg0, arg1)
}
// UpdateScheduler mocks base method.
@ -535,7 +842,7 @@ func (m *MockManagerServer) UpdateScheduler(arg0 context.Context, arg1 *manager.
}
// UpdateScheduler indicates an expected call of UpdateScheduler.
func (mr *MockManagerServerMockRecorder) UpdateScheduler(arg0, arg1 any) *gomock.Call {
func (mr *MockManagerServerMockRecorder) UpdateScheduler(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateScheduler", reflect.TypeOf((*MockManagerServer)(nil).UpdateScheduler), arg0, arg1)
}
@ -550,7 +857,7 @@ func (m *MockManagerServer) UpdateSeedPeer(arg0 context.Context, arg1 *manager.U
}
// UpdateSeedPeer indicates an expected call of UpdateSeedPeer.
func (mr *MockManagerServerMockRecorder) UpdateSeedPeer(arg0, arg1 any) *gomock.Call {
func (mr *MockManagerServerMockRecorder) UpdateSeedPeer(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSeedPeer", reflect.TypeOf((*MockManagerServer)(nil).UpdateSeedPeer), arg0, arg1)
}
@ -559,7 +866,6 @@ func (mr *MockManagerServerMockRecorder) UpdateSeedPeer(arg0, arg1 any) *gomock.
type MockUnsafeManagerServer struct {
ctrl *gomock.Controller
recorder *MockUnsafeManagerServerMockRecorder
isgomock struct{}
}
// MockUnsafeManagerServerMockRecorder is the mock recorder for MockUnsafeManagerServer.
@ -595,7 +901,6 @@ func (mr *MockUnsafeManagerServerMockRecorder) mustEmbedUnimplementedManagerServ
type MockManager_KeepAliveServer struct {
ctrl *gomock.Controller
recorder *MockManager_KeepAliveServerMockRecorder
isgomock struct{}
}
// MockManager_KeepAliveServerMockRecorder is the mock recorder for MockManager_KeepAliveServer.
@ -645,7 +950,7 @@ func (mr *MockManager_KeepAliveServerMockRecorder) Recv() *gomock.Call {
}
// RecvMsg mocks base method.
func (m_2 *MockManager_KeepAliveServer) RecvMsg(m any) error {
func (m_2 *MockManager_KeepAliveServer) RecvMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
@ -653,7 +958,7 @@ func (m_2 *MockManager_KeepAliveServer) RecvMsg(m any) error {
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockManager_KeepAliveServerMockRecorder) RecvMsg(m any) *gomock.Call {
func (mr *MockManager_KeepAliveServerMockRecorder) RecvMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockManager_KeepAliveServer)(nil).RecvMsg), m)
}
@ -667,7 +972,7 @@ func (m *MockManager_KeepAliveServer) SendAndClose(arg0 *emptypb.Empty) error {
}
// SendAndClose indicates an expected call of SendAndClose.
func (mr *MockManager_KeepAliveServerMockRecorder) SendAndClose(arg0 any) *gomock.Call {
func (mr *MockManager_KeepAliveServerMockRecorder) SendAndClose(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAndClose", reflect.TypeOf((*MockManager_KeepAliveServer)(nil).SendAndClose), arg0)
}
@ -681,13 +986,13 @@ func (m *MockManager_KeepAliveServer) SendHeader(arg0 metadata.MD) error {
}
// SendHeader indicates an expected call of SendHeader.
func (mr *MockManager_KeepAliveServerMockRecorder) SendHeader(arg0 any) *gomock.Call {
func (mr *MockManager_KeepAliveServerMockRecorder) SendHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockManager_KeepAliveServer)(nil).SendHeader), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockManager_KeepAliveServer) SendMsg(m any) error {
func (m_2 *MockManager_KeepAliveServer) SendMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
@ -695,7 +1000,7 @@ func (m_2 *MockManager_KeepAliveServer) SendMsg(m any) error {
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockManager_KeepAliveServerMockRecorder) SendMsg(m any) *gomock.Call {
func (mr *MockManager_KeepAliveServerMockRecorder) SendMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockManager_KeepAliveServer)(nil).SendMsg), m)
}
@ -709,7 +1014,7 @@ func (m *MockManager_KeepAliveServer) SetHeader(arg0 metadata.MD) error {
}
// SetHeader indicates an expected call of SetHeader.
func (mr *MockManager_KeepAliveServerMockRecorder) SetHeader(arg0 any) *gomock.Call {
func (mr *MockManager_KeepAliveServerMockRecorder) SetHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockManager_KeepAliveServer)(nil).SetHeader), arg0)
}
@ -721,7 +1026,7 @@ func (m *MockManager_KeepAliveServer) SetTrailer(arg0 metadata.MD) {
}
// SetTrailer indicates an expected call of SetTrailer.
func (mr *MockManager_KeepAliveServerMockRecorder) SetTrailer(arg0 any) *gomock.Call {
func (mr *MockManager_KeepAliveServerMockRecorder) SetTrailer(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockManager_KeepAliveServer)(nil).SetTrailer), arg0)
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -21,21 +21,34 @@ package manager.v2;
import "pkg/apis/common/v2/common.proto";
import "google/protobuf/empty.proto";
import "validate/validate.proto";
import "google/protobuf/timestamp.proto";
option go_package = "d7y.io/api/v2/pkg/apis/manager/v2;manager";
option go_package = "d7y.io/api/pkg/apis/manager/v2;manager";
// Request source type.
enum SourceType {
// Scheduler service.
SCHEDULER_SOURCE = 0;
// Peer service.
PEER_SOURCE = 1;
// SeedPeer service.
SEED_PEER_SOURCE = 2;
}
// SecurityGroup represents security group of cluster.
message SecurityGroup {
// Group id.
uint64 id = 1;
// Group name.
string name = 2;
// Group biography.
string bio = 3;
// Group domain.
string domain = 4;
// Group proxy domain.
string proxy_domain = 5;
}
// SeedPeerCluster represents cluster of seed peer.
message SeedPeerCluster {
// Cluster id.
@ -46,6 +59,10 @@ message SeedPeerCluster {
string bio = 3;
// Cluster configuration.
bytes config = 4;
// Cluster scopes.
bytes scopes = 5;
// Security group to which the seed peer cluster belongs.
SecurityGroup security_group = 6;
}
// SeedPeer represents seed peer for network.
@ -53,18 +70,18 @@ message SeedPeer {
// Seed peer id.
uint64 id = 1;
// Seed peer hostname.
string hostname = 2;
string host_name = 2;
// Seed peer type.
string type = 3;
// Seed peer idc.
optional string idc = 4;
string idc = 4;
// Seed peer location.
optional string location = 5;
string location = 5;
// Seed peer ip.
string ip = 6;
// Seed peer grpc port.
int32 port = 7;
// Seed peer download port.
// Seed peer download port.
int32 download_port = 8;
// Seed peer state.
string state = 9;
@ -74,6 +91,8 @@ message SeedPeer {
SeedPeerCluster seed_peer_cluster = 11;
// Schedulers included in seed peer.
repeated Scheduler schedulers = 12;
// Seed peer object storage port.
int32 object_storage_port = 13;
}
// GetSeedPeerRequest represents request of GetSeedPeer.
@ -81,45 +100,25 @@ message GetSeedPeerRequest {
// Request source type.
SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
// Seed peer hostname.
string hostname = 2 [(validate.rules).string.hostname = true];
string host_name = 2 [(validate.rules).string.hostname = true];
// ID of the cluster to which the seed peer belongs.
uint64 seed_peer_cluster_id = 3 [(validate.rules).uint64 = {gte: 1}];
// Seed peer ip.
string ip = 4 [(validate.rules).string = {ip: true, ignore_empty: true}];
}
// ListSeedPeersRequest represents request of ListSeedPeers.
message ListSeedPeersRequest {
// Request source type.
SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
// Source service hostname.
string hostname = 2 [(validate.rules).string.hostname = true];
// Source service ip.
string ip = 3 [(validate.rules).string.ip = true];
// Dfdaemon version.
string version = 4 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
// Dfdaemon commit.
string commit = 5 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
}
// ListSeedPeersResponse represents response of ListSeedPeers.
message ListSeedPeersResponse {
// Seed peers to which the source service belongs.
repeated SeedPeer seed_peers = 1;
}
// UpdateSeedPeerRequest represents request of UpdateSeedPeer.
message UpdateSeedPeerRequest {
// Request source type.
SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
// Seed peer hostname.
string hostname = 2 [(validate.rules).string.hostname = true];
string host_name = 2 [(validate.rules).string.hostname = true];
// Seed peer type.
string type = 3 [(validate.rules).string = {in: ["super", "strong", "weak"]}];
// Seed peer idc.
optional string idc = 4 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
string idc = 4 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
// Seed peer location.
optional string location = 5 [(validate.rules).string = {max_len: 1024, ignore_empty: true}];
string location = 5 [(validate.rules).string = {max_len: 1024, ignore_empty: true}];
// Seed peer ip.
string ip = 6 [(validate.rules).string = {ip: true}];
// Seed peer port.
@ -128,18 +127,8 @@ message UpdateSeedPeerRequest {
int32 download_port = 8 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
// ID of the cluster to which the seed peer belongs.
uint64 seed_peer_cluster_id = 9 [(validate.rules).uint64 = {gte: 1}];
}
// DeleteSeedPeerRequest represents request of DeleteSeedPeer.
message DeleteSeedPeerRequest {
// Request source type.
SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
// Seed peer hostname.
string hostname = 2 [(validate.rules).string.hostname = true];
// ID of the cluster to which the seed peer belongs.
uint64 seed_peer_cluster_id = 3 [(validate.rules).uint64 = {gte: 1}];
// Seed peer ip.
string ip = 4 [(validate.rules).string = {ip: true, ignore_empty: true}];
// Seed peer object storage port.
int32 object_storage_port = 10 [(validate.rules).int32 = {gte: 1024, lt: 65535, ignore_empty: true}];
}
// SeedPeerCluster represents cluster of scheduler.
@ -156,6 +145,8 @@ message SchedulerCluster {
bytes client_config = 5;
// Cluster scopes.
bytes scopes = 6;
// Security group to which the scheduler cluster belongs.
SecurityGroup security_group = 7;
}
// SeedPeerCluster represents scheduler for network.
@ -163,11 +154,11 @@ message Scheduler {
// Scheduler id.
uint64 id = 1;
// Scheduler hostname.
string hostname = 2;
string host_name = 2;
// Scheduler idc.
optional string idc = 3;
string idc = 3;
// Scheduler location.
optional string location = 4;
string location = 4;
// Scheduler ip.
string ip = 5;
// Scheduler grpc port.
@ -180,8 +171,6 @@ message Scheduler {
SchedulerCluster scheduler_cluster = 9;
// Seed peers to which the scheduler belongs.
repeated SeedPeer seed_peers = 10;
// Feature flags of scheduler.
bytes features = 11;
}
// GetSchedulerRequest represents request of GetScheduler.
@ -189,7 +178,7 @@ message GetSchedulerRequest {
// Request source type.
SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
// Scheduler hostname.
string hostname = 2 [(validate.rules).string.hostname = true];
string host_name = 2 [(validate.rules).string.hostname = true];
// ID of the cluster to which the scheduler belongs.
uint64 scheduler_cluster_id = 3 [(validate.rules).uint64 = {gte: 1}];
// Scheduler ip.
@ -201,21 +190,17 @@ message UpdateSchedulerRequest {
// Request source type.
SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
// Scheduler hostname.
string hostname = 2 [(validate.rules).string.hostname = true];
string host_name = 2 [(validate.rules).string.hostname = true];
// ID of the cluster to which the scheduler belongs.
uint64 scheduler_cluster_id = 3 [(validate.rules).uint64 = {gte: 1}];
// Scheduler idc.
optional string idc = 4 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
string idc = 4 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
// Scheduler location.
optional string location = 5 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
string location = 5 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
// Scheduler ip.
string ip = 6 [(validate.rules).string = {ip: true}];
// Scheduler port.
int32 port = 7 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
// Scheduler features.
repeated string features = 8;
// Scheduler configuration.
bytes config = 9;
}
// ListSchedulersRequest represents request of ListSchedulers.
@ -223,19 +208,15 @@ message ListSchedulersRequest {
// Request source type.
SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
// Source service hostname.
string hostname = 2 [(validate.rules).string.hostname = true];
string host_name = 2 [(validate.rules).string.hostname = true];
// Source service ip.
string ip = 3 [(validate.rules).string.ip = true];
// Source idc.
optional string idc = 4 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
// Source location.
optional string location = 5 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
// Source service host information.
map<string, string> host_info = 4 [(validate.rules).map.ignore_empty = true];
// Dfdaemon version.
string version = 6 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
string version = 5 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
// Dfdaemon commit.
string commit = 7 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
// ID of the cluster to which the scheduler belongs.
uint64 scheduler_cluster_id = 8;
string commit = 6 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
}
// ListSchedulersResponse represents response of ListSchedulers.
@ -244,6 +225,231 @@ message ListSchedulersResponse {
repeated Scheduler schedulers = 1;
}
// ObjectStorage represents config of object storage.
message ObjectStorage {
// name is object storage name of type, it can be s3, oss or obs.
string name = 1 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Region is storage region.
string region = 2 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
// Endpoint is datacenter endpoint.
string endpoint = 3 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
// AccessKey is access key ID.
string access_key = 4 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
// SecretKey is access key secret.
string secret_key = 5 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
// S3ForcePathStyle sets force path style for s3, true by default.
// Set this to `true` to force the request to use path-style addressing,
// i.e., `http://s3.amazonaws.com/BUCKET/KEY`. By default, the S3 client
// will use virtual hosted bucket addressing when possible
// (`http://BUCKET.s3.amazonaws.com/KEY`).
// Refer to https://github.com/aws/aws-sdk-go/blob/main/aws/config.go#L118.
bool s3_force_path_style = 6;
}
// GetObjectStorageRequest represents request of GetObjectStorage.
message GetObjectStorageRequest {
// Request source type.
SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
// Source service hostname.
string host_name = 2 [(validate.rules).string.hostname = true];
// Source service ip.
string ip = 3 [(validate.rules).string.ip = true];
}
// Bucket represents config of bucket.
message Bucket {
// Bucket name.
string name = 1 [(validate.rules).string = {min_len: 1, max_len: 1024}];
}
// ListSchedulersRequest represents request of ListBuckets.
message ListBucketsRequest {
// Request source type.
SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
// Source service hostname.
string host_name = 2 [(validate.rules).string.hostname = true];
// Source service ip.
string ip = 3 [(validate.rules).string.ip = true];
}
// ListBucketsResponse represents response of ListBuckets.
message ListBucketsResponse {
// Bucket configs.
repeated Bucket buckets = 1;
}
// Model represents information of model.
message Model {
// Model id.
string model_id = 1 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Model name.
string name = 2 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Model version id.
string version_id = 3 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Scheduler id.
uint64 scheduler_id = 4 [(validate.rules).uint64 = {gte: 1}];
// Scheduler hostname.
string host_name = 5 [(validate.rules).string.hostname = true];
// Scheduler ip.
string ip = 6 [(validate.rules).string.ip = true];
// Model create time.
google.protobuf.Timestamp created_at = 7 [(validate.rules).timestamp.required = true];
// Model update time.
google.protobuf.Timestamp updated_at = 8 [(validate.rules).timestamp.required = true];
}
// ListModelsRequest represents request of ListModels.
message ListModelsRequest {
// Scheduler id.
uint64 scheduler_id = 1 [(validate.rules).uint64 = {gte: 1}];
}
// ListModelsResponse represents response of ListModels.
message ListModelsResponse {
// Model informations.
repeated Model models = 1;
}
// GetModelRequest represents request of GetModel.
message GetModelRequest {
// Scheduler id.
uint64 scheduler_id = 1 [(validate.rules).uint64 = {gte: 1}];
// Model id.
string model_id = 2 [(validate.rules).string = {min_len: 1, max_len: 1024}];
}
// CreateModelRequest represents request of CreateModel.
message CreateModelRequest {
// Model id.
string model_id = 1 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Model name.
string name = 2 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Model version id.
string version_id = 3 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Scheduler id.
uint64 scheduler_id = 4 [(validate.rules).uint64 = {gte: 1}];
// Scheduler hostname.
string host_name = 5 [(validate.rules).string.hostname = true];
// Scheduler ip.
string ip = 6 [(validate.rules).string.ip = true];
}
// UpdateModelRequest represents request of UpdateModel.
message UpdateModelRequest {
// Model id.
string model_id = 1 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Model name.
string name = 2 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
// Model version id.
string version_id = 3 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
// Scheduler id.
uint64 scheduler_id = 4 [(validate.rules).uint64 = {gte: 1}];
// Scheduler hostname.
string host_name = 5 [(validate.rules).string = {hostname: true, ignore_empty: true}];
// Scheduler ip.
string ip = 6 [(validate.rules).string = {ip: true, ignore_empty: true}];
}
// DeleteModelRequest represents request of DeleteModel.
message DeleteModelRequest {
// Scheduler id.
uint64 scheduler_id = 1 [(validate.rules).uint64 = {gte: 1}];
// Model id.
string model_id = 2 [(validate.rules).string = {min_len: 1, max_len: 1024}];
}
// ModelVersion represents information of model version.
message ModelVersion {
// Model version id.
string version_id = 1 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Model version data.
bytes data = 2 [(validate.rules).bytes.min_len = 1];
// Model version mae.
double mae = 3 [(validate.rules).double.gte = 0];
// Model version mse.
double mse = 4 [(validate.rules).double.gte = 0];
// Model version rmse.
double rmse = 5 [(validate.rules).double.gte = 0];
// Model version r^2.
double r2 = 6;
// Model create time.
google.protobuf.Timestamp created_at = 7 [(validate.rules).timestamp.required = true];
// Model update time.
google.protobuf.Timestamp updated_at = 8 [(validate.rules).timestamp.required = true];
}
// ListModelVersionsRequest represents request of ListModelVersions.
message ListModelVersionsRequest {
// Scheduler id.
uint64 scheduler_id = 1 [(validate.rules).uint64 = {gte: 1}];
// Model id.
string model_id = 2 [(validate.rules).string = {min_len: 1, max_len: 1024}];
}
// ListModelVersionsResponse represents response of ListModelVersions.
message ListModelVersionsResponse {
// Model version informations.
repeated ModelVersion model_versions = 1;
}
// GetModelVersionRequest represents request of GetModelVersion.
message GetModelVersionRequest {
// Scheduler id.
uint64 scheduler_id = 1 [(validate.rules).uint64 = {gte: 1}];
// Model id.
string model_id = 2 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Model version id.
string version_id = 3 [(validate.rules).string = {min_len: 1, max_len: 1024}];
}
// CreateModelVersionRequest represents request of CreateModelVersion.
message CreateModelVersionRequest {
// Scheduler id.
uint64 scheduler_id = 1 [(validate.rules).uint64 = {gte: 1}];
// Model id.
string model_id = 2 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Model version data.
bytes data = 3 [(validate.rules).bytes.min_len = 1];
// Model version mae.
double mae = 4 [(validate.rules).double.gte = 0];
// Model version mse.
double mse = 5 [(validate.rules).double.gte = 0];
// Model version rmse.
double rmse = 6 [(validate.rules).double.gte = 0];
// Model version r^2.
double r2 = 7;
}
// UpdateModelVersionRequest represents request of UpdateModelVersion.
message UpdateModelVersionRequest {
// Model version id.
string version_id = 1 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Scheduler id.
uint64 scheduler_id = 2 [(validate.rules).uint64 = {gte: 1}];
// Model id.
string model_id = 3 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Model version data.
bytes data = 4 [(validate.rules).bytes = {min_len: 1, ignore_empty: true}];
// Model version mae.
double mae = 5 [(validate.rules).double = {gte: 0, ignore_empty: true}];
// Model version mse.
double mse = 6 [(validate.rules).double = {gte: 0, ignore_empty: true}];
// Model version rmse.
double rmse = 7 [(validate.rules).double = {gte: 0, ignore_empty: true}];
// Model version r^2.
double r2 = 8 [(validate.rules).double = {ignore_empty: true}];
}
// DeleteModelVersionRequest represents request of DeleteModelVersion.
message DeleteModelVersionRequest {
// Scheduler id.
uint64 scheduler_id = 1 [(validate.rules).uint64 = {gte: 1}];
// Model id.
string model_id = 2 [(validate.rules).string = {min_len: 1, max_len: 1024}];
// Model version id.
string version_id = 3 [(validate.rules).string = {min_len: 1, max_len: 1024}];
}
// URLPriority represents config of url priority.
message URLPriority {
// URL regex.
@ -279,7 +485,7 @@ message ListApplicationsRequest {
// Request source type.
SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
// Source service hostname.
string hostname = 2 [(validate.rules).string.hostname = true];
string host_name = 2 [(validate.rules).string.hostname = true];
// Source service ip.
string ip = 3 [(validate.rules).string.ip = true];
}
@ -295,7 +501,7 @@ message KeepAliveRequest {
// Request source type.
SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
// Source service hostname.
string hostname = 2 [(validate.rules).string.hostname = true];
string host_name = 2 [(validate.rules).string.hostname = true];
// ID of the cluster to which the source service belongs.
uint64 cluster_id = 3 [(validate.rules).uint64 = {gte: 1}];
// Source service ip.
@ -307,15 +513,9 @@ service Manager {
// Get SeedPeer and SeedPeer cluster configuration.
rpc GetSeedPeer(GetSeedPeerRequest) returns(SeedPeer);
// List acitve schedulers configuration.
rpc ListSeedPeers(ListSeedPeersRequest)returns(ListSeedPeersResponse);
// Update SeedPeer configuration.
rpc UpdateSeedPeer(UpdateSeedPeerRequest) returns(SeedPeer);
// Delete SeedPeer configuration.
rpc DeleteSeedPeer(DeleteSeedPeerRequest) returns(google.protobuf.Empty);
// Get Scheduler and Scheduler cluster configuration.
rpc GetScheduler(GetSchedulerRequest)returns(Scheduler);
@ -325,6 +525,42 @@ service Manager {
// List acitve schedulers configuration.
rpc ListSchedulers(ListSchedulersRequest)returns(ListSchedulersResponse);
// Get ObjectStorage configuration.
rpc GetObjectStorage(GetObjectStorageRequest) returns(ObjectStorage);
// List buckets configuration.
rpc ListBuckets(ListBucketsRequest)returns(ListBucketsResponse);
// List models information.
rpc ListModels(ListModelsRequest)returns(ListModelsResponse);
// Get model information.
rpc GetModel(GetModelRequest)returns(Model);
// Create model information.
rpc CreateModel(CreateModelRequest)returns(Model);
// Update model information.
rpc UpdateModel(UpdateModelRequest)returns(Model);
// Delete model information.
rpc DeleteModel(DeleteModelRequest)returns(google.protobuf.Empty);
// List model versions information.
rpc ListModelVersions(ListModelVersionsRequest)returns(ListModelVersionsResponse);
// Get model version information.
rpc GetModelVersion(GetModelVersionRequest)returns(ModelVersion);
// Create model version information.
rpc CreateModelVersion(CreateModelVersionRequest)returns(ModelVersion);
// Update model version information.
rpc UpdateModelVersion(UpdateModelVersionRequest)returns(ModelVersion);
// Delete model version information.
rpc DeleteModelVersion(DeleteModelVersionRequest)returns(google.protobuf.Empty);
// List applications configuration.
rpc ListApplications(ListApplicationsRequest)returns(ListApplicationsResponse);

View File

@ -25,18 +25,38 @@ const _ = grpc.SupportPackageIsVersion7
type ManagerClient interface {
// Get SeedPeer and SeedPeer cluster configuration.
GetSeedPeer(ctx context.Context, in *GetSeedPeerRequest, opts ...grpc.CallOption) (*SeedPeer, error)
// List acitve schedulers configuration.
ListSeedPeers(ctx context.Context, in *ListSeedPeersRequest, opts ...grpc.CallOption) (*ListSeedPeersResponse, error)
// Update SeedPeer configuration.
UpdateSeedPeer(ctx context.Context, in *UpdateSeedPeerRequest, opts ...grpc.CallOption) (*SeedPeer, error)
// Delete SeedPeer configuration.
DeleteSeedPeer(ctx context.Context, in *DeleteSeedPeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// Get Scheduler and Scheduler cluster configuration.
GetScheduler(ctx context.Context, in *GetSchedulerRequest, opts ...grpc.CallOption) (*Scheduler, error)
// Update scheduler configuration.
UpdateScheduler(ctx context.Context, in *UpdateSchedulerRequest, opts ...grpc.CallOption) (*Scheduler, error)
// List acitve schedulers configuration.
ListSchedulers(ctx context.Context, in *ListSchedulersRequest, opts ...grpc.CallOption) (*ListSchedulersResponse, error)
// Get ObjectStorage configuration.
GetObjectStorage(ctx context.Context, in *GetObjectStorageRequest, opts ...grpc.CallOption) (*ObjectStorage, error)
// List buckets configuration.
ListBuckets(ctx context.Context, in *ListBucketsRequest, opts ...grpc.CallOption) (*ListBucketsResponse, error)
// List models information.
ListModels(ctx context.Context, in *ListModelsRequest, opts ...grpc.CallOption) (*ListModelsResponse, error)
// Get model information.
GetModel(ctx context.Context, in *GetModelRequest, opts ...grpc.CallOption) (*Model, error)
// Create model information.
CreateModel(ctx context.Context, in *CreateModelRequest, opts ...grpc.CallOption) (*Model, error)
// Update model information.
UpdateModel(ctx context.Context, in *UpdateModelRequest, opts ...grpc.CallOption) (*Model, error)
// Delete model information.
DeleteModel(ctx context.Context, in *DeleteModelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// List model versions information.
ListModelVersions(ctx context.Context, in *ListModelVersionsRequest, opts ...grpc.CallOption) (*ListModelVersionsResponse, error)
// Get model version information.
GetModelVersion(ctx context.Context, in *GetModelVersionRequest, opts ...grpc.CallOption) (*ModelVersion, error)
// Create model version information.
CreateModelVersion(ctx context.Context, in *CreateModelVersionRequest, opts ...grpc.CallOption) (*ModelVersion, error)
// Update model version information.
UpdateModelVersion(ctx context.Context, in *UpdateModelVersionRequest, opts ...grpc.CallOption) (*ModelVersion, error)
// Delete model version information.
DeleteModelVersion(ctx context.Context, in *DeleteModelVersionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// List applications configuration.
ListApplications(ctx context.Context, in *ListApplicationsRequest, opts ...grpc.CallOption) (*ListApplicationsResponse, error)
// KeepAlive with manager.
@ -60,15 +80,6 @@ func (c *managerClient) GetSeedPeer(ctx context.Context, in *GetSeedPeerRequest,
return out, nil
}
func (c *managerClient) ListSeedPeers(ctx context.Context, in *ListSeedPeersRequest, opts ...grpc.CallOption) (*ListSeedPeersResponse, error) {
out := new(ListSeedPeersResponse)
err := c.cc.Invoke(ctx, "/manager.v2.Manager/ListSeedPeers", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) UpdateSeedPeer(ctx context.Context, in *UpdateSeedPeerRequest, opts ...grpc.CallOption) (*SeedPeer, error) {
out := new(SeedPeer)
err := c.cc.Invoke(ctx, "/manager.v2.Manager/UpdateSeedPeer", in, out, opts...)
@ -78,15 +89,6 @@ func (c *managerClient) UpdateSeedPeer(ctx context.Context, in *UpdateSeedPeerRe
return out, nil
}
func (c *managerClient) DeleteSeedPeer(ctx context.Context, in *DeleteSeedPeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/manager.v2.Manager/DeleteSeedPeer", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) GetScheduler(ctx context.Context, in *GetSchedulerRequest, opts ...grpc.CallOption) (*Scheduler, error) {
out := new(Scheduler)
err := c.cc.Invoke(ctx, "/manager.v2.Manager/GetScheduler", in, out, opts...)
@ -114,6 +116,114 @@ func (c *managerClient) ListSchedulers(ctx context.Context, in *ListSchedulersRe
return out, nil
}
func (c *managerClient) GetObjectStorage(ctx context.Context, in *GetObjectStorageRequest, opts ...grpc.CallOption) (*ObjectStorage, error) {
out := new(ObjectStorage)
err := c.cc.Invoke(ctx, "/manager.v2.Manager/GetObjectStorage", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) ListBuckets(ctx context.Context, in *ListBucketsRequest, opts ...grpc.CallOption) (*ListBucketsResponse, error) {
out := new(ListBucketsResponse)
err := c.cc.Invoke(ctx, "/manager.v2.Manager/ListBuckets", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) ListModels(ctx context.Context, in *ListModelsRequest, opts ...grpc.CallOption) (*ListModelsResponse, error) {
out := new(ListModelsResponse)
err := c.cc.Invoke(ctx, "/manager.v2.Manager/ListModels", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) GetModel(ctx context.Context, in *GetModelRequest, opts ...grpc.CallOption) (*Model, error) {
out := new(Model)
err := c.cc.Invoke(ctx, "/manager.v2.Manager/GetModel", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) CreateModel(ctx context.Context, in *CreateModelRequest, opts ...grpc.CallOption) (*Model, error) {
out := new(Model)
err := c.cc.Invoke(ctx, "/manager.v2.Manager/CreateModel", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) UpdateModel(ctx context.Context, in *UpdateModelRequest, opts ...grpc.CallOption) (*Model, error) {
out := new(Model)
err := c.cc.Invoke(ctx, "/manager.v2.Manager/UpdateModel", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) DeleteModel(ctx context.Context, in *DeleteModelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/manager.v2.Manager/DeleteModel", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) ListModelVersions(ctx context.Context, in *ListModelVersionsRequest, opts ...grpc.CallOption) (*ListModelVersionsResponse, error) {
out := new(ListModelVersionsResponse)
err := c.cc.Invoke(ctx, "/manager.v2.Manager/ListModelVersions", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) GetModelVersion(ctx context.Context, in *GetModelVersionRequest, opts ...grpc.CallOption) (*ModelVersion, error) {
out := new(ModelVersion)
err := c.cc.Invoke(ctx, "/manager.v2.Manager/GetModelVersion", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) CreateModelVersion(ctx context.Context, in *CreateModelVersionRequest, opts ...grpc.CallOption) (*ModelVersion, error) {
out := new(ModelVersion)
err := c.cc.Invoke(ctx, "/manager.v2.Manager/CreateModelVersion", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) UpdateModelVersion(ctx context.Context, in *UpdateModelVersionRequest, opts ...grpc.CallOption) (*ModelVersion, error) {
out := new(ModelVersion)
err := c.cc.Invoke(ctx, "/manager.v2.Manager/UpdateModelVersion", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) DeleteModelVersion(ctx context.Context, in *DeleteModelVersionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/manager.v2.Manager/DeleteModelVersion", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) ListApplications(ctx context.Context, in *ListApplicationsRequest, opts ...grpc.CallOption) (*ListApplicationsResponse, error) {
out := new(ListApplicationsResponse)
err := c.cc.Invoke(ctx, "/manager.v2.Manager/ListApplications", in, out, opts...)
@ -163,18 +273,38 @@ func (x *managerKeepAliveClient) CloseAndRecv() (*emptypb.Empty, error) {
type ManagerServer interface {
// Get SeedPeer and SeedPeer cluster configuration.
GetSeedPeer(context.Context, *GetSeedPeerRequest) (*SeedPeer, error)
// List acitve schedulers configuration.
ListSeedPeers(context.Context, *ListSeedPeersRequest) (*ListSeedPeersResponse, error)
// Update SeedPeer configuration.
UpdateSeedPeer(context.Context, *UpdateSeedPeerRequest) (*SeedPeer, error)
// Delete SeedPeer configuration.
DeleteSeedPeer(context.Context, *DeleteSeedPeerRequest) (*emptypb.Empty, error)
// Get Scheduler and Scheduler cluster configuration.
GetScheduler(context.Context, *GetSchedulerRequest) (*Scheduler, error)
// Update scheduler configuration.
UpdateScheduler(context.Context, *UpdateSchedulerRequest) (*Scheduler, error)
// List acitve schedulers configuration.
ListSchedulers(context.Context, *ListSchedulersRequest) (*ListSchedulersResponse, error)
// Get ObjectStorage configuration.
GetObjectStorage(context.Context, *GetObjectStorageRequest) (*ObjectStorage, error)
// List buckets configuration.
ListBuckets(context.Context, *ListBucketsRequest) (*ListBucketsResponse, error)
// List models information.
ListModels(context.Context, *ListModelsRequest) (*ListModelsResponse, error)
// Get model information.
GetModel(context.Context, *GetModelRequest) (*Model, error)
// Create model information.
CreateModel(context.Context, *CreateModelRequest) (*Model, error)
// Update model information.
UpdateModel(context.Context, *UpdateModelRequest) (*Model, error)
// Delete model information.
DeleteModel(context.Context, *DeleteModelRequest) (*emptypb.Empty, error)
// List model versions information.
ListModelVersions(context.Context, *ListModelVersionsRequest) (*ListModelVersionsResponse, error)
// Get model version information.
GetModelVersion(context.Context, *GetModelVersionRequest) (*ModelVersion, error)
// Create model version information.
CreateModelVersion(context.Context, *CreateModelVersionRequest) (*ModelVersion, error)
// Update model version information.
UpdateModelVersion(context.Context, *UpdateModelVersionRequest) (*ModelVersion, error)
// Delete model version information.
DeleteModelVersion(context.Context, *DeleteModelVersionRequest) (*emptypb.Empty, error)
// List applications configuration.
ListApplications(context.Context, *ListApplicationsRequest) (*ListApplicationsResponse, error)
// KeepAlive with manager.
@ -188,15 +318,9 @@ type UnimplementedManagerServer struct {
func (UnimplementedManagerServer) GetSeedPeer(context.Context, *GetSeedPeerRequest) (*SeedPeer, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetSeedPeer not implemented")
}
func (UnimplementedManagerServer) ListSeedPeers(context.Context, *ListSeedPeersRequest) (*ListSeedPeersResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListSeedPeers not implemented")
}
func (UnimplementedManagerServer) UpdateSeedPeer(context.Context, *UpdateSeedPeerRequest) (*SeedPeer, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateSeedPeer not implemented")
}
func (UnimplementedManagerServer) DeleteSeedPeer(context.Context, *DeleteSeedPeerRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteSeedPeer not implemented")
}
func (UnimplementedManagerServer) GetScheduler(context.Context, *GetSchedulerRequest) (*Scheduler, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetScheduler not implemented")
}
@ -206,6 +330,42 @@ func (UnimplementedManagerServer) UpdateScheduler(context.Context, *UpdateSchedu
func (UnimplementedManagerServer) ListSchedulers(context.Context, *ListSchedulersRequest) (*ListSchedulersResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListSchedulers not implemented")
}
func (UnimplementedManagerServer) GetObjectStorage(context.Context, *GetObjectStorageRequest) (*ObjectStorage, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetObjectStorage not implemented")
}
func (UnimplementedManagerServer) ListBuckets(context.Context, *ListBucketsRequest) (*ListBucketsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListBuckets not implemented")
}
func (UnimplementedManagerServer) ListModels(context.Context, *ListModelsRequest) (*ListModelsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListModels not implemented")
}
func (UnimplementedManagerServer) GetModel(context.Context, *GetModelRequest) (*Model, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetModel not implemented")
}
func (UnimplementedManagerServer) CreateModel(context.Context, *CreateModelRequest) (*Model, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateModel not implemented")
}
func (UnimplementedManagerServer) UpdateModel(context.Context, *UpdateModelRequest) (*Model, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateModel not implemented")
}
func (UnimplementedManagerServer) DeleteModel(context.Context, *DeleteModelRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteModel not implemented")
}
func (UnimplementedManagerServer) ListModelVersions(context.Context, *ListModelVersionsRequest) (*ListModelVersionsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListModelVersions not implemented")
}
func (UnimplementedManagerServer) GetModelVersion(context.Context, *GetModelVersionRequest) (*ModelVersion, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetModelVersion not implemented")
}
func (UnimplementedManagerServer) CreateModelVersion(context.Context, *CreateModelVersionRequest) (*ModelVersion, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateModelVersion not implemented")
}
func (UnimplementedManagerServer) UpdateModelVersion(context.Context, *UpdateModelVersionRequest) (*ModelVersion, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateModelVersion not implemented")
}
func (UnimplementedManagerServer) DeleteModelVersion(context.Context, *DeleteModelVersionRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteModelVersion not implemented")
}
func (UnimplementedManagerServer) ListApplications(context.Context, *ListApplicationsRequest) (*ListApplicationsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListApplications not implemented")
}
@ -242,24 +402,6 @@ func _Manager_GetSeedPeer_Handler(srv interface{}, ctx context.Context, dec func
return interceptor(ctx, in, info, handler)
}
func _Manager_ListSeedPeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListSeedPeersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).ListSeedPeers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.v2.Manager/ListSeedPeers",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).ListSeedPeers(ctx, req.(*ListSeedPeersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_UpdateSeedPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateSeedPeerRequest)
if err := dec(in); err != nil {
@ -278,24 +420,6 @@ func _Manager_UpdateSeedPeer_Handler(srv interface{}, ctx context.Context, dec f
return interceptor(ctx, in, info, handler)
}
func _Manager_DeleteSeedPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteSeedPeerRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).DeleteSeedPeer(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.v2.Manager/DeleteSeedPeer",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).DeleteSeedPeer(ctx, req.(*DeleteSeedPeerRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_GetScheduler_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetSchedulerRequest)
if err := dec(in); err != nil {
@ -350,6 +474,222 @@ func _Manager_ListSchedulers_Handler(srv interface{}, ctx context.Context, dec f
return interceptor(ctx, in, info, handler)
}
func _Manager_GetObjectStorage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetObjectStorageRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).GetObjectStorage(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.v2.Manager/GetObjectStorage",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).GetObjectStorage(ctx, req.(*GetObjectStorageRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_ListBuckets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListBucketsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).ListBuckets(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.v2.Manager/ListBuckets",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).ListBuckets(ctx, req.(*ListBucketsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_ListModels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListModelsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).ListModels(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.v2.Manager/ListModels",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).ListModels(ctx, req.(*ListModelsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_GetModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetModelRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).GetModel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.v2.Manager/GetModel",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).GetModel(ctx, req.(*GetModelRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_CreateModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateModelRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).CreateModel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.v2.Manager/CreateModel",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).CreateModel(ctx, req.(*CreateModelRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_UpdateModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateModelRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).UpdateModel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.v2.Manager/UpdateModel",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).UpdateModel(ctx, req.(*UpdateModelRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_DeleteModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteModelRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).DeleteModel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.v2.Manager/DeleteModel",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).DeleteModel(ctx, req.(*DeleteModelRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_ListModelVersions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListModelVersionsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).ListModelVersions(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.v2.Manager/ListModelVersions",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).ListModelVersions(ctx, req.(*ListModelVersionsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_GetModelVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetModelVersionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).GetModelVersion(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.v2.Manager/GetModelVersion",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).GetModelVersion(ctx, req.(*GetModelVersionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_CreateModelVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateModelVersionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).CreateModelVersion(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.v2.Manager/CreateModelVersion",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).CreateModelVersion(ctx, req.(*CreateModelVersionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_UpdateModelVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateModelVersionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).UpdateModelVersion(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.v2.Manager/UpdateModelVersion",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).UpdateModelVersion(ctx, req.(*UpdateModelVersionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_DeleteModelVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteModelVersionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).DeleteModelVersion(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.v2.Manager/DeleteModelVersion",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).DeleteModelVersion(ctx, req.(*DeleteModelVersionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_ListApplications_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListApplicationsRequest)
if err := dec(in); err != nil {
@ -405,18 +745,10 @@ var Manager_ServiceDesc = grpc.ServiceDesc{
MethodName: "GetSeedPeer",
Handler: _Manager_GetSeedPeer_Handler,
},
{
MethodName: "ListSeedPeers",
Handler: _Manager_ListSeedPeers_Handler,
},
{
MethodName: "UpdateSeedPeer",
Handler: _Manager_UpdateSeedPeer_Handler,
},
{
MethodName: "DeleteSeedPeer",
Handler: _Manager_DeleteSeedPeer_Handler,
},
{
MethodName: "GetScheduler",
Handler: _Manager_GetScheduler_Handler,
@ -429,6 +761,54 @@ var Manager_ServiceDesc = grpc.ServiceDesc{
MethodName: "ListSchedulers",
Handler: _Manager_ListSchedulers_Handler,
},
{
MethodName: "GetObjectStorage",
Handler: _Manager_GetObjectStorage_Handler,
},
{
MethodName: "ListBuckets",
Handler: _Manager_ListBuckets_Handler,
},
{
MethodName: "ListModels",
Handler: _Manager_ListModels_Handler,
},
{
MethodName: "GetModel",
Handler: _Manager_GetModel_Handler,
},
{
MethodName: "CreateModel",
Handler: _Manager_CreateModel_Handler,
},
{
MethodName: "UpdateModel",
Handler: _Manager_UpdateModel_Handler,
},
{
MethodName: "DeleteModel",
Handler: _Manager_DeleteModel_Handler,
},
{
MethodName: "ListModelVersions",
Handler: _Manager_ListModelVersions_Handler,
},
{
MethodName: "GetModelVersion",
Handler: _Manager_GetModelVersion_Handler,
},
{
MethodName: "CreateModelVersion",
Handler: _Manager_CreateModelVersion_Handler,
},
{
MethodName: "UpdateModelVersion",
Handler: _Manager_UpdateModelVersion_Handler,
},
{
MethodName: "DeleteModelVersion",
Handler: _Manager_DeleteModelVersion_Handler,
},
{
MethodName: "ListApplications",
Handler: _Manager_ListApplications_Handler,

View File

@ -1,10 +1,5 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: ../manager_grpc.pb.go
//
// Generated by this command:
//
// mockgen -destination manager_mock.go -source ../manager_grpc.pb.go -package mocks
//
// Package mocks is a generated GoMock package.
package mocks
@ -13,8 +8,8 @@ import (
context "context"
reflect "reflect"
manager "d7y.io/api/v2/pkg/apis/manager/v2"
gomock "go.uber.org/mock/gomock"
manager "d7y.io/api/pkg/apis/manager/v2"
gomock "github.com/golang/mock/gomock"
grpc "google.golang.org/grpc"
metadata "google.golang.org/grpc/metadata"
emptypb "google.golang.org/protobuf/types/known/emptypb"
@ -24,7 +19,6 @@ import (
type MockManagerClient struct {
ctrl *gomock.Controller
recorder *MockManagerClientMockRecorder
isgomock struct{}
}
// MockManagerClientMockRecorder is the mock recorder for MockManagerClient.
@ -44,30 +38,150 @@ func (m *MockManagerClient) EXPECT() *MockManagerClientMockRecorder {
return m.recorder
}
// DeleteSeedPeer mocks base method.
func (m *MockManagerClient) DeleteSeedPeer(ctx context.Context, in *manager.DeleteSeedPeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
// CreateModel mocks base method.
func (m *MockManagerClient) CreateModel(ctx context.Context, in *manager.CreateModelRequest, opts ...grpc.CallOption) (*manager.Model, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "DeleteSeedPeer", varargs...)
ret := m.ctrl.Call(m, "CreateModel", varargs...)
ret0, _ := ret[0].(*manager.Model)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CreateModel indicates an expected call of CreateModel.
func (mr *MockManagerClientMockRecorder) CreateModel(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateModel", reflect.TypeOf((*MockManagerClient)(nil).CreateModel), varargs...)
}
// CreateModelVersion mocks base method.
func (m *MockManagerClient) CreateModelVersion(ctx context.Context, in *manager.CreateModelVersionRequest, opts ...grpc.CallOption) (*manager.ModelVersion, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "CreateModelVersion", varargs...)
ret0, _ := ret[0].(*manager.ModelVersion)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CreateModelVersion indicates an expected call of CreateModelVersion.
func (mr *MockManagerClientMockRecorder) CreateModelVersion(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateModelVersion", reflect.TypeOf((*MockManagerClient)(nil).CreateModelVersion), varargs...)
}
// DeleteModel mocks base method.
func (m *MockManagerClient) DeleteModel(ctx context.Context, in *manager.DeleteModelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "DeleteModel", varargs...)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// DeleteSeedPeer indicates an expected call of DeleteSeedPeer.
func (mr *MockManagerClientMockRecorder) DeleteSeedPeer(ctx, in any, opts ...any) *gomock.Call {
// DeleteModel indicates an expected call of DeleteModel.
func (mr *MockManagerClientMockRecorder) DeleteModel(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteSeedPeer", reflect.TypeOf((*MockManagerClient)(nil).DeleteSeedPeer), varargs...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteModel", reflect.TypeOf((*MockManagerClient)(nil).DeleteModel), varargs...)
}
// DeleteModelVersion mocks base method.
func (m *MockManagerClient) DeleteModelVersion(ctx context.Context, in *manager.DeleteModelVersionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "DeleteModelVersion", varargs...)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// DeleteModelVersion indicates an expected call of DeleteModelVersion.
func (mr *MockManagerClientMockRecorder) DeleteModelVersion(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteModelVersion", reflect.TypeOf((*MockManagerClient)(nil).DeleteModelVersion), varargs...)
}
// GetModel mocks base method.
func (m *MockManagerClient) GetModel(ctx context.Context, in *manager.GetModelRequest, opts ...grpc.CallOption) (*manager.Model, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetModel", varargs...)
ret0, _ := ret[0].(*manager.Model)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetModel indicates an expected call of GetModel.
func (mr *MockManagerClientMockRecorder) GetModel(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModel", reflect.TypeOf((*MockManagerClient)(nil).GetModel), varargs...)
}
// GetModelVersion mocks base method.
func (m *MockManagerClient) GetModelVersion(ctx context.Context, in *manager.GetModelVersionRequest, opts ...grpc.CallOption) (*manager.ModelVersion, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetModelVersion", varargs...)
ret0, _ := ret[0].(*manager.ModelVersion)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetModelVersion indicates an expected call of GetModelVersion.
func (mr *MockManagerClientMockRecorder) GetModelVersion(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModelVersion", reflect.TypeOf((*MockManagerClient)(nil).GetModelVersion), varargs...)
}
// GetObjectStorage mocks base method.
func (m *MockManagerClient) GetObjectStorage(ctx context.Context, in *manager.GetObjectStorageRequest, opts ...grpc.CallOption) (*manager.ObjectStorage, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetObjectStorage", varargs...)
ret0, _ := ret[0].(*manager.ObjectStorage)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetObjectStorage indicates an expected call of GetObjectStorage.
func (mr *MockManagerClientMockRecorder) GetObjectStorage(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetObjectStorage", reflect.TypeOf((*MockManagerClient)(nil).GetObjectStorage), varargs...)
}
// GetScheduler mocks base method.
func (m *MockManagerClient) GetScheduler(ctx context.Context, in *manager.GetSchedulerRequest, opts ...grpc.CallOption) (*manager.Scheduler, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -78,16 +192,16 @@ func (m *MockManagerClient) GetScheduler(ctx context.Context, in *manager.GetSch
}
// GetScheduler indicates an expected call of GetScheduler.
func (mr *MockManagerClientMockRecorder) GetScheduler(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockManagerClientMockRecorder) GetScheduler(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetScheduler", reflect.TypeOf((*MockManagerClient)(nil).GetScheduler), varargs...)
}
// GetSeedPeer mocks base method.
func (m *MockManagerClient) GetSeedPeer(ctx context.Context, in *manager.GetSeedPeerRequest, opts ...grpc.CallOption) (*manager.SeedPeer, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -98,16 +212,16 @@ func (m *MockManagerClient) GetSeedPeer(ctx context.Context, in *manager.GetSeed
}
// GetSeedPeer indicates an expected call of GetSeedPeer.
func (mr *MockManagerClientMockRecorder) GetSeedPeer(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockManagerClientMockRecorder) GetSeedPeer(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSeedPeer", reflect.TypeOf((*MockManagerClient)(nil).GetSeedPeer), varargs...)
}
// KeepAlive mocks base method.
func (m *MockManagerClient) KeepAlive(ctx context.Context, opts ...grpc.CallOption) (manager.Manager_KeepAliveClient, error) {
m.ctrl.T.Helper()
varargs := []any{ctx}
varargs := []interface{}{ctx}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -118,16 +232,16 @@ func (m *MockManagerClient) KeepAlive(ctx context.Context, opts ...grpc.CallOpti
}
// KeepAlive indicates an expected call of KeepAlive.
func (mr *MockManagerClientMockRecorder) KeepAlive(ctx any, opts ...any) *gomock.Call {
func (mr *MockManagerClientMockRecorder) KeepAlive(ctx interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx}, opts...)
varargs := append([]interface{}{ctx}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "KeepAlive", reflect.TypeOf((*MockManagerClient)(nil).KeepAlive), varargs...)
}
// ListApplications mocks base method.
func (m *MockManagerClient) ListApplications(ctx context.Context, in *manager.ListApplicationsRequest, opts ...grpc.CallOption) (*manager.ListApplicationsResponse, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -138,16 +252,76 @@ func (m *MockManagerClient) ListApplications(ctx context.Context, in *manager.Li
}
// ListApplications indicates an expected call of ListApplications.
func (mr *MockManagerClientMockRecorder) ListApplications(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockManagerClientMockRecorder) ListApplications(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListApplications", reflect.TypeOf((*MockManagerClient)(nil).ListApplications), varargs...)
}
// ListBuckets mocks base method.
func (m *MockManagerClient) ListBuckets(ctx context.Context, in *manager.ListBucketsRequest, opts ...grpc.CallOption) (*manager.ListBucketsResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ListBuckets", varargs...)
ret0, _ := ret[0].(*manager.ListBucketsResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListBuckets indicates an expected call of ListBuckets.
func (mr *MockManagerClientMockRecorder) ListBuckets(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListBuckets", reflect.TypeOf((*MockManagerClient)(nil).ListBuckets), varargs...)
}
// ListModelVersions mocks base method.
func (m *MockManagerClient) ListModelVersions(ctx context.Context, in *manager.ListModelVersionsRequest, opts ...grpc.CallOption) (*manager.ListModelVersionsResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ListModelVersions", varargs...)
ret0, _ := ret[0].(*manager.ListModelVersionsResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListModelVersions indicates an expected call of ListModelVersions.
func (mr *MockManagerClientMockRecorder) ListModelVersions(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListModelVersions", reflect.TypeOf((*MockManagerClient)(nil).ListModelVersions), varargs...)
}
// ListModels mocks base method.
func (m *MockManagerClient) ListModels(ctx context.Context, in *manager.ListModelsRequest, opts ...grpc.CallOption) (*manager.ListModelsResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ListModels", varargs...)
ret0, _ := ret[0].(*manager.ListModelsResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListModels indicates an expected call of ListModels.
func (mr *MockManagerClientMockRecorder) ListModels(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListModels", reflect.TypeOf((*MockManagerClient)(nil).ListModels), varargs...)
}
// ListSchedulers mocks base method.
func (m *MockManagerClient) ListSchedulers(ctx context.Context, in *manager.ListSchedulersRequest, opts ...grpc.CallOption) (*manager.ListSchedulersResponse, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -158,36 +332,56 @@ func (m *MockManagerClient) ListSchedulers(ctx context.Context, in *manager.List
}
// ListSchedulers indicates an expected call of ListSchedulers.
func (mr *MockManagerClientMockRecorder) ListSchedulers(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockManagerClientMockRecorder) ListSchedulers(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListSchedulers", reflect.TypeOf((*MockManagerClient)(nil).ListSchedulers), varargs...)
}
// ListSeedPeers mocks base method.
func (m *MockManagerClient) ListSeedPeers(ctx context.Context, in *manager.ListSeedPeersRequest, opts ...grpc.CallOption) (*manager.ListSeedPeersResponse, error) {
// UpdateModel mocks base method.
func (m *MockManagerClient) UpdateModel(ctx context.Context, in *manager.UpdateModelRequest, opts ...grpc.CallOption) (*manager.Model, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ListSeedPeers", varargs...)
ret0, _ := ret[0].(*manager.ListSeedPeersResponse)
ret := m.ctrl.Call(m, "UpdateModel", varargs...)
ret0, _ := ret[0].(*manager.Model)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListSeedPeers indicates an expected call of ListSeedPeers.
func (mr *MockManagerClientMockRecorder) ListSeedPeers(ctx, in any, opts ...any) *gomock.Call {
// UpdateModel indicates an expected call of UpdateModel.
func (mr *MockManagerClientMockRecorder) UpdateModel(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListSeedPeers", reflect.TypeOf((*MockManagerClient)(nil).ListSeedPeers), varargs...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateModel", reflect.TypeOf((*MockManagerClient)(nil).UpdateModel), varargs...)
}
// UpdateModelVersion mocks base method.
func (m *MockManagerClient) UpdateModelVersion(ctx context.Context, in *manager.UpdateModelVersionRequest, opts ...grpc.CallOption) (*manager.ModelVersion, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "UpdateModelVersion", varargs...)
ret0, _ := ret[0].(*manager.ModelVersion)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// UpdateModelVersion indicates an expected call of UpdateModelVersion.
func (mr *MockManagerClientMockRecorder) UpdateModelVersion(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateModelVersion", reflect.TypeOf((*MockManagerClient)(nil).UpdateModelVersion), varargs...)
}
// UpdateScheduler mocks base method.
func (m *MockManagerClient) UpdateScheduler(ctx context.Context, in *manager.UpdateSchedulerRequest, opts ...grpc.CallOption) (*manager.Scheduler, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -198,16 +392,16 @@ func (m *MockManagerClient) UpdateScheduler(ctx context.Context, in *manager.Upd
}
// UpdateScheduler indicates an expected call of UpdateScheduler.
func (mr *MockManagerClientMockRecorder) UpdateScheduler(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockManagerClientMockRecorder) UpdateScheduler(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateScheduler", reflect.TypeOf((*MockManagerClient)(nil).UpdateScheduler), varargs...)
}
// UpdateSeedPeer mocks base method.
func (m *MockManagerClient) UpdateSeedPeer(ctx context.Context, in *manager.UpdateSeedPeerRequest, opts ...grpc.CallOption) (*manager.SeedPeer, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -218,9 +412,9 @@ func (m *MockManagerClient) UpdateSeedPeer(ctx context.Context, in *manager.Upda
}
// UpdateSeedPeer indicates an expected call of UpdateSeedPeer.
func (mr *MockManagerClientMockRecorder) UpdateSeedPeer(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockManagerClientMockRecorder) UpdateSeedPeer(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSeedPeer", reflect.TypeOf((*MockManagerClient)(nil).UpdateSeedPeer), varargs...)
}
@ -228,7 +422,6 @@ func (mr *MockManagerClientMockRecorder) UpdateSeedPeer(ctx, in any, opts ...any
type MockManager_KeepAliveClient struct {
ctrl *gomock.Controller
recorder *MockManager_KeepAliveClientMockRecorder
isgomock struct{}
}
// MockManager_KeepAliveClientMockRecorder is the mock recorder for MockManager_KeepAliveClient.
@ -307,7 +500,7 @@ func (mr *MockManager_KeepAliveClientMockRecorder) Header() *gomock.Call {
}
// RecvMsg mocks base method.
func (m_2 *MockManager_KeepAliveClient) RecvMsg(m any) error {
func (m_2 *MockManager_KeepAliveClient) RecvMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
@ -315,7 +508,7 @@ func (m_2 *MockManager_KeepAliveClient) RecvMsg(m any) error {
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockManager_KeepAliveClientMockRecorder) RecvMsg(m any) *gomock.Call {
func (mr *MockManager_KeepAliveClientMockRecorder) RecvMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockManager_KeepAliveClient)(nil).RecvMsg), m)
}
@ -329,13 +522,13 @@ func (m *MockManager_KeepAliveClient) Send(arg0 *manager.KeepAliveRequest) error
}
// Send indicates an expected call of Send.
func (mr *MockManager_KeepAliveClientMockRecorder) Send(arg0 any) *gomock.Call {
func (mr *MockManager_KeepAliveClientMockRecorder) Send(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockManager_KeepAliveClient)(nil).Send), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockManager_KeepAliveClient) SendMsg(m any) error {
func (m_2 *MockManager_KeepAliveClient) SendMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
@ -343,7 +536,7 @@ func (m_2 *MockManager_KeepAliveClient) SendMsg(m any) error {
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockManager_KeepAliveClientMockRecorder) SendMsg(m any) *gomock.Call {
func (mr *MockManager_KeepAliveClientMockRecorder) SendMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockManager_KeepAliveClient)(nil).SendMsg), m)
}
@ -366,7 +559,6 @@ func (mr *MockManager_KeepAliveClientMockRecorder) Trailer() *gomock.Call {
type MockManagerServer struct {
ctrl *gomock.Controller
recorder *MockManagerServerMockRecorder
isgomock struct{}
}
// MockManagerServerMockRecorder is the mock recorder for MockManagerServer.
@ -386,19 +578,109 @@ func (m *MockManagerServer) EXPECT() *MockManagerServerMockRecorder {
return m.recorder
}
// DeleteSeedPeer mocks base method.
func (m *MockManagerServer) DeleteSeedPeer(arg0 context.Context, arg1 *manager.DeleteSeedPeerRequest) (*emptypb.Empty, error) {
// CreateModel mocks base method.
func (m *MockManagerServer) CreateModel(arg0 context.Context, arg1 *manager.CreateModelRequest) (*manager.Model, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DeleteSeedPeer", arg0, arg1)
ret := m.ctrl.Call(m, "CreateModel", arg0, arg1)
ret0, _ := ret[0].(*manager.Model)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CreateModel indicates an expected call of CreateModel.
func (mr *MockManagerServerMockRecorder) CreateModel(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateModel", reflect.TypeOf((*MockManagerServer)(nil).CreateModel), arg0, arg1)
}
// CreateModelVersion mocks base method.
func (m *MockManagerServer) CreateModelVersion(arg0 context.Context, arg1 *manager.CreateModelVersionRequest) (*manager.ModelVersion, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CreateModelVersion", arg0, arg1)
ret0, _ := ret[0].(*manager.ModelVersion)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CreateModelVersion indicates an expected call of CreateModelVersion.
func (mr *MockManagerServerMockRecorder) CreateModelVersion(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateModelVersion", reflect.TypeOf((*MockManagerServer)(nil).CreateModelVersion), arg0, arg1)
}
// DeleteModel mocks base method.
func (m *MockManagerServer) DeleteModel(arg0 context.Context, arg1 *manager.DeleteModelRequest) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DeleteModel", arg0, arg1)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// DeleteSeedPeer indicates an expected call of DeleteSeedPeer.
func (mr *MockManagerServerMockRecorder) DeleteSeedPeer(arg0, arg1 any) *gomock.Call {
// DeleteModel indicates an expected call of DeleteModel.
func (mr *MockManagerServerMockRecorder) DeleteModel(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteSeedPeer", reflect.TypeOf((*MockManagerServer)(nil).DeleteSeedPeer), arg0, arg1)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteModel", reflect.TypeOf((*MockManagerServer)(nil).DeleteModel), arg0, arg1)
}
// DeleteModelVersion mocks base method.
func (m *MockManagerServer) DeleteModelVersion(arg0 context.Context, arg1 *manager.DeleteModelVersionRequest) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DeleteModelVersion", arg0, arg1)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// DeleteModelVersion indicates an expected call of DeleteModelVersion.
func (mr *MockManagerServerMockRecorder) DeleteModelVersion(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteModelVersion", reflect.TypeOf((*MockManagerServer)(nil).DeleteModelVersion), arg0, arg1)
}
// GetModel mocks base method.
func (m *MockManagerServer) GetModel(arg0 context.Context, arg1 *manager.GetModelRequest) (*manager.Model, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetModel", arg0, arg1)
ret0, _ := ret[0].(*manager.Model)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetModel indicates an expected call of GetModel.
func (mr *MockManagerServerMockRecorder) GetModel(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModel", reflect.TypeOf((*MockManagerServer)(nil).GetModel), arg0, arg1)
}
// GetModelVersion mocks base method.
func (m *MockManagerServer) GetModelVersion(arg0 context.Context, arg1 *manager.GetModelVersionRequest) (*manager.ModelVersion, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetModelVersion", arg0, arg1)
ret0, _ := ret[0].(*manager.ModelVersion)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetModelVersion indicates an expected call of GetModelVersion.
func (mr *MockManagerServerMockRecorder) GetModelVersion(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModelVersion", reflect.TypeOf((*MockManagerServer)(nil).GetModelVersion), arg0, arg1)
}
// GetObjectStorage mocks base method.
func (m *MockManagerServer) GetObjectStorage(arg0 context.Context, arg1 *manager.GetObjectStorageRequest) (*manager.ObjectStorage, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetObjectStorage", arg0, arg1)
ret0, _ := ret[0].(*manager.ObjectStorage)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetObjectStorage indicates an expected call of GetObjectStorage.
func (mr *MockManagerServerMockRecorder) GetObjectStorage(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetObjectStorage", reflect.TypeOf((*MockManagerServer)(nil).GetObjectStorage), arg0, arg1)
}
// GetScheduler mocks base method.
@ -411,7 +693,7 @@ func (m *MockManagerServer) GetScheduler(arg0 context.Context, arg1 *manager.Get
}
// GetScheduler indicates an expected call of GetScheduler.
func (mr *MockManagerServerMockRecorder) GetScheduler(arg0, arg1 any) *gomock.Call {
func (mr *MockManagerServerMockRecorder) GetScheduler(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetScheduler", reflect.TypeOf((*MockManagerServer)(nil).GetScheduler), arg0, arg1)
}
@ -426,7 +708,7 @@ func (m *MockManagerServer) GetSeedPeer(arg0 context.Context, arg1 *manager.GetS
}
// GetSeedPeer indicates an expected call of GetSeedPeer.
func (mr *MockManagerServerMockRecorder) GetSeedPeer(arg0, arg1 any) *gomock.Call {
func (mr *MockManagerServerMockRecorder) GetSeedPeer(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSeedPeer", reflect.TypeOf((*MockManagerServer)(nil).GetSeedPeer), arg0, arg1)
}
@ -440,7 +722,7 @@ func (m *MockManagerServer) KeepAlive(arg0 manager.Manager_KeepAliveServer) erro
}
// KeepAlive indicates an expected call of KeepAlive.
func (mr *MockManagerServerMockRecorder) KeepAlive(arg0 any) *gomock.Call {
func (mr *MockManagerServerMockRecorder) KeepAlive(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "KeepAlive", reflect.TypeOf((*MockManagerServer)(nil).KeepAlive), arg0)
}
@ -455,11 +737,56 @@ func (m *MockManagerServer) ListApplications(arg0 context.Context, arg1 *manager
}
// ListApplications indicates an expected call of ListApplications.
func (mr *MockManagerServerMockRecorder) ListApplications(arg0, arg1 any) *gomock.Call {
func (mr *MockManagerServerMockRecorder) ListApplications(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListApplications", reflect.TypeOf((*MockManagerServer)(nil).ListApplications), arg0, arg1)
}
// ListBuckets mocks base method.
func (m *MockManagerServer) ListBuckets(arg0 context.Context, arg1 *manager.ListBucketsRequest) (*manager.ListBucketsResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListBuckets", arg0, arg1)
ret0, _ := ret[0].(*manager.ListBucketsResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListBuckets indicates an expected call of ListBuckets.
func (mr *MockManagerServerMockRecorder) ListBuckets(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListBuckets", reflect.TypeOf((*MockManagerServer)(nil).ListBuckets), arg0, arg1)
}
// ListModelVersions mocks base method.
func (m *MockManagerServer) ListModelVersions(arg0 context.Context, arg1 *manager.ListModelVersionsRequest) (*manager.ListModelVersionsResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListModelVersions", arg0, arg1)
ret0, _ := ret[0].(*manager.ListModelVersionsResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListModelVersions indicates an expected call of ListModelVersions.
func (mr *MockManagerServerMockRecorder) ListModelVersions(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListModelVersions", reflect.TypeOf((*MockManagerServer)(nil).ListModelVersions), arg0, arg1)
}
// ListModels mocks base method.
func (m *MockManagerServer) ListModels(arg0 context.Context, arg1 *manager.ListModelsRequest) (*manager.ListModelsResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListModels", arg0, arg1)
ret0, _ := ret[0].(*manager.ListModelsResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListModels indicates an expected call of ListModels.
func (mr *MockManagerServerMockRecorder) ListModels(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListModels", reflect.TypeOf((*MockManagerServer)(nil).ListModels), arg0, arg1)
}
// ListSchedulers mocks base method.
func (m *MockManagerServer) ListSchedulers(arg0 context.Context, arg1 *manager.ListSchedulersRequest) (*manager.ListSchedulersResponse, error) {
m.ctrl.T.Helper()
@ -470,24 +797,39 @@ func (m *MockManagerServer) ListSchedulers(arg0 context.Context, arg1 *manager.L
}
// ListSchedulers indicates an expected call of ListSchedulers.
func (mr *MockManagerServerMockRecorder) ListSchedulers(arg0, arg1 any) *gomock.Call {
func (mr *MockManagerServerMockRecorder) ListSchedulers(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListSchedulers", reflect.TypeOf((*MockManagerServer)(nil).ListSchedulers), arg0, arg1)
}
// ListSeedPeers mocks base method.
func (m *MockManagerServer) ListSeedPeers(arg0 context.Context, arg1 *manager.ListSeedPeersRequest) (*manager.ListSeedPeersResponse, error) {
// UpdateModel mocks base method.
func (m *MockManagerServer) UpdateModel(arg0 context.Context, arg1 *manager.UpdateModelRequest) (*manager.Model, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListSeedPeers", arg0, arg1)
ret0, _ := ret[0].(*manager.ListSeedPeersResponse)
ret := m.ctrl.Call(m, "UpdateModel", arg0, arg1)
ret0, _ := ret[0].(*manager.Model)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListSeedPeers indicates an expected call of ListSeedPeers.
func (mr *MockManagerServerMockRecorder) ListSeedPeers(arg0, arg1 any) *gomock.Call {
// UpdateModel indicates an expected call of UpdateModel.
func (mr *MockManagerServerMockRecorder) UpdateModel(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListSeedPeers", reflect.TypeOf((*MockManagerServer)(nil).ListSeedPeers), arg0, arg1)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateModel", reflect.TypeOf((*MockManagerServer)(nil).UpdateModel), arg0, arg1)
}
// UpdateModelVersion mocks base method.
func (m *MockManagerServer) UpdateModelVersion(arg0 context.Context, arg1 *manager.UpdateModelVersionRequest) (*manager.ModelVersion, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "UpdateModelVersion", arg0, arg1)
ret0, _ := ret[0].(*manager.ModelVersion)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// UpdateModelVersion indicates an expected call of UpdateModelVersion.
func (mr *MockManagerServerMockRecorder) UpdateModelVersion(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateModelVersion", reflect.TypeOf((*MockManagerServer)(nil).UpdateModelVersion), arg0, arg1)
}
// UpdateScheduler mocks base method.
@ -500,7 +842,7 @@ func (m *MockManagerServer) UpdateScheduler(arg0 context.Context, arg1 *manager.
}
// UpdateScheduler indicates an expected call of UpdateScheduler.
func (mr *MockManagerServerMockRecorder) UpdateScheduler(arg0, arg1 any) *gomock.Call {
func (mr *MockManagerServerMockRecorder) UpdateScheduler(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateScheduler", reflect.TypeOf((*MockManagerServer)(nil).UpdateScheduler), arg0, arg1)
}
@ -515,7 +857,7 @@ func (m *MockManagerServer) UpdateSeedPeer(arg0 context.Context, arg1 *manager.U
}
// UpdateSeedPeer indicates an expected call of UpdateSeedPeer.
func (mr *MockManagerServerMockRecorder) UpdateSeedPeer(arg0, arg1 any) *gomock.Call {
func (mr *MockManagerServerMockRecorder) UpdateSeedPeer(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSeedPeer", reflect.TypeOf((*MockManagerServer)(nil).UpdateSeedPeer), arg0, arg1)
}
@ -524,7 +866,6 @@ func (mr *MockManagerServerMockRecorder) UpdateSeedPeer(arg0, arg1 any) *gomock.
type MockUnsafeManagerServer struct {
ctrl *gomock.Controller
recorder *MockUnsafeManagerServerMockRecorder
isgomock struct{}
}
// MockUnsafeManagerServerMockRecorder is the mock recorder for MockUnsafeManagerServer.
@ -560,7 +901,6 @@ func (mr *MockUnsafeManagerServerMockRecorder) mustEmbedUnimplementedManagerServ
type MockManager_KeepAliveServer struct {
ctrl *gomock.Controller
recorder *MockManager_KeepAliveServerMockRecorder
isgomock struct{}
}
// MockManager_KeepAliveServerMockRecorder is the mock recorder for MockManager_KeepAliveServer.
@ -610,7 +950,7 @@ func (mr *MockManager_KeepAliveServerMockRecorder) Recv() *gomock.Call {
}
// RecvMsg mocks base method.
func (m_2 *MockManager_KeepAliveServer) RecvMsg(m any) error {
func (m_2 *MockManager_KeepAliveServer) RecvMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
@ -618,7 +958,7 @@ func (m_2 *MockManager_KeepAliveServer) RecvMsg(m any) error {
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockManager_KeepAliveServerMockRecorder) RecvMsg(m any) *gomock.Call {
func (mr *MockManager_KeepAliveServerMockRecorder) RecvMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockManager_KeepAliveServer)(nil).RecvMsg), m)
}
@ -632,7 +972,7 @@ func (m *MockManager_KeepAliveServer) SendAndClose(arg0 *emptypb.Empty) error {
}
// SendAndClose indicates an expected call of SendAndClose.
func (mr *MockManager_KeepAliveServerMockRecorder) SendAndClose(arg0 any) *gomock.Call {
func (mr *MockManager_KeepAliveServerMockRecorder) SendAndClose(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAndClose", reflect.TypeOf((*MockManager_KeepAliveServer)(nil).SendAndClose), arg0)
}
@ -646,13 +986,13 @@ func (m *MockManager_KeepAliveServer) SendHeader(arg0 metadata.MD) error {
}
// SendHeader indicates an expected call of SendHeader.
func (mr *MockManager_KeepAliveServerMockRecorder) SendHeader(arg0 any) *gomock.Call {
func (mr *MockManager_KeepAliveServerMockRecorder) SendHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockManager_KeepAliveServer)(nil).SendHeader), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockManager_KeepAliveServer) SendMsg(m any) error {
func (m_2 *MockManager_KeepAliveServer) SendMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
@ -660,7 +1000,7 @@ func (m_2 *MockManager_KeepAliveServer) SendMsg(m any) error {
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockManager_KeepAliveServerMockRecorder) SendMsg(m any) *gomock.Call {
func (mr *MockManager_KeepAliveServerMockRecorder) SendMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockManager_KeepAliveServer)(nil).SendMsg), m)
}
@ -674,7 +1014,7 @@ func (m *MockManager_KeepAliveServer) SetHeader(arg0 metadata.MD) error {
}
// SetHeader indicates an expected call of SetHeader.
func (mr *MockManager_KeepAliveServerMockRecorder) SetHeader(arg0 any) *gomock.Call {
func (mr *MockManager_KeepAliveServerMockRecorder) SetHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockManager_KeepAliveServer)(nil).SetHeader), arg0)
}
@ -686,7 +1026,7 @@ func (m *MockManager_KeepAliveServer) SetTrailer(arg0 metadata.MD) {
}
// SetTrailer indicates an expected call of SetTrailer.
func (mr *MockManager_KeepAliveServerMockRecorder) SetTrailer(arg0 any) *gomock.Call {
func (mr *MockManager_KeepAliveServerMockRecorder) SetTrailer(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockManager_KeepAliveServer)(nil).SetTrailer), arg0)
}

View File

@ -1,10 +1,5 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: ../scheduler_grpc.pb.go
//
// Generated by this command:
//
// mockgen -destination scheduler_mock.go -source ../scheduler_grpc.pb.go -package mocks
//
// Package mocks is a generated GoMock package.
package mocks
@ -13,8 +8,8 @@ import (
context "context"
reflect "reflect"
scheduler "d7y.io/api/v2/pkg/apis/scheduler/v1"
gomock "go.uber.org/mock/gomock"
scheduler "d7y.io/api/pkg/apis/scheduler/v1"
gomock "github.com/golang/mock/gomock"
grpc "google.golang.org/grpc"
metadata "google.golang.org/grpc/metadata"
emptypb "google.golang.org/protobuf/types/known/emptypb"
@ -24,7 +19,6 @@ import (
type MockSchedulerClient struct {
ctrl *gomock.Controller
recorder *MockSchedulerClientMockRecorder
isgomock struct{}
}
// MockSchedulerClientMockRecorder is the mock recorder for MockSchedulerClient.
@ -47,7 +41,7 @@ func (m *MockSchedulerClient) EXPECT() *MockSchedulerClientMockRecorder {
// AnnounceHost mocks base method.
func (m *MockSchedulerClient) AnnounceHost(ctx context.Context, in *scheduler.AnnounceHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -58,16 +52,16 @@ func (m *MockSchedulerClient) AnnounceHost(ctx context.Context, in *scheduler.An
}
// AnnounceHost indicates an expected call of AnnounceHost.
func (mr *MockSchedulerClientMockRecorder) AnnounceHost(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockSchedulerClientMockRecorder) AnnounceHost(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AnnounceHost", reflect.TypeOf((*MockSchedulerClient)(nil).AnnounceHost), varargs...)
}
// AnnounceTask mocks base method.
func (m *MockSchedulerClient) AnnounceTask(ctx context.Context, in *scheduler.AnnounceTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -78,16 +72,16 @@ func (m *MockSchedulerClient) AnnounceTask(ctx context.Context, in *scheduler.An
}
// AnnounceTask indicates an expected call of AnnounceTask.
func (mr *MockSchedulerClientMockRecorder) AnnounceTask(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockSchedulerClientMockRecorder) AnnounceTask(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AnnounceTask", reflect.TypeOf((*MockSchedulerClient)(nil).AnnounceTask), varargs...)
}
// LeaveHost mocks base method.
func (m *MockSchedulerClient) LeaveHost(ctx context.Context, in *scheduler.LeaveHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -98,16 +92,16 @@ func (m *MockSchedulerClient) LeaveHost(ctx context.Context, in *scheduler.Leave
}
// LeaveHost indicates an expected call of LeaveHost.
func (mr *MockSchedulerClientMockRecorder) LeaveHost(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockSchedulerClientMockRecorder) LeaveHost(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeaveHost", reflect.TypeOf((*MockSchedulerClient)(nil).LeaveHost), varargs...)
}
// LeaveTask mocks base method.
func (m *MockSchedulerClient) LeaveTask(ctx context.Context, in *scheduler.PeerTarget, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -118,16 +112,16 @@ func (m *MockSchedulerClient) LeaveTask(ctx context.Context, in *scheduler.PeerT
}
// LeaveTask indicates an expected call of LeaveTask.
func (mr *MockSchedulerClientMockRecorder) LeaveTask(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockSchedulerClientMockRecorder) LeaveTask(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeaveTask", reflect.TypeOf((*MockSchedulerClient)(nil).LeaveTask), varargs...)
}
// RegisterPeerTask mocks base method.
func (m *MockSchedulerClient) RegisterPeerTask(ctx context.Context, in *scheduler.PeerTaskRequest, opts ...grpc.CallOption) (*scheduler.RegisterResult, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -138,16 +132,16 @@ func (m *MockSchedulerClient) RegisterPeerTask(ctx context.Context, in *schedule
}
// RegisterPeerTask indicates an expected call of RegisterPeerTask.
func (mr *MockSchedulerClientMockRecorder) RegisterPeerTask(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockSchedulerClientMockRecorder) RegisterPeerTask(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterPeerTask", reflect.TypeOf((*MockSchedulerClient)(nil).RegisterPeerTask), varargs...)
}
// ReportPeerResult mocks base method.
func (m *MockSchedulerClient) ReportPeerResult(ctx context.Context, in *scheduler.PeerResult, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -158,16 +152,16 @@ func (m *MockSchedulerClient) ReportPeerResult(ctx context.Context, in *schedule
}
// ReportPeerResult indicates an expected call of ReportPeerResult.
func (mr *MockSchedulerClientMockRecorder) ReportPeerResult(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockSchedulerClientMockRecorder) ReportPeerResult(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReportPeerResult", reflect.TypeOf((*MockSchedulerClient)(nil).ReportPeerResult), varargs...)
}
// ReportPieceResult mocks base method.
func (m *MockSchedulerClient) ReportPieceResult(ctx context.Context, opts ...grpc.CallOption) (scheduler.Scheduler_ReportPieceResultClient, error) {
m.ctrl.T.Helper()
varargs := []any{ctx}
varargs := []interface{}{ctx}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -178,16 +172,16 @@ func (m *MockSchedulerClient) ReportPieceResult(ctx context.Context, opts ...grp
}
// ReportPieceResult indicates an expected call of ReportPieceResult.
func (mr *MockSchedulerClientMockRecorder) ReportPieceResult(ctx any, opts ...any) *gomock.Call {
func (mr *MockSchedulerClientMockRecorder) ReportPieceResult(ctx interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx}, opts...)
varargs := append([]interface{}{ctx}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReportPieceResult", reflect.TypeOf((*MockSchedulerClient)(nil).ReportPieceResult), varargs...)
}
// StatTask mocks base method.
func (m *MockSchedulerClient) StatTask(ctx context.Context, in *scheduler.StatTaskRequest, opts ...grpc.CallOption) (*scheduler.Task, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
@ -198,17 +192,56 @@ func (m *MockSchedulerClient) StatTask(ctx context.Context, in *scheduler.StatTa
}
// StatTask indicates an expected call of StatTask.
func (mr *MockSchedulerClientMockRecorder) StatTask(ctx, in any, opts ...any) *gomock.Call {
func (mr *MockSchedulerClientMockRecorder) StatTask(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StatTask", reflect.TypeOf((*MockSchedulerClient)(nil).StatTask), varargs...)
}
// SyncNetworkTopology mocks base method.
func (m *MockSchedulerClient) SyncNetworkTopology(ctx context.Context, opts ...grpc.CallOption) (scheduler.Scheduler_SyncNetworkTopologyClient, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "SyncNetworkTopology", varargs...)
ret0, _ := ret[0].(scheduler.Scheduler_SyncNetworkTopologyClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// SyncNetworkTopology indicates an expected call of SyncNetworkTopology.
func (mr *MockSchedulerClientMockRecorder) SyncNetworkTopology(ctx interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncNetworkTopology", reflect.TypeOf((*MockSchedulerClient)(nil).SyncNetworkTopology), varargs...)
}
// SyncProbes mocks base method.
func (m *MockSchedulerClient) SyncProbes(ctx context.Context, opts ...grpc.CallOption) (scheduler.Scheduler_SyncProbesClient, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "SyncProbes", varargs...)
ret0, _ := ret[0].(scheduler.Scheduler_SyncProbesClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// SyncProbes indicates an expected call of SyncProbes.
func (mr *MockSchedulerClientMockRecorder) SyncProbes(ctx interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncProbes", reflect.TypeOf((*MockSchedulerClient)(nil).SyncProbes), varargs...)
}
// MockScheduler_ReportPieceResultClient is a mock of Scheduler_ReportPieceResultClient interface.
type MockScheduler_ReportPieceResultClient struct {
ctrl *gomock.Controller
recorder *MockScheduler_ReportPieceResultClientMockRecorder
isgomock struct{}
}
// MockScheduler_ReportPieceResultClientMockRecorder is the mock recorder for MockScheduler_ReportPieceResultClient.
@ -287,7 +320,7 @@ func (mr *MockScheduler_ReportPieceResultClientMockRecorder) Recv() *gomock.Call
}
// RecvMsg mocks base method.
func (m_2 *MockScheduler_ReportPieceResultClient) RecvMsg(m any) error {
func (m_2 *MockScheduler_ReportPieceResultClient) RecvMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
@ -295,7 +328,7 @@ func (m_2 *MockScheduler_ReportPieceResultClient) RecvMsg(m any) error {
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockScheduler_ReportPieceResultClientMockRecorder) RecvMsg(m any) *gomock.Call {
func (mr *MockScheduler_ReportPieceResultClientMockRecorder) RecvMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockScheduler_ReportPieceResultClient)(nil).RecvMsg), m)
}
@ -309,13 +342,13 @@ func (m *MockScheduler_ReportPieceResultClient) Send(arg0 *scheduler.PieceResult
}
// Send indicates an expected call of Send.
func (mr *MockScheduler_ReportPieceResultClientMockRecorder) Send(arg0 any) *gomock.Call {
func (mr *MockScheduler_ReportPieceResultClientMockRecorder) Send(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockScheduler_ReportPieceResultClient)(nil).Send), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockScheduler_ReportPieceResultClient) SendMsg(m any) error {
func (m_2 *MockScheduler_ReportPieceResultClient) SendMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
@ -323,7 +356,7 @@ func (m_2 *MockScheduler_ReportPieceResultClient) SendMsg(m any) error {
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockScheduler_ReportPieceResultClientMockRecorder) SendMsg(m any) *gomock.Call {
func (mr *MockScheduler_ReportPieceResultClientMockRecorder) SendMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockScheduler_ReportPieceResultClient)(nil).SendMsg), m)
}
@ -342,11 +375,284 @@ func (mr *MockScheduler_ReportPieceResultClientMockRecorder) Trailer() *gomock.C
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockScheduler_ReportPieceResultClient)(nil).Trailer))
}
// MockScheduler_SyncProbesClient is a mock of Scheduler_SyncProbesClient interface.
type MockScheduler_SyncProbesClient struct {
ctrl *gomock.Controller
recorder *MockScheduler_SyncProbesClientMockRecorder
}
// MockScheduler_SyncProbesClientMockRecorder is the mock recorder for MockScheduler_SyncProbesClient.
type MockScheduler_SyncProbesClientMockRecorder struct {
mock *MockScheduler_SyncProbesClient
}
// NewMockScheduler_SyncProbesClient creates a new mock instance.
func NewMockScheduler_SyncProbesClient(ctrl *gomock.Controller) *MockScheduler_SyncProbesClient {
mock := &MockScheduler_SyncProbesClient{ctrl: ctrl}
mock.recorder = &MockScheduler_SyncProbesClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockScheduler_SyncProbesClient) EXPECT() *MockScheduler_SyncProbesClientMockRecorder {
return m.recorder
}
// CloseSend mocks base method.
func (m *MockScheduler_SyncProbesClient) CloseSend() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CloseSend")
ret0, _ := ret[0].(error)
return ret0
}
// CloseSend indicates an expected call of CloseSend.
func (mr *MockScheduler_SyncProbesClientMockRecorder) CloseSend() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseSend", reflect.TypeOf((*MockScheduler_SyncProbesClient)(nil).CloseSend))
}
// Context mocks base method.
func (m *MockScheduler_SyncProbesClient) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockScheduler_SyncProbesClientMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockScheduler_SyncProbesClient)(nil).Context))
}
// Header mocks base method.
func (m *MockScheduler_SyncProbesClient) Header() (metadata.MD, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Header")
ret0, _ := ret[0].(metadata.MD)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Header indicates an expected call of Header.
func (mr *MockScheduler_SyncProbesClientMockRecorder) Header() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Header", reflect.TypeOf((*MockScheduler_SyncProbesClient)(nil).Header))
}
// Recv mocks base method.
func (m *MockScheduler_SyncProbesClient) Recv() (*scheduler.SyncProbesResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*scheduler.SyncProbesResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Recv indicates an expected call of Recv.
func (mr *MockScheduler_SyncProbesClientMockRecorder) Recv() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockScheduler_SyncProbesClient)(nil).Recv))
}
// RecvMsg mocks base method.
func (m_2 *MockScheduler_SyncProbesClient) RecvMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockScheduler_SyncProbesClientMockRecorder) RecvMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockScheduler_SyncProbesClient)(nil).RecvMsg), m)
}
// Send mocks base method.
func (m *MockScheduler_SyncProbesClient) Send(arg0 *scheduler.SyncProbesRequest) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Send indicates an expected call of Send.
func (mr *MockScheduler_SyncProbesClientMockRecorder) Send(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockScheduler_SyncProbesClient)(nil).Send), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockScheduler_SyncProbesClient) SendMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockScheduler_SyncProbesClientMockRecorder) SendMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockScheduler_SyncProbesClient)(nil).SendMsg), m)
}
// Trailer mocks base method.
func (m *MockScheduler_SyncProbesClient) Trailer() metadata.MD {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Trailer")
ret0, _ := ret[0].(metadata.MD)
return ret0
}
// Trailer indicates an expected call of Trailer.
func (mr *MockScheduler_SyncProbesClientMockRecorder) Trailer() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockScheduler_SyncProbesClient)(nil).Trailer))
}
// MockScheduler_SyncNetworkTopologyClient is a mock of Scheduler_SyncNetworkTopologyClient interface.
type MockScheduler_SyncNetworkTopologyClient struct {
ctrl *gomock.Controller
recorder *MockScheduler_SyncNetworkTopologyClientMockRecorder
}
// MockScheduler_SyncNetworkTopologyClientMockRecorder is the mock recorder for MockScheduler_SyncNetworkTopologyClient.
type MockScheduler_SyncNetworkTopologyClientMockRecorder struct {
mock *MockScheduler_SyncNetworkTopologyClient
}
// NewMockScheduler_SyncNetworkTopologyClient creates a new mock instance.
func NewMockScheduler_SyncNetworkTopologyClient(ctrl *gomock.Controller) *MockScheduler_SyncNetworkTopologyClient {
mock := &MockScheduler_SyncNetworkTopologyClient{ctrl: ctrl}
mock.recorder = &MockScheduler_SyncNetworkTopologyClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockScheduler_SyncNetworkTopologyClient) EXPECT() *MockScheduler_SyncNetworkTopologyClientMockRecorder {
return m.recorder
}
// CloseAndRecv mocks base method.
func (m *MockScheduler_SyncNetworkTopologyClient) CloseAndRecv() (*emptypb.Empty, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CloseAndRecv")
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CloseAndRecv indicates an expected call of CloseAndRecv.
func (mr *MockScheduler_SyncNetworkTopologyClientMockRecorder) CloseAndRecv() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseAndRecv", reflect.TypeOf((*MockScheduler_SyncNetworkTopologyClient)(nil).CloseAndRecv))
}
// CloseSend mocks base method.
func (m *MockScheduler_SyncNetworkTopologyClient) CloseSend() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CloseSend")
ret0, _ := ret[0].(error)
return ret0
}
// CloseSend indicates an expected call of CloseSend.
func (mr *MockScheduler_SyncNetworkTopologyClientMockRecorder) CloseSend() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseSend", reflect.TypeOf((*MockScheduler_SyncNetworkTopologyClient)(nil).CloseSend))
}
// Context mocks base method.
func (m *MockScheduler_SyncNetworkTopologyClient) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockScheduler_SyncNetworkTopologyClientMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockScheduler_SyncNetworkTopologyClient)(nil).Context))
}
// Header mocks base method.
func (m *MockScheduler_SyncNetworkTopologyClient) Header() (metadata.MD, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Header")
ret0, _ := ret[0].(metadata.MD)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Header indicates an expected call of Header.
func (mr *MockScheduler_SyncNetworkTopologyClientMockRecorder) Header() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Header", reflect.TypeOf((*MockScheduler_SyncNetworkTopologyClient)(nil).Header))
}
// RecvMsg mocks base method.
func (m_2 *MockScheduler_SyncNetworkTopologyClient) RecvMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockScheduler_SyncNetworkTopologyClientMockRecorder) RecvMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockScheduler_SyncNetworkTopologyClient)(nil).RecvMsg), m)
}
// Send mocks base method.
func (m *MockScheduler_SyncNetworkTopologyClient) Send(arg0 *scheduler.SyncNetworkTopologyRequest) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Send indicates an expected call of Send.
func (mr *MockScheduler_SyncNetworkTopologyClientMockRecorder) Send(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockScheduler_SyncNetworkTopologyClient)(nil).Send), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockScheduler_SyncNetworkTopologyClient) SendMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockScheduler_SyncNetworkTopologyClientMockRecorder) SendMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockScheduler_SyncNetworkTopologyClient)(nil).SendMsg), m)
}
// Trailer mocks base method.
func (m *MockScheduler_SyncNetworkTopologyClient) Trailer() metadata.MD {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Trailer")
ret0, _ := ret[0].(metadata.MD)
return ret0
}
// Trailer indicates an expected call of Trailer.
func (mr *MockScheduler_SyncNetworkTopologyClientMockRecorder) Trailer() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockScheduler_SyncNetworkTopologyClient)(nil).Trailer))
}
// MockSchedulerServer is a mock of SchedulerServer interface.
type MockSchedulerServer struct {
ctrl *gomock.Controller
recorder *MockSchedulerServerMockRecorder
isgomock struct{}
}
// MockSchedulerServerMockRecorder is the mock recorder for MockSchedulerServer.
@ -376,7 +682,7 @@ func (m *MockSchedulerServer) AnnounceHost(arg0 context.Context, arg1 *scheduler
}
// AnnounceHost indicates an expected call of AnnounceHost.
func (mr *MockSchedulerServerMockRecorder) AnnounceHost(arg0, arg1 any) *gomock.Call {
func (mr *MockSchedulerServerMockRecorder) AnnounceHost(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AnnounceHost", reflect.TypeOf((*MockSchedulerServer)(nil).AnnounceHost), arg0, arg1)
}
@ -391,7 +697,7 @@ func (m *MockSchedulerServer) AnnounceTask(arg0 context.Context, arg1 *scheduler
}
// AnnounceTask indicates an expected call of AnnounceTask.
func (mr *MockSchedulerServerMockRecorder) AnnounceTask(arg0, arg1 any) *gomock.Call {
func (mr *MockSchedulerServerMockRecorder) AnnounceTask(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AnnounceTask", reflect.TypeOf((*MockSchedulerServer)(nil).AnnounceTask), arg0, arg1)
}
@ -406,7 +712,7 @@ func (m *MockSchedulerServer) LeaveHost(arg0 context.Context, arg1 *scheduler.Le
}
// LeaveHost indicates an expected call of LeaveHost.
func (mr *MockSchedulerServerMockRecorder) LeaveHost(arg0, arg1 any) *gomock.Call {
func (mr *MockSchedulerServerMockRecorder) LeaveHost(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeaveHost", reflect.TypeOf((*MockSchedulerServer)(nil).LeaveHost), arg0, arg1)
}
@ -421,7 +727,7 @@ func (m *MockSchedulerServer) LeaveTask(arg0 context.Context, arg1 *scheduler.Pe
}
// LeaveTask indicates an expected call of LeaveTask.
func (mr *MockSchedulerServerMockRecorder) LeaveTask(arg0, arg1 any) *gomock.Call {
func (mr *MockSchedulerServerMockRecorder) LeaveTask(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeaveTask", reflect.TypeOf((*MockSchedulerServer)(nil).LeaveTask), arg0, arg1)
}
@ -436,7 +742,7 @@ func (m *MockSchedulerServer) RegisterPeerTask(arg0 context.Context, arg1 *sched
}
// RegisterPeerTask indicates an expected call of RegisterPeerTask.
func (mr *MockSchedulerServerMockRecorder) RegisterPeerTask(arg0, arg1 any) *gomock.Call {
func (mr *MockSchedulerServerMockRecorder) RegisterPeerTask(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterPeerTask", reflect.TypeOf((*MockSchedulerServer)(nil).RegisterPeerTask), arg0, arg1)
}
@ -451,7 +757,7 @@ func (m *MockSchedulerServer) ReportPeerResult(arg0 context.Context, arg1 *sched
}
// ReportPeerResult indicates an expected call of ReportPeerResult.
func (mr *MockSchedulerServerMockRecorder) ReportPeerResult(arg0, arg1 any) *gomock.Call {
func (mr *MockSchedulerServerMockRecorder) ReportPeerResult(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReportPeerResult", reflect.TypeOf((*MockSchedulerServer)(nil).ReportPeerResult), arg0, arg1)
}
@ -465,7 +771,7 @@ func (m *MockSchedulerServer) ReportPieceResult(arg0 scheduler.Scheduler_ReportP
}
// ReportPieceResult indicates an expected call of ReportPieceResult.
func (mr *MockSchedulerServerMockRecorder) ReportPieceResult(arg0 any) *gomock.Call {
func (mr *MockSchedulerServerMockRecorder) ReportPieceResult(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReportPieceResult", reflect.TypeOf((*MockSchedulerServer)(nil).ReportPieceResult), arg0)
}
@ -480,16 +786,43 @@ func (m *MockSchedulerServer) StatTask(arg0 context.Context, arg1 *scheduler.Sta
}
// StatTask indicates an expected call of StatTask.
func (mr *MockSchedulerServerMockRecorder) StatTask(arg0, arg1 any) *gomock.Call {
func (mr *MockSchedulerServerMockRecorder) StatTask(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StatTask", reflect.TypeOf((*MockSchedulerServer)(nil).StatTask), arg0, arg1)
}
// SyncNetworkTopology mocks base method.
func (m *MockSchedulerServer) SyncNetworkTopology(arg0 scheduler.Scheduler_SyncNetworkTopologyServer) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SyncNetworkTopology", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SyncNetworkTopology indicates an expected call of SyncNetworkTopology.
func (mr *MockSchedulerServerMockRecorder) SyncNetworkTopology(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncNetworkTopology", reflect.TypeOf((*MockSchedulerServer)(nil).SyncNetworkTopology), arg0)
}
// SyncProbes mocks base method.
func (m *MockSchedulerServer) SyncProbes(arg0 scheduler.Scheduler_SyncProbesServer) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SyncProbes", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SyncProbes indicates an expected call of SyncProbes.
func (mr *MockSchedulerServerMockRecorder) SyncProbes(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncProbes", reflect.TypeOf((*MockSchedulerServer)(nil).SyncProbes), arg0)
}
// MockUnsafeSchedulerServer is a mock of UnsafeSchedulerServer interface.
type MockUnsafeSchedulerServer struct {
ctrl *gomock.Controller
recorder *MockUnsafeSchedulerServerMockRecorder
isgomock struct{}
}
// MockUnsafeSchedulerServerMockRecorder is the mock recorder for MockUnsafeSchedulerServer.
@ -525,7 +858,6 @@ func (mr *MockUnsafeSchedulerServerMockRecorder) mustEmbedUnimplementedScheduler
type MockScheduler_ReportPieceResultServer struct {
ctrl *gomock.Controller
recorder *MockScheduler_ReportPieceResultServerMockRecorder
isgomock struct{}
}
// MockScheduler_ReportPieceResultServerMockRecorder is the mock recorder for MockScheduler_ReportPieceResultServer.
@ -575,7 +907,7 @@ func (mr *MockScheduler_ReportPieceResultServerMockRecorder) Recv() *gomock.Call
}
// RecvMsg mocks base method.
func (m_2 *MockScheduler_ReportPieceResultServer) RecvMsg(m any) error {
func (m_2 *MockScheduler_ReportPieceResultServer) RecvMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
@ -583,7 +915,7 @@ func (m_2 *MockScheduler_ReportPieceResultServer) RecvMsg(m any) error {
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockScheduler_ReportPieceResultServerMockRecorder) RecvMsg(m any) *gomock.Call {
func (mr *MockScheduler_ReportPieceResultServerMockRecorder) RecvMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockScheduler_ReportPieceResultServer)(nil).RecvMsg), m)
}
@ -597,7 +929,7 @@ func (m *MockScheduler_ReportPieceResultServer) Send(arg0 *scheduler.PeerPacket)
}
// Send indicates an expected call of Send.
func (mr *MockScheduler_ReportPieceResultServerMockRecorder) Send(arg0 any) *gomock.Call {
func (mr *MockScheduler_ReportPieceResultServerMockRecorder) Send(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockScheduler_ReportPieceResultServer)(nil).Send), arg0)
}
@ -611,13 +943,13 @@ func (m *MockScheduler_ReportPieceResultServer) SendHeader(arg0 metadata.MD) err
}
// SendHeader indicates an expected call of SendHeader.
func (mr *MockScheduler_ReportPieceResultServerMockRecorder) SendHeader(arg0 any) *gomock.Call {
func (mr *MockScheduler_ReportPieceResultServerMockRecorder) SendHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockScheduler_ReportPieceResultServer)(nil).SendHeader), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockScheduler_ReportPieceResultServer) SendMsg(m any) error {
func (m_2 *MockScheduler_ReportPieceResultServer) SendMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
@ -625,7 +957,7 @@ func (m_2 *MockScheduler_ReportPieceResultServer) SendMsg(m any) error {
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockScheduler_ReportPieceResultServerMockRecorder) SendMsg(m any) *gomock.Call {
func (mr *MockScheduler_ReportPieceResultServerMockRecorder) SendMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockScheduler_ReportPieceResultServer)(nil).SendMsg), m)
}
@ -639,7 +971,7 @@ func (m *MockScheduler_ReportPieceResultServer) SetHeader(arg0 metadata.MD) erro
}
// SetHeader indicates an expected call of SetHeader.
func (mr *MockScheduler_ReportPieceResultServerMockRecorder) SetHeader(arg0 any) *gomock.Call {
func (mr *MockScheduler_ReportPieceResultServerMockRecorder) SetHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockScheduler_ReportPieceResultServer)(nil).SetHeader), arg0)
}
@ -651,7 +983,275 @@ func (m *MockScheduler_ReportPieceResultServer) SetTrailer(arg0 metadata.MD) {
}
// SetTrailer indicates an expected call of SetTrailer.
func (mr *MockScheduler_ReportPieceResultServerMockRecorder) SetTrailer(arg0 any) *gomock.Call {
func (mr *MockScheduler_ReportPieceResultServerMockRecorder) SetTrailer(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockScheduler_ReportPieceResultServer)(nil).SetTrailer), arg0)
}
// MockScheduler_SyncProbesServer is a mock of Scheduler_SyncProbesServer interface.
type MockScheduler_SyncProbesServer struct {
ctrl *gomock.Controller
recorder *MockScheduler_SyncProbesServerMockRecorder
}
// MockScheduler_SyncProbesServerMockRecorder is the mock recorder for MockScheduler_SyncProbesServer.
type MockScheduler_SyncProbesServerMockRecorder struct {
mock *MockScheduler_SyncProbesServer
}
// NewMockScheduler_SyncProbesServer creates a new mock instance.
func NewMockScheduler_SyncProbesServer(ctrl *gomock.Controller) *MockScheduler_SyncProbesServer {
mock := &MockScheduler_SyncProbesServer{ctrl: ctrl}
mock.recorder = &MockScheduler_SyncProbesServerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockScheduler_SyncProbesServer) EXPECT() *MockScheduler_SyncProbesServerMockRecorder {
return m.recorder
}
// Context mocks base method.
func (m *MockScheduler_SyncProbesServer) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockScheduler_SyncProbesServerMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockScheduler_SyncProbesServer)(nil).Context))
}
// Recv mocks base method.
func (m *MockScheduler_SyncProbesServer) Recv() (*scheduler.SyncProbesRequest, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*scheduler.SyncProbesRequest)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Recv indicates an expected call of Recv.
func (mr *MockScheduler_SyncProbesServerMockRecorder) Recv() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockScheduler_SyncProbesServer)(nil).Recv))
}
// RecvMsg mocks base method.
func (m_2 *MockScheduler_SyncProbesServer) RecvMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockScheduler_SyncProbesServerMockRecorder) RecvMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockScheduler_SyncProbesServer)(nil).RecvMsg), m)
}
// Send mocks base method.
func (m *MockScheduler_SyncProbesServer) Send(arg0 *scheduler.SyncProbesResponse) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Send indicates an expected call of Send.
func (mr *MockScheduler_SyncProbesServerMockRecorder) Send(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockScheduler_SyncProbesServer)(nil).Send), arg0)
}
// SendHeader mocks base method.
func (m *MockScheduler_SyncProbesServer) SendHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendHeader indicates an expected call of SendHeader.
func (mr *MockScheduler_SyncProbesServerMockRecorder) SendHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockScheduler_SyncProbesServer)(nil).SendHeader), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockScheduler_SyncProbesServer) SendMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockScheduler_SyncProbesServerMockRecorder) SendMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockScheduler_SyncProbesServer)(nil).SendMsg), m)
}
// SetHeader mocks base method.
func (m *MockScheduler_SyncProbesServer) SetHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SetHeader indicates an expected call of SetHeader.
func (mr *MockScheduler_SyncProbesServerMockRecorder) SetHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockScheduler_SyncProbesServer)(nil).SetHeader), arg0)
}
// SetTrailer mocks base method.
func (m *MockScheduler_SyncProbesServer) SetTrailer(arg0 metadata.MD) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "SetTrailer", arg0)
}
// SetTrailer indicates an expected call of SetTrailer.
func (mr *MockScheduler_SyncProbesServerMockRecorder) SetTrailer(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockScheduler_SyncProbesServer)(nil).SetTrailer), arg0)
}
// MockScheduler_SyncNetworkTopologyServer is a mock of Scheduler_SyncNetworkTopologyServer interface.
type MockScheduler_SyncNetworkTopologyServer struct {
ctrl *gomock.Controller
recorder *MockScheduler_SyncNetworkTopologyServerMockRecorder
}
// MockScheduler_SyncNetworkTopologyServerMockRecorder is the mock recorder for MockScheduler_SyncNetworkTopologyServer.
type MockScheduler_SyncNetworkTopologyServerMockRecorder struct {
mock *MockScheduler_SyncNetworkTopologyServer
}
// NewMockScheduler_SyncNetworkTopologyServer creates a new mock instance.
func NewMockScheduler_SyncNetworkTopologyServer(ctrl *gomock.Controller) *MockScheduler_SyncNetworkTopologyServer {
mock := &MockScheduler_SyncNetworkTopologyServer{ctrl: ctrl}
mock.recorder = &MockScheduler_SyncNetworkTopologyServerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockScheduler_SyncNetworkTopologyServer) EXPECT() *MockScheduler_SyncNetworkTopologyServerMockRecorder {
return m.recorder
}
// Context mocks base method.
func (m *MockScheduler_SyncNetworkTopologyServer) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockScheduler_SyncNetworkTopologyServerMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockScheduler_SyncNetworkTopologyServer)(nil).Context))
}
// Recv mocks base method.
func (m *MockScheduler_SyncNetworkTopologyServer) Recv() (*scheduler.SyncNetworkTopologyRequest, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*scheduler.SyncNetworkTopologyRequest)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Recv indicates an expected call of Recv.
func (mr *MockScheduler_SyncNetworkTopologyServerMockRecorder) Recv() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockScheduler_SyncNetworkTopologyServer)(nil).Recv))
}
// RecvMsg mocks base method.
func (m_2 *MockScheduler_SyncNetworkTopologyServer) RecvMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockScheduler_SyncNetworkTopologyServerMockRecorder) RecvMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockScheduler_SyncNetworkTopologyServer)(nil).RecvMsg), m)
}
// SendAndClose mocks base method.
func (m *MockScheduler_SyncNetworkTopologyServer) SendAndClose(arg0 *emptypb.Empty) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendAndClose", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendAndClose indicates an expected call of SendAndClose.
func (mr *MockScheduler_SyncNetworkTopologyServerMockRecorder) SendAndClose(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAndClose", reflect.TypeOf((*MockScheduler_SyncNetworkTopologyServer)(nil).SendAndClose), arg0)
}
// SendHeader mocks base method.
func (m *MockScheduler_SyncNetworkTopologyServer) SendHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendHeader indicates an expected call of SendHeader.
func (mr *MockScheduler_SyncNetworkTopologyServerMockRecorder) SendHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockScheduler_SyncNetworkTopologyServer)(nil).SendHeader), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockScheduler_SyncNetworkTopologyServer) SendMsg(m interface{}) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockScheduler_SyncNetworkTopologyServerMockRecorder) SendMsg(m interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockScheduler_SyncNetworkTopologyServer)(nil).SendMsg), m)
}
// SetHeader mocks base method.
func (m *MockScheduler_SyncNetworkTopologyServer) SetHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SetHeader indicates an expected call of SetHeader.
func (mr *MockScheduler_SyncNetworkTopologyServerMockRecorder) SetHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockScheduler_SyncNetworkTopologyServer)(nil).SetHeader), arg0)
}
// SetTrailer mocks base method.
func (m *MockScheduler_SyncNetworkTopologyServer) SetTrailer(arg0 metadata.MD) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "SetTrailer", arg0)
}
// SetTrailer indicates an expected call of SetTrailer.
func (mr *MockScheduler_SyncNetworkTopologyServerMockRecorder) SetTrailer(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockScheduler_SyncNetworkTopologyServer)(nil).SetTrailer), arg0)
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -22,8 +22,10 @@ import "pkg/apis/common/v1/common.proto";
import "pkg/apis/errordetails/v1/errordetails.proto";
import "validate/validate.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
option go_package = "d7y.io/api/v2/pkg/apis/scheduler/v1;scheduler";
option go_package = "d7y.io/api/pkg/apis/scheduler/v1;scheduler";
// PeerTaskRequest represents request of RegisterPeerTask.
message PeerTaskRequest{
@ -35,8 +37,6 @@ message PeerTaskRequest{
string peer_id = 3 [(validate.rules).string.min_len = 1];
// Peer host info.
PeerHost peer_host = 4;
// When requesting for range, it will trigger seed peer to download entire task.
bool prefetch = 5;
// Whether this request is caused by migration.
bool is_migrating = 6;
// Task id.
@ -84,7 +84,9 @@ message PeerHost{
// Port of download server.
int32 down_port = 4 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
// Peer hostname.
string hostname = 5 [(validate.rules).string.hostname = true];
string host_name = 5 [(validate.rules).string.hostname = true];
// Security domain for network.
string security_domain = 6;
// Location path(area|country|province|city|...).
string location = 7;
// IDC where the peer host is located
@ -131,6 +133,8 @@ message PeerPacket{
string task_id = 2 [(validate.rules).string.min_len = 1];
// Source peer id.
string src_pid = 3 [(validate.rules).string.min_len = 1];
// Concurrent downloading count from main peer.
int32 parallel_count = 4 [(validate.rules).int32.gte = 1];
// Main peer.
DestPeer main_peer = 5;
// Candidate peers.
@ -152,6 +156,8 @@ message PeerResult{
string peer_id = 2 [(validate.rules).string.min_len = 1];
// Source host ip.
string src_ip = 3 [(validate.rules).string.ip = true];
// Security domain.
string security_domain = 4;
// IDC where the peer host is located
string idc = 5;
// Download url.
@ -263,10 +269,6 @@ message AnnounceHostRequest{
Disk disk = 15 [(validate.rules).message.required = true];
// Build information.
Build build = 16 [(validate.rules).message.required = true];
// ID of the cluster to which the host belongs.
uint64 scheduler_cluster_id = 17;
// Port of object storage server.
int32 object_storage_port = 18 [(validate.rules).int32 = {gte: 1024, lt: 65535, ignore_empty: true}];
}
// CPU Stat.
@ -276,9 +278,9 @@ message CPU {
// Number of physical cores in the system
uint32 physical_count = 2;
// Percent calculates the percentage of cpu used.
double percent = 3 [(validate.rules).double.gte = 0];
double percent = 3 [(validate.rules).double = {gte: 0, lte: 100}];
// Calculates the percentage of cpu used by process.
double process_percent = 4 [(validate.rules).double.gte = 0];
double process_percent = 4 [(validate.rules).double = {gte: 0, lte: 100}];
// CPUTimes contains the amounts of time the CPU has spent performing different kinds of work.
CPUTimes times = 5 [(validate.rules).message.required = true];
}
@ -317,9 +319,9 @@ message Memory {
// RAM used by programs.
uint64 used = 3;
// Percentage of RAM used by programs.
double used_percent = 4;
double used_percent = 4 [(validate.rules).double = {gte: 0, lte: 100}];
// Calculates the percentage of memory used by process.
double process_used_percent = 5;
double process_used_percent = 5 [(validate.rules).double = {gte: 0, lte: 100}];
// This is the kernel's notion of free memory.
uint64 free = 6;
}
@ -330,6 +332,8 @@ message Network {
uint32 tcp_connection_count = 1;
// Return count of upload tcp connections opened and status is ESTABLISHED.
uint32 upload_tcp_connection_count = 2;
// Security domain for network.
string security_domain = 3;
// Location path(area|country|province|city|...).
string location = 4;
// IDC where the peer host is located
@ -368,6 +372,60 @@ message Build {
string platform = 4;
}
// Probe information.
message Probe {
// Host metadata.
common.Host host = 1 [(validate.rules).message.required = true];
// RTT is the round-trip time sent via this pinger.
google.protobuf.Duration rtt = 2 [(validate.rules).duration.required = true];
// Task update time.
google.protobuf.Timestamp updated_at = 3 [(validate.rules).timestamp.required = true];
}
// ProbesOfHost represents probes information of the host.
message ProbesOfHost {
// Host metadata.
common.Host host = 1 [(validate.rules).message.required = true];
// Probes information.
repeated Probe probes = 2 [(validate.rules).repeated = {min_items: 1, ignore_empty: true}];
}
// SyncProbesRequest represents request of SyncProbes.
message SyncProbesRequest {
// Probes information of the host.
ProbesOfHost probes_of_host = 1 [(validate.rules).message.required = true];
}
// SyncProbesResponse represents response of SyncProbes.
message SyncProbesResponse {
// Hosts needs to be probed.
repeated common.Host hosts = 1 [(validate.rules).repeated = {min_items: 1, ignore_empty: true}];
// Probe interval.
google.protobuf.Duration probe_interval = 2 [(validate.rules).duration.required = true];
}
// UpdateHostsRequest represents update hosts request of SyncNetworkTopologyRequest.
message UpdateHostsRequest {
// Hosts needs to be updated.
repeated ProbesOfHost probes_of_hosts = 1 [(validate.rules).repeated = {min_items: 1}];
}
// DeleteHostsRequest represents delete hosts request of SyncNetworkTopologyRequest.
message DeleteHostsRequest {
// Hosts needs to be deleted.
repeated ProbesOfHost probes_of_hosts = 1 [(validate.rules).repeated = {min_items: 1}];
}
// SyncProbesRequest represents request of SyncProbes.
message SyncNetworkTopologyRequest {
oneof request {
option (validate.required) = true;
UpdateHostsRequest update_probes_of_hosts_request = 1;
DeleteHostsRequest delete_probes_of_hosts_request = 2;
}
}
// Scheduler RPC Service.
service Scheduler{
// RegisterPeerTask registers a peer into task.
@ -393,4 +451,10 @@ service Scheduler{
// LeaveHost makes the peers leaving from host.
rpc LeaveHost(LeaveHostRequest)returns(google.protobuf.Empty);
// SyncProbes sync probes of the host.
rpc SyncProbes(stream SyncProbesRequest)returns(stream SyncProbesResponse);
// SyncNetworkTopology sync network topology of the hosts.
rpc SyncNetworkTopology(stream SyncNetworkTopologyRequest)returns(google.protobuf.Empty);
}

View File

@ -39,6 +39,10 @@ type SchedulerClient interface {
AnnounceHost(ctx context.Context, in *AnnounceHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// LeaveHost makes the peers leaving from host.
LeaveHost(ctx context.Context, in *LeaveHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// SyncProbes sync probes of the host.
SyncProbes(ctx context.Context, opts ...grpc.CallOption) (Scheduler_SyncProbesClient, error)
// SyncNetworkTopology sync network topology of the hosts.
SyncNetworkTopology(ctx context.Context, opts ...grpc.CallOption) (Scheduler_SyncNetworkTopologyClient, error)
}
type schedulerClient struct {
@ -143,6 +147,71 @@ func (c *schedulerClient) LeaveHost(ctx context.Context, in *LeaveHostRequest, o
return out, nil
}
func (c *schedulerClient) SyncProbes(ctx context.Context, opts ...grpc.CallOption) (Scheduler_SyncProbesClient, error) {
stream, err := c.cc.NewStream(ctx, &Scheduler_ServiceDesc.Streams[1], "/scheduler.Scheduler/SyncProbes", opts...)
if err != nil {
return nil, err
}
x := &schedulerSyncProbesClient{stream}
return x, nil
}
type Scheduler_SyncProbesClient interface {
Send(*SyncProbesRequest) error
Recv() (*SyncProbesResponse, error)
grpc.ClientStream
}
type schedulerSyncProbesClient struct {
grpc.ClientStream
}
func (x *schedulerSyncProbesClient) Send(m *SyncProbesRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *schedulerSyncProbesClient) Recv() (*SyncProbesResponse, error) {
m := new(SyncProbesResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *schedulerClient) SyncNetworkTopology(ctx context.Context, opts ...grpc.CallOption) (Scheduler_SyncNetworkTopologyClient, error) {
stream, err := c.cc.NewStream(ctx, &Scheduler_ServiceDesc.Streams[2], "/scheduler.Scheduler/SyncNetworkTopology", opts...)
if err != nil {
return nil, err
}
x := &schedulerSyncNetworkTopologyClient{stream}
return x, nil
}
type Scheduler_SyncNetworkTopologyClient interface {
Send(*SyncNetworkTopologyRequest) error
CloseAndRecv() (*emptypb.Empty, error)
grpc.ClientStream
}
type schedulerSyncNetworkTopologyClient struct {
grpc.ClientStream
}
func (x *schedulerSyncNetworkTopologyClient) Send(m *SyncNetworkTopologyRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *schedulerSyncNetworkTopologyClient) CloseAndRecv() (*emptypb.Empty, error) {
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
m := new(emptypb.Empty)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// SchedulerServer is the server API for Scheduler service.
// All implementations should embed UnimplementedSchedulerServer
// for forward compatibility
@ -163,6 +232,10 @@ type SchedulerServer interface {
AnnounceHost(context.Context, *AnnounceHostRequest) (*emptypb.Empty, error)
// LeaveHost makes the peers leaving from host.
LeaveHost(context.Context, *LeaveHostRequest) (*emptypb.Empty, error)
// SyncProbes sync probes of the host.
SyncProbes(Scheduler_SyncProbesServer) error
// SyncNetworkTopology sync network topology of the hosts.
SyncNetworkTopology(Scheduler_SyncNetworkTopologyServer) error
}
// UnimplementedSchedulerServer should be embedded to have forward compatible implementations.
@ -193,6 +266,12 @@ func (UnimplementedSchedulerServer) AnnounceHost(context.Context, *AnnounceHostR
func (UnimplementedSchedulerServer) LeaveHost(context.Context, *LeaveHostRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method LeaveHost not implemented")
}
func (UnimplementedSchedulerServer) SyncProbes(Scheduler_SyncProbesServer) error {
return status.Errorf(codes.Unimplemented, "method SyncProbes not implemented")
}
func (UnimplementedSchedulerServer) SyncNetworkTopology(Scheduler_SyncNetworkTopologyServer) error {
return status.Errorf(codes.Unimplemented, "method SyncNetworkTopology not implemented")
}
// UnsafeSchedulerServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SchedulerServer will
@ -357,6 +436,58 @@ func _Scheduler_LeaveHost_Handler(srv interface{}, ctx context.Context, dec func
return interceptor(ctx, in, info, handler)
}
func _Scheduler_SyncProbes_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(SchedulerServer).SyncProbes(&schedulerSyncProbesServer{stream})
}
type Scheduler_SyncProbesServer interface {
Send(*SyncProbesResponse) error
Recv() (*SyncProbesRequest, error)
grpc.ServerStream
}
type schedulerSyncProbesServer struct {
grpc.ServerStream
}
func (x *schedulerSyncProbesServer) Send(m *SyncProbesResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *schedulerSyncProbesServer) Recv() (*SyncProbesRequest, error) {
m := new(SyncProbesRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func _Scheduler_SyncNetworkTopology_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(SchedulerServer).SyncNetworkTopology(&schedulerSyncNetworkTopologyServer{stream})
}
type Scheduler_SyncNetworkTopologyServer interface {
SendAndClose(*emptypb.Empty) error
Recv() (*SyncNetworkTopologyRequest, error)
grpc.ServerStream
}
type schedulerSyncNetworkTopologyServer struct {
grpc.ServerStream
}
func (x *schedulerSyncNetworkTopologyServer) SendAndClose(m *emptypb.Empty) error {
return x.ServerStream.SendMsg(m)
}
func (x *schedulerSyncNetworkTopologyServer) Recv() (*SyncNetworkTopologyRequest, error) {
m := new(SyncNetworkTopologyRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// Scheduler_ServiceDesc is the grpc.ServiceDesc for Scheduler service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@ -400,6 +531,17 @@ var Scheduler_ServiceDesc = grpc.ServiceDesc{
ServerStreams: true,
ClientStreams: true,
},
{
StreamName: "SyncProbes",
Handler: _Scheduler_SyncProbes_Handler,
ServerStreams: true,
ClientStreams: true,
},
{
StreamName: "SyncNetworkTopology",
Handler: _Scheduler_SyncNetworkTopology_Handler,
ClientStreams: true,
},
},
Metadata: "pkg/apis/scheduler/v1/scheduler.proto",
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -23,8 +23,9 @@ import "pkg/apis/errordetails/v2/errordetails.proto";
import "validate/validate.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
option go_package = "d7y.io/api/v2/pkg/apis/scheduler/v2;scheduler";
option go_package = "d7y.io/api/pkg/apis/scheduler/v2;scheduler";
// RegisterPeerRequest represents peer registered request of AnnouncePeerRequest.
message RegisterPeerRequest {
@ -38,45 +39,24 @@ message DownloadPeerStartedRequest {
// DownloadPeerBackToSourceStartedRequest represents peer download back-to-source started request of AnnouncePeerRequest.
message DownloadPeerBackToSourceStartedRequest {
// The description of the back-to-source reason.
optional string description = 1 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
}
// ReschedulePeerRequest represents reschedule request of AnnouncePeerRequest.
message ReschedulePeerRequest {
// Candidate parent ids.
repeated common.v2.Peer candidate_parents = 1;
// The description of the reschedule reason.
optional string description = 2 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Download back-to-source reason.
string reason = 1 [(validate.rules).string.min_len = 1];
}
// DownloadPeerFinishedRequest represents peer download finished request of AnnouncePeerRequest.
message DownloadPeerFinishedRequest {
// Total content length.
uint64 content_length = 1;
int64 content_length = 1 [(validate.rules).int64.gte = 0];
// Total piece count.
uint32 piece_count = 2;
int64 piece_count = 2 [(validate.rules).int64.gte = 0];
}
// DownloadPeerBackToSourceFinishedRequest represents peer download back-to-source finished request of AnnouncePeerRequest.
message DownloadPeerBackToSourceFinishedRequest {
// Total content length.
uint64 content_length = 1;
int64 content_length = 1 [(validate.rules).int64.gte = 0];
// Total piece count.
uint32 piece_count = 2;
}
// DownloadPeerFailedRequest represents peer download failed request of AnnouncePeerRequest.
message DownloadPeerFailedRequest {
// The description of the download failed.
optional string description = 1 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
}
// DownloadPeerBackToSourceFailedRequest represents peer download back-to-source failed request of AnnouncePeerRequest.
message DownloadPeerBackToSourceFailedRequest {
// The description of the download back-to-source failed.
optional string description = 1 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
int64 piece_count = 2 [(validate.rules).int64.gte = 0];
}
// DownloadPieceFinishedRequest represents piece download finished request of AnnouncePeerRequest.
@ -91,70 +71,56 @@ message DownloadPieceBackToSourceFinishedRequest {
common.v2.Piece piece = 1 [(validate.rules).message.required = true];
}
// DownloadPieceFailedRequest downloads piece failed request of AnnouncePeerRequest.
message DownloadPieceFailedRequest {
// Piece number.
optional uint32 piece_number = 1;
// Parent id.
string parent_id = 2 [(validate.rules).string.min_len = 1];
// Temporary indicates whether the error is temporary.
bool temporary = 3;
}
// DownloadPieceBackToSourceFailedRequest downloads piece back-to-source failed request of AnnouncePeerRequest.
message DownloadPieceBackToSourceFailedRequest {
// Piece number.
optional uint32 piece_number = 1;
oneof response {
option (validate.required) = true;
errordetails.v2.Backend backend = 2;
errordetails.v2.Unknown unknown = 3;
}
}
// AnnouncePeerRequest represents request of AnnouncePeer.
message AnnouncePeerRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
string task_id = 1 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 3 [(validate.rules).string.min_len = 1];
string peer_id = 2 [(validate.rules).string.min_len = 1];
oneof request {
option (validate.required) = true;
RegisterPeerRequest register_peer_request = 4;
DownloadPeerStartedRequest download_peer_started_request = 5;
DownloadPeerBackToSourceStartedRequest download_peer_back_to_source_started_request = 6;
ReschedulePeerRequest reschedule_peer_request = 7;
DownloadPeerFinishedRequest download_peer_finished_request = 8;
DownloadPeerBackToSourceFinishedRequest download_peer_back_to_source_finished_request = 9;
DownloadPeerFailedRequest download_peer_failed_request = 10;
DownloadPeerBackToSourceFailedRequest download_peer_back_to_source_failed_request = 11;
DownloadPieceFinishedRequest download_piece_finished_request = 12;
DownloadPieceBackToSourceFinishedRequest download_piece_back_to_source_finished_request = 13;
DownloadPieceFailedRequest download_piece_failed_request = 14;
DownloadPieceBackToSourceFailedRequest download_piece_back_to_source_failed_request = 15;
RegisterPeerRequest register_peer_request = 3;
DownloadPeerStartedRequest download_peer_started_request = 4;
DownloadPeerBackToSourceStartedRequest download_peer_back_to_source_started_request = 5;
DownloadPeerFinishedRequest download_peer_finished_request = 6;
DownloadPeerBackToSourceFinishedRequest download_peer_back_to_source_finished_request = 7;
DownloadPieceFinishedRequest download_piece_finished_request = 8;
DownloadPieceBackToSourceFinishedRequest download_piece_back_to_source_finished_request = 9;
}
oneof errordetails {
errordetails.v2.DownloadPeerBackToSourceFailed download_peer_back_to_source_failed = 10;
errordetails.v2.DownloadPieceBackToSourceFailed download_piece_back_to_source_failed = 11;
errordetails.v2.SyncPiecesFailed sync_pieces_failed = 12;
errordetails.v2.DownloadPieceFailed download_piece_failed = 13;
}
}
// EmptyTaskResponse represents empty task response of AnnouncePeerResponse.
message EmptyTaskResponse {
// TinyTaskResponse represents tiny task response of AnnouncePeerResponse.
message TinyTaskResponse {
bytes data = 1 [(validate.rules).bytes.min_len = 1];
}
// SmallTaskResponse represents small task response of AnnouncePeerResponse.
message SmallTaskResponse {
// Piece info.
common.v2.Piece piece = 1 [(validate.rules).message.required = true];
}
// NormalTaskResponse represents normal task response of AnnouncePeerResponse.
message NormalTaskResponse {
// Candidate parents.
repeated common.v2.Peer candidate_parents = 1 [(validate.rules).repeated.min_items = 1];
repeated common.v2.Peer candidate_parents = 1 [(validate.rules).repeated = {min_items: 1}];
// Concurrent downloading piece count from the peers.
int32 concurrent_piece_count = 2 [(validate.rules).int32.gte = 1];
}
// NeedBackToSourceResponse represents need back-to-source response of AnnouncePeerResponse.
message NeedBackToSourceResponse {
// The description of the back-to-source reason.
optional string description = 1 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Download back-to-source reason.
string reason = 1 [(validate.rules).string.min_len = 1];
}
// AnnouncePeerResponse represents response of AnnouncePeer.
@ -162,282 +128,278 @@ message AnnouncePeerResponse {
oneof response {
option (validate.required) = true;
EmptyTaskResponse empty_task_response = 1;
NormalTaskResponse normal_task_response = 2;
NeedBackToSourceResponse need_back_to_source_response = 3;
TinyTaskResponse tiny_task_response = 1;
SmallTaskResponse small_task_response = 2;
NormalTaskResponse normal_task_response = 3;
NeedBackToSourceResponse need_back_to_source_response = 4;
}
oneof errordetails {
errordetails.v2.SchedulePeerForbidden schedule_peer_forbidden = 5;
errordetails.v2.SchedulePeerFailed schedule_peer_failed = 6;
}
}
// StatPeerRequest represents request of StatPeer.
message StatPeerRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
string task_id = 1 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 3 [(validate.rules).string.min_len = 1];
string peer_id = 2 [(validate.rules).string.min_len = 1];
}
// DeletePeerRequest represents request of DeletePeer.
message DeletePeerRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// TODO exchange peer request definition.
// ExchangePeerRequest represents request of ExchangePeer.
message ExchangePeerRequest {
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
string task_id = 1 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 3 [(validate.rules).string.min_len = 1];
string peer_id = 2 [(validate.rules).string.min_len = 1];
}
// TODO exchange peer response definition.
// ExchangePeerResponse represents response of ExchangePeer.
message ExchangePeerResponse {
}
// LeavePeerRequest represents request of LeavePeer.
message LeavePeerRequest {
// Task id.
string task_id = 1 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 2 [(validate.rules).string.min_len = 1];
}
// StatTaskRequest represents request of StatTask.
message StatTaskRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
}
// DeleteTaskRequest represents request of DeleteTask.
message DeleteTaskRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
string id = 1 [(validate.rules).string.min_len = 1];
}
// AnnounceHostRequest represents request of AnnounceHost.
message AnnounceHostRequest {
// Host info.
// Host id.
string id = 1 [(validate.rules).string.min_len = 1];
// Host type.
uint32 type = 2 [(validate.rules).uint32.lte = 3];
// Hostname.
string hostname = 3 [(validate.rules).string.min_len = 1];
// Host ip.
string ip = 4 [(validate.rules).string.ip = true];
// Port of grpc service.
int32 port = 5 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
// Port of download server.
int32 download_port = 6 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
// Host OS.
string os = 7;
// Host platform.
string platform = 8;
// Host platform family.
string platform_family = 9;
// Host platform version.
string platform_version = 10;
// Host kernel version.
string kernel_version = 11;
// CPU Stat.
CPU cpu = 12 [(validate.rules).message.required = true];
// Memory Stat.
Memory memory = 13 [(validate.rules).message.required = true];
// Network Stat.
Network network = 14 [(validate.rules).message.required = true];
// Disk Stat.
Disk disk = 15 [(validate.rules).message.required = true];
// Build information.
Build build = 16 [(validate.rules).message.required = true];
}
// CPU Stat.
message CPU {
// Number of logical cores in the system.
uint32 logical_count = 1;
// Number of physical cores in the system
uint32 physical_count = 2;
// Percent calculates the percentage of cpu used.
double percent = 3 [(validate.rules).double = {gte: 0, lte: 100}];
// Calculates the percentage of cpu used by process.
double process_percent = 4 [(validate.rules).double = {gte: 0, lte: 100}];
// CPUTimes contains the amounts of time the CPU has spent performing different kinds of work.
CPUTimes times = 5 [(validate.rules).message.required = true];
}
// CPUTimes contains the amounts of time the CPU has spent performing different
// kinds of work. Time units are in seconds.
message CPUTimes {
// CPU time of user.
double user = 1 [(validate.rules).double.gte = 0];
// CPU time of system.
double system = 2 [(validate.rules).double.gte = 0];
// CPU time of idle.
double idle = 3 [(validate.rules).double.gte = 0];
// CPU time of nice.
double nice = 4 [(validate.rules).double.gte = 0];
// CPU time of iowait.
double iowait = 5 [(validate.rules).double.gte = 0];
// CPU time of irq.
double irq = 6 [(validate.rules).double.gte = 0];
// CPU time of softirq.
double softirq = 7 [(validate.rules).double.gte = 0];
// CPU time of steal.
double steal = 8 [(validate.rules).double.gte = 0];
// CPU time of guest.
double guest = 9 [(validate.rules).double.gte = 0];
// CPU time of guest nice.
double guest_nice = 10 [(validate.rules).double.gte = 0];
}
// Memory Stat.
message Memory {
// Total amount of RAM on this system.
uint64 total = 1;
// RAM available for programs to allocate.
uint64 available = 2;
// RAM used by programs.
uint64 used = 3;
// Percentage of RAM used by programs.
double used_percent = 4 [(validate.rules).double = {gte: 0, lte: 100}];
// Calculates the percentage of memory used by process.
double process_used_percent = 5 [(validate.rules).double = {gte: 0, lte: 100}];
// This is the kernel's notion of free memory.
uint64 free = 6;
}
// Network Stat.
message Network {
// Return count of tcp connections opened and status is ESTABLISHED.
uint32 tcp_connection_count = 1;
// Return count of upload tcp connections opened and status is ESTABLISHED.
uint32 upload_tcp_connection_count = 2;
// Security domain for network.
string security_domain = 3;
// Location path(area|country|province|city|...).
string location = 4;
// IDC where the peer host is located
string idc = 5;
}
// Disk Stat.
message Disk {
// Total amount of disk on the data path of dragonfly.
uint64 total = 1;
// Free amount of disk on the data path of dragonfly.
uint64 free = 2;
// Used amount of disk on the data path of dragonfly.
uint64 used = 3;
// Used percent of disk on the data path of dragonfly directory.
double used_percent = 4 [(validate.rules).double = {gte: 0, lte: 100}];
// Total amount of indoes on the data path of dragonfly directory.
uint64 inodes_total = 5;
// Used amount of indoes on the data path of dragonfly directory.
uint64 inodes_used = 6;
// Free amount of indoes on the data path of dragonfly directory.
uint64 inodes_free = 7;
// Used percent of indoes on the data path of dragonfly directory.
double inodes_used_percent = 8 [(validate.rules).double = {gte: 0, lte: 100}];
}
// Build information.
message Build {
// Git version.
string git_version = 1;
// Git commit.
string git_commit = 2;
// Golang version.
string go_version = 3;
// Build platform.
string platform = 4;
}
// LeaveHostRequest represents request of LeaveHost.
message LeaveHostRequest{
// Host id.
string id = 1 [(validate.rules).string.min_len = 1];
}
// Probe information.
message Probe {
// Host metadata.
common.v2.Host host = 1 [(validate.rules).message.required = true];
// The interval between dfdaemon announces to scheduler.
optional google.protobuf.Duration interval = 2;
// RTT is the round-trip time sent via this pinger.
google.protobuf.Duration rtt = 2 [(validate.rules).duration.required = true];
// Task update time.
google.protobuf.Timestamp updated_at = 3 [(validate.rules).timestamp.required = true];
}
// ListHostsResponse represents response of ListHosts.
message ListHostsResponse {
// Hosts info.
repeated common.v2.Host hosts = 1;
// ProbesOfHost represents probes information of the host.
message ProbesOfHost {
// Host metadata.
common.v2.Host host = 1 [(validate.rules).message.required = true];
// Probes information.
repeated Probe probes = 2 [(validate.rules).repeated = {min_items: 1, ignore_empty: true}];
}
// DeleteHostRequest represents request of DeleteHost.
message DeleteHostRequest{
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// SyncProbesRequest represents request of SyncProbes.
message SyncProbesRequest {
// Probes information of the host.
ProbesOfHost probes_of_host = 1 [(validate.rules).message.required = true];
}
// RegisterPersistentCachePeerRequest represents persistent cache peer registered request of AnnouncePersistentCachePeerRequest.
message RegisterPersistentCachePeerRequest {
// Persistent represents whether the persistent cache task is persistent.
// If the persistent cache task is persistent, the persistent cache peer will
// not be deleted when dfdaemon runs garbage collection.
bool persistent = 1;
// Tag is used to distinguish different persistent cache tasks.
optional string tag = 2;
// Application of task.
optional string application = 3;
// Task piece length, the value needs to be greater than or equal to 4194304(4MiB)
uint64 piece_length = 4 [(validate.rules).uint64.gte = 4194304];
// File path to be exported.
optional string output_path = 5 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Download timeout.
optional google.protobuf.Duration timeout = 6;
// SyncProbesResponse represents response of SyncProbes.
message SyncProbesResponse {
// Hosts needs to be probed.
repeated common.v2.Host hosts = 1 [(validate.rules).repeated = {min_items: 1, ignore_empty: true}];
// Probe interval.
google.protobuf.Duration probe_interval = 2 [(validate.rules).duration.required = true];
}
// DownloadPersistentCachePeerStartedRequest represents persistent cache peer download started request of AnnouncePersistentCachePeerRequest.
message DownloadPersistentCachePeerStartedRequest {
// UpdateHostsRequest represents update hosts request of SyncNetworkTopologyRequest.
message UpdateHostsRequest {
// Hosts needs to be updated.
repeated ProbesOfHost probes_of_hosts = 1 [(validate.rules).repeated = {min_items: 1}];
}
// ReschedulePersistentCachePeerRequest represents reschedule request of AnnouncePersistentCachePeerRequest.
message ReschedulePersistentCachePeerRequest {
// Candidate parent ids.
repeated common.v2.PersistentCachePeer candidate_parents = 1;
// The description of the reschedule reason.
optional string description = 2 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// DeleteHostsRequest represents delete hosts request of SyncNetworkTopologyRequest.
message DeleteHostsRequest {
// Hosts needs to be deleted.
repeated ProbesOfHost probes_of_hosts = 1 [(validate.rules).repeated = {min_items: 1}];
}
// DownloadPersistentCachePeerFinishedRequest represents persistent cache peer download finished request of AnnouncePersistentCachePeerRequest.
message DownloadPersistentCachePeerFinishedRequest {
// Total piece count.
uint32 piece_count = 1;
}
// DownloadPersistentCachePeerFailedRequest represents persistent cache peer download failed request of AnnouncePersistentCachePeerRequest.
message DownloadPersistentCachePeerFailedRequest {
// The description of the download failed.
optional string description = 1 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
}
// AnnouncePersistentCachePeerRequest represents request of AnnouncePersistentCachePeer.
message AnnouncePersistentCachePeerRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 3 [(validate.rules).string.min_len = 1];
// SyncProbesRequest represents request of SyncProbes.
message SyncNetworkTopologyRequest {
oneof request {
option (validate.required) = true;
RegisterPersistentCachePeerRequest register_persistent_cache_peer_request = 4;
DownloadPersistentCachePeerStartedRequest download_persistent_cache_peer_started_request = 5;
ReschedulePersistentCachePeerRequest reschedule_persistent_cache_peer_request = 6;
DownloadPersistentCachePeerFinishedRequest download_persistent_cache_peer_finished_request = 7;
DownloadPersistentCachePeerFailedRequest download_persistent_cache_peer_failed_request = 8;
DownloadPieceFinishedRequest download_piece_finished_request = 9;
DownloadPieceFailedRequest download_piece_failed_request = 10;
UpdateHostsRequest update_probes_of_hosts_request = 1;
DeleteHostsRequest delete_probes_of_hosts_request = 2;
}
}
// EmptyPersistentCacheTaskResponse represents empty persistent cache task response of AnnouncePersistentCachePeerResponse.
message EmptyPersistentCacheTaskResponse {
}
// NormalPersistentCacheTaskResponse represents normal persistent cache task response of AnnouncePersistentCachePeerResponse.
message NormalPersistentCacheTaskResponse {
// Candidate parents.
repeated common.v2.PersistentCachePeer candidate_parents = 1 [(validate.rules).repeated.min_items = 1];
}
// AnnouncePersistentCachePeerResponse represents response of AnnouncePersistentCachePeer.
message AnnouncePersistentCachePeerResponse {
oneof response {
option (validate.required) = true;
EmptyPersistentCacheTaskResponse empty_persistent_cache_task_response = 1;
NormalPersistentCacheTaskResponse normal_persistent_cache_task_response = 2;
}
}
// StatPersistentCachePeerRequest represents request of StatPersistentCachePeer.
message StatPersistentCachePeerRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 3 [(validate.rules).string.min_len = 1];
}
// DeletePersistentCachePeerRequest represents request of DeletePersistentCachePeer.
message DeletePersistentCachePeerRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 3 [(validate.rules).string.min_len = 1];
}
// UploadPersistentCacheTaskStartedRequest represents upload persistent cache task started request of UploadPersistentCacheTaskStartedRequest.
message UploadPersistentCacheTaskStartedRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 3 [(validate.rules).string.min_len = 1];
// Replica count of the persistent cache task.
uint64 persistent_replica_count = 4 [(validate.rules).uint64.gte = 1];
// Tag is used to distinguish different persistent cache tasks.
optional string tag = 5;
// Application of task.
optional string application = 6;
// Task piece length, the value needs to be greater than or equal to 4194304(4MiB)
uint64 piece_length = 7 [(validate.rules).uint64.gte = 4194304];
// Task content length.
uint64 content_length = 8;
// Task piece count.
uint32 piece_count = 9;
// TTL of the persistent cache task.
google.protobuf.Duration ttl = 10 [(validate.rules).duration = {gte:{seconds: 300}, lte:{seconds: 604800}}];
}
// UploadPersistentCacheTaskFinishedRequest represents upload persistent cache task finished request of UploadPersistentCacheTaskFinishedRequest.
message UploadPersistentCacheTaskFinishedRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 3 [(validate.rules).string.min_len = 1];
}
// UploadPersistentCacheTaskFailedRequest represents upload persistent cache task failed request of UploadPersistentCacheTaskFailedRequest.
message UploadPersistentCacheTaskFailedRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 3 [(validate.rules).string.min_len = 1];
// The description of the upload failed.
optional string description = 4 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
}
// StatPersistentCacheTaskRequest represents request of StatPersistentCacheTask.
message StatPersistentCacheTaskRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
}
// DeletePersistentCacheTaskRequest represents request of DeletePersistentCacheTask.
message DeletePersistentCacheTaskRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
}
// Scheduler RPC Service.
service Scheduler {
service Scheduler{
// AnnouncePeer announces peer to scheduler.
rpc AnnouncePeer(stream AnnouncePeerRequest) returns(stream AnnouncePeerResponse);
// Checks information of peer.
rpc StatPeer(StatPeerRequest)returns(common.v2.Peer);
// DeletePeer releases peer in scheduler.
rpc DeletePeer(DeletePeerRequest)returns(google.protobuf.Empty);
// LeavePeer releases peer in scheduler.
rpc LeavePeer(LeavePeerRequest)returns(google.protobuf.Empty);
// TODO exchange peer api definition.
// ExchangePeer exchanges peer information.
rpc ExchangePeer(ExchangePeerRequest)returns(ExchangePeerResponse);
// Checks information of task.
rpc StatTask(StatTaskRequest)returns(common.v2.Task);
// DeleteTask releases task in scheduler.
rpc DeleteTask(DeleteTaskRequest)returns(google.protobuf.Empty);
// AnnounceHost announces host to scheduler.
rpc AnnounceHost(AnnounceHostRequest)returns(google.protobuf.Empty);
// ListHosts lists hosts in scheduler.
rpc ListHosts(google.protobuf.Empty)returns(ListHostsResponse);
// LeaveHost releases host in scheduler.
rpc LeaveHost(LeaveHostRequest)returns(google.protobuf.Empty);
// DeleteHost releases host in scheduler.
rpc DeleteHost(DeleteHostRequest)returns(google.protobuf.Empty);
// SyncProbes sync probes of the host.
rpc SyncProbes(stream SyncProbesRequest)returns(stream SyncProbesResponse);
// AnnouncePersistentCachePeer announces persistent cache peer to scheduler.
rpc AnnouncePersistentCachePeer(stream AnnouncePersistentCachePeerRequest) returns(stream AnnouncePersistentCachePeerResponse);
// Checks information of persistent cache peer.
rpc StatPersistentCachePeer(StatPersistentCachePeerRequest)returns(common.v2.PersistentCachePeer);
// DeletePersistentCachePeer releases persistent cache peer in scheduler.
rpc DeletePersistentCachePeer(DeletePersistentCachePeerRequest)returns(google.protobuf.Empty);
// UploadPersistentCacheTaskStarted uploads persistent cache task started to scheduler.
rpc UploadPersistentCacheTaskStarted(UploadPersistentCacheTaskStartedRequest)returns(google.protobuf.Empty);
// UploadPersistentCacheTaskFinished uploads persistent cache task finished to scheduler.
rpc UploadPersistentCacheTaskFinished(UploadPersistentCacheTaskFinishedRequest)returns(common.v2.PersistentCacheTask);
// UploadPersistentCacheTaskFailed uploads persistent cache task failed to scheduler.
rpc UploadPersistentCacheTaskFailed(UploadPersistentCacheTaskFailedRequest)returns(google.protobuf.Empty);
// Checks information of persistent cache task.
rpc StatPersistentCacheTask(StatPersistentCacheTaskRequest)returns(common.v2.PersistentCacheTask);
// DeletePersistentCacheTask releases persistent cache task in scheduler.
rpc DeletePersistentCacheTask(DeletePersistentCacheTaskRequest)returns(google.protobuf.Empty);
// SyncNetworkTopology sync network topology of the hosts.
rpc SyncNetworkTopology(stream SyncNetworkTopologyRequest)returns(google.protobuf.Empty);
}

View File

@ -8,7 +8,7 @@ package scheduler
import (
context "context"
v2 "d7y.io/api/v2/pkg/apis/common/v2"
v2 "d7y.io/api/pkg/apis/common/v2"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
@ -28,34 +28,21 @@ type SchedulerClient interface {
AnnouncePeer(ctx context.Context, opts ...grpc.CallOption) (Scheduler_AnnouncePeerClient, error)
// Checks information of peer.
StatPeer(ctx context.Context, in *StatPeerRequest, opts ...grpc.CallOption) (*v2.Peer, error)
// DeletePeer releases peer in scheduler.
DeletePeer(ctx context.Context, in *DeletePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// LeavePeer releases peer in scheduler.
LeavePeer(ctx context.Context, in *LeavePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// TODO exchange peer api definition.
// ExchangePeer exchanges peer information.
ExchangePeer(ctx context.Context, in *ExchangePeerRequest, opts ...grpc.CallOption) (*ExchangePeerResponse, error)
// Checks information of task.
StatTask(ctx context.Context, in *StatTaskRequest, opts ...grpc.CallOption) (*v2.Task, error)
// DeleteTask releases task in scheduler.
DeleteTask(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// AnnounceHost announces host to scheduler.
AnnounceHost(ctx context.Context, in *AnnounceHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// ListHosts lists hosts in scheduler.
ListHosts(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListHostsResponse, error)
// DeleteHost releases host in scheduler.
DeleteHost(ctx context.Context, in *DeleteHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// AnnouncePersistentCachePeer announces persistent cache peer to scheduler.
AnnouncePersistentCachePeer(ctx context.Context, opts ...grpc.CallOption) (Scheduler_AnnouncePersistentCachePeerClient, error)
// Checks information of persistent cache peer.
StatPersistentCachePeer(ctx context.Context, in *StatPersistentCachePeerRequest, opts ...grpc.CallOption) (*v2.PersistentCachePeer, error)
// DeletePersistentCachePeer releases persistent cache peer in scheduler.
DeletePersistentCachePeer(ctx context.Context, in *DeletePersistentCachePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// UploadPersistentCacheTaskStarted uploads persistent cache task started to scheduler.
UploadPersistentCacheTaskStarted(ctx context.Context, in *UploadPersistentCacheTaskStartedRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// UploadPersistentCacheTaskFinished uploads persistent cache task finished to scheduler.
UploadPersistentCacheTaskFinished(ctx context.Context, in *UploadPersistentCacheTaskFinishedRequest, opts ...grpc.CallOption) (*v2.PersistentCacheTask, error)
// UploadPersistentCacheTaskFailed uploads persistent cache task failed to scheduler.
UploadPersistentCacheTaskFailed(ctx context.Context, in *UploadPersistentCacheTaskFailedRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// Checks information of persistent cache task.
StatPersistentCacheTask(ctx context.Context, in *StatPersistentCacheTaskRequest, opts ...grpc.CallOption) (*v2.PersistentCacheTask, error)
// DeletePersistentCacheTask releases persistent cache task in scheduler.
DeletePersistentCacheTask(ctx context.Context, in *DeletePersistentCacheTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// LeaveHost releases host in scheduler.
LeaveHost(ctx context.Context, in *LeaveHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// SyncProbes sync probes of the host.
SyncProbes(ctx context.Context, opts ...grpc.CallOption) (Scheduler_SyncProbesClient, error)
// SyncNetworkTopology sync network topology of the hosts.
SyncNetworkTopology(ctx context.Context, opts ...grpc.CallOption) (Scheduler_SyncNetworkTopologyClient, error)
}
type schedulerClient struct {
@ -106,9 +93,18 @@ func (c *schedulerClient) StatPeer(ctx context.Context, in *StatPeerRequest, opt
return out, nil
}
func (c *schedulerClient) DeletePeer(ctx context.Context, in *DeletePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
func (c *schedulerClient) LeavePeer(ctx context.Context, in *LeavePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/DeletePeer", in, out, opts...)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/LeavePeer", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *schedulerClient) ExchangePeer(ctx context.Context, in *ExchangePeerRequest, opts ...grpc.CallOption) (*ExchangePeerResponse, error) {
out := new(ExchangePeerResponse)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/ExchangePeer", in, out, opts...)
if err != nil {
return nil, err
}
@ -124,15 +120,6 @@ func (c *schedulerClient) StatTask(ctx context.Context, in *StatTaskRequest, opt
return out, nil
}
func (c *schedulerClient) DeleteTask(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/DeleteTask", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *schedulerClient) AnnounceHost(ctx context.Context, in *AnnounceHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/AnnounceHost", in, out, opts...)
@ -142,116 +129,78 @@ func (c *schedulerClient) AnnounceHost(ctx context.Context, in *AnnounceHostRequ
return out, nil
}
func (c *schedulerClient) ListHosts(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListHostsResponse, error) {
out := new(ListHostsResponse)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/ListHosts", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *schedulerClient) DeleteHost(ctx context.Context, in *DeleteHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
func (c *schedulerClient) LeaveHost(ctx context.Context, in *LeaveHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/DeleteHost", in, out, opts...)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/LeaveHost", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *schedulerClient) AnnouncePersistentCachePeer(ctx context.Context, opts ...grpc.CallOption) (Scheduler_AnnouncePersistentCachePeerClient, error) {
stream, err := c.cc.NewStream(ctx, &Scheduler_ServiceDesc.Streams[1], "/scheduler.v2.Scheduler/AnnouncePersistentCachePeer", opts...)
func (c *schedulerClient) SyncProbes(ctx context.Context, opts ...grpc.CallOption) (Scheduler_SyncProbesClient, error) {
stream, err := c.cc.NewStream(ctx, &Scheduler_ServiceDesc.Streams[1], "/scheduler.v2.Scheduler/SyncProbes", opts...)
if err != nil {
return nil, err
}
x := &schedulerAnnouncePersistentCachePeerClient{stream}
x := &schedulerSyncProbesClient{stream}
return x, nil
}
type Scheduler_AnnouncePersistentCachePeerClient interface {
Send(*AnnouncePersistentCachePeerRequest) error
Recv() (*AnnouncePersistentCachePeerResponse, error)
type Scheduler_SyncProbesClient interface {
Send(*SyncProbesRequest) error
Recv() (*SyncProbesResponse, error)
grpc.ClientStream
}
type schedulerAnnouncePersistentCachePeerClient struct {
type schedulerSyncProbesClient struct {
grpc.ClientStream
}
func (x *schedulerAnnouncePersistentCachePeerClient) Send(m *AnnouncePersistentCachePeerRequest) error {
func (x *schedulerSyncProbesClient) Send(m *SyncProbesRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *schedulerAnnouncePersistentCachePeerClient) Recv() (*AnnouncePersistentCachePeerResponse, error) {
m := new(AnnouncePersistentCachePeerResponse)
func (x *schedulerSyncProbesClient) Recv() (*SyncProbesResponse, error) {
m := new(SyncProbesResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *schedulerClient) StatPersistentCachePeer(ctx context.Context, in *StatPersistentCachePeerRequest, opts ...grpc.CallOption) (*v2.PersistentCachePeer, error) {
out := new(v2.PersistentCachePeer)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/StatPersistentCachePeer", in, out, opts...)
func (c *schedulerClient) SyncNetworkTopology(ctx context.Context, opts ...grpc.CallOption) (Scheduler_SyncNetworkTopologyClient, error) {
stream, err := c.cc.NewStream(ctx, &Scheduler_ServiceDesc.Streams[2], "/scheduler.v2.Scheduler/SyncNetworkTopology", opts...)
if err != nil {
return nil, err
}
return out, nil
x := &schedulerSyncNetworkTopologyClient{stream}
return x, nil
}
func (c *schedulerClient) DeletePersistentCachePeer(ctx context.Context, in *DeletePersistentCachePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/DeletePersistentCachePeer", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
type Scheduler_SyncNetworkTopologyClient interface {
Send(*SyncNetworkTopologyRequest) error
CloseAndRecv() (*emptypb.Empty, error)
grpc.ClientStream
}
func (c *schedulerClient) UploadPersistentCacheTaskStarted(ctx context.Context, in *UploadPersistentCacheTaskStartedRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/UploadPersistentCacheTaskStarted", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
type schedulerSyncNetworkTopologyClient struct {
grpc.ClientStream
}
func (c *schedulerClient) UploadPersistentCacheTaskFinished(ctx context.Context, in *UploadPersistentCacheTaskFinishedRequest, opts ...grpc.CallOption) (*v2.PersistentCacheTask, error) {
out := new(v2.PersistentCacheTask)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/UploadPersistentCacheTaskFinished", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
func (x *schedulerSyncNetworkTopologyClient) Send(m *SyncNetworkTopologyRequest) error {
return x.ClientStream.SendMsg(m)
}
func (c *schedulerClient) UploadPersistentCacheTaskFailed(ctx context.Context, in *UploadPersistentCacheTaskFailedRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/UploadPersistentCacheTaskFailed", in, out, opts...)
if err != nil {
func (x *schedulerSyncNetworkTopologyClient) CloseAndRecv() (*emptypb.Empty, error) {
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return out, nil
}
func (c *schedulerClient) StatPersistentCacheTask(ctx context.Context, in *StatPersistentCacheTaskRequest, opts ...grpc.CallOption) (*v2.PersistentCacheTask, error) {
out := new(v2.PersistentCacheTask)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/StatPersistentCacheTask", in, out, opts...)
if err != nil {
m := new(emptypb.Empty)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return out, nil
}
func (c *schedulerClient) DeletePersistentCacheTask(ctx context.Context, in *DeletePersistentCacheTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/DeletePersistentCacheTask", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
return m, nil
}
// SchedulerServer is the server API for Scheduler service.
@ -262,34 +211,21 @@ type SchedulerServer interface {
AnnouncePeer(Scheduler_AnnouncePeerServer) error
// Checks information of peer.
StatPeer(context.Context, *StatPeerRequest) (*v2.Peer, error)
// DeletePeer releases peer in scheduler.
DeletePeer(context.Context, *DeletePeerRequest) (*emptypb.Empty, error)
// LeavePeer releases peer in scheduler.
LeavePeer(context.Context, *LeavePeerRequest) (*emptypb.Empty, error)
// TODO exchange peer api definition.
// ExchangePeer exchanges peer information.
ExchangePeer(context.Context, *ExchangePeerRequest) (*ExchangePeerResponse, error)
// Checks information of task.
StatTask(context.Context, *StatTaskRequest) (*v2.Task, error)
// DeleteTask releases task in scheduler.
DeleteTask(context.Context, *DeleteTaskRequest) (*emptypb.Empty, error)
// AnnounceHost announces host to scheduler.
AnnounceHost(context.Context, *AnnounceHostRequest) (*emptypb.Empty, error)
// ListHosts lists hosts in scheduler.
ListHosts(context.Context, *emptypb.Empty) (*ListHostsResponse, error)
// DeleteHost releases host in scheduler.
DeleteHost(context.Context, *DeleteHostRequest) (*emptypb.Empty, error)
// AnnouncePersistentCachePeer announces persistent cache peer to scheduler.
AnnouncePersistentCachePeer(Scheduler_AnnouncePersistentCachePeerServer) error
// Checks information of persistent cache peer.
StatPersistentCachePeer(context.Context, *StatPersistentCachePeerRequest) (*v2.PersistentCachePeer, error)
// DeletePersistentCachePeer releases persistent cache peer in scheduler.
DeletePersistentCachePeer(context.Context, *DeletePersistentCachePeerRequest) (*emptypb.Empty, error)
// UploadPersistentCacheTaskStarted uploads persistent cache task started to scheduler.
UploadPersistentCacheTaskStarted(context.Context, *UploadPersistentCacheTaskStartedRequest) (*emptypb.Empty, error)
// UploadPersistentCacheTaskFinished uploads persistent cache task finished to scheduler.
UploadPersistentCacheTaskFinished(context.Context, *UploadPersistentCacheTaskFinishedRequest) (*v2.PersistentCacheTask, error)
// UploadPersistentCacheTaskFailed uploads persistent cache task failed to scheduler.
UploadPersistentCacheTaskFailed(context.Context, *UploadPersistentCacheTaskFailedRequest) (*emptypb.Empty, error)
// Checks information of persistent cache task.
StatPersistentCacheTask(context.Context, *StatPersistentCacheTaskRequest) (*v2.PersistentCacheTask, error)
// DeletePersistentCacheTask releases persistent cache task in scheduler.
DeletePersistentCacheTask(context.Context, *DeletePersistentCacheTaskRequest) (*emptypb.Empty, error)
// LeaveHost releases host in scheduler.
LeaveHost(context.Context, *LeaveHostRequest) (*emptypb.Empty, error)
// SyncProbes sync probes of the host.
SyncProbes(Scheduler_SyncProbesServer) error
// SyncNetworkTopology sync network topology of the hosts.
SyncNetworkTopology(Scheduler_SyncNetworkTopologyServer) error
}
// UnimplementedSchedulerServer should be embedded to have forward compatible implementations.
@ -302,47 +238,26 @@ func (UnimplementedSchedulerServer) AnnouncePeer(Scheduler_AnnouncePeerServer) e
func (UnimplementedSchedulerServer) StatPeer(context.Context, *StatPeerRequest) (*v2.Peer, error) {
return nil, status.Errorf(codes.Unimplemented, "method StatPeer not implemented")
}
func (UnimplementedSchedulerServer) DeletePeer(context.Context, *DeletePeerRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeletePeer not implemented")
func (UnimplementedSchedulerServer) LeavePeer(context.Context, *LeavePeerRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method LeavePeer not implemented")
}
func (UnimplementedSchedulerServer) ExchangePeer(context.Context, *ExchangePeerRequest) (*ExchangePeerResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ExchangePeer not implemented")
}
func (UnimplementedSchedulerServer) StatTask(context.Context, *StatTaskRequest) (*v2.Task, error) {
return nil, status.Errorf(codes.Unimplemented, "method StatTask not implemented")
}
func (UnimplementedSchedulerServer) DeleteTask(context.Context, *DeleteTaskRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteTask not implemented")
}
func (UnimplementedSchedulerServer) AnnounceHost(context.Context, *AnnounceHostRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method AnnounceHost not implemented")
}
func (UnimplementedSchedulerServer) ListHosts(context.Context, *emptypb.Empty) (*ListHostsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListHosts not implemented")
func (UnimplementedSchedulerServer) LeaveHost(context.Context, *LeaveHostRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method LeaveHost not implemented")
}
func (UnimplementedSchedulerServer) DeleteHost(context.Context, *DeleteHostRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteHost not implemented")
func (UnimplementedSchedulerServer) SyncProbes(Scheduler_SyncProbesServer) error {
return status.Errorf(codes.Unimplemented, "method SyncProbes not implemented")
}
func (UnimplementedSchedulerServer) AnnouncePersistentCachePeer(Scheduler_AnnouncePersistentCachePeerServer) error {
return status.Errorf(codes.Unimplemented, "method AnnouncePersistentCachePeer not implemented")
}
func (UnimplementedSchedulerServer) StatPersistentCachePeer(context.Context, *StatPersistentCachePeerRequest) (*v2.PersistentCachePeer, error) {
return nil, status.Errorf(codes.Unimplemented, "method StatPersistentCachePeer not implemented")
}
func (UnimplementedSchedulerServer) DeletePersistentCachePeer(context.Context, *DeletePersistentCachePeerRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeletePersistentCachePeer not implemented")
}
func (UnimplementedSchedulerServer) UploadPersistentCacheTaskStarted(context.Context, *UploadPersistentCacheTaskStartedRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method UploadPersistentCacheTaskStarted not implemented")
}
func (UnimplementedSchedulerServer) UploadPersistentCacheTaskFinished(context.Context, *UploadPersistentCacheTaskFinishedRequest) (*v2.PersistentCacheTask, error) {
return nil, status.Errorf(codes.Unimplemented, "method UploadPersistentCacheTaskFinished not implemented")
}
func (UnimplementedSchedulerServer) UploadPersistentCacheTaskFailed(context.Context, *UploadPersistentCacheTaskFailedRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method UploadPersistentCacheTaskFailed not implemented")
}
func (UnimplementedSchedulerServer) StatPersistentCacheTask(context.Context, *StatPersistentCacheTaskRequest) (*v2.PersistentCacheTask, error) {
return nil, status.Errorf(codes.Unimplemented, "method StatPersistentCacheTask not implemented")
}
func (UnimplementedSchedulerServer) DeletePersistentCacheTask(context.Context, *DeletePersistentCacheTaskRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeletePersistentCacheTask not implemented")
func (UnimplementedSchedulerServer) SyncNetworkTopology(Scheduler_SyncNetworkTopologyServer) error {
return status.Errorf(codes.Unimplemented, "method SyncNetworkTopology not implemented")
}
// UnsafeSchedulerServer may be embedded to opt out of forward compatibility for this service.
@ -400,20 +315,38 @@ func _Scheduler_StatPeer_Handler(srv interface{}, ctx context.Context, dec func(
return interceptor(ctx, in, info, handler)
}
func _Scheduler_DeletePeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeletePeerRequest)
func _Scheduler_LeavePeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LeavePeerRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).DeletePeer(ctx, in)
return srv.(SchedulerServer).LeavePeer(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/DeletePeer",
FullMethod: "/scheduler.v2.Scheduler/LeavePeer",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).DeletePeer(ctx, req.(*DeletePeerRequest))
return srv.(SchedulerServer).LeavePeer(ctx, req.(*LeavePeerRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Scheduler_ExchangePeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ExchangePeerRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).ExchangePeer(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/ExchangePeer",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).ExchangePeer(ctx, req.(*ExchangePeerRequest))
}
return interceptor(ctx, in, info, handler)
}
@ -436,24 +369,6 @@ func _Scheduler_StatTask_Handler(srv interface{}, ctx context.Context, dec func(
return interceptor(ctx, in, info, handler)
}
func _Scheduler_DeleteTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteTaskRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).DeleteTask(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/DeleteTask",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).DeleteTask(ctx, req.(*DeleteTaskRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Scheduler_AnnounceHost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AnnounceHostRequest)
if err := dec(in); err != nil {
@ -472,192 +387,74 @@ func _Scheduler_AnnounceHost_Handler(srv interface{}, ctx context.Context, dec f
return interceptor(ctx, in, info, handler)
}
func _Scheduler_ListHosts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(emptypb.Empty)
func _Scheduler_LeaveHost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LeaveHostRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).ListHosts(ctx, in)
return srv.(SchedulerServer).LeaveHost(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/ListHosts",
FullMethod: "/scheduler.v2.Scheduler/LeaveHost",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).ListHosts(ctx, req.(*emptypb.Empty))
return srv.(SchedulerServer).LeaveHost(ctx, req.(*LeaveHostRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Scheduler_DeleteHost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteHostRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).DeleteHost(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/DeleteHost",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).DeleteHost(ctx, req.(*DeleteHostRequest))
}
return interceptor(ctx, in, info, handler)
func _Scheduler_SyncProbes_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(SchedulerServer).SyncProbes(&schedulerSyncProbesServer{stream})
}
func _Scheduler_AnnouncePersistentCachePeer_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(SchedulerServer).AnnouncePersistentCachePeer(&schedulerAnnouncePersistentCachePeerServer{stream})
}
type Scheduler_AnnouncePersistentCachePeerServer interface {
Send(*AnnouncePersistentCachePeerResponse) error
Recv() (*AnnouncePersistentCachePeerRequest, error)
type Scheduler_SyncProbesServer interface {
Send(*SyncProbesResponse) error
Recv() (*SyncProbesRequest, error)
grpc.ServerStream
}
type schedulerAnnouncePersistentCachePeerServer struct {
type schedulerSyncProbesServer struct {
grpc.ServerStream
}
func (x *schedulerAnnouncePersistentCachePeerServer) Send(m *AnnouncePersistentCachePeerResponse) error {
func (x *schedulerSyncProbesServer) Send(m *SyncProbesResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *schedulerAnnouncePersistentCachePeerServer) Recv() (*AnnouncePersistentCachePeerRequest, error) {
m := new(AnnouncePersistentCachePeerRequest)
func (x *schedulerSyncProbesServer) Recv() (*SyncProbesRequest, error) {
m := new(SyncProbesRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func _Scheduler_StatPersistentCachePeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StatPersistentCachePeerRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).StatPersistentCachePeer(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/StatPersistentCachePeer",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).StatPersistentCachePeer(ctx, req.(*StatPersistentCachePeerRequest))
}
return interceptor(ctx, in, info, handler)
func _Scheduler_SyncNetworkTopology_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(SchedulerServer).SyncNetworkTopology(&schedulerSyncNetworkTopologyServer{stream})
}
func _Scheduler_DeletePersistentCachePeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeletePersistentCachePeerRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).DeletePersistentCachePeer(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/DeletePersistentCachePeer",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).DeletePersistentCachePeer(ctx, req.(*DeletePersistentCachePeerRequest))
}
return interceptor(ctx, in, info, handler)
type Scheduler_SyncNetworkTopologyServer interface {
SendAndClose(*emptypb.Empty) error
Recv() (*SyncNetworkTopologyRequest, error)
grpc.ServerStream
}
func _Scheduler_UploadPersistentCacheTaskStarted_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UploadPersistentCacheTaskStartedRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).UploadPersistentCacheTaskStarted(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/UploadPersistentCacheTaskStarted",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).UploadPersistentCacheTaskStarted(ctx, req.(*UploadPersistentCacheTaskStartedRequest))
}
return interceptor(ctx, in, info, handler)
type schedulerSyncNetworkTopologyServer struct {
grpc.ServerStream
}
func _Scheduler_UploadPersistentCacheTaskFinished_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UploadPersistentCacheTaskFinishedRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).UploadPersistentCacheTaskFinished(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/UploadPersistentCacheTaskFinished",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).UploadPersistentCacheTaskFinished(ctx, req.(*UploadPersistentCacheTaskFinishedRequest))
}
return interceptor(ctx, in, info, handler)
func (x *schedulerSyncNetworkTopologyServer) SendAndClose(m *emptypb.Empty) error {
return x.ServerStream.SendMsg(m)
}
func _Scheduler_UploadPersistentCacheTaskFailed_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UploadPersistentCacheTaskFailedRequest)
if err := dec(in); err != nil {
func (x *schedulerSyncNetworkTopologyServer) Recv() (*SyncNetworkTopologyRequest, error) {
m := new(SyncNetworkTopologyRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).UploadPersistentCacheTaskFailed(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/UploadPersistentCacheTaskFailed",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).UploadPersistentCacheTaskFailed(ctx, req.(*UploadPersistentCacheTaskFailedRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Scheduler_StatPersistentCacheTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StatPersistentCacheTaskRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).StatPersistentCacheTask(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/StatPersistentCacheTask",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).StatPersistentCacheTask(ctx, req.(*StatPersistentCacheTaskRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Scheduler_DeletePersistentCacheTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeletePersistentCacheTaskRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).DeletePersistentCacheTask(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/DeletePersistentCacheTask",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).DeletePersistentCacheTask(ctx, req.(*DeletePersistentCacheTaskRequest))
}
return interceptor(ctx, in, info, handler)
return m, nil
}
// Scheduler_ServiceDesc is the grpc.ServiceDesc for Scheduler service.
@ -672,56 +469,24 @@ var Scheduler_ServiceDesc = grpc.ServiceDesc{
Handler: _Scheduler_StatPeer_Handler,
},
{
MethodName: "DeletePeer",
Handler: _Scheduler_DeletePeer_Handler,
MethodName: "LeavePeer",
Handler: _Scheduler_LeavePeer_Handler,
},
{
MethodName: "ExchangePeer",
Handler: _Scheduler_ExchangePeer_Handler,
},
{
MethodName: "StatTask",
Handler: _Scheduler_StatTask_Handler,
},
{
MethodName: "DeleteTask",
Handler: _Scheduler_DeleteTask_Handler,
},
{
MethodName: "AnnounceHost",
Handler: _Scheduler_AnnounceHost_Handler,
},
{
MethodName: "ListHosts",
Handler: _Scheduler_ListHosts_Handler,
},
{
MethodName: "DeleteHost",
Handler: _Scheduler_DeleteHost_Handler,
},
{
MethodName: "StatPersistentCachePeer",
Handler: _Scheduler_StatPersistentCachePeer_Handler,
},
{
MethodName: "DeletePersistentCachePeer",
Handler: _Scheduler_DeletePersistentCachePeer_Handler,
},
{
MethodName: "UploadPersistentCacheTaskStarted",
Handler: _Scheduler_UploadPersistentCacheTaskStarted_Handler,
},
{
MethodName: "UploadPersistentCacheTaskFinished",
Handler: _Scheduler_UploadPersistentCacheTaskFinished_Handler,
},
{
MethodName: "UploadPersistentCacheTaskFailed",
Handler: _Scheduler_UploadPersistentCacheTaskFailed_Handler,
},
{
MethodName: "StatPersistentCacheTask",
Handler: _Scheduler_StatPersistentCacheTask_Handler,
},
{
MethodName: "DeletePersistentCacheTask",
Handler: _Scheduler_DeletePersistentCacheTask_Handler,
MethodName: "LeaveHost",
Handler: _Scheduler_LeaveHost_Handler,
},
},
Streams: []grpc.StreamDesc{
@ -732,11 +497,16 @@ var Scheduler_ServiceDesc = grpc.ServiceDesc{
ClientStreams: true,
},
{
StreamName: "AnnouncePersistentCachePeer",
Handler: _Scheduler_AnnouncePersistentCachePeer_Handler,
StreamName: "SyncProbes",
Handler: _Scheduler_SyncProbes_Handler,
ServerStreams: true,
ClientStreams: true,
},
{
StreamName: "SyncNetworkTopology",
Handler: _Scheduler_SyncNetworkTopology_Handler,
ClientStreams: true,
},
},
Metadata: "pkg/apis/scheduler/v2/scheduler.proto",
}

View File

@ -0,0 +1,265 @@
//
// Copyright 2022 The Dragonfly Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.21.6
// source: pkg/apis/security/v1/security.proto
package security
import (
_ "github.com/envoyproxy/protoc-gen-validate/validate"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
durationpb "google.golang.org/protobuf/types/known/durationpb"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Certificate request type.
// Dragonfly supports peers authentication with Mutual TLS(mTLS)
// For mTLS, all peers need to request TLS certificates for communicating
// The server side may overwrite ant requested certificate filed based on its policies.
type CertificateRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// ASN.1 DER form certificate request.
// The public key in the CSR is used to generate the certificate,
// and other fields in the generated certificate may be overwritten by the CA.
Csr []byte `protobuf:"bytes,1,opt,name=csr,proto3" json:"csr,omitempty"`
// Optional: requested certificate validity period.
ValidityPeriod *durationpb.Duration `protobuf:"bytes,2,opt,name=validity_period,json=validityPeriod,proto3" json:"validity_period,omitempty"`
}
func (x *CertificateRequest) Reset() {
*x = CertificateRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_security_v1_security_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CertificateRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CertificateRequest) ProtoMessage() {}
func (x *CertificateRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_security_v1_security_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CertificateRequest.ProtoReflect.Descriptor instead.
func (*CertificateRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_security_v1_security_proto_rawDescGZIP(), []int{0}
}
func (x *CertificateRequest) GetCsr() []byte {
if x != nil {
return x.Csr
}
return nil
}
func (x *CertificateRequest) GetValidityPeriod() *durationpb.Duration {
if x != nil {
return x.ValidityPeriod
}
return nil
}
// Certificate response type.
type CertificateResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// ASN.1 DER form certificate chain.
CertificateChain [][]byte `protobuf:"bytes,1,rep,name=certificate_chain,json=certificateChain,proto3" json:"certificate_chain,omitempty"`
}
func (x *CertificateResponse) Reset() {
*x = CertificateResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_security_v1_security_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CertificateResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CertificateResponse) ProtoMessage() {}
func (x *CertificateResponse) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_security_v1_security_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CertificateResponse.ProtoReflect.Descriptor instead.
func (*CertificateResponse) Descriptor() ([]byte, []int) {
return file_pkg_apis_security_v1_security_proto_rawDescGZIP(), []int{1}
}
func (x *CertificateResponse) GetCertificateChain() [][]byte {
if x != nil {
return x.CertificateChain
}
return nil
}
var File_pkg_apis_security_v1_security_proto protoreflect.FileDescriptor
var file_pkg_apis_security_v1_security_proto_rawDesc = []byte{
0x0a, 0x23, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x73, 0x65, 0x63, 0x75, 0x72,
0x69, 0x74, 0x79, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x1a,
0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61,
0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7d, 0x0a, 0x12, 0x43, 0x65, 0x72, 0x74,
0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19,
0x0a, 0x03, 0x63, 0x73, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0xfa, 0x42, 0x04,
0x7a, 0x02, 0x10, 0x01, 0x52, 0x03, 0x63, 0x73, 0x72, 0x12, 0x4c, 0x0a, 0x0f, 0x76, 0x61, 0x6c,
0x69, 0x64, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xfa,
0x42, 0x05, 0xaa, 0x01, 0x02, 0x08, 0x01, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x69, 0x74,
0x79, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, 0x4c, 0x0a, 0x13, 0x43, 0x65, 0x72, 0x74, 0x69,
0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35,
0x0a, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68,
0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01,
0x02, 0x08, 0x01, 0x52, 0x10, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65,
0x43, 0x68, 0x61, 0x69, 0x6e, 0x32, 0x67, 0x0a, 0x12, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69,
0x63, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x51, 0x0a, 0x10, 0x49,
0x73, 0x73, 0x75, 0x65, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12,
0x1c, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69,
0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e,
0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69,
0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x2a,
0x5a, 0x28, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6b, 0x67,
0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2f, 0x76,
0x31, 0x3b, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
}
var (
file_pkg_apis_security_v1_security_proto_rawDescOnce sync.Once
file_pkg_apis_security_v1_security_proto_rawDescData = file_pkg_apis_security_v1_security_proto_rawDesc
)
func file_pkg_apis_security_v1_security_proto_rawDescGZIP() []byte {
file_pkg_apis_security_v1_security_proto_rawDescOnce.Do(func() {
file_pkg_apis_security_v1_security_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_apis_security_v1_security_proto_rawDescData)
})
return file_pkg_apis_security_v1_security_proto_rawDescData
}
var file_pkg_apis_security_v1_security_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_pkg_apis_security_v1_security_proto_goTypes = []interface{}{
(*CertificateRequest)(nil), // 0: security.CertificateRequest
(*CertificateResponse)(nil), // 1: security.CertificateResponse
(*durationpb.Duration)(nil), // 2: google.protobuf.Duration
}
var file_pkg_apis_security_v1_security_proto_depIdxs = []int32{
2, // 0: security.CertificateRequest.validity_period:type_name -> google.protobuf.Duration
0, // 1: security.CertificateService.IssueCertificate:input_type -> security.CertificateRequest
1, // 2: security.CertificateService.IssueCertificate:output_type -> security.CertificateResponse
2, // [2:3] is the sub-list for method output_type
1, // [1:2] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_pkg_apis_security_v1_security_proto_init() }
func file_pkg_apis_security_v1_security_proto_init() {
if File_pkg_apis_security_v1_security_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_pkg_apis_security_v1_security_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CertificateRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_apis_security_v1_security_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CertificateResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_pkg_apis_security_v1_security_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_pkg_apis_security_v1_security_proto_goTypes,
DependencyIndexes: file_pkg_apis_security_v1_security_proto_depIdxs,
MessageInfos: file_pkg_apis_security_v1_security_proto_msgTypes,
}.Build()
File_pkg_apis_security_v1_security_proto = out.File
file_pkg_apis_security_v1_security_proto_rawDesc = nil
file_pkg_apis_security_v1_security_proto_goTypes = nil
file_pkg_apis_security_v1_security_proto_depIdxs = nil
}

View File

@ -0,0 +1,273 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: pkg/apis/security/v1/security.proto
package security
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
"google.golang.org/protobuf/types/known/anypb"
)
// ensure the imports are used
var (
_ = bytes.MinRead
_ = errors.New("")
_ = fmt.Print
_ = utf8.UTFMax
_ = (*regexp.Regexp)(nil)
_ = (*strings.Reader)(nil)
_ = net.IPv4len
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on CertificateRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *CertificateRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on CertificateRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// CertificateRequestMultiError, or nil if none found.
func (m *CertificateRequest) ValidateAll() error {
return m.validate(true)
}
func (m *CertificateRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(m.GetCsr()) < 1 {
err := CertificateRequestValidationError{
field: "Csr",
reason: "value length must be at least 1 bytes",
}
if !all {
return err
}
errors = append(errors, err)
}
if m.GetValidityPeriod() == nil {
err := CertificateRequestValidationError{
field: "ValidityPeriod",
reason: "value is required",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return CertificateRequestMultiError(errors)
}
return nil
}
// CertificateRequestMultiError is an error wrapping multiple validation errors
// returned by CertificateRequest.ValidateAll() if the designated constraints
// aren't met.
type CertificateRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m CertificateRequestMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m CertificateRequestMultiError) AllErrors() []error { return m }
// CertificateRequestValidationError is the validation error returned by
// CertificateRequest.Validate if the designated constraints aren't met.
type CertificateRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e CertificateRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e CertificateRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e CertificateRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e CertificateRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e CertificateRequestValidationError) ErrorName() string {
return "CertificateRequestValidationError"
}
// Error satisfies the builtin error interface
func (e CertificateRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sCertificateRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = CertificateRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = CertificateRequestValidationError{}
// Validate checks the field values on CertificateResponse with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *CertificateResponse) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on CertificateResponse with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// CertificateResponseMultiError, or nil if none found.
func (m *CertificateResponse) ValidateAll() error {
return m.validate(true)
}
func (m *CertificateResponse) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(m.GetCertificateChain()) < 1 {
err := CertificateResponseValidationError{
field: "CertificateChain",
reason: "value must contain at least 1 item(s)",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return CertificateResponseMultiError(errors)
}
return nil
}
// CertificateResponseMultiError is an error wrapping multiple validation
// errors returned by CertificateResponse.ValidateAll() if the designated
// constraints aren't met.
type CertificateResponseMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m CertificateResponseMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m CertificateResponseMultiError) AllErrors() []error { return m }
// CertificateResponseValidationError is the validation error returned by
// CertificateResponse.Validate if the designated constraints aren't met.
type CertificateResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e CertificateResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e CertificateResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e CertificateResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e CertificateResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e CertificateResponseValidationError) ErrorName() string {
return "CertificateResponseValidationError"
}
// Error satisfies the builtin error interface
func (e CertificateResponseValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sCertificateResponse.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = CertificateResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = CertificateResponseValidationError{}

View File

@ -0,0 +1,54 @@
/*
* Copyright 2022 The Dragonfly Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto3";
package security;
import "google/protobuf/duration.proto";
import "validate/validate.proto";
option go_package = "d7y.io/api/pkg/apis/security/v1;security";
// Refer: https://github.com/istio/api/blob/master/security/v1alpha1/ca.proto
// Istio defines similar api for signing certificate, but it's not applicable in Dragonfly.
// Certificate request type.
// Dragonfly supports peers authentication with Mutual TLS(mTLS)
// For mTLS, all peers need to request TLS certificates for communicating
// The server side may overwrite ant requested certificate filed based on its policies.
message CertificateRequest {
// ASN.1 DER form certificate request.
// The public key in the CSR is used to generate the certificate,
// and other fields in the generated certificate may be overwritten by the CA.
bytes csr = 1 [(validate.rules).bytes.min_len = 1];
// Optional: requested certificate validity period.
google.protobuf.Duration validity_period = 2 [(validate.rules).duration.required = true];
}
// Certificate response type.
message CertificateResponse {
// ASN.1 DER form certificate chain.
repeated bytes certificate_chain = 1 [(validate.rules).repeated.min_items = 1];
}
// Service for managing certificates issued by the CA.
service CertificateService {
// Using provided CSR, returns a signed certificate.
rpc IssueCertificate(CertificateRequest)
returns (CertificateResponse) {
}
}

View File

@ -0,0 +1,105 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.21.6
// source: pkg/apis/security/v1/security.proto
package security
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// CertificateServiceClient is the client API for CertificateService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type CertificateServiceClient interface {
// Using provided CSR, returns a signed certificate.
IssueCertificate(ctx context.Context, in *CertificateRequest, opts ...grpc.CallOption) (*CertificateResponse, error)
}
type certificateServiceClient struct {
cc grpc.ClientConnInterface
}
func NewCertificateServiceClient(cc grpc.ClientConnInterface) CertificateServiceClient {
return &certificateServiceClient{cc}
}
func (c *certificateServiceClient) IssueCertificate(ctx context.Context, in *CertificateRequest, opts ...grpc.CallOption) (*CertificateResponse, error) {
out := new(CertificateResponse)
err := c.cc.Invoke(ctx, "/security.CertificateService/IssueCertificate", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// CertificateServiceServer is the server API for CertificateService service.
// All implementations should embed UnimplementedCertificateServiceServer
// for forward compatibility
type CertificateServiceServer interface {
// Using provided CSR, returns a signed certificate.
IssueCertificate(context.Context, *CertificateRequest) (*CertificateResponse, error)
}
// UnimplementedCertificateServiceServer should be embedded to have forward compatible implementations.
type UnimplementedCertificateServiceServer struct {
}
func (UnimplementedCertificateServiceServer) IssueCertificate(context.Context, *CertificateRequest) (*CertificateResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method IssueCertificate not implemented")
}
// UnsafeCertificateServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to CertificateServiceServer will
// result in compilation errors.
type UnsafeCertificateServiceServer interface {
mustEmbedUnimplementedCertificateServiceServer()
}
func RegisterCertificateServiceServer(s grpc.ServiceRegistrar, srv CertificateServiceServer) {
s.RegisterService(&CertificateService_ServiceDesc, srv)
}
func _CertificateService_IssueCertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CertificateRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CertificateServiceServer).IssueCertificate(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/security.CertificateService/IssueCertificate",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CertificateServiceServer).IssueCertificate(ctx, req.(*CertificateRequest))
}
return interceptor(ctx, in, info, handler)
}
// CertificateService_ServiceDesc is the grpc.ServiceDesc for CertificateService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var CertificateService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "security.CertificateService",
HandlerType: (*CertificateServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "IssueCertificate",
Handler: _CertificateService_IssueCertificate_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "pkg/apis/security/v1/security.proto",
}

View File

@ -16,7 +16,7 @@
syntax = "proto3";
package common.v2;
package common;
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
@ -38,24 +38,18 @@ enum SizeScope {
// TaskType represents type of task.
enum TaskType {
// STANDARD is standard type of task, it can download from source, remote peer and
// local peer(local cache). When the standard task is never downloaded in the
// P2P cluster, dfdaemon will download the task from the source. When the standard
// task is downloaded in the P2P cluster, dfdaemon will download the task from
// the remote peer or local peer(local cache).
STANDARD = 0;
// DFDAEMON is dfdeamon type of task,
// dfdeamon task is a normal p2p task.
DFDAEMON = 0;
// PERSISTENT is persistent type of task, it can import file and export file in P2P cluster.
// When the persistent task is imported into the P2P cluster, dfdaemon will store
// the task in the peer's disk and copy multiple replicas to remote peers to
// prevent data loss.
PERSISTENT = 1;
// DFCACHE is dfcache type of task,
// dfcache task is a cache task, and the task url is fake url.
// It can only be used for caching and cannot be downloaded back to source.
DFCACHE = 1;
// PERSISTENT_CACHE is persistent cache type of task, it can import file and export file in P2P cluster.
// When the persistent cache task is imported into the P2P cluster, dfdaemon will store
// the task in the peer's disk and copy multiple replicas to remote peers to prevent data loss.
// When the expiration time is reached, task will be deleted in the P2P cluster.
PERSISTENT_CACHE = 2;
// DFSTORE is dfstore type of task,
// dfstore task is a persistent task in backend.
DFSTORE = 2;
}
// TrafficType represents type of traffic.
@ -111,7 +105,7 @@ message Peer {
// Peer id.
string id = 1;
// Range is url range of request.
optional Range range = 2;
Range range = 2;
// Peer priority.
Priority priority = 3;
// Pieces of peer.
@ -132,29 +126,6 @@ message Peer {
google.protobuf.Timestamp updated_at = 11;
}
// PersistentCachePeer metadata.
message PersistentCachePeer {
// Peer id.
string id = 1;
// Persistent represents whether the persistent cache peer is persistent.
// If the persistent cache peer is persistent, the persistent cache peer will
// not be deleted when dfdaemon runs garbage collection. It only be deleted
// when the task is deleted by the user.
bool persistent = 2;
// Peer downloads costs time.
google.protobuf.Duration cost = 3;
// Peer state.
string state = 4;
// Persistent task info.
PersistentCacheTask task = 5;
// Host info.
Host host = 6;
// Peer create time.
google.protobuf.Timestamp created_at = 7;
// Peer update time.
google.protobuf.Timestamp updated_at = 8;
}
// Task metadata.
message Task {
// Task id.
@ -163,351 +134,124 @@ message Task {
TaskType type = 2;
// Download url.
string url = 3;
// Verifies task data integrity after download using a digest. Supports CRC32, SHA256, and SHA512 algorithms.
// Format: `<algorithm>:<hash>`, e.g., `crc32:xxx`, `sha256:yyy`, `sha512:zzz`.
// Returns an error if the computed digest mismatches the expected value.
//
// Performance
// Digest calculation increases processing time. Enable only when data integrity verification is critical.
optional string digest = 4;
// Digest of the pieces digest, for example md5:xxx or sha256:yyy.
string digest = 4;
// URL tag identifies different task for same url.
optional string tag = 5;
string tag = 5;
// Application of task.
optional string application = 6;
// Filtered query params to generate the task id.
// When filter is ["Signature", "Expires", "ns"], for example:
// http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io and http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io
// will generate the same task id.
// Default value includes the filtered query params of s3, gcs, oss, obs, cos.
repeated string filtered_query_params = 7;
string application = 6;
// Filter url used to generate task id.
repeated string filters = 7;
// Task request headers.
map<string, string> request_header = 8;
// Task content length.
uint64 content_length = 9;
// Task piece count.
uint32 piece_count = 10;
// Task size scope.
SizeScope size_scope = 11;
// Pieces of task.
repeated Piece pieces = 12;
// Task state.
string state = 13;
// Task peer count.
uint32 peer_count = 14;
// Task contains available peer.
bool has_available_peer = 15;
// Task create time.
google.protobuf.Timestamp created_at = 16;
// Task update time.
google.protobuf.Timestamp updated_at = 17;
}
// PersistentCacheTask metadata.
message PersistentCacheTask {
// Task id.
string id = 1;
// Replica count of the persistent cache task. The persistent cache task will
// not be deleted when dfdamon runs garbage collection. It only be deleted
// when the task is deleted by the user.
uint64 persistent_replica_count = 2;
// Current replica count of the persistent cache task. The persistent cache task
// will not be deleted when dfdaemon runs garbage collection. It only be deleted
// when the task is deleted by the user.
uint64 current_persistent_replica_count = 3;
// Current replica count of the cache task. If cache task is not persistent,
// the persistent cache task will be deleted when dfdaemon runs garbage collection.
uint64 current_replica_count = 4;
// Tag is used to distinguish different persistent cache tasks.
optional string tag = 5;
// Application of task.
optional string application = 6;
map<string, string> header = 8;
// Task piece length.
uint64 piece_length = 7;
int32 piece_length = 9;
// Task content length.
uint64 content_length = 8;
int64 content_length = 10;
// Task piece count.
uint32 piece_count = 9;
int64 piece_count = 11;
// Task size scope.
SizeScope size_scope = 12;
// Pieces of task.
repeated Piece pieces = 13;
// Task state.
string state = 10;
// TTL of the persistent cache task.
google.protobuf.Duration ttl = 11;
string state = 14;
// Task peer count.
int32 peer_count = 15;
// Task contains available peer.
bool hasAvailablePeer = 16;
// Task create time.
google.protobuf.Timestamp created_at = 12;
google.protobuf.Timestamp created_at = 17;
// Task update time.
google.protobuf.Timestamp updated_at = 13;
google.protobuf.Timestamp updated_at = 18;
}
// Host metadata.
message Host {
// Host id.
string id = 1;
// Host type.
uint32 type = 2;
// Hostname.
string hostname = 3;
// Host ip.
string ip = 4;
string ip = 2;
// Peer hostname.
string hostname = 3;
// Port of grpc service.
int32 port = 5;
int32 port = 4;
// Port of download server.
int32 download_port = 6;
// Host OS.
string os = 7;
// Host platform.
string platform = 8;
// Host platform family.
string platform_family = 9;
// Host platform version.
string platform_version = 10;
// Host kernel version.
string kernel_version = 11;
// CPU Stat.
optional CPU cpu = 12;
// Memory Stat.
optional Memory memory = 13;
// Network Stat.
optional Network network = 14;
// Disk Stat.
optional Disk disk = 15;
// Build information.
optional Build build = 16;
// ID of the cluster to which the host belongs.
uint64 scheduler_cluster_id = 17;
// Disable shared data for other peers.
bool disable_shared = 18;
int32 download_port = 5;
// Security domain for network.
string security_domain = 6;
// Host location, eg: area|country|province|city.
string location = 7;
// IDC where the peer host is located.
string idc = 8;
}
// CPU Stat.
message CPU {
// Number of logical cores in the system.
uint32 logical_count = 1;
// Number of physical cores in the system
uint32 physical_count = 2;
// Percent calculates the percentage of cpu used.
double percent = 3;
// Calculates the percentage of cpu used by process.
double process_percent = 4;
// CPUTimes contains the amounts of time the CPU has spent performing different kinds of work.
optional CPUTimes times = 5;
}
// CPUTimes contains the amounts of time the CPU has spent performing different
// kinds of work. Time units are in seconds.
message CPUTimes {
// CPU time of user.
double user = 1;
// CPU time of system.
double system = 2;
// CPU time of idle.
double idle = 3;
// CPU time of nice.
double nice = 4;
// CPU time of iowait.
double iowait = 5;
// CPU time of irq.
double irq = 6;
// CPU time of softirq.
double softirq = 7;
// CPU time of steal.
double steal = 8;
// CPU time of guest.
double guest = 9;
// CPU time of guest nice.
double guest_nice = 10;
}
// Memory Stat.
message Memory {
// Total amount of RAM on this system.
uint64 total = 1;
// RAM available for programs to allocate.
uint64 available = 2;
// RAM used by programs.
uint64 used = 3;
// Percentage of RAM used by programs.
double used_percent = 4;
// Calculates the percentage of memory used by process.
double process_used_percent = 5;
// This is the kernel's notion of free memory.
uint64 free = 6;
}
// Network Stat.
message Network {
// Return count of tcp connections opened and status is ESTABLISHED.
uint32 tcp_connection_count = 1;
// Return count of upload tcp connections opened and status is ESTABLISHED.
uint32 upload_tcp_connection_count = 2;
// Location path(area|country|province|city|...).
optional string location = 3;
// IDC where the peer host is located
optional string idc = 4;
// Download rate is received bytes per second.
uint64 download_rate = 5;
// Download rate is the limit of received bytes per second.
uint64 download_rate_limit = 6;
// Upload rate is transmitted bytes per second.
uint64 upload_rate = 7;
// Upload rate is the limit of transmitted bytes per second.
uint64 upload_rate_limit = 8;
}
// Disk Stat.
message Disk {
// Total amount of disk on the data path of dragonfly.
uint64 total = 1;
// Free amount of disk on the data path of dragonfly.
uint64 free = 2;
// Used amount of disk on the data path of dragonfly.
uint64 used = 3;
// Used percent of disk on the data path of dragonfly directory.
double used_percent = 4;
// Total amount of indoes on the data path of dragonfly directory.
uint64 inodes_total = 5;
// Used amount of indoes on the data path of dragonfly directory.
uint64 inodes_used = 6;
// Free amount of indoes on the data path of dragonfly directory.
uint64 inodes_free = 7;
// Used percent of indoes on the data path of dragonfly directory.
double inodes_used_percent = 8;
// Disk read bandwidth, in bytes per second.
uint64 read_bandwidth = 9;
// Disk write bandwidth, in bytes per second.
uint64 write_bandwidth = 10;
}
// Build information.
message Build {
// Git version.
string git_version = 1;
// Git commit.
optional string git_commit = 2;
// Golang version.
optional string go_version = 3;
// Rust version.
optional string rust_version = 4;
// Build platform.
optional string platform = 5;
// Range represents download range.
message Range {
// Start of range.
int64 start = 1;
// Length of range.
int64 length = 2;
}
// Download information.
message Download {
// Download url.
string url = 1;
// Digest of the task digest, for example :xxx or sha256:yyy.
optional string digest = 2;
// Range is url range of request. If protocol is http, range
// will set in request header. If protocol is others, range
// will set in range field.
optional Range range = 3;
// Digest of the pieces digest, for example md5:xxx or sha256:yyy.
string digest = 2;
// Range is url range of request.
Range range = 3;
// Task type.
TaskType type = 4;
// URL tag identifies different task for same url.
optional string tag = 5;
string tag = 5;
// Application of task.
optional string application = 6;
string application = 6;
// Peer priority.
Priority priority = 7;
// Filtered query params to generate the task id.
// When filter is ["Signature", "Expires", "ns"], for example:
// http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io and http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io
// will generate the same task id.
// Default value includes the filtered query params of s3, gcs, oss, obs, cos.
repeated string filtered_query_params = 8;
// Filter url used to generate task id.
repeated string filters = 8;
// Task request headers.
map<string, string> request_header = 9;
map<string, string> header = 9;
// Task piece length.
optional uint64 piece_length = 10;
// File path to be downloaded. If output_path is set, the downloaded file will be saved to the specified path.
// Dfdaemon will try to create hard link to the output path before starting the download. If hard link creation fails,
// it will copy the file to the output path after the download is completed.
// For more details refer to https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.
optional string output_path = 11;
int32 piece_length = 10;
// File path to be exported.
string output_path = 11;
// Download timeout.
optional google.protobuf.Duration timeout = 12;
// Dfdaemon cannot download the task from the source if disable_back_to_source is true.
bool disable_back_to_source = 13;
// Scheduler needs to schedule the task downloads from the source if need_back_to_source is true.
google.protobuf.Duration timeout = 12;
// Download rate limit in bytes per second.
double download_rate_limit = 13;
// NeedBackToSource needs downloaded from source.
bool need_back_to_source = 14;
// certificate_chain is the client certs with DER format for the backend client to download back-to-source.
repeated bytes certificate_chain = 15;
// Prefetch pre-downloads all pieces of the task when the download task request is a range request.
bool prefetch = 16;
// Object storage protocol information.
optional ObjectStorage object_storage = 17;
// HDFS protocol information.
optional HDFS hdfs = 18;
// is_prefetch is the flag to indicate whether the request is a prefetch request.
bool is_prefetch = 19;
// need_piece_content is the flag to indicate whether the response needs to return piece content.
bool need_piece_content = 20;
// load_to_cache indicates whether the content downloaded will be stored in the cache storage.
// Cache storage is designed to store downloaded piece content from preheat tasks,
// allowing other peers to access the content from memory instead of disk.
bool load_to_cache = 21;
// force_hard_link is the flag to indicate whether the download file must be hard linked to the output path.
// For more details refer to https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.
bool force_hard_link = 22;
// content_for_calculating_task_id is the content used to calculate the task id.
// If content_for_calculating_task_id is set, use its value to calculate the task ID.
// Otherwise, calculate the task ID based on url, piece_length, tag, application, and filtered_query_params.
optional string content_for_calculating_task_id = 23;
// remote_ip represents the IP address of the client initiating the download request.
// For proxy requests, it is set to the IP address of the request source.
// For dfget requests, it is set to the IP address of the dfget.
optional string remote_ip = 24;
}
// Object Storage related information.
message ObjectStorage {
// Region is the region of the object storage service.
optional string region = 1;
// Endpoint is the endpoint of the object storage service.
optional string endpoint = 2;
// Access key that used to access the object storage service.
optional string access_key_id = 3;
// Access secret that used to access the object storage service.
optional string access_key_secret = 4;
// Session token that used to access s3 storage service.
optional string session_token = 5;
// Local path to credential file for Google Cloud Storage service OAuth2 authentication.
optional string credential_path = 6;
// Predefined ACL that used for the Google Cloud Storage service.
optional string predefined_acl = 7;
}
// HDFS related information.
message HDFS {
// Delegation token for Web HDFS operator.
optional string delegation_token = 1;
}
// Range represents download range.
message Range {
// Start of range.
uint64 start = 1;
// Length of range.
uint64 length = 2;
}
// Piece represents information of piece.
message Piece {
// Piece number.
uint32 number = 1;
int32 number = 1;
// Parent peer id.
optional string parent_id = 2;
string parent_id = 2;
// Piece offset.
uint64 offset = 3;
// Piece length.
uint64 length = 4;
// Digest of the piece data, for example blake3:xxx or sha256:yyy.
// Digest of the piece data, for example md5:xxx or sha256:yyy.
string digest = 5;
// Piece content.
optional bytes content = 6;
// Traffic type.
optional TrafficType traffic_type = 7;
TrafficType traffic_type = 6;
// Downloading piece costs time.
google.protobuf.Duration cost = 8;
google.protobuf.Duration cost = 7;
// Piece create time.
google.protobuf.Timestamp created_at = 9;
google.protobuf.Timestamp created_at = 8;
}
// ExtendAttribute represents extend of attribution.
message ExtendAttribute {
// Task response header, eg: HTTP Response Header
map<string, string> header = 1;
// Task response code, eg: HTTP Status Code
int32 status_code = 2;
// Task response status, eg: HTTP Status
string status = 3;
}

View File

@ -16,394 +16,91 @@
syntax = "proto3";
package dfdaemon.v2;
package dfdaemon;
import "common.proto";
import "google/protobuf/duration.proto";
import "errordetails.proto";
import "google/protobuf/empty.proto";
// DownloadTaskRequest represents request of DownloadTask.
message DownloadTaskRequest {
// Download information.
common.v2.Download download = 1;
// InterestedAllPiecesRequest represents interested all pieces request of SyncPiecesRequest.
message InterestedAllPiecesRequest {
}
// DownloadTaskStartedResponse represents task download started response of DownloadTaskResponse.
message DownloadTaskStartedResponse {
// Task content length.
uint64 content_length = 1;
// Range is url range of request. If protocol is http, range
// is parsed from http header. If other protocol, range comes
// from download range field.
optional common.v2.Range range = 2;
// Task response headers.
map<string, string> response_header = 3;
// Need to download pieces.
repeated common.v2.Piece pieces = 4;
// InterestedPiecesRequest represents interested pieces request of SyncPiecesRequest.
message InterestedPiecesRequest {
// Interested piece numbers.
repeated uint32 piece_numbers = 1;
}
// DownloadPieceFinishedResponse represents piece download finished response of DownloadTaskResponse.
message DownloadPieceFinishedResponse {
// Finished piece of task.
common.v2.Piece piece = 1;
}
// DownloadTaskResponse represents response of DownloadTask.
message DownloadTaskResponse {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Peer id.
string peer_id = 3;
oneof response {
DownloadTaskStartedResponse download_task_started_response = 4;
DownloadPieceFinishedResponse download_piece_finished_response = 5;
// SyncPiecesRequest represents request of AnnouncePeer.
message SyncPiecesRequest{
oneof request {
InterestedAllPiecesRequest interested_all_pieces_request = 1;
InterestedPiecesRequest interested_pieces_request = 2;
}
}
// SyncPiecesRequest represents request of SyncPieces.
message SyncPiecesRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Interested piece numbers.
repeated uint32 interested_piece_numbers = 3;
// InterestedPiecesResponse represents interested pieces response of SyncPiecesResponse.
message InterestedPiecesResponse {
// Interested pieces of task.
repeated common.Piece pieces = 1;
}
// SyncPiecesResponse represents response of SyncPieces.
message SyncPiecesResponse {
// Exist piece number.
uint32 number = 1;
// Piece offset.
uint64 offset = 2;
// Piece length.
uint64 length = 3;
oneof response {
InterestedPiecesResponse interested_pieces_response = 1;
}
oneof errordetails {
errordetails.SyncPiecesFailed sync_pieces_failed = 3;
}
}
// DownloadPieceRequest represents request of DownloadPiece.
message DownloadPieceRequest{
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Piece number.
uint32 piece_number = 3;
// DownloadTaskRequest represents request of DownloadTask.
message DownloadTaskRequest {
// Download information.
common.Download download = 1;
}
// DownloadPieceResponse represents response of DownloadPieces.
message DownloadPieceResponse {
// Piece information.
common.v2.Piece piece = 1;
// Piece metadata digest, it is used to verify the integrity of the piece metadata.
optional string digest = 2;
// UploadTaskRequest represents request of UploadTask.
message UploadTaskRequest {
// Task metadata.
common.Task task = 1;
}
// StatTaskRequest represents request of StatTask.
message StatTaskRequest {
// Task id.
string task_id = 1;
// Remote IP represents the IP address of the client initiating the stat request.
optional string remote_ip = 2;
}
// ListTaskEntriesRequest represents request of ListTaskEntries.
message ListTaskEntriesRequest {
// Task id.
string task_id = 1;
// URL to be listed the entries.
string url = 2;
// HTTP header to be sent with the request.
map<string, string> request_header = 3;
// List timeout.
optional google.protobuf.Duration timeout = 4;
// certificate_chain is the client certs with DER format for the backend client to list the entries.
repeated bytes certificate_chain = 5;
// Object storage protocol information.
optional common.v2.ObjectStorage object_storage = 6;
// HDFS protocol information.
optional common.v2.HDFS hdfs = 7;
// Remote IP represents the IP address of the client initiating the list request.
optional string remote_ip = 8;
}
// ListTaskEntriesResponse represents response of ListTaskEntries.
message ListTaskEntriesResponse {
// Content length is the content length of the response
uint64 content_length = 1;
// HTTP header to be sent with the request.
map<string, string> response_header = 2;
// Backend HTTP status code.
optional int32 status_code = 3;
/// Entries is the information of the entries in the directory.
repeated Entry entries = 4;
}
// Entry represents an entry in a directory.
message Entry {
// URL of the entry.
string url = 1;
// Size of the entry.
uint64 content_length = 2;
// Is directory or not.
bool is_dir = 3;
// StatTaskResponse represents response of StatTask.
message StatTaskResponse {
// Task metadata.
common.Task task = 1;
}
// DeleteTaskRequest represents request of DeleteTask.
message DeleteTaskRequest {
// Task id.
string task_id = 1;
// Remote IP represents the IP address of the client initiating the delete request.
optional string remote_ip = 2;
}
// DownloadPersistentCacheTaskRequest represents request of DownloadPersistentCacheTask.
message DownloadPersistentCacheTaskRequest {
// Task id.
string task_id = 1;
// Persistent represents whether the persistent cache task is persistent.
// If the persistent cache task is persistent, the persistent cache peer will
// not be deleted when dfdaemon runs garbage collection.
bool persistent = 2;
// Tag is used to distinguish different persistent cache tasks.
optional string tag = 3;
// Application of task.
optional string application = 4;
// File path to be exported. If output_path is set, the exported file will be saved to the specified path.
// Dfdaemon will try to create hard link to the output path before starting the export. If hard link creation fails,
// it will copy the file to the output path after the export is completed.
// For more details refer to https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.
optional string output_path = 5;
// Download timeout.
optional google.protobuf.Duration timeout = 6;
// need_piece_content is the flag to indicate whether the response needs to return piece content.
bool need_piece_content = 7;
// force_hard_link is the flag to indicate whether the exported file must be hard linked to the output path.
// For more details refer to https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.
bool force_hard_link = 8;
// Verifies task data integrity after download using a digest. Supports CRC32, SHA256, and SHA512 algorithms.
// Format: `<algorithm>:<hash>`, e.g., `crc32:xxx`, `sha256:yyy`, `sha512:zzz`.
// Returns an error if the computed digest mismatches the expected value.
//
// Performance
// Digest calculation increases processing time. Enable only when data integrity verification is critical.
optional string digest = 9;
// Remote IP represents the IP address of the client initiating the download request.
optional string remote_ip = 10;
}
// Dfdaemon RPC Service.
service Dfdaemon{
// SyncPieces syncs pieces from the other peers.
rpc SyncPieces(stream SyncPiecesRequest)returns(stream SyncPiecesResponse);
// DownloadPersistentCacheTaskStartedResponse represents task download started response of DownloadPersistentCacheTaskResponse.
message DownloadPersistentCacheTaskStartedResponse {
// Task content length.
uint64 content_length = 1;
}
// DownloadTask downloads task back-to-source.
rpc DownloadTask(DownloadTaskRequest) returns(google.protobuf.Empty);
// DownloadPersistentCacheTaskResponse represents response of DownloadPersistentCacheTask.
message DownloadPersistentCacheTaskResponse {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Peer id.
string peer_id = 3;
oneof response {
DownloadPersistentCacheTaskStartedResponse download_persistent_cache_task_started_response = 4;
DownloadPieceFinishedResponse download_piece_finished_response = 5;
}
}
// UploadPersistentCacheTaskRequest represents request of UploadPersistentCacheTask.
message UploadPersistentCacheTaskRequest {
// content_for_calculating_task_id is the content used to calculate the task id.
// If content_for_calculating_task_id is set, use its value to calculate the task ID.
// Otherwise, calculate the task ID based on the file content, tag and application by crc32 algorithm`.
optional string content_for_calculating_task_id = 1;
// Upload file path of persistent cache task.
string path = 2;
// Replica count of the persistent persistent cache task.
uint64 persistent_replica_count = 3;
// Tag is used to distinguish different persistent cache tasks.
optional string tag = 4;
// Application of the persistent cache task.
optional string application = 5;
// Piece length of the persistent cache task, the value needs to be greater than or equal to 4194304(4MiB).
optional uint64 piece_length = 6;
// TTL of the persistent cache task.
google.protobuf.Duration ttl = 7;
// Download timeout.
optional google.protobuf.Duration timeout = 8;
// Remote IP represents the IP address of the client initiating the upload request.
optional string remote_ip = 9;
}
// UpdatePersistentCacheTaskRequest represents request of UpdatePersistentCacheTask.
message UpdatePersistentCacheTaskRequest {
// Task id.
string task_id = 1;
// Persistent represents whether the persistent cache peer is persistent.
// If the persistent cache peer is persistent, the persistent cache peer will
// not be deleted when dfdaemon runs garbage collection. It only be deleted
// when the task is deleted by the user.
bool persistent = 2;
// Remote IP represents the IP address of the client initiating the list request.
optional string remote_ip = 3;
}
// StatPersistentCacheTaskRequest represents request of StatPersistentCacheTask.
message StatPersistentCacheTaskRequest {
// Task id.
string task_id = 1;
// Remote IP represents the IP address of the client initiating the stat request.
optional string remote_ip = 2;
}
// DeletePersistentCacheTaskRequest represents request of DeletePersistentCacheTask.
message DeletePersistentCacheTaskRequest {
// Task id.
string task_id = 1;
// Remote IP represents the IP address of the client initiating the delete request.
optional string remote_ip = 2;
}
// SyncPersistentCachePiecesRequest represents request of SyncPersistentCachePieces.
message SyncPersistentCachePiecesRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Interested piece numbers.
repeated uint32 interested_piece_numbers = 3;
}
// SyncPersistentCachePiecesResponse represents response of SyncPersistentCachePieces.
message SyncPersistentCachePiecesResponse {
// Exist piece number.
uint32 number = 1;
// Piece offset.
uint64 offset = 2;
// Piece length.
uint64 length = 3;
}
// DownloadPersistentCachePieceRequest represents request of DownloadPersistentCachePiece.
message DownloadPersistentCachePieceRequest{
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Piece number.
uint32 piece_number = 3;
}
// DownloadPersistentCachePieceResponse represents response of DownloadPersistentCachePieces.
message DownloadPersistentCachePieceResponse {
// Piece information.
common.v2.Piece piece = 1;
// Piece metadata digest, it is used to verify the integrity of the piece metadata.
optional string digest = 2;
}
// SyncHostRequest represents request of SyncHost.
message SyncHostRequest {
// Host id.
string host_id = 1;
// Peer id.
string peer_id = 2;
}
// IBVerbsQueuePairEndpoint represents queue pair endpoint of IBVerbs.
message IBVerbsQueuePairEndpoint {
// Number of the queue pair.
uint32 num = 1;
// Local identifier of the context.
uint32 lid = 2;
// Global identifier of the context.
bytes gid = 3;
}
// ExchangeIBVerbsQueuePairEndpointRequest represents request of ExchangeIBVerbsQueuePairEndpoint.
message ExchangeIBVerbsQueuePairEndpointRequest {
// Information of the source's queue pair endpoint of IBVerbs.
IBVerbsQueuePairEndpoint endpoint = 1;
}
// ExchangeIBVerbsQueuePairEndpointResponse represents response of ExchangeIBVerbsQueuePairEndpoint.
message ExchangeIBVerbsQueuePairEndpointResponse {
// Information of the destination's queue pair endpoint of IBVerbs.
IBVerbsQueuePairEndpoint endpoint = 1;
}
// DfdaemonUpload represents upload service of dfdaemon.
service DfdaemonUpload {
// DownloadTask downloads task from p2p network.
rpc DownloadTask(DownloadTaskRequest) returns(stream DownloadTaskResponse);
// UploadTask uploads task to p2p network.
rpc UploadTask(UploadTaskRequest) returns(google.protobuf.Empty);
// StatTask stats task information.
rpc StatTask(StatTaskRequest) returns(common.v2.Task);
rpc StatTask(StatTaskRequest) returns(common.Task);
// DeleteTask deletes task from p2p network.
rpc DeleteTask(DeleteTaskRequest) returns(google.protobuf.Empty);
// SyncPieces syncs piece metadatas from remote peer.
rpc SyncPieces(SyncPiecesRequest) returns(stream SyncPiecesResponse);
// DownloadPiece downloads piece from the remote peer.
rpc DownloadPiece(DownloadPieceRequest)returns(DownloadPieceResponse);
// DownloadPersistentCacheTask downloads persistent cache task from p2p network.
rpc DownloadPersistentCacheTask(DownloadPersistentCacheTaskRequest) returns(stream DownloadPersistentCacheTaskResponse);
// UpdatePersistentCacheTask updates metadate of thr persistent cache task in p2p network.
rpc UpdatePersistentCacheTask(UpdatePersistentCacheTaskRequest) returns(google.protobuf.Empty);
// StatPersistentCacheTask stats persistent cache task information.
rpc StatPersistentCacheTask(StatPersistentCacheTaskRequest) returns(common.v2.PersistentCacheTask);
// DeletePersistentCacheTask deletes persistent cache task from p2p network.
rpc DeletePersistentCacheTask(DeletePersistentCacheTaskRequest) returns(google.protobuf.Empty);
// SyncPersistentCachePieces syncs persistent cache pieces from remote peer.
rpc SyncPersistentCachePieces(SyncPersistentCachePiecesRequest) returns(stream SyncPersistentCachePiecesResponse);
// DownloadPersistentCachePiece downloads persistent cache piece from p2p network.
rpc DownloadPersistentCachePiece(DownloadPersistentCachePieceRequest)returns(DownloadPersistentCachePieceResponse);
// SyncHost sync host info from parents.
rpc SyncHost(SyncHostRequest) returns (stream common.v2.Host);
// ExchangeIBVerbsQueuePairEndpoint exchanges queue pair endpoint of IBVerbs with remote peer.
rpc ExchangeIBVerbsQueuePairEndpoint(ExchangeIBVerbsQueuePairEndpointRequest) returns(ExchangeIBVerbsQueuePairEndpointResponse);
}
// DfdaemonDownload represents download service of dfdaemon.
service DfdaemonDownload {
// DownloadTask downloads task from p2p network.
rpc DownloadTask(DownloadTaskRequest) returns(stream DownloadTaskResponse);
// StatTask stats task information.
rpc StatTask(StatTaskRequest) returns(common.v2.Task);
// ListTaskEntries lists task entries for downloading directory.
rpc ListTaskEntries(ListTaskEntriesRequest) returns(ListTaskEntriesResponse);
// DeleteTask deletes task from p2p network.
rpc DeleteTask(DeleteTaskRequest) returns(google.protobuf.Empty);
// DeleteHost releases host in scheduler.
rpc DeleteHost(google.protobuf.Empty)returns(google.protobuf.Empty);
// DownloadPersistentCacheTask downloads persistent cache task from p2p network.
rpc DownloadPersistentCacheTask(DownloadPersistentCacheTaskRequest) returns(stream DownloadPersistentCacheTaskResponse);
// UploadPersistentCacheTask uploads persistent cache task to p2p network.
rpc UploadPersistentCacheTask(UploadPersistentCacheTaskRequest) returns(common.v2.PersistentCacheTask);
// StatPersistentCacheTask stats persistent cache task information.
rpc StatPersistentCacheTask(StatPersistentCacheTaskRequest) returns(common.v2.PersistentCacheTask);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2024 The Dragonfly Authors
* Copyright 2022 The Dragonfly Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,20 +16,60 @@
syntax = "proto3";
package errordetails.v2;
package errordetails;
// Backend is error detail for Backend.
message Backend {
// Backend error message.
string message = 1;
// Backend HTTP response header.
map<string, string> header = 2;
// Backend HTTP status code.
optional int32 status_code = 3;
import "common.proto";
// DownloadPeerBackToSourceFailed is error detail of downloading peer back-to-source.
message DownloadPeerBackToSourceFailed {
// The description of the error.
string description = 1;
}
// Unknown is error detail for Unknown.
message Unknown {
// Unknown error message.
optional string message = 1;
// DownloadPieceBackToSourceFailed is error detail of downloading piece back-to-source.
message DownloadPieceBackToSourceFailed {
// Temporary recoverable error of source.
bool temporary = 1;
// Source response metadata, eg: HTTP Status Code, HTTP Status, HTTP Header
common.ExtendAttribute extend_attribute = 2;
// The number of piece.
uint32 piece_number = 3;
// The description of the error.
string description = 4;
}
// DownloadPieceFailed is error detail of downloading piece.
message DownloadPieceFailed {
// Temporary recoverable error of parent peer.
bool temporary = 1;
// Source response metadata, eg: HTTP Status Code, HTTP Status, HTTP Header
common.ExtendAttribute extend_attribute = 2;
// Piece is information of piece.
string parent_id = 3;
// The number of piece.
uint32 piece_number = 4;
// The description of the error.
string description = 5;
}
// SchedulePeerForbidden is error detail of forbidden.
message SchedulePeerForbidden {
// The description of the error.
string description = 1;
}
// SchedulePeerFailed is error detail of scheduling.
message SchedulePeerFailed {
// The description of the error.
string description = 1;
}
// SyncPiecesFailed is error detail of syncing pieces.
message SyncPiecesFailed {
// Temporary recoverable error of parent peer.
bool temporary = 1;
// Parent peer id.
string parent_id = 2;
// The description of the error.
string description = 3;
}

View File

@ -16,23 +16,36 @@
syntax = "proto3";
package manager.v2;
package manager;
import "common.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
// Request source type.
enum SourceType {
// Scheduler service.
SCHEDULER_SOURCE = 0;
// Peer service.
PEER_SOURCE = 1;
// SeedPeer service.
SEED_PEER_SOURCE = 2;
}
// SecurityGroup represents security group of cluster.
message SecurityGroup {
// Group id.
uint64 id = 1;
// Group name.
string name = 2;
// Group biography.
string bio = 3;
// Group domain.
string domain = 4;
// Group proxy domain.
string proxy_domain = 5;
}
// SeedPeerCluster represents cluster of seed peer.
message SeedPeerCluster {
// Cluster id.
@ -43,6 +56,10 @@ message SeedPeerCluster {
string bio = 3;
// Cluster configuration.
bytes config = 4;
// Cluster scopes.
bytes scopes = 5;
// Security group to which the seed peer cluster belongs.
SecurityGroup security_group = 6;
}
// SeedPeer represents seed peer for network.
@ -50,13 +67,13 @@ message SeedPeer {
// Seed peer id.
uint64 id = 1;
// Seed peer hostname.
string hostname = 2;
string host_name = 2;
// Seed peer type.
string type = 3;
// Seed peer idc.
optional string idc = 4;
string idc = 4;
// Seed peer location.
optional string location = 5;
string location = 5;
// Seed peer ip.
string ip = 6;
// Seed peer grpc port.
@ -71,6 +88,8 @@ message SeedPeer {
SeedPeerCluster seed_peer_cluster = 11;
// Schedulers included in seed peer.
repeated Scheduler schedulers = 12;
// Seed peer object storage port.
int32 object_storage_port = 13;
}
// GetSeedPeerRequest represents request of GetSeedPeer.
@ -78,45 +97,25 @@ message GetSeedPeerRequest {
// Request source type.
SourceType source_type = 1;
// Seed peer hostname.
string hostname = 2;
string host_name = 2;
// ID of the cluster to which the seed peer belongs.
uint64 seed_peer_cluster_id = 3;
// Seed peer ip.
string ip = 4;
}
// ListSeedPeersRequest represents request of ListSeedPeers.
message ListSeedPeersRequest {
// Request source type.
SourceType source_type = 1;
// Source service hostname.
string hostname = 2;
// Source service ip.
string ip = 3;
// Dfdaemon version.
string version = 4;
// Dfdaemon commit.
string commit = 5;
}
// ListSeedPeersResponse represents response of ListSeedPeers.
message ListSeedPeersResponse {
// Seed peers to which the source service belongs.
repeated SeedPeer seed_peers = 1;
}
// UpdateSeedPeerRequest represents request of UpdateSeedPeer.
message UpdateSeedPeerRequest {
// Request source type.
SourceType source_type = 1;
// Seed peer hostname.
string hostname = 2;
string host_name = 2;
// Seed peer type.
string type = 3;
// Seed peer idc.
optional string idc = 4;
string idc = 4;
// Seed peer location.
optional string location = 5;
string location = 5;
// Seed peer ip.
string ip = 6;
// Seed peer port.
@ -125,18 +124,8 @@ message UpdateSeedPeerRequest {
int32 download_port = 8;
// ID of the cluster to which the seed peer belongs.
uint64 seed_peer_cluster_id = 9;
}
// DeleteSeedPeerRequest represents request of DeleteSeedPeer.
message DeleteSeedPeerRequest {
// Request source type.
SourceType source_type = 1;
// Seed peer hostname.
string hostname = 2;
// ID of the cluster to which the seed peer belongs.
uint64 seed_peer_cluster_id = 3;
// Seed peer ip.
string ip = 4;
// Seed peer object storage port.
int32 object_storage_port = 10;
}
// SeedPeerCluster represents cluster of scheduler.
@ -153,6 +142,8 @@ message SchedulerCluster {
bytes client_config = 5;
// Cluster scopes.
bytes scopes = 6;
// Security group to which the scheduler cluster belongs.
SecurityGroup security_group = 7;
}
// SeedPeerCluster represents scheduler for network.
@ -160,11 +151,11 @@ message Scheduler {
// Scheduler id.
uint64 id = 1;
// Scheduler hostname.
string hostname = 2;
string host_name = 2;
// Scheduler idc.
optional string idc = 3;
string idc = 3;
// Scheduler location.
optional string location = 4;
string location = 4;
// Scheduler ip.
string ip = 5;
// Scheduler grpc port.
@ -177,8 +168,6 @@ message Scheduler {
SchedulerCluster scheduler_cluster = 9;
// Seed peers to which the scheduler belongs.
repeated SeedPeer seed_peers = 10;
// Feature flags of scheduler.
bytes features = 11;
}
// GetSchedulerRequest represents request of GetScheduler.
@ -186,7 +175,7 @@ message GetSchedulerRequest {
// Request source type.
SourceType source_type = 1;
// Scheduler hostname.
string hostname = 2;
string host_name = 2;
// ID of the cluster to which the scheduler belongs.
uint64 scheduler_cluster_id = 3;
// Scheduler ip.
@ -198,21 +187,17 @@ message UpdateSchedulerRequest {
// Request source type.
SourceType source_type = 1;
// Scheduler hostname.
string hostname = 2;
string host_name = 2;
// ID of the cluster to which the scheduler belongs.
uint64 scheduler_cluster_id = 3;
// Scheduler idc.
optional string idc = 4;
string idc = 4;
// Scheduler location.
optional string location = 5;
string location = 5;
// Scheduler ip.
string ip = 6;
// Scheduler port.
int32 port = 7;
// Scheduler features.
repeated string features = 8;
// Scheduler Configuration.
bytes config = 9;
}
// ListSchedulersRequest represents request of ListSchedulers.
@ -220,19 +205,15 @@ message ListSchedulersRequest {
// Request source type.
SourceType source_type = 1;
// Source service hostname.
string hostname = 2;
string host_name = 2;
// Source service ip.
string ip = 3;
// Source idc.
optional string idc = 4;
// Source location.
optional string location = 5;
// Source service host information.
map<string, string> host_info = 4;
// Dfdaemon version.
string version = 6;
string version = 5;
// Dfdaemon commit.
string commit = 7;
// ID of the cluster to which the scheduler belongs.
uint64 scheduler_cluster_id = 8;
string commit = 6;
}
// ListSchedulersResponse represents response of ListSchedulers.
@ -241,18 +222,243 @@ message ListSchedulersResponse {
repeated Scheduler schedulers = 1;
}
// ObjectStorage represents config of object storage.
message ObjectStorage {
// name is object storage name of type, it can be s3, oss or obs.
string name = 1;
// Region is storage region.
string region = 2;
// Endpoint is datacenter endpoint.
string endpoint = 3;
// AccessKey is access key ID.
string access_key = 4;
// SecretKey is access key secret.
string secret_key = 5;
// S3ForcePathStyle sets force path style for s3, true by default.
// Set this to `true` to force the request to use path-style addressing,
// i.e., `http://s3.amazonaws.com/BUCKET/KEY`. By default, the S3 client
// will use virtual hosted bucket addressing when possible
// (`http://BUCKET.s3.amazonaws.com/KEY`).
// Refer to https://github.com/aws/aws-sdk-go/blob/main/aws/config.go#L118.
bool s3_force_path_style = 6;
}
// GetObjectStorageRequest represents request of GetObjectStorage.
message GetObjectStorageRequest {
// Request source type.
SourceType source_type = 1;
// Source service hostname.
string host_name = 2;
// Source service ip.
string ip = 3;
}
// Bucket represents config of bucket.
message Bucket {
// Bucket name.
string name = 1;
}
// ListSchedulersRequest represents request of ListBuckets.
message ListBucketsRequest {
// Request source type.
SourceType source_type = 1;
// Source service hostname.
string host_name = 2;
// Source service ip.
string ip = 3;
}
// ListBucketsResponse represents response of ListBuckets.
message ListBucketsResponse {
// Bucket configs.
repeated Bucket buckets = 1;
}
// Model represents information of model.
message Model {
// Model id.
string model_id = 1;
// Model name.
string name = 2;
// Model version id.
string version_id = 3;
// Scheduler id.
uint64 scheduler_id = 4;
// Scheduler hostname.
string host_name = 5;
// Scheduler ip.
string ip = 6;
// Model create time.
google.protobuf.Timestamp created_at = 7;
// Model update time.
google.protobuf.Timestamp updated_at = 8;
}
// ListModelsRequest represents request of ListModels.
message ListModelsRequest {
// Scheduler id.
uint64 scheduler_id = 1;
}
// ListModelsResponse represents response of ListModels.
message ListModelsResponse {
// Model informations.
repeated Model models = 1;
}
// GetModelRequest represents request of GetModel.
message GetModelRequest {
// Scheduler id.
uint64 scheduler_id = 1;
// Model id.
string model_id = 2;
}
// CreateModelRequest represents request of CreateModel.
message CreateModelRequest {
// Model id.
string model_id = 1;
// Model name.
string name = 2;
// Model version id.
string version_id = 3;
// Scheduler id.
uint64 scheduler_id = 4;
// Scheduler hostname.
string host_name = 5;
// Scheduler ip.
string ip = 6;
}
// UpdateModelRequest represents request of UpdateModel.
message UpdateModelRequest {
// Model id.
string model_id = 1;
// Model name.
string name = 2;
// Model version id.
string version_id = 3;
// Scheduler id.
uint64 scheduler_id = 4;
// Scheduler hostname.
string host_name = 5;
// Scheduler ip.
string ip = 6;
}
// DeleteModelRequest represents request of DeleteModel.
message DeleteModelRequest {
// Scheduler id.
uint64 scheduler_id = 1;
// Model id.
string model_id = 2;
}
// ModelVersion represents information of model version.
message ModelVersion {
// Model version id.
string version_id = 1;
// Model version data.
bytes data = 2;
// Model version mae.
double mae = 3;
// Model version mse.
double mse = 4;
// Model version rmse.
double rmse = 5;
// Model version r^2.
double r2 = 6;
// Model create time.
google.protobuf.Timestamp created_at = 7;
// Model update time.
google.protobuf.Timestamp updated_at = 8;
}
// ListModelVersionsRequest represents request of ListModelVersions.
message ListModelVersionsRequest {
// Scheduler id.
uint64 scheduler_id = 1;
// Model id.
string model_id = 2;
}
// ListModelVersionsResponse represents response of ListModelVersions.
message ListModelVersionsResponse {
// Model version informations.
repeated ModelVersion model_versions = 1;
}
// GetModelVersionRequest represents request of GetModelVersion.
message GetModelVersionRequest {
// Scheduler id.
uint64 scheduler_id = 1;
// Model id.
string model_id = 2;
// Model version id.
string version_id = 3;
}
// CreateModelVersionRequest represents request of CreateModelVersion.
message CreateModelVersionRequest {
// Scheduler id.
uint64 scheduler_id = 1;
// Model id.
string model_id = 2;
// Model version data.
bytes data = 3;
// Model version mae.
double mae = 4;
// Model version mse.
double mse = 5;
// Model version rmse.
double rmse = 6;
// Model version r^2.
double r2 = 7;
}
// UpdateModelVersionRequest represents request of UpdateModelVersion.
message UpdateModelVersionRequest {
// Model version id.
string version_id = 1;
// Scheduler id.
uint64 scheduler_id = 2;
// Model id.
string model_id = 3;
// Model version data.
bytes data = 4;
// Model version mae.
double mae = 5;
// Model version mse.
double mse = 6;
// Model version rmse.
double rmse = 7;
// Model version r^2.
double r2 = 8;
}
// DeleteModelVersionRequest represents request of DeleteModelVersion.
message DeleteModelVersionRequest {
// Scheduler id.
uint64 scheduler_id = 1;
// Model id.
string model_id = 2;
// Model version id.
string version_id = 3;
}
// URLPriority represents config of url priority.
message URLPriority {
// URL regex.
string regex = 1;
// URL priority value.
common.v2.Priority value = 2;
common.Priority value = 2;
}
// ApplicationPriority represents config of application priority.
message ApplicationPriority {
// Priority value.
common.v2.Priority value = 1;
common.Priority value = 1;
// URL priority.
repeated URLPriority urls = 2;
}
@ -276,7 +482,7 @@ message ListApplicationsRequest {
// Request source type.
SourceType source_type = 1;
// Source service hostname.
string hostname = 2;
string host_name = 2;
// Source service ip.
string ip = 3;
}
@ -292,7 +498,7 @@ message KeepAliveRequest {
// Request source type.
SourceType source_type = 1;
// Source service hostname.
string hostname = 2;
string host_name = 2;
// ID of the cluster to which the source service belongs.
uint64 cluster_id = 3;
// Source service ip.
@ -304,15 +510,9 @@ service Manager {
// Get SeedPeer and SeedPeer cluster configuration.
rpc GetSeedPeer(GetSeedPeerRequest) returns(SeedPeer);
// List acitve schedulers configuration.
rpc ListSeedPeers(ListSeedPeersRequest)returns(ListSeedPeersResponse);
// Update SeedPeer configuration.
rpc UpdateSeedPeer(UpdateSeedPeerRequest) returns(SeedPeer);
// Delete SeedPeer configuration.
rpc DeleteSeedPeer(DeleteSeedPeerRequest) returns(google.protobuf.Empty);
// Get Scheduler and Scheduler cluster configuration.
rpc GetScheduler(GetSchedulerRequest)returns(Scheduler);
@ -322,6 +522,42 @@ service Manager {
// List acitve schedulers configuration.
rpc ListSchedulers(ListSchedulersRequest)returns(ListSchedulersResponse);
// Get ObjectStorage configuration.
rpc GetObjectStorage(GetObjectStorageRequest) returns(ObjectStorage);
// List buckets configuration.
rpc ListBuckets(ListBucketsRequest)returns(ListBucketsResponse);
// List models information.
rpc ListModels(ListModelsRequest)returns(ListModelsResponse);
// Get model information.
rpc GetModel(GetModelRequest)returns(Model);
// Create model information.
rpc CreateModel(CreateModelRequest)returns(Model);
// Update model information.
rpc UpdateModel(UpdateModelRequest)returns(Model);
// Delete model information.
rpc DeleteModel(DeleteModelRequest)returns(google.protobuf.Empty);
// List model versions information.
rpc ListModelVersions(ListModelVersionsRequest)returns(ListModelVersionsResponse);
// Get model version information.
rpc GetModelVersion(GetModelVersionRequest)returns(ModelVersion);
// Create model version information.
rpc CreateModelVersion(CreateModelVersionRequest)returns(ModelVersion);
// Update model version information.
rpc UpdateModelVersion(UpdateModelVersionRequest)returns(ModelVersion);
// Delete model version information.
rpc DeleteModelVersion(DeleteModelVersionRequest)returns(google.protobuf.Empty);
// List applications configuration.
rpc ListApplications(ListApplicationsRequest)returns(ListApplicationsResponse);

View File

@ -16,7 +16,7 @@
syntax = "proto3";
package scheduler.v2;
package scheduler;
import "common.proto";
import "errordetails.proto";
@ -27,7 +27,7 @@ import "google/protobuf/timestamp.proto";
// RegisterPeerRequest represents peer registered request of AnnouncePeerRequest.
message RegisterPeerRequest {
// Download information.
common.v2.Download download = 1;
common.Download download = 1;
}
// DownloadPeerStartedRequest represents peer download started request of AnnouncePeerRequest.
@ -36,395 +36,361 @@ message DownloadPeerStartedRequest {
// DownloadPeerBackToSourceStartedRequest represents peer download back-to-source started request of AnnouncePeerRequest.
message DownloadPeerBackToSourceStartedRequest {
// The description of the back-to-source reason.
optional string description = 1;
}
// ReschedulePeerRequest represents reschedule request of AnnouncePeerRequest.
message ReschedulePeerRequest {
// Candidate parent ids.
repeated common.v2.Peer candidate_parents = 1;
// The description of the reschedule reason.
optional string description = 2;
// Download back-to-source reason.
string reason = 1;
}
// DownloadPeerFinishedRequest represents peer download finished request of AnnouncePeerRequest.
message DownloadPeerFinishedRequest {
// Total content length.
uint64 content_length = 1;
int64 content_length = 1;
// Total piece count.
uint32 piece_count = 2;
int64 piece_count = 2;
}
// DownloadPeerBackToSourceFinishedRequest represents peer download back-to-source finished request of AnnouncePeerRequest.
message DownloadPeerBackToSourceFinishedRequest {
// Total content length.
uint64 content_length = 1;
int64 content_length = 1;
// Total piece count.
uint32 piece_count = 2;
}
// DownloadPeerFailedRequest represents peer download failed request of AnnouncePeerRequest.
message DownloadPeerFailedRequest {
// The description of the download failed.
optional string description = 1;
}
// DownloadPeerBackToSourceFailedRequest represents peer download back-to-source failed request of AnnouncePeerRequest.
message DownloadPeerBackToSourceFailedRequest {
// The description of the download back-to-source failed.
optional string description = 1;
int64 piece_count = 2;
}
// DownloadPieceFinishedRequest represents piece download finished request of AnnouncePeerRequest.
message DownloadPieceFinishedRequest {
// Piece info.
common.v2.Piece piece = 1;
common.Piece piece = 1;
}
// DownloadPieceBackToSourceFinishedRequest represents piece download back-to-source finished request of AnnouncePeerRequest.
message DownloadPieceBackToSourceFinishedRequest {
// Piece info.
common.v2.Piece piece = 1;
}
// DownloadPieceFailedRequest downloads piece failed request of AnnouncePeerRequest.
message DownloadPieceFailedRequest {
// Piece number.
optional uint32 piece_number = 1;
// Parent id.
string parent_id = 2;
// Temporary indicates whether the error is temporary.
bool temporary = 3;
}
// DownloadPieceBackToSourceFailedRequest downloads piece back-to-source failed request of AnnouncePeerRequest.
message DownloadPieceBackToSourceFailedRequest {
// Piece number.
optional uint32 piece_number = 1;
oneof response {
errordetails.v2.Backend backend = 2;
errordetails.v2.Unknown unknown = 3;
}
common.Piece piece = 1;
}
// AnnouncePeerRequest represents request of AnnouncePeer.
message AnnouncePeerRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
string task_id = 1;
// Peer id.
string peer_id = 3;
string peer_id = 2;
oneof request {
RegisterPeerRequest register_peer_request = 4;
DownloadPeerStartedRequest download_peer_started_request = 5;
DownloadPeerBackToSourceStartedRequest download_peer_back_to_source_started_request = 6;
ReschedulePeerRequest reschedule_peer_request = 7;
DownloadPeerFinishedRequest download_peer_finished_request = 8;
DownloadPeerBackToSourceFinishedRequest download_peer_back_to_source_finished_request = 9;
DownloadPeerFailedRequest download_peer_failed_request = 10;
DownloadPeerBackToSourceFailedRequest download_peer_back_to_source_failed_request = 11;
DownloadPieceFinishedRequest download_piece_finished_request = 12;
DownloadPieceBackToSourceFinishedRequest download_piece_back_to_source_finished_request = 13;
DownloadPieceFailedRequest download_piece_failed_request = 14;
DownloadPieceBackToSourceFailedRequest download_piece_back_to_source_failed_request = 15;
RegisterPeerRequest register_peer_request = 3;
DownloadPeerStartedRequest download_peer_started_request = 4;
DownloadPeerBackToSourceStartedRequest download_peer_back_to_source_started_request = 5;
DownloadPeerFinishedRequest download_peer_finished_request = 6;
DownloadPeerBackToSourceFinishedRequest download_peer_back_to_source_finished_request = 7;
DownloadPieceFinishedRequest download_piece_finished_request = 8;
DownloadPieceBackToSourceFinishedRequest download_piece_back_to_source_finished_request = 9;
}
oneof errordetails {
errordetails.DownloadPeerBackToSourceFailed download_peer_back_to_source_failed = 10;
errordetails.DownloadPieceBackToSourceFailed download_piece_back_to_source_failed = 11;
errordetails.SyncPiecesFailed sync_pieces_failed = 12;
errordetails.DownloadPieceFailed download_piece_failed = 13;
}
}
// EmptyTaskResponse represents empty task response of AnnouncePeerResponse.
message EmptyTaskResponse {
// TinyTaskResponse represents tiny task response of AnnouncePeerResponse.
message TinyTaskResponse {
bytes data = 1;
}
// SmallTaskResponse represents small task response of AnnouncePeerResponse.
message SmallTaskResponse {
// Piece info.
common.Piece piece = 1;
}
// NormalTaskResponse represents normal task response of AnnouncePeerResponse.
message NormalTaskResponse {
// Candidate parents.
repeated common.v2.Peer candidate_parents = 1;
repeated common.Peer candidate_parents = 1;
// Concurrent downloading piece count from the peers.
int32 concurrent_piece_count = 2;
}
// NeedBackToSourceResponse represents need back-to-source response of AnnouncePeerResponse.
message NeedBackToSourceResponse {
// The description of the back-to-source reason.
optional string description = 1;
// Download back-to-source reason.
string reason = 1;
}
// AnnouncePeerResponse represents response of AnnouncePeer.
message AnnouncePeerResponse {
oneof response {
EmptyTaskResponse empty_task_response = 1;
NormalTaskResponse normal_task_response = 2;
NeedBackToSourceResponse need_back_to_source_response = 3;
TinyTaskResponse tiny_task_response = 1;
SmallTaskResponse small_task_response = 2;
NormalTaskResponse normal_task_response = 3;
NeedBackToSourceResponse need_back_to_source_response = 4;
}
oneof errordetails {
errordetails.SchedulePeerForbidden schedule_peer_forbidden = 5;
errordetails.SchedulePeerFailed schedule_peer_failed = 6;
}
}
// StatPeerRequest represents request of StatPeer.
message StatPeerRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
string task_id = 1;
// Peer id.
string peer_id = 3;
string peer_id = 2;
}
// DeletePeerRequest represents request of DeletePeer.
message DeletePeerRequest {
// Host id.
string host_id = 1;
// TODO exchange peer request definition.
// ExchangePeerRequest represents request of ExchangePeer.
message ExchangePeerRequest {
// Task id.
string task_id = 2;
string task_id = 1;
// Peer id.
string peer_id = 3;
string peer_id = 2;
}
// TODO exchange peer response definition.
// ExchangePeerResponse represents response of ExchangePeer.
message ExchangePeerResponse {
}
// LeavePeerRequest represents request of LeavePeer.
message LeavePeerRequest {
// Task id.
string task_id = 1;
// Peer id.
string peer_id = 2;
}
// StatTaskRequest represents request of StatTask.
message StatTaskRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
}
// DeleteTaskRequest represents request of DeleteTask.
message DeleteTaskRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
string id = 1;
}
// AnnounceHostRequest represents request of AnnounceHost.
message AnnounceHostRequest {
// Host information.
common.v2.Host host = 1;
// The interval between dfdaemon announces to scheduler.
optional google.protobuf.Duration interval = 2;
}
// ListHostsResponse represents response of ListHosts.
message ListHostsResponse {
// Hosts info.
repeated common.v2.Host hosts = 1;
}
// DeleteHostRequest represents request of DeleteHost.
message DeleteHostRequest{
// Host id.
string host_id = 1;
string id = 1;
// Host type.
uint32 type = 2;
// Hostname.
string hostname = 3;
// Host ip.
string ip = 4;
// Port of grpc service.
int32 port = 5;
// Port of download server.
int32 download_port = 6;
// Host OS.
string os = 7;
// Host platform.
string platform = 8;
// Host platform family.
string platform_family = 9;
// Host platform version.
string platform_version = 10;
// Host kernel version.
string kernel_version = 11;
// CPU Stat.
CPU cpu = 12;
// Memory Stat.
Memory memory = 13;
// Network Stat.
Network network = 14;
// Disk Stat.
Disk disk = 15;
// Build information.
Build build = 16;
}
// RegisterPersistentCachePeerRequest represents persistent cache peer registered request of AnnouncePersistentCachePeerRequest.
message RegisterPersistentCachePeerRequest {
// Persistent represents whether the persistent cache task is persistent.
// If the persistent cache task is persistent, the persistent cache peer will
// not be deleted when dfdaemon runs garbage collection.
bool persistent = 1;
// Tag is used to distinguish different persistent cache tasks.
optional string tag = 2;
// Application of task.
optional string application = 3;
// Task piece length, the value needs to be greater than or equal to 4194304(4MiB).
uint64 piece_length = 4;
// File path to be exported.
optional string output_path = 5;
// Download timeout.
optional google.protobuf.Duration timeout = 6;
// CPU Stat.
message CPU {
// Number of logical cores in the system.
uint32 logical_count = 1;
// Number of physical cores in the system
uint32 physical_count = 2;
// Percent calculates the percentage of cpu used.
double percent = 3;
// Calculates the percentage of cpu used by process.
double process_percent = 4;
// CPUTimes contains the amounts of time the CPU has spent performing different kinds of work.
CPUTimes times = 5;
}
// DownloadPersistentCachePeerStartedRequest represents persistent cache peer download started request of AnnouncePersistentCachePeerRequest.
message DownloadPersistentCachePeerStartedRequest {
// CPUTimes contains the amounts of time the CPU has spent performing different
// kinds of work. Time units are in seconds.
message CPUTimes {
// CPU time of user.
double user = 1;
// CPU time of system.
double system = 2;
// CPU time of idle.
double idle = 3;
// CPU time of nice.
double nice = 4;
// CPU time of iowait.
double iowait = 5;
// CPU time of irq.
double irq = 6;
// CPU time of softirq.
double softirq = 7;
// CPU time of steal.
double steal = 8;
// CPU time of guest.
double guest = 9;
// CPU time of guest nice.
double guest_nice = 10;
}
// ReschedulePersistentCachePeerRequest represents reschedule request of AnnouncePersistentCachePeerRequest.
message ReschedulePersistentCachePeerRequest {
// Candidate parent ids.
repeated common.v2.PersistentCachePeer candidate_parents = 1;
// The description of the reschedule reason.
optional string description = 2;
// Memory Stat.
message Memory {
// Total amount of RAM on this system.
uint64 total = 1;
// RAM available for programs to allocate.
uint64 available = 2;
// RAM used by programs.
uint64 used = 3;
// Percentage of RAM used by programs.
double used_percent = 4;
// Calculates the percentage of memory used by process.
double process_used_percent = 5;
// This is the kernel's notion of free memory.
uint64 free = 6;
}
// DownloadPersistentCachePeerFinishedRequest represents persistent cache peer download finished request of AnnouncePersistentCachePeerRequest.
message DownloadPersistentCachePeerFinishedRequest {
// Total piece count.
uint32 piece_count = 1;
// Network Stat.
message Network {
// Return count of tcp connections opened and status is ESTABLISHED.
uint32 tcp_connection_count = 1;
// Return count of upload tcp connections opened and status is ESTABLISHED.
uint32 upload_tcp_connection_count = 2;
// Security domain for network.
string security_domain = 3;
// Location path(area|country|province|city|...).
string location = 4;
// IDC where the peer host is located
string idc = 5;
}
// DownloadPersistentCachePeerFailedRequest represents persistent cache peer download failed request of AnnouncePersistentCachePeerRequest.
message DownloadPersistentCachePeerFailedRequest {
// The description of the download failed.
optional string description = 1;
// Disk Stat.
message Disk {
// Total amount of disk on the data path of dragonfly.
uint64 total = 1;
// Free amount of disk on the data path of dragonfly.
uint64 free = 2;
// Used amount of disk on the data path of dragonfly.
uint64 used = 3;
// Used percent of disk on the data path of dragonfly directory.
double used_percent = 4;
// Total amount of indoes on the data path of dragonfly directory.
uint64 inodes_total = 5;
// Used amount of indoes on the data path of dragonfly directory.
uint64 inodes_used = 6;
// Free amount of indoes on the data path of dragonfly directory.
uint64 inodes_free = 7;
// Used percent of indoes on the data path of dragonfly directory.
double inodes_used_percent = 8;
}
// AnnouncePersistentCachePeerRequest represents request of AnnouncePersistentCachePeer.
message AnnouncePersistentCachePeerRequest {
// Build information.
message Build {
// Git version.
string git_version = 1;
// Git commit.
string git_commit = 2;
// Golang version.
string go_version = 3;
// Build platform.
string platform = 4;
}
// LeaveHostRequest represents request of LeaveHost.
message LeaveHostRequest{
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Peer id.
string peer_id = 3;
string id = 1;
}
// Probe information.
message Probe {
// Host metadata.
common.Host host = 1;
// RTT is the round-trip time sent via this pinger.
google.protobuf.Duration rtt = 2;
// Task update time.
google.protobuf.Timestamp updated_at = 3;
}
// ProbesOfHost represents probes information of the host.
message ProbesOfHost {
// Host metadata.
common.Host host = 1;
// Probes information.
repeated Probe probes = 2;
}
// SyncProbesRequest represents request of SyncProbes.
message SyncProbesRequest {
// Probes information of the host.
ProbesOfHost probes_of_host = 1;
}
// SyncProbesResponse represents response of SyncProbes.
message SyncProbesResponse {
// Hosts needs to be probed.
repeated common.Host hosts = 1;
// Probe interval.
google.protobuf.Duration probe_interval = 2;
}
// UpdateHostsRequest represents update hosts request of SyncNetworkTopologyRequest.
message UpdateHostsRequest {
// Hosts needs to be updated.
repeated ProbesOfHost probes_of_hosts = 1;
}
// DeleteHostsRequest represents delete hosts request of SyncNetworkTopologyRequest.
message DeleteHostsRequest {
// Hosts needs to be deleted.
repeated ProbesOfHost probes_of_hosts = 1;
}
// SyncProbesRequest represents request of SyncProbes.
message SyncNetworkTopologyRequest {
oneof request {
RegisterPersistentCachePeerRequest register_persistent_cache_peer_request = 4;
DownloadPersistentCachePeerStartedRequest download_persistent_cache_peer_started_request = 5;
ReschedulePersistentCachePeerRequest reschedule_persistent_cache_peer_request = 6;
DownloadPersistentCachePeerFinishedRequest download_persistent_cache_peer_finished_request = 7;
DownloadPersistentCachePeerFailedRequest download_persistent_cache_peer_failed_request = 8;
DownloadPieceFinishedRequest download_piece_finished_request = 9;
DownloadPieceFailedRequest download_piece_failed_request = 10;
UpdateHostsRequest update_probes_of_hosts_request = 1;
DeleteHostsRequest delete_probes_of_hosts_request = 2;
}
}
// EmptyPersistentCacheTaskResponse represents empty persistent cache task response of AnnouncePersistentCachePeerResponse.
message EmptyPersistentCacheTaskResponse {
}
// NormalPersistentCacheTaskResponse represents normal persistent cache task response of AnnouncePersistentCachePeerResponse.
message NormalPersistentCacheTaskResponse {
// Candidate parents.
repeated common.v2.PersistentCachePeer candidate_cache_parents = 1;
}
// AnnouncePersistentCachePeerResponse represents response of AnnouncePersistentCachePeer.
message AnnouncePersistentCachePeerResponse {
oneof response {
EmptyPersistentCacheTaskResponse empty_persistent_cache_task_response = 1;
NormalPersistentCacheTaskResponse normal_persistent_cache_task_response = 2;
}
}
// StatPersistentCachePeerRequest represents request of StatPersistentCachePeer.
message StatPersistentCachePeerRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Peer id.
string peer_id = 3;
}
// DeletePersistentCachePeerRequest represents request of DeletePersistentCachePeer.
message DeletePersistentCachePeerRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Peer id.
string peer_id = 3;
}
// UploadPersistentCacheTaskStartedRequest represents upload persistent cache task started request of UploadPersistentCacheTaskStarted.
message UploadPersistentCacheTaskStartedRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Peer id.
string peer_id = 3;
// Replica count of the persistent cache task.
uint64 persistent_replica_count = 4;
// Tag is used to distinguish different persistent cache tasks.
optional string tag = 5;
// Application of task.
optional string application = 6;
// Task piece length, the value needs to be greater than or equal to 4194304(4MiB).
uint64 piece_length = 7;
// Task content length.
uint64 content_length = 8;
// Task piece count.
uint32 piece_count = 9;
// TTL of the persistent cache task.
google.protobuf.Duration ttl = 10;
}
// UploadPersistentCacheTaskFinishedRequest represents upload persistent cache task finished request of UploadPersistentCacheTaskFinished.
message UploadPersistentCacheTaskFinishedRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Peer id.
string peer_id = 3;
}
// UploadPersistentCacheTaskFailedRequest represents upload persistent cache task failed request of UploadPersistentCacheTaskFailed.
message UploadPersistentCacheTaskFailedRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Peer id.
string peer_id = 3;
// The description of the upload failed.
optional string description = 4;
}
// StatPersistentCacheTaskRequest represents request of StatPersistentCacheTask.
message StatPersistentCacheTaskRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
}
// DeletePersistentCacheTaskRequest represents request of DeletePersistentCacheTask.
message DeletePersistentCacheTaskRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
}
// Scheduler RPC Service.
service Scheduler {
service Scheduler{
// AnnouncePeer announces peer to scheduler.
rpc AnnouncePeer(stream AnnouncePeerRequest) returns(stream AnnouncePeerResponse);
// Checks information of peer.
rpc StatPeer(StatPeerRequest)returns(common.v2.Peer);
rpc StatPeer(StatPeerRequest)returns(common.Peer);
// DeletePeer releases peer in scheduler.
rpc DeletePeer(DeletePeerRequest)returns(google.protobuf.Empty);
// LeavePeer releases peer in scheduler.
rpc LeavePeer(LeavePeerRequest)returns(google.protobuf.Empty);
// TODO exchange peer api definition.
// ExchangePeer exchanges peer information.
rpc ExchangePeer(ExchangePeerRequest)returns(ExchangePeerResponse);
// Checks information of task.
rpc StatTask(StatTaskRequest)returns(common.v2.Task);
// DeleteTask releases task in scheduler.
rpc DeleteTask(DeleteTaskRequest)returns(google.protobuf.Empty);
rpc StatTask(StatTaskRequest)returns(common.Task);
// AnnounceHost announces host to scheduler.
rpc AnnounceHost(AnnounceHostRequest)returns(google.protobuf.Empty);
// ListHosts lists hosts in scheduler.
rpc ListHosts(google.protobuf.Empty)returns(ListHostsResponse);
// LeaveHost releases host in scheduler.
rpc LeaveHost(LeaveHostRequest)returns(google.protobuf.Empty);
// DeleteHost releases host in scheduler.
rpc DeleteHost(DeleteHostRequest)returns(google.protobuf.Empty);
// SyncProbes sync probes of the host.
rpc SyncProbes(stream SyncProbesRequest)returns(stream SyncProbesResponse);
// AnnouncePersistentCachePeer announces persistent cache peer to scheduler.
rpc AnnouncePersistentCachePeer(stream AnnouncePersistentCachePeerRequest) returns(stream AnnouncePersistentCachePeerResponse);
// Checks information of persistent cache peer.
rpc StatPersistentCachePeer(StatPersistentCachePeerRequest)returns(common.v2.PersistentCachePeer);
// DeletePersistentCachePeer releases persistent cache peer in scheduler.
rpc DeletePersistentCachePeer(DeletePersistentCachePeerRequest)returns(google.protobuf.Empty);
// UploadPersistentCacheTaskStarted uploads persistent cache task started to scheduler.
rpc UploadPersistentCacheTaskStarted(UploadPersistentCacheTaskStartedRequest)returns(google.protobuf.Empty);
// UploadPersistentCacheTaskFinished uploads persistent cache task finished to scheduler.
rpc UploadPersistentCacheTaskFinished(UploadPersistentCacheTaskFinishedRequest)returns(common.v2.PersistentCacheTask);
// UploadPersistentCacheTaskFailed uploads persistent cache task failed to scheduler.
rpc UploadPersistentCacheTaskFailed(UploadPersistentCacheTaskFailedRequest)returns(google.protobuf.Empty);
// Checks information of persistent cache task.
rpc StatPersistentCacheTask(StatPersistentCacheTaskRequest)returns(common.v2.PersistentCacheTask);
// DeletePersistentCacheTask releases persistent cache task in scheduler.
rpc DeletePersistentCacheTask(DeletePersistentCacheTaskRequest)returns(google.protobuf.Empty);
// SyncNetworkTopology sync network topology of the hosts.
rpc SyncNetworkTopology(stream SyncNetworkTopologyRequest)returns(google.protobuf.Empty);
}

51
proto/security.proto Normal file
View File

@ -0,0 +1,51 @@
/*
* Copyright 2022 The Dragonfly Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto3";
package security;
import "google/protobuf/duration.proto";
// Refer: https://github.com/istio/api/blob/master/security/v1alpha1/ca.proto
// Istio defines similar api for signing certificate, but it's not applicable in Dragonfly.
// Certificate request type.
// Dragonfly supports peers authentication with Mutual TLS(mTLS)
// For mTLS, all peers need to request TLS certificates for communicating
// The server side may overwrite ant requested certificate filed based on its policies.
message CertificateRequest {
// ASN.1 DER form certificate request.
// The public key in the CSR is used to generate the certificate,
// and other fields in the generated certificate may be overwritten by the CA.
bytes csr = 1;
// Optional: requested certificate validity period.
google.protobuf.Duration validity_period = 2;
}
// Certificate response type.
message CertificateResponse {
// ASN.1 DER form certificate chain.
repeated bytes certificate_chain = 1;
}
// Service for managing certificates issued by the CA.
service CertificateService {
// Using provided CSR, returns a signed certificate.
rpc IssueCertificate(CertificateRequest)
returns (CertificateResponse) {
}
}

404
src/common.rs Normal file
View File

@ -0,0 +1,404 @@
/// Peer metadata.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Peer {
/// Peer id.
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// Range is url range of request.
#[prost(message, optional, tag = "2")]
pub range: ::core::option::Option<Range>,
/// Peer priority.
#[prost(enumeration = "Priority", tag = "3")]
pub priority: i32,
/// Pieces of peer.
#[prost(message, repeated, tag = "4")]
pub pieces: ::prost::alloc::vec::Vec<Piece>,
/// Peer downloads costs time.
#[prost(message, optional, tag = "5")]
pub cost: ::core::option::Option<::prost_types::Duration>,
/// Peer state.
#[prost(string, tag = "6")]
pub state: ::prost::alloc::string::String,
/// Task info.
#[prost(message, optional, tag = "7")]
pub task: ::core::option::Option<Task>,
/// Host info.
#[prost(message, optional, tag = "8")]
pub host: ::core::option::Option<Host>,
/// NeedBackToSource needs downloaded from source.
#[prost(bool, tag = "9")]
pub need_back_to_source: bool,
/// Peer create time.
#[prost(message, optional, tag = "10")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
/// Peer update time.
#[prost(message, optional, tag = "11")]
pub updated_at: ::core::option::Option<::prost_types::Timestamp>,
}
/// Task metadata.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Task {
/// Task id.
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// Task type.
#[prost(enumeration = "TaskType", tag = "2")]
pub r#type: i32,
/// Download url.
#[prost(string, tag = "3")]
pub url: ::prost::alloc::string::String,
/// Digest of the pieces digest, for example md5:xxx or sha256:yyy.
#[prost(string, tag = "4")]
pub digest: ::prost::alloc::string::String,
/// URL tag identifies different task for same url.
#[prost(string, tag = "5")]
pub tag: ::prost::alloc::string::String,
/// Application of task.
#[prost(string, tag = "6")]
pub application: ::prost::alloc::string::String,
/// Filter url used to generate task id.
#[prost(string, repeated, tag = "7")]
pub filters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Task request headers.
#[prost(map = "string, string", tag = "8")]
pub header: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Task piece length.
#[prost(int32, tag = "9")]
pub piece_length: i32,
/// Task content length.
#[prost(int64, tag = "10")]
pub content_length: i64,
/// Task piece count.
#[prost(int64, tag = "11")]
pub piece_count: i64,
/// Task size scope.
#[prost(enumeration = "SizeScope", tag = "12")]
pub size_scope: i32,
/// Pieces of task.
#[prost(message, repeated, tag = "13")]
pub pieces: ::prost::alloc::vec::Vec<Piece>,
/// Task state.
#[prost(string, tag = "14")]
pub state: ::prost::alloc::string::String,
/// Task peer count.
#[prost(int32, tag = "15")]
pub peer_count: i32,
/// Task contains available peer.
#[prost(bool, tag = "16")]
pub has_available_peer: bool,
/// Task create time.
#[prost(message, optional, tag = "17")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
/// Task update time.
#[prost(message, optional, tag = "18")]
pub updated_at: ::core::option::Option<::prost_types::Timestamp>,
}
/// Host metadata.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Host {
/// Host id.
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// Host ip.
#[prost(string, tag = "2")]
pub ip: ::prost::alloc::string::String,
/// Peer hostname.
#[prost(string, tag = "3")]
pub hostname: ::prost::alloc::string::String,
/// Port of grpc service.
#[prost(int32, tag = "4")]
pub port: i32,
/// Port of download server.
#[prost(int32, tag = "5")]
pub download_port: i32,
/// Security domain for network.
#[prost(string, tag = "6")]
pub security_domain: ::prost::alloc::string::String,
/// Host location, eg: area|country|province|city.
#[prost(string, tag = "7")]
pub location: ::prost::alloc::string::String,
/// IDC where the peer host is located.
#[prost(string, tag = "8")]
pub idc: ::prost::alloc::string::String,
}
/// Range represents download range.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Range {
/// Start of range.
#[prost(int64, tag = "1")]
pub start: i64,
/// Length of range.
#[prost(int64, tag = "2")]
pub length: i64,
}
/// Download information.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Download {
/// Download url.
#[prost(string, tag = "1")]
pub url: ::prost::alloc::string::String,
/// Digest of the pieces digest, for example md5:xxx or sha256:yyy.
#[prost(string, tag = "2")]
pub digest: ::prost::alloc::string::String,
/// Range is url range of request.
#[prost(message, optional, tag = "3")]
pub range: ::core::option::Option<Range>,
/// Task type.
#[prost(enumeration = "TaskType", tag = "4")]
pub r#type: i32,
/// URL tag identifies different task for same url.
#[prost(string, tag = "5")]
pub tag: ::prost::alloc::string::String,
/// Application of task.
#[prost(string, tag = "6")]
pub application: ::prost::alloc::string::String,
/// Peer priority.
#[prost(enumeration = "Priority", tag = "7")]
pub priority: i32,
/// Filter url used to generate task id.
#[prost(string, repeated, tag = "8")]
pub filters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Task request headers.
#[prost(map = "string, string", tag = "9")]
pub header: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Task piece length.
#[prost(int32, tag = "10")]
pub piece_length: i32,
/// File path to be exported.
#[prost(string, tag = "11")]
pub output_path: ::prost::alloc::string::String,
/// Download timeout.
#[prost(message, optional, tag = "12")]
pub timeout: ::core::option::Option<::prost_types::Duration>,
/// Download rate limit in bytes per second.
#[prost(double, tag = "13")]
pub download_rate_limit: f64,
/// NeedBackToSource needs downloaded from source.
#[prost(bool, tag = "14")]
pub need_back_to_source: bool,
}
/// Piece represents information of piece.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Piece {
/// Piece number.
#[prost(int32, tag = "1")]
pub number: i32,
/// Parent peer id.
#[prost(string, tag = "2")]
pub parent_id: ::prost::alloc::string::String,
/// Piece offset.
#[prost(uint64, tag = "3")]
pub offset: u64,
/// Piece length.
#[prost(uint64, tag = "4")]
pub length: u64,
/// Digest of the piece data, for example md5:xxx or sha256:yyy.
#[prost(string, tag = "5")]
pub digest: ::prost::alloc::string::String,
/// Traffic type.
#[prost(enumeration = "TrafficType", tag = "6")]
pub traffic_type: i32,
/// Downloading piece costs time.
#[prost(message, optional, tag = "7")]
pub cost: ::core::option::Option<::prost_types::Duration>,
/// Piece create time.
#[prost(message, optional, tag = "8")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
}
/// ExtendAttribute represents extend of attribution.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExtendAttribute {
/// Task response header, eg: HTTP Response Header
#[prost(map = "string, string", tag = "1")]
pub header: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Task response code, eg: HTTP Status Code
#[prost(int32, tag = "2")]
pub status_code: i32,
/// Task response status, eg: HTTP Status
#[prost(string, tag = "3")]
pub status: ::prost::alloc::string::String,
}
/// SizeScope represents size scope of task.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SizeScope {
/// size > one piece size.
Normal = 0,
/// 128 byte < size <= one piece size and be plain type.
Small = 1,
/// size <= 128 byte and be plain type.
Tiny = 2,
/// size == 0 byte and be plain type.
Empty = 3,
}
impl SizeScope {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
SizeScope::Normal => "NORMAL",
SizeScope::Small => "SMALL",
SizeScope::Tiny => "TINY",
SizeScope::Empty => "EMPTY",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NORMAL" => Some(Self::Normal),
"SMALL" => Some(Self::Small),
"TINY" => Some(Self::Tiny),
"EMPTY" => Some(Self::Empty),
_ => None,
}
}
}
/// TaskType represents type of task.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TaskType {
/// DFDAEMON is dfdeamon type of task,
/// dfdeamon task is a normal p2p task.
Dfdaemon = 0,
/// DFCACHE is dfcache type of task,
/// dfcache task is a cache task, and the task url is fake url.
/// It can only be used for caching and cannot be downloaded back to source.
Dfcache = 1,
/// DFSTORE is dfstore type of task,
/// dfstore task is a persistent task in backend.
Dfstore = 2,
}
impl TaskType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
TaskType::Dfdaemon => "DFDAEMON",
TaskType::Dfcache => "DFCACHE",
TaskType::Dfstore => "DFSTORE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DFDAEMON" => Some(Self::Dfdaemon),
"DFCACHE" => Some(Self::Dfcache),
"DFSTORE" => Some(Self::Dfstore),
_ => None,
}
}
}
/// TrafficType represents type of traffic.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TrafficType {
/// BACK_TO_SOURCE is to download traffic from the source.
BackToSource = 0,
/// REMOTE_PEER is to download traffic from the remote peer.
RemotePeer = 1,
/// LOCAL_PEER is to download traffic from the local peer.
LocalPeer = 2,
}
impl TrafficType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
TrafficType::BackToSource => "BACK_TO_SOURCE",
TrafficType::RemotePeer => "REMOTE_PEER",
TrafficType::LocalPeer => "LOCAL_PEER",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"BACK_TO_SOURCE" => Some(Self::BackToSource),
"REMOTE_PEER" => Some(Self::RemotePeer),
"LOCAL_PEER" => Some(Self::LocalPeer),
_ => None,
}
}
}
/// Priority represents priority of application.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Priority {
/// LEVEL0 has no special meaning for scheduler.
Level0 = 0,
/// LEVEL1 represents the download task is forbidden,
/// and an error code is returned during the registration.
Level1 = 1,
/// LEVEL2 represents when the task is downloaded for the first time,
/// allow peers to download from the other peers,
/// but not back-to-source. When the task is not downloaded for
/// the first time, it is scheduled normally.
Level2 = 2,
/// LEVEL3 represents when the task is downloaded for the first time,
/// the normal peer is first to download back-to-source.
/// When the task is not downloaded for the first time, it is scheduled normally.
Level3 = 3,
/// LEVEL4 represents when the task is downloaded for the first time,
/// the weak peer is first triggered to back-to-source.
/// When the task is not downloaded for the first time, it is scheduled normally.
Level4 = 4,
/// LEVEL5 represents when the task is downloaded for the first time,
/// the strong peer is first triggered to back-to-source.
/// When the task is not downloaded for the first time, it is scheduled normally.
Level5 = 5,
/// LEVEL6 represents when the task is downloaded for the first time,
/// the super peer is first triggered to back-to-source.
/// When the task is not downloaded for the first time, it is scheduled normally.
Level6 = 6,
}
impl Priority {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Priority::Level0 => "LEVEL0",
Priority::Level1 => "LEVEL1",
Priority::Level2 => "LEVEL2",
Priority::Level3 => "LEVEL3",
Priority::Level4 => "LEVEL4",
Priority::Level5 => "LEVEL5",
Priority::Level6 => "LEVEL6",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"LEVEL0" => Some(Self::Level0),
"LEVEL1" => Some(Self::Level1),
"LEVEL2" => Some(Self::Level2),
"LEVEL3" => Some(Self::Level3),
"LEVEL4" => Some(Self::Level4),
"LEVEL5" => Some(Self::Level5),
"LEVEL6" => Some(Self::Level6),
_ => None,
}
}
}

View File

@ -1,779 +0,0 @@
// This file is @generated by prost-build.
/// Peer metadata.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Peer {
/// Peer id.
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// Range is url range of request.
#[prost(message, optional, tag = "2")]
pub range: ::core::option::Option<Range>,
/// Peer priority.
#[prost(enumeration = "Priority", tag = "3")]
pub priority: i32,
/// Pieces of peer.
#[prost(message, repeated, tag = "4")]
pub pieces: ::prost::alloc::vec::Vec<Piece>,
/// Peer downloads costs time.
#[prost(message, optional, tag = "5")]
pub cost: ::core::option::Option<::prost_wkt_types::Duration>,
/// Peer state.
#[prost(string, tag = "6")]
pub state: ::prost::alloc::string::String,
/// Task info.
#[prost(message, optional, tag = "7")]
pub task: ::core::option::Option<Task>,
/// Host info.
#[prost(message, optional, tag = "8")]
pub host: ::core::option::Option<Host>,
/// NeedBackToSource needs downloaded from source.
#[prost(bool, tag = "9")]
pub need_back_to_source: bool,
/// Peer create time.
#[prost(message, optional, tag = "10")]
pub created_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
/// Peer update time.
#[prost(message, optional, tag = "11")]
pub updated_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
}
/// PersistentCachePeer metadata.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PersistentCachePeer {
/// Peer id.
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// Persistent represents whether the persistent cache peer is persistent.
/// If the persistent cache peer is persistent, the persistent cache peer will
/// not be deleted when dfdaemon runs garbage collection. It only be deleted
/// when the task is deleted by the user.
#[prost(bool, tag = "2")]
pub persistent: bool,
/// Peer downloads costs time.
#[prost(message, optional, tag = "3")]
pub cost: ::core::option::Option<::prost_wkt_types::Duration>,
/// Peer state.
#[prost(string, tag = "4")]
pub state: ::prost::alloc::string::String,
/// Persistent task info.
#[prost(message, optional, tag = "5")]
pub task: ::core::option::Option<PersistentCacheTask>,
/// Host info.
#[prost(message, optional, tag = "6")]
pub host: ::core::option::Option<Host>,
/// Peer create time.
#[prost(message, optional, tag = "7")]
pub created_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
/// Peer update time.
#[prost(message, optional, tag = "8")]
pub updated_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
}
/// Task metadata.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Task {
/// Task id.
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// Task type.
#[prost(enumeration = "TaskType", tag = "2")]
pub r#type: i32,
/// Download url.
#[prost(string, tag = "3")]
pub url: ::prost::alloc::string::String,
/// Verifies task data integrity after download using a digest. Supports CRC32, SHA256, and SHA512 algorithms.
/// Format: `<algorithm>:<hash>`, e.g., `crc32:xxx`, `sha256:yyy`, `sha512:zzz`.
/// Returns an error if the computed digest mismatches the expected value.
///
/// Performance
/// Digest calculation increases processing time. Enable only when data integrity verification is critical.
#[prost(string, optional, tag = "4")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
/// URL tag identifies different task for same url.
#[prost(string, optional, tag = "5")]
pub tag: ::core::option::Option<::prost::alloc::string::String>,
/// Application of task.
#[prost(string, optional, tag = "6")]
pub application: ::core::option::Option<::prost::alloc::string::String>,
/// Filtered query params to generate the task id.
/// When filter is \["Signature", "Expires", "ns"\], for example:
/// <http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io> and <http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io>
/// will generate the same task id.
/// Default value includes the filtered query params of s3, gcs, oss, obs, cos.
#[prost(string, repeated, tag = "7")]
pub filtered_query_params: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Task request headers.
#[prost(map = "string, string", tag = "8")]
pub request_header: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Task content length.
#[prost(uint64, tag = "9")]
pub content_length: u64,
/// Task piece count.
#[prost(uint32, tag = "10")]
pub piece_count: u32,
/// Task size scope.
#[prost(enumeration = "SizeScope", tag = "11")]
pub size_scope: i32,
/// Pieces of task.
#[prost(message, repeated, tag = "12")]
pub pieces: ::prost::alloc::vec::Vec<Piece>,
/// Task state.
#[prost(string, tag = "13")]
pub state: ::prost::alloc::string::String,
/// Task peer count.
#[prost(uint32, tag = "14")]
pub peer_count: u32,
/// Task contains available peer.
#[prost(bool, tag = "15")]
pub has_available_peer: bool,
/// Task create time.
#[prost(message, optional, tag = "16")]
pub created_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
/// Task update time.
#[prost(message, optional, tag = "17")]
pub updated_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
}
/// PersistentCacheTask metadata.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PersistentCacheTask {
/// Task id.
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// Replica count of the persistent cache task. The persistent cache task will
/// not be deleted when dfdamon runs garbage collection. It only be deleted
/// when the task is deleted by the user.
#[prost(uint64, tag = "2")]
pub persistent_replica_count: u64,
/// Current replica count of the persistent cache task. The persistent cache task
/// will not be deleted when dfdaemon runs garbage collection. It only be deleted
/// when the task is deleted by the user.
#[prost(uint64, tag = "3")]
pub current_persistent_replica_count: u64,
/// Current replica count of the cache task. If cache task is not persistent,
/// the persistent cache task will be deleted when dfdaemon runs garbage collection.
#[prost(uint64, tag = "4")]
pub current_replica_count: u64,
/// Tag is used to distinguish different persistent cache tasks.
#[prost(string, optional, tag = "5")]
pub tag: ::core::option::Option<::prost::alloc::string::String>,
/// Application of task.
#[prost(string, optional, tag = "6")]
pub application: ::core::option::Option<::prost::alloc::string::String>,
/// Task piece length.
#[prost(uint64, tag = "7")]
pub piece_length: u64,
/// Task content length.
#[prost(uint64, tag = "8")]
pub content_length: u64,
/// Task piece count.
#[prost(uint32, tag = "9")]
pub piece_count: u32,
/// Task state.
#[prost(string, tag = "10")]
pub state: ::prost::alloc::string::String,
/// TTL of the persistent cache task.
#[prost(message, optional, tag = "11")]
pub ttl: ::core::option::Option<::prost_wkt_types::Duration>,
/// Task create time.
#[prost(message, optional, tag = "12")]
pub created_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
/// Task update time.
#[prost(message, optional, tag = "13")]
pub updated_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
}
/// Host metadata.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Host {
/// Host id.
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// Host type.
#[prost(uint32, tag = "2")]
pub r#type: u32,
/// Hostname.
#[prost(string, tag = "3")]
pub hostname: ::prost::alloc::string::String,
/// Host ip.
#[prost(string, tag = "4")]
pub ip: ::prost::alloc::string::String,
/// Port of grpc service.
#[prost(int32, tag = "5")]
pub port: i32,
/// Port of download server.
#[prost(int32, tag = "6")]
pub download_port: i32,
/// Host OS.
#[prost(string, tag = "7")]
pub os: ::prost::alloc::string::String,
/// Host platform.
#[prost(string, tag = "8")]
pub platform: ::prost::alloc::string::String,
/// Host platform family.
#[prost(string, tag = "9")]
pub platform_family: ::prost::alloc::string::String,
/// Host platform version.
#[prost(string, tag = "10")]
pub platform_version: ::prost::alloc::string::String,
/// Host kernel version.
#[prost(string, tag = "11")]
pub kernel_version: ::prost::alloc::string::String,
/// CPU Stat.
#[prost(message, optional, tag = "12")]
pub cpu: ::core::option::Option<Cpu>,
/// Memory Stat.
#[prost(message, optional, tag = "13")]
pub memory: ::core::option::Option<Memory>,
/// Network Stat.
#[prost(message, optional, tag = "14")]
pub network: ::core::option::Option<Network>,
/// Disk Stat.
#[prost(message, optional, tag = "15")]
pub disk: ::core::option::Option<Disk>,
/// Build information.
#[prost(message, optional, tag = "16")]
pub build: ::core::option::Option<Build>,
/// ID of the cluster to which the host belongs.
#[prost(uint64, tag = "17")]
pub scheduler_cluster_id: u64,
/// Disable shared data for other peers.
#[prost(bool, tag = "18")]
pub disable_shared: bool,
}
/// CPU Stat.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Cpu {
/// Number of logical cores in the system.
#[prost(uint32, tag = "1")]
pub logical_count: u32,
/// Number of physical cores in the system
#[prost(uint32, tag = "2")]
pub physical_count: u32,
/// Percent calculates the percentage of cpu used.
#[prost(double, tag = "3")]
pub percent: f64,
/// Calculates the percentage of cpu used by process.
#[prost(double, tag = "4")]
pub process_percent: f64,
/// CPUTimes contains the amounts of time the CPU has spent performing different kinds of work.
#[prost(message, optional, tag = "5")]
pub times: ::core::option::Option<CpuTimes>,
}
/// CPUTimes contains the amounts of time the CPU has spent performing different
/// kinds of work. Time units are in seconds.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CpuTimes {
/// CPU time of user.
#[prost(double, tag = "1")]
pub user: f64,
/// CPU time of system.
#[prost(double, tag = "2")]
pub system: f64,
/// CPU time of idle.
#[prost(double, tag = "3")]
pub idle: f64,
/// CPU time of nice.
#[prost(double, tag = "4")]
pub nice: f64,
/// CPU time of iowait.
#[prost(double, tag = "5")]
pub iowait: f64,
/// CPU time of irq.
#[prost(double, tag = "6")]
pub irq: f64,
/// CPU time of softirq.
#[prost(double, tag = "7")]
pub softirq: f64,
/// CPU time of steal.
#[prost(double, tag = "8")]
pub steal: f64,
/// CPU time of guest.
#[prost(double, tag = "9")]
pub guest: f64,
/// CPU time of guest nice.
#[prost(double, tag = "10")]
pub guest_nice: f64,
}
/// Memory Stat.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Memory {
/// Total amount of RAM on this system.
#[prost(uint64, tag = "1")]
pub total: u64,
/// RAM available for programs to allocate.
#[prost(uint64, tag = "2")]
pub available: u64,
/// RAM used by programs.
#[prost(uint64, tag = "3")]
pub used: u64,
/// Percentage of RAM used by programs.
#[prost(double, tag = "4")]
pub used_percent: f64,
/// Calculates the percentage of memory used by process.
#[prost(double, tag = "5")]
pub process_used_percent: f64,
/// This is the kernel's notion of free memory.
#[prost(uint64, tag = "6")]
pub free: u64,
}
/// Network Stat.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Network {
/// Return count of tcp connections opened and status is ESTABLISHED.
#[prost(uint32, tag = "1")]
pub tcp_connection_count: u32,
/// Return count of upload tcp connections opened and status is ESTABLISHED.
#[prost(uint32, tag = "2")]
pub upload_tcp_connection_count: u32,
/// Location path(area|country|province|city|...).
#[prost(string, optional, tag = "3")]
pub location: ::core::option::Option<::prost::alloc::string::String>,
/// IDC where the peer host is located
#[prost(string, optional, tag = "4")]
pub idc: ::core::option::Option<::prost::alloc::string::String>,
/// Download rate is received bytes per second.
#[prost(uint64, tag = "5")]
pub download_rate: u64,
/// Download rate is the limit of received bytes per second.
#[prost(uint64, tag = "6")]
pub download_rate_limit: u64,
/// Upload rate is transmitted bytes per second.
#[prost(uint64, tag = "7")]
pub upload_rate: u64,
/// Upload rate is the limit of transmitted bytes per second.
#[prost(uint64, tag = "8")]
pub upload_rate_limit: u64,
}
/// Disk Stat.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Disk {
/// Total amount of disk on the data path of dragonfly.
#[prost(uint64, tag = "1")]
pub total: u64,
/// Free amount of disk on the data path of dragonfly.
#[prost(uint64, tag = "2")]
pub free: u64,
/// Used amount of disk on the data path of dragonfly.
#[prost(uint64, tag = "3")]
pub used: u64,
/// Used percent of disk on the data path of dragonfly directory.
#[prost(double, tag = "4")]
pub used_percent: f64,
/// Total amount of indoes on the data path of dragonfly directory.
#[prost(uint64, tag = "5")]
pub inodes_total: u64,
/// Used amount of indoes on the data path of dragonfly directory.
#[prost(uint64, tag = "6")]
pub inodes_used: u64,
/// Free amount of indoes on the data path of dragonfly directory.
#[prost(uint64, tag = "7")]
pub inodes_free: u64,
/// Used percent of indoes on the data path of dragonfly directory.
#[prost(double, tag = "8")]
pub inodes_used_percent: f64,
/// Disk read bandwidth, in bytes per second.
#[prost(uint64, tag = "9")]
pub read_bandwidth: u64,
/// Disk write bandwidth, in bytes per second.
#[prost(uint64, tag = "10")]
pub write_bandwidth: u64,
}
/// Build information.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Build {
/// Git version.
#[prost(string, tag = "1")]
pub git_version: ::prost::alloc::string::String,
/// Git commit.
#[prost(string, optional, tag = "2")]
pub git_commit: ::core::option::Option<::prost::alloc::string::String>,
/// Golang version.
#[prost(string, optional, tag = "3")]
pub go_version: ::core::option::Option<::prost::alloc::string::String>,
/// Rust version.
#[prost(string, optional, tag = "4")]
pub rust_version: ::core::option::Option<::prost::alloc::string::String>,
/// Build platform.
#[prost(string, optional, tag = "5")]
pub platform: ::core::option::Option<::prost::alloc::string::String>,
}
/// Download information.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Download {
/// Download url.
#[prost(string, tag = "1")]
pub url: ::prost::alloc::string::String,
/// Digest of the task digest, for example :xxx or sha256:yyy.
#[prost(string, optional, tag = "2")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
/// Range is url range of request. If protocol is http, range
/// will set in request header. If protocol is others, range
/// will set in range field.
#[prost(message, optional, tag = "3")]
pub range: ::core::option::Option<Range>,
/// Task type.
#[prost(enumeration = "TaskType", tag = "4")]
pub r#type: i32,
/// URL tag identifies different task for same url.
#[prost(string, optional, tag = "5")]
pub tag: ::core::option::Option<::prost::alloc::string::String>,
/// Application of task.
#[prost(string, optional, tag = "6")]
pub application: ::core::option::Option<::prost::alloc::string::String>,
/// Peer priority.
#[prost(enumeration = "Priority", tag = "7")]
pub priority: i32,
/// Filtered query params to generate the task id.
/// When filter is \["Signature", "Expires", "ns"\], for example:
/// <http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io> and <http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io>
/// will generate the same task id.
/// Default value includes the filtered query params of s3, gcs, oss, obs, cos.
#[prost(string, repeated, tag = "8")]
pub filtered_query_params: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Task request headers.
#[prost(map = "string, string", tag = "9")]
pub request_header: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Task piece length.
#[prost(uint64, optional, tag = "10")]
pub piece_length: ::core::option::Option<u64>,
/// File path to be downloaded. If output_path is set, the downloaded file will be saved to the specified path.
/// Dfdaemon will try to create hard link to the output path before starting the download. If hard link creation fails,
/// it will copy the file to the output path after the download is completed.
/// For more details refer to <https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.>
#[prost(string, optional, tag = "11")]
pub output_path: ::core::option::Option<::prost::alloc::string::String>,
/// Download timeout.
#[prost(message, optional, tag = "12")]
pub timeout: ::core::option::Option<::prost_wkt_types::Duration>,
/// Dfdaemon cannot download the task from the source if disable_back_to_source is true.
#[prost(bool, tag = "13")]
pub disable_back_to_source: bool,
/// Scheduler needs to schedule the task downloads from the source if need_back_to_source is true.
#[prost(bool, tag = "14")]
pub need_back_to_source: bool,
/// certificate_chain is the client certs with DER format for the backend client to download back-to-source.
#[prost(bytes = "vec", repeated, tag = "15")]
pub certificate_chain: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
/// Prefetch pre-downloads all pieces of the task when the download task request is a range request.
#[prost(bool, tag = "16")]
pub prefetch: bool,
/// Object storage protocol information.
#[prost(message, optional, tag = "17")]
pub object_storage: ::core::option::Option<ObjectStorage>,
/// HDFS protocol information.
#[prost(message, optional, tag = "18")]
pub hdfs: ::core::option::Option<Hdfs>,
/// is_prefetch is the flag to indicate whether the request is a prefetch request.
#[prost(bool, tag = "19")]
pub is_prefetch: bool,
/// need_piece_content is the flag to indicate whether the response needs to return piece content.
#[prost(bool, tag = "20")]
pub need_piece_content: bool,
/// load_to_cache indicates whether the content downloaded will be stored in the cache storage.
/// Cache storage is designed to store downloaded piece content from preheat tasks,
/// allowing other peers to access the content from memory instead of disk.
#[prost(bool, tag = "21")]
pub load_to_cache: bool,
/// force_hard_link is the flag to indicate whether the download file must be hard linked to the output path.
/// For more details refer to <https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.>
#[prost(bool, tag = "22")]
pub force_hard_link: bool,
/// content_for_calculating_task_id is the content used to calculate the task id.
/// If content_for_calculating_task_id is set, use its value to calculate the task ID.
/// Otherwise, calculate the task ID based on url, piece_length, tag, application, and filtered_query_params.
#[prost(string, optional, tag = "23")]
pub content_for_calculating_task_id: ::core::option::Option<
::prost::alloc::string::String,
>,
/// remote_ip represents the IP address of the client initiating the download request.
/// For proxy requests, it is set to the IP address of the request source.
/// For dfget requests, it is set to the IP address of the dfget.
#[prost(string, optional, tag = "24")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
/// Object Storage related information.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ObjectStorage {
/// Region is the region of the object storage service.
#[prost(string, optional, tag = "1")]
pub region: ::core::option::Option<::prost::alloc::string::String>,
/// Endpoint is the endpoint of the object storage service.
#[prost(string, optional, tag = "2")]
pub endpoint: ::core::option::Option<::prost::alloc::string::String>,
/// Access key that used to access the object storage service.
#[prost(string, optional, tag = "3")]
pub access_key_id: ::core::option::Option<::prost::alloc::string::String>,
/// Access secret that used to access the object storage service.
#[prost(string, optional, tag = "4")]
pub access_key_secret: ::core::option::Option<::prost::alloc::string::String>,
/// Session token that used to access s3 storage service.
#[prost(string, optional, tag = "5")]
pub session_token: ::core::option::Option<::prost::alloc::string::String>,
/// Local path to credential file for Google Cloud Storage service OAuth2 authentication.
#[prost(string, optional, tag = "6")]
pub credential_path: ::core::option::Option<::prost::alloc::string::String>,
/// Predefined ACL that used for the Google Cloud Storage service.
#[prost(string, optional, tag = "7")]
pub predefined_acl: ::core::option::Option<::prost::alloc::string::String>,
}
/// HDFS related information.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Hdfs {
/// Delegation token for Web HDFS operator.
#[prost(string, optional, tag = "1")]
pub delegation_token: ::core::option::Option<::prost::alloc::string::String>,
}
/// Range represents download range.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Range {
/// Start of range.
#[prost(uint64, tag = "1")]
pub start: u64,
/// Length of range.
#[prost(uint64, tag = "2")]
pub length: u64,
}
/// Piece represents information of piece.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Piece {
/// Piece number.
#[prost(uint32, tag = "1")]
pub number: u32,
/// Parent peer id.
#[prost(string, optional, tag = "2")]
pub parent_id: ::core::option::Option<::prost::alloc::string::String>,
/// Piece offset.
#[prost(uint64, tag = "3")]
pub offset: u64,
/// Piece length.
#[prost(uint64, tag = "4")]
pub length: u64,
/// Digest of the piece data, for example blake3:xxx or sha256:yyy.
#[prost(string, tag = "5")]
pub digest: ::prost::alloc::string::String,
/// Piece content.
#[prost(bytes = "vec", optional, tag = "6")]
pub content: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// Traffic type.
#[prost(enumeration = "TrafficType", optional, tag = "7")]
pub traffic_type: ::core::option::Option<i32>,
/// Downloading piece costs time.
#[prost(message, optional, tag = "8")]
pub cost: ::core::option::Option<::prost_wkt_types::Duration>,
/// Piece create time.
#[prost(message, optional, tag = "9")]
pub created_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
}
/// SizeScope represents size scope of task.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SizeScope {
/// size > one piece size.
Normal = 0,
/// 128 byte < size <= one piece size and be plain type.
Small = 1,
/// size <= 128 byte and be plain type.
Tiny = 2,
/// size == 0 byte and be plain type.
Empty = 3,
}
impl SizeScope {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
SizeScope::Normal => "NORMAL",
SizeScope::Small => "SMALL",
SizeScope::Tiny => "TINY",
SizeScope::Empty => "EMPTY",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NORMAL" => Some(Self::Normal),
"SMALL" => Some(Self::Small),
"TINY" => Some(Self::Tiny),
"EMPTY" => Some(Self::Empty),
_ => None,
}
}
}
/// TaskType represents type of task.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TaskType {
/// STANDARD is standard type of task, it can download from source, remote peer and
/// local peer(local cache). When the standard task is never downloaded in the
/// P2P cluster, dfdaemon will download the task from the source. When the standard
/// task is downloaded in the P2P cluster, dfdaemon will download the task from
/// the remote peer or local peer(local cache).
Standard = 0,
/// PERSISTENT is persistent type of task, it can import file and export file in P2P cluster.
/// When the persistent task is imported into the P2P cluster, dfdaemon will store
/// the task in the peer's disk and copy multiple replicas to remote peers to
/// prevent data loss.
Persistent = 1,
/// PERSISTENT_CACHE is persistent cache type of task, it can import file and export file in P2P cluster.
/// When the persistent cache task is imported into the P2P cluster, dfdaemon will store
/// the task in the peer's disk and copy multiple replicas to remote peers to prevent data loss.
/// When the expiration time is reached, task will be deleted in the P2P cluster.
PersistentCache = 2,
}
impl TaskType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
TaskType::Standard => "STANDARD",
TaskType::Persistent => "PERSISTENT",
TaskType::PersistentCache => "PERSISTENT_CACHE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STANDARD" => Some(Self::Standard),
"PERSISTENT" => Some(Self::Persistent),
"PERSISTENT_CACHE" => Some(Self::PersistentCache),
_ => None,
}
}
}
/// TrafficType represents type of traffic.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TrafficType {
/// BACK_TO_SOURCE is to download traffic from the source.
BackToSource = 0,
/// REMOTE_PEER is to download traffic from the remote peer.
RemotePeer = 1,
/// LOCAL_PEER is to download traffic from the local peer.
LocalPeer = 2,
}
impl TrafficType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
TrafficType::BackToSource => "BACK_TO_SOURCE",
TrafficType::RemotePeer => "REMOTE_PEER",
TrafficType::LocalPeer => "LOCAL_PEER",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"BACK_TO_SOURCE" => Some(Self::BackToSource),
"REMOTE_PEER" => Some(Self::RemotePeer),
"LOCAL_PEER" => Some(Self::LocalPeer),
_ => None,
}
}
}
/// Priority represents priority of application.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Priority {
/// LEVEL0 has no special meaning for scheduler.
Level0 = 0,
/// LEVEL1 represents the download task is forbidden,
/// and an error code is returned during the registration.
Level1 = 1,
/// LEVEL2 represents when the task is downloaded for the first time,
/// allow peers to download from the other peers,
/// but not back-to-source. When the task is not downloaded for
/// the first time, it is scheduled normally.
Level2 = 2,
/// LEVEL3 represents when the task is downloaded for the first time,
/// the normal peer is first to download back-to-source.
/// When the task is not downloaded for the first time, it is scheduled normally.
Level3 = 3,
/// LEVEL4 represents when the task is downloaded for the first time,
/// the weak peer is first triggered to back-to-source.
/// When the task is not downloaded for the first time, it is scheduled normally.
Level4 = 4,
/// LEVEL5 represents when the task is downloaded for the first time,
/// the strong peer is first triggered to back-to-source.
/// When the task is not downloaded for the first time, it is scheduled normally.
Level5 = 5,
/// LEVEL6 represents when the task is downloaded for the first time,
/// the super peer is first triggered to back-to-source.
/// When the task is not downloaded for the first time, it is scheduled normally.
Level6 = 6,
}
impl Priority {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Priority::Level0 => "LEVEL0",
Priority::Level1 => "LEVEL1",
Priority::Level2 => "LEVEL2",
Priority::Level3 => "LEVEL3",
Priority::Level4 => "LEVEL4",
Priority::Level5 => "LEVEL5",
Priority::Level6 => "LEVEL6",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"LEVEL0" => Some(Self::Level0),
"LEVEL1" => Some(Self::Level1),
"LEVEL2" => Some(Self::Level2),
"LEVEL3" => Some(Self::Level3),
"LEVEL4" => Some(Self::Level4),
"LEVEL5" => Some(Self::Level5),
"LEVEL6" => Some(Self::Level6),
_ => None,
}
}
}

Binary file not shown.

608
src/dfdaemon.rs Normal file
View File

@ -0,0 +1,608 @@
/// InterestedAllPiecesRequest represents interested all pieces request of SyncPiecesRequest.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InterestedAllPiecesRequest {}
/// InterestedPiecesRequest represents interested pieces request of SyncPiecesRequest.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InterestedPiecesRequest {
/// Interested piece numbers.
#[prost(uint32, repeated, tag = "1")]
pub piece_numbers: ::prost::alloc::vec::Vec<u32>,
}
/// SyncPiecesRequest represents request of AnnouncePeer.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SyncPiecesRequest {
#[prost(oneof = "sync_pieces_request::Request", tags = "1, 2")]
pub request: ::core::option::Option<sync_pieces_request::Request>,
}
/// Nested message and enum types in `SyncPiecesRequest`.
pub mod sync_pieces_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Request {
#[prost(message, tag = "1")]
InterestedAllPiecesRequest(super::InterestedAllPiecesRequest),
#[prost(message, tag = "2")]
InterestedPiecesRequest(super::InterestedPiecesRequest),
}
}
/// InterestedPiecesResponse represents interested pieces response of SyncPiecesResponse.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InterestedPiecesResponse {
/// Interested pieces of task.
#[prost(message, repeated, tag = "1")]
pub pieces: ::prost::alloc::vec::Vec<super::common::Piece>,
}
/// SyncPiecesResponse represents response of SyncPieces.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SyncPiecesResponse {
#[prost(oneof = "sync_pieces_response::Response", tags = "1")]
pub response: ::core::option::Option<sync_pieces_response::Response>,
#[prost(oneof = "sync_pieces_response::Errordetails", tags = "3")]
pub errordetails: ::core::option::Option<sync_pieces_response::Errordetails>,
}
/// Nested message and enum types in `SyncPiecesResponse`.
pub mod sync_pieces_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Response {
#[prost(message, tag = "1")]
InterestedPiecesResponse(super::InterestedPiecesResponse),
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Errordetails {
#[prost(message, tag = "3")]
SyncPiecesFailed(super::super::errordetails::SyncPiecesFailed),
}
}
/// DownloadTaskRequest represents request of DownloadTask.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadTaskRequest {
/// Download information.
#[prost(message, optional, tag = "1")]
pub download: ::core::option::Option<super::common::Download>,
}
/// UploadTaskRequest represents request of UploadTask.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UploadTaskRequest {
/// Task metadata.
#[prost(message, optional, tag = "1")]
pub task: ::core::option::Option<super::common::Task>,
}
/// StatTaskRequest represents request of StatTask.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatTaskRequest {
/// Task id.
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
}
/// StatTaskResponse represents response of StatTask.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatTaskResponse {
/// Task metadata.
#[prost(message, optional, tag = "1")]
pub task: ::core::option::Option<super::common::Task>,
}
/// DeleteTaskRequest represents request of DeleteTask.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteTaskRequest {
/// Task id.
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod dfdaemon_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Dfdaemon RPC Service.
#[derive(Debug, Clone)]
pub struct DfdaemonClient<T> {
inner: tonic::client::Grpc<T>,
}
impl DfdaemonClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> DfdaemonClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> DfdaemonClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
DfdaemonClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// SyncPieces syncs pieces from the other peers.
pub async fn sync_pieces(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::SyncPiecesRequest>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::SyncPiecesResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.Dfdaemon/SyncPieces",
);
self.inner.streaming(request.into_streaming_request(), path, codec).await
}
/// DownloadTask downloads task back-to-source.
pub async fn download_task(
&mut self,
request: impl tonic::IntoRequest<super::DownloadTaskRequest>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.Dfdaemon/DownloadTask",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// UploadTask uploads task to p2p network.
pub async fn upload_task(
&mut self,
request: impl tonic::IntoRequest<super::UploadTaskRequest>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.Dfdaemon/UploadTask",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// StatTask stats task information.
pub async fn stat_task(
&mut self,
request: impl tonic::IntoRequest<super::StatTaskRequest>,
) -> Result<tonic::Response<super::super::common::Task>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.Dfdaemon/StatTask",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// DeleteTask deletes task from p2p network.
pub async fn delete_task(
&mut self,
request: impl tonic::IntoRequest<super::DeleteTaskRequest>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.Dfdaemon/DeleteTask",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
/// Generated server implementations.
pub mod dfdaemon_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with DfdaemonServer.
#[async_trait]
pub trait Dfdaemon: Send + Sync + 'static {
/// Server streaming response type for the SyncPieces method.
type SyncPiecesStream: futures_core::Stream<
Item = Result<super::SyncPiecesResponse, tonic::Status>,
>
+ Send
+ 'static;
/// SyncPieces syncs pieces from the other peers.
async fn sync_pieces(
&self,
request: tonic::Request<tonic::Streaming<super::SyncPiecesRequest>>,
) -> Result<tonic::Response<Self::SyncPiecesStream>, tonic::Status>;
/// DownloadTask downloads task back-to-source.
async fn download_task(
&self,
request: tonic::Request<super::DownloadTaskRequest>,
) -> Result<tonic::Response<()>, tonic::Status>;
/// UploadTask uploads task to p2p network.
async fn upload_task(
&self,
request: tonic::Request<super::UploadTaskRequest>,
) -> Result<tonic::Response<()>, tonic::Status>;
/// StatTask stats task information.
async fn stat_task(
&self,
request: tonic::Request<super::StatTaskRequest>,
) -> Result<tonic::Response<super::super::common::Task>, tonic::Status>;
/// DeleteTask deletes task from p2p network.
async fn delete_task(
&self,
request: tonic::Request<super::DeleteTaskRequest>,
) -> Result<tonic::Response<()>, tonic::Status>;
}
/// Dfdaemon RPC Service.
#[derive(Debug)]
pub struct DfdaemonServer<T: Dfdaemon> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
}
struct _Inner<T>(Arc<T>);
impl<T: Dfdaemon> DfdaemonServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
/// Enable decompressing requests with the given encoding.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
/// Compress responses with the given encoding, if the client supports it.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for DfdaemonServer<T>
where
T: Dfdaemon,
B: Body + Send + 'static,
B::Error: Into<StdError> + Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/dfdaemon.Dfdaemon/SyncPieces" => {
#[allow(non_camel_case_types)]
struct SyncPiecesSvc<T: Dfdaemon>(pub Arc<T>);
impl<
T: Dfdaemon,
> tonic::server::StreamingService<super::SyncPiecesRequest>
for SyncPiecesSvc<T> {
type Response = super::SyncPiecesResponse;
type ResponseStream = T::SyncPiecesStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
tonic::Streaming<super::SyncPiecesRequest>,
>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).sync_pieces(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = SyncPiecesSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.Dfdaemon/DownloadTask" => {
#[allow(non_camel_case_types)]
struct DownloadTaskSvc<T: Dfdaemon>(pub Arc<T>);
impl<
T: Dfdaemon,
> tonic::server::UnaryService<super::DownloadTaskRequest>
for DownloadTaskSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DownloadTaskRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).download_task(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = DownloadTaskSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.Dfdaemon/UploadTask" => {
#[allow(non_camel_case_types)]
struct UploadTaskSvc<T: Dfdaemon>(pub Arc<T>);
impl<
T: Dfdaemon,
> tonic::server::UnaryService<super::UploadTaskRequest>
for UploadTaskSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UploadTaskRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).upload_task(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = UploadTaskSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.Dfdaemon/StatTask" => {
#[allow(non_camel_case_types)]
struct StatTaskSvc<T: Dfdaemon>(pub Arc<T>);
impl<T: Dfdaemon> tonic::server::UnaryService<super::StatTaskRequest>
for StatTaskSvc<T> {
type Response = super::super::common::Task;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::StatTaskRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).stat_task(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = StatTaskSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.Dfdaemon/DeleteTask" => {
#[allow(non_camel_case_types)]
struct DeleteTaskSvc<T: Dfdaemon>(pub Arc<T>);
impl<
T: Dfdaemon,
> tonic::server::UnaryService<super::DeleteTaskRequest>
for DeleteTaskSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteTaskRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).delete_task(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = DeleteTaskSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: Dfdaemon> Clone for DfdaemonServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
}
}
}
impl<T: Dfdaemon> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: Dfdaemon> tonic::server::NamedService for DfdaemonServer<T> {
const NAME: &'static str = "dfdaemon.Dfdaemon";
}
}

File diff suppressed because it is too large Load Diff

75
src/errordetails.rs Normal file
View File

@ -0,0 +1,75 @@
/// DownloadPeerBackToSourceFailed is error detail of downloading peer back-to-source.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadPeerBackToSourceFailed {
/// The description of the error.
#[prost(string, tag = "1")]
pub description: ::prost::alloc::string::String,
}
/// DownloadPieceBackToSourceFailed is error detail of downloading piece back-to-source.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadPieceBackToSourceFailed {
/// Temporary recoverable error of source.
#[prost(bool, tag = "1")]
pub temporary: bool,
/// Source response metadata, eg: HTTP Status Code, HTTP Status, HTTP Header
#[prost(message, optional, tag = "2")]
pub extend_attribute: ::core::option::Option<super::common::ExtendAttribute>,
/// The number of piece.
#[prost(uint32, tag = "3")]
pub piece_number: u32,
/// The description of the error.
#[prost(string, tag = "4")]
pub description: ::prost::alloc::string::String,
}
/// DownloadPieceFailed is error detail of downloading piece.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadPieceFailed {
/// Temporary recoverable error of parent peer.
#[prost(bool, tag = "1")]
pub temporary: bool,
/// Source response metadata, eg: HTTP Status Code, HTTP Status, HTTP Header
#[prost(message, optional, tag = "2")]
pub extend_attribute: ::core::option::Option<super::common::ExtendAttribute>,
/// Piece is information of piece.
#[prost(string, tag = "3")]
pub parent_id: ::prost::alloc::string::String,
/// The number of piece.
#[prost(uint32, tag = "4")]
pub piece_number: u32,
/// The description of the error.
#[prost(string, tag = "5")]
pub description: ::prost::alloc::string::String,
}
/// SchedulePeerForbidden is error detail of forbidden.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SchedulePeerForbidden {
/// The description of the error.
#[prost(string, tag = "1")]
pub description: ::prost::alloc::string::String,
}
/// SchedulePeerFailed is error detail of scheduling.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SchedulePeerFailed {
/// The description of the error.
#[prost(string, tag = "1")]
pub description: ::prost::alloc::string::String,
}
/// SyncPiecesFailed is error detail of syncing pieces.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SyncPiecesFailed {
/// Temporary recoverable error of parent peer.
#[prost(bool, tag = "1")]
pub temporary: bool,
/// Parent peer id.
#[prost(string, tag = "2")]
pub parent_id: ::prost::alloc::string::String,
/// The description of the error.
#[prost(string, tag = "3")]
pub description: ::prost::alloc::string::String,
}

View File

@ -1,28 +0,0 @@
// This file is @generated by prost-build.
/// Backend is error detail for Backend.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Backend {
/// Backend error message.
#[prost(string, tag = "1")]
pub message: ::prost::alloc::string::String,
/// Backend HTTP response header.
#[prost(map = "string, string", tag = "2")]
pub header: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Backend HTTP status code.
#[prost(int32, optional, tag = "3")]
pub status_code: ::core::option::Option<i32>,
}
/// Unknown is error detail for Unknown.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Unknown {
/// Unknown error message.
#[prost(string, optional, tag = "1")]
pub message: ::core::option::Option<::prost::alloc::string::String>,
}

View File

@ -1,32 +1,6 @@
#[path = ""]
pub mod common {
#[path = "common.v2.rs"]
pub mod v2;
}
#[path = ""]
pub mod errordetails {
#[path = "errordetails.v2.rs"]
pub mod v2;
}
#[path = ""]
pub mod dfdaemon {
#[path = "dfdaemon.v2.rs"]
pub mod v2;
}
#[path = ""]
pub mod manager {
#[path = "manager.v2.rs"]
pub mod v2;
}
#[path = ""]
pub mod scheduler {
#[path = "scheduler.v2.rs"]
pub mod v2;
}
// FILE_DESCRIPTOR_SET is the serialized FileDescriptorSet of the proto files.
pub const FILE_DESCRIPTOR_SET: &[u8] = include_bytes!("descriptor.bin");
pub mod common;
pub mod dfdaemon;
pub mod errordetails;
pub mod manager;
pub mod scheduler;
pub mod security;

2115
src/manager.rs Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1302
src/scheduler.rs Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

269
src/security.rs Normal file
View File

@ -0,0 +1,269 @@
/// Certificate request type.
/// Dragonfly supports peers authentication with Mutual TLS(mTLS)
/// For mTLS, all peers need to request TLS certificates for communicating
/// The server side may overwrite ant requested certificate filed based on its policies.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CertificateRequest {
/// ASN.1 DER form certificate request.
/// The public key in the CSR is used to generate the certificate,
/// and other fields in the generated certificate may be overwritten by the CA.
#[prost(bytes = "vec", tag = "1")]
pub csr: ::prost::alloc::vec::Vec<u8>,
/// Optional: requested certificate validity period.
#[prost(message, optional, tag = "2")]
pub validity_period: ::core::option::Option<::prost_types::Duration>,
}
/// Certificate response type.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CertificateResponse {
/// ASN.1 DER form certificate chain.
#[prost(bytes = "vec", repeated, tag = "1")]
pub certificate_chain: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
}
/// Generated client implementations.
pub mod certificate_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Service for managing certificates issued by the CA.
#[derive(Debug, Clone)]
pub struct CertificateServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl CertificateServiceClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> CertificateServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> CertificateServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
CertificateServiceClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Using provided CSR, returns a signed certificate.
pub async fn issue_certificate(
&mut self,
request: impl tonic::IntoRequest<super::CertificateRequest>,
) -> Result<tonic::Response<super::CertificateResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/security.CertificateService/IssueCertificate",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
/// Generated server implementations.
pub mod certificate_service_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with CertificateServiceServer.
#[async_trait]
pub trait CertificateService: Send + Sync + 'static {
/// Using provided CSR, returns a signed certificate.
async fn issue_certificate(
&self,
request: tonic::Request<super::CertificateRequest>,
) -> Result<tonic::Response<super::CertificateResponse>, tonic::Status>;
}
/// Service for managing certificates issued by the CA.
#[derive(Debug)]
pub struct CertificateServiceServer<T: CertificateService> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
}
struct _Inner<T>(Arc<T>);
impl<T: CertificateService> CertificateServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
/// Enable decompressing requests with the given encoding.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
/// Compress responses with the given encoding, if the client supports it.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for CertificateServiceServer<T>
where
T: CertificateService,
B: Body + Send + 'static,
B::Error: Into<StdError> + Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/security.CertificateService/IssueCertificate" => {
#[allow(non_camel_case_types)]
struct IssueCertificateSvc<T: CertificateService>(pub Arc<T>);
impl<
T: CertificateService,
> tonic::server::UnaryService<super::CertificateRequest>
for IssueCertificateSvc<T> {
type Response = super::CertificateResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CertificateRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).issue_certificate(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = IssueCertificateSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: CertificateService> Clone for CertificateServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
}
}
}
impl<T: CertificateService> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: CertificateService> tonic::server::NamedService
for CertificateServiceServer<T> {
const NAME: &'static str = "security.CertificateService";
}
}