cosmossdk.io/client/v2@v2.0.0-beta.1/internal/testpb/query_grpc.pb.go (about)

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  
     3  package testpb
     4  
     5  import (
     6  	context "context"
     7  	grpc "google.golang.org/grpc"
     8  	codes "google.golang.org/grpc/codes"
     9  	status "google.golang.org/grpc/status"
    10  )
    11  
    12  // This is a compile-time assertion to ensure that this generated file
    13  // is compatible with the grpc package it is being compiled against.
    14  // Requires gRPC-Go v1.32.0 or later.
    15  const _ = grpc.SupportPackageIsVersion7
    16  
    17  // QueryClient is the client API for Query service.
    18  //
    19  // 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.
    20  type QueryClient interface {
    21  	// Echo returns the request in the response
    22  	Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
    23  }
    24  
    25  type queryClient struct {
    26  	cc grpc.ClientConnInterface
    27  }
    28  
    29  func NewQueryClient(cc grpc.ClientConnInterface) QueryClient {
    30  	return &queryClient{cc}
    31  }
    32  
    33  func (c *queryClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) {
    34  	out := new(EchoResponse)
    35  	err := c.cc.Invoke(ctx, "/testpb.Query/Echo", in, out, opts...)
    36  	if err != nil {
    37  		return nil, err
    38  	}
    39  	return out, nil
    40  }
    41  
    42  // QueryServer is the server API for Query service.
    43  // All implementations must embed UnimplementedQueryServer
    44  // for forward compatibility
    45  type QueryServer interface {
    46  	// Echo returns the request in the response
    47  	Echo(context.Context, *EchoRequest) (*EchoResponse, error)
    48  	mustEmbedUnimplementedQueryServer()
    49  }
    50  
    51  // UnimplementedQueryServer must be embedded to have forward compatible implementations.
    52  type UnimplementedQueryServer struct {
    53  }
    54  
    55  func (UnimplementedQueryServer) Echo(context.Context, *EchoRequest) (*EchoResponse, error) {
    56  	return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented")
    57  }
    58  func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
    59  
    60  // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
    61  // Use of this interface is not recommended, as added methods to QueryServer will
    62  // result in compilation errors.
    63  type UnsafeQueryServer interface {
    64  	mustEmbedUnimplementedQueryServer()
    65  }
    66  
    67  func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) {
    68  	s.RegisterService(&Query_ServiceDesc, srv)
    69  }
    70  
    71  func _Query_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    72  	in := new(EchoRequest)
    73  	if err := dec(in); err != nil {
    74  		return nil, err
    75  	}
    76  	if interceptor == nil {
    77  		return srv.(QueryServer).Echo(ctx, in)
    78  	}
    79  	info := &grpc.UnaryServerInfo{
    80  		Server:     srv,
    81  		FullMethod: "/testpb.Query/Echo",
    82  	}
    83  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
    84  		return srv.(QueryServer).Echo(ctx, req.(*EchoRequest))
    85  	}
    86  	return interceptor(ctx, in, info, handler)
    87  }
    88  
    89  // Query_ServiceDesc is the grpc.ServiceDesc for Query service.
    90  // It's only intended for direct use with grpc.RegisterService,
    91  // and not to be introspected or modified (even as a copy)
    92  var Query_ServiceDesc = grpc.ServiceDesc{
    93  	ServiceName: "testpb.Query",
    94  	HandlerType: (*QueryServer)(nil),
    95  	Methods: []grpc.MethodDesc{
    96  		{
    97  			MethodName: "Echo",
    98  			Handler:    _Query_Echo_Handler,
    99  		},
   100  	},
   101  	Streams:  []grpc.StreamDesc{},
   102  	Metadata: "testpb/query.proto",
   103  }