1 // Code generated by protoc-gen-go. DO NOT EDIT.
5 Package grpctest is a generated protocol buffer package.
7 It is generated from these files:
10 It has these top-level messages:
22 import proto "github.com/golang/protobuf/proto"
27 context "golang.org/x/net/context"
28 grpc "google.golang.org/grpc"
31 // Reference imports to suppress errors if they are not otherwise used.
36 // This is a compile-time assertion to ensure that this generated file
37 // is compatible with the proto package it is being compiled against.
38 // A compilation error at this line likely means your copy of the
39 // proto package needs to be updated.
40 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
42 type TestRequest struct {
43 Input int32 `protobuf:"varint,1,opt,name=Input" json:"Input,omitempty"`
46 func (m *TestRequest) Reset() { *m = TestRequest{} }
47 func (m *TestRequest) String() string { return proto.CompactTextString(m) }
48 func (*TestRequest) ProtoMessage() {}
49 func (*TestRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
51 func (m *TestRequest) GetInput() int32 {
58 type TestResponse struct {
59 Output int32 `protobuf:"varint,2,opt,name=Output" json:"Output,omitempty"`
62 func (m *TestResponse) Reset() { *m = TestResponse{} }
63 func (m *TestResponse) String() string { return proto.CompactTextString(m) }
64 func (*TestResponse) ProtoMessage() {}
65 func (*TestResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
67 func (m *TestResponse) GetOutput() int32 {
74 type PrintKVRequest struct {
75 Key string `protobuf:"bytes,1,opt,name=Key" json:"Key,omitempty"`
76 // Types that are valid to be assigned to Value:
77 // *PrintKVRequest_ValueString
78 // *PrintKVRequest_ValueInt
79 Value isPrintKVRequest_Value `protobuf_oneof:"Value"`
82 func (m *PrintKVRequest) Reset() { *m = PrintKVRequest{} }
83 func (m *PrintKVRequest) String() string { return proto.CompactTextString(m) }
84 func (*PrintKVRequest) ProtoMessage() {}
85 func (*PrintKVRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
87 type isPrintKVRequest_Value interface{ isPrintKVRequest_Value() }
89 type PrintKVRequest_ValueString struct {
90 ValueString string `protobuf:"bytes,2,opt,name=ValueString,oneof"`
92 type PrintKVRequest_ValueInt struct {
93 ValueInt int32 `protobuf:"varint,3,opt,name=ValueInt,oneof"`
96 func (*PrintKVRequest_ValueString) isPrintKVRequest_Value() {}
97 func (*PrintKVRequest_ValueInt) isPrintKVRequest_Value() {}
99 func (m *PrintKVRequest) GetValue() isPrintKVRequest_Value {
106 func (m *PrintKVRequest) GetKey() string {
113 func (m *PrintKVRequest) GetValueString() string {
114 if x, ok := m.GetValue().(*PrintKVRequest_ValueString); ok {
120 func (m *PrintKVRequest) GetValueInt() int32 {
121 if x, ok := m.GetValue().(*PrintKVRequest_ValueInt); ok {
127 // XXX_OneofFuncs is for the internal use of the proto package.
128 func (*PrintKVRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
129 return _PrintKVRequest_OneofMarshaler, _PrintKVRequest_OneofUnmarshaler, _PrintKVRequest_OneofSizer, []interface{}{
130 (*PrintKVRequest_ValueString)(nil),
131 (*PrintKVRequest_ValueInt)(nil),
135 func _PrintKVRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
136 m := msg.(*PrintKVRequest)
138 switch x := m.Value.(type) {
139 case *PrintKVRequest_ValueString:
140 b.EncodeVarint(2<<3 | proto.WireBytes)
141 b.EncodeStringBytes(x.ValueString)
142 case *PrintKVRequest_ValueInt:
143 b.EncodeVarint(3<<3 | proto.WireVarint)
144 b.EncodeVarint(uint64(x.ValueInt))
147 return fmt.Errorf("PrintKVRequest.Value has unexpected type %T", x)
152 func _PrintKVRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
153 m := msg.(*PrintKVRequest)
155 case 2: // Value.ValueString
156 if wire != proto.WireBytes {
157 return true, proto.ErrInternalBadWireType
159 x, err := b.DecodeStringBytes()
160 m.Value = &PrintKVRequest_ValueString{x}
162 case 3: // Value.ValueInt
163 if wire != proto.WireVarint {
164 return true, proto.ErrInternalBadWireType
166 x, err := b.DecodeVarint()
167 m.Value = &PrintKVRequest_ValueInt{int32(x)}
174 func _PrintKVRequest_OneofSizer(msg proto.Message) (n int) {
175 m := msg.(*PrintKVRequest)
177 switch x := m.Value.(type) {
178 case *PrintKVRequest_ValueString:
179 n += proto.SizeVarint(2<<3 | proto.WireBytes)
180 n += proto.SizeVarint(uint64(len(x.ValueString)))
181 n += len(x.ValueString)
182 case *PrintKVRequest_ValueInt:
183 n += proto.SizeVarint(3<<3 | proto.WireVarint)
184 n += proto.SizeVarint(uint64(x.ValueInt))
187 panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
192 type PrintKVResponse struct {
195 func (m *PrintKVResponse) Reset() { *m = PrintKVResponse{} }
196 func (m *PrintKVResponse) String() string { return proto.CompactTextString(m) }
197 func (*PrintKVResponse) ProtoMessage() {}
198 func (*PrintKVResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
200 type BidirectionalRequest struct {
201 Id uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
204 func (m *BidirectionalRequest) Reset() { *m = BidirectionalRequest{} }
205 func (m *BidirectionalRequest) String() string { return proto.CompactTextString(m) }
206 func (*BidirectionalRequest) ProtoMessage() {}
207 func (*BidirectionalRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
209 func (m *BidirectionalRequest) GetId() uint32 {
216 type BidirectionalResponse struct {
217 Id uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
220 func (m *BidirectionalResponse) Reset() { *m = BidirectionalResponse{} }
221 func (m *BidirectionalResponse) String() string { return proto.CompactTextString(m) }
222 func (*BidirectionalResponse) ProtoMessage() {}
223 func (*BidirectionalResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
225 func (m *BidirectionalResponse) GetId() uint32 {
232 type PingRequest struct {
235 func (m *PingRequest) Reset() { *m = PingRequest{} }
236 func (m *PingRequest) String() string { return proto.CompactTextString(m) }
237 func (*PingRequest) ProtoMessage() {}
238 func (*PingRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
240 type PongResponse struct {
241 Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"`
244 func (m *PongResponse) Reset() { *m = PongResponse{} }
245 func (m *PongResponse) String() string { return proto.CompactTextString(m) }
246 func (*PongResponse) ProtoMessage() {}
247 func (*PongResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
249 func (m *PongResponse) GetMsg() string {
257 proto.RegisterType((*TestRequest)(nil), "grpctest.TestRequest")
258 proto.RegisterType((*TestResponse)(nil), "grpctest.TestResponse")
259 proto.RegisterType((*PrintKVRequest)(nil), "grpctest.PrintKVRequest")
260 proto.RegisterType((*PrintKVResponse)(nil), "grpctest.PrintKVResponse")
261 proto.RegisterType((*BidirectionalRequest)(nil), "grpctest.BidirectionalRequest")
262 proto.RegisterType((*BidirectionalResponse)(nil), "grpctest.BidirectionalResponse")
263 proto.RegisterType((*PingRequest)(nil), "grpctest.PingRequest")
264 proto.RegisterType((*PongResponse)(nil), "grpctest.PongResponse")
267 // Reference imports to suppress errors if they are not otherwise used.
268 var _ context.Context
269 var _ grpc.ClientConn
271 // This is a compile-time assertion to ensure that this generated file
272 // is compatible with the grpc package it is being compiled against.
273 const _ = grpc.SupportPackageIsVersion4
275 // Client API for Test service
277 type TestClient interface {
278 Double(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestResponse, error)
279 PrintKV(ctx context.Context, in *PrintKVRequest, opts ...grpc.CallOption) (*PrintKVResponse, error)
280 Bidirectional(ctx context.Context, in *BidirectionalRequest, opts ...grpc.CallOption) (*BidirectionalResponse, error)
281 Stream(ctx context.Context, opts ...grpc.CallOption) (Test_StreamClient, error)
284 type testClient struct {
288 func NewTestClient(cc *grpc.ClientConn) TestClient {
289 return &testClient{cc}
292 func (c *testClient) Double(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestResponse, error) {
293 out := new(TestResponse)
294 err := grpc.Invoke(ctx, "/grpctest.Test/Double", in, out, c.cc, opts...)
301 func (c *testClient) PrintKV(ctx context.Context, in *PrintKVRequest, opts ...grpc.CallOption) (*PrintKVResponse, error) {
302 out := new(PrintKVResponse)
303 err := grpc.Invoke(ctx, "/grpctest.Test/PrintKV", in, out, c.cc, opts...)
310 func (c *testClient) Bidirectional(ctx context.Context, in *BidirectionalRequest, opts ...grpc.CallOption) (*BidirectionalResponse, error) {
311 out := new(BidirectionalResponse)
312 err := grpc.Invoke(ctx, "/grpctest.Test/Bidirectional", in, out, c.cc, opts...)
319 func (c *testClient) Stream(ctx context.Context, opts ...grpc.CallOption) (Test_StreamClient, error) {
320 stream, err := grpc.NewClientStream(ctx, &_Test_serviceDesc.Streams[0], c.cc, "/grpctest.Test/Stream", opts...)
324 x := &testStreamClient{stream}
328 type Test_StreamClient interface {
329 Send(*TestRequest) error
330 Recv() (*TestResponse, error)
334 type testStreamClient struct {
338 func (x *testStreamClient) Send(m *TestRequest) error {
339 return x.ClientStream.SendMsg(m)
342 func (x *testStreamClient) Recv() (*TestResponse, error) {
343 m := new(TestResponse)
344 if err := x.ClientStream.RecvMsg(m); err != nil {
350 // Server API for Test service
352 type TestServer interface {
353 Double(context.Context, *TestRequest) (*TestResponse, error)
354 PrintKV(context.Context, *PrintKVRequest) (*PrintKVResponse, error)
355 Bidirectional(context.Context, *BidirectionalRequest) (*BidirectionalResponse, error)
356 Stream(Test_StreamServer) error
359 func RegisterTestServer(s *grpc.Server, srv TestServer) {
360 s.RegisterService(&_Test_serviceDesc, srv)
363 func _Test_Double_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
364 in := new(TestRequest)
365 if err := dec(in); err != nil {
368 if interceptor == nil {
369 return srv.(TestServer).Double(ctx, in)
371 info := &grpc.UnaryServerInfo{
373 FullMethod: "/grpctest.Test/Double",
375 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
376 return srv.(TestServer).Double(ctx, req.(*TestRequest))
378 return interceptor(ctx, in, info, handler)
381 func _Test_PrintKV_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
382 in := new(PrintKVRequest)
383 if err := dec(in); err != nil {
386 if interceptor == nil {
387 return srv.(TestServer).PrintKV(ctx, in)
389 info := &grpc.UnaryServerInfo{
391 FullMethod: "/grpctest.Test/PrintKV",
393 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
394 return srv.(TestServer).PrintKV(ctx, req.(*PrintKVRequest))
396 return interceptor(ctx, in, info, handler)
399 func _Test_Bidirectional_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
400 in := new(BidirectionalRequest)
401 if err := dec(in); err != nil {
404 if interceptor == nil {
405 return srv.(TestServer).Bidirectional(ctx, in)
407 info := &grpc.UnaryServerInfo{
409 FullMethod: "/grpctest.Test/Bidirectional",
411 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
412 return srv.(TestServer).Bidirectional(ctx, req.(*BidirectionalRequest))
414 return interceptor(ctx, in, info, handler)
417 func _Test_Stream_Handler(srv interface{}, stream grpc.ServerStream) error {
418 return srv.(TestServer).Stream(&testStreamServer{stream})
421 type Test_StreamServer interface {
422 Send(*TestResponse) error
423 Recv() (*TestRequest, error)
427 type testStreamServer struct {
431 func (x *testStreamServer) Send(m *TestResponse) error {
432 return x.ServerStream.SendMsg(m)
435 func (x *testStreamServer) Recv() (*TestRequest, error) {
436 m := new(TestRequest)
437 if err := x.ServerStream.RecvMsg(m); err != nil {
443 var _Test_serviceDesc = grpc.ServiceDesc{
444 ServiceName: "grpctest.Test",
445 HandlerType: (*TestServer)(nil),
446 Methods: []grpc.MethodDesc{
448 MethodName: "Double",
449 Handler: _Test_Double_Handler,
452 MethodName: "PrintKV",
453 Handler: _Test_PrintKV_Handler,
456 MethodName: "Bidirectional",
457 Handler: _Test_Bidirectional_Handler,
460 Streams: []grpc.StreamDesc{
462 StreamName: "Stream",
463 Handler: _Test_Stream_Handler,
468 Metadata: "test.proto",
471 // Client API for PingPong service
473 type PingPongClient interface {
474 Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PongResponse, error)
477 type pingPongClient struct {
481 func NewPingPongClient(cc *grpc.ClientConn) PingPongClient {
482 return &pingPongClient{cc}
485 func (c *pingPongClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PongResponse, error) {
486 out := new(PongResponse)
487 err := grpc.Invoke(ctx, "/grpctest.PingPong/Ping", in, out, c.cc, opts...)
494 // Server API for PingPong service
496 type PingPongServer interface {
497 Ping(context.Context, *PingRequest) (*PongResponse, error)
500 func RegisterPingPongServer(s *grpc.Server, srv PingPongServer) {
501 s.RegisterService(&_PingPong_serviceDesc, srv)
504 func _PingPong_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
505 in := new(PingRequest)
506 if err := dec(in); err != nil {
509 if interceptor == nil {
510 return srv.(PingPongServer).Ping(ctx, in)
512 info := &grpc.UnaryServerInfo{
514 FullMethod: "/grpctest.PingPong/Ping",
516 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
517 return srv.(PingPongServer).Ping(ctx, req.(*PingRequest))
519 return interceptor(ctx, in, info, handler)
522 var _PingPong_serviceDesc = grpc.ServiceDesc{
523 ServiceName: "grpctest.PingPong",
524 HandlerType: (*PingPongServer)(nil),
525 Methods: []grpc.MethodDesc{
528 Handler: _PingPong_Ping_Handler,
531 Streams: []grpc.StreamDesc{},
532 Metadata: "test.proto",
535 func init() { proto.RegisterFile("test.proto", fileDescriptor0) }
537 var fileDescriptor0 = []byte{
538 // 355 bytes of a gzipped FileDescriptorProto
539 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xcd, 0x4e, 0xc2, 0x40,
540 0x14, 0x85, 0xdb, 0x02, 0x05, 0x2e, 0x3f, 0xe2, 0x04, 0x08, 0x12, 0xa3, 0x64, 0x4c, 0x90, 0x15,
541 0x31, 0xb8, 0x30, 0x2e, 0x4c, 0x0c, 0xba, 0x80, 0xb0, 0x90, 0x0c, 0x86, 0x3d, 0x3f, 0x93, 0x66,
542 0x12, 0x3a, 0xad, 0x9d, 0xe9, 0xc2, 0x17, 0xf1, 0x79, 0xcd, 0x0c, 0x6d, 0x19, 0x08, 0x2e, 0xdc,
543 0xdd, 0x73, 0x7b, 0x72, 0xe6, 0x9e, 0x2f, 0x05, 0x90, 0x54, 0xc8, 0x61, 0x18, 0x05, 0x32, 0x40,
544 0x25, 0x2f, 0x0a, 0x37, 0x4a, 0xe3, 0x3b, 0xa8, 0x7c, 0x52, 0x21, 0x09, 0xfd, 0x8a, 0xa9, 0x90,
545 0xa8, 0x09, 0x85, 0x29, 0x0f, 0x63, 0xd9, 0xb1, 0x7b, 0xf6, 0xa0, 0x40, 0xf6, 0x02, 0xf7, 0xa1,
546 0xba, 0x37, 0x89, 0x30, 0xe0, 0x82, 0xa2, 0x36, 0xb8, 0x1f, 0xb1, 0x54, 0x36, 0x47, 0xdb, 0x12,
547 0x85, 0x7d, 0xa8, 0xcf, 0x23, 0xc6, 0xe5, 0x6c, 0x99, 0xe6, 0x35, 0x20, 0x37, 0xa3, 0xdf, 0x3a,
548 0xad, 0x4c, 0xd4, 0x88, 0x30, 0x54, 0x96, 0xab, 0x5d, 0x4c, 0x17, 0x32, 0x62, 0xdc, 0xd3, 0x01,
549 0xe5, 0x89, 0x45, 0xcc, 0x25, 0xba, 0x86, 0x92, 0x96, 0x53, 0x2e, 0x3b, 0x39, 0xf5, 0xc2, 0xc4,
550 0x22, 0xd9, 0x66, 0x5c, 0x84, 0x82, 0x9e, 0xf1, 0x25, 0x5c, 0x64, 0xcf, 0xed, 0x2f, 0xc3, 0x7d,
551 0x68, 0x8e, 0xd9, 0x96, 0x45, 0x74, 0x23, 0x59, 0xc0, 0x57, 0xbb, 0xf4, 0x8e, 0x3a, 0x38, 0x6c,
552 0xab, 0xcf, 0xa8, 0x11, 0x87, 0x6d, 0xf1, 0x3d, 0xb4, 0x4e, 0x7c, 0x49, 0xb5, 0x53, 0x63, 0x0d,
553 0x2a, 0x73, 0xc6, 0xbd, 0x24, 0x07, 0xf7, 0xa0, 0x3a, 0x0f, 0x94, 0x4c, 0xec, 0x0d, 0xc8, 0xf9,
554 0xc2, 0x4b, 0xfb, 0xf9, 0xc2, 0x1b, 0xfd, 0x38, 0x90, 0x57, 0xb0, 0xd0, 0x33, 0xb8, 0xef, 0x41,
555 0xbc, 0xde, 0x51, 0xd4, 0x1a, 0xa6, 0xb8, 0x87, 0x06, 0xeb, 0x6e, 0xfb, 0x74, 0x9d, 0x74, 0xb0,
556 0xd0, 0x2b, 0x14, 0x93, 0x62, 0xa8, 0x73, 0x30, 0x1d, 0xa3, 0xed, 0x5e, 0x9d, 0xf9, 0x92, 0x25,
557 0x10, 0xa8, 0x1d, 0xf5, 0x43, 0x37, 0x07, 0xf7, 0x39, 0x40, 0xdd, 0xdb, 0x3f, 0xbf, 0x67, 0x99,
558 0x2f, 0xe0, 0x2e, 0x64, 0x44, 0x57, 0xfe, 0xbf, 0x0b, 0x0d, 0xec, 0x07, 0x7b, 0xf4, 0x06, 0x25,
559 0x45, 0x52, 0xe1, 0x43, 0x4f, 0x90, 0x57, 0xb3, 0x19, 0x64, 0x50, 0x36, 0x83, 0x4c, 0xda, 0xd8,
560 0x5a, 0xbb, 0xfa, 0xff, 0x7d, 0xfc, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x59, 0x20, 0xc7, 0xcd,