gobuch/microservices/grpc/hello/hello-message_grpc.pb.go

92 lines
3.1 KiB
Go
Raw Permalink Normal View History

2020-08-21 04:26:40 +00:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package hello
import (
context "context"
empty "github.com/golang/protobuf/ptypes/empty"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
// HelloWorldServiceClient is the client API for HelloWorldService service.
//
// 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.
type HelloWorldServiceClient interface {
SayHello(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*HelloMessage, error)
}
type helloWorldServiceClient struct {
cc grpc.ClientConnInterface
}
func NewHelloWorldServiceClient(cc grpc.ClientConnInterface) HelloWorldServiceClient {
return &helloWorldServiceClient{cc}
}
func (c *helloWorldServiceClient) SayHello(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*HelloMessage, error) {
out := new(HelloMessage)
err := c.cc.Invoke(ctx, "/hello.HelloWorldService/sayHello", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// HelloWorldServiceServer is the server API for HelloWorldService service.
// All implementations must embed UnimplementedHelloWorldServiceServer
// for forward compatibility
type HelloWorldServiceServer interface {
SayHello(context.Context, *empty.Empty) (*HelloMessage, error)
mustEmbedUnimplementedHelloWorldServiceServer()
}
// UnimplementedHelloWorldServiceServer must be embedded to have forward compatible implementations.
type UnimplementedHelloWorldServiceServer struct {
}
func (*UnimplementedHelloWorldServiceServer) SayHello(context.Context, *empty.Empty) (*HelloMessage, error) {
return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented")
}
func (*UnimplementedHelloWorldServiceServer) mustEmbedUnimplementedHelloWorldServiceServer() {}
func RegisterHelloWorldServiceServer(s *grpc.Server, srv HelloWorldServiceServer) {
s.RegisterService(&_HelloWorldService_serviceDesc, srv)
}
func _HelloWorldService_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(empty.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HelloWorldServiceServer).SayHello(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/hello.HelloWorldService/SayHello",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HelloWorldServiceServer).SayHello(ctx, req.(*empty.Empty))
}
return interceptor(ctx, in, info, handler)
}
var _HelloWorldService_serviceDesc = grpc.ServiceDesc{
ServiceName: "hello.HelloWorldService",
HandlerType: (*HelloWorldServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "sayHello",
Handler: _HelloWorldService_SayHello_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "hello-message.proto",
}