feat: change TrafficType (#31)

Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
Gaius 2022-11-09 12:11:29 +08:00 committed by GitHub
parent 87f8419c19
commit 7fcdd86b59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 13 deletions

View File

@ -156,21 +156,25 @@ func (TaskType) EnumDescriptor() ([]byte, []int) {
type TrafficType int32
const (
// BACK_TO_SOURCE is back-to-source traffic.
// BACK_TO_SOURCE is to download traffic from the source.
TrafficType_BACK_TO_SOURCE TrafficType = 0
// P2P is p2p traffic.
TrafficType_P2P TrafficType = 1
// REMOTE_PEER is to download traffic from the remote peer.
TrafficType_REMOTE_PEER TrafficType = 1
// LOCAL_PEER is to download traffic from the local peer.
TrafficType_LOCAL_PEER TrafficType = 2
)
// Enum value maps for TrafficType.
var (
TrafficType_name = map[int32]string{
0: "BACK_TO_SOURCE",
1: "P2P",
1: "REMOTE_PEER",
2: "LOCAL_PEER",
}
TrafficType_value = map[string]int32{
"BACK_TO_SOURCE": 0,
"P2P": 1,
"REMOTE_PEER": 1,
"LOCAL_PEER": 2,
}
)
@ -631,12 +635,14 @@ var file_pkg_apis_common_v2_common_proto_rawDesc = []byte{
0x59, 0x10, 0x03, 0x2a, 0x32, 0x0a, 0x08, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12,
0x0c, 0x0a, 0x08, 0x44, 0x46, 0x44, 0x41, 0x45, 0x4d, 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a,
0x07, 0x44, 0x46, 0x43, 0x41, 0x43, 0x48, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x46,
0x53, 0x54, 0x4f, 0x52, 0x45, 0x10, 0x02, 0x2a, 0x2a, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x66, 0x66,
0x53, 0x54, 0x4f, 0x52, 0x45, 0x10, 0x02, 0x2a, 0x42, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x66, 0x66,
0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x42, 0x41, 0x43, 0x4b, 0x5f, 0x54,
0x4f, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x32,
0x50, 0x10, 0x01, 0x42, 0x1f, 0x5a, 0x1d, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x2f, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x4f, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x45,
0x4d, 0x4f, 0x54, 0x45, 0x5f, 0x50, 0x45, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x4c,
0x4f, 0x43, 0x41, 0x4c, 0x5f, 0x50, 0x45, 0x45, 0x52, 0x10, 0x02, 0x42, 0x1f, 0x5a, 0x1d, 0x64,
0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70,
0x69, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -57,11 +57,14 @@ enum TaskType{
// TrafficType represents type of traffic.
enum TrafficType{
// BACK_TO_SOURCE is back-to-source traffic.
// BACK_TO_SOURCE is to download traffic from the source.
BACK_TO_SOURCE = 0;
// P2P is p2p traffic.
P2P = 1;
// REMOTE_PEER is to download traffic from the remote peer.
REMOTE_PEER = 1;
// LOCAL_PEER is to download traffic from the local peer.
LOCAL_PEER = 2;
}
// Range represents download range.