update sd proto

This commit is contained in:
ginuerzh 2023-11-02 20:51:24 +08:00
parent 4c25027b8b
commit a1cc7a13e0
3 changed files with 100 additions and 104 deletions

View File

@ -21,19 +21,19 @@ type server struct {
func (s *server) Register(ctx context.Context, in *proto.RegisterRequest) (*proto.RegisterReply, error) { func (s *server) Register(ctx context.Context, in *proto.RegisterRequest) (*proto.RegisterReply, error) {
reply := &proto.RegisterReply{} reply := &proto.RegisterReply{}
log.Printf("register: %s, %s, %s", in.GetName(), in.GetNetwork(), in.GetAddress()) log.Printf("register: %+v", in.GetService())
return reply, nil return reply, nil
} }
func (s *server) Deregister(ctx context.Context, in *proto.DeregisterRequest) (*proto.DeregisterReply, error) { func (s *server) Deregister(ctx context.Context, in *proto.DeregisterRequest) (*proto.DeregisterReply, error) {
reply := &proto.DeregisterReply{} reply := &proto.DeregisterReply{}
log.Printf("deregister: %s", in.GetName()) log.Printf("deregister: %+v", in.GetService())
return reply, nil return reply, nil
} }
func (s *server) Renew(ctx context.Context, in *proto.RenewRequest) (*proto.RenewReply, error) { func (s *server) Renew(ctx context.Context, in *proto.RenewRequest) (*proto.RenewReply, error) {
reply := &proto.RenewReply{} reply := &proto.RenewReply{}
log.Printf("renew: %s", in.GetName()) log.Printf("renew: %+v", in.GetService())
return reply, nil return reply, nil
} }

View File

@ -29,9 +29,7 @@ type RegisterRequest struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
Network string `protobuf:"bytes,2,opt,name=network,proto3" json:"network,omitempty"`
Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"`
} }
func (x *RegisterRequest) Reset() { func (x *RegisterRequest) Reset() {
@ -66,25 +64,11 @@ func (*RegisterRequest) Descriptor() ([]byte, []int) {
return file_sd_proto_rawDescGZIP(), []int{0} return file_sd_proto_rawDescGZIP(), []int{0}
} }
func (x *RegisterRequest) GetName() string { func (x *RegisterRequest) GetService() *Service {
if x != nil { if x != nil {
return x.Name return x.Service
} }
return "" return nil
}
func (x *RegisterRequest) GetNetwork() string {
if x != nil {
return x.Network
}
return ""
}
func (x *RegisterRequest) GetAddress() string {
if x != nil {
return x.Address
}
return ""
} }
type RegisterReply struct { type RegisterReply struct {
@ -139,7 +123,7 @@ type RenewRequest struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
} }
func (x *RenewRequest) Reset() { func (x *RenewRequest) Reset() {
@ -174,11 +158,11 @@ func (*RenewRequest) Descriptor() ([]byte, []int) {
return file_sd_proto_rawDescGZIP(), []int{2} return file_sd_proto_rawDescGZIP(), []int{2}
} }
func (x *RenewRequest) GetName() string { func (x *RenewRequest) GetService() *Service {
if x != nil { if x != nil {
return x.Name return x.Service
} }
return "" return nil
} }
type RenewReply struct { type RenewReply struct {
@ -233,7 +217,7 @@ type DeregisterRequest struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
} }
func (x *DeregisterRequest) Reset() { func (x *DeregisterRequest) Reset() {
@ -268,11 +252,11 @@ func (*DeregisterRequest) Descriptor() ([]byte, []int) {
return file_sd_proto_rawDescGZIP(), []int{4} return file_sd_proto_rawDescGZIP(), []int{4}
} }
func (x *DeregisterRequest) GetName() string { func (x *DeregisterRequest) GetService() *Service {
if x != nil { if x != nil {
return x.Name return x.Service
} }
return "" return nil
} }
type DeregisterReply struct { type DeregisterReply struct {
@ -327,10 +311,11 @@ type Service struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Node string `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Network string `protobuf:"bytes,3,opt,name=network,proto3" json:"network,omitempty"` Node string `protobuf:"bytes,3,opt,name=node,proto3" json:"node,omitempty"`
Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"` Network string `protobuf:"bytes,4,opt,name=network,proto3" json:"network,omitempty"`
Address string `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"`
} }
func (x *Service) Reset() { func (x *Service) Reset() {
@ -365,9 +350,9 @@ func (*Service) Descriptor() ([]byte, []int) {
return file_sd_proto_rawDescGZIP(), []int{6} return file_sd_proto_rawDescGZIP(), []int{6}
} }
func (x *Service) GetNode() string { func (x *Service) GetId() string {
if x != nil { if x != nil {
return x.Node return x.Id
} }
return "" return ""
} }
@ -379,6 +364,13 @@ func (x *Service) GetName() string {
return "" return ""
} }
func (x *Service) GetNode() string {
if x != nil {
return x.Node
}
return ""
}
func (x *Service) GetNetwork() string { func (x *Service) GetNetwork() string {
if x != nil { if x != nil {
return x.Network return x.Network
@ -491,54 +483,56 @@ var File_sd_proto protoreflect.FileDescriptor
var file_sd_proto_rawDesc = []byte{ var file_sd_proto_rawDesc = []byte{
0x0a, 0x08, 0x73, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x0a, 0x08, 0x73, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x22, 0x59, 0x0a, 0x0f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x6f, 0x22, 0x3b, 0x0a, 0x0f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18,
0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65,
0x6f, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x1f,
0x72, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x0a, 0x0d, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12,
0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x1f, 0x0a, 0x0d,
0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x0e, 0x0a,
0x02, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x6f, 0x6b, 0x22, 0x22, 0x0a,
0x0c, 0x52, 0x65, 0x6e, 0x65, 0x77, 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, 0x22, 0x1c, 0x0a, 0x0a, 0x52, 0x65, 0x6e, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12,
0x0e, 0x0a, 0x02, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x6f, 0x6b, 0x22, 0x0e, 0x0a, 0x02, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x6f, 0x6b, 0x22,
0x27, 0x0a, 0x11, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x38, 0x0a, 0x0c, 0x52, 0x65, 0x6e, 0x65, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x21, 0x0a, 0x0f, 0x44, 0x65, 0x72, 0x65,
0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x6f,
0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x6f, 0x6b, 0x22, 0x65, 0x0a, 0x07, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18,
0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72,
0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65,
0x73, 0x73, 0x22, 0x27, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
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, 0x22, 0x3d, 0x0a, 0x0f, 0x47,
0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2a,
0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x32, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x32, 0xe8, 0x01, 0x0a, 0x02, 0x53, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x1c, 0x0a, 0x0a, 0x52, 0x65, 0x6e,
0x44, 0x12, 0x38, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x6b, 0x18, 0x01, 0x20,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x01, 0x28, 0x08, 0x52, 0x02, 0x6f, 0x6b, 0x22, 0x3d, 0x0a, 0x11, 0x44, 0x65, 0x72, 0x65, 0x67,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x07,
0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x3e, 0x0a, 0x0a, 0x44, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e,
0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x73,
0x6f, 0x2e, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x21, 0x0a, 0x0f, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69,
0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x6b, 0x18,
0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2f, 0x0a, 0x05, 0x52, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x6f, 0x6b, 0x22, 0x75, 0x0a, 0x07, 0x53, 0x65, 0x72,
0x65, 0x6e, 0x65, 0x77, 0x12, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x6e, 0x76, 0x69, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x65, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
0x6f, 0x2e, 0x52, 0x65, 0x6e, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x37, 0x0a, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65,
0x47, 0x65, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73,
0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x24, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2d, 0x67, 0x6f, 0x73, 0x74, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x22, 0x27, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65,
0x69, 0x6e, 0x2f, 0x73, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
0x74, 0x6f, 0x33, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3d, 0x0a, 0x0f, 0x47, 0x65, 0x74,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2a, 0x0a, 0x08,
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x08,
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x32, 0xe8, 0x01, 0x0a, 0x02, 0x53, 0x44, 0x12,
0x38, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x67, 0x69,
0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x3e, 0x0a, 0x0a, 0x44, 0x65, 0x72,
0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69,
0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2f, 0x0a, 0x05, 0x52, 0x65, 0x6e,
0x65, 0x77, 0x12, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x6e, 0x65, 0x77,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
0x52, 0x65, 0x6e, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x37, 0x0a, 0x03, 0x47, 0x65,
0x74, 0x12, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65,
0x70, 0x6c, 0x79, 0x42, 0x24, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x67, 0x6f, 0x2d, 0x67, 0x6f, 0x73, 0x74, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e,
0x2f, 0x73, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
} }
var ( var (
@ -566,20 +560,23 @@ var file_sd_proto_goTypes = []interface{}{
(*GetServiceReply)(nil), // 8: proto.GetServiceReply (*GetServiceReply)(nil), // 8: proto.GetServiceReply
} }
var file_sd_proto_depIdxs = []int32{ var file_sd_proto_depIdxs = []int32{
6, // 0: proto.GetServiceReply.services:type_name -> proto.Service 6, // 0: proto.RegisterRequest.service:type_name -> proto.Service
0, // 1: proto.SD.Register:input_type -> proto.RegisterRequest 6, // 1: proto.RenewRequest.service:type_name -> proto.Service
4, // 2: proto.SD.Deregister:input_type -> proto.DeregisterRequest 6, // 2: proto.DeregisterRequest.service:type_name -> proto.Service
2, // 3: proto.SD.Renew:input_type -> proto.RenewRequest 6, // 3: proto.GetServiceReply.services:type_name -> proto.Service
7, // 4: proto.SD.Get:input_type -> proto.GetServiceRequest 0, // 4: proto.SD.Register:input_type -> proto.RegisterRequest
1, // 5: proto.SD.Register:output_type -> proto.RegisterReply 4, // 5: proto.SD.Deregister:input_type -> proto.DeregisterRequest
5, // 6: proto.SD.Deregister:output_type -> proto.DeregisterReply 2, // 6: proto.SD.Renew:input_type -> proto.RenewRequest
3, // 7: proto.SD.Renew:output_type -> proto.RenewReply 7, // 7: proto.SD.Get:input_type -> proto.GetServiceRequest
8, // 8: proto.SD.Get:output_type -> proto.GetServiceReply 1, // 8: proto.SD.Register:output_type -> proto.RegisterReply
5, // [5:9] is the sub-list for method output_type 5, // 9: proto.SD.Deregister:output_type -> proto.DeregisterReply
1, // [1:5] is the sub-list for method input_type 3, // 10: proto.SD.Renew:output_type -> proto.RenewReply
1, // [1:1] is the sub-list for extension type_name 8, // 11: proto.SD.Get:output_type -> proto.GetServiceReply
1, // [1:1] is the sub-list for extension extendee 8, // [8:12] is the sub-list for method output_type
0, // [0:1] is the sub-list for field type_name 4, // [4:8] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
} }
func init() { file_sd_proto_init() } func init() { file_sd_proto_init() }

View File

@ -7,9 +7,7 @@ package proto;
option go_package = "github.com/go-gost/plugin/sd/proto"; option go_package = "github.com/go-gost/plugin/sd/proto";
message RegisterRequest { message RegisterRequest {
string name = 1; Service service = 1;
string network = 2;
string address = 3;
} }
message RegisterReply { message RegisterReply {
@ -17,7 +15,7 @@ message RegisterReply {
} }
message RenewRequest { message RenewRequest {
string name = 1; Service service = 1;
} }
message RenewReply { message RenewReply {
@ -25,7 +23,7 @@ message RenewReply {
} }
message DeregisterRequest { message DeregisterRequest {
string name = 1; Service service = 1;
} }
message DeregisterReply { message DeregisterReply {
@ -33,10 +31,11 @@ message DeregisterReply {
} }
message Service { message Service {
string node = 1; string id = 1;
string name = 2; string name = 2;
string network = 3; string node = 3;
string address = 4; string network = 4;
string address = 5;
} }
message GetServiceRequest { message GetServiceRequest {