Skip to content

Commit

Permalink
feat: add validation to range message
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi committed Nov 13, 2023
1 parent b0a16ac commit 716efd7
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 64 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.43"
version = "2.0.44"
authors = ["Gaius <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
119 changes: 60 additions & 59 deletions pkg/apis/common/v2/common.pb.go

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

22 changes: 20 additions & 2 deletions pkg/apis/common/v2/common.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/common/v2/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ message Download {
// Range represents download range.
message Range {
// Start of range.
int64 start = 1;
int64 start = 1 [(validate.rules).int64.gte = 0];
// Length of range.
int64 length = 2;
int64 length = 2 [(validate.rules).int64.gt = 0];
}

// Piece represents information of piece.
Expand Down

0 comments on commit 716efd7

Please sign in to comment.