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