Skip to content

Commit

Permalink
feat: remove grpc error code validate (#1191)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi committed Jun 28, 2023
1 parent 9f4b86c commit 953622c
Show file tree
Hide file tree
Showing 6 changed files with 221 additions and 243 deletions.
266 changes: 133 additions & 133 deletions pkg/rpc/base/base.pb.go

Large diffs are not rendered by default.

7 changes: 1 addition & 6 deletions pkg/rpc/base/base.pb.validate.go

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

2 changes: 1 addition & 1 deletion pkg/rpc/base/base.proto
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ enum SizeScope{
TINY = 2;
}
message GrpcDfError {
Code code = 1 [(validate.rules).enum.defined_only = true];
Code code = 1;
string message = 2;
}

Expand Down
162 changes: 80 additions & 82 deletions pkg/rpc/scheduler/scheduler.pb.go

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

21 changes: 3 additions & 18 deletions pkg/rpc/scheduler/scheduler.pb.validate.go

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

6 changes: 3 additions & 3 deletions pkg/rpc/scheduler/scheduler.proto
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ message PieceResult{
// whether the piece downloading is successfully
bool success = 7;
// result code
base.Code code = 8 [(validate.rules).enum = {defined_only:true}];
base.Code code = 8;
// current host resource usage
base.HostLoad host_load = 9;
// currently completed piece count, -1 represent download failed
Expand All @@ -126,7 +126,7 @@ message PeerPacket{
DestPeer main_peer = 5;
repeated DestPeer steal_peers = 6;
// result code
base.Code code = 7 [(validate.rules).enum.defined_only = true];
base.Code code = 7;
}

message PeerResult{
Expand All @@ -145,7 +145,7 @@ message PeerResult{
// whether peer downloading file is successfully
bool success = 10;
// result code
base.Code code = 11 [(validate.rules).enum = {defined_only:true}];
base.Code code = 11;
// -1 represent task is running or download failed
int32 total_piece_count = 12;
}
Expand Down

0 comments on commit 953622c

Please sign in to comment.