github.com/kaydxh/golang@v0.0.131/pkg/grpc-gateway/date/date_grpc.pb.go (about) 1 /* 2 *Copyright (c) 2022, kaydxh 3 * 4 *Permission is hereby granted, free of charge, to any person obtaining a copy 5 *of this software and associated documentation files (the "Software"), to deal 6 *in the Software without restriction, including without limitation the rights 7 *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 *copies of the Software, and to permit persons to whom the Software is 9 *furnished to do so, subject to the following conditions: 10 * 11 *The above copyright notice and this permission notice shall be included in all 12 *copies or substantial portions of the Software. 13 * 14 *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 *SOFTWARE. 21 */ 22 // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 23 24 package date 25 26 import ( 27 context "context" 28 grpc "google.golang.org/grpc" 29 codes "google.golang.org/grpc/codes" 30 status "google.golang.org/grpc/status" 31 ) 32 33 // This is a compile-time assertion to ensure that this generated file 34 // is compatible with the grpc package it is being compiled against. 35 // Requires gRPC-Go v1.32.0 or later. 36 const _ = grpc.SupportPackageIsVersion7 37 38 // DateServiceClient is the client API for DateService service. 39 // 40 // 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. 41 type DateServiceClient interface { 42 Now(ctx context.Context, in *DateRequest, opts ...grpc.CallOption) (*DateResponse, error) 43 } 44 45 type dateServiceClient struct { 46 cc grpc.ClientConnInterface 47 } 48 49 func NewDateServiceClient(cc grpc.ClientConnInterface) DateServiceClient { 50 return &dateServiceClient{cc} 51 } 52 53 func (c *dateServiceClient) Now(ctx context.Context, in *DateRequest, opts ...grpc.CallOption) (*DateResponse, error) { 54 out := new(DateResponse) 55 err := c.cc.Invoke(ctx, "/sea.api.v1.date.DateService/Now", in, out, opts...) 56 if err != nil { 57 return nil, err 58 } 59 return out, nil 60 } 61 62 // DateServiceServer is the server API for DateService service. 63 // All implementations must embed UnimplementedDateServiceServer 64 // for forward compatibility 65 type DateServiceServer interface { 66 Now(context.Context, *DateRequest) (*DateResponse, error) 67 mustEmbedUnimplementedDateServiceServer() 68 } 69 70 // UnimplementedDateServiceServer must be embedded to have forward compatible implementations. 71 type UnimplementedDateServiceServer struct { 72 } 73 74 func (UnimplementedDateServiceServer) Now(context.Context, *DateRequest) (*DateResponse, error) { 75 return nil, status.Errorf(codes.Unimplemented, "method Now not implemented") 76 } 77 func (UnimplementedDateServiceServer) mustEmbedUnimplementedDateServiceServer() {} 78 79 // UnsafeDateServiceServer may be embedded to opt out of forward compatibility for this service. 80 // Use of this interface is not recommended, as added methods to DateServiceServer will 81 // result in compilation errors. 82 type UnsafeDateServiceServer interface { 83 mustEmbedUnimplementedDateServiceServer() 84 } 85 86 func RegisterDateServiceServer(s grpc.ServiceRegistrar, srv DateServiceServer) { 87 s.RegisterService(&DateService_ServiceDesc, srv) 88 } 89 90 func _DateService_Now_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 91 in := new(DateRequest) 92 if err := dec(in); err != nil { 93 return nil, err 94 } 95 if interceptor == nil { 96 return srv.(DateServiceServer).Now(ctx, in) 97 } 98 info := &grpc.UnaryServerInfo{ 99 Server: srv, 100 FullMethod: "/sea.api.v1.date.DateService/Now", 101 } 102 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 103 return srv.(DateServiceServer).Now(ctx, req.(*DateRequest)) 104 } 105 return interceptor(ctx, in, info, handler) 106 } 107 108 // DateService_ServiceDesc is the grpc.ServiceDesc for DateService service. 109 // It's only intended for direct use with grpc.RegisterService, 110 // and not to be introspected or modified (even as a copy) 111 var DateService_ServiceDesc = grpc.ServiceDesc{ 112 ServiceName: "sea.api.v1.date.DateService", 113 HandlerType: (*DateServiceServer)(nil), 114 Methods: []grpc.MethodDesc{ 115 { 116 MethodName: "Now", 117 Handler: _DateService_Now_Handler, 118 }, 119 }, 120 Streams: []grpc.StreamDesc{}, 121 Metadata: "date/date.proto", 122 }