github.com/micro/go-micro/v2@v2.9.1/client/service/proto/client.pb.go (about)

     1  // Code generated by protoc-gen-go. DO NOT EDIT.
     2  // source: client/service/proto/client.proto
     3  
     4  package go_micro_client
     5  
     6  import (
     7  	context "context"
     8  	fmt "fmt"
     9  	proto "github.com/golang/protobuf/proto"
    10  	grpc "google.golang.org/grpc"
    11  	codes "google.golang.org/grpc/codes"
    12  	status "google.golang.org/grpc/status"
    13  	math "math"
    14  )
    15  
    16  // Reference imports to suppress errors if they are not otherwise used.
    17  var _ = proto.Marshal
    18  var _ = fmt.Errorf
    19  var _ = math.Inf
    20  
    21  // This is a compile-time assertion to ensure that this generated file
    22  // is compatible with the proto package it is being compiled against.
    23  // A compilation error at this line likely means your copy of the
    24  // proto package needs to be updated.
    25  const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
    26  
    27  type Request struct {
    28  	Service              string   `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
    29  	Endpoint             string   `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
    30  	ContentType          string   `protobuf:"bytes,3,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
    31  	Body                 []byte   `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"`
    32  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
    33  	XXX_unrecognized     []byte   `json:"-"`
    34  	XXX_sizecache        int32    `json:"-"`
    35  }
    36  
    37  func (m *Request) Reset()         { *m = Request{} }
    38  func (m *Request) String() string { return proto.CompactTextString(m) }
    39  func (*Request) ProtoMessage()    {}
    40  func (*Request) Descriptor() ([]byte, []int) {
    41  	return fileDescriptor_27c3d425ddd1a066, []int{0}
    42  }
    43  
    44  func (m *Request) XXX_Unmarshal(b []byte) error {
    45  	return xxx_messageInfo_Request.Unmarshal(m, b)
    46  }
    47  func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    48  	return xxx_messageInfo_Request.Marshal(b, m, deterministic)
    49  }
    50  func (m *Request) XXX_Merge(src proto.Message) {
    51  	xxx_messageInfo_Request.Merge(m, src)
    52  }
    53  func (m *Request) XXX_Size() int {
    54  	return xxx_messageInfo_Request.Size(m)
    55  }
    56  func (m *Request) XXX_DiscardUnknown() {
    57  	xxx_messageInfo_Request.DiscardUnknown(m)
    58  }
    59  
    60  var xxx_messageInfo_Request proto.InternalMessageInfo
    61  
    62  func (m *Request) GetService() string {
    63  	if m != nil {
    64  		return m.Service
    65  	}
    66  	return ""
    67  }
    68  
    69  func (m *Request) GetEndpoint() string {
    70  	if m != nil {
    71  		return m.Endpoint
    72  	}
    73  	return ""
    74  }
    75  
    76  func (m *Request) GetContentType() string {
    77  	if m != nil {
    78  		return m.ContentType
    79  	}
    80  	return ""
    81  }
    82  
    83  func (m *Request) GetBody() []byte {
    84  	if m != nil {
    85  		return m.Body
    86  	}
    87  	return nil
    88  }
    89  
    90  type Response struct {
    91  	Body                 []byte   `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
    92  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
    93  	XXX_unrecognized     []byte   `json:"-"`
    94  	XXX_sizecache        int32    `json:"-"`
    95  }
    96  
    97  func (m *Response) Reset()         { *m = Response{} }
    98  func (m *Response) String() string { return proto.CompactTextString(m) }
    99  func (*Response) ProtoMessage()    {}
   100  func (*Response) Descriptor() ([]byte, []int) {
   101  	return fileDescriptor_27c3d425ddd1a066, []int{1}
   102  }
   103  
   104  func (m *Response) XXX_Unmarshal(b []byte) error {
   105  	return xxx_messageInfo_Response.Unmarshal(m, b)
   106  }
   107  func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   108  	return xxx_messageInfo_Response.Marshal(b, m, deterministic)
   109  }
   110  func (m *Response) XXX_Merge(src proto.Message) {
   111  	xxx_messageInfo_Response.Merge(m, src)
   112  }
   113  func (m *Response) XXX_Size() int {
   114  	return xxx_messageInfo_Response.Size(m)
   115  }
   116  func (m *Response) XXX_DiscardUnknown() {
   117  	xxx_messageInfo_Response.DiscardUnknown(m)
   118  }
   119  
   120  var xxx_messageInfo_Response proto.InternalMessageInfo
   121  
   122  func (m *Response) GetBody() []byte {
   123  	if m != nil {
   124  		return m.Body
   125  	}
   126  	return nil
   127  }
   128  
   129  type Message struct {
   130  	Topic                string   `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
   131  	ContentType          string   `protobuf:"bytes,2,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
   132  	Body                 []byte   `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
   133  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
   134  	XXX_unrecognized     []byte   `json:"-"`
   135  	XXX_sizecache        int32    `json:"-"`
   136  }
   137  
   138  func (m *Message) Reset()         { *m = Message{} }
   139  func (m *Message) String() string { return proto.CompactTextString(m) }
   140  func (*Message) ProtoMessage()    {}
   141  func (*Message) Descriptor() ([]byte, []int) {
   142  	return fileDescriptor_27c3d425ddd1a066, []int{2}
   143  }
   144  
   145  func (m *Message) XXX_Unmarshal(b []byte) error {
   146  	return xxx_messageInfo_Message.Unmarshal(m, b)
   147  }
   148  func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   149  	return xxx_messageInfo_Message.Marshal(b, m, deterministic)
   150  }
   151  func (m *Message) XXX_Merge(src proto.Message) {
   152  	xxx_messageInfo_Message.Merge(m, src)
   153  }
   154  func (m *Message) XXX_Size() int {
   155  	return xxx_messageInfo_Message.Size(m)
   156  }
   157  func (m *Message) XXX_DiscardUnknown() {
   158  	xxx_messageInfo_Message.DiscardUnknown(m)
   159  }
   160  
   161  var xxx_messageInfo_Message proto.InternalMessageInfo
   162  
   163  func (m *Message) GetTopic() string {
   164  	if m != nil {
   165  		return m.Topic
   166  	}
   167  	return ""
   168  }
   169  
   170  func (m *Message) GetContentType() string {
   171  	if m != nil {
   172  		return m.ContentType
   173  	}
   174  	return ""
   175  }
   176  
   177  func (m *Message) GetBody() []byte {
   178  	if m != nil {
   179  		return m.Body
   180  	}
   181  	return nil
   182  }
   183  
   184  func init() {
   185  	proto.RegisterType((*Request)(nil), "go.micro.client.Request")
   186  	proto.RegisterType((*Response)(nil), "go.micro.client.Response")
   187  	proto.RegisterType((*Message)(nil), "go.micro.client.Message")
   188  }
   189  
   190  func init() { proto.RegisterFile("client/service/proto/client.proto", fileDescriptor_27c3d425ddd1a066) }
   191  
   192  var fileDescriptor_27c3d425ddd1a066 = []byte{
   193  	// 267 bytes of a gzipped FileDescriptorProto
   194  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x91, 0xc1, 0x4b, 0xc3, 0x30,
   195  	0x14, 0xc6, 0x97, 0x6d, 0xb6, 0xf3, 0x39, 0x10, 0x1e, 0x1e, 0x62, 0x0f, 0xb2, 0xf5, 0xd4, 0x53,
   196  	0x2b, 0x7a, 0x16, 0x0f, 0x3d, 0x0b, 0x52, 0xc5, 0xab, 0xb4, 0xd9, 0x63, 0x06, 0xba, 0x24, 0x36,
   197  	0xd9, 0xa0, 0x7f, 0xa4, 0xff, 0x93, 0x90, 0x46, 0x27, 0xba, 0x5d, 0xbc, 0xe5, 0xfb, 0x7e, 0xe4,
   198  	0x7b, 0x2f, 0x5f, 0x60, 0x29, 0x5a, 0x49, 0xca, 0x15, 0x96, 0xba, 0x9d, 0x14, 0x54, 0x98, 0x4e,
   199  	0x3b, 0x5d, 0x0c, 0x66, 0xee, 0x05, 0x9e, 0xaf, 0x75, 0xbe, 0x91, 0xa2, 0xd3, 0xf9, 0x60, 0xa7,
   200  	0x3b, 0x88, 0x2b, 0x7a, 0xdf, 0x92, 0x75, 0xc8, 0x21, 0x0e, 0x37, 0x39, 0x5b, 0xb0, 0xec, 0xb4,
   201  	0xfa, 0x92, 0x98, 0xc0, 0x8c, 0xd4, 0xca, 0x68, 0xa9, 0x1c, 0x1f, 0x7b, 0xf4, 0xad, 0x71, 0x09,
   202  	0x73, 0xa1, 0x95, 0x23, 0xe5, 0x5e, 0x5d, 0x6f, 0x88, 0x4f, 0x3c, 0x3f, 0x0b, 0xde, 0x73, 0x6f,
   203  	0x08, 0x11, 0xa6, 0x8d, 0x5e, 0xf5, 0x7c, 0xba, 0x60, 0xd9, 0xbc, 0xf2, 0xe7, 0xf4, 0x0a, 0x66,
   204  	0x15, 0x59, 0xa3, 0x95, 0xdd, 0x73, 0xf6, 0x83, 0xbf, 0x40, 0xfc, 0x40, 0xd6, 0xd6, 0x6b, 0xc2,
   205  	0x0b, 0x38, 0x71, 0xda, 0x48, 0x11, 0xb6, 0x1a, 0xc4, 0x9f, 0xb9, 0xe3, 0xe3, 0x73, 0x27, 0xfb,
   206  	0xdc, 0x9b, 0x0f, 0x06, 0x51, 0xe9, 0x9f, 0x8e, 0x77, 0x30, 0x2d, 0xeb, 0xb6, 0x45, 0x9e, 0xff,
   207  	0x2a, 0x25, 0x0f, 0x8d, 0x24, 0x97, 0x07, 0xc8, 0xb0, 0x73, 0x3a, 0xc2, 0x12, 0xa2, 0x27, 0xd7,
   208  	0x51, 0xbd, 0xf9, 0x67, 0x40, 0xc6, 0xae, 0x19, 0xde, 0x43, 0xfc, 0xb8, 0x6d, 0x5a, 0x69, 0xdf,
   209  	0x0e, 0xa4, 0x84, 0x02, 0x92, 0xa3, 0x24, 0x1d, 0x35, 0x91, 0xff, 0xd7, 0xdb, 0xcf, 0x00, 0x00,
   210  	0x00, 0xff, 0xff, 0xd6, 0x3f, 0xc3, 0xa1, 0xfc, 0x01, 0x00, 0x00,
   211  }
   212  
   213  // Reference imports to suppress errors if they are not otherwise used.
   214  var _ context.Context
   215  var _ grpc.ClientConn
   216  
   217  // This is a compile-time assertion to ensure that this generated file
   218  // is compatible with the grpc package it is being compiled against.
   219  const _ = grpc.SupportPackageIsVersion4
   220  
   221  // ClientClient is the client API for Client service.
   222  //
   223  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
   224  type ClientClient interface {
   225  	// Call allows a single request to be made
   226  	Call(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
   227  	// Stream is a bidirectional stream
   228  	Stream(ctx context.Context, opts ...grpc.CallOption) (Client_StreamClient, error)
   229  	// Publish publishes a message and returns an empty Message
   230  	Publish(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)
   231  }
   232  
   233  type clientClient struct {
   234  	cc *grpc.ClientConn
   235  }
   236  
   237  func NewClientClient(cc *grpc.ClientConn) ClientClient {
   238  	return &clientClient{cc}
   239  }
   240  
   241  func (c *clientClient) Call(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
   242  	out := new(Response)
   243  	err := c.cc.Invoke(ctx, "/go.micro.client.Client/Call", in, out, opts...)
   244  	if err != nil {
   245  		return nil, err
   246  	}
   247  	return out, nil
   248  }
   249  
   250  func (c *clientClient) Stream(ctx context.Context, opts ...grpc.CallOption) (Client_StreamClient, error) {
   251  	stream, err := c.cc.NewStream(ctx, &_Client_serviceDesc.Streams[0], "/go.micro.client.Client/Stream", opts...)
   252  	if err != nil {
   253  		return nil, err
   254  	}
   255  	x := &clientStreamClient{stream}
   256  	return x, nil
   257  }
   258  
   259  type Client_StreamClient interface {
   260  	Send(*Request) error
   261  	Recv() (*Response, error)
   262  	grpc.ClientStream
   263  }
   264  
   265  type clientStreamClient struct {
   266  	grpc.ClientStream
   267  }
   268  
   269  func (x *clientStreamClient) Send(m *Request) error {
   270  	return x.ClientStream.SendMsg(m)
   271  }
   272  
   273  func (x *clientStreamClient) Recv() (*Response, error) {
   274  	m := new(Response)
   275  	if err := x.ClientStream.RecvMsg(m); err != nil {
   276  		return nil, err
   277  	}
   278  	return m, nil
   279  }
   280  
   281  func (c *clientClient) Publish(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) {
   282  	out := new(Message)
   283  	err := c.cc.Invoke(ctx, "/go.micro.client.Client/Publish", in, out, opts...)
   284  	if err != nil {
   285  		return nil, err
   286  	}
   287  	return out, nil
   288  }
   289  
   290  // ClientServer is the server API for Client service.
   291  type ClientServer interface {
   292  	// Call allows a single request to be made
   293  	Call(context.Context, *Request) (*Response, error)
   294  	// Stream is a bidirectional stream
   295  	Stream(Client_StreamServer) error
   296  	// Publish publishes a message and returns an empty Message
   297  	Publish(context.Context, *Message) (*Message, error)
   298  }
   299  
   300  // UnimplementedClientServer can be embedded to have forward compatible implementations.
   301  type UnimplementedClientServer struct {
   302  }
   303  
   304  func (*UnimplementedClientServer) Call(ctx context.Context, req *Request) (*Response, error) {
   305  	return nil, status.Errorf(codes.Unimplemented, "method Call not implemented")
   306  }
   307  func (*UnimplementedClientServer) Stream(srv Client_StreamServer) error {
   308  	return status.Errorf(codes.Unimplemented, "method Stream not implemented")
   309  }
   310  func (*UnimplementedClientServer) Publish(ctx context.Context, req *Message) (*Message, error) {
   311  	return nil, status.Errorf(codes.Unimplemented, "method Publish not implemented")
   312  }
   313  
   314  func RegisterClientServer(s *grpc.Server, srv ClientServer) {
   315  	s.RegisterService(&_Client_serviceDesc, srv)
   316  }
   317  
   318  func _Client_Call_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   319  	in := new(Request)
   320  	if err := dec(in); err != nil {
   321  		return nil, err
   322  	}
   323  	if interceptor == nil {
   324  		return srv.(ClientServer).Call(ctx, in)
   325  	}
   326  	info := &grpc.UnaryServerInfo{
   327  		Server:     srv,
   328  		FullMethod: "/go.micro.client.Client/Call",
   329  	}
   330  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   331  		return srv.(ClientServer).Call(ctx, req.(*Request))
   332  	}
   333  	return interceptor(ctx, in, info, handler)
   334  }
   335  
   336  func _Client_Stream_Handler(srv interface{}, stream grpc.ServerStream) error {
   337  	return srv.(ClientServer).Stream(&clientStreamServer{stream})
   338  }
   339  
   340  type Client_StreamServer interface {
   341  	Send(*Response) error
   342  	Recv() (*Request, error)
   343  	grpc.ServerStream
   344  }
   345  
   346  type clientStreamServer struct {
   347  	grpc.ServerStream
   348  }
   349  
   350  func (x *clientStreamServer) Send(m *Response) error {
   351  	return x.ServerStream.SendMsg(m)
   352  }
   353  
   354  func (x *clientStreamServer) Recv() (*Request, error) {
   355  	m := new(Request)
   356  	if err := x.ServerStream.RecvMsg(m); err != nil {
   357  		return nil, err
   358  	}
   359  	return m, nil
   360  }
   361  
   362  func _Client_Publish_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   363  	in := new(Message)
   364  	if err := dec(in); err != nil {
   365  		return nil, err
   366  	}
   367  	if interceptor == nil {
   368  		return srv.(ClientServer).Publish(ctx, in)
   369  	}
   370  	info := &grpc.UnaryServerInfo{
   371  		Server:     srv,
   372  		FullMethod: "/go.micro.client.Client/Publish",
   373  	}
   374  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   375  		return srv.(ClientServer).Publish(ctx, req.(*Message))
   376  	}
   377  	return interceptor(ctx, in, info, handler)
   378  }
   379  
   380  var _Client_serviceDesc = grpc.ServiceDesc{
   381  	ServiceName: "go.micro.client.Client",
   382  	HandlerType: (*ClientServer)(nil),
   383  	Methods: []grpc.MethodDesc{
   384  		{
   385  			MethodName: "Call",
   386  			Handler:    _Client_Call_Handler,
   387  		},
   388  		{
   389  			MethodName: "Publish",
   390  			Handler:    _Client_Publish_Handler,
   391  		},
   392  	},
   393  	Streams: []grpc.StreamDesc{
   394  		{
   395  			StreamName:    "Stream",
   396  			Handler:       _Client_Stream_Handler,
   397  			ServerStreams: true,
   398  			ClientStreams: true,
   399  		},
   400  	},
   401  	Metadata: "client/service/proto/client.proto",
   402  }