github.com/kaydxh/golang@v0.0.131/go/net/grpc/example/data_grpc.pb.go (about)

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  // versions:
     3  // - protoc-gen-go-grpc v1.2.0
     4  // - protoc             v3.13.0
     5  // source: go/net/grpc/example/data.proto
     6  
     7  package date
     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  // DateServiceClient is the client API for DateService service.
    22  //
    23  // 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.
    24  type DateServiceClient interface {
    25  	// 生成当前时间
    26  	Now(ctx context.Context, in *NowRequest, opts ...grpc.CallOption) (*NowResponse, error)
    27  }
    28  
    29  type dateServiceClient struct {
    30  	cc grpc.ClientConnInterface
    31  }
    32  
    33  func NewDateServiceClient(cc grpc.ClientConnInterface) DateServiceClient {
    34  	return &dateServiceClient{cc}
    35  }
    36  
    37  func (c *dateServiceClient) Now(ctx context.Context, in *NowRequest, opts ...grpc.CallOption) (*NowResponse, error) {
    38  	out := new(NowResponse)
    39  	err := c.cc.Invoke(ctx, "/sea.api.date.DateService/Now", in, out, opts...)
    40  	if err != nil {
    41  		return nil, err
    42  	}
    43  	return out, nil
    44  }
    45  
    46  // DateServiceServer is the server API for DateService service.
    47  // All implementations must embed UnimplementedDateServiceServer
    48  // for forward compatibility
    49  type DateServiceServer interface {
    50  	// 生成当前时间
    51  	Now(context.Context, *NowRequest) (*NowResponse, error)
    52  	mustEmbedUnimplementedDateServiceServer()
    53  }
    54  
    55  // UnimplementedDateServiceServer must be embedded to have forward compatible implementations.
    56  type UnimplementedDateServiceServer struct {
    57  }
    58  
    59  func (UnimplementedDateServiceServer) Now(context.Context, *NowRequest) (*NowResponse, error) {
    60  	return nil, status.Errorf(codes.Unimplemented, "method Now not implemented")
    61  }
    62  func (UnimplementedDateServiceServer) mustEmbedUnimplementedDateServiceServer() {}
    63  
    64  // UnsafeDateServiceServer may be embedded to opt out of forward compatibility for this service.
    65  // Use of this interface is not recommended, as added methods to DateServiceServer will
    66  // result in compilation errors.
    67  type UnsafeDateServiceServer interface {
    68  	mustEmbedUnimplementedDateServiceServer()
    69  }
    70  
    71  func RegisterDateServiceServer(s grpc.ServiceRegistrar, srv DateServiceServer) {
    72  	s.RegisterService(&DateService_ServiceDesc, srv)
    73  }
    74  
    75  func _DateService_Now_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    76  	in := new(NowRequest)
    77  	if err := dec(in); err != nil {
    78  		return nil, err
    79  	}
    80  	if interceptor == nil {
    81  		return srv.(DateServiceServer).Now(ctx, in)
    82  	}
    83  	info := &grpc.UnaryServerInfo{
    84  		Server:     srv,
    85  		FullMethod: "/sea.api.date.DateService/Now",
    86  	}
    87  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
    88  		return srv.(DateServiceServer).Now(ctx, req.(*NowRequest))
    89  	}
    90  	return interceptor(ctx, in, info, handler)
    91  }
    92  
    93  // DateService_ServiceDesc is the grpc.ServiceDesc for DateService service.
    94  // It's only intended for direct use with grpc.RegisterService,
    95  // and not to be introspected or modified (even as a copy)
    96  var DateService_ServiceDesc = grpc.ServiceDesc{
    97  	ServiceName: "sea.api.date.DateService",
    98  	HandlerType: (*DateServiceServer)(nil),
    99  	Methods: []grpc.MethodDesc{
   100  		{
   101  			MethodName: "Now",
   102  			Handler:    _DateService_Now_Handler,
   103  		},
   104  	},
   105  	Streams:  []grpc.StreamDesc{},
   106  	Metadata: "go/net/grpc/example/data.proto",
   107  }