github.com/tickoalcantara12/micro/v3@v3.0.0-20221007104245-9d75b9bcbab9/service/client/grpc/proto/helloworld_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.6.1 5 // source: proto/helloworld.proto 6 7 package helloworld 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 // GreeterClient is the client API for Greeter 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 GreeterClient interface { 25 // Sends a greeting 26 SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) 27 } 28 29 type greeterClient struct { 30 cc grpc.ClientConnInterface 31 } 32 33 func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient { 34 return &greeterClient{cc} 35 } 36 37 func (c *greeterClient) SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) { 38 out := new(HelloReply) 39 err := c.cc.Invoke(ctx, "/helloworld.Greeter/SayHello", in, out, opts...) 40 if err != nil { 41 return nil, err 42 } 43 return out, nil 44 } 45 46 // GreeterServer is the server API for Greeter service. 47 // All implementations must embed UnimplementedGreeterServer 48 // for forward compatibility 49 type GreeterServer interface { 50 // Sends a greeting 51 SayHello(context.Context, *HelloRequest) (*HelloReply, error) 52 mustEmbedUnimplementedGreeterServer() 53 } 54 55 // UnimplementedGreeterServer must be embedded to have forward compatible implementations. 56 type UnimplementedGreeterServer struct { 57 } 58 59 func (UnimplementedGreeterServer) SayHello(context.Context, *HelloRequest) (*HelloReply, error) { 60 return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented") 61 } 62 func (UnimplementedGreeterServer) mustEmbedUnimplementedGreeterServer() {} 63 64 // UnsafeGreeterServer may be embedded to opt out of forward compatibility for this service. 65 // Use of this interface is not recommended, as added methods to GreeterServer will 66 // result in compilation errors. 67 type UnsafeGreeterServer interface { 68 mustEmbedUnimplementedGreeterServer() 69 } 70 71 func RegisterGreeterServer(s grpc.ServiceRegistrar, srv GreeterServer) { 72 s.RegisterService(&Greeter_ServiceDesc, srv) 73 } 74 75 func _Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 76 in := new(HelloRequest) 77 if err := dec(in); err != nil { 78 return nil, err 79 } 80 if interceptor == nil { 81 return srv.(GreeterServer).SayHello(ctx, in) 82 } 83 info := &grpc.UnaryServerInfo{ 84 Server: srv, 85 FullMethod: "/helloworld.Greeter/SayHello", 86 } 87 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 88 return srv.(GreeterServer).SayHello(ctx, req.(*HelloRequest)) 89 } 90 return interceptor(ctx, in, info, handler) 91 } 92 93 // Greeter_ServiceDesc is the grpc.ServiceDesc for Greeter 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 Greeter_ServiceDesc = grpc.ServiceDesc{ 97 ServiceName: "helloworld.Greeter", 98 HandlerType: (*GreeterServer)(nil), 99 Methods: []grpc.MethodDesc{ 100 { 101 MethodName: "SayHello", 102 Handler: _Greeter_SayHello_Handler, 103 }, 104 }, 105 Streams: []grpc.StreamDesc{}, 106 Metadata: "proto/helloworld.proto", 107 }