反向代理源站可以设置权重

This commit is contained in:
刘祥超
2020-11-17 17:11:51 +08:00
parent 3609d556a3
commit d61e036df3
2 changed files with 134 additions and 114 deletions

View File

@@ -2,7 +2,7 @@
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: service_origin_server.proto
// source: service_origin.proto
package pb
@@ -38,12 +38,13 @@ type CreateOriginRequest struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Addr *NetworkAddress `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"`
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
Weight int32 `protobuf:"varint,4,opt,name=weight,proto3" json:"weight,omitempty"`
}
func (x *CreateOriginRequest) Reset() {
*x = CreateOriginRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_origin_server_proto_msgTypes[0]
mi := &file_service_origin_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -56,7 +57,7 @@ func (x *CreateOriginRequest) String() string {
func (*CreateOriginRequest) ProtoMessage() {}
func (x *CreateOriginRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_origin_server_proto_msgTypes[0]
mi := &file_service_origin_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -69,7 +70,7 @@ func (x *CreateOriginRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use CreateOriginRequest.ProtoReflect.Descriptor instead.
func (*CreateOriginRequest) Descriptor() ([]byte, []int) {
return file_service_origin_server_proto_rawDescGZIP(), []int{0}
return file_service_origin_proto_rawDescGZIP(), []int{0}
}
func (x *CreateOriginRequest) GetName() string {
@@ -93,6 +94,13 @@ func (x *CreateOriginRequest) GetDescription() string {
return ""
}
func (x *CreateOriginRequest) GetWeight() int32 {
if x != nil {
return x.Weight
}
return 0
}
type CreateOriginResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -104,7 +112,7 @@ type CreateOriginResponse struct {
func (x *CreateOriginResponse) Reset() {
*x = CreateOriginResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_origin_server_proto_msgTypes[1]
mi := &file_service_origin_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -117,7 +125,7 @@ func (x *CreateOriginResponse) String() string {
func (*CreateOriginResponse) ProtoMessage() {}
func (x *CreateOriginResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_origin_server_proto_msgTypes[1]
mi := &file_service_origin_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -130,7 +138,7 @@ func (x *CreateOriginResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use CreateOriginResponse.ProtoReflect.Descriptor instead.
func (*CreateOriginResponse) Descriptor() ([]byte, []int) {
return file_service_origin_server_proto_rawDescGZIP(), []int{1}
return file_service_origin_proto_rawDescGZIP(), []int{1}
}
func (x *CreateOriginResponse) GetOriginId() int64 {
@@ -150,12 +158,13 @@ type UpdateOriginRequest struct {
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Addr *NetworkAddress `protobuf:"bytes,3,opt,name=addr,proto3" json:"addr,omitempty"`
Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
Weight int32 `protobuf:"varint,5,opt,name=weight,proto3" json:"weight,omitempty"`
}
func (x *UpdateOriginRequest) Reset() {
*x = UpdateOriginRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_origin_server_proto_msgTypes[2]
mi := &file_service_origin_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -168,7 +177,7 @@ func (x *UpdateOriginRequest) String() string {
func (*UpdateOriginRequest) ProtoMessage() {}
func (x *UpdateOriginRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_origin_server_proto_msgTypes[2]
mi := &file_service_origin_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -181,7 +190,7 @@ func (x *UpdateOriginRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateOriginRequest.ProtoReflect.Descriptor instead.
func (*UpdateOriginRequest) Descriptor() ([]byte, []int) {
return file_service_origin_server_proto_rawDescGZIP(), []int{2}
return file_service_origin_proto_rawDescGZIP(), []int{2}
}
func (x *UpdateOriginRequest) GetOriginId() int64 {
@@ -212,6 +221,13 @@ func (x *UpdateOriginRequest) GetDescription() string {
return ""
}
func (x *UpdateOriginRequest) GetWeight() int32 {
if x != nil {
return x.Weight
}
return 0
}
// 查找单个源站信息
type FindEnabledOriginRequest struct {
state protoimpl.MessageState
@@ -224,7 +240,7 @@ type FindEnabledOriginRequest struct {
func (x *FindEnabledOriginRequest) Reset() {
*x = FindEnabledOriginRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_origin_server_proto_msgTypes[3]
mi := &file_service_origin_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -237,7 +253,7 @@ func (x *FindEnabledOriginRequest) String() string {
func (*FindEnabledOriginRequest) ProtoMessage() {}
func (x *FindEnabledOriginRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_origin_server_proto_msgTypes[3]
mi := &file_service_origin_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -250,7 +266,7 @@ func (x *FindEnabledOriginRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use FindEnabledOriginRequest.ProtoReflect.Descriptor instead.
func (*FindEnabledOriginRequest) Descriptor() ([]byte, []int) {
return file_service_origin_server_proto_rawDescGZIP(), []int{3}
return file_service_origin_proto_rawDescGZIP(), []int{3}
}
func (x *FindEnabledOriginRequest) GetOriginId() int64 {
@@ -271,7 +287,7 @@ type FindEnabledOriginResponse struct {
func (x *FindEnabledOriginResponse) Reset() {
*x = FindEnabledOriginResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_origin_server_proto_msgTypes[4]
mi := &file_service_origin_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -284,7 +300,7 @@ func (x *FindEnabledOriginResponse) String() string {
func (*FindEnabledOriginResponse) ProtoMessage() {}
func (x *FindEnabledOriginResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_origin_server_proto_msgTypes[4]
mi := &file_service_origin_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -297,7 +313,7 @@ func (x *FindEnabledOriginResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use FindEnabledOriginResponse.ProtoReflect.Descriptor instead.
func (*FindEnabledOriginResponse) Descriptor() ([]byte, []int) {
return file_service_origin_server_proto_rawDescGZIP(), []int{4}
return file_service_origin_proto_rawDescGZIP(), []int{4}
}
func (x *FindEnabledOriginResponse) GetOrigin() *Origin {
@@ -319,7 +335,7 @@ type FindEnabledOriginConfigRequest struct {
func (x *FindEnabledOriginConfigRequest) Reset() {
*x = FindEnabledOriginConfigRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_origin_server_proto_msgTypes[5]
mi := &file_service_origin_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -332,7 +348,7 @@ func (x *FindEnabledOriginConfigRequest) String() string {
func (*FindEnabledOriginConfigRequest) ProtoMessage() {}
func (x *FindEnabledOriginConfigRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_origin_server_proto_msgTypes[5]
mi := &file_service_origin_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -345,7 +361,7 @@ func (x *FindEnabledOriginConfigRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use FindEnabledOriginConfigRequest.ProtoReflect.Descriptor instead.
func (*FindEnabledOriginConfigRequest) Descriptor() ([]byte, []int) {
return file_service_origin_server_proto_rawDescGZIP(), []int{5}
return file_service_origin_proto_rawDescGZIP(), []int{5}
}
func (x *FindEnabledOriginConfigRequest) GetOriginId() int64 {
@@ -366,7 +382,7 @@ type FindEnabledOriginConfigResponse struct {
func (x *FindEnabledOriginConfigResponse) Reset() {
*x = FindEnabledOriginConfigResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_origin_server_proto_msgTypes[6]
mi := &file_service_origin_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -379,7 +395,7 @@ func (x *FindEnabledOriginConfigResponse) String() string {
func (*FindEnabledOriginConfigResponse) ProtoMessage() {}
func (x *FindEnabledOriginConfigResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_origin_server_proto_msgTypes[6]
mi := &file_service_origin_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -392,7 +408,7 @@ func (x *FindEnabledOriginConfigResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use FindEnabledOriginConfigResponse.ProtoReflect.Descriptor instead.
func (*FindEnabledOriginConfigResponse) Descriptor() ([]byte, []int) {
return file_service_origin_server_proto_rawDescGZIP(), []int{6}
return file_service_origin_proto_rawDescGZIP(), []int{6}
}
func (x *FindEnabledOriginConfigResponse) GetOriginJSON() []byte {
@@ -402,89 +418,91 @@ func (x *FindEnabledOriginConfigResponse) GetOriginJSON() []byte {
return nil
}
var File_service_origin_server_proto protoreflect.FileDescriptor
var File_service_origin_proto protoreflect.FileDescriptor
var file_service_origin_server_proto_rawDesc = []byte{
0x0a, 0x1b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e,
0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70,
0x62, 0x1a, 0x19, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f,
0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x6d, 0x6f,
0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x61, 0x64, 0x64, 0x72,
0x65, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x72, 0x70, 0x63, 0x5f, 0x6d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x73, 0x0a,
0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x65, 0x74, 0x77,
0x6f, 0x72, 0x6b, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72,
0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18,
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69,
0x6f, 0x6e, 0x22, 0x32, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x69, 0x67,
0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x72,
0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6f, 0x72,
0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x22, 0x8f, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74,
0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a,
0x0a, 0x08, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
0x52, 0x08, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26,
0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70,
0x62, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73,
0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x36, 0x0a, 0x18, 0x46, 0x69, 0x6e, 0x64,
0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x64,
0x22, 0x3f, 0x0a, 0x19, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4f,
0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a,
0x06, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e,
0x70, 0x62, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x06, 0x4f, 0x72, 0x69, 0x67, 0x69,
0x6e, 0x22, 0x3c, 0x0a, 0x1e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64,
0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x22,
0x41, 0x0a, 0x1f, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4f, 0x72,
0x69, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x4a, 0x53, 0x4f, 0x4e,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x4a, 0x53,
0x4f, 0x4e, 0x32, 0xc1, 0x02, 0x0a, 0x0d, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72,
0x69, 0x67, 0x69, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e,
0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74,
0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64,
var file_service_origin_proto_rawDesc = []byte{
0x0a, 0x14, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x19, 0x6d, 0x6f, 0x64, 0x65,
0x6c, 0x5f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x65, 0x74,
0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x1a, 0x12, 0x72, 0x70, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8b, 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74,
0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12,
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x41, 0x64, 0x64,
0x72, 0x65, 0x73, 0x73, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65,
0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06,
0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x77, 0x65,
0x69, 0x67, 0x68, 0x74, 0x22, 0x32, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72,
0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08,
0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08,
0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x22, 0xa7, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64,
0x61, 0x74, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73,
0x12, 0x50, 0x0a, 0x11, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4f,
0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45,
0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61,
0x62, 0x6c, 0x65, 0x64, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x62, 0x0a, 0x17, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65,
0x64, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x22, 0x2e,
0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x03, 0x52, 0x08, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x12, 0x26, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12,
0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x41, 0x64, 0x64, 0x72, 0x65,
0x73, 0x73, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63,
0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64,
0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x77, 0x65,
0x69, 0x67, 0x68, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x77, 0x65, 0x69, 0x67,
0x68, 0x74, 0x22, 0x36, 0x0a, 0x18, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65,
0x64, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a,
0x0a, 0x08, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
0x52, 0x08, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x22, 0x3f, 0x0a, 0x19, 0x46, 0x69,
0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x06, 0x4f, 0x72, 0x69, 0x67, 0x69,
0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x72, 0x69,
0x67, 0x69, 0x6e, 0x52, 0x06, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x22, 0x3c, 0x0a, 0x1e, 0x46,
0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e,
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a,
0x08, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
0x08, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x22, 0x41, 0x0a, 0x1f, 0x46, 0x69, 0x6e,
0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x43, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a,
0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c,
0x52, 0x0a, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x4a, 0x53, 0x4f, 0x4e, 0x32, 0xc1, 0x02, 0x0a,
0x0d, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x41,
0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x17,
0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65,
0x61, 0x74, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x37, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69,
0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x69,
0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e,
0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x50, 0x0a, 0x11, 0x66, 0x69,
0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12,
0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64,
0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e,
0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4f, 0x72,
0x69, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c,
0x65, 0x64, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x17,
0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4f, 0x72, 0x69, 0x67, 0x69,
0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e,
0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x43, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x62,
0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4f, 0x72, 0x69, 0x67,
0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_service_origin_server_proto_rawDescOnce sync.Once
file_service_origin_server_proto_rawDescData = file_service_origin_server_proto_rawDesc
file_service_origin_proto_rawDescOnce sync.Once
file_service_origin_proto_rawDescData = file_service_origin_proto_rawDesc
)
func file_service_origin_server_proto_rawDescGZIP() []byte {
file_service_origin_server_proto_rawDescOnce.Do(func() {
file_service_origin_server_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_origin_server_proto_rawDescData)
func file_service_origin_proto_rawDescGZIP() []byte {
file_service_origin_proto_rawDescOnce.Do(func() {
file_service_origin_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_origin_proto_rawDescData)
})
return file_service_origin_server_proto_rawDescData
return file_service_origin_proto_rawDescData
}
var file_service_origin_server_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_service_origin_server_proto_goTypes = []interface{}{
var file_service_origin_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_service_origin_proto_goTypes = []interface{}{
(*CreateOriginRequest)(nil), // 0: pb.CreateOriginRequest
(*CreateOriginResponse)(nil), // 1: pb.CreateOriginResponse
(*UpdateOriginRequest)(nil), // 2: pb.UpdateOriginRequest
@@ -496,7 +514,7 @@ var file_service_origin_server_proto_goTypes = []interface{}{
(*Origin)(nil), // 8: pb.Origin
(*RPCSuccess)(nil), // 9: pb.RPCSuccess
}
var file_service_origin_server_proto_depIdxs = []int32{
var file_service_origin_proto_depIdxs = []int32{
7, // 0: pb.CreateOriginRequest.addr:type_name -> pb.NetworkAddress
7, // 1: pb.UpdateOriginRequest.addr:type_name -> pb.NetworkAddress
8, // 2: pb.FindEnabledOriginResponse.Origin:type_name -> pb.Origin
@@ -515,16 +533,16 @@ var file_service_origin_server_proto_depIdxs = []int32{
0, // [0:3] is the sub-list for field type_name
}
func init() { file_service_origin_server_proto_init() }
func file_service_origin_server_proto_init() {
if File_service_origin_server_proto != nil {
func init() { file_service_origin_proto_init() }
func file_service_origin_proto_init() {
if File_service_origin_proto != nil {
return
}
file_model_origin_server_proto_init()
file_model_network_address_proto_init()
file_rpc_messages_proto_init()
if !protoimpl.UnsafeEnabled {
file_service_origin_server_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_service_origin_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateOriginRequest); i {
case 0:
return &v.state
@@ -536,7 +554,7 @@ func file_service_origin_server_proto_init() {
return nil
}
}
file_service_origin_server_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_service_origin_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateOriginResponse); i {
case 0:
return &v.state
@@ -548,7 +566,7 @@ func file_service_origin_server_proto_init() {
return nil
}
}
file_service_origin_server_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_service_origin_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateOriginRequest); i {
case 0:
return &v.state
@@ -560,7 +578,7 @@ func file_service_origin_server_proto_init() {
return nil
}
}
file_service_origin_server_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_service_origin_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FindEnabledOriginRequest); i {
case 0:
return &v.state
@@ -572,7 +590,7 @@ func file_service_origin_server_proto_init() {
return nil
}
}
file_service_origin_server_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_service_origin_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FindEnabledOriginResponse); i {
case 0:
return &v.state
@@ -584,7 +602,7 @@ func file_service_origin_server_proto_init() {
return nil
}
}
file_service_origin_server_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_service_origin_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FindEnabledOriginConfigRequest); i {
case 0:
return &v.state
@@ -596,7 +614,7 @@ func file_service_origin_server_proto_init() {
return nil
}
}
file_service_origin_server_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_service_origin_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FindEnabledOriginConfigResponse); i {
case 0:
return &v.state
@@ -613,20 +631,20 @@ func file_service_origin_server_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_origin_server_proto_rawDesc,
RawDescriptor: file_service_origin_proto_rawDesc,
NumEnums: 0,
NumMessages: 7,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_service_origin_server_proto_goTypes,
DependencyIndexes: file_service_origin_server_proto_depIdxs,
MessageInfos: file_service_origin_server_proto_msgTypes,
GoTypes: file_service_origin_proto_goTypes,
DependencyIndexes: file_service_origin_proto_depIdxs,
MessageInfos: file_service_origin_proto_msgTypes,
}.Build()
File_service_origin_server_proto = out.File
file_service_origin_server_proto_rawDesc = nil
file_service_origin_server_proto_goTypes = nil
file_service_origin_server_proto_depIdxs = nil
File_service_origin_proto = out.File
file_service_origin_proto_rawDesc = nil
file_service_origin_proto_goTypes = nil
file_service_origin_proto_depIdxs = nil
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -822,5 +840,5 @@ var _OriginService_serviceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "service_origin_server.proto",
Metadata: "service_origin.proto",
}

View File

@@ -26,6 +26,7 @@ message CreateOriginRequest {
string name = 1;
NetworkAddress addr = 2;
string description = 3;
int32 weight = 4;
}
message CreateOriginResponse {
@@ -38,6 +39,7 @@ message UpdateOriginRequest {
string name = 2;
NetworkAddress addr = 3;
string description = 4;
int32 weight = 5;
}
//