github.com/micro/go-micro/examples@v0.0.0-20210105173217-bf4ab679e18b/server/proto/example/example.pb.go (about)

     1  // Code generated by protoc-gen-go. DO NOT EDIT.
     2  // source: github.com/micro/go-micro/examples/server/proto/example/example.proto
     3  
     4  /*
     5  Package go_micro_srv_example is a generated protocol buffer package.
     6  
     7  It is generated from these files:
     8  	github.com/micro/go-micro/examples/server/proto/example/example.proto
     9  
    10  It has these top-level messages:
    11  	Message
    12  	Request
    13  	Response
    14  	StreamingRequest
    15  	StreamingResponse
    16  	Ping
    17  	Pong
    18  */
    19  package go_micro_srv_example
    20  
    21  import proto "github.com/golang/protobuf/proto"
    22  import fmt "fmt"
    23  import math "math"
    24  
    25  import (
    26  	context "golang.org/x/net/context"
    27  	grpc "google.golang.org/grpc"
    28  )
    29  
    30  // Reference imports to suppress errors if they are not otherwise used.
    31  var _ = proto.Marshal
    32  var _ = fmt.Errorf
    33  var _ = math.Inf
    34  
    35  // This is a compile-time assertion to ensure that this generated file
    36  // is compatible with the proto package it is being compiled against.
    37  // A compilation error at this line likely means your copy of the
    38  // proto package needs to be updated.
    39  const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
    40  
    41  type Message struct {
    42  	Say string `protobuf:"bytes,1,opt,name=say" json:"say,omitempty"`
    43  }
    44  
    45  func (m *Message) Reset()                    { *m = Message{} }
    46  func (m *Message) String() string            { return proto.CompactTextString(m) }
    47  func (*Message) ProtoMessage()               {}
    48  func (*Message) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
    49  
    50  func (m *Message) GetSay() string {
    51  	if m != nil {
    52  		return m.Say
    53  	}
    54  	return ""
    55  }
    56  
    57  type Request struct {
    58  	Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
    59  }
    60  
    61  func (m *Request) Reset()                    { *m = Request{} }
    62  func (m *Request) String() string            { return proto.CompactTextString(m) }
    63  func (*Request) ProtoMessage()               {}
    64  func (*Request) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
    65  
    66  func (m *Request) GetName() string {
    67  	if m != nil {
    68  		return m.Name
    69  	}
    70  	return ""
    71  }
    72  
    73  type Response struct {
    74  	Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"`
    75  }
    76  
    77  func (m *Response) Reset()                    { *m = Response{} }
    78  func (m *Response) String() string            { return proto.CompactTextString(m) }
    79  func (*Response) ProtoMessage()               {}
    80  func (*Response) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
    81  
    82  func (m *Response) GetMsg() string {
    83  	if m != nil {
    84  		return m.Msg
    85  	}
    86  	return ""
    87  }
    88  
    89  type StreamingRequest struct {
    90  	Count int64 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"`
    91  }
    92  
    93  func (m *StreamingRequest) Reset()                    { *m = StreamingRequest{} }
    94  func (m *StreamingRequest) String() string            { return proto.CompactTextString(m) }
    95  func (*StreamingRequest) ProtoMessage()               {}
    96  func (*StreamingRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
    97  
    98  func (m *StreamingRequest) GetCount() int64 {
    99  	if m != nil {
   100  		return m.Count
   101  	}
   102  	return 0
   103  }
   104  
   105  type StreamingResponse struct {
   106  	Count int64 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"`
   107  }
   108  
   109  func (m *StreamingResponse) Reset()                    { *m = StreamingResponse{} }
   110  func (m *StreamingResponse) String() string            { return proto.CompactTextString(m) }
   111  func (*StreamingResponse) ProtoMessage()               {}
   112  func (*StreamingResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
   113  
   114  func (m *StreamingResponse) GetCount() int64 {
   115  	if m != nil {
   116  		return m.Count
   117  	}
   118  	return 0
   119  }
   120  
   121  type Ping struct {
   122  	Stroke int64 `protobuf:"varint,1,opt,name=stroke" json:"stroke,omitempty"`
   123  }
   124  
   125  func (m *Ping) Reset()                    { *m = Ping{} }
   126  func (m *Ping) String() string            { return proto.CompactTextString(m) }
   127  func (*Ping) ProtoMessage()               {}
   128  func (*Ping) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
   129  
   130  func (m *Ping) GetStroke() int64 {
   131  	if m != nil {
   132  		return m.Stroke
   133  	}
   134  	return 0
   135  }
   136  
   137  type Pong struct {
   138  	Stroke int64 `protobuf:"varint,1,opt,name=stroke" json:"stroke,omitempty"`
   139  }
   140  
   141  func (m *Pong) Reset()                    { *m = Pong{} }
   142  func (m *Pong) String() string            { return proto.CompactTextString(m) }
   143  func (*Pong) ProtoMessage()               {}
   144  func (*Pong) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
   145  
   146  func (m *Pong) GetStroke() int64 {
   147  	if m != nil {
   148  		return m.Stroke
   149  	}
   150  	return 0
   151  }
   152  
   153  func init() {
   154  	proto.RegisterType((*Message)(nil), "go.micro.srv.example.Message")
   155  	proto.RegisterType((*Request)(nil), "go.micro.srv.example.Request")
   156  	proto.RegisterType((*Response)(nil), "go.micro.srv.example.Response")
   157  	proto.RegisterType((*StreamingRequest)(nil), "go.micro.srv.example.StreamingRequest")
   158  	proto.RegisterType((*StreamingResponse)(nil), "go.micro.srv.example.StreamingResponse")
   159  	proto.RegisterType((*Ping)(nil), "go.micro.srv.example.Ping")
   160  	proto.RegisterType((*Pong)(nil), "go.micro.srv.example.Pong")
   161  }
   162  
   163  // Reference imports to suppress errors if they are not otherwise used.
   164  var _ context.Context
   165  var _ grpc.ClientConn
   166  
   167  // This is a compile-time assertion to ensure that this generated file
   168  // is compatible with the grpc package it is being compiled against.
   169  const _ = grpc.SupportPackageIsVersion4
   170  
   171  // Client API for Example service
   172  
   173  type ExampleClient interface {
   174  	Call(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
   175  	Stream(ctx context.Context, in *StreamingRequest, opts ...grpc.CallOption) (Example_StreamClient, error)
   176  	PingPong(ctx context.Context, opts ...grpc.CallOption) (Example_PingPongClient, error)
   177  }
   178  
   179  type exampleClient struct {
   180  	cc *grpc.ClientConn
   181  }
   182  
   183  func NewExampleClient(cc *grpc.ClientConn) ExampleClient {
   184  	return &exampleClient{cc}
   185  }
   186  
   187  func (c *exampleClient) Call(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
   188  	out := new(Response)
   189  	err := grpc.Invoke(ctx, "/go.micro.srv.example.Example/Call", in, out, c.cc, opts...)
   190  	if err != nil {
   191  		return nil, err
   192  	}
   193  	return out, nil
   194  }
   195  
   196  func (c *exampleClient) Stream(ctx context.Context, in *StreamingRequest, opts ...grpc.CallOption) (Example_StreamClient, error) {
   197  	stream, err := grpc.NewClientStream(ctx, &_Example_serviceDesc.Streams[0], c.cc, "/go.micro.srv.example.Example/Stream", opts...)
   198  	if err != nil {
   199  		return nil, err
   200  	}
   201  	x := &exampleStreamClient{stream}
   202  	if err := x.ClientStream.SendMsg(in); err != nil {
   203  		return nil, err
   204  	}
   205  	if err := x.ClientStream.CloseSend(); err != nil {
   206  		return nil, err
   207  	}
   208  	return x, nil
   209  }
   210  
   211  type Example_StreamClient interface {
   212  	Recv() (*StreamingResponse, error)
   213  	grpc.ClientStream
   214  }
   215  
   216  type exampleStreamClient struct {
   217  	grpc.ClientStream
   218  }
   219  
   220  func (x *exampleStreamClient) Recv() (*StreamingResponse, error) {
   221  	m := new(StreamingResponse)
   222  	if err := x.ClientStream.RecvMsg(m); err != nil {
   223  		return nil, err
   224  	}
   225  	return m, nil
   226  }
   227  
   228  func (c *exampleClient) PingPong(ctx context.Context, opts ...grpc.CallOption) (Example_PingPongClient, error) {
   229  	stream, err := grpc.NewClientStream(ctx, &_Example_serviceDesc.Streams[1], c.cc, "/go.micro.srv.example.Example/PingPong", opts...)
   230  	if err != nil {
   231  		return nil, err
   232  	}
   233  	x := &examplePingPongClient{stream}
   234  	return x, nil
   235  }
   236  
   237  type Example_PingPongClient interface {
   238  	Send(*Ping) error
   239  	Recv() (*Pong, error)
   240  	grpc.ClientStream
   241  }
   242  
   243  type examplePingPongClient struct {
   244  	grpc.ClientStream
   245  }
   246  
   247  func (x *examplePingPongClient) Send(m *Ping) error {
   248  	return x.ClientStream.SendMsg(m)
   249  }
   250  
   251  func (x *examplePingPongClient) Recv() (*Pong, error) {
   252  	m := new(Pong)
   253  	if err := x.ClientStream.RecvMsg(m); err != nil {
   254  		return nil, err
   255  	}
   256  	return m, nil
   257  }
   258  
   259  // Server API for Example service
   260  
   261  type ExampleServer interface {
   262  	Call(context.Context, *Request) (*Response, error)
   263  	Stream(*StreamingRequest, Example_StreamServer) error
   264  	PingPong(Example_PingPongServer) error
   265  }
   266  
   267  func RegisterExampleServer(s *grpc.Server, srv ExampleServer) {
   268  	s.RegisterService(&_Example_serviceDesc, srv)
   269  }
   270  
   271  func _Example_Call_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   272  	in := new(Request)
   273  	if err := dec(in); err != nil {
   274  		return nil, err
   275  	}
   276  	if interceptor == nil {
   277  		return srv.(ExampleServer).Call(ctx, in)
   278  	}
   279  	info := &grpc.UnaryServerInfo{
   280  		Server:     srv,
   281  		FullMethod: "/go.micro.srv.example.Example/Call",
   282  	}
   283  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   284  		return srv.(ExampleServer).Call(ctx, req.(*Request))
   285  	}
   286  	return interceptor(ctx, in, info, handler)
   287  }
   288  
   289  func _Example_Stream_Handler(srv interface{}, stream grpc.ServerStream) error {
   290  	m := new(StreamingRequest)
   291  	if err := stream.RecvMsg(m); err != nil {
   292  		return err
   293  	}
   294  	return srv.(ExampleServer).Stream(m, &exampleStreamServer{stream})
   295  }
   296  
   297  type Example_StreamServer interface {
   298  	Send(*StreamingResponse) error
   299  	grpc.ServerStream
   300  }
   301  
   302  type exampleStreamServer struct {
   303  	grpc.ServerStream
   304  }
   305  
   306  func (x *exampleStreamServer) Send(m *StreamingResponse) error {
   307  	return x.ServerStream.SendMsg(m)
   308  }
   309  
   310  func _Example_PingPong_Handler(srv interface{}, stream grpc.ServerStream) error {
   311  	return srv.(ExampleServer).PingPong(&examplePingPongServer{stream})
   312  }
   313  
   314  type Example_PingPongServer interface {
   315  	Send(*Pong) error
   316  	Recv() (*Ping, error)
   317  	grpc.ServerStream
   318  }
   319  
   320  type examplePingPongServer struct {
   321  	grpc.ServerStream
   322  }
   323  
   324  func (x *examplePingPongServer) Send(m *Pong) error {
   325  	return x.ServerStream.SendMsg(m)
   326  }
   327  
   328  func (x *examplePingPongServer) Recv() (*Ping, error) {
   329  	m := new(Ping)
   330  	if err := x.ServerStream.RecvMsg(m); err != nil {
   331  		return nil, err
   332  	}
   333  	return m, nil
   334  }
   335  
   336  var _Example_serviceDesc = grpc.ServiceDesc{
   337  	ServiceName: "go.micro.srv.example.Example",
   338  	HandlerType: (*ExampleServer)(nil),
   339  	Methods: []grpc.MethodDesc{
   340  		{
   341  			MethodName: "Call",
   342  			Handler:    _Example_Call_Handler,
   343  		},
   344  	},
   345  	Streams: []grpc.StreamDesc{
   346  		{
   347  			StreamName:    "Stream",
   348  			Handler:       _Example_Stream_Handler,
   349  			ServerStreams: true,
   350  		},
   351  		{
   352  			StreamName:    "PingPong",
   353  			Handler:       _Example_PingPong_Handler,
   354  			ServerStreams: true,
   355  			ClientStreams: true,
   356  		},
   357  	},
   358  	Metadata: "github.com/micro/go-micro/examples/server/proto/example/example.proto",
   359  }
   360  
   361  func init() {
   362  	proto.RegisterFile("github.com/micro/go-micro/examples/server/proto/example/example.proto", fileDescriptor0)
   363  }
   364  
   365  var fileDescriptor0 = []byte{
   366  	// 291 bytes of a gzipped FileDescriptorProto
   367  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xc1, 0x4b, 0x2b, 0x31,
   368  	0x10, 0xc6, 0x1b, 0xda, 0xd7, 0xf6, 0xcd, 0xa9, 0x86, 0x22, 0xb2, 0xda, 0x22, 0x39, 0x68, 0xbd,
   369  	0x64, 0x8b, 0x5e, 0xbd, 0x89, 0xe8, 0x45, 0x90, 0xf5, 0xec, 0x21, 0x2d, 0x43, 0x5c, 0x6c, 0x92,
   370  	0x9a, 0x49, 0x8b, 0xfe, 0xed, 0x5e, 0x64, 0xb3, 0x59, 0x11, 0xd9, 0xc5, 0x53, 0x66, 0xe6, 0xf7,
   371  	0x7d, 0xc3, 0xcc, 0x10, 0xb8, 0xd6, 0x65, 0x78, 0xd9, 0xad, 0xe4, 0xda, 0x99, 0xdc, 0x94, 0x6b,
   372  	0xef, 0x72, 0x7c, 0x57, 0x66, 0xbb, 0x41, 0xca, 0x09, 0xfd, 0x1e, 0x7d, 0xbe, 0xf5, 0x2e, 0x7c,
   373  	0x57, 0x9b, 0x57, 0xc6, 0x2a, 0x9f, 0x6a, 0x27, 0xa3, 0x4b, 0x92, 0xdf, 0xcb, 0xc4, 0xc4, 0x31,
   374  	0x8c, 0x1e, 0x90, 0x48, 0x69, 0xe4, 0x13, 0xe8, 0x93, 0xfa, 0x38, 0x62, 0xa7, 0x6c, 0xf1, 0xbf,
   375  	0xa8, 0x42, 0x31, 0x83, 0x51, 0x81, 0x6f, 0x3b, 0xa4, 0xc0, 0x39, 0x0c, 0xac, 0x32, 0x98, 0x68,
   376  	0x8c, 0xc5, 0x09, 0x8c, 0x0b, 0xa4, 0xad, 0xb3, 0x14, 0xcd, 0x86, 0x74, 0x63, 0x36, 0xa4, 0xc5,
   377  	0x02, 0x26, 0x4f, 0xc1, 0xa3, 0x32, 0xa5, 0xd5, 0x4d, 0x97, 0x29, 0xfc, 0x5b, 0xbb, 0x9d, 0x0d,
   378  	0x51, 0xd7, 0x2f, 0xea, 0x44, 0x5c, 0xc0, 0xc1, 0x0f, 0x65, 0x6a, 0xd8, 0x2e, 0x9d, 0xc3, 0xe0,
   379  	0xb1, 0xb4, 0x9a, 0x1f, 0xc2, 0x90, 0x82, 0x77, 0xaf, 0x98, 0x70, 0xca, 0x22, 0x77, 0xdd, 0xfc,
   380  	0xf2, 0x93, 0xc1, 0xe8, 0xb6, 0x5e, 0x9d, 0xdf, 0xc1, 0xe0, 0x46, 0x6d, 0x36, 0x7c, 0x26, 0xdb,
   381  	0x2e, 0x23, 0xd3, 0xcc, 0xd9, 0xbc, 0x0b, 0xd7, 0x83, 0x8a, 0x1e, 0x7f, 0x86, 0x61, 0x3d, 0x3f,
   382  	0x3f, 0x6b, 0xd7, 0xfe, 0xbe, 0x43, 0x76, 0xfe, 0xa7, 0xae, 0x69, 0xbe, 0x64, 0xfc, 0x1e, 0xc6,
   383  	0xd5, 0xce, 0x71, 0xaf, 0xac, 0xdd, 0x58, 0xf1, 0xac, 0x8b, 0x39, 0xab, 0x45, 0x6f, 0xc1, 0x96,
   384  	0x6c, 0x35, 0x8c, 0x3f, 0xe1, 0xea, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x5e, 0x6d, 0x30, 0x6b, 0x49,
   385  	0x02, 0x00, 0x00,
   386  }