update for latest micro

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-04-20 23:43:41 +03:00
parent 885149f05f
commit 36b57727dd
7 changed files with 176 additions and 330 deletions

2
go.mod
View File

@ -3,7 +3,7 @@ module github.com/unistack-org/micro-register-service/v3
go 1.16 go 1.16
require ( require (
github.com/unistack-org/micro/v3 v3.3.15 github.com/unistack-org/micro/v3 v3.3.16
google.golang.org/grpc v1.37.0 google.golang.org/grpc v1.37.0
google.golang.org/protobuf v1.26.0 google.golang.org/protobuf v1.26.0
) )

4
go.sum
View File

@ -41,8 +41,8 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:
github.com/silas/dag v0.0.0-20210121180416-41cf55125c34/go.mod h1:7RTUFBdIRC9nZ7/3RyRNH1bdqIShrDejd1YbLwgPS+I= github.com/silas/dag v0.0.0-20210121180416-41cf55125c34/go.mod h1:7RTUFBdIRC9nZ7/3RyRNH1bdqIShrDejd1YbLwgPS+I=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/unistack-org/micro/v3 v3.3.15 h1:rj+spzhezCg4gmj1nuF0FRGixC51/7xFACOchB/23/E= github.com/unistack-org/micro/v3 v3.3.16 h1:v0h/oC0TO2n1djQJeOjD2jNEqKkiykwI6cpflEVTlQE=
github.com/unistack-org/micro/v3 v3.3.15/go.mod h1:ETGcQQUcjxGaD44LUMX+0fgo8Loh7ExldfIPLvfUmDo= github.com/unistack-org/micro/v3 v3.3.16/go.mod h1:ETGcQQUcjxGaD44LUMX+0fgo8Loh7ExldfIPLvfUmDo=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=

View File

@ -158,8 +158,9 @@ func RegisterRegisterServer(s server.Server, sh RegisterServer, opts ...server.H
register register
} }
h := &registerServer{sh} h := &registerServer{sh}
var nopts []server.HandlerOption
for _, endpoint := range NewRegisterEndpoints() { for _, endpoint := range NewRegisterEndpoints() {
opts = append(opts, api.WithEndpoint(endpoint)) nopts = append(nopts, api.WithEndpoint(endpoint))
} }
return s.Handle(s.NewHandler(&Register{h}, opts...)) return s.Handle(s.NewHandler(&Register{h}, append(nopts, opts...)...))
} }

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.26.0 // protoc-gen-go v1.26.0
// protoc v3.6.1 // protoc v3.15.6
// source: service.proto // source: service.proto
package service package service
@ -237,8 +237,8 @@ type Endpoint struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Request *Value `protobuf:"bytes,2,opt,name=request,proto3" json:"request,omitempty"` Request string `protobuf:"bytes,2,opt,name=request,proto3" json:"request,omitempty"`
Response *Value `protobuf:"bytes,3,opt,name=response,proto3" json:"response,omitempty"` Response string `protobuf:"bytes,3,opt,name=response,proto3" json:"response,omitempty"`
Metadata map[string]string `protobuf:"bytes,4,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Metadata map[string]string `protobuf:"bytes,4,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
} }
@ -281,18 +281,18 @@ func (x *Endpoint) GetName() string {
return "" return ""
} }
func (x *Endpoint) GetRequest() *Value { func (x *Endpoint) GetRequest() string {
if x != nil { if x != nil {
return x.Request return x.Request
} }
return nil return ""
} }
func (x *Endpoint) GetResponse() *Value { func (x *Endpoint) GetResponse() string {
if x != nil { if x != nil {
return x.Response return x.Response
} }
return nil return ""
} }
func (x *Endpoint) GetMetadata() map[string]string { func (x *Endpoint) GetMetadata() map[string]string {
@ -302,70 +302,6 @@ func (x *Endpoint) GetMetadata() map[string]string {
return nil return nil
} }
// Value is an opaque value for a request or response
type Value struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
Values []*Value `protobuf:"bytes,3,rep,name=values,proto3" json:"values,omitempty"`
}
func (x *Value) Reset() {
*x = Value{}
if protoimpl.UnsafeEnabled {
mi := &file_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Value) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Value) ProtoMessage() {}
func (x *Value) ProtoReflect() protoreflect.Message {
mi := &file_service_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 Value.ProtoReflect.Descriptor instead.
func (*Value) Descriptor() ([]byte, []int) {
return file_service_proto_rawDescGZIP(), []int{3}
}
func (x *Value) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Value) GetType() string {
if x != nil {
return x.Type
}
return ""
}
func (x *Value) GetValues() []*Value {
if x != nil {
return x.Values
}
return nil
}
// Options are registry options // Options are registry options
type Options struct { type Options struct {
state protoimpl.MessageState state protoimpl.MessageState
@ -379,7 +315,7 @@ type Options struct {
func (x *Options) Reset() { func (x *Options) Reset() {
*x = Options{} *x = Options{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_service_proto_msgTypes[4] mi := &file_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -392,7 +328,7 @@ func (x *Options) String() string {
func (*Options) ProtoMessage() {} func (*Options) ProtoMessage() {}
func (x *Options) ProtoReflect() protoreflect.Message { func (x *Options) ProtoReflect() protoreflect.Message {
mi := &file_service_proto_msgTypes[4] mi := &file_service_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 {
@ -405,7 +341,7 @@ func (x *Options) ProtoReflect() protoreflect.Message {
// Deprecated: Use Options.ProtoReflect.Descriptor instead. // Deprecated: Use Options.ProtoReflect.Descriptor instead.
func (*Options) Descriptor() ([]byte, []int) { func (*Options) Descriptor() ([]byte, []int) {
return file_service_proto_rawDescGZIP(), []int{4} return file_service_proto_rawDescGZIP(), []int{3}
} }
func (x *Options) GetTtl() int64 { func (x *Options) GetTtl() int64 {
@ -436,7 +372,7 @@ type Result struct {
func (x *Result) Reset() { func (x *Result) Reset() {
*x = Result{} *x = Result{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_service_proto_msgTypes[5] mi := &file_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -449,7 +385,7 @@ func (x *Result) String() string {
func (*Result) ProtoMessage() {} func (*Result) ProtoMessage() {}
func (x *Result) ProtoReflect() protoreflect.Message { func (x *Result) ProtoReflect() protoreflect.Message {
mi := &file_service_proto_msgTypes[5] mi := &file_service_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 {
@ -462,7 +398,7 @@ func (x *Result) ProtoReflect() protoreflect.Message {
// Deprecated: Use Result.ProtoReflect.Descriptor instead. // Deprecated: Use Result.ProtoReflect.Descriptor instead.
func (*Result) Descriptor() ([]byte, []int) { func (*Result) Descriptor() ([]byte, []int) {
return file_service_proto_rawDescGZIP(), []int{5} return file_service_proto_rawDescGZIP(), []int{4}
} }
func (x *Result) GetAction() string { func (x *Result) GetAction() string {
@ -495,7 +431,7 @@ type EmptyResponse struct {
func (x *EmptyResponse) Reset() { func (x *EmptyResponse) Reset() {
*x = EmptyResponse{} *x = EmptyResponse{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_service_proto_msgTypes[6] mi := &file_service_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -508,7 +444,7 @@ func (x *EmptyResponse) String() string {
func (*EmptyResponse) ProtoMessage() {} func (*EmptyResponse) ProtoMessage() {}
func (x *EmptyResponse) ProtoReflect() protoreflect.Message { func (x *EmptyResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_proto_msgTypes[6] mi := &file_service_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 {
@ -521,7 +457,7 @@ func (x *EmptyResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use EmptyResponse.ProtoReflect.Descriptor instead. // Deprecated: Use EmptyResponse.ProtoReflect.Descriptor instead.
func (*EmptyResponse) Descriptor() ([]byte, []int) { func (*EmptyResponse) Descriptor() ([]byte, []int) {
return file_service_proto_rawDescGZIP(), []int{6} return file_service_proto_rawDescGZIP(), []int{5}
} }
type LookupRequest struct { type LookupRequest struct {
@ -536,7 +472,7 @@ type LookupRequest struct {
func (x *LookupRequest) Reset() { func (x *LookupRequest) Reset() {
*x = LookupRequest{} *x = LookupRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_service_proto_msgTypes[7] mi := &file_service_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -549,7 +485,7 @@ func (x *LookupRequest) String() string {
func (*LookupRequest) ProtoMessage() {} func (*LookupRequest) ProtoMessage() {}
func (x *LookupRequest) ProtoReflect() protoreflect.Message { func (x *LookupRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_proto_msgTypes[7] mi := &file_service_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 {
@ -562,7 +498,7 @@ func (x *LookupRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use LookupRequest.ProtoReflect.Descriptor instead. // Deprecated: Use LookupRequest.ProtoReflect.Descriptor instead.
func (*LookupRequest) Descriptor() ([]byte, []int) { func (*LookupRequest) Descriptor() ([]byte, []int) {
return file_service_proto_rawDescGZIP(), []int{7} return file_service_proto_rawDescGZIP(), []int{6}
} }
func (x *LookupRequest) GetService() string { func (x *LookupRequest) GetService() string {
@ -590,7 +526,7 @@ type LookupResponse struct {
func (x *LookupResponse) Reset() { func (x *LookupResponse) Reset() {
*x = LookupResponse{} *x = LookupResponse{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_service_proto_msgTypes[8] mi := &file_service_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -603,7 +539,7 @@ func (x *LookupResponse) String() string {
func (*LookupResponse) ProtoMessage() {} func (*LookupResponse) ProtoMessage() {}
func (x *LookupResponse) ProtoReflect() protoreflect.Message { func (x *LookupResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_proto_msgTypes[8] mi := &file_service_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 {
@ -616,7 +552,7 @@ func (x *LookupResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use LookupResponse.ProtoReflect.Descriptor instead. // Deprecated: Use LookupResponse.ProtoReflect.Descriptor instead.
func (*LookupResponse) Descriptor() ([]byte, []int) { func (*LookupResponse) Descriptor() ([]byte, []int) {
return file_service_proto_rawDescGZIP(), []int{8} return file_service_proto_rawDescGZIP(), []int{7}
} }
func (x *LookupResponse) GetServices() []*Service { func (x *LookupResponse) GetServices() []*Service {
@ -637,7 +573,7 @@ type ListRequest struct {
func (x *ListRequest) Reset() { func (x *ListRequest) Reset() {
*x = ListRequest{} *x = ListRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_service_proto_msgTypes[9] mi := &file_service_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -650,7 +586,7 @@ func (x *ListRequest) String() string {
func (*ListRequest) ProtoMessage() {} func (*ListRequest) ProtoMessage() {}
func (x *ListRequest) ProtoReflect() protoreflect.Message { func (x *ListRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_proto_msgTypes[9] mi := &file_service_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 {
@ -663,7 +599,7 @@ func (x *ListRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListRequest.ProtoReflect.Descriptor instead. // Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.
func (*ListRequest) Descriptor() ([]byte, []int) { func (*ListRequest) Descriptor() ([]byte, []int) {
return file_service_proto_rawDescGZIP(), []int{9} return file_service_proto_rawDescGZIP(), []int{8}
} }
func (x *ListRequest) GetOptions() *Options { func (x *ListRequest) GetOptions() *Options {
@ -684,7 +620,7 @@ type ListResponse struct {
func (x *ListResponse) Reset() { func (x *ListResponse) Reset() {
*x = ListResponse{} *x = ListResponse{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_service_proto_msgTypes[10] mi := &file_service_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -697,7 +633,7 @@ func (x *ListResponse) String() string {
func (*ListResponse) ProtoMessage() {} func (*ListResponse) ProtoMessage() {}
func (x *ListResponse) ProtoReflect() protoreflect.Message { func (x *ListResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_proto_msgTypes[10] mi := &file_service_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 {
@ -710,7 +646,7 @@ func (x *ListResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListResponse.ProtoReflect.Descriptor instead. // Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.
func (*ListResponse) Descriptor() ([]byte, []int) { func (*ListResponse) Descriptor() ([]byte, []int) {
return file_service_proto_rawDescGZIP(), []int{10} return file_service_proto_rawDescGZIP(), []int{9}
} }
func (x *ListResponse) GetServices() []*Service { func (x *ListResponse) GetServices() []*Service {
@ -733,7 +669,7 @@ type WatchRequest struct {
func (x *WatchRequest) Reset() { func (x *WatchRequest) Reset() {
*x = WatchRequest{} *x = WatchRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_service_proto_msgTypes[11] mi := &file_service_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -746,7 +682,7 @@ func (x *WatchRequest) String() string {
func (*WatchRequest) ProtoMessage() {} func (*WatchRequest) ProtoMessage() {}
func (x *WatchRequest) ProtoReflect() protoreflect.Message { func (x *WatchRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_proto_msgTypes[11] mi := &file_service_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 {
@ -759,7 +695,7 @@ func (x *WatchRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use WatchRequest.ProtoReflect.Descriptor instead. // Deprecated: Use WatchRequest.ProtoReflect.Descriptor instead.
func (*WatchRequest) Descriptor() ([]byte, []int) { func (*WatchRequest) Descriptor() ([]byte, []int) {
return file_service_proto_rawDescGZIP(), []int{11} return file_service_proto_rawDescGZIP(), []int{10}
} }
func (x *WatchRequest) GetService() string { func (x *WatchRequest) GetService() string {
@ -795,7 +731,7 @@ type Event struct {
func (x *Event) Reset() { func (x *Event) Reset() {
*x = Event{} *x = Event{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_service_proto_msgTypes[12] mi := &file_service_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -808,7 +744,7 @@ func (x *Event) String() string {
func (*Event) ProtoMessage() {} func (*Event) ProtoMessage() {}
func (x *Event) ProtoReflect() protoreflect.Message { func (x *Event) ProtoReflect() protoreflect.Message {
mi := &file_service_proto_msgTypes[12] mi := &file_service_proto_msgTypes[11]
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 {
@ -821,7 +757,7 @@ func (x *Event) ProtoReflect() protoreflect.Message {
// Deprecated: Use Event.ProtoReflect.Descriptor instead. // Deprecated: Use Event.ProtoReflect.Descriptor instead.
func (*Event) Descriptor() ([]byte, []int) { func (*Event) Descriptor() ([]byte, []int) {
return file_service_proto_rawDescGZIP(), []int{12} return file_service_proto_rawDescGZIP(), []int{11}
} }
func (x *Event) GetId() string { func (x *Event) GetId() string {
@ -887,14 +823,12 @@ var file_service_proto_rawDesc = []byte{
0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79,
0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xee, 0x01, 0x0a, 0x08, 0x45, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xce, 0x01, 0x0a, 0x08, 0x45,
0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x07, 0x72, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x3b, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x45, 0x6e, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x45, 0x6e,
0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45,
@ -902,82 +836,77 @@ var file_service_proto_rawDesc = []byte{
0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12,
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65,
0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x57, 0x0a, 0x05, 0x56, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x33, 0x0a, 0x07, 0x4f,
0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18, 0x01, 0x20,
0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x01, 0x28, 0x03, 0x52, 0x03, 0x74, 0x74, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e,
0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x22, 0x6a, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69,
0x6c, 0x75, 0x65, 0x73, 0x22, 0x33, 0x0a, 0x07, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20,
0x10, 0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x74, 0x74, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x65,
0x6c, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1c,
0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0x6a, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28,
0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x0f, 0x0a, 0x0d,
0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x07, 0x73, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x55, 0x0a,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x0d, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69,
0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76,
0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x0f, 0x0a, 0x0d, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x69, 0x63, 0x65, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x55, 0x0a, 0x0d, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3e, 0x0a, 0x0e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69,
0x65, 0x12, 0x2a, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x63, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76,
0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x63, 0x65, 0x73, 0x22, 0x39, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75,
0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3e, 0x0a, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01,
0x0e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4f,
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22,
0x3c, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x2c, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x2c, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x22, 0x39, 0x0a, 0x69, 0x63, 0x65, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x22, 0x54, 0x0a,
0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x0c, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a,
0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f,
0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3c, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x63, 0x65, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69,
0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x6f, 0x6e, 0x73, 0x22, 0x89, 0x01, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a,
0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x08, 0x73, 0x65, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a,
0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x22, 0x54, 0x0a, 0x0c, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x73, 0x65,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
0x12, 0x2a, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74,
0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x04,
0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x89, 0x01, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53,
0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2a,
0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x2f, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06,
0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x45, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65,
0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x74, 0x65, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x10, 0x02,
0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x32, 0xb4, 0x02, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x42, 0x0a,
0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x07, 0x0d, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x16,
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52,
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2a, 0x2f, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x10, 0x00, 0x12, 0x36, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x10, 0x2e,
0x00, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a,
0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x10, 0x02, 0x32, 0xb4, 0x02, 0x0a, 0x08, 0x52, 0x65, 0x16, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52,
0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x0d, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x0a, 0x44, 0x65, 0x72,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x16, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x16, 0x2e, 0x73, 0x65, 0x72, 0x76,
0x17, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x69, 0x63, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x08, 0x52, 0x65, 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69,
0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x65, 0x73, 0x12, 0x14, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69,
0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x16, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x73, 0x65, 0x72, 0x76,
0x63, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x22, 0x00, 0x12, 0x38, 0x0a, 0x0a, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x22, 0x00, 0x12, 0x33, 0x0a, 0x05, 0x57, 0x61, 0x74, 0x63, 0x68, 0x12, 0x15, 0x2e, 0x73, 0x65,
0x12, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65,
0x63, 0x65, 0x1a, 0x16, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73,
0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0c, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x30, 0x01, 0x42, 0x41, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75,
0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x14, 0x2e, 0x73, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x6e, 0x69, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2d, 0x6f,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x72, 0x67, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2d, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65,
0x73, 0x74, 0x1a, 0x15, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x72, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x72, 0x6f,
0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x33, 0x0a, 0x05, 0x57, 0x74, 0x6f, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x61, 0x74, 0x63, 0x68, 0x12, 0x15, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x57, 0x6f, 0x33,
0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x73, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x30, 0x01,
0x42, 0x41, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75,
0x6e, 0x69, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x6d, 0x69, 0x63, 0x72,
0x6f, 0x2d, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x73, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -993,59 +922,55 @@ func file_service_proto_rawDescGZIP() []byte {
} }
var file_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_service_proto_msgTypes = make([]protoimpl.MessageInfo, 16) var file_service_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
var file_service_proto_goTypes = []interface{}{ var file_service_proto_goTypes = []interface{}{
(EventType)(0), // 0: service.EventType (EventType)(0), // 0: service.EventType
(*Service)(nil), // 1: service.Service (*Service)(nil), // 1: service.Service
(*Node)(nil), // 2: service.Node (*Node)(nil), // 2: service.Node
(*Endpoint)(nil), // 3: service.Endpoint (*Endpoint)(nil), // 3: service.Endpoint
(*Value)(nil), // 4: service.Value (*Options)(nil), // 4: service.Options
(*Options)(nil), // 5: service.Options (*Result)(nil), // 5: service.Result
(*Result)(nil), // 6: service.Result (*EmptyResponse)(nil), // 6: service.EmptyResponse
(*EmptyResponse)(nil), // 7: service.EmptyResponse (*LookupRequest)(nil), // 7: service.LookupRequest
(*LookupRequest)(nil), // 8: service.LookupRequest (*LookupResponse)(nil), // 8: service.LookupResponse
(*LookupResponse)(nil), // 9: service.LookupResponse (*ListRequest)(nil), // 9: service.ListRequest
(*ListRequest)(nil), // 10: service.ListRequest (*ListResponse)(nil), // 10: service.ListResponse
(*ListResponse)(nil), // 11: service.ListResponse (*WatchRequest)(nil), // 11: service.WatchRequest
(*WatchRequest)(nil), // 12: service.WatchRequest (*Event)(nil), // 12: service.Event
(*Event)(nil), // 13: service.Event nil, // 13: service.Service.MetadataEntry
nil, // 14: service.Service.MetadataEntry nil, // 14: service.Node.MetadataEntry
nil, // 15: service.Node.MetadataEntry nil, // 15: service.Endpoint.MetadataEntry
nil, // 16: service.Endpoint.MetadataEntry
} }
var file_service_proto_depIdxs = []int32{ var file_service_proto_depIdxs = []int32{
14, // 0: service.Service.metadata:type_name -> service.Service.MetadataEntry 13, // 0: service.Service.metadata:type_name -> service.Service.MetadataEntry
3, // 1: service.Service.endpoints:type_name -> service.Endpoint 3, // 1: service.Service.endpoints:type_name -> service.Endpoint
2, // 2: service.Service.nodes:type_name -> service.Node 2, // 2: service.Service.nodes:type_name -> service.Node
5, // 3: service.Service.options:type_name -> service.Options 4, // 3: service.Service.options:type_name -> service.Options
15, // 4: service.Node.metadata:type_name -> service.Node.MetadataEntry 14, // 4: service.Node.metadata:type_name -> service.Node.MetadataEntry
4, // 5: service.Endpoint.request:type_name -> service.Value 15, // 5: service.Endpoint.metadata:type_name -> service.Endpoint.MetadataEntry
4, // 6: service.Endpoint.response:type_name -> service.Value 1, // 6: service.Result.service:type_name -> service.Service
16, // 7: service.Endpoint.metadata:type_name -> service.Endpoint.MetadataEntry 4, // 7: service.LookupRequest.options:type_name -> service.Options
4, // 8: service.Value.values:type_name -> service.Value 1, // 8: service.LookupResponse.services:type_name -> service.Service
1, // 9: service.Result.service:type_name -> service.Service 4, // 9: service.ListRequest.options:type_name -> service.Options
5, // 10: service.LookupRequest.options:type_name -> service.Options 1, // 10: service.ListResponse.services:type_name -> service.Service
1, // 11: service.LookupResponse.services:type_name -> service.Service 4, // 11: service.WatchRequest.options:type_name -> service.Options
5, // 12: service.ListRequest.options:type_name -> service.Options 0, // 12: service.Event.type:type_name -> service.EventType
1, // 13: service.ListResponse.services:type_name -> service.Service 1, // 13: service.Event.service:type_name -> service.Service
5, // 14: service.WatchRequest.options:type_name -> service.Options 7, // 14: service.Register.LookupService:input_type -> service.LookupRequest
0, // 15: service.Event.type:type_name -> service.EventType 1, // 15: service.Register.Register:input_type -> service.Service
1, // 16: service.Event.service:type_name -> service.Service 1, // 16: service.Register.Deregister:input_type -> service.Service
8, // 17: service.Register.LookupService:input_type -> service.LookupRequest 9, // 17: service.Register.ListServices:input_type -> service.ListRequest
1, // 18: service.Register.Register:input_type -> service.Service 11, // 18: service.Register.Watch:input_type -> service.WatchRequest
1, // 19: service.Register.Deregister:input_type -> service.Service 8, // 19: service.Register.LookupService:output_type -> service.LookupResponse
10, // 20: service.Register.ListServices:input_type -> service.ListRequest 6, // 20: service.Register.Register:output_type -> service.EmptyResponse
12, // 21: service.Register.Watch:input_type -> service.WatchRequest 6, // 21: service.Register.Deregister:output_type -> service.EmptyResponse
9, // 22: service.Register.LookupService:output_type -> service.LookupResponse 10, // 22: service.Register.ListServices:output_type -> service.ListResponse
7, // 23: service.Register.Register:output_type -> service.EmptyResponse 5, // 23: service.Register.Watch:output_type -> service.Result
7, // 24: service.Register.Deregister:output_type -> service.EmptyResponse 19, // [19:24] is the sub-list for method output_type
11, // 25: service.Register.ListServices:output_type -> service.ListResponse 14, // [14:19] is the sub-list for method input_type
6, // 26: service.Register.Watch:output_type -> service.Result 14, // [14:14] is the sub-list for extension type_name
22, // [22:27] is the sub-list for method output_type 14, // [14:14] is the sub-list for extension extendee
17, // [17:22] is the sub-list for method input_type 0, // [0:14] is the sub-list for field type_name
17, // [17:17] is the sub-list for extension type_name
17, // [17:17] is the sub-list for extension extendee
0, // [0:17] is the sub-list for field type_name
} }
func init() { file_service_proto_init() } func init() { file_service_proto_init() }
@ -1091,18 +1016,6 @@ func file_service_proto_init() {
} }
} }
file_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { file_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Value); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Options); i { switch v := v.(*Options); i {
case 0: case 0:
return &v.state return &v.state
@ -1114,7 +1027,7 @@ func file_service_proto_init() {
return nil return nil
} }
} }
file_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { file_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Result); i { switch v := v.(*Result); i {
case 0: case 0:
return &v.state return &v.state
@ -1126,7 +1039,7 @@ func file_service_proto_init() {
return nil return nil
} }
} }
file_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { file_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*EmptyResponse); i { switch v := v.(*EmptyResponse); i {
case 0: case 0:
return &v.state return &v.state
@ -1138,7 +1051,7 @@ func file_service_proto_init() {
return nil return nil
} }
} }
file_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { file_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LookupRequest); i { switch v := v.(*LookupRequest); i {
case 0: case 0:
return &v.state return &v.state
@ -1150,7 +1063,7 @@ func file_service_proto_init() {
return nil return nil
} }
} }
file_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { file_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LookupResponse); i { switch v := v.(*LookupResponse); i {
case 0: case 0:
return &v.state return &v.state
@ -1162,7 +1075,7 @@ func file_service_proto_init() {
return nil return nil
} }
} }
file_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { file_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListRequest); i { switch v := v.(*ListRequest); i {
case 0: case 0:
return &v.state return &v.state
@ -1174,7 +1087,7 @@ func file_service_proto_init() {
return nil return nil
} }
} }
file_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { file_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListResponse); i { switch v := v.(*ListResponse); i {
case 0: case 0:
return &v.state return &v.state
@ -1186,7 +1099,7 @@ func file_service_proto_init() {
return nil return nil
} }
} }
file_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { file_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*WatchRequest); i { switch v := v.(*WatchRequest); i {
case 0: case 0:
return &v.state return &v.state
@ -1198,7 +1111,7 @@ func file_service_proto_init() {
return nil return nil
} }
} }
file_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { file_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Event); i { switch v := v.(*Event); i {
case 0: case 0:
return &v.state return &v.state
@ -1217,7 +1130,7 @@ func file_service_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_proto_rawDesc, RawDescriptor: file_service_proto_rawDesc,
NumEnums: 1, NumEnums: 1,
NumMessages: 16, NumMessages: 15,
NumExtensions: 0, NumExtensions: 0,
NumServices: 1, NumServices: 1,
}, },

View File

@ -32,18 +32,11 @@ message Node {
// Endpoint is a endpoint provided by a service // Endpoint is a endpoint provided by a service
message Endpoint { message Endpoint {
string name = 1; string name = 1;
Value request = 2; string request = 2;
Value response = 3; string response = 3;
map<string, string> metadata = 4; map<string, string> metadata = 4;
} }
// Value is an opaque value for a request or response
message Value {
string name = 1;
string type = 2;
repeated Value values = 3;
}
// Options are registry options // Options are registry options
message Options { message Options {
int64 ttl = 1; int64 ttl = 1;

7
service_test.go Normal file
View File

@ -0,0 +1,7 @@
package service
import "testing"
func TestService(t *testing.T) {
}

76
util.go
View File

@ -5,63 +5,13 @@ import (
"github.com/unistack-org/micro/v3/register" "github.com/unistack-org/micro/v3/register"
) )
func values(v []*register.Value) []*pb.Value {
if len(v) == 0 {
return []*pb.Value{}
}
vs := make([]*pb.Value, 0, len(v))
for _, vi := range v {
vs = append(vs, &pb.Value{
Name: vi.Name,
Type: vi.Type,
Values: values(vi.Values),
})
}
return vs
}
func toValues(v []*pb.Value) []*register.Value {
if len(v) == 0 {
return []*register.Value{}
}
vs := make([]*register.Value, 0, len(v))
for _, vi := range v {
vs = append(vs, &register.Value{
Name: vi.Name,
Type: vi.Type,
Values: toValues(vi.Values),
})
}
return vs
}
func ToProto(s *register.Service) *pb.Service { func ToProto(s *register.Service) *pb.Service {
endpoints := make([]*pb.Endpoint, 0, len(s.Endpoints)) endpoints := make([]*pb.Endpoint, 0, len(s.Endpoints))
for _, ep := range s.Endpoints { for _, ep := range s.Endpoints {
var request, response *pb.Value
if ep.Request != nil {
request = &pb.Value{
Name: ep.Request.Name,
Type: ep.Request.Type,
Values: values(ep.Request.Values),
}
}
if ep.Response != nil {
response = &pb.Value{
Name: ep.Response.Name,
Type: ep.Response.Type,
Values: values(ep.Response.Values),
}
}
endpoints = append(endpoints, &pb.Endpoint{ endpoints = append(endpoints, &pb.Endpoint{
Name: ep.Name, Name: ep.Name,
Request: request, Request: ep.Request,
Response: response, Response: ep.Response,
Metadata: ep.Metadata, Metadata: ep.Metadata,
}) })
} }
@ -89,28 +39,10 @@ func ToProto(s *register.Service) *pb.Service {
func ToService(s *pb.Service) *register.Service { func ToService(s *pb.Service) *register.Service {
endpoints := make([]*register.Endpoint, 0, len(s.Endpoints)) endpoints := make([]*register.Endpoint, 0, len(s.Endpoints))
for _, ep := range s.Endpoints { for _, ep := range s.Endpoints {
var request, response *register.Value
if ep.Request != nil {
request = &register.Value{
Name: ep.Request.Name,
Type: ep.Request.Type,
Values: toValues(ep.Request.Values),
}
}
if ep.Response != nil {
response = &register.Value{
Name: ep.Response.Name,
Type: ep.Response.Type,
Values: toValues(ep.Response.Values),
}
}
endpoints = append(endpoints, &register.Endpoint{ endpoints = append(endpoints, &register.Endpoint{
Name: ep.Name, Name: ep.Name,
Request: request, Request: ep.Request,
Response: response, Response: ep.Response,
Metadata: ep.Metadata, Metadata: ep.Metadata,
}) })
} }