1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-10 09:50:43 +00:00

update API command

This commit is contained in:
Shelikhoo 2021-06-19 08:57:40 +01:00
parent 81462f7b65
commit 775b9f54df
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316
6 changed files with 152 additions and 310 deletions

View File

@ -293,53 +293,6 @@ func (x *TestRouteRequest) GetPublishResult() bool {
return false return false
} }
type GetBalancersRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
BalancerTags []string `protobuf:"bytes,1,rep,name=balancerTags,proto3" json:"balancerTags,omitempty"`
}
func (x *GetBalancersRequest) Reset() {
*x = GetBalancersRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_app_router_command_command_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetBalancersRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetBalancersRequest) ProtoMessage() {}
func (x *GetBalancersRequest) ProtoReflect() protoreflect.Message {
mi := &file_app_router_command_command_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetBalancersRequest.ProtoReflect.Descriptor instead.
func (*GetBalancersRequest) Descriptor() ([]byte, []int) {
return file_app_router_command_command_proto_rawDescGZIP(), []int{3}
}
func (x *GetBalancersRequest) GetBalancerTags() []string {
if x != nil {
return x.BalancerTags
}
return nil
}
type PrincipleTargetInfo struct { type PrincipleTargetInfo struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -351,7 +304,7 @@ type PrincipleTargetInfo struct {
func (x *PrincipleTargetInfo) Reset() { func (x *PrincipleTargetInfo) Reset() {
*x = PrincipleTargetInfo{} *x = PrincipleTargetInfo{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_app_router_command_command_proto_msgTypes[4] mi := &file_app_router_command_command_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -364,7 +317,7 @@ func (x *PrincipleTargetInfo) String() string {
func (*PrincipleTargetInfo) ProtoMessage() {} func (*PrincipleTargetInfo) ProtoMessage() {}
func (x *PrincipleTargetInfo) ProtoReflect() protoreflect.Message { func (x *PrincipleTargetInfo) ProtoReflect() protoreflect.Message {
mi := &file_app_router_command_command_proto_msgTypes[4] mi := &file_app_router_command_command_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -377,7 +330,7 @@ func (x *PrincipleTargetInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use PrincipleTargetInfo.ProtoReflect.Descriptor instead. // Deprecated: Use PrincipleTargetInfo.ProtoReflect.Descriptor instead.
func (*PrincipleTargetInfo) Descriptor() ([]byte, []int) { func (*PrincipleTargetInfo) Descriptor() ([]byte, []int) {
return file_app_router_command_command_proto_rawDescGZIP(), []int{4} return file_app_router_command_command_proto_rawDescGZIP(), []int{3}
} }
func (x *PrincipleTargetInfo) GetTag() []string { func (x *PrincipleTargetInfo) GetTag() []string {
@ -398,7 +351,7 @@ type OverrideInfo struct {
func (x *OverrideInfo) Reset() { func (x *OverrideInfo) Reset() {
*x = OverrideInfo{} *x = OverrideInfo{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_app_router_command_command_proto_msgTypes[5] mi := &file_app_router_command_command_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -411,7 +364,7 @@ func (x *OverrideInfo) String() string {
func (*OverrideInfo) ProtoMessage() {} func (*OverrideInfo) ProtoMessage() {}
func (x *OverrideInfo) ProtoReflect() protoreflect.Message { func (x *OverrideInfo) ProtoReflect() protoreflect.Message {
mi := &file_app_router_command_command_proto_msgTypes[5] mi := &file_app_router_command_command_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -424,7 +377,7 @@ func (x *OverrideInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use OverrideInfo.ProtoReflect.Descriptor instead. // Deprecated: Use OverrideInfo.ProtoReflect.Descriptor instead.
func (*OverrideInfo) Descriptor() ([]byte, []int) { func (*OverrideInfo) Descriptor() ([]byte, []int) {
return file_app_router_command_command_proto_rawDescGZIP(), []int{5} return file_app_router_command_command_proto_rawDescGZIP(), []int{4}
} }
func (x *OverrideInfo) GetTarget() string { func (x *OverrideInfo) GetTarget() string {
@ -446,7 +399,7 @@ type BalancerMsg struct {
func (x *BalancerMsg) Reset() { func (x *BalancerMsg) Reset() {
*x = BalancerMsg{} *x = BalancerMsg{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_app_router_command_command_proto_msgTypes[6] mi := &file_app_router_command_command_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -459,7 +412,7 @@ func (x *BalancerMsg) String() string {
func (*BalancerMsg) ProtoMessage() {} func (*BalancerMsg) ProtoMessage() {}
func (x *BalancerMsg) ProtoReflect() protoreflect.Message { func (x *BalancerMsg) ProtoReflect() protoreflect.Message {
mi := &file_app_router_command_command_proto_msgTypes[6] mi := &file_app_router_command_command_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -472,7 +425,7 @@ func (x *BalancerMsg) ProtoReflect() protoreflect.Message {
// Deprecated: Use BalancerMsg.ProtoReflect.Descriptor instead. // Deprecated: Use BalancerMsg.ProtoReflect.Descriptor instead.
func (*BalancerMsg) Descriptor() ([]byte, []int) { func (*BalancerMsg) Descriptor() ([]byte, []int) {
return file_app_router_command_command_proto_rawDescGZIP(), []int{6} return file_app_router_command_command_proto_rawDescGZIP(), []int{5}
} }
func (x *BalancerMsg) GetOverride() *OverrideInfo { func (x *BalancerMsg) GetOverride() *OverrideInfo {
@ -500,7 +453,7 @@ type GetBalancerInfoRequest struct {
func (x *GetBalancerInfoRequest) Reset() { func (x *GetBalancerInfoRequest) Reset() {
*x = GetBalancerInfoRequest{} *x = GetBalancerInfoRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_app_router_command_command_proto_msgTypes[7] mi := &file_app_router_command_command_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -513,7 +466,7 @@ func (x *GetBalancerInfoRequest) String() string {
func (*GetBalancerInfoRequest) ProtoMessage() {} func (*GetBalancerInfoRequest) ProtoMessage() {}
func (x *GetBalancerInfoRequest) ProtoReflect() protoreflect.Message { func (x *GetBalancerInfoRequest) ProtoReflect() protoreflect.Message {
mi := &file_app_router_command_command_proto_msgTypes[7] mi := &file_app_router_command_command_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -526,7 +479,7 @@ func (x *GetBalancerInfoRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetBalancerInfoRequest.ProtoReflect.Descriptor instead. // Deprecated: Use GetBalancerInfoRequest.ProtoReflect.Descriptor instead.
func (*GetBalancerInfoRequest) Descriptor() ([]byte, []int) { func (*GetBalancerInfoRequest) Descriptor() ([]byte, []int) {
return file_app_router_command_command_proto_rawDescGZIP(), []int{7} return file_app_router_command_command_proto_rawDescGZIP(), []int{6}
} }
func (x *GetBalancerInfoRequest) GetTag() string { func (x *GetBalancerInfoRequest) GetTag() string {
@ -547,7 +500,7 @@ type GetBalancerInfoResponse struct {
func (x *GetBalancerInfoResponse) Reset() { func (x *GetBalancerInfoResponse) Reset() {
*x = GetBalancerInfoResponse{} *x = GetBalancerInfoResponse{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_app_router_command_command_proto_msgTypes[8] mi := &file_app_router_command_command_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -560,7 +513,7 @@ func (x *GetBalancerInfoResponse) String() string {
func (*GetBalancerInfoResponse) ProtoMessage() {} func (*GetBalancerInfoResponse) ProtoMessage() {}
func (x *GetBalancerInfoResponse) ProtoReflect() protoreflect.Message { func (x *GetBalancerInfoResponse) ProtoReflect() protoreflect.Message {
mi := &file_app_router_command_command_proto_msgTypes[8] mi := &file_app_router_command_command_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -573,7 +526,7 @@ func (x *GetBalancerInfoResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetBalancerInfoResponse.ProtoReflect.Descriptor instead. // Deprecated: Use GetBalancerInfoResponse.ProtoReflect.Descriptor instead.
func (*GetBalancerInfoResponse) Descriptor() ([]byte, []int) { func (*GetBalancerInfoResponse) Descriptor() ([]byte, []int) {
return file_app_router_command_command_proto_rawDescGZIP(), []int{8} return file_app_router_command_command_proto_rawDescGZIP(), []int{7}
} }
func (x *GetBalancerInfoResponse) GetBalancer() *BalancerMsg { func (x *GetBalancerInfoResponse) GetBalancer() *BalancerMsg {
@ -595,7 +548,7 @@ type OverrideBalancerTargetRequest struct {
func (x *OverrideBalancerTargetRequest) Reset() { func (x *OverrideBalancerTargetRequest) Reset() {
*x = OverrideBalancerTargetRequest{} *x = OverrideBalancerTargetRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_app_router_command_command_proto_msgTypes[9] mi := &file_app_router_command_command_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -608,7 +561,7 @@ func (x *OverrideBalancerTargetRequest) String() string {
func (*OverrideBalancerTargetRequest) ProtoMessage() {} func (*OverrideBalancerTargetRequest) ProtoMessage() {}
func (x *OverrideBalancerTargetRequest) ProtoReflect() protoreflect.Message { func (x *OverrideBalancerTargetRequest) ProtoReflect() protoreflect.Message {
mi := &file_app_router_command_command_proto_msgTypes[9] mi := &file_app_router_command_command_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -621,7 +574,7 @@ func (x *OverrideBalancerTargetRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use OverrideBalancerTargetRequest.ProtoReflect.Descriptor instead. // Deprecated: Use OverrideBalancerTargetRequest.ProtoReflect.Descriptor instead.
func (*OverrideBalancerTargetRequest) Descriptor() ([]byte, []int) { func (*OverrideBalancerTargetRequest) Descriptor() ([]byte, []int) {
return file_app_router_command_command_proto_rawDescGZIP(), []int{9} return file_app_router_command_command_proto_rawDescGZIP(), []int{8}
} }
func (x *OverrideBalancerTargetRequest) GetBalancerTag() string { func (x *OverrideBalancerTargetRequest) GetBalancerTag() string {
@ -647,7 +600,7 @@ type OverrideBalancerTargetResponse struct {
func (x *OverrideBalancerTargetResponse) Reset() { func (x *OverrideBalancerTargetResponse) Reset() {
*x = OverrideBalancerTargetResponse{} *x = OverrideBalancerTargetResponse{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_app_router_command_command_proto_msgTypes[10] mi := &file_app_router_command_command_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -660,7 +613,7 @@ func (x *OverrideBalancerTargetResponse) String() string {
func (*OverrideBalancerTargetResponse) ProtoMessage() {} func (*OverrideBalancerTargetResponse) ProtoMessage() {}
func (x *OverrideBalancerTargetResponse) ProtoReflect() protoreflect.Message { func (x *OverrideBalancerTargetResponse) ProtoReflect() protoreflect.Message {
mi := &file_app_router_command_command_proto_msgTypes[10] mi := &file_app_router_command_command_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -673,7 +626,7 @@ func (x *OverrideBalancerTargetResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use OverrideBalancerTargetResponse.ProtoReflect.Descriptor instead. // Deprecated: Use OverrideBalancerTargetResponse.ProtoReflect.Descriptor instead.
func (*OverrideBalancerTargetResponse) Descriptor() ([]byte, []int) { func (*OverrideBalancerTargetResponse) Descriptor() ([]byte, []int) {
return file_app_router_command_command_proto_rawDescGZIP(), []int{10} return file_app_router_command_command_proto_rawDescGZIP(), []int{9}
} }
type Config struct { type Config struct {
@ -685,7 +638,7 @@ type Config struct {
func (x *Config) Reset() { func (x *Config) Reset() {
*x = Config{} *x = Config{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_app_router_command_command_proto_msgTypes[11] mi := &file_app_router_command_command_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -698,7 +651,7 @@ func (x *Config) String() string {
func (*Config) ProtoMessage() {} func (*Config) ProtoMessage() {}
func (x *Config) ProtoReflect() protoreflect.Message { func (x *Config) ProtoReflect() protoreflect.Message {
mi := &file_app_router_command_command_proto_msgTypes[11] mi := &file_app_router_command_command_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -711,7 +664,7 @@ func (x *Config) ProtoReflect() protoreflect.Message {
// Deprecated: Use Config.ProtoReflect.Descriptor instead. // Deprecated: Use Config.ProtoReflect.Descriptor instead.
func (*Config) Descriptor() ([]byte, []int) { func (*Config) Descriptor() ([]byte, []int) {
return file_app_router_command_command_proto_rawDescGZIP(), []int{11} return file_app_router_command_command_proto_rawDescGZIP(), []int{10}
} }
var File_app_router_command_command_proto protoreflect.FileDescriptor var File_app_router_command_command_proto protoreflect.FileDescriptor
@ -773,87 +726,84 @@ var file_app_router_command_command_proto_rawDesc = []byte{
0x28, 0x09, 0x52, 0x0e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x28, 0x09, 0x52, 0x0e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f,
0x72, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x72, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73,
0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x50, 0x75, 0x62, 0x6c, 0x69,
0x73, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x39, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x42, 0x73, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x27, 0x0a, 0x13, 0x50, 0x72, 0x69, 0x6e,
0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x63, 0x69, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12,
0x22, 0x0a, 0x0c, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x54, 0x61, 0x67, 0x73, 0x18, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61,
0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x54, 0x67, 0x22, 0x26, 0x0a, 0x0c, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x49, 0x6e, 0x66,
0x61, 0x67, 0x73, 0x22, 0x27, 0x0a, 0x13, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x6c, 0x65, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28,
0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0xb5, 0x01, 0x0a, 0x0b, 0x42, 0x61,
0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x22, 0x26, 0x0a, 0x0c, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x47, 0x0a, 0x08, 0x6f, 0x76, 0x65,
0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x72, 0x69, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x76, 0x32,
0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75,
0x72, 0x67, 0x65, 0x74, 0x22, 0xb5, 0x01, 0x0a, 0x0b, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x4f, 0x76, 0x65, 0x72,
0x72, 0x4d, 0x73, 0x67, 0x12, 0x47, 0x0a, 0x08, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x72, 0x69, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69,
0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x64, 0x65, 0x12, 0x5d, 0x0a, 0x10, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x6c, 0x65, 0x5f,
0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x76,
0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x49, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f,
0x6e, 0x66, 0x6f, 0x52, 0x08, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x12, 0x5d, 0x0a, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x50, 0x72, 0x69,
0x10, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x69, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f,
0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x52, 0x0f, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65,
0x74, 0x22, 0x2a, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72,
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x74,
0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x22, 0x61, 0x0a,
0x17, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x08, 0x62, 0x61, 0x6c, 0x61,
0x6e, 0x63, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x76, 0x32, 0x72,
0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74,
0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e,
0x63, 0x65, 0x72, 0x4d, 0x73, 0x67, 0x52, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72,
0x22, 0x59, 0x0a, 0x1d, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x61, 0x6c, 0x61,
0x6e, 0x63, 0x65, 0x72, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x20, 0x0a, 0x0b, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x54, 0x61, 0x67,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72,
0x54, 0x61, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0x20, 0x0a, 0x1e, 0x4f,
0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x54,
0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x08, 0x0a,
0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x32, 0xa8, 0x04, 0x0a, 0x0e, 0x52, 0x6f, 0x75, 0x74,
0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x87, 0x01, 0x0a, 0x15, 0x53,
0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x53,
0x74, 0x61, 0x74, 0x73, 0x12, 0x3b, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72,
0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d,
0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x6f,
0x75, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x2d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61,
0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e,
0x64, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74,
0x22, 0x00, 0x30, 0x01, 0x12, 0x6d, 0x0a, 0x09, 0x54, 0x65, 0x73, 0x74, 0x52, 0x6f, 0x75, 0x74,
0x65, 0x12, 0x2f, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61,
0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e,
0x64, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e,
0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61,
0x6e, 0x64, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78,
0x74, 0x22, 0x00, 0x12, 0x82, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e,
0x63, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x35, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e,
0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e,
0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x6c, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e,
0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36,
0x6e, 0x63, 0x69, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0x2a, 0x0a, 0x16,
0x47, 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x22, 0x61, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x42,
0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f,
0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f,
0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x4d, 0x73,
0x67, 0x52, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x22, 0x59, 0x0a, 0x1d, 0x4f,
0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x54,
0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b,
0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x54, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0b, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x54, 0x61, 0x67, 0x12, 0x16,
0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0x20, 0x0a, 0x1e, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69,
0x64, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x08, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x32, 0xa8, 0x04, 0x0a, 0x0e, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x87, 0x01, 0x0a, 0x15, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72,
0x69, 0x62, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12,
0x3b, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70,
0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e,
0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67,
0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x76,
0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f,
0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x6f, 0x75,
0x74, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x00, 0x30, 0x01, 0x12,
0x6d, 0x0a, 0x09, 0x54, 0x65, 0x73, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x2f, 0x2e, 0x76,
0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f,
0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x54, 0x65, 0x73,
0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e,
0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72,
0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x6f,
0x75, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x00, 0x12, 0x82,
0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x49, 0x6e,
0x66, 0x6f, 0x12, 0x35, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e,
0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61,
0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x49, 0x6e,
0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x76, 0x32, 0x72, 0x61,
0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65,
0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6c,
0x61, 0x6e, 0x63, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x22, 0x00, 0x12, 0x97, 0x01, 0x0a, 0x16, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65,
0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x3c,
0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e,
0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x4f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x47,
0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x54, 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65,
0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3d, 0x2e, 0x76, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x97, 0x01, 0x0a, 0x16, 0x4f, 0x76, 0x65,
0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f,
0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x4f, 0x76, 0x65,
0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x54, 0x61, 0x72, 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x54, 0x61, 0x72,
0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x78, 0x0a, 0x67, 0x65, 0x74, 0x12, 0x3c, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65,
0x21, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x61, 0x6e, 0x64, 0x2e, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x61, 0x6c, 0x61,
0x6e, 0x64, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6e, 0x63, 0x65, 0x72, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x2f, 0x76, 0x32, 0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x74, 0x1a, 0x3d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61,
0x65, 0x2f, 0x76, 0x34, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2f, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e,
0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x1d, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x64, 0x2e, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63,
0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x65, 0x72, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x22, 0x00, 0x42, 0x78, 0x0a, 0x21, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e,
0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e,
0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75,
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x32, 0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32, 0x72, 0x61,
0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x34, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x6f,
0x75, 0x74, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x1d, 0x56,
0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x52, 0x6f,
0x75, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -868,38 +818,37 @@ func file_app_router_command_command_proto_rawDescGZIP() []byte {
return file_app_router_command_command_proto_rawDescData return file_app_router_command_command_proto_rawDescData
} }
var file_app_router_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_app_router_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
var file_app_router_command_command_proto_goTypes = []interface{}{ var file_app_router_command_command_proto_goTypes = []interface{}{
(*RoutingContext)(nil), // 0: v2ray.core.app.router.command.RoutingContext (*RoutingContext)(nil), // 0: v2ray.core.app.router.command.RoutingContext
(*SubscribeRoutingStatsRequest)(nil), // 1: v2ray.core.app.router.command.SubscribeRoutingStatsRequest (*SubscribeRoutingStatsRequest)(nil), // 1: v2ray.core.app.router.command.SubscribeRoutingStatsRequest
(*TestRouteRequest)(nil), // 2: v2ray.core.app.router.command.TestRouteRequest (*TestRouteRequest)(nil), // 2: v2ray.core.app.router.command.TestRouteRequest
(*GetBalancersRequest)(nil), // 3: v2ray.core.app.router.command.GetBalancersRequest (*PrincipleTargetInfo)(nil), // 3: v2ray.core.app.router.command.PrincipleTargetInfo
(*PrincipleTargetInfo)(nil), // 4: v2ray.core.app.router.command.PrincipleTargetInfo (*OverrideInfo)(nil), // 4: v2ray.core.app.router.command.OverrideInfo
(*OverrideInfo)(nil), // 5: v2ray.core.app.router.command.OverrideInfo (*BalancerMsg)(nil), // 5: v2ray.core.app.router.command.BalancerMsg
(*BalancerMsg)(nil), // 6: v2ray.core.app.router.command.BalancerMsg (*GetBalancerInfoRequest)(nil), // 6: v2ray.core.app.router.command.GetBalancerInfoRequest
(*GetBalancerInfoRequest)(nil), // 7: v2ray.core.app.router.command.GetBalancerInfoRequest (*GetBalancerInfoResponse)(nil), // 7: v2ray.core.app.router.command.GetBalancerInfoResponse
(*GetBalancerInfoResponse)(nil), // 8: v2ray.core.app.router.command.GetBalancerInfoResponse (*OverrideBalancerTargetRequest)(nil), // 8: v2ray.core.app.router.command.OverrideBalancerTargetRequest
(*OverrideBalancerTargetRequest)(nil), // 9: v2ray.core.app.router.command.OverrideBalancerTargetRequest (*OverrideBalancerTargetResponse)(nil), // 9: v2ray.core.app.router.command.OverrideBalancerTargetResponse
(*OverrideBalancerTargetResponse)(nil), // 10: v2ray.core.app.router.command.OverrideBalancerTargetResponse (*Config)(nil), // 10: v2ray.core.app.router.command.Config
(*Config)(nil), // 11: v2ray.core.app.router.command.Config nil, // 11: v2ray.core.app.router.command.RoutingContext.AttributesEntry
nil, // 12: v2ray.core.app.router.command.RoutingContext.AttributesEntry (net.Network)(0), // 12: v2ray.core.common.net.Network
(net.Network)(0), // 13: v2ray.core.common.net.Network
} }
var file_app_router_command_command_proto_depIdxs = []int32{ var file_app_router_command_command_proto_depIdxs = []int32{
13, // 0: v2ray.core.app.router.command.RoutingContext.Network:type_name -> v2ray.core.common.net.Network 12, // 0: v2ray.core.app.router.command.RoutingContext.Network:type_name -> v2ray.core.common.net.Network
12, // 1: v2ray.core.app.router.command.RoutingContext.Attributes:type_name -> v2ray.core.app.router.command.RoutingContext.AttributesEntry 11, // 1: v2ray.core.app.router.command.RoutingContext.Attributes:type_name -> v2ray.core.app.router.command.RoutingContext.AttributesEntry
0, // 2: v2ray.core.app.router.command.TestRouteRequest.RoutingContext:type_name -> v2ray.core.app.router.command.RoutingContext 0, // 2: v2ray.core.app.router.command.TestRouteRequest.RoutingContext:type_name -> v2ray.core.app.router.command.RoutingContext
5, // 3: v2ray.core.app.router.command.BalancerMsg.override:type_name -> v2ray.core.app.router.command.OverrideInfo 4, // 3: v2ray.core.app.router.command.BalancerMsg.override:type_name -> v2ray.core.app.router.command.OverrideInfo
4, // 4: v2ray.core.app.router.command.BalancerMsg.principle_target:type_name -> v2ray.core.app.router.command.PrincipleTargetInfo 3, // 4: v2ray.core.app.router.command.BalancerMsg.principle_target:type_name -> v2ray.core.app.router.command.PrincipleTargetInfo
6, // 5: v2ray.core.app.router.command.GetBalancerInfoResponse.balancer:type_name -> v2ray.core.app.router.command.BalancerMsg 5, // 5: v2ray.core.app.router.command.GetBalancerInfoResponse.balancer:type_name -> v2ray.core.app.router.command.BalancerMsg
1, // 6: v2ray.core.app.router.command.RoutingService.SubscribeRoutingStats:input_type -> v2ray.core.app.router.command.SubscribeRoutingStatsRequest 1, // 6: v2ray.core.app.router.command.RoutingService.SubscribeRoutingStats:input_type -> v2ray.core.app.router.command.SubscribeRoutingStatsRequest
2, // 7: v2ray.core.app.router.command.RoutingService.TestRoute:input_type -> v2ray.core.app.router.command.TestRouteRequest 2, // 7: v2ray.core.app.router.command.RoutingService.TestRoute:input_type -> v2ray.core.app.router.command.TestRouteRequest
7, // 8: v2ray.core.app.router.command.RoutingService.GetBalancerInfo:input_type -> v2ray.core.app.router.command.GetBalancerInfoRequest 6, // 8: v2ray.core.app.router.command.RoutingService.GetBalancerInfo:input_type -> v2ray.core.app.router.command.GetBalancerInfoRequest
9, // 9: v2ray.core.app.router.command.RoutingService.OverrideBalancerTarget:input_type -> v2ray.core.app.router.command.OverrideBalancerTargetRequest 8, // 9: v2ray.core.app.router.command.RoutingService.OverrideBalancerTarget:input_type -> v2ray.core.app.router.command.OverrideBalancerTargetRequest
0, // 10: v2ray.core.app.router.command.RoutingService.SubscribeRoutingStats:output_type -> v2ray.core.app.router.command.RoutingContext 0, // 10: v2ray.core.app.router.command.RoutingService.SubscribeRoutingStats:output_type -> v2ray.core.app.router.command.RoutingContext
0, // 11: v2ray.core.app.router.command.RoutingService.TestRoute:output_type -> v2ray.core.app.router.command.RoutingContext 0, // 11: v2ray.core.app.router.command.RoutingService.TestRoute:output_type -> v2ray.core.app.router.command.RoutingContext
8, // 12: v2ray.core.app.router.command.RoutingService.GetBalancerInfo:output_type -> v2ray.core.app.router.command.GetBalancerInfoResponse 7, // 12: v2ray.core.app.router.command.RoutingService.GetBalancerInfo:output_type -> v2ray.core.app.router.command.GetBalancerInfoResponse
10, // 13: v2ray.core.app.router.command.RoutingService.OverrideBalancerTarget:output_type -> v2ray.core.app.router.command.OverrideBalancerTargetResponse 9, // 13: v2ray.core.app.router.command.RoutingService.OverrideBalancerTarget:output_type -> v2ray.core.app.router.command.OverrideBalancerTargetResponse
10, // [10:14] is the sub-list for method output_type 10, // [10:14] is the sub-list for method output_type
6, // [6:10] is the sub-list for method input_type 6, // [6:10] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name 6, // [6:6] is the sub-list for extension type_name
@ -950,18 +899,6 @@ func file_app_router_command_command_proto_init() {
} }
} }
file_app_router_command_command_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { file_app_router_command_command_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetBalancersRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_app_router_command_command_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PrincipleTargetInfo); i { switch v := v.(*PrincipleTargetInfo); i {
case 0: case 0:
return &v.state return &v.state
@ -973,7 +910,7 @@ func file_app_router_command_command_proto_init() {
return nil return nil
} }
} }
file_app_router_command_command_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { file_app_router_command_command_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*OverrideInfo); i { switch v := v.(*OverrideInfo); i {
case 0: case 0:
return &v.state return &v.state
@ -985,7 +922,7 @@ func file_app_router_command_command_proto_init() {
return nil return nil
} }
} }
file_app_router_command_command_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { file_app_router_command_command_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BalancerMsg); i { switch v := v.(*BalancerMsg); i {
case 0: case 0:
return &v.state return &v.state
@ -997,7 +934,7 @@ func file_app_router_command_command_proto_init() {
return nil return nil
} }
} }
file_app_router_command_command_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { file_app_router_command_command_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetBalancerInfoRequest); i { switch v := v.(*GetBalancerInfoRequest); i {
case 0: case 0:
return &v.state return &v.state
@ -1009,7 +946,7 @@ func file_app_router_command_command_proto_init() {
return nil return nil
} }
} }
file_app_router_command_command_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { file_app_router_command_command_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetBalancerInfoResponse); i { switch v := v.(*GetBalancerInfoResponse); i {
case 0: case 0:
return &v.state return &v.state
@ -1021,7 +958,7 @@ func file_app_router_command_command_proto_init() {
return nil return nil
} }
} }
file_app_router_command_command_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { file_app_router_command_command_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*OverrideBalancerTargetRequest); i { switch v := v.(*OverrideBalancerTargetRequest); i {
case 0: case 0:
return &v.state return &v.state
@ -1033,7 +970,7 @@ func file_app_router_command_command_proto_init() {
return nil return nil
} }
} }
file_app_router_command_command_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { file_app_router_command_command_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*OverrideBalancerTargetResponse); i { switch v := v.(*OverrideBalancerTargetResponse); i {
case 0: case 0:
return &v.state return &v.state
@ -1045,7 +982,7 @@ func file_app_router_command_command_proto_init() {
return nil return nil
} }
} }
file_app_router_command_command_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { file_app_router_command_command_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Config); i { switch v := v.(*Config); i {
case 0: case 0:
return &v.state return &v.state
@ -1064,7 +1001,7 @@ func file_app_router_command_command_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_app_router_command_command_proto_rawDesc, RawDescriptor: file_app_router_command_command_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 13, NumMessages: 12,
NumExtensions: 0, NumExtensions: 0,
NumServices: 1, NumServices: 1,
}, },

View File

@ -60,10 +60,6 @@ message TestRouteRequest {
bool PublishResult = 3; bool PublishResult = 3;
} }
message GetBalancersRequest {
repeated string balancerTags = 1;
}
message PrincipleTargetInfo { message PrincipleTargetInfo {
repeated string tag = 1; repeated string tag = 1;
} }

View File

@ -1,47 +0,0 @@
package api
import (
routerService "github.com/v2fly/v2ray-core/v4/app/router/command"
"github.com/v2fly/v2ray-core/v4/main/commands/base"
)
var cmdBalancerCheck = &base.Command{
CustomFlags: true,
UsageLine: "{{.Exec}} api bc [--server=127.0.0.1:8080] [balancer]...",
Short: "balancer health check",
Long: `
Perform instant health checks for specific balancers. If no
balancer tag specified, check all balancers.
> Make sure you have "RoutingService" set in "config.api.services"
of server config.
Arguments:
-s, -server <server:port>
The API server address. Default 127.0.0.1:8080
-t, -timeout <seconds>
Timeout seconds to call API. Default 3
Example:
{{.Exec}} {{.LongName}} --server=127.0.0.1:8080 balancer1 balancer2
`,
Run: executeBalancerCheck,
}
func executeBalancerCheck(cmd *base.Command, args []string) {
setSharedFlags(cmd)
cmd.Flag.Parse(args)
conn, ctx, close := dialAPIServer()
defer close()
client := routerService.NewRoutingServiceClient(conn)
r := &routerService.CheckBalancersRequest{BalancerTags: cmd.Flag.Args()}
_, err := client.CheckBalancers(ctx, r)
if err != nil {
base.Fatalf("failed to perform balancer health checks: %s", err)
}
}

View File

@ -3,7 +3,6 @@ package api
import ( import (
"fmt" "fmt"
"os" "os"
"sort"
"strings" "strings"
routerService "github.com/v2fly/v2ray-core/v4/app/router/command" routerService "github.com/v2fly/v2ray-core/v4/app/router/command"
@ -49,60 +48,36 @@ func executeBalancerInfo(cmd *base.Command, args []string) {
defer close() defer close()
client := routerService.NewRoutingServiceClient(conn) client := routerService.NewRoutingServiceClient(conn)
r := &routerService.GetBalancersRequest{BalancerTags: cmd.Flag.Args()} r := &routerService.GetBalancerInfoRequest{Tag: args[0]}
resp, err := client.GetBalancers(ctx, r) resp, err := client.GetBalancerInfo(ctx, r)
if err != nil { if err != nil {
base.Fatalf("failed to get health information: %s", err) base.Fatalf("failed to get health information: %s", err)
} }
sort.Slice(resp.Balancers, func(i, j int) bool {
return resp.Balancers[i].Tag < resp.Balancers[j].Tag
})
if apiJSON { if apiJSON {
showJSONResponse(resp) showJSONResponse(resp)
return return
} }
for _, b := range resp.Balancers {
showBalancerInfo(b) showBalancerInfo(resp.Balancer)
}
} }
func showBalancerInfo(b *routerService.BalancerMsg) { func showBalancerInfo(b *routerService.BalancerMsg) {
const tableIndent = 4 const tableIndent = 4
sb := new(strings.Builder) sb := new(strings.Builder)
// Balancer
sb.WriteString(fmt.Sprintf("Balancer: %s\n", b.Tag))
// Strategy
sb.WriteString(" - Strategy:\n")
for _, v := range b.StrategySettings {
sb.WriteString(fmt.Sprintf(" %s\n", v))
}
// Override // Override
if b.Override != nil { if b.Override != nil {
sb.WriteString(" - Selecting Override:\n") sb.WriteString(" - Selecting Override:\n")
until := fmt.Sprintf("until: %s", b.Override.Until) for i, s := range []string{b.Override.Target} {
writeRow(sb, tableIndent, 0, []string{until}, nil)
for i, s := range b.Override.Selects {
writeRow(sb, tableIndent, i+1, []string{s}, nil) writeRow(sb, tableIndent, i+1, []string{s}, nil)
} }
} }
b.Titles = append(b.Titles, "Tag")
formats := getColumnFormats(b.Titles)
// Selects // Selects
sb.WriteString(" - Selects:\n") sb.WriteString(" - Selects:\n")
writeRow(sb, tableIndent, 0, b.Titles, formats)
for i, o := range b.Selects { for i, o := range b.PrincipleTarget.Tag {
o.Values = append(o.Values, o.Tag) writeRow(sb, tableIndent, i+1, []string{o}, nil)
writeRow(sb, tableIndent, i+1, o.Values, formats)
}
// Others
scnt := len(b.Selects)
if len(b.Others) > 0 {
sb.WriteString(" - Others:\n")
writeRow(sb, tableIndent, 0, b.Titles, formats)
for i, o := range b.Others {
o.Values = append(o.Values, o.Tag)
writeRow(sb, tableIndent, scnt+i+1, o.Values, formats)
}
} }
os.Stdout.WriteString(sb.String()) os.Stdout.WriteString(sb.String())
} }

View File

@ -1,37 +1,29 @@
package api package api
import ( import (
"time"
routerService "github.com/v2fly/v2ray-core/v4/app/router/command" routerService "github.com/v2fly/v2ray-core/v4/app/router/command"
"github.com/v2fly/v2ray-core/v4/main/commands/base" "github.com/v2fly/v2ray-core/v4/main/commands/base"
) )
var cmdBalancerOverride = &base.Command{ var cmdBalancerOverride = &base.Command{
CustomFlags: true, CustomFlags: true,
UsageLine: "{{.Exec}} api bo [--server=127.0.0.1:8080] <-b balancer> selectors...", UsageLine: "{{.Exec}} api bo [--server=127.0.0.1:8080] <-b balancer> outboundTag",
Short: "balancer override", Short: "balancer override",
Long: ` Long: `
Override a balancer's selection in a duration of time. Override a balancer's selection.
> Make sure you have "RoutingService" set in "config.api.services" > Make sure you have "RoutingService" set in "config.api.services"
of server config. of server config.
Once a balancer's selection is overridden: Once a balancer's selection is overridden:
- The selectors of the balancer won't apply. - The balancer's selection result will always be outboundTag
- The strategy of the balancer stops selecting qualified nodes
according to its settings, doing only the final pick.
Arguments: Arguments:
-b, -balancer <tag> -b, -balancer <tag>
Tag of the target balancer. Required. Tag of the target balancer. Required.
-v, -validity <duration>
Time duration of the validity of override, e.g.: 60s, 60m,
24h, 1m30s. Default 1h.
-r, -remove -r, -remove
Remove the override Remove the override
@ -43,7 +35,7 @@ Arguments:
Example: Example:
{{.Exec}} {{.LongName}} --server=127.0.0.1:8080 -b balancer selector1 selector2 {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 -b balancer tag
{{.Exec}} {{.LongName}} --server=127.0.0.1:8080 -b balancer -r {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 -b balancer -r
`, `,
Run: executeBalancerOverride, Run: executeBalancerOverride,
@ -52,13 +44,10 @@ Example:
func executeBalancerOverride(cmd *base.Command, args []string) { func executeBalancerOverride(cmd *base.Command, args []string) {
var ( var (
balancer string balancer string
validity time.Duration
remove bool remove bool
) )
cmd.Flag.StringVar(&balancer, "b", "", "") cmd.Flag.StringVar(&balancer, "b", "", "")
cmd.Flag.StringVar(&balancer, "balancer", "", "") cmd.Flag.StringVar(&balancer, "balancer", "", "")
cmd.Flag.DurationVar(&validity, "v", time.Hour, "")
cmd.Flag.DurationVar(&validity, "validity", time.Hour, "")
cmd.Flag.BoolVar(&remove, "r", false, "") cmd.Flag.BoolVar(&remove, "r", false, "")
cmd.Flag.BoolVar(&remove, "remove", false, "") cmd.Flag.BoolVar(&remove, "remove", false, "")
setSharedFlags(cmd) setSharedFlags(cmd)
@ -71,17 +60,17 @@ func executeBalancerOverride(cmd *base.Command, args []string) {
conn, ctx, close := dialAPIServer() conn, ctx, close := dialAPIServer()
defer close() defer close()
v := int64(0)
if !remove {
v = int64(validity)
}
client := routerService.NewRoutingServiceClient(conn) client := routerService.NewRoutingServiceClient(conn)
r := &routerService.OverrideSelectingRequest{ target := ""
BalancerTag: balancer, if !remove {
Selectors: cmd.Flag.Args(), target = cmd.Flag.Args()[0]
Validity: v,
} }
_, err := client.OverrideSelecting(ctx, r) r := &routerService.OverrideBalancerTargetRequest{
BalancerTag: balancer,
Target: target,
}
_, err := client.OverrideBalancerTarget(ctx, r)
if err != nil { if err != nil {
base.Fatalf("failed to override balancer: %s", err) base.Fatalf("failed to override balancer: %s", err)
} }

View File

@ -2,8 +2,8 @@ package api
import ( import (
"context" "context"
"encoding/json"
"fmt" "fmt"
"google.golang.org/protobuf/encoding/protojson"
"os" "os"
"strings" "strings"
"time" "time"
@ -81,15 +81,7 @@ func dialAPIServerWithContext(ctx context.Context) (conn *grpc.ClientConn) {
} }
func protoToJSONString(m proto.Message, prefix, indent string) (string, error) { func protoToJSONString(m proto.Message, prefix, indent string) (string, error) {
b := new(strings.Builder) return strings.TrimSpace(protojson.MarshalOptions{Indent: indent}.Format(m)), nil
e := json.NewEncoder(b)
e.SetIndent(prefix, indent)
e.SetEscapeHTML(false)
err := e.Encode(m)
if err != nil {
return "", err
}
return strings.TrimSpace(b.String()), nil
} }
func showJSONResponse(m proto.Message) { func showJSONResponse(m proto.Message) {