github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/go-grpc-middleware/testing/testproto/test.pb.go (about)

     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 "github.com/hxx258456/ccgo/net/context"
    24  	grpc "github.com/hxx258456/ccgo/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  	PingStream(ctx context.Context, opts ...grpc.CallOption) (TestService_PingStreamClient, error)
   124  }
   125  
   126  type testServiceClient struct {
   127  	cc *grpc.ClientConn
   128  }
   129  
   130  func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient {
   131  	return &testServiceClient{cc}
   132  }
   133  
   134  func (c *testServiceClient) PingEmpty(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*PingResponse, error) {
   135  	out := new(PingResponse)
   136  	err := grpc.Invoke(ctx, "/mwitkow.testproto.TestService/PingEmpty", in, out, c.cc, opts...)
   137  	if err != nil {
   138  		return nil, err
   139  	}
   140  	return out, nil
   141  }
   142  
   143  func (c *testServiceClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) {
   144  	out := new(PingResponse)
   145  	err := grpc.Invoke(ctx, "/mwitkow.testproto.TestService/Ping", in, out, c.cc, opts...)
   146  	if err != nil {
   147  		return nil, err
   148  	}
   149  	return out, nil
   150  }
   151  
   152  func (c *testServiceClient) PingError(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*Empty, error) {
   153  	out := new(Empty)
   154  	err := grpc.Invoke(ctx, "/mwitkow.testproto.TestService/PingError", in, out, c.cc, opts...)
   155  	if err != nil {
   156  		return nil, err
   157  	}
   158  	return out, nil
   159  }
   160  
   161  func (c *testServiceClient) PingList(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (TestService_PingListClient, error) {
   162  	stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[0], c.cc, "/mwitkow.testproto.TestService/PingList", opts...)
   163  	if err != nil {
   164  		return nil, err
   165  	}
   166  	x := &testServicePingListClient{stream}
   167  	if err := x.ClientStream.SendMsg(in); err != nil {
   168  		return nil, err
   169  	}
   170  	if err := x.ClientStream.CloseSend(); err != nil {
   171  		return nil, err
   172  	}
   173  	return x, nil
   174  }
   175  
   176  type TestService_PingListClient interface {
   177  	Recv() (*PingResponse, error)
   178  	grpc.ClientStream
   179  }
   180  
   181  type testServicePingListClient struct {
   182  	grpc.ClientStream
   183  }
   184  
   185  func (x *testServicePingListClient) Recv() (*PingResponse, error) {
   186  	m := new(PingResponse)
   187  	if err := x.ClientStream.RecvMsg(m); err != nil {
   188  		return nil, err
   189  	}
   190  	return m, nil
   191  }
   192  
   193  func (c *testServiceClient) PingStream(ctx context.Context, opts ...grpc.CallOption) (TestService_PingStreamClient, error) {
   194  	stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[1], c.cc, "/mwitkow.testproto.TestService/PingStream", opts...)
   195  	if err != nil {
   196  		return nil, err
   197  	}
   198  	x := &testServicePingStreamClient{stream}
   199  	return x, nil
   200  }
   201  
   202  type TestService_PingStreamClient interface {
   203  	Send(*PingRequest) error
   204  	Recv() (*PingResponse, error)
   205  	grpc.ClientStream
   206  }
   207  
   208  type testServicePingStreamClient struct {
   209  	grpc.ClientStream
   210  }
   211  
   212  func (x *testServicePingStreamClient) Send(m *PingRequest) error {
   213  	return x.ClientStream.SendMsg(m)
   214  }
   215  
   216  func (x *testServicePingStreamClient) Recv() (*PingResponse, error) {
   217  	m := new(PingResponse)
   218  	if err := x.ClientStream.RecvMsg(m); err != nil {
   219  		return nil, err
   220  	}
   221  	return m, nil
   222  }
   223  
   224  // Server API for TestService service
   225  
   226  type TestServiceServer interface {
   227  	PingEmpty(context.Context, *Empty) (*PingResponse, error)
   228  	Ping(context.Context, *PingRequest) (*PingResponse, error)
   229  	PingError(context.Context, *PingRequest) (*Empty, error)
   230  	PingList(*PingRequest, TestService_PingListServer) error
   231  	PingStream(TestService_PingStreamServer) error
   232  }
   233  
   234  func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer) {
   235  	s.RegisterService(&_TestService_serviceDesc, srv)
   236  }
   237  
   238  func _TestService_PingEmpty_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   239  	in := new(Empty)
   240  	if err := dec(in); err != nil {
   241  		return nil, err
   242  	}
   243  	if interceptor == nil {
   244  		return srv.(TestServiceServer).PingEmpty(ctx, in)
   245  	}
   246  	info := &grpc.UnaryServerInfo{
   247  		Server:     srv,
   248  		FullMethod: "/mwitkow.testproto.TestService/PingEmpty",
   249  	}
   250  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   251  		return srv.(TestServiceServer).PingEmpty(ctx, req.(*Empty))
   252  	}
   253  	return interceptor(ctx, in, info, handler)
   254  }
   255  
   256  func _TestService_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   257  	in := new(PingRequest)
   258  	if err := dec(in); err != nil {
   259  		return nil, err
   260  	}
   261  	if interceptor == nil {
   262  		return srv.(TestServiceServer).Ping(ctx, in)
   263  	}
   264  	info := &grpc.UnaryServerInfo{
   265  		Server:     srv,
   266  		FullMethod: "/mwitkow.testproto.TestService/Ping",
   267  	}
   268  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   269  		return srv.(TestServiceServer).Ping(ctx, req.(*PingRequest))
   270  	}
   271  	return interceptor(ctx, in, info, handler)
   272  }
   273  
   274  func _TestService_PingError_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   275  	in := new(PingRequest)
   276  	if err := dec(in); err != nil {
   277  		return nil, err
   278  	}
   279  	if interceptor == nil {
   280  		return srv.(TestServiceServer).PingError(ctx, in)
   281  	}
   282  	info := &grpc.UnaryServerInfo{
   283  		Server:     srv,
   284  		FullMethod: "/mwitkow.testproto.TestService/PingError",
   285  	}
   286  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   287  		return srv.(TestServiceServer).PingError(ctx, req.(*PingRequest))
   288  	}
   289  	return interceptor(ctx, in, info, handler)
   290  }
   291  
   292  func _TestService_PingList_Handler(srv interface{}, stream grpc.ServerStream) error {
   293  	m := new(PingRequest)
   294  	if err := stream.RecvMsg(m); err != nil {
   295  		return err
   296  	}
   297  	return srv.(TestServiceServer).PingList(m, &testServicePingListServer{stream})
   298  }
   299  
   300  type TestService_PingListServer interface {
   301  	Send(*PingResponse) error
   302  	grpc.ServerStream
   303  }
   304  
   305  type testServicePingListServer struct {
   306  	grpc.ServerStream
   307  }
   308  
   309  func (x *testServicePingListServer) Send(m *PingResponse) error {
   310  	return x.ServerStream.SendMsg(m)
   311  }
   312  
   313  func _TestService_PingStream_Handler(srv interface{}, stream grpc.ServerStream) error {
   314  	return srv.(TestServiceServer).PingStream(&testServicePingStreamServer{stream})
   315  }
   316  
   317  type TestService_PingStreamServer interface {
   318  	Send(*PingResponse) error
   319  	Recv() (*PingRequest, error)
   320  	grpc.ServerStream
   321  }
   322  
   323  type testServicePingStreamServer struct {
   324  	grpc.ServerStream
   325  }
   326  
   327  func (x *testServicePingStreamServer) Send(m *PingResponse) error {
   328  	return x.ServerStream.SendMsg(m)
   329  }
   330  
   331  func (x *testServicePingStreamServer) Recv() (*PingRequest, error) {
   332  	m := new(PingRequest)
   333  	if err := x.ServerStream.RecvMsg(m); err != nil {
   334  		return nil, err
   335  	}
   336  	return m, nil
   337  }
   338  
   339  var _TestService_serviceDesc = grpc.ServiceDesc{
   340  	ServiceName: "mwitkow.testproto.TestService",
   341  	HandlerType: (*TestServiceServer)(nil),
   342  	Methods: []grpc.MethodDesc{
   343  		{
   344  			MethodName: "PingEmpty",
   345  			Handler:    _TestService_PingEmpty_Handler,
   346  		},
   347  		{
   348  			MethodName: "Ping",
   349  			Handler:    _TestService_Ping_Handler,
   350  		},
   351  		{
   352  			MethodName: "PingError",
   353  			Handler:    _TestService_PingError_Handler,
   354  		},
   355  	},
   356  	Streams: []grpc.StreamDesc{
   357  		{
   358  			StreamName:    "PingList",
   359  			Handler:       _TestService_PingList_Handler,
   360  			ServerStreams: true,
   361  		},
   362  		{
   363  			StreamName:    "PingStream",
   364  			Handler:       _TestService_PingStream_Handler,
   365  			ServerStreams: true,
   366  			ClientStreams: true,
   367  		},
   368  	},
   369  	Metadata: "test.proto",
   370  }
   371  
   372  func init() { proto.RegisterFile("test.proto", fileDescriptor0) }
   373  
   374  var fileDescriptor0 = []byte{
   375  	// 288 bytes of a gzipped FileDescriptorProto
   376  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x90, 0x4f, 0x4b, 0xfb, 0x30,
   377  	0x18, 0xc7, 0x97, 0xdf, 0x7e, 0x75, 0xee, 0xa9, 0x3b, 0x2c, 0x7a, 0x28, 0x1e, 0xb4, 0xe4, 0xd4,
   378  	0x53, 0x19, 0x7a, 0xf7, 0x22, 0xa2, 0x82, 0xa2, 0xb4, 0xc3, 0x6b, 0x99, 0xed, 0x83, 0x04, 0x97,
   379  	0xa6, 0x26, 0x4f, 0x57, 0x7c, 0x19, 0xbe, 0x63, 0x49, 0x56, 0x41, 0x98, 0x43, 0x0f, 0x3b, 0xe6,
   380  	0xfb, 0x79, 0xf8, 0xfe, 0x09, 0x00, 0xa1, 0xa5, 0xb4, 0x31, 0x9a, 0x34, 0x9f, 0xaa, 0x4e, 0xd2,
   381  	0xab, 0xee, 0x52, 0xa7, 0x79, 0x49, 0x8c, 0x20, 0xb8, 0x52, 0x0d, 0xbd, 0x8b, 0x0e, 0xc2, 0x47,
   382  	0x59, 0xbf, 0x64, 0xf8, 0xd6, 0xa2, 0x25, 0x7e, 0x04, 0xc1, 0x6a, 0xb1, 0x6c, 0x31, 0x62, 0x31,
   383  	0x4b, 0xc6, 0xd9, 0xfa, 0xc1, 0x05, 0x4c, 0xec, 0x12, 0xb1, 0x29, 0x48, 0x2a, 0x2c, 0x94, 0x8d,
   384  	0xfe, 0xc5, 0x2c, 0x09, 0xb2, 0xd0, 0x8b, 0x73, 0xa9, 0xf0, 0xde, 0xf2, 0x14, 0x0e, 0xd1, 0x18,
   385  	0x6d, 0x8a, 0x52, 0x57, 0x58, 0x18, 0xa4, 0xd6, 0xd4, 0x58, 0x45, 0xc3, 0x98, 0x25, 0x93, 0x6c,
   386  	0xea, 0xd1, 0xa5, 0xae, 0x30, 0xeb, 0x81, 0xb8, 0x80, 0x83, 0x75, 0xb0, 0x6d, 0x74, 0x6d, 0xd1,
   387  	0x25, 0x3f, 0x6d, 0x26, 0x47, 0x30, 0x2a, 0x75, 0x5b, 0x13, 0x9a, 0x3e, 0xf3, 0xeb, 0x79, 0xf6,
   388  	0x31, 0x84, 0x70, 0x8e, 0x96, 0x72, 0x34, 0x2b, 0x59, 0x22, 0xbf, 0x81, 0xb1, 0xf3, 0xf3, 0xab,
   389  	0x78, 0x94, 0x6e, 0x4c, 0x4e, 0x3d, 0x39, 0x3e, 0xfd, 0x81, 0x7c, 0xef, 0x21, 0x06, 0xfc, 0x16,
   390  	0xfe, 0x3b, 0x85, 0x9f, 0x6c, 0x3d, 0xf5, 0x7f, 0xf5, 0x17, 0xab, 0xeb, 0xbe, 0x94, 0x5b, 0xff,
   391  	0xab, 0xdf, 0xd6, 0xd2, 0x62, 0xc0, 0x1f, 0x60, 0xdf, 0x9d, 0xde, 0x49, 0x4b, 0x3b, 0xe8, 0x35,
   392  	0x63, 0x3c, 0x07, 0x70, 0x5a, 0x4e, 0x06, 0x17, 0x6a, 0x07, 0x96, 0x09, 0x9b, 0xb1, 0xe7, 0x3d,
   393  	0x4f, 0xce, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x2a, 0x8a, 0x7b, 0x7d, 0x02, 0x00, 0x00,
   394  }