2019-09-22 15:31:07 +01:00
|
|
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
2020-05-19 18:17:17 +01:00
|
|
|
// source: server/proto/server.proto
|
2019-09-22 15:31:07 +01:00
|
|
|
|
|
|
|
package go_micro_server
|
|
|
|
|
|
|
|
import (
|
2020-05-19 18:17:17 +01:00
|
|
|
context "context"
|
|
|
|
fmt "fmt"
|
2019-09-22 15:31:07 +01:00
|
|
|
proto "github.com/golang/protobuf/proto"
|
2020-05-19 18:17:17 +01:00
|
|
|
grpc "google.golang.org/grpc"
|
|
|
|
codes "google.golang.org/grpc/codes"
|
|
|
|
status "google.golang.org/grpc/status"
|
|
|
|
math "math"
|
2019-09-22 15:31:07 +01:00
|
|
|
)
|
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
|
|
var _ = proto.Marshal
|
|
|
|
var _ = fmt.Errorf
|
|
|
|
var _ = math.Inf
|
2019-09-22 15:31:07 +01:00
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
// 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
|
2019-09-22 15:31:07 +01:00
|
|
|
|
|
|
|
type HandleRequest struct {
|
2020-05-19 18:17:17 +01:00
|
|
|
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:"-"`
|
2019-09-22 15:31:07 +01:00
|
|
|
}
|
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
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}
|
2019-09-22 15:31:07 +01:00
|
|
|
}
|
2020-05-11 14:08:27 +02:00
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
func (m *HandleRequest) XXX_Unmarshal(b []byte) error {
|
|
|
|
return xxx_messageInfo_HandleRequest.Unmarshal(m, b)
|
2019-09-22 15:31:07 +01:00
|
|
|
}
|
2020-05-19 18:17:17 +01:00
|
|
|
func (m *HandleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
return xxx_messageInfo_HandleRequest.Marshal(b, m, deterministic)
|
2019-09-22 15:31:07 +01:00
|
|
|
}
|
2020-05-19 18:17:17 +01:00
|
|
|
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)
|
2020-05-11 14:08:27 +02:00
|
|
|
}
|
2019-09-22 15:31:07 +01:00
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
var xxx_messageInfo_HandleRequest proto.InternalMessageInfo
|
|
|
|
|
|
|
|
func (m *HandleRequest) GetService() string {
|
|
|
|
if m != nil {
|
|
|
|
return m.Service
|
2019-09-22 15:31:07 +01:00
|
|
|
}
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
func (m *HandleRequest) GetEndpoint() string {
|
|
|
|
if m != nil {
|
|
|
|
return m.Endpoint
|
2019-09-22 15:31:07 +01:00
|
|
|
}
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
func (m *HandleRequest) GetProtocol() string {
|
|
|
|
if m != nil {
|
|
|
|
return m.Protocol
|
2019-09-22 15:31:07 +01:00
|
|
|
}
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
type HandleResponse struct {
|
2020-05-19 18:17:17 +01:00
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
2019-09-22 15:31:07 +01:00
|
|
|
}
|
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
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)
|
2019-09-22 15:31:07 +01:00
|
|
|
}
|
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
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:"-"`
|
2019-09-22 15:31:07 +01:00
|
|
|
}
|
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
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}
|
|
|
|
}
|
2019-09-22 15:31:07 +01:00
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
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
|
2019-09-22 15:31:07 +01:00
|
|
|
}
|
2020-05-19 18:17:17 +01:00
|
|
|
return ""
|
2019-09-22 15:31:07 +01:00
|
|
|
}
|
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
type SubscribeResponse struct {
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
2019-09-22 15:31:07 +01:00
|
|
|
}
|
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
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}
|
|
|
|
}
|
2019-09-22 15:31:07 +01:00
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
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)
|
2019-09-22 15:31:07 +01:00
|
|
|
}
|
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
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")
|
2020-03-30 23:58:32 +03:00
|
|
|
}
|
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
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,
|
2020-03-30 23:58:32 +03:00
|
|
|
}
|
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
|
|
var _ context.Context
|
|
|
|
var _ grpc.ClientConn
|
2020-03-30 23:58:32 +03:00
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
// 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)
|
2020-03-30 23:58:32 +03:00
|
|
|
}
|
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
type serverClient struct {
|
|
|
|
cc *grpc.ClientConn
|
2020-03-30 23:58:32 +03:00
|
|
|
}
|
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
func NewServerClient(cc *grpc.ClientConn) ServerClient {
|
|
|
|
return &serverClient{cc}
|
2020-03-30 23:58:32 +03:00
|
|
|
}
|
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
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
|
2020-03-30 23:58:32 +03:00
|
|
|
}
|
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
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
|
2020-05-11 14:08:27 +02:00
|
|
|
}
|
2020-05-19 18:17:17 +01:00
|
|
|
return out, nil
|
2020-03-30 23:58:32 +03:00
|
|
|
}
|
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
// ServerServer is the server API for Server service.
|
|
|
|
type ServerServer interface {
|
|
|
|
Handle(context.Context, *HandleRequest) (*HandleResponse, error)
|
|
|
|
Subscribe(context.Context, *SubscribeRequest) (*SubscribeResponse, error)
|
2020-03-30 23:58:32 +03:00
|
|
|
}
|
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
// UnimplementedServerServer can be embedded to have forward compatible implementations.
|
|
|
|
type UnimplementedServerServer struct {
|
|
|
|
}
|
2020-03-30 23:58:32 +03:00
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
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")
|
2020-03-30 23:58:32 +03:00
|
|
|
}
|
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
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)
|
|
|
|
}
|
2020-05-11 14:08:27 +02:00
|
|
|
|
2020-05-19 18:17:17 +01:00
|
|
|
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)
|
2020-03-30 23:58:32 +03:00
|
|
|
}
|
2020-05-19 18:17:17 +01:00
|
|
|
info := &grpc.UnaryServerInfo{
|
|
|
|
Server: srv,
|
|
|
|
FullMethod: "/go.micro.server.Server/Subscribe",
|
2020-03-30 23:58:32 +03:00
|
|
|
}
|
2020-05-19 18:17:17 +01:00
|
|
|
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,
|
2020-03-30 23:58:32 +03:00
|
|
|
},
|
2020-05-19 18:17:17 +01:00
|
|
|
},
|
|
|
|
Streams: []grpc.StreamDesc{},
|
|
|
|
Metadata: "server/proto/server.proto",
|
2019-09-22 15:31:07 +01:00
|
|
|
}
|