Skip to content

Commit

Permalink
feat: add resource ids to DownloadTaskResponse (#233)
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 79249ee commit 495349e
Show file tree
Hide file tree
Showing 7 changed files with 177 additions and 84 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.64"
version = "2.0.65"
authors = ["Gaius <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
187 changes: 110 additions & 77 deletions pkg/apis/dfdaemon/v2/dfdaemon.pb.go

Large diffs are not rendered by default.

33 changes: 33 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.

13 changes: 11 additions & 2 deletions pkg/apis/dfdaemon/v2/dfdaemon.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,20 @@ message DownloadTaskRequest {

// 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];

// Task content length.
uint64 content_length = 1;
uint64 content_length = 4;

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

// SyncPiecesRequest represents request of SyncPieces.
Expand Down
13 changes: 11 additions & 2 deletions proto/dfdaemon.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,20 @@ message DownloadTaskRequest {

// 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;

// Task content length.
uint64 content_length = 1;
uint64 content_length = 4;

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

// SyncPiecesRequest represents request of SyncPieces.
Expand Down
Binary file modified src/descriptor.bin
Binary file not shown.
13 changes: 11 additions & 2 deletions src/dfdaemon.v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,20 @@ pub struct DownloadTaskRequest {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadTaskResponse {
/// Host id.
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
/// Task id.
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
/// Peer id.
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
/// Task content length.
#[prost(uint64, tag = "1")]
#[prost(uint64, tag = "4")]
pub content_length: u64,
/// Finished piece of task.
#[prost(message, optional, tag = "2")]
#[prost(message, optional, tag = "5")]
pub piece: ::core::option::Option<super::super::common::v2::Piece>,
}
/// SyncPiecesRequest represents request of SyncPieces.
Expand Down

0 comments on commit 495349e

Please sign in to comment.