mirror of https://github.com/dragonflyoss/api.git
feat: upper priority level (#44)
Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
parent
64ecd30a29
commit
69ae546791
|
@ -101,47 +101,47 @@ type Priority int32
|
|||
const (
|
||||
// Level0 represents the download task is forbidden,
|
||||
// and an error code is returned during the registration.
|
||||
Priority_Level0 Priority = 0
|
||||
Priority_LEVEL0 Priority = 0
|
||||
// Level1 represents when the task is downloaded for the first time,
|
||||
// allow peers to download from the other peers,
|
||||
// but not back-to-source. When the task is not downloaded for
|
||||
// the first time, it is scheduled normally.
|
||||
Priority_Level1 Priority = 1
|
||||
Priority_LEVEL1 Priority = 1
|
||||
// Level2 represents when the task is downloaded for the first time,
|
||||
// the normal peer is first to download back-to-source.
|
||||
// When the task is not downloaded for the first time, it is scheduled normally.
|
||||
Priority_Level2 Priority = 2
|
||||
Priority_LEVEL2 Priority = 2
|
||||
// Level3 represents when the task is downloaded for the first time,
|
||||
// the weak peer is first triggered to back-to-source.
|
||||
// When the task is not downloaded for the first time, it is scheduled normally.
|
||||
Priority_Level3 Priority = 3
|
||||
Priority_LEVEL3 Priority = 3
|
||||
// Level4 represents when the task is downloaded for the first time,
|
||||
// the strong peer is first triggered to back-to-source.
|
||||
// When the task is not downloaded for the first time, it is scheduled normally.
|
||||
Priority_Level4 Priority = 4
|
||||
Priority_LEVEL4 Priority = 4
|
||||
// Level4 represents when the task is downloaded for the first time,
|
||||
// the super peer is first triggered to back-to-source.
|
||||
// When the task is not downloaded for the first time, it is scheduled normally.
|
||||
Priority_Level5 Priority = 5
|
||||
Priority_LEVEL5 Priority = 5
|
||||
)
|
||||
|
||||
// Enum value maps for Priority.
|
||||
var (
|
||||
Priority_name = map[int32]string{
|
||||
0: "Level0",
|
||||
1: "Level1",
|
||||
2: "Level2",
|
||||
3: "Level3",
|
||||
4: "Level4",
|
||||
5: "Level5",
|
||||
0: "LEVEL0",
|
||||
1: "LEVEL1",
|
||||
2: "LEVEL2",
|
||||
3: "LEVEL3",
|
||||
4: "LEVEL4",
|
||||
5: "LEVEL5",
|
||||
}
|
||||
Priority_value = map[string]int32{
|
||||
"Level0": 0,
|
||||
"Level1": 1,
|
||||
"Level2": 2,
|
||||
"Level3": 3,
|
||||
"Level4": 4,
|
||||
"Level5": 5,
|
||||
"LEVEL0": 0,
|
||||
"LEVEL1": 1,
|
||||
"LEVEL2": 2,
|
||||
"LEVEL3": 3,
|
||||
"LEVEL4": 4,
|
||||
"LEVEL5": 5,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -2795,7 +2795,7 @@ func (x *URLPriority) GetValue() Priority {
|
|||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return Priority_Level0
|
||||
return Priority_LEVEL0
|
||||
}
|
||||
|
||||
// ApplicationPriority represents config of application priority.
|
||||
|
@ -2846,7 +2846,7 @@ func (x *ApplicationPriority) GetValue() Priority {
|
|||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return Priority_Level0
|
||||
return Priority_LEVEL0
|
||||
}
|
||||
|
||||
func (x *ApplicationPriority) GetUrls() []*URLPriority {
|
||||
|
@ -3613,11 +3613,11 @@ var file_pkg_apis_manager_v1_manager_proto_rawDesc = []byte{
|
|||
0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x45,
|
||||
0x45, 0x44, 0x5f, 0x50, 0x45, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x02,
|
||||
0x2a, 0x52, 0x0a, 0x08, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x0a, 0x0a, 0x06,
|
||||
0x4c, 0x65, 0x76, 0x65, 0x6c, 0x30, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x65, 0x76, 0x65,
|
||||
0x6c, 0x31, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x32, 0x10, 0x02,
|
||||
0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x33, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06,
|
||||
0x4c, 0x65, 0x76, 0x65, 0x6c, 0x34, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x65, 0x76, 0x65,
|
||||
0x6c, 0x35, 0x10, 0x05, 0x32, 0xf1, 0x0a, 0x0a, 0x07, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72,
|
||||
0x4c, 0x45, 0x56, 0x45, 0x4c, 0x30, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45,
|
||||
0x4c, 0x31, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x32, 0x10, 0x02,
|
||||
0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x33, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06,
|
||||
0x4c, 0x45, 0x56, 0x45, 0x4c, 0x34, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45,
|
||||
0x4c, 0x35, 0x10, 0x05, 0x32, 0xf1, 0x0a, 0x0a, 0x07, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72,
|
||||
0x12, 0x3d, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x12,
|
||||
0x1b, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x65,
|
||||
0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x6d,
|
||||
|
|
|
@ -38,33 +38,33 @@ enum SourceType {
|
|||
enum Priority {
|
||||
// Level0 represents the download task is forbidden,
|
||||
// and an error code is returned during the registration.
|
||||
Level0 = 0;
|
||||
LEVEL0 = 0;
|
||||
|
||||
// Level1 represents when the task is downloaded for the first time,
|
||||
// allow peers to download from the other peers,
|
||||
// but not back-to-source. When the task is not downloaded for
|
||||
// the first time, it is scheduled normally.
|
||||
Level1 = 1;
|
||||
LEVEL1 = 1;
|
||||
|
||||
// Level2 represents when the task is downloaded for the first time,
|
||||
// the normal peer is first to download back-to-source.
|
||||
// When the task is not downloaded for the first time, it is scheduled normally.
|
||||
Level2 = 2;
|
||||
LEVEL2 = 2;
|
||||
|
||||
// Level3 represents when the task is downloaded for the first time,
|
||||
// the weak peer is first triggered to back-to-source.
|
||||
// When the task is not downloaded for the first time, it is scheduled normally.
|
||||
Level3 = 3;
|
||||
LEVEL3 = 3;
|
||||
|
||||
// Level4 represents when the task is downloaded for the first time,
|
||||
// the strong peer is first triggered to back-to-source.
|
||||
// When the task is not downloaded for the first time, it is scheduled normally.
|
||||
Level4 = 4;
|
||||
LEVEL4 = 4;
|
||||
|
||||
// Level4 represents when the task is downloaded for the first time,
|
||||
// the super peer is first triggered to back-to-source.
|
||||
// When the task is not downloaded for the first time, it is scheduled normally.
|
||||
Level5 = 5;
|
||||
LEVEL5 = 5;
|
||||
}
|
||||
|
||||
// SecurityGroup represents security group of cluster.
|
||||
|
|
Loading…
Reference in New Issue