Skip to content

Commit

Permalink
feat: remove TriggerDownloadTaskResponse in TriggerDownloadTask (#238)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi authored Dec 19, 2023
1 parent 82e3f21 commit a71c5bd
Show file tree
Hide file tree
Showing 9 changed files with 172 additions and 349 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dragonfly-api"
version = "2.0.69"
version = "2.0.70"
authors = ["Gaius <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
369 changes: 157 additions & 212 deletions pkg/apis/dfdaemon/v2/dfdaemon.pb.go

Large diffs are not rendered by default.

103 changes: 0 additions & 103 deletions pkg/apis/dfdaemon/v2/dfdaemon.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions pkg/apis/dfdaemon/v2/dfdaemon.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ message TriggerDownloadTaskRequest {
common.v2.Download download = 1 [(validate.rules).message.required = true];
}

// TriggerDownloadTaskResponse represents response of TriggerDownloadTask.
message TriggerDownloadTaskResponse {
}

// SyncPiecesRequest represents request of SyncPieces.
message SyncPiecesRequest {
// Task id.
Expand Down Expand Up @@ -65,7 +61,7 @@ message DownloadPieceResponse {
// DfdaemonUpload represents dfdaemon upload service.
service DfdaemonUpload {
// TriggerDownloadTask triggers download task.
rpc TriggerDownloadTask(TriggerDownloadTaskRequest) returns(TriggerDownloadTaskResponse);
rpc TriggerDownloadTask(TriggerDownloadTaskRequest) returns(google.protobuf.Empty);

// SyncPieces syncs piece metadatas from remote peer.
rpc SyncPieces(SyncPiecesRequest) returns(stream SyncPiecesResponse);
Expand Down
10 changes: 5 additions & 5 deletions pkg/apis/dfdaemon/v2/dfdaemon_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pkg/apis/dfdaemon/v2/mocks/dfdaemon_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions proto/dfdaemon.proto
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ message TriggerDownloadTaskRequest {
common.v2.Download download = 1;
}

// TriggerDownloadTaskResponse represents response of TriggerDownloadTask.
message TriggerDownloadTaskResponse {
}

// SyncPiecesRequest represents request of SyncPieces.
message SyncPiecesRequest {
// Task id.
Expand Down Expand Up @@ -62,7 +58,7 @@ message DownloadPieceResponse {
// DfdaemonUpload represents upload service of dfdaemon.
service DfdaemonUpload{
// TriggerDownloadTask triggers download task.
rpc TriggerDownloadTask(TriggerDownloadTaskRequest) returns(TriggerDownloadTaskResponse);
rpc TriggerDownloadTask(TriggerDownloadTaskRequest) returns(google.protobuf.Empty);

// SyncPieces syncs piece metadatas from remote peer.
rpc SyncPieces(SyncPiecesRequest) returns(stream SyncPiecesResponse);
Expand Down
Binary file modified src/descriptor.bin
Binary file not shown.
17 changes: 3 additions & 14 deletions src/dfdaemon.v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ pub struct TriggerDownloadTaskRequest {
#[prost(message, optional, tag = "1")]
pub download: ::core::option::Option<super::super::common::v2::Download>,
}
/// TriggerDownloadTaskResponse represents response of TriggerDownloadTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TriggerDownloadTaskResponse {}
/// SyncPiecesRequest represents request of SyncPieces.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down Expand Up @@ -201,10 +196,7 @@ pub mod dfdaemon_upload_client {
pub async fn trigger_download_task(
&mut self,
request: impl tonic::IntoRequest<super::TriggerDownloadTaskRequest>,
) -> std::result::Result<
tonic::Response<super::TriggerDownloadTaskResponse>,
tonic::Status,
> {
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
Expand Down Expand Up @@ -476,10 +468,7 @@ pub mod dfdaemon_upload_server {
async fn trigger_download_task(
&self,
request: tonic::Request<super::TriggerDownloadTaskRequest>,
) -> std::result::Result<
tonic::Response<super::TriggerDownloadTaskResponse>,
tonic::Status,
>;
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
/// Server streaming response type for the SyncPieces method.
type SyncPiecesStream: futures_core::Stream<
Item = std::result::Result<super::SyncPiecesResponse, tonic::Status>,
Expand Down Expand Up @@ -587,7 +576,7 @@ pub mod dfdaemon_upload_server {
T: DfdaemonUpload,
> tonic::server::UnaryService<super::TriggerDownloadTaskRequest>
for TriggerDownloadTaskSvc<T> {
type Response = super::TriggerDownloadTaskResponse;
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
Expand Down

0 comments on commit a71c5bd

Please sign in to comment.