mirror of https://github.com/dragonflyoss/api.git
feat: change piece number type from uint32 to int32 (#72)
Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
parent
41e14b7c60
commit
11a152f294
|
@ -970,7 +970,7 @@ type Piece struct {
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Piece number.
|
// Piece number.
|
||||||
Number uint32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"`
|
Number int32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"`
|
||||||
// Parent peer id.
|
// Parent peer id.
|
||||||
ParentId string `protobuf:"bytes,2,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"`
|
ParentId string `protobuf:"bytes,2,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"`
|
||||||
// Piece offset.
|
// Piece offset.
|
||||||
|
@ -1019,7 +1019,7 @@ func (*Piece) Descriptor() ([]byte, []int) {
|
||||||
return file_pkg_apis_common_v2_common_proto_rawDescGZIP(), []int{5}
|
return file_pkg_apis_common_v2_common_proto_rawDescGZIP(), []int{5}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Piece) GetNumber() uint32 {
|
func (x *Piece) GetNumber() int32 {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Number
|
return x.Number
|
||||||
}
|
}
|
||||||
|
@ -1310,8 +1310,8 @@ var file_pkg_apis_common_v2_common_proto_rawDesc = []byte{
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
|
||||||
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
|
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
|
||||||
0x02, 0x38, 0x01, 0x22, 0x8d, 0x03, 0x0a, 0x05, 0x50, 0x69, 0x65, 0x63, 0x65, 0x12, 0x1f, 0x0a,
|
0x02, 0x38, 0x01, 0x22, 0x8d, 0x03, 0x0a, 0x05, 0x50, 0x69, 0x65, 0x63, 0x65, 0x12, 0x1f, 0x0a,
|
||||||
0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x07, 0xfa,
|
0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa,
|
||||||
0x42, 0x04, 0x2a, 0x02, 0x28, 0x00, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x27,
|
0x42, 0x04, 0x1a, 0x02, 0x28, 0x00, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x27,
|
||||||
0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
|
0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||||
0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0xd0, 0x01, 0x01, 0x52, 0x08, 0x70,
|
0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0xd0, 0x01, 0x01, 0x52, 0x08, 0x70,
|
||||||
0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65,
|
0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65,
|
||||||
|
|
|
@ -232,7 +232,7 @@ message Download {
|
||||||
// Piece represents information of piece.
|
// Piece represents information of piece.
|
||||||
message Piece {
|
message Piece {
|
||||||
// Piece number.
|
// Piece number.
|
||||||
uint32 number = 1 [(validate.rules).uint32.gte = 0];
|
int32 number = 1 [(validate.rules).int32.gte = 0];
|
||||||
// Parent peer id.
|
// Parent peer id.
|
||||||
string parent_id = 2 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
|
string parent_id = 2 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
|
||||||
// Piece offset.
|
// Piece offset.
|
||||||
|
|
|
@ -229,7 +229,7 @@ message Download {
|
||||||
// Piece represents information of piece.
|
// Piece represents information of piece.
|
||||||
message Piece {
|
message Piece {
|
||||||
// Piece number.
|
// Piece number.
|
||||||
uint32 number = 1;
|
int32 number = 1;
|
||||||
// Parent peer id.
|
// Parent peer id.
|
||||||
string parent_id = 2;
|
string parent_id = 2;
|
||||||
// Piece offset.
|
// Piece offset.
|
||||||
|
|
|
@ -193,8 +193,8 @@ pub struct Download {
|
||||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
pub struct Piece {
|
pub struct Piece {
|
||||||
/// Piece number.
|
/// Piece number.
|
||||||
#[prost(uint32, tag = "1")]
|
#[prost(int32, tag = "1")]
|
||||||
pub number: u32,
|
pub number: i32,
|
||||||
/// Parent peer id.
|
/// Parent peer id.
|
||||||
#[prost(string, tag = "2")]
|
#[prost(string, tag = "2")]
|
||||||
pub parent_id: ::prost::alloc::string::String,
|
pub parent_id: ::prost::alloc::string::String,
|
||||||
|
|
Loading…
Reference in New Issue