Skip to content

Commit

Permalink
fix: partten for crc32 (#420)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi authored Nov 29, 2024
1 parent f79271f commit 8ac708e
Show file tree
Hide file tree
Showing 8 changed files with 596 additions and 602 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

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.175"
version = "2.0.176"
authors = ["Gaius <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
873 changes: 434 additions & 439 deletions pkg/apis/common/v2/common.pb.go

Large diffs are not rendered by default.

16 changes: 8 additions & 8 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.

8 changes: 4 additions & 4 deletions pkg/apis/common/v2/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ message Task {
// Download url.
string url = 3 [(validate.rules).string.uri = true];
// Digest of the task digest, for example blake3:xxx or sha256:yyy.
optional string digest = 4 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]{8}(?:[a-fA-F0-9]{2})?)$", ignore_empty: true}];
optional string digest = 4 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]+)$", ignore_empty: true}];
// URL tag identifies different task for same url.
optional string tag = 5;
// Application of task.
Expand Down Expand Up @@ -221,7 +221,7 @@ message PersistentCacheTask {
// the persistent cache task will be deleted when dfdaemon runs garbage collection.
uint64 current_replica_count = 4;
// Digest of the task digest, for example blake3:xxx or sha256:yyy.
string digest = 5 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]{8}(?:[a-fA-F0-9]{2})?)$"}];
string digest = 5 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]+)$"}];
// Tag is used to distinguish different persistent cache tasks.
optional string tag = 6;
// Application of task.
Expand Down Expand Up @@ -398,7 +398,7 @@ message Download {
// Download url.
string url = 1 [(validate.rules).string.uri = true];
// Digest of the task digest, for example blake3:xxx or sha256:yyy.
optional string digest = 2 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]{8}(?:[a-fA-F0-9]{2})?)$", ignore_empty: true}];
optional string digest = 2 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]+)$", ignore_empty: true}];
// Range is url range of request. If protocol is http, range
// will set in request header. If protocol is others, range
// will set in range field.
Expand Down Expand Up @@ -484,7 +484,7 @@ message Piece {
// Piece length.
uint64 length = 4;
// Digest of the piece data, for example blake3:xxx or sha256:yyy.
string digest = 5 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]{8}(?:[a-fA-F0-9]{2})?)$", ignore_empty: true}];
string digest = 5 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]+)$", ignore_empty: true}];
// Piece content.
optional bytes content = 6 [(validate.rules).bytes = {min_len: 1, ignore_empty: true}];
// Traffic type.
Expand Down
Loading

0 comments on commit 8ac708e

Please sign in to comment.