...

Source file src/github.com/grpc-ecosystem/go-grpc-prometheus/examples/testproto/test.pb.go

Documentation: github.com/grpc-ecosystem/go-grpc-prometheus/examples/testproto

     1  // Code generated by protoc-gen-go.
     2  // source: test.proto
     3  // DO NOT EDIT!
     4  
     5  /*
     6  Package mwitkow_testproto is a generated protocol buffer package.
     7  
     8  It is generated from these files:
     9  	test.proto
    10  
    11  It has these top-level messages:
    12  	Empty
    13  	PingRequest
    14  	PingResponse
    15  */
    16  package mwitkow_testproto
    17  
    18  import proto "github.com/golang/protobuf/proto"
    19  import fmt "fmt"
    20  import math "math"
    21  
    22  import (
    23  	context "golang.org/x/net/context"
    24  	grpc "google.golang.org/grpc"
    25  )
    26  
    27  // Reference imports to suppress errors if they are not otherwise used.
    28  var _ = proto.Marshal
    29  var _ = fmt.Errorf
    30  var _ = math.Inf
    31  
    32  // This is a compile-time assertion to ensure that this generated file
    33  // is compatible with the proto package it is being compiled against.
    34  // A compilation error at this line likely means your copy of the
    35  // proto package needs to be updated.
    36  const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
    37  
    38  type Empty struct {
    39  }
    40  
    41  func (m *Empty) Reset()                    { *m = Empty{} }
    42  func (m *Empty) String() string            { return proto.CompactTextString(m) }
    43  func (*Empty) ProtoMessage()               {}
    44  func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
    45  
    46  type PingRequest struct {
    47  	Value             string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"`
    48  	SleepTimeMs       int32  `protobuf:"varint,2,opt,name=sleep_time_ms,json=sleepTimeMs" json:"sleep_time_ms,omitempty"`
    49  	ErrorCodeReturned uint32 `protobuf:"varint,3,opt,name=error_code_returned,json=errorCodeReturned" json:"error_code_returned,omitempty"`
    50  }
    51  
    52  func (m *PingRequest) Reset()                    { *m = PingRequest{} }
    53  func (m *PingRequest) String() string            { return proto.CompactTextString(m) }
    54  func (*PingRequest) ProtoMessage()               {}
    55  func (*PingRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
    56  
    57  func (m *PingRequest) GetValue() string {
    58  	if m != nil {
    59  		return m.Value
    60  	}
    61  	return ""
    62  }
    63  
    64  func (m *PingRequest) GetSleepTimeMs() int32 {
    65  	if m != nil {
    66  		return m.SleepTimeMs
    67  	}
    68  	return 0
    69  }
    70  
    71  func (m *PingRequest) GetErrorCodeReturned() uint32 {
    72  	if m != nil {
    73  		return m.ErrorCodeReturned
    74  	}
    75  	return 0
    76  }
    77  
    78  type PingResponse struct {
    79  	Value   string `protobuf:"bytes,1,opt,name=Value,json=value" json:"Value,omitempty"`
    80  	Counter int32  `protobuf:"varint,2,opt,name=counter" json:"counter,omitempty"`
    81  }
    82  
    83  func (m *PingResponse) Reset()                    { *m = PingResponse{} }
    84  func (m *PingResponse) String() string            { return proto.CompactTextString(m) }
    85  func (*PingResponse) ProtoMessage()               {}
    86  func (*PingResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
    87  
    88  func (m *PingResponse) GetValue() string {
    89  	if m != nil {
    90  		return m.Value
    91  	}
    92  	return ""
    93  }
    94  
    95  func (m *PingResponse) GetCounter() int32 {
    96  	if m != nil {
    97  		return m.Counter
    98  	}
    99  	return 0
   100  }
   101  
   102  func init() {
   103  	proto.RegisterType((*Empty)(nil), "mwitkow.testproto.Empty")
   104  	proto.RegisterType((*PingRequest)(nil), "mwitkow.testproto.PingRequest")
   105  	proto.RegisterType((*PingResponse)(nil), "mwitkow.testproto.PingResponse")
   106  }
   107  
   108  // Reference imports to suppress errors if they are not otherwise used.
   109  var _ context.Context
   110  var _ grpc.ClientConn
   111  
   112  // This is a compile-time assertion to ensure that this generated file
   113  // is compatible with the grpc package it is being compiled against.
   114  const _ = grpc.SupportPackageIsVersion4
   115  
   116  // Client API for TestService service
   117  
   118  type TestServiceClient interface {
   119  	PingEmpty(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*PingResponse, error)
   120  	Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
   121  	PingError(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*Empty, error)
   122  	PingList(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (TestService_PingListClient, error)
   123  }
   124  
   125  type testServiceClient struct {
   126  	cc *grpc.ClientConn
   127  }
   128  
   129  func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient {
   130  	return &testServiceClient{cc}
   131  }
   132  
   133  func (c *testServiceClient) PingEmpty(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*PingResponse, error) {
   134  	out := new(PingResponse)
   135  	err := grpc.Invoke(ctx, "/mwitkow.testproto.TestService/PingEmpty", in, out, c.cc, opts...)
   136  	if err != nil {
   137  		return nil, err
   138  	}
   139  	return out, nil
   140  }
   141  
   142  func (c *testServiceClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) {
   143  	out := new(PingResponse)
   144  	err := grpc.Invoke(ctx, "/mwitkow.testproto.TestService/Ping", in, out, c.cc, opts...)
   145  	if err != nil {
   146  		return nil, err
   147  	}
   148  	return out, nil
   149  }
   150  
   151  func (c *testServiceClient) PingError(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*Empty, error) {
   152  	out := new(Empty)
   153  	err := grpc.Invoke(ctx, "/mwitkow.testproto.TestService/PingError", in, out, c.cc, opts...)
   154  	if err != nil {
   155  		return nil, err
   156  	}
   157  	return out, nil
   158  }
   159  
   160  func (c *testServiceClient) PingList(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (TestService_PingListClient, error) {
   161  	stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[0], c.cc, "/mwitkow.testproto.TestService/PingList", opts...)
   162  	if err != nil {
   163  		return nil, err
   164  	}
   165  	x := &testServicePingListClient{stream}
   166  	if err := x.ClientStream.SendMsg(in); err != nil {
   167  		return nil, err
   168  	}
   169  	if err := x.ClientStream.CloseSend(); err != nil {
   170  		return nil, err
   171  	}
   172  	return x, nil
   173  }
   174  
   175  type TestService_PingListClient interface {
   176  	Recv() (*PingResponse, error)
   177  	grpc.ClientStream
   178  }
   179  
   180  type testServicePingListClient struct {
   181  	grpc.ClientStream
   182  }
   183  
   184  func (x *testServicePingListClient) Recv() (*PingResponse, error) {
   185  	m := new(PingResponse)
   186  	if err := x.ClientStream.RecvMsg(m); err != nil {
   187  		return nil, err
   188  	}
   189  	return m, nil
   190  }
   191  
   192  // Server API for TestService service
   193  
   194  type TestServiceServer interface {
   195  	PingEmpty(context.Context, *Empty) (*PingResponse, error)
   196  	Ping(context.Context, *PingRequest) (*PingResponse, error)
   197  	PingError(context.Context, *PingRequest) (*Empty, error)
   198  	PingList(*PingRequest, TestService_PingListServer) error
   199  }
   200  
   201  func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer) {
   202  	s.RegisterService(&_TestService_serviceDesc, srv)
   203  }
   204  
   205  func _TestService_PingEmpty_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   206  	in := new(Empty)
   207  	if err := dec(in); err != nil {
   208  		return nil, err
   209  	}
   210  	if interceptor == nil {
   211  		return srv.(TestServiceServer).PingEmpty(ctx, in)
   212  	}
   213  	info := &grpc.UnaryServerInfo{
   214  		Server:     srv,
   215  		FullMethod: "/mwitkow.testproto.TestService/PingEmpty",
   216  	}
   217  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   218  		return srv.(TestServiceServer).PingEmpty(ctx, req.(*Empty))
   219  	}
   220  	return interceptor(ctx, in, info, handler)
   221  }
   222  
   223  func _TestService_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   224  	in := new(PingRequest)
   225  	if err := dec(in); err != nil {
   226  		return nil, err
   227  	}
   228  	if interceptor == nil {
   229  		return srv.(TestServiceServer).Ping(ctx, in)
   230  	}
   231  	info := &grpc.UnaryServerInfo{
   232  		Server:     srv,
   233  		FullMethod: "/mwitkow.testproto.TestService/Ping",
   234  	}
   235  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   236  		return srv.(TestServiceServer).Ping(ctx, req.(*PingRequest))
   237  	}
   238  	return interceptor(ctx, in, info, handler)
   239  }
   240  
   241  func _TestService_PingError_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   242  	in := new(PingRequest)
   243  	if err := dec(in); err != nil {
   244  		return nil, err
   245  	}
   246  	if interceptor == nil {
   247  		return srv.(TestServiceServer).PingError(ctx, in)
   248  	}
   249  	info := &grpc.UnaryServerInfo{
   250  		Server:     srv,
   251  		FullMethod: "/mwitkow.testproto.TestService/PingError",
   252  	}
   253  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   254  		return srv.(TestServiceServer).PingError(ctx, req.(*PingRequest))
   255  	}
   256  	return interceptor(ctx, in, info, handler)
   257  }
   258  
   259  func _TestService_PingList_Handler(srv interface{}, stream grpc.ServerStream) error {
   260  	m := new(PingRequest)
   261  	if err := stream.RecvMsg(m); err != nil {
   262  		return err
   263  	}
   264  	return srv.(TestServiceServer).PingList(m, &testServicePingListServer{stream})
   265  }
   266  
   267  type TestService_PingListServer interface {
   268  	Send(*PingResponse) error
   269  	grpc.ServerStream
   270  }
   271  
   272  type testServicePingListServer struct {
   273  	grpc.ServerStream
   274  }
   275  
   276  func (x *testServicePingListServer) Send(m *PingResponse) error {
   277  	return x.ServerStream.SendMsg(m)
   278  }
   279  
   280  var _TestService_serviceDesc = grpc.ServiceDesc{
   281  	ServiceName: "mwitkow.testproto.TestService",
   282  	HandlerType: (*TestServiceServer)(nil),
   283  	Methods: []grpc.MethodDesc{
   284  		{
   285  			MethodName: "PingEmpty",
   286  			Handler:    _TestService_PingEmpty_Handler,
   287  		},
   288  		{
   289  			MethodName: "Ping",
   290  			Handler:    _TestService_Ping_Handler,
   291  		},
   292  		{
   293  			MethodName: "PingError",
   294  			Handler:    _TestService_PingError_Handler,
   295  		},
   296  	},
   297  	Streams: []grpc.StreamDesc{
   298  		{
   299  			StreamName:    "PingList",
   300  			Handler:       _TestService_PingList_Handler,
   301  			ServerStreams: true,
   302  		},
   303  	},
   304  	Metadata: "test.proto",
   305  }
   306  
   307  func init() { proto.RegisterFile("test.proto", fileDescriptor0) }
   308  
   309  var fileDescriptor0 = []byte{
   310  	// 273 bytes of a gzipped FileDescriptorProto
   311  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x90, 0xcf, 0x4b, 0xc3, 0x30,
   312  	0x14, 0xc7, 0xd7, 0x69, 0x9d, 0x7b, 0x75, 0x87, 0x45, 0x0f, 0xc5, 0x83, 0x96, 0x9c, 0x7a, 0x0a,
   313  	0xa2, 0x77, 0x2f, 0x22, 0x2a, 0x28, 0x4a, 0x1c, 0x5e, 0x8b, 0xb6, 0x0f, 0x09, 0x2e, 0x4d, 0x4d,
   314  	0x5e, 0x57, 0xfc, 0xdf, 0xfc, 0xe3, 0x24, 0x59, 0x05, 0x61, 0x0e, 0x3d, 0xec, 0x98, 0xcf, 0xf7,
   315  	0xf1, 0xfd, 0x11, 0x00, 0x42, 0x47, 0xa2, 0xb1, 0x86, 0x0c, 0x9b, 0xea, 0x4e, 0xd1, 0x9b, 0xe9,
   316  	0x84, 0x67, 0x01, 0xf1, 0x11, 0xc4, 0x97, 0xba, 0xa1, 0x0f, 0xde, 0x41, 0xf2, 0xa0, 0xea, 0x57,
   317  	0x89, 0xef, 0x2d, 0x3a, 0x62, 0x07, 0x10, 0x2f, 0x9e, 0xe7, 0x2d, 0xa6, 0x51, 0x16, 0xe5, 0x63,
   318  	0xb9, 0x7c, 0x30, 0x0e, 0x13, 0x37, 0x47, 0x6c, 0x0a, 0x52, 0x1a, 0x0b, 0xed, 0xd2, 0x61, 0x16,
   319  	0xe5, 0xb1, 0x4c, 0x02, 0x9c, 0x29, 0x8d, 0x77, 0x8e, 0x09, 0xd8, 0x47, 0x6b, 0x8d, 0x2d, 0x4a,
   320  	0x53, 0x61, 0x61, 0x91, 0x5a, 0x5b, 0x63, 0x95, 0x6e, 0x65, 0x51, 0x3e, 0x91, 0xd3, 0x20, 0x5d,
   321  	0x98, 0x0a, 0x65, 0x2f, 0xf0, 0x73, 0xd8, 0x5b, 0x06, 0xbb, 0xc6, 0xd4, 0x0e, 0x7d, 0xf2, 0xd3,
   322  	0x6a, 0x72, 0x0a, 0xa3, 0xd2, 0xb4, 0x35, 0xa1, 0xed, 0x33, 0xbf, 0x9f, 0xa7, 0x9f, 0x43, 0x48,
   323  	0x66, 0xe8, 0xe8, 0x11, 0xed, 0x42, 0x95, 0xc8, 0xae, 0x61, 0xec, 0xfd, 0xc2, 0x2a, 0x96, 0x8a,
   324  	0x95, 0xc9, 0x22, 0x28, 0x87, 0xc7, 0xbf, 0x28, 0x3f, 0x7b, 0xf0, 0x01, 0xbb, 0x81, 0x6d, 0x4f,
   325  	0xd8, 0xd1, 0xda, 0xd3, 0xf0, 0x57, 0xff, 0xb1, 0xba, 0xea, 0x4b, 0xf9, 0xf5, 0x7f, 0xfa, 0xad,
   326  	0x2d, 0xcd, 0x07, 0xec, 0x1e, 0x76, 0xfd, 0xe9, 0xad, 0x72, 0xb4, 0x81, 0x5e, 0x27, 0xd1, 0xcb,
   327  	0x4e, 0xe0, 0x67, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x38, 0x3e, 0x02, 0xe9, 0x28, 0x02, 0x00,
   328  	0x00,
   329  }
   330  

View as plain text