github.com/cosmos/cosmos-sdk@v0.50.10/testutil/testdata/testpb/query_grpc.pb.go (about)

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  // versions:
     3  // - protoc-gen-go-grpc v1.3.0
     4  // - protoc             (unknown)
     5  // source: testpb/query.proto
     6  
     7  package testpb
     8  
     9  import (
    10  	context "context"
    11  	grpc "google.golang.org/grpc"
    12  	codes "google.golang.org/grpc/codes"
    13  	status "google.golang.org/grpc/status"
    14  )
    15  
    16  // This is a compile-time assertion to ensure that this generated file
    17  // is compatible with the grpc package it is being compiled against.
    18  // Requires gRPC-Go v1.32.0 or later.
    19  const _ = grpc.SupportPackageIsVersion7
    20  
    21  const (
    22  	Query_Echo_FullMethodName     = "/testpb.Query/Echo"
    23  	Query_SayHello_FullMethodName = "/testpb.Query/SayHello"
    24  	Query_TestAny_FullMethodName  = "/testpb.Query/TestAny"
    25  )
    26  
    27  // QueryClient is the client API for Query service.
    28  //
    29  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
    30  type QueryClient interface {
    31  	Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
    32  	SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error)
    33  	TestAny(ctx context.Context, in *TestAnyRequest, opts ...grpc.CallOption) (*TestAnyResponse, error)
    34  }
    35  
    36  type queryClient struct {
    37  	cc grpc.ClientConnInterface
    38  }
    39  
    40  func NewQueryClient(cc grpc.ClientConnInterface) QueryClient {
    41  	return &queryClient{cc}
    42  }
    43  
    44  func (c *queryClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) {
    45  	out := new(EchoResponse)
    46  	err := c.cc.Invoke(ctx, Query_Echo_FullMethodName, in, out, opts...)
    47  	if err != nil {
    48  		return nil, err
    49  	}
    50  	return out, nil
    51  }
    52  
    53  func (c *queryClient) SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) {
    54  	out := new(SayHelloResponse)
    55  	err := c.cc.Invoke(ctx, Query_SayHello_FullMethodName, in, out, opts...)
    56  	if err != nil {
    57  		return nil, err
    58  	}
    59  	return out, nil
    60  }
    61  
    62  func (c *queryClient) TestAny(ctx context.Context, in *TestAnyRequest, opts ...grpc.CallOption) (*TestAnyResponse, error) {
    63  	out := new(TestAnyResponse)
    64  	err := c.cc.Invoke(ctx, Query_TestAny_FullMethodName, in, out, opts...)
    65  	if err != nil {
    66  		return nil, err
    67  	}
    68  	return out, nil
    69  }
    70  
    71  // QueryServer is the server API for Query service.
    72  // All implementations must embed UnimplementedQueryServer
    73  // for forward compatibility
    74  type QueryServer interface {
    75  	Echo(context.Context, *EchoRequest) (*EchoResponse, error)
    76  	SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error)
    77  	TestAny(context.Context, *TestAnyRequest) (*TestAnyResponse, error)
    78  	mustEmbedUnimplementedQueryServer()
    79  }
    80  
    81  // UnimplementedQueryServer must be embedded to have forward compatible implementations.
    82  type UnimplementedQueryServer struct {
    83  }
    84  
    85  func (UnimplementedQueryServer) Echo(context.Context, *EchoRequest) (*EchoResponse, error) {
    86  	return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented")
    87  }
    88  func (UnimplementedQueryServer) SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error) {
    89  	return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented")
    90  }
    91  func (UnimplementedQueryServer) TestAny(context.Context, *TestAnyRequest) (*TestAnyResponse, error) {
    92  	return nil, status.Errorf(codes.Unimplemented, "method TestAny not implemented")
    93  }
    94  func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
    95  
    96  // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
    97  // Use of this interface is not recommended, as added methods to QueryServer will
    98  // result in compilation errors.
    99  type UnsafeQueryServer interface {
   100  	mustEmbedUnimplementedQueryServer()
   101  }
   102  
   103  func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) {
   104  	s.RegisterService(&Query_ServiceDesc, srv)
   105  }
   106  
   107  func _Query_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   108  	in := new(EchoRequest)
   109  	if err := dec(in); err != nil {
   110  		return nil, err
   111  	}
   112  	if interceptor == nil {
   113  		return srv.(QueryServer).Echo(ctx, in)
   114  	}
   115  	info := &grpc.UnaryServerInfo{
   116  		Server:     srv,
   117  		FullMethod: Query_Echo_FullMethodName,
   118  	}
   119  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   120  		return srv.(QueryServer).Echo(ctx, req.(*EchoRequest))
   121  	}
   122  	return interceptor(ctx, in, info, handler)
   123  }
   124  
   125  func _Query_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   126  	in := new(SayHelloRequest)
   127  	if err := dec(in); err != nil {
   128  		return nil, err
   129  	}
   130  	if interceptor == nil {
   131  		return srv.(QueryServer).SayHello(ctx, in)
   132  	}
   133  	info := &grpc.UnaryServerInfo{
   134  		Server:     srv,
   135  		FullMethod: Query_SayHello_FullMethodName,
   136  	}
   137  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   138  		return srv.(QueryServer).SayHello(ctx, req.(*SayHelloRequest))
   139  	}
   140  	return interceptor(ctx, in, info, handler)
   141  }
   142  
   143  func _Query_TestAny_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   144  	in := new(TestAnyRequest)
   145  	if err := dec(in); err != nil {
   146  		return nil, err
   147  	}
   148  	if interceptor == nil {
   149  		return srv.(QueryServer).TestAny(ctx, in)
   150  	}
   151  	info := &grpc.UnaryServerInfo{
   152  		Server:     srv,
   153  		FullMethod: Query_TestAny_FullMethodName,
   154  	}
   155  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   156  		return srv.(QueryServer).TestAny(ctx, req.(*TestAnyRequest))
   157  	}
   158  	return interceptor(ctx, in, info, handler)
   159  }
   160  
   161  // Query_ServiceDesc is the grpc.ServiceDesc for Query service.
   162  // It's only intended for direct use with grpc.RegisterService,
   163  // and not to be introspected or modified (even as a copy)
   164  var Query_ServiceDesc = grpc.ServiceDesc{
   165  	ServiceName: "testpb.Query",
   166  	HandlerType: (*QueryServer)(nil),
   167  	Methods: []grpc.MethodDesc{
   168  		{
   169  			MethodName: "Echo",
   170  			Handler:    _Query_Echo_Handler,
   171  		},
   172  		{
   173  			MethodName: "SayHello",
   174  			Handler:    _Query_SayHello_Handler,
   175  		},
   176  		{
   177  			MethodName: "TestAny",
   178  			Handler:    _Query_TestAny_Handler,
   179  		},
   180  	},
   181  	Streams:  []grpc.StreamDesc{},
   182  	Metadata: "testpb/query.proto",
   183  }