Skip to content

Commit

Permalink
feat: add validation to range message (#207)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
gaius-qi authored Nov 13, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent b0a16ac commit b91c7e8
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"
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
@@ -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.

0 comments on commit b91c7e8

Please sign in to comment.