修改反向代理实现方式

This commit is contained in:
刘祥超
2020-09-21 20:21:20 +08:00
parent de371a8e20
commit 0a3a751620
9 changed files with 286 additions and 286 deletions

View File

@@ -25,7 +25,7 @@ const (
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type OriginServer struct {
type Origin struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@@ -37,8 +37,8 @@ type OriginServer struct {
Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
}
func (x *OriginServer) Reset() {
*x = OriginServer{}
func (x *Origin) Reset() {
*x = Origin{}
if protoimpl.UnsafeEnabled {
mi := &file_model_origin_server_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -46,13 +46,13 @@ func (x *OriginServer) Reset() {
}
}
func (x *OriginServer) String() string {
func (x *Origin) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*OriginServer) ProtoMessage() {}
func (*Origin) ProtoMessage() {}
func (x *OriginServer) ProtoReflect() protoreflect.Message {
func (x *Origin) ProtoReflect() protoreflect.Message {
mi := &file_model_origin_server_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -64,40 +64,40 @@ func (x *OriginServer) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use OriginServer.ProtoReflect.Descriptor instead.
func (*OriginServer) Descriptor() ([]byte, []int) {
// Deprecated: Use Origin.ProtoReflect.Descriptor instead.
func (*Origin) Descriptor() ([]byte, []int) {
return file_model_origin_server_proto_rawDescGZIP(), []int{0}
}
func (x *OriginServer) GetId() int64 {
func (x *Origin) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *OriginServer) GetIsOn() bool {
func (x *Origin) GetIsOn() bool {
if x != nil {
return x.IsOn
}
return false
}
func (x *OriginServer) GetName() string {
func (x *Origin) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *OriginServer) GetAddr() *NetworkAddress {
func (x *Origin) GetAddr() *NetworkAddress {
if x != nil {
return x.Addr
}
return nil
}
func (x *OriginServer) GetDescription() string {
func (x *Origin) GetDescription() string {
if x != nil {
return x.Description
}
@@ -110,17 +110,17 @@ var file_model_origin_server_proto_rawDesc = []byte{
0x0a, 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, 0x12, 0x02, 0x70, 0x62, 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, 0x22, 0x90, 0x01, 0x0a,
0x0c, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x0e, 0x0a,
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a,
0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f,
0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x04, 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, 0x05, 0x20, 0x01,
0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42,
0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8a, 0x01, 0x0a,
0x06, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18,
0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
0x26, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x04, 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, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65,
0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70,
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -137,11 +137,11 @@ func file_model_origin_server_proto_rawDescGZIP() []byte {
var file_model_origin_server_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_model_origin_server_proto_goTypes = []interface{}{
(*OriginServer)(nil), // 0: pb.OriginServer
(*Origin)(nil), // 0: pb.Origin
(*NetworkAddress)(nil), // 1: pb.NetworkAddress
}
var file_model_origin_server_proto_depIdxs = []int32{
1, // 0: pb.OriginServer.addr:type_name -> pb.NetworkAddress
1, // 0: pb.Origin.addr:type_name -> pb.NetworkAddress
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
@@ -157,7 +157,7 @@ func file_model_origin_server_proto_init() {
file_model_network_address_proto_init()
if !protoimpl.UnsafeEnabled {
file_model_origin_server_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*OriginServer); i {
switch v := v.(*Origin); i {
case 0:
return &v.state
case 1: