Skip to content

Commit

Permalink
feat: add optional to piece_number in DownloadPieceFailedRequest (#224)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi authored Dec 5, 2023
1 parent f94caaa commit 300b38f
Show file tree
Hide file tree
Showing 7 changed files with 331 additions and 323 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.57"
version = "2.0.58"
authors = ["Gaius <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
624 changes: 314 additions & 310 deletions pkg/apis/scheduler/v2/scheduler.pb.go

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions pkg/apis/scheduler/v2/scheduler.pb.validate.go

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

4 changes: 2 additions & 2 deletions pkg/apis/scheduler/v2/scheduler.proto
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ message DownloadPieceBackToSourceFinishedRequest {
// DownloadPieceFailedRequest downloads piece failed request of AnnouncePeerRequest.
message DownloadPieceFailedRequest {
// Piece number.
uint32 piece_number = 1;
optional uint32 piece_number = 1;
// Parent id.
string parent_id = 2 [(validate.rules).string.min_len = 1];
// Temporary indicates whether the error is temporary.
Expand All @@ -117,7 +117,7 @@ message HTTPResponse {
// DownloadPieceBackToSourceFailedRequest downloads piece back-to-source failed request of AnnouncePeerRequest.
message DownloadPieceBackToSourceFailedRequest {
// Piece number.
uint32 piece_number = 1;
optional uint32 piece_number = 1;

oneof response {
option (validate.required) = true;
Expand Down
4 changes: 2 additions & 2 deletions proto/scheduler.proto
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ message DownloadPieceBackToSourceFinishedRequest {
// DownloadPieceFailedRequest downloads piece failed request of AnnouncePeerRequest.
message DownloadPieceFailedRequest {
// Piece number.
uint32 piece_number = 1;
optional uint32 piece_number = 1;
// Parent id.
string parent_id = 2;
// Temporary indicates whether the error is temporary.
Expand All @@ -114,7 +114,7 @@ message HTTPResponse {
// DownloadPieceBackToSourceFailedRequest downloads piece back-to-source failed request of AnnouncePeerRequest.
message DownloadPieceBackToSourceFailedRequest {
// Piece number.
uint32 piece_number = 1;
optional uint32 piece_number = 1;

oneof response {
HTTPResponse http_response = 2;
Expand Down
Binary file modified src/descriptor.bin
Binary file not shown.
8 changes: 4 additions & 4 deletions src/scheduler.v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ pub struct DownloadPieceBackToSourceFinishedRequest {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadPieceFailedRequest {
/// Piece number.
#[prost(uint32, tag = "1")]
pub piece_number: u32,
#[prost(uint32, optional, tag = "1")]
pub piece_number: ::core::option::Option<u32>,
/// Parent id.
#[prost(string, tag = "2")]
pub parent_id: ::prost::alloc::string::String,
Expand Down Expand Up @@ -138,8 +138,8 @@ pub struct HttpResponse {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadPieceBackToSourceFailedRequest {
/// Piece number.
#[prost(uint32, tag = "1")]
pub piece_number: u32,
#[prost(uint32, optional, tag = "1")]
pub piece_number: ::core::option::Option<u32>,
#[prost(
oneof = "download_piece_back_to_source_failed_request::Response",
tags = "2"
Expand Down

0 comments on commit 300b38f

Please sign in to comment.