...

Source file src/github.com/grpc-ecosystem/go-grpc-middleware/testing/testproto/test.pb.go

Documentation: github.com/grpc-ecosystem/go-grpc-middleware/testing/testproto

     1  // Code generated by protoc-gen-go. DO NOT EDIT.
     2  // source: test.proto
     3  
     4  package mwitkow_testproto
     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  // TODO(domgreen): This is blocking us from upgrading to later versions of gRPC. Fix in new PR.
    26  const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
    27  
    28  type Empty struct {
    29  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
    30  	XXX_unrecognized     []byte   `json:"-"`
    31  	XXX_sizecache        int32    `json:"-"`
    32  }
    33  
    34  func (m *Empty) Reset()         { *m = Empty{} }
    35  func (m *Empty) String() string { return proto.CompactTextString(m) }
    36  func (*Empty) ProtoMessage()    {}
    37  func (*Empty) Descriptor() ([]byte, []int) {
    38  	return fileDescriptor_c161fcfdc0c3ff1e, []int{0}
    39  }
    40  
    41  func (m *Empty) XXX_Unmarshal(b []byte) error {
    42  	return xxx_messageInfo_Empty.Unmarshal(m, b)
    43  }
    44  func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    45  	return xxx_messageInfo_Empty.Marshal(b, m, deterministic)
    46  }
    47  func (m *Empty) XXX_Merge(src proto.Message) {
    48  	xxx_messageInfo_Empty.Merge(m, src)
    49  }
    50  func (m *Empty) XXX_Size() int {
    51  	return xxx_messageInfo_Empty.Size(m)
    52  }
    53  func (m *Empty) XXX_DiscardUnknown() {
    54  	xxx_messageInfo_Empty.DiscardUnknown(m)
    55  }
    56  
    57  var xxx_messageInfo_Empty proto.InternalMessageInfo
    58  
    59  type PingRequest struct {
    60  	Value                string   `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
    61  	SleepTimeMs          int32    `protobuf:"varint,2,opt,name=sleep_time_ms,json=sleepTimeMs,proto3" json:"sleep_time_ms,omitempty"`
    62  	ErrorCodeReturned    uint32   `protobuf:"varint,3,opt,name=error_code_returned,json=errorCodeReturned,proto3" json:"error_code_returned,omitempty"`
    63  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
    64  	XXX_unrecognized     []byte   `json:"-"`
    65  	XXX_sizecache        int32    `json:"-"`
    66  }
    67  
    68  func (m *PingRequest) Reset()         { *m = PingRequest{} }
    69  func (m *PingRequest) String() string { return proto.CompactTextString(m) }
    70  func (*PingRequest) ProtoMessage()    {}
    71  func (*PingRequest) Descriptor() ([]byte, []int) {
    72  	return fileDescriptor_c161fcfdc0c3ff1e, []int{1}
    73  }
    74  
    75  func (m *PingRequest) XXX_Unmarshal(b []byte) error {
    76  	return xxx_messageInfo_PingRequest.Unmarshal(m, b)
    77  }
    78  func (m *PingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    79  	return xxx_messageInfo_PingRequest.Marshal(b, m, deterministic)
    80  }
    81  func (m *PingRequest) XXX_Merge(src proto.Message) {
    82  	xxx_messageInfo_PingRequest.Merge(m, src)
    83  }
    84  func (m *PingRequest) XXX_Size() int {
    85  	return xxx_messageInfo_PingRequest.Size(m)
    86  }
    87  func (m *PingRequest) XXX_DiscardUnknown() {
    88  	xxx_messageInfo_PingRequest.DiscardUnknown(m)
    89  }
    90  
    91  var xxx_messageInfo_PingRequest proto.InternalMessageInfo
    92  
    93  func (m *PingRequest) GetValue() string {
    94  	if m != nil {
    95  		return m.Value
    96  	}
    97  	return ""
    98  }
    99  
   100  func (m *PingRequest) GetSleepTimeMs() int32 {
   101  	if m != nil {
   102  		return m.SleepTimeMs
   103  	}
   104  	return 0
   105  }
   106  
   107  func (m *PingRequest) GetErrorCodeReturned() uint32 {
   108  	if m != nil {
   109  		return m.ErrorCodeReturned
   110  	}
   111  	return 0
   112  }
   113  
   114  type PingResponse struct {
   115  	Value                string   `protobuf:"bytes,1,opt,name=Value,proto3" json:"Value,omitempty"`
   116  	Counter              int32    `protobuf:"varint,2,opt,name=counter,proto3" json:"counter,omitempty"`
   117  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
   118  	XXX_unrecognized     []byte   `json:"-"`
   119  	XXX_sizecache        int32    `json:"-"`
   120  }
   121  
   122  func (m *PingResponse) Reset()         { *m = PingResponse{} }
   123  func (m *PingResponse) String() string { return proto.CompactTextString(m) }
   124  func (*PingResponse) ProtoMessage()    {}
   125  func (*PingResponse) Descriptor() ([]byte, []int) {
   126  	return fileDescriptor_c161fcfdc0c3ff1e, []int{2}
   127  }
   128  
   129  func (m *PingResponse) XXX_Unmarshal(b []byte) error {
   130  	return xxx_messageInfo_PingResponse.Unmarshal(m, b)
   131  }
   132  func (m *PingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   133  	return xxx_messageInfo_PingResponse.Marshal(b, m, deterministic)
   134  }
   135  func (m *PingResponse) XXX_Merge(src proto.Message) {
   136  	xxx_messageInfo_PingResponse.Merge(m, src)
   137  }
   138  func (m *PingResponse) XXX_Size() int {
   139  	return xxx_messageInfo_PingResponse.Size(m)
   140  }
   141  func (m *PingResponse) XXX_DiscardUnknown() {
   142  	xxx_messageInfo_PingResponse.DiscardUnknown(m)
   143  }
   144  
   145  var xxx_messageInfo_PingResponse proto.InternalMessageInfo
   146  
   147  func (m *PingResponse) GetValue() string {
   148  	if m != nil {
   149  		return m.Value
   150  	}
   151  	return ""
   152  }
   153  
   154  func (m *PingResponse) GetCounter() int32 {
   155  	if m != nil {
   156  		return m.Counter
   157  	}
   158  	return 0
   159  }
   160  
   161  func init() {
   162  	proto.RegisterType((*Empty)(nil), "mwitkow.testproto.Empty")
   163  	proto.RegisterType((*PingRequest)(nil), "mwitkow.testproto.PingRequest")
   164  	proto.RegisterType((*PingResponse)(nil), "mwitkow.testproto.PingResponse")
   165  }
   166  
   167  func init() { proto.RegisterFile("test.proto", fileDescriptor_c161fcfdc0c3ff1e) }
   168  
   169  var fileDescriptor_c161fcfdc0c3ff1e = []byte{
   170  	// 289 bytes of a gzipped FileDescriptorProto
   171  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x50, 0x4f, 0x4b, 0xfb, 0x40,
   172  	0x10, 0xed, 0xfe, 0xfa, 0x8b, 0xb5, 0x13, 0x7b, 0xe8, 0xea, 0x21, 0x78, 0xd0, 0xb0, 0xa7, 0x9c,
   173  	0x42, 0xd1, 0xbb, 0x17, 0x11, 0x15, 0x14, 0x25, 0x29, 0x5e, 0x43, 0x4d, 0x06, 0x59, 0xec, 0x66,
   174  	0xe3, 0xee, 0xa4, 0xc1, 0x8f, 0xe1, 0x37, 0x96, 0xdd, 0x46, 0x28, 0x68, 0xd1, 0x43, 0x8f, 0xef,
   175  	0xbd, 0xe1, 0xfd, 0x19, 0x00, 0x42, 0x4b, 0x69, 0x63, 0x34, 0x69, 0x3e, 0x55, 0x9d, 0xa4, 0x57,
   176  	0xdd, 0xa5, 0x8e, 0xf3, 0x94, 0x18, 0x41, 0x70, 0xa5, 0x1a, 0x7a, 0x17, 0x1d, 0x84, 0x8f, 0xb2,
   177  	0x7e, 0xc9, 0xf0, 0xad, 0x45, 0x4b, 0xfc, 0x08, 0x82, 0xd5, 0x62, 0xd9, 0x62, 0xc4, 0x62, 0x96,
   178  	0x8c, 0xb3, 0x35, 0xe0, 0x02, 0x26, 0x76, 0x89, 0xd8, 0x14, 0x24, 0x15, 0x16, 0xca, 0x46, 0xff,
   179  	0x62, 0x96, 0x04, 0x59, 0xe8, 0xc9, 0xb9, 0x54, 0x78, 0x6f, 0x79, 0x0a, 0x87, 0x68, 0x8c, 0x36,
   180  	0x45, 0xa9, 0x2b, 0x2c, 0x0c, 0x52, 0x6b, 0x6a, 0xac, 0xa2, 0x61, 0xcc, 0x92, 0x49, 0x36, 0xf5,
   181  	0xd2, 0xa5, 0xae, 0x30, 0xeb, 0x05, 0x71, 0x01, 0x07, 0xeb, 0x60, 0xdb, 0xe8, 0xda, 0xa2, 0x4b,
   182  	0x7e, 0xda, 0x4c, 0xf6, 0x80, 0x47, 0x30, 0x2a, 0x75, 0x5b, 0x13, 0x9a, 0x3e, 0xf3, 0x0b, 0x9e,
   183  	0x7d, 0x0c, 0x21, 0x9c, 0xa3, 0xa5, 0x1c, 0xcd, 0x4a, 0x96, 0xc8, 0x6f, 0x60, 0xec, 0xfc, 0xfc,
   184  	0x2a, 0x1e, 0xa5, 0xdf, 0x26, 0xa7, 0x5e, 0x39, 0x3e, 0xfd, 0x41, 0xd9, 0xec, 0x21, 0x06, 0xfc,
   185  	0x16, 0xfe, 0x3b, 0x86, 0x9f, 0x6c, 0x3d, 0xf5, 0xbf, 0xfa, 0x8b, 0xd5, 0x75, 0x5f, 0xca, 0xad,
   186  	0xff, 0xd5, 0x6f, 0x6b, 0x69, 0x31, 0xe0, 0x0f, 0xb0, 0xef, 0x4e, 0xef, 0xa4, 0xa5, 0x1d, 0xf4,
   187  	0x9a, 0x31, 0x9e, 0x03, 0x38, 0x2e, 0x27, 0x83, 0x0b, 0xb5, 0x03, 0xcb, 0x84, 0xcd, 0xd8, 0xf3,
   188  	0x9e, 0x57, 0xce, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x75, 0xf0, 0x5c, 0x7d, 0x02, 0x00,
   189  	0x00,
   190  }
   191  
   192  // Reference imports to suppress errors if they are not otherwise used.
   193  var _ context.Context
   194  var _ grpc.ClientConn
   195  
   196  // This is a compile-time assertion to ensure that this generated file
   197  // is compatible with the grpc package it is being compiled against.
   198  const _ = grpc.SupportPackageIsVersion4
   199  
   200  // TestServiceClient is the client API for TestService service.
   201  //
   202  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
   203  type TestServiceClient interface {
   204  	PingEmpty(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*PingResponse, error)
   205  	Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
   206  	PingError(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*Empty, error)
   207  	PingList(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (TestService_PingListClient, error)
   208  	PingStream(ctx context.Context, opts ...grpc.CallOption) (TestService_PingStreamClient, error)
   209  }
   210  
   211  type testServiceClient struct {
   212  	cc *grpc.ClientConn
   213  }
   214  
   215  func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient {
   216  	return &testServiceClient{cc}
   217  }
   218  
   219  func (c *testServiceClient) PingEmpty(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*PingResponse, error) {
   220  	out := new(PingResponse)
   221  	err := c.cc.Invoke(ctx, "/mwitkow.testproto.TestService/PingEmpty", in, out, opts...)
   222  	if err != nil {
   223  		return nil, err
   224  	}
   225  	return out, nil
   226  }
   227  
   228  func (c *testServiceClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) {
   229  	out := new(PingResponse)
   230  	err := c.cc.Invoke(ctx, "/mwitkow.testproto.TestService/Ping", in, out, opts...)
   231  	if err != nil {
   232  		return nil, err
   233  	}
   234  	return out, nil
   235  }
   236  
   237  func (c *testServiceClient) PingError(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*Empty, error) {
   238  	out := new(Empty)
   239  	err := c.cc.Invoke(ctx, "/mwitkow.testproto.TestService/PingError", in, out, opts...)
   240  	if err != nil {
   241  		return nil, err
   242  	}
   243  	return out, nil
   244  }
   245  
   246  func (c *testServiceClient) PingList(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (TestService_PingListClient, error) {
   247  	stream, err := c.cc.NewStream(ctx, &_TestService_serviceDesc.Streams[0], "/mwitkow.testproto.TestService/PingList", opts...)
   248  	if err != nil {
   249  		return nil, err
   250  	}
   251  	x := &testServicePingListClient{stream}
   252  	if err := x.ClientStream.SendMsg(in); err != nil {
   253  		return nil, err
   254  	}
   255  	if err := x.ClientStream.CloseSend(); err != nil {
   256  		return nil, err
   257  	}
   258  	return x, nil
   259  }
   260  
   261  type TestService_PingListClient interface {
   262  	Recv() (*PingResponse, error)
   263  	grpc.ClientStream
   264  }
   265  
   266  type testServicePingListClient struct {
   267  	grpc.ClientStream
   268  }
   269  
   270  func (x *testServicePingListClient) Recv() (*PingResponse, error) {
   271  	m := new(PingResponse)
   272  	if err := x.ClientStream.RecvMsg(m); err != nil {
   273  		return nil, err
   274  	}
   275  	return m, nil
   276  }
   277  
   278  func (c *testServiceClient) PingStream(ctx context.Context, opts ...grpc.CallOption) (TestService_PingStreamClient, error) {
   279  	stream, err := c.cc.NewStream(ctx, &_TestService_serviceDesc.Streams[1], "/mwitkow.testproto.TestService/PingStream", opts...)
   280  	if err != nil {
   281  		return nil, err
   282  	}
   283  	x := &testServicePingStreamClient{stream}
   284  	return x, nil
   285  }
   286  
   287  type TestService_PingStreamClient interface {
   288  	Send(*PingRequest) error
   289  	Recv() (*PingResponse, error)
   290  	grpc.ClientStream
   291  }
   292  
   293  type testServicePingStreamClient struct {
   294  	grpc.ClientStream
   295  }
   296  
   297  func (x *testServicePingStreamClient) Send(m *PingRequest) error {
   298  	return x.ClientStream.SendMsg(m)
   299  }
   300  
   301  func (x *testServicePingStreamClient) Recv() (*PingResponse, error) {
   302  	m := new(PingResponse)
   303  	if err := x.ClientStream.RecvMsg(m); err != nil {
   304  		return nil, err
   305  	}
   306  	return m, nil
   307  }
   308  
   309  // TestServiceServer is the server API for TestService service.
   310  type TestServiceServer interface {
   311  	PingEmpty(context.Context, *Empty) (*PingResponse, error)
   312  	Ping(context.Context, *PingRequest) (*PingResponse, error)
   313  	PingError(context.Context, *PingRequest) (*Empty, error)
   314  	PingList(*PingRequest, TestService_PingListServer) error
   315  	PingStream(TestService_PingStreamServer) error
   316  }
   317  
   318  // UnimplementedTestServiceServer can be embedded to have forward compatible implementations.
   319  type UnimplementedTestServiceServer struct {
   320  }
   321  
   322  func (*UnimplementedTestServiceServer) PingEmpty(ctx context.Context, req *Empty) (*PingResponse, error) {
   323  	return nil, status.Errorf(codes.Unimplemented, "method PingEmpty not implemented")
   324  }
   325  func (*UnimplementedTestServiceServer) Ping(ctx context.Context, req *PingRequest) (*PingResponse, error) {
   326  	return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
   327  }
   328  func (*UnimplementedTestServiceServer) PingError(ctx context.Context, req *PingRequest) (*Empty, error) {
   329  	return nil, status.Errorf(codes.Unimplemented, "method PingError not implemented")
   330  }
   331  func (*UnimplementedTestServiceServer) PingList(req *PingRequest, srv TestService_PingListServer) error {
   332  	return status.Errorf(codes.Unimplemented, "method PingList not implemented")
   333  }
   334  func (*UnimplementedTestServiceServer) PingStream(srv TestService_PingStreamServer) error {
   335  	return status.Errorf(codes.Unimplemented, "method PingStream not implemented")
   336  }
   337  
   338  func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer) {
   339  	s.RegisterService(&_TestService_serviceDesc, srv)
   340  }
   341  
   342  func _TestService_PingEmpty_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   343  	in := new(Empty)
   344  	if err := dec(in); err != nil {
   345  		return nil, err
   346  	}
   347  	if interceptor == nil {
   348  		return srv.(TestServiceServer).PingEmpty(ctx, in)
   349  	}
   350  	info := &grpc.UnaryServerInfo{
   351  		Server:     srv,
   352  		FullMethod: "/mwitkow.testproto.TestService/PingEmpty",
   353  	}
   354  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   355  		return srv.(TestServiceServer).PingEmpty(ctx, req.(*Empty))
   356  	}
   357  	return interceptor(ctx, in, info, handler)
   358  }
   359  
   360  func _TestService_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   361  	in := new(PingRequest)
   362  	if err := dec(in); err != nil {
   363  		return nil, err
   364  	}
   365  	if interceptor == nil {
   366  		return srv.(TestServiceServer).Ping(ctx, in)
   367  	}
   368  	info := &grpc.UnaryServerInfo{
   369  		Server:     srv,
   370  		FullMethod: "/mwitkow.testproto.TestService/Ping",
   371  	}
   372  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   373  		return srv.(TestServiceServer).Ping(ctx, req.(*PingRequest))
   374  	}
   375  	return interceptor(ctx, in, info, handler)
   376  }
   377  
   378  func _TestService_PingError_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   379  	in := new(PingRequest)
   380  	if err := dec(in); err != nil {
   381  		return nil, err
   382  	}
   383  	if interceptor == nil {
   384  		return srv.(TestServiceServer).PingError(ctx, in)
   385  	}
   386  	info := &grpc.UnaryServerInfo{
   387  		Server:     srv,
   388  		FullMethod: "/mwitkow.testproto.TestService/PingError",
   389  	}
   390  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   391  		return srv.(TestServiceServer).PingError(ctx, req.(*PingRequest))
   392  	}
   393  	return interceptor(ctx, in, info, handler)
   394  }
   395  
   396  func _TestService_PingList_Handler(srv interface{}, stream grpc.ServerStream) error {
   397  	m := new(PingRequest)
   398  	if err := stream.RecvMsg(m); err != nil {
   399  		return err
   400  	}
   401  	return srv.(TestServiceServer).PingList(m, &testServicePingListServer{stream})
   402  }
   403  
   404  type TestService_PingListServer interface {
   405  	Send(*PingResponse) error
   406  	grpc.ServerStream
   407  }
   408  
   409  type testServicePingListServer struct {
   410  	grpc.ServerStream
   411  }
   412  
   413  func (x *testServicePingListServer) Send(m *PingResponse) error {
   414  	return x.ServerStream.SendMsg(m)
   415  }
   416  
   417  func _TestService_PingStream_Handler(srv interface{}, stream grpc.ServerStream) error {
   418  	return srv.(TestServiceServer).PingStream(&testServicePingStreamServer{stream})
   419  }
   420  
   421  type TestService_PingStreamServer interface {
   422  	Send(*PingResponse) error
   423  	Recv() (*PingRequest, error)
   424  	grpc.ServerStream
   425  }
   426  
   427  type testServicePingStreamServer struct {
   428  	grpc.ServerStream
   429  }
   430  
   431  func (x *testServicePingStreamServer) Send(m *PingResponse) error {
   432  	return x.ServerStream.SendMsg(m)
   433  }
   434  
   435  func (x *testServicePingStreamServer) Recv() (*PingRequest, error) {
   436  	m := new(PingRequest)
   437  	if err := x.ServerStream.RecvMsg(m); err != nil {
   438  		return nil, err
   439  	}
   440  	return m, nil
   441  }
   442  
   443  var _TestService_serviceDesc = grpc.ServiceDesc{
   444  	ServiceName: "mwitkow.testproto.TestService",
   445  	HandlerType: (*TestServiceServer)(nil),
   446  	Methods: []grpc.MethodDesc{
   447  		{
   448  			MethodName: "PingEmpty",
   449  			Handler:    _TestService_PingEmpty_Handler,
   450  		},
   451  		{
   452  			MethodName: "Ping",
   453  			Handler:    _TestService_Ping_Handler,
   454  		},
   455  		{
   456  			MethodName: "PingError",
   457  			Handler:    _TestService_PingError_Handler,
   458  		},
   459  	},
   460  	Streams: []grpc.StreamDesc{
   461  		{
   462  			StreamName:    "PingList",
   463  			Handler:       _TestService_PingList_Handler,
   464  			ServerStreams: true,
   465  		},
   466  		{
   467  			StreamName:    "PingStream",
   468  			Handler:       _TestService_PingStream_Handler,
   469  			ServerStreams: true,
   470  			ClientStreams: true,
   471  		},
   472  	},
   473  	Metadata: "test.proto",
   474  }
   475  

View as plain text