Skip to content

Commit

Permalink
feat: add content_length to DownloadTaskResponse (#219)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi authored Nov 20, 2023
1 parent 7f93979 commit 2840dfe
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 52 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.53"
version = "2.0.54"
authors = ["Gaius <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
107 changes: 59 additions & 48 deletions pkg/apis/dfdaemon/v2/dfdaemon.pb.go

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

2 changes: 2 additions & 0 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.

5 changes: 4 additions & 1 deletion pkg/apis/dfdaemon/v2/dfdaemon.proto
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,11 @@ message DownloadTaskRequest {

// DownloadTaskResponse represents response of DownloadTask.
message DownloadTaskResponse {
// Task content length.
int64 content_length = 1;

// Finished piece of task.
common.v2.Piece piece = 1 [(validate.rules).message.required = true];
common.v2.Piece piece = 2 [(validate.rules).message.required = true];
}

// UploadTaskRequest represents request of UploadTask.
Expand Down
5 changes: 4 additions & 1 deletion proto/dfdaemon.proto
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,11 @@ message DownloadTaskRequest {

// DownloadTaskResponse represents response of DownloadTask.
message DownloadTaskResponse {
// Task content length.
int64 content_length = 1;

// Finished piece of task.
common.v2.Piece piece = 1;
common.v2.Piece piece = 2;
}

// UploadTaskRequest represents request of UploadTask.
Expand Down
Binary file modified src/descriptor.bin
Binary file not shown.
5 changes: 4 additions & 1 deletion src/dfdaemon.v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@ pub struct DownloadTaskRequest {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadTaskResponse {
/// Task content length.
#[prost(int64, tag = "1")]
pub content_length: i64,
/// Finished piece of task.
#[prost(message, optional, tag = "1")]
#[prost(message, optional, tag = "2")]
pub piece: ::core::option::Option<super::super::common::v2::Piece>,
}
/// UploadTaskRequest represents request of UploadTask.
Expand Down

0 comments on commit 2840dfe

Please sign in to comment.