+++ /dev/null
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: test.proto
-
-/*
-Package grpctest is a generated protocol buffer package.
-
-It is generated from these files:
- test.proto
-
-It has these top-level messages:
- TestRequest
- TestResponse
- PrintKVRequest
- PrintKVResponse
- BidirectionalRequest
- BidirectionalResponse
- PingRequest
- PongResponse
-*/
-package grpctest
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-import (
- context "golang.org/x/net/context"
- grpc "google.golang.org/grpc"
-)
-
-// 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.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type TestRequest struct {
- Input int32 `protobuf:"varint,1,opt,name=Input" json:"Input,omitempty"`
-}
-
-func (m *TestRequest) Reset() { *m = TestRequest{} }
-func (m *TestRequest) String() string { return proto.CompactTextString(m) }
-func (*TestRequest) ProtoMessage() {}
-func (*TestRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
-
-func (m *TestRequest) GetInput() int32 {
- if m != nil {
- return m.Input
- }
- return 0
-}
-
-type TestResponse struct {
- Output int32 `protobuf:"varint,2,opt,name=Output" json:"Output,omitempty"`
-}
-
-func (m *TestResponse) Reset() { *m = TestResponse{} }
-func (m *TestResponse) String() string { return proto.CompactTextString(m) }
-func (*TestResponse) ProtoMessage() {}
-func (*TestResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
-
-func (m *TestResponse) GetOutput() int32 {
- if m != nil {
- return m.Output
- }
- return 0
-}
-
-type PrintKVRequest struct {
- Key string `protobuf:"bytes,1,opt,name=Key" json:"Key,omitempty"`
- // Types that are valid to be assigned to Value:
- // *PrintKVRequest_ValueString
- // *PrintKVRequest_ValueInt
- Value isPrintKVRequest_Value `protobuf_oneof:"Value"`
-}
-
-func (m *PrintKVRequest) Reset() { *m = PrintKVRequest{} }
-func (m *PrintKVRequest) String() string { return proto.CompactTextString(m) }
-func (*PrintKVRequest) ProtoMessage() {}
-func (*PrintKVRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
-
-type isPrintKVRequest_Value interface{ isPrintKVRequest_Value() }
-
-type PrintKVRequest_ValueString struct {
- ValueString string `protobuf:"bytes,2,opt,name=ValueString,oneof"`
-}
-type PrintKVRequest_ValueInt struct {
- ValueInt int32 `protobuf:"varint,3,opt,name=ValueInt,oneof"`
-}
-
-func (*PrintKVRequest_ValueString) isPrintKVRequest_Value() {}
-func (*PrintKVRequest_ValueInt) isPrintKVRequest_Value() {}
-
-func (m *PrintKVRequest) GetValue() isPrintKVRequest_Value {
- if m != nil {
- return m.Value
- }
- return nil
-}
-
-func (m *PrintKVRequest) GetKey() string {
- if m != nil {
- return m.Key
- }
- return ""
-}
-
-func (m *PrintKVRequest) GetValueString() string {
- if x, ok := m.GetValue().(*PrintKVRequest_ValueString); ok {
- return x.ValueString
- }
- return ""
-}
-
-func (m *PrintKVRequest) GetValueInt() int32 {
- if x, ok := m.GetValue().(*PrintKVRequest_ValueInt); ok {
- return x.ValueInt
- }
- return 0
-}
-
-// XXX_OneofFuncs is for the internal use of the proto package.
-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{}) {
- return _PrintKVRequest_OneofMarshaler, _PrintKVRequest_OneofUnmarshaler, _PrintKVRequest_OneofSizer, []interface{}{
- (*PrintKVRequest_ValueString)(nil),
- (*PrintKVRequest_ValueInt)(nil),
- }
-}
-
-func _PrintKVRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
- m := msg.(*PrintKVRequest)
- // Value
- switch x := m.Value.(type) {
- case *PrintKVRequest_ValueString:
- b.EncodeVarint(2<<3 | proto.WireBytes)
- b.EncodeStringBytes(x.ValueString)
- case *PrintKVRequest_ValueInt:
- b.EncodeVarint(3<<3 | proto.WireVarint)
- b.EncodeVarint(uint64(x.ValueInt))
- case nil:
- default:
- return fmt.Errorf("PrintKVRequest.Value has unexpected type %T", x)
- }
- return nil
-}
-
-func _PrintKVRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
- m := msg.(*PrintKVRequest)
- switch tag {
- case 2: // Value.ValueString
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.Value = &PrintKVRequest_ValueString{x}
- return true, err
- case 3: // Value.ValueInt
- if wire != proto.WireVarint {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeVarint()
- m.Value = &PrintKVRequest_ValueInt{int32(x)}
- return true, err
- default:
- return false, nil
- }
-}
-
-func _PrintKVRequest_OneofSizer(msg proto.Message) (n int) {
- m := msg.(*PrintKVRequest)
- // Value
- switch x := m.Value.(type) {
- case *PrintKVRequest_ValueString:
- n += proto.SizeVarint(2<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(len(x.ValueString)))
- n += len(x.ValueString)
- case *PrintKVRequest_ValueInt:
- n += proto.SizeVarint(3<<3 | proto.WireVarint)
- n += proto.SizeVarint(uint64(x.ValueInt))
- case nil:
- default:
- panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
- }
- return n
-}
-
-type PrintKVResponse struct {
-}
-
-func (m *PrintKVResponse) Reset() { *m = PrintKVResponse{} }
-func (m *PrintKVResponse) String() string { return proto.CompactTextString(m) }
-func (*PrintKVResponse) ProtoMessage() {}
-func (*PrintKVResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
-
-type BidirectionalRequest struct {
- Id uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
-}
-
-func (m *BidirectionalRequest) Reset() { *m = BidirectionalRequest{} }
-func (m *BidirectionalRequest) String() string { return proto.CompactTextString(m) }
-func (*BidirectionalRequest) ProtoMessage() {}
-func (*BidirectionalRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
-
-func (m *BidirectionalRequest) GetId() uint32 {
- if m != nil {
- return m.Id
- }
- return 0
-}
-
-type BidirectionalResponse struct {
- Id uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
-}
-
-func (m *BidirectionalResponse) Reset() { *m = BidirectionalResponse{} }
-func (m *BidirectionalResponse) String() string { return proto.CompactTextString(m) }
-func (*BidirectionalResponse) ProtoMessage() {}
-func (*BidirectionalResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
-
-func (m *BidirectionalResponse) GetId() uint32 {
- if m != nil {
- return m.Id
- }
- return 0
-}
-
-type PingRequest struct {
-}
-
-func (m *PingRequest) Reset() { *m = PingRequest{} }
-func (m *PingRequest) String() string { return proto.CompactTextString(m) }
-func (*PingRequest) ProtoMessage() {}
-func (*PingRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
-
-type PongResponse struct {
- Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"`
-}
-
-func (m *PongResponse) Reset() { *m = PongResponse{} }
-func (m *PongResponse) String() string { return proto.CompactTextString(m) }
-func (*PongResponse) ProtoMessage() {}
-func (*PongResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
-
-func (m *PongResponse) GetMsg() string {
- if m != nil {
- return m.Msg
- }
- return ""
-}
-
-func init() {
- proto.RegisterType((*TestRequest)(nil), "grpctest.TestRequest")
- proto.RegisterType((*TestResponse)(nil), "grpctest.TestResponse")
- proto.RegisterType((*PrintKVRequest)(nil), "grpctest.PrintKVRequest")
- proto.RegisterType((*PrintKVResponse)(nil), "grpctest.PrintKVResponse")
- proto.RegisterType((*BidirectionalRequest)(nil), "grpctest.BidirectionalRequest")
- proto.RegisterType((*BidirectionalResponse)(nil), "grpctest.BidirectionalResponse")
- proto.RegisterType((*PingRequest)(nil), "grpctest.PingRequest")
- proto.RegisterType((*PongResponse)(nil), "grpctest.PongResponse")
-}
-
-// 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
-
-// Client API for Test service
-
-type TestClient interface {
- Double(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestResponse, error)
- PrintKV(ctx context.Context, in *PrintKVRequest, opts ...grpc.CallOption) (*PrintKVResponse, error)
- Bidirectional(ctx context.Context, in *BidirectionalRequest, opts ...grpc.CallOption) (*BidirectionalResponse, error)
- Stream(ctx context.Context, opts ...grpc.CallOption) (Test_StreamClient, error)
-}
-
-type testClient struct {
- cc *grpc.ClientConn
-}
-
-func NewTestClient(cc *grpc.ClientConn) TestClient {
- return &testClient{cc}
-}
-
-func (c *testClient) Double(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestResponse, error) {
- out := new(TestResponse)
- err := grpc.Invoke(ctx, "/grpctest.Test/Double", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *testClient) PrintKV(ctx context.Context, in *PrintKVRequest, opts ...grpc.CallOption) (*PrintKVResponse, error) {
- out := new(PrintKVResponse)
- err := grpc.Invoke(ctx, "/grpctest.Test/PrintKV", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *testClient) Bidirectional(ctx context.Context, in *BidirectionalRequest, opts ...grpc.CallOption) (*BidirectionalResponse, error) {
- out := new(BidirectionalResponse)
- err := grpc.Invoke(ctx, "/grpctest.Test/Bidirectional", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *testClient) Stream(ctx context.Context, opts ...grpc.CallOption) (Test_StreamClient, error) {
- stream, err := grpc.NewClientStream(ctx, &_Test_serviceDesc.Streams[0], c.cc, "/grpctest.Test/Stream", opts...)
- if err != nil {
- return nil, err
- }
- x := &testStreamClient{stream}
- return x, nil
-}
-
-type Test_StreamClient interface {
- Send(*TestRequest) error
- Recv() (*TestResponse, error)
- grpc.ClientStream
-}
-
-type testStreamClient struct {
- grpc.ClientStream
-}
-
-func (x *testStreamClient) Send(m *TestRequest) error {
- return x.ClientStream.SendMsg(m)
-}
-
-func (x *testStreamClient) Recv() (*TestResponse, error) {
- m := new(TestResponse)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-// Server API for Test service
-
-type TestServer interface {
- Double(context.Context, *TestRequest) (*TestResponse, error)
- PrintKV(context.Context, *PrintKVRequest) (*PrintKVResponse, error)
- Bidirectional(context.Context, *BidirectionalRequest) (*BidirectionalResponse, error)
- Stream(Test_StreamServer) error
-}
-
-func RegisterTestServer(s *grpc.Server, srv TestServer) {
- s.RegisterService(&_Test_serviceDesc, srv)
-}
-
-func _Test_Double_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(TestRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TestServer).Double(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/grpctest.Test/Double",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TestServer).Double(ctx, req.(*TestRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Test_PrintKV_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(PrintKVRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TestServer).PrintKV(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/grpctest.Test/PrintKV",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TestServer).PrintKV(ctx, req.(*PrintKVRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Test_Bidirectional_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(BidirectionalRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TestServer).Bidirectional(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/grpctest.Test/Bidirectional",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TestServer).Bidirectional(ctx, req.(*BidirectionalRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Test_Stream_Handler(srv interface{}, stream grpc.ServerStream) error {
- return srv.(TestServer).Stream(&testStreamServer{stream})
-}
-
-type Test_StreamServer interface {
- Send(*TestResponse) error
- Recv() (*TestRequest, error)
- grpc.ServerStream
-}
-
-type testStreamServer struct {
- grpc.ServerStream
-}
-
-func (x *testStreamServer) Send(m *TestResponse) error {
- return x.ServerStream.SendMsg(m)
-}
-
-func (x *testStreamServer) Recv() (*TestRequest, error) {
- m := new(TestRequest)
- if err := x.ServerStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-var _Test_serviceDesc = grpc.ServiceDesc{
- ServiceName: "grpctest.Test",
- HandlerType: (*TestServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "Double",
- Handler: _Test_Double_Handler,
- },
- {
- MethodName: "PrintKV",
- Handler: _Test_PrintKV_Handler,
- },
- {
- MethodName: "Bidirectional",
- Handler: _Test_Bidirectional_Handler,
- },
- },
- Streams: []grpc.StreamDesc{
- {
- StreamName: "Stream",
- Handler: _Test_Stream_Handler,
- ServerStreams: true,
- ClientStreams: true,
- },
- },
- Metadata: "test.proto",
-}
-
-// Client API for PingPong service
-
-type PingPongClient interface {
- Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PongResponse, error)
-}
-
-type pingPongClient struct {
- cc *grpc.ClientConn
-}
-
-func NewPingPongClient(cc *grpc.ClientConn) PingPongClient {
- return &pingPongClient{cc}
-}
-
-func (c *pingPongClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PongResponse, error) {
- out := new(PongResponse)
- err := grpc.Invoke(ctx, "/grpctest.PingPong/Ping", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// Server API for PingPong service
-
-type PingPongServer interface {
- Ping(context.Context, *PingRequest) (*PongResponse, error)
-}
-
-func RegisterPingPongServer(s *grpc.Server, srv PingPongServer) {
- s.RegisterService(&_PingPong_serviceDesc, srv)
-}
-
-func _PingPong_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(PingRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(PingPongServer).Ping(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/grpctest.PingPong/Ping",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(PingPongServer).Ping(ctx, req.(*PingRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-var _PingPong_serviceDesc = grpc.ServiceDesc{
- ServiceName: "grpctest.PingPong",
- HandlerType: (*PingPongServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "Ping",
- Handler: _PingPong_Ping_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "test.proto",
-}
-
-func init() { proto.RegisterFile("test.proto", fileDescriptor0) }
-
-var fileDescriptor0 = []byte{
- // 355 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xcd, 0x4e, 0xc2, 0x40,
- 0x14, 0x85, 0xdb, 0x02, 0x05, 0x2e, 0x3f, 0xe2, 0x04, 0x08, 0x12, 0xa3, 0x64, 0x4c, 0x90, 0x15,
- 0x31, 0xb8, 0x30, 0x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