mirror of https://github.com/dragonflyoss/api.git
feat: tonic generates v2 rust code (#159)
Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
parent
3b47185f98
commit
9a0d19afc2
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "dragonfly-api"
|
||||
version = "2.0.11"
|
||||
version = "2.0.12"
|
||||
authors = ["Gaius <gaius.qi@gmail.com>"]
|
||||
edition = "2021"
|
||||
license = "Apache-2.0"
|
||||
|
@ -12,9 +12,9 @@ readme = "README.md"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
[dependencies]
|
||||
tonic = "0.9.2"
|
||||
prost = "0.11"
|
||||
prost-types = "0.11"
|
||||
tokio = { version = "1.28.1", features = ["rt-multi-thread", "macros"] }
|
||||
prost = "0.11.9"
|
||||
prost-types = "0.11.9"
|
||||
tokio = { version = "1.29.1", features = ["rt-multi-thread", "macros"] }
|
||||
|
||||
[build-dependencies]
|
||||
tonic-build = "0.9.2"
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
syntax = "proto3";
|
||||
|
||||
package common;
|
||||
package common.v2;
|
||||
|
||||
import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
@ -191,15 +191,15 @@ message Host {
|
|||
// Host kernel version.
|
||||
string kernel_version = 11;
|
||||
// CPU Stat.
|
||||
// CPU cpu = 12;
|
||||
CPU cpu = 12;
|
||||
// Memory Stat.
|
||||
// Memory memory = 13;
|
||||
Memory memory = 13;
|
||||
// Network Stat.
|
||||
// Network network = 14;
|
||||
Network network = 14;
|
||||
// Disk Stat.
|
||||
// Disk disk = 15;
|
||||
Disk disk = 15;
|
||||
// Build information.
|
||||
// Build build = 16;
|
||||
Build build = 16;
|
||||
}
|
||||
|
||||
// CPU Stat.
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
syntax = "proto3";
|
||||
|
||||
package dfdaemon;
|
||||
package dfdaemon.v2;
|
||||
|
||||
import "common.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
|
@ -42,7 +42,7 @@ message SyncPiecesRequest{
|
|||
// InterestedPiecesResponse represents interested pieces response of SyncPiecesResponse.
|
||||
message InterestedPiecesResponse {
|
||||
// Interested pieces of task.
|
||||
repeated common.Piece pieces = 1;
|
||||
repeated common.v2.Piece pieces = 1;
|
||||
}
|
||||
|
||||
// SyncPiecesResponse represents response of SyncPieces.
|
||||
|
@ -55,13 +55,13 @@ message SyncPiecesResponse {
|
|||
// DownloadTaskRequest represents request of DownloadTask.
|
||||
message DownloadTaskRequest {
|
||||
// Download information.
|
||||
common.Download download = 1;
|
||||
common.v2.Download download = 1;
|
||||
}
|
||||
|
||||
// UploadTaskRequest represents request of UploadTask.
|
||||
message UploadTaskRequest {
|
||||
// Task metadata.
|
||||
common.Task task = 1;
|
||||
common.v2.Task task = 1;
|
||||
}
|
||||
|
||||
// StatTaskRequest represents request of StatTask.
|
||||
|
@ -73,7 +73,7 @@ message StatTaskRequest {
|
|||
// StatTaskResponse represents response of StatTask.
|
||||
message StatTaskResponse {
|
||||
// Task metadata.
|
||||
common.Task task = 1;
|
||||
common.v2.Task task = 1;
|
||||
}
|
||||
|
||||
// DeleteTaskRequest represents request of DeleteTask.
|
||||
|
@ -94,7 +94,7 @@ service Dfdaemon{
|
|||
rpc UploadTask(UploadTaskRequest) returns(google.protobuf.Empty);
|
||||
|
||||
// StatTask stats task information.
|
||||
rpc StatTask(StatTaskRequest) returns(common.Task);
|
||||
rpc StatTask(StatTaskRequest) returns(common.v2.Task);
|
||||
|
||||
// DeleteTask deletes task from p2p network.
|
||||
rpc DeleteTask(DeleteTaskRequest) returns(google.protobuf.Empty);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
syntax = "proto3";
|
||||
|
||||
package manager;
|
||||
package manager.v2;
|
||||
|
||||
import "common.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
|
@ -261,13 +261,13 @@ message URLPriority {
|
|||
// URL regex.
|
||||
string regex = 1;
|
||||
// URL priority value.
|
||||
common.Priority value = 2;
|
||||
common.v2.Priority value = 2;
|
||||
}
|
||||
|
||||
// ApplicationPriority represents config of application priority.
|
||||
message ApplicationPriority {
|
||||
// Priority value.
|
||||
common.Priority value = 1;
|
||||
common.v2.Priority value = 1;
|
||||
// URL priority.
|
||||
repeated URLPriority urls = 2;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
syntax = "proto3";
|
||||
|
||||
package scheduler;
|
||||
package scheduler.v2;
|
||||
|
||||
import "common.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
|
@ -26,13 +26,13 @@ import "google/protobuf/timestamp.proto";
|
|||
// RegisterPeerRequest represents peer registered request of AnnouncePeerRequest.
|
||||
message RegisterPeerRequest {
|
||||
// Download information.
|
||||
common.Download download = 1;
|
||||
common.v2.Download download = 1;
|
||||
}
|
||||
|
||||
// RegisterSeedPeerRequest represents seed peer registered request of AnnouncePeerRequest.
|
||||
message RegisterSeedPeerRequest {
|
||||
// Download information.
|
||||
common.Download download = 1;
|
||||
common.v2.Download download = 1;
|
||||
}
|
||||
|
||||
// DownloadPeerStartedRequest represents peer download started request of AnnouncePeerRequest.
|
||||
|
@ -76,19 +76,19 @@ message DownloadPeerBackToSourceFailedRequest {
|
|||
// DownloadPieceFinishedRequest represents piece download finished request of AnnouncePeerRequest.
|
||||
message DownloadPieceFinishedRequest {
|
||||
// Piece info.
|
||||
common.Piece piece = 1;
|
||||
common.v2.Piece piece = 1;
|
||||
}
|
||||
|
||||
// DownloadPieceBackToSourceFinishedRequest represents piece download back-to-source finished request of AnnouncePeerRequest.
|
||||
message DownloadPieceBackToSourceFinishedRequest {
|
||||
// Piece info.
|
||||
common.Piece piece = 1;
|
||||
common.v2.Piece piece = 1;
|
||||
}
|
||||
|
||||
// DownloadPieceFailedRequest downloads piece failed request of AnnouncePeerRequest.
|
||||
message DownloadPieceFailedRequest {
|
||||
// Piece info.
|
||||
common.Piece piece = 1;
|
||||
common.v2.Piece piece = 1;
|
||||
// Temporary indicates whether the error is temporary.
|
||||
bool temporary = 2;
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ message OSSResponse {
|
|||
// DownloadPieceBackToSourceFailedRequest downloads piece back-to-source failed request of AnnouncePeerRequest.
|
||||
message DownloadPieceBackToSourceFailedRequest {
|
||||
// Piece info.
|
||||
common.Piece piece = 1;
|
||||
common.v2.Piece piece = 1;
|
||||
|
||||
oneof response {
|
||||
HTTPResponse http_response = 2;
|
||||
|
@ -185,7 +185,7 @@ message SmallTaskResponse {
|
|||
// NormalTaskResponse represents normal task response of AnnouncePeerResponse.
|
||||
message NormalTaskResponse {
|
||||
// Candidate parents.
|
||||
repeated common.Peer candidate_parents = 1;
|
||||
repeated common.v2.Peer candidate_parents = 1;
|
||||
// Concurrent downloading piece count from the peers.
|
||||
int32 concurrent_piece_count = 2;
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ message StatTaskRequest {
|
|||
|
||||
// AnnounceHostRequest represents request of AnnounceHost.
|
||||
message AnnounceHostRequest {
|
||||
common.Host host = 1;
|
||||
common.v2.Host host = 1;
|
||||
}
|
||||
|
||||
// LeaveHostRequest represents request of LeaveHost.
|
||||
|
@ -267,7 +267,7 @@ message ProbeStartedRequest {
|
|||
// Probe information.
|
||||
message Probe {
|
||||
// Destination host metadata.
|
||||
common.Host host = 1;
|
||||
common.v2.Host host = 1;
|
||||
// RTT is the round-trip time sent via this pinger.
|
||||
google.protobuf.Duration rtt = 2;
|
||||
// Probe create time.
|
||||
|
@ -283,7 +283,7 @@ message ProbeFinishedRequest {
|
|||
// FailedProbe information.
|
||||
message FailedProbe {
|
||||
// Destination host metadata.
|
||||
common.Host host = 1;
|
||||
common.v2.Host host = 1;
|
||||
// The description of probing failed.
|
||||
string description = 2;
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ message ProbeFailedRequest {
|
|||
// SyncProbesRequest represents request of SyncProbes.
|
||||
message SyncProbesRequest {
|
||||
// Source host metadata.
|
||||
common.Host host = 1;
|
||||
common.v2.Host host = 1;
|
||||
|
||||
oneof request {
|
||||
ProbeStartedRequest probe_started_request = 2;
|
||||
|
@ -309,7 +309,7 @@ message SyncProbesRequest {
|
|||
// SyncProbesResponse represents response of SyncProbes.
|
||||
message SyncProbesResponse {
|
||||
// Hosts needs to be probed.
|
||||
repeated common.Host hosts = 1;
|
||||
repeated common.v2.Host hosts = 1;
|
||||
}
|
||||
|
||||
// Scheduler RPC Service.
|
||||
|
@ -318,7 +318,7 @@ service Scheduler{
|
|||
rpc AnnouncePeer(stream AnnouncePeerRequest) returns(stream AnnouncePeerResponse);
|
||||
|
||||
// Checks information of peer.
|
||||
rpc StatPeer(StatPeerRequest)returns(common.Peer);
|
||||
rpc StatPeer(StatPeerRequest)returns(common.v2.Peer);
|
||||
|
||||
// LeavePeer releases peer in scheduler.
|
||||
rpc LeavePeer(LeavePeerRequest)returns(google.protobuf.Empty);
|
||||
|
@ -328,7 +328,7 @@ service Scheduler{
|
|||
rpc ExchangePeer(ExchangePeerRequest)returns(ExchangePeerResponse);
|
||||
|
||||
// Checks information of task.
|
||||
rpc StatTask(StatTaskRequest)returns(common.Task);
|
||||
rpc StatTask(StatTaskRequest)returns(common.v2.Task);
|
||||
|
||||
// AnnounceHost announces host to scheduler.
|
||||
rpc AnnounceHost(AnnounceHostRequest)returns(google.protobuf.Empty);
|
||||
|
|
|
@ -133,19 +133,23 @@ pub struct Host {
|
|||
#[prost(string, tag = "10")]
|
||||
pub platform_version: ::prost::alloc::string::String,
|
||||
/// Host kernel version.
|
||||
///
|
||||
/// 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;
|
||||
#[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>,
|
||||
}
|
||||
/// CPU Stat.
|
||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
Binary file not shown.
|
@ -34,7 +34,7 @@ pub mod sync_pieces_request {
|
|||
pub struct InterestedPiecesResponse {
|
||||
/// Interested pieces of task.
|
||||
#[prost(message, repeated, tag = "1")]
|
||||
pub pieces: ::prost::alloc::vec::Vec<super::common::Piece>,
|
||||
pub pieces: ::prost::alloc::vec::Vec<super::super::common::v2::Piece>,
|
||||
}
|
||||
/// SyncPiecesResponse represents response of SyncPieces.
|
||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||
|
@ -58,7 +58,7 @@ pub mod sync_pieces_response {
|
|||
pub struct DownloadTaskRequest {
|
||||
/// Download information.
|
||||
#[prost(message, optional, tag = "1")]
|
||||
pub download: ::core::option::Option<super::common::Download>,
|
||||
pub download: ::core::option::Option<super::super::common::v2::Download>,
|
||||
}
|
||||
/// UploadTaskRequest represents request of UploadTask.
|
||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||
|
@ -66,7 +66,7 @@ pub struct DownloadTaskRequest {
|
|||
pub struct UploadTaskRequest {
|
||||
/// Task metadata.
|
||||
#[prost(message, optional, tag = "1")]
|
||||
pub task: ::core::option::Option<super::common::Task>,
|
||||
pub task: ::core::option::Option<super::super::common::v2::Task>,
|
||||
}
|
||||
/// StatTaskRequest represents request of StatTask.
|
||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||
|
@ -82,7 +82,7 @@ pub struct StatTaskRequest {
|
|||
pub struct StatTaskResponse {
|
||||
/// Task metadata.
|
||||
#[prost(message, optional, tag = "1")]
|
||||
pub task: ::core::option::Option<super::common::Task>,
|
||||
pub task: ::core::option::Option<super::super::common::v2::Task>,
|
||||
}
|
||||
/// DeleteTaskRequest represents request of DeleteTask.
|
||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||
|
@ -197,11 +197,11 @@ pub mod dfdaemon_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/dfdaemon.Dfdaemon/SyncPieces",
|
||||
"/dfdaemon.v2.Dfdaemon/SyncPieces",
|
||||
);
|
||||
let mut req = request.into_streaming_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("dfdaemon.Dfdaemon", "SyncPieces"));
|
||||
.insert(GrpcMethod::new("dfdaemon.v2.Dfdaemon", "SyncPieces"));
|
||||
self.inner.streaming(req, path, codec).await
|
||||
}
|
||||
/// DownloadTask downloads task back-to-source.
|
||||
|
@ -220,11 +220,11 @@ pub mod dfdaemon_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/dfdaemon.Dfdaemon/DownloadTask",
|
||||
"/dfdaemon.v2.Dfdaemon/DownloadTask",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("dfdaemon.Dfdaemon", "DownloadTask"));
|
||||
.insert(GrpcMethod::new("dfdaemon.v2.Dfdaemon", "DownloadTask"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// UploadTask uploads task to p2p network.
|
||||
|
@ -243,11 +243,11 @@ pub mod dfdaemon_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/dfdaemon.Dfdaemon/UploadTask",
|
||||
"/dfdaemon.v2.Dfdaemon/UploadTask",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("dfdaemon.Dfdaemon", "UploadTask"));
|
||||
.insert(GrpcMethod::new("dfdaemon.v2.Dfdaemon", "UploadTask"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// StatTask stats task information.
|
||||
|
@ -255,7 +255,7 @@ pub mod dfdaemon_client {
|
|||
&mut self,
|
||||
request: impl tonic::IntoRequest<super::StatTaskRequest>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::super::common::Task>,
|
||||
tonic::Response<super::super::super::common::v2::Task>,
|
||||
tonic::Status,
|
||||
> {
|
||||
self.inner
|
||||
|
@ -269,11 +269,11 @@ pub mod dfdaemon_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/dfdaemon.Dfdaemon/StatTask",
|
||||
"/dfdaemon.v2.Dfdaemon/StatTask",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("dfdaemon.Dfdaemon", "StatTask"));
|
||||
.insert(GrpcMethod::new("dfdaemon.v2.Dfdaemon", "StatTask"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// DeleteTask deletes task from p2p network.
|
||||
|
@ -292,11 +292,11 @@ pub mod dfdaemon_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/dfdaemon.Dfdaemon/DeleteTask",
|
||||
"/dfdaemon.v2.Dfdaemon/DeleteTask",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("dfdaemon.Dfdaemon", "DeleteTask"));
|
||||
.insert(GrpcMethod::new("dfdaemon.v2.Dfdaemon", "DeleteTask"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
}
|
||||
|
@ -334,7 +334,7 @@ pub mod dfdaemon_server {
|
|||
&self,
|
||||
request: tonic::Request<super::StatTaskRequest>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::super::common::Task>,
|
||||
tonic::Response<super::super::super::common::v2::Task>,
|
||||
tonic::Status,
|
||||
>;
|
||||
/// DeleteTask deletes task from p2p network.
|
||||
|
@ -423,7 +423,7 @@ pub mod dfdaemon_server {
|
|||
fn call(&mut self, req: http::Request<B>) -> Self::Future {
|
||||
let inner = self.inner.clone();
|
||||
match req.uri().path() {
|
||||
"/dfdaemon.Dfdaemon/SyncPieces" => {
|
||||
"/dfdaemon.v2.Dfdaemon/SyncPieces" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct SyncPiecesSvc<T: Dfdaemon>(pub Arc<T>);
|
||||
impl<
|
||||
|
@ -470,7 +470,7 @@ pub mod dfdaemon_server {
|
|||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/dfdaemon.Dfdaemon/DownloadTask" => {
|
||||
"/dfdaemon.v2.Dfdaemon/DownloadTask" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct DownloadTaskSvc<T: Dfdaemon>(pub Arc<T>);
|
||||
impl<
|
||||
|
@ -516,7 +516,7 @@ pub mod dfdaemon_server {
|
|||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/dfdaemon.Dfdaemon/UploadTask" => {
|
||||
"/dfdaemon.v2.Dfdaemon/UploadTask" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct UploadTaskSvc<T: Dfdaemon>(pub Arc<T>);
|
||||
impl<
|
||||
|
@ -560,12 +560,12 @@ pub mod dfdaemon_server {
|
|||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/dfdaemon.Dfdaemon/StatTask" => {
|
||||
"/dfdaemon.v2.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 Response = super::super::super::common::v2::Task;
|
||||
type Future = BoxFuture<
|
||||
tonic::Response<Self::Response>,
|
||||
tonic::Status,
|
||||
|
@ -602,7 +602,7 @@ pub mod dfdaemon_server {
|
|||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/dfdaemon.Dfdaemon/DeleteTask" => {
|
||||
"/dfdaemon.v2.Dfdaemon/DeleteTask" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct DeleteTaskSvc<T: Dfdaemon>(pub Arc<T>);
|
||||
impl<
|
||||
|
@ -684,6 +684,6 @@ pub mod dfdaemon_server {
|
|||
}
|
||||
}
|
||||
impl<T: Dfdaemon> tonic::server::NamedService for DfdaemonServer<T> {
|
||||
const NAME: &'static str = "dfdaemon.Dfdaemon";
|
||||
const NAME: &'static str = "dfdaemon.v2.Dfdaemon";
|
||||
}
|
||||
}
|
28
src/lib.rs
28
src/lib.rs
|
@ -1,7 +1,27 @@
|
|||
pub mod common;
|
||||
pub mod dfdaemon;
|
||||
pub mod manager;
|
||||
pub mod scheduler;
|
||||
#[path = ""]
|
||||
pub mod common {
|
||||
#[path = "common.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;
|
||||
}
|
||||
|
||||
pub mod security;
|
||||
|
||||
// FILE_DESCRIPTOR_SET is the serialized FileDescriptorSet of the proto files.
|
||||
|
|
|
@ -329,7 +329,7 @@ pub struct UrlPriority {
|
|||
#[prost(string, tag = "1")]
|
||||
pub regex: ::prost::alloc::string::String,
|
||||
/// URL priority value.
|
||||
#[prost(enumeration = "super::common::Priority", tag = "2")]
|
||||
#[prost(enumeration = "super::super::common::v2::Priority", tag = "2")]
|
||||
pub value: i32,
|
||||
}
|
||||
/// ApplicationPriority represents config of application priority.
|
||||
|
@ -337,7 +337,7 @@ pub struct UrlPriority {
|
|||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct ApplicationPriority {
|
||||
/// Priority value.
|
||||
#[prost(enumeration = "super::common::Priority", tag = "1")]
|
||||
#[prost(enumeration = "super::super::common::v2::Priority", tag = "1")]
|
||||
pub value: i32,
|
||||
/// URL priority.
|
||||
#[prost(message, repeated, tag = "2")]
|
||||
|
@ -592,11 +592,11 @@ pub mod manager_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/manager.Manager/GetSeedPeer",
|
||||
"/manager.v2.Manager/GetSeedPeer",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("manager.Manager", "GetSeedPeer"));
|
||||
.insert(GrpcMethod::new("manager.v2.Manager", "GetSeedPeer"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// Update SeedPeer configuration.
|
||||
|
@ -615,11 +615,11 @@ pub mod manager_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/manager.Manager/UpdateSeedPeer",
|
||||
"/manager.v2.Manager/UpdateSeedPeer",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("manager.Manager", "UpdateSeedPeer"));
|
||||
.insert(GrpcMethod::new("manager.v2.Manager", "UpdateSeedPeer"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// Get Scheduler and Scheduler cluster configuration.
|
||||
|
@ -638,11 +638,11 @@ pub mod manager_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/manager.Manager/GetScheduler",
|
||||
"/manager.v2.Manager/GetScheduler",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("manager.Manager", "GetScheduler"));
|
||||
.insert(GrpcMethod::new("manager.v2.Manager", "GetScheduler"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// Update scheduler configuration.
|
||||
|
@ -661,11 +661,11 @@ pub mod manager_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/manager.Manager/UpdateScheduler",
|
||||
"/manager.v2.Manager/UpdateScheduler",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("manager.Manager", "UpdateScheduler"));
|
||||
.insert(GrpcMethod::new("manager.v2.Manager", "UpdateScheduler"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// List acitve schedulers configuration.
|
||||
|
@ -687,11 +687,11 @@ pub mod manager_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/manager.Manager/ListSchedulers",
|
||||
"/manager.v2.Manager/ListSchedulers",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("manager.Manager", "ListSchedulers"));
|
||||
.insert(GrpcMethod::new("manager.v2.Manager", "ListSchedulers"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// Get ObjectStorage configuration.
|
||||
|
@ -710,11 +710,11 @@ pub mod manager_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/manager.Manager/GetObjectStorage",
|
||||
"/manager.v2.Manager/GetObjectStorage",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("manager.Manager", "GetObjectStorage"));
|
||||
.insert(GrpcMethod::new("manager.v2.Manager", "GetObjectStorage"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// List buckets configuration.
|
||||
|
@ -736,11 +736,11 @@ pub mod manager_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/manager.Manager/ListBuckets",
|
||||
"/manager.v2.Manager/ListBuckets",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("manager.Manager", "ListBuckets"));
|
||||
.insert(GrpcMethod::new("manager.v2.Manager", "ListBuckets"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// List applications configuration.
|
||||
|
@ -762,11 +762,11 @@ pub mod manager_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/manager.Manager/ListApplications",
|
||||
"/manager.v2.Manager/ListApplications",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("manager.Manager", "ListApplications"));
|
||||
.insert(GrpcMethod::new("manager.v2.Manager", "ListApplications"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// Create model and update data of model to object storage.
|
||||
|
@ -785,11 +785,11 @@ pub mod manager_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/manager.Manager/CreateModel",
|
||||
"/manager.v2.Manager/CreateModel",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("manager.Manager", "CreateModel"));
|
||||
.insert(GrpcMethod::new("manager.v2.Manager", "CreateModel"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// KeepAlive with manager.
|
||||
|
@ -808,10 +808,11 @@ pub mod manager_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/manager.Manager/KeepAlive",
|
||||
"/manager.v2.Manager/KeepAlive",
|
||||
);
|
||||
let mut req = request.into_streaming_request();
|
||||
req.extensions_mut().insert(GrpcMethod::new("manager.Manager", "KeepAlive"));
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("manager.v2.Manager", "KeepAlive"));
|
||||
self.inner.client_streaming(req, path, codec).await
|
||||
}
|
||||
}
|
||||
|
@ -963,7 +964,7 @@ pub mod manager_server {
|
|||
fn call(&mut self, req: http::Request<B>) -> Self::Future {
|
||||
let inner = self.inner.clone();
|
||||
match req.uri().path() {
|
||||
"/manager.Manager/GetSeedPeer" => {
|
||||
"/manager.v2.Manager/GetSeedPeer" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct GetSeedPeerSvc<T: Manager>(pub Arc<T>);
|
||||
impl<
|
||||
|
@ -1009,7 +1010,7 @@ pub mod manager_server {
|
|||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/manager.Manager/UpdateSeedPeer" => {
|
||||
"/manager.v2.Manager/UpdateSeedPeer" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct UpdateSeedPeerSvc<T: Manager>(pub Arc<T>);
|
||||
impl<
|
||||
|
@ -1055,7 +1056,7 @@ pub mod manager_server {
|
|||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/manager.Manager/GetScheduler" => {
|
||||
"/manager.v2.Manager/GetScheduler" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct GetSchedulerSvc<T: Manager>(pub Arc<T>);
|
||||
impl<
|
||||
|
@ -1101,7 +1102,7 @@ pub mod manager_server {
|
|||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/manager.Manager/UpdateScheduler" => {
|
||||
"/manager.v2.Manager/UpdateScheduler" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct UpdateSchedulerSvc<T: Manager>(pub Arc<T>);
|
||||
impl<
|
||||
|
@ -1147,7 +1148,7 @@ pub mod manager_server {
|
|||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/manager.Manager/ListSchedulers" => {
|
||||
"/manager.v2.Manager/ListSchedulers" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct ListSchedulersSvc<T: Manager>(pub Arc<T>);
|
||||
impl<
|
||||
|
@ -1193,7 +1194,7 @@ pub mod manager_server {
|
|||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/manager.Manager/GetObjectStorage" => {
|
||||
"/manager.v2.Manager/GetObjectStorage" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct GetObjectStorageSvc<T: Manager>(pub Arc<T>);
|
||||
impl<
|
||||
|
@ -1239,7 +1240,7 @@ pub mod manager_server {
|
|||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/manager.Manager/ListBuckets" => {
|
||||
"/manager.v2.Manager/ListBuckets" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct ListBucketsSvc<T: Manager>(pub Arc<T>);
|
||||
impl<
|
||||
|
@ -1285,7 +1286,7 @@ pub mod manager_server {
|
|||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/manager.Manager/ListApplications" => {
|
||||
"/manager.v2.Manager/ListApplications" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct ListApplicationsSvc<T: Manager>(pub Arc<T>);
|
||||
impl<
|
||||
|
@ -1331,7 +1332,7 @@ pub mod manager_server {
|
|||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/manager.Manager/CreateModel" => {
|
||||
"/manager.v2.Manager/CreateModel" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct CreateModelSvc<T: Manager>(pub Arc<T>);
|
||||
impl<
|
||||
|
@ -1377,7 +1378,7 @@ pub mod manager_server {
|
|||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/manager.Manager/KeepAlive" => {
|
||||
"/manager.v2.Manager/KeepAlive" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct KeepAliveSvc<T: Manager>(pub Arc<T>);
|
||||
impl<
|
||||
|
@ -1461,6 +1462,6 @@ pub mod manager_server {
|
|||
}
|
||||
}
|
||||
impl<T: Manager> tonic::server::NamedService for ManagerServer<T> {
|
||||
const NAME: &'static str = "manager.Manager";
|
||||
const NAME: &'static str = "manager.v2.Manager";
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
pub struct RegisterPeerRequest {
|
||||
/// Download information.
|
||||
#[prost(message, optional, tag = "1")]
|
||||
pub download: ::core::option::Option<super::common::Download>,
|
||||
pub download: ::core::option::Option<super::super::common::v2::Download>,
|
||||
}
|
||||
/// RegisterSeedPeerRequest represents seed peer registered request of AnnouncePeerRequest.
|
||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||
|
@ -12,7 +12,7 @@ pub struct RegisterPeerRequest {
|
|||
pub struct RegisterSeedPeerRequest {
|
||||
/// Download information.
|
||||
#[prost(message, optional, tag = "1")]
|
||||
pub download: ::core::option::Option<super::common::Download>,
|
||||
pub download: ::core::option::Option<super::super::common::v2::Download>,
|
||||
}
|
||||
/// DownloadPeerStartedRequest represents peer download started request of AnnouncePeerRequest.
|
||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||
|
@ -70,7 +70,7 @@ pub struct DownloadPeerBackToSourceFailedRequest {
|
|||
pub struct DownloadPieceFinishedRequest {
|
||||
/// Piece info.
|
||||
#[prost(message, optional, tag = "1")]
|
||||
pub piece: ::core::option::Option<super::common::Piece>,
|
||||
pub piece: ::core::option::Option<super::super::common::v2::Piece>,
|
||||
}
|
||||
/// DownloadPieceBackToSourceFinishedRequest represents piece download back-to-source finished request of AnnouncePeerRequest.
|
||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||
|
@ -78,7 +78,7 @@ pub struct DownloadPieceFinishedRequest {
|
|||
pub struct DownloadPieceBackToSourceFinishedRequest {
|
||||
/// Piece info.
|
||||
#[prost(message, optional, tag = "1")]
|
||||
pub piece: ::core::option::Option<super::common::Piece>,
|
||||
pub piece: ::core::option::Option<super::super::common::v2::Piece>,
|
||||
}
|
||||
/// DownloadPieceFailedRequest downloads piece failed request of AnnouncePeerRequest.
|
||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||
|
@ -86,7 +86,7 @@ pub struct DownloadPieceBackToSourceFinishedRequest {
|
|||
pub struct DownloadPieceFailedRequest {
|
||||
/// Piece info.
|
||||
#[prost(message, optional, tag = "1")]
|
||||
pub piece: ::core::option::Option<super::common::Piece>,
|
||||
pub piece: ::core::option::Option<super::super::common::v2::Piece>,
|
||||
/// Temporary indicates whether the error is temporary.
|
||||
#[prost(bool, tag = "2")]
|
||||
pub temporary: bool,
|
||||
|
@ -126,7 +126,7 @@ pub struct OssResponse {}
|
|||
pub struct DownloadPieceBackToSourceFailedRequest {
|
||||
/// Piece info.
|
||||
#[prost(message, optional, tag = "1")]
|
||||
pub piece: ::core::option::Option<super::common::Piece>,
|
||||
pub piece: ::core::option::Option<super::super::common::v2::Piece>,
|
||||
#[prost(
|
||||
oneof = "download_piece_back_to_source_failed_request::Response",
|
||||
tags = "2, 3, 4, 5"
|
||||
|
@ -252,7 +252,7 @@ pub struct SmallTaskResponse {}
|
|||
pub struct NormalTaskResponse {
|
||||
/// Candidate parents.
|
||||
#[prost(message, repeated, tag = "1")]
|
||||
pub candidate_parents: ::prost::alloc::vec::Vec<super::common::Peer>,
|
||||
pub candidate_parents: ::prost::alloc::vec::Vec<super::super::common::v2::Peer>,
|
||||
/// Concurrent downloading piece count from the peers.
|
||||
#[prost(int32, tag = "2")]
|
||||
pub concurrent_piece_count: i32,
|
||||
|
@ -350,7 +350,7 @@ pub struct StatTaskRequest {
|
|||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct AnnounceHostRequest {
|
||||
#[prost(message, optional, tag = "1")]
|
||||
pub host: ::core::option::Option<super::common::Host>,
|
||||
pub host: ::core::option::Option<super::super::common::v2::Host>,
|
||||
}
|
||||
/// LeaveHostRequest represents request of LeaveHost.
|
||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||
|
@ -370,7 +370,7 @@ pub struct ProbeStartedRequest {}
|
|||
pub struct Probe {
|
||||
/// Destination host metadata.
|
||||
#[prost(message, optional, tag = "1")]
|
||||
pub host: ::core::option::Option<super::common::Host>,
|
||||
pub host: ::core::option::Option<super::super::common::v2::Host>,
|
||||
/// RTT is the round-trip time sent via this pinger.
|
||||
#[prost(message, optional, tag = "2")]
|
||||
pub rtt: ::core::option::Option<::prost_types::Duration>,
|
||||
|
@ -392,7 +392,7 @@ pub struct ProbeFinishedRequest {
|
|||
pub struct FailedProbe {
|
||||
/// Destination host metadata.
|
||||
#[prost(message, optional, tag = "1")]
|
||||
pub host: ::core::option::Option<super::common::Host>,
|
||||
pub host: ::core::option::Option<super::super::common::v2::Host>,
|
||||
/// The description of probing failed.
|
||||
#[prost(string, tag = "2")]
|
||||
pub description: ::prost::alloc::string::String,
|
||||
|
@ -411,7 +411,7 @@ pub struct ProbeFailedRequest {
|
|||
pub struct SyncProbesRequest {
|
||||
/// Source host metadata.
|
||||
#[prost(message, optional, tag = "1")]
|
||||
pub host: ::core::option::Option<super::common::Host>,
|
||||
pub host: ::core::option::Option<super::super::common::v2::Host>,
|
||||
#[prost(oneof = "sync_probes_request::Request", tags = "2, 3, 4")]
|
||||
pub request: ::core::option::Option<sync_probes_request::Request>,
|
||||
}
|
||||
|
@ -434,7 +434,7 @@ pub mod sync_probes_request {
|
|||
pub struct SyncProbesResponse {
|
||||
/// Hosts needs to be probed.
|
||||
#[prost(message, repeated, tag = "1")]
|
||||
pub hosts: ::prost::alloc::vec::Vec<super::common::Host>,
|
||||
pub hosts: ::prost::alloc::vec::Vec<super::super::common::v2::Host>,
|
||||
}
|
||||
/// Generated client implementations.
|
||||
pub mod scheduler_client {
|
||||
|
@ -543,11 +543,11 @@ pub mod scheduler_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/scheduler.Scheduler/AnnouncePeer",
|
||||
"/scheduler.v2.Scheduler/AnnouncePeer",
|
||||
);
|
||||
let mut req = request.into_streaming_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("scheduler.Scheduler", "AnnouncePeer"));
|
||||
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "AnnouncePeer"));
|
||||
self.inner.streaming(req, path, codec).await
|
||||
}
|
||||
/// Checks information of peer.
|
||||
|
@ -555,7 +555,7 @@ pub mod scheduler_client {
|
|||
&mut self,
|
||||
request: impl tonic::IntoRequest<super::StatPeerRequest>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::super::common::Peer>,
|
||||
tonic::Response<super::super::super::common::v2::Peer>,
|
||||
tonic::Status,
|
||||
> {
|
||||
self.inner
|
||||
|
@ -569,11 +569,11 @@ pub mod scheduler_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/scheduler.Scheduler/StatPeer",
|
||||
"/scheduler.v2.Scheduler/StatPeer",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("scheduler.Scheduler", "StatPeer"));
|
||||
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "StatPeer"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// LeavePeer releases peer in scheduler.
|
||||
|
@ -592,11 +592,11 @@ pub mod scheduler_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/scheduler.Scheduler/LeavePeer",
|
||||
"/scheduler.v2.Scheduler/LeavePeer",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("scheduler.Scheduler", "LeavePeer"));
|
||||
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "LeavePeer"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// TODO exchange peer api definition.
|
||||
|
@ -619,11 +619,11 @@ pub mod scheduler_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/scheduler.Scheduler/ExchangePeer",
|
||||
"/scheduler.v2.Scheduler/ExchangePeer",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("scheduler.Scheduler", "ExchangePeer"));
|
||||
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "ExchangePeer"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// Checks information of task.
|
||||
|
@ -631,7 +631,7 @@ pub mod scheduler_client {
|
|||
&mut self,
|
||||
request: impl tonic::IntoRequest<super::StatTaskRequest>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::super::common::Task>,
|
||||
tonic::Response<super::super::super::common::v2::Task>,
|
||||
tonic::Status,
|
||||
> {
|
||||
self.inner
|
||||
|
@ -645,11 +645,11 @@ pub mod scheduler_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/scheduler.Scheduler/StatTask",
|
||||
"/scheduler.v2.Scheduler/StatTask",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("scheduler.Scheduler", "StatTask"));
|
||||
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "StatTask"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// AnnounceHost announces host to scheduler.
|
||||
|
@ -668,11 +668,11 @@ pub mod scheduler_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/scheduler.Scheduler/AnnounceHost",
|
||||
"/scheduler.v2.Scheduler/AnnounceHost",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("scheduler.Scheduler", "AnnounceHost"));
|
||||
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "AnnounceHost"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// LeaveHost releases host in scheduler.
|
||||
|
@ -691,11 +691,11 @@ pub mod scheduler_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/scheduler.Scheduler/LeaveHost",
|
||||
"/scheduler.v2.Scheduler/LeaveHost",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("scheduler.Scheduler", "LeaveHost"));
|
||||
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "LeaveHost"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// SyncProbes sync probes of the host.
|
||||
|
@ -717,11 +717,11 @@ pub mod scheduler_client {
|
|||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/scheduler.Scheduler/SyncProbes",
|
||||
"/scheduler.v2.Scheduler/SyncProbes",
|
||||
);
|
||||
let mut req = request.into_streaming_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("scheduler.Scheduler", "SyncProbes"));
|
||||
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "SyncProbes"));
|
||||
self.inner.streaming(req, path, codec).await
|
||||
}
|
||||
}
|
||||
|
@ -752,7 +752,7 @@ pub mod scheduler_server {
|
|||
&self,
|
||||
request: tonic::Request<super::StatPeerRequest>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::super::common::Peer>,
|
||||
tonic::Response<super::super::super::common::v2::Peer>,
|
||||
tonic::Status,
|
||||
>;
|
||||
/// LeavePeer releases peer in scheduler.
|
||||
|
@ -774,7 +774,7 @@ pub mod scheduler_server {
|
|||
&self,
|
||||
request: tonic::Request<super::StatTaskRequest>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::super::common::Task>,
|
||||
tonic::Response<super::super::super::common::v2::Task>,
|
||||
tonic::Status,
|
||||
>;
|
||||
/// AnnounceHost announces host to scheduler.
|
||||
|
@ -879,7 +879,7 @@ pub mod scheduler_server {
|
|||
fn call(&mut self, req: http::Request<B>) -> Self::Future {
|
||||
let inner = self.inner.clone();
|
||||
match req.uri().path() {
|
||||
"/scheduler.Scheduler/AnnouncePeer" => {
|
||||
"/scheduler.v2.Scheduler/AnnouncePeer" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct AnnouncePeerSvc<T: Scheduler>(pub Arc<T>);
|
||||
impl<
|
||||
|
@ -928,14 +928,14 @@ pub mod scheduler_server {
|
|||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/scheduler.Scheduler/StatPeer" => {
|
||||
"/scheduler.v2.Scheduler/StatPeer" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct StatPeerSvc<T: Scheduler>(pub Arc<T>);
|
||||
impl<
|
||||
T: Scheduler,
|
||||
> tonic::server::UnaryService<super::StatPeerRequest>
|
||||
for StatPeerSvc<T> {
|
||||
type Response = super::super::common::Peer;
|
||||
type Response = super::super::super::common::v2::Peer;
|
||||
type Future = BoxFuture<
|
||||
tonic::Response<Self::Response>,
|
||||
tonic::Status,
|
||||
|
@ -972,7 +972,7 @@ pub mod scheduler_server {
|
|||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/scheduler.Scheduler/LeavePeer" => {
|
||||
"/scheduler.v2.Scheduler/LeavePeer" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct LeavePeerSvc<T: Scheduler>(pub Arc<T>);
|
||||
impl<
|
||||
|
@ -1016,7 +1016,7 @@ pub mod scheduler_server {
|
|||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/scheduler.Scheduler/ExchangePeer" => {
|
||||
"/scheduler.v2.Scheduler/ExchangePeer" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct ExchangePeerSvc<T: Scheduler>(pub Arc<T>);
|
||||
impl<
|
||||
|
@ -1062,14 +1062,14 @@ pub mod scheduler_server {
|
|||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/scheduler.Scheduler/StatTask" => {
|
||||
"/scheduler.v2.Scheduler/StatTask" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct StatTaskSvc<T: Scheduler>(pub Arc<T>);
|
||||
impl<
|
||||
T: Scheduler,
|
||||
> tonic::server::UnaryService<super::StatTaskRequest>
|
||||
for StatTaskSvc<T> {
|
||||
type Response = super::super::common::Task;
|
||||
type Response = super::super::super::common::v2::Task;
|
||||
type Future = BoxFuture<
|
||||
tonic::Response<Self::Response>,
|
||||
tonic::Status,
|
||||
|
@ -1106,7 +1106,7 @@ pub mod scheduler_server {
|
|||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/scheduler.Scheduler/AnnounceHost" => {
|
||||
"/scheduler.v2.Scheduler/AnnounceHost" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct AnnounceHostSvc<T: Scheduler>(pub Arc<T>);
|
||||
impl<
|
||||
|
@ -1152,7 +1152,7 @@ pub mod scheduler_server {
|
|||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/scheduler.Scheduler/LeaveHost" => {
|
||||
"/scheduler.v2.Scheduler/LeaveHost" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct LeaveHostSvc<T: Scheduler>(pub Arc<T>);
|
||||
impl<
|
||||
|
@ -1196,7 +1196,7 @@ pub mod scheduler_server {
|
|||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/scheduler.Scheduler/SyncProbes" => {
|
||||
"/scheduler.v2.Scheduler/SyncProbes" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct SyncProbesSvc<T: Scheduler>(pub Arc<T>);
|
||||
impl<
|
||||
|
@ -1281,6 +1281,6 @@ pub mod scheduler_server {
|
|||
}
|
||||
}
|
||||
impl<T: Scheduler> tonic::server::NamedService for SchedulerServer<T> {
|
||||
const NAME: &'static str = "scheduler.Scheduler";
|
||||
const NAME: &'static str = "scheduler.v2.Scheduler";
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue