diff --git a/server/proto/server.pb.go b/server/proto/server.pb.go deleted file mode 100644 index 5813ff28..00000000 --- a/server/proto/server.pb.go +++ /dev/null @@ -1,324 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: server/proto/server.proto - -package go_micro_server - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type HandleRequest struct { - Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` - Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"` - Protocol string `protobuf:"bytes,3,opt,name=protocol,proto3" json:"protocol,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HandleRequest) Reset() { *m = HandleRequest{} } -func (m *HandleRequest) String() string { return proto.CompactTextString(m) } -func (*HandleRequest) ProtoMessage() {} -func (*HandleRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_1959cecd4d1121a1, []int{0} -} - -func (m *HandleRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HandleRequest.Unmarshal(m, b) -} -func (m *HandleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HandleRequest.Marshal(b, m, deterministic) -} -func (m *HandleRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_HandleRequest.Merge(m, src) -} -func (m *HandleRequest) XXX_Size() int { - return xxx_messageInfo_HandleRequest.Size(m) -} -func (m *HandleRequest) XXX_DiscardUnknown() { - xxx_messageInfo_HandleRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_HandleRequest proto.InternalMessageInfo - -func (m *HandleRequest) GetService() string { - if m != nil { - return m.Service - } - return "" -} - -func (m *HandleRequest) GetEndpoint() string { - if m != nil { - return m.Endpoint - } - return "" -} - -func (m *HandleRequest) GetProtocol() string { - if m != nil { - return m.Protocol - } - return "" -} - -type HandleResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HandleResponse) Reset() { *m = HandleResponse{} } -func (m *HandleResponse) String() string { return proto.CompactTextString(m) } -func (*HandleResponse) ProtoMessage() {} -func (*HandleResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1959cecd4d1121a1, []int{1} -} - -func (m *HandleResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HandleResponse.Unmarshal(m, b) -} -func (m *HandleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HandleResponse.Marshal(b, m, deterministic) -} -func (m *HandleResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_HandleResponse.Merge(m, src) -} -func (m *HandleResponse) XXX_Size() int { - return xxx_messageInfo_HandleResponse.Size(m) -} -func (m *HandleResponse) XXX_DiscardUnknown() { - xxx_messageInfo_HandleResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_HandleResponse proto.InternalMessageInfo - -type SubscribeRequest struct { - Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SubscribeRequest) Reset() { *m = SubscribeRequest{} } -func (m *SubscribeRequest) String() string { return proto.CompactTextString(m) } -func (*SubscribeRequest) ProtoMessage() {} -func (*SubscribeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_1959cecd4d1121a1, []int{2} -} - -func (m *SubscribeRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SubscribeRequest.Unmarshal(m, b) -} -func (m *SubscribeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SubscribeRequest.Marshal(b, m, deterministic) -} -func (m *SubscribeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubscribeRequest.Merge(m, src) -} -func (m *SubscribeRequest) XXX_Size() int { - return xxx_messageInfo_SubscribeRequest.Size(m) -} -func (m *SubscribeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SubscribeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SubscribeRequest proto.InternalMessageInfo - -func (m *SubscribeRequest) GetTopic() string { - if m != nil { - return m.Topic - } - return "" -} - -type SubscribeResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SubscribeResponse) Reset() { *m = SubscribeResponse{} } -func (m *SubscribeResponse) String() string { return proto.CompactTextString(m) } -func (*SubscribeResponse) ProtoMessage() {} -func (*SubscribeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1959cecd4d1121a1, []int{3} -} - -func (m *SubscribeResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SubscribeResponse.Unmarshal(m, b) -} -func (m *SubscribeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SubscribeResponse.Marshal(b, m, deterministic) -} -func (m *SubscribeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubscribeResponse.Merge(m, src) -} -func (m *SubscribeResponse) XXX_Size() int { - return xxx_messageInfo_SubscribeResponse.Size(m) -} -func (m *SubscribeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SubscribeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SubscribeResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*HandleRequest)(nil), "go.micro.server.HandleRequest") - proto.RegisterType((*HandleResponse)(nil), "go.micro.server.HandleResponse") - proto.RegisterType((*SubscribeRequest)(nil), "go.micro.server.SubscribeRequest") - proto.RegisterType((*SubscribeResponse)(nil), "go.micro.server.SubscribeResponse") -} - -func init() { proto.RegisterFile("server/proto/server.proto", fileDescriptor_1959cecd4d1121a1) } - -var fileDescriptor_1959cecd4d1121a1 = []byte{ - // 223 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2c, 0x4e, 0x2d, 0x2a, - 0x4b, 0x2d, 0xd2, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x87, 0x70, 0xf4, 0xc0, 0x1c, 0x21, 0xfe, - 0xf4, 0x7c, 0xbd, 0xdc, 0xcc, 0xe4, 0xa2, 0x7c, 0x3d, 0x88, 0xb0, 0x52, 0x22, 0x17, 0xaf, 0x47, - 0x62, 0x5e, 0x4a, 0x4e, 0x6a, 0x50, 0x6a, 0x61, 0x69, 0x6a, 0x71, 0x89, 0x90, 0x04, 0x17, 0x3b, - 0x48, 0x2a, 0x33, 0x39, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08, 0xc6, 0x15, 0x92, 0xe2, - 0xe2, 0x48, 0xcd, 0x4b, 0x29, 0xc8, 0xcf, 0xcc, 0x2b, 0x91, 0x60, 0x02, 0x4b, 0xc1, 0xf9, 0x20, - 0x39, 0xb0, 0x05, 0xc9, 0xf9, 0x39, 0x12, 0xcc, 0x10, 0x39, 0x18, 0x5f, 0x49, 0x80, 0x8b, 0x0f, - 0x66, 0x45, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x92, 0x06, 0x97, 0x40, 0x70, 0x69, 0x52, 0x71, - 0x72, 0x51, 0x66, 0x12, 0xdc, 0x5e, 0x11, 0x2e, 0xd6, 0x92, 0xfc, 0x82, 0xcc, 0x64, 0xa8, 0xad, - 0x10, 0x8e, 0x92, 0x30, 0x97, 0x20, 0x92, 0x4a, 0x88, 0x76, 0xa3, 0xd5, 0x8c, 0x5c, 0x6c, 0xc1, - 0x60, 0xe7, 0x0b, 0x79, 0x73, 0xb1, 0x41, 0xcc, 0x16, 0x92, 0xd3, 0x43, 0xf3, 0x9a, 0x1e, 0x8a, - 0xbf, 0xa4, 0xe4, 0x71, 0xca, 0x43, 0x1d, 0xc5, 0x20, 0x14, 0xc2, 0xc5, 0x09, 0xb7, 0x4c, 0x48, - 0x11, 0x43, 0x3d, 0xba, 0x93, 0xa5, 0x94, 0xf0, 0x29, 0x81, 0x99, 0x9a, 0xc4, 0x06, 0x0e, 0x08, - 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa4, 0x3f, 0x79, 0x80, 0x96, 0x01, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// ServerClient is the client API for Server service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ServerClient interface { - Handle(ctx context.Context, in *HandleRequest, opts ...grpc.CallOption) (*HandleResponse, error) - Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (*SubscribeResponse, error) -} - -type serverClient struct { - cc *grpc.ClientConn -} - -func NewServerClient(cc *grpc.ClientConn) ServerClient { - return &serverClient{cc} -} - -func (c *serverClient) Handle(ctx context.Context, in *HandleRequest, opts ...grpc.CallOption) (*HandleResponse, error) { - out := new(HandleResponse) - err := c.cc.Invoke(ctx, "/go.micro.server.Server/Handle", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serverClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (*SubscribeResponse, error) { - out := new(SubscribeResponse) - err := c.cc.Invoke(ctx, "/go.micro.server.Server/Subscribe", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ServerServer is the server API for Server service. -type ServerServer interface { - Handle(context.Context, *HandleRequest) (*HandleResponse, error) - Subscribe(context.Context, *SubscribeRequest) (*SubscribeResponse, error) -} - -// UnimplementedServerServer can be embedded to have forward compatible implementations. -type UnimplementedServerServer struct { -} - -func (*UnimplementedServerServer) Handle(ctx context.Context, req *HandleRequest) (*HandleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Handle not implemented") -} -func (*UnimplementedServerServer) Subscribe(ctx context.Context, req *SubscribeRequest) (*SubscribeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Subscribe not implemented") -} - -func RegisterServerServer(s *grpc.Server, srv ServerServer) { - s.RegisterService(&_Server_serviceDesc, srv) -} - -func _Server_Handle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HandleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServerServer).Handle(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/go.micro.server.Server/Handle", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServerServer).Handle(ctx, req.(*HandleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Server_Subscribe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SubscribeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServerServer).Subscribe(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/go.micro.server.Server/Subscribe", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServerServer).Subscribe(ctx, req.(*SubscribeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Server_serviceDesc = grpc.ServiceDesc{ - ServiceName: "go.micro.server.Server", - HandlerType: (*ServerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Handle", - Handler: _Server_Handle_Handler, - }, - { - MethodName: "Subscribe", - Handler: _Server_Subscribe_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "server/proto/server.proto", -} diff --git a/server/proto/server.pb.micro.go b/server/proto/server.pb.micro.go deleted file mode 100644 index ecb350e8..00000000 --- a/server/proto/server.pb.micro.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by protoc-gen-micro. DO NOT EDIT. -// source: server/proto/server.proto - -package go_micro_server - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -import ( - context "context" - api "github.com/micro/go-micro/v3/api" - client "github.com/micro/go-micro/v3/client" - server "github.com/micro/go-micro/v3/server" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// Reference imports to suppress errors if they are not otherwise used. -var _ api.Endpoint -var _ context.Context -var _ client.Option -var _ server.Option - -// Api Endpoints for Server service - -func NewServerEndpoints() []*api.Endpoint { - return []*api.Endpoint{} -} - -// Client API for Server service - -type ServerService interface { - Handle(ctx context.Context, in *HandleRequest, opts ...client.CallOption) (*HandleResponse, error) - Subscribe(ctx context.Context, in *SubscribeRequest, opts ...client.CallOption) (*SubscribeResponse, error) -} - -type serverService struct { - c client.Client - name string -} - -func NewServerService(name string, c client.Client) ServerService { - return &serverService{ - c: c, - name: name, - } -} - -func (c *serverService) Handle(ctx context.Context, in *HandleRequest, opts ...client.CallOption) (*HandleResponse, error) { - req := c.c.NewRequest(c.name, "Server.Handle", in) - out := new(HandleResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serverService) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...client.CallOption) (*SubscribeResponse, error) { - req := c.c.NewRequest(c.name, "Server.Subscribe", in) - out := new(SubscribeResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Server service - -type ServerHandler interface { - Handle(context.Context, *HandleRequest, *HandleResponse) error - Subscribe(context.Context, *SubscribeRequest, *SubscribeResponse) error -} - -func RegisterServerHandler(s server.Server, hdlr ServerHandler, opts ...server.HandlerOption) error { - type server interface { - Handle(ctx context.Context, in *HandleRequest, out *HandleResponse) error - Subscribe(ctx context.Context, in *SubscribeRequest, out *SubscribeResponse) error - } - type Server struct { - server - } - h := &serverHandler{hdlr} - return s.Handle(s.NewHandler(&Server{h}, opts...)) -} - -type serverHandler struct { - ServerHandler -} - -func (h *serverHandler) Handle(ctx context.Context, in *HandleRequest, out *HandleResponse) error { - return h.ServerHandler.Handle(ctx, in, out) -} - -func (h *serverHandler) Subscribe(ctx context.Context, in *SubscribeRequest, out *SubscribeResponse) error { - return h.ServerHandler.Subscribe(ctx, in, out) -} diff --git a/server/proto/server.proto b/server/proto/server.proto deleted file mode 100644 index 2440edbe..00000000 --- a/server/proto/server.proto +++ /dev/null @@ -1,22 +0,0 @@ -syntax = "proto3"; - -package go.micro.server; - -service Server { - rpc Handle(HandleRequest) returns (HandleResponse) {}; - rpc Subscribe(SubscribeRequest) returns (SubscribeResponse) {}; -} - -message HandleRequest { - string service = 1; - string endpoint = 2; - string protocol = 3; -} - -message HandleResponse {} - -message SubscribeRequest { - string topic = 1; -} - -message SubscribeResponse {}