micro-register-service/proto/register_grpc.pb.go

263 lines
8.4 KiB
Go
Raw Normal View History

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package service
import (
context "context"
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
// RegisterClient is the client API for Register 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 RegisterClient interface {
LookupService(ctx context.Context, in *LookupRequest, opts ...grpc.CallOption) (*LookupResponse, error)
Register(ctx context.Context, in *Service, opts ...grpc.CallOption) (*EmptyResponse, error)
Deregister(ctx context.Context, in *Service, opts ...grpc.CallOption) (*EmptyResponse, error)
ListServices(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (Register_WatchClient, error)
}
type registerClient struct {
cc grpc.ClientConnInterface
}
func NewRegisterClient(cc grpc.ClientConnInterface) RegisterClient {
return &registerClient{cc}
}
func (c *registerClient) LookupService(ctx context.Context, in *LookupRequest, opts ...grpc.CallOption) (*LookupResponse, error) {
out := new(LookupResponse)
err := c.cc.Invoke(ctx, "/service.Register/LookupService", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *registerClient) Register(ctx context.Context, in *Service, opts ...grpc.CallOption) (*EmptyResponse, error) {
out := new(EmptyResponse)
err := c.cc.Invoke(ctx, "/service.Register/Register", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *registerClient) Deregister(ctx context.Context, in *Service, opts ...grpc.CallOption) (*EmptyResponse, error) {
out := new(EmptyResponse)
err := c.cc.Invoke(ctx, "/service.Register/Deregister", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *registerClient) ListServices(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) {
out := new(ListResponse)
err := c.cc.Invoke(ctx, "/service.Register/ListServices", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *registerClient) Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (Register_WatchClient, error) {
stream, err := c.cc.NewStream(ctx, &_Register_serviceDesc.Streams[0], "/service.Register/Watch", opts...)
if err != nil {
return nil, err
}
x := &registerWatchClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type Register_WatchClient interface {
Recv() (*Result, error)
grpc.ClientStream
}
type registerWatchClient struct {
grpc.ClientStream
}
func (x *registerWatchClient) Recv() (*Result, error) {
m := new(Result)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// RegisterServer is the server API for Register service.
// All implementations must embed UnimplementedRegisterServer
// for forward compatibility
type RegisterServer interface {
LookupService(context.Context, *LookupRequest) (*LookupResponse, error)
Register(context.Context, *Service) (*EmptyResponse, error)
Deregister(context.Context, *Service) (*EmptyResponse, error)
ListServices(context.Context, *ListRequest) (*ListResponse, error)
Watch(*WatchRequest, Register_WatchServer) error
mustEmbedUnimplementedRegisterServer()
}
// UnimplementedRegisterServer must be embedded to have forward compatible implementations.
type UnimplementedRegisterServer struct {
}
func (*UnimplementedRegisterServer) LookupService(context.Context, *LookupRequest) (*LookupResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method LookupService not implemented")
}
func (*UnimplementedRegisterServer) Register(context.Context, *Service) (*EmptyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Register not implemented")
}
func (*UnimplementedRegisterServer) Deregister(context.Context, *Service) (*EmptyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Deregister not implemented")
}
func (*UnimplementedRegisterServer) ListServices(context.Context, *ListRequest) (*ListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListServices not implemented")
}
func (*UnimplementedRegisterServer) Watch(*WatchRequest, Register_WatchServer) error {
return status.Errorf(codes.Unimplemented, "method Watch not implemented")
}
func (*UnimplementedRegisterServer) mustEmbedUnimplementedRegisterServer() {}
func RegisterRegisterServer(s *grpc.Server, srv RegisterServer) {
s.RegisterService(&_Register_serviceDesc, srv)
}
func _Register_LookupService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LookupRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RegisterServer).LookupService(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/service.Register/LookupService",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RegisterServer).LookupService(ctx, req.(*LookupRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Register_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Service)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RegisterServer).Register(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/service.Register/Register",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RegisterServer).Register(ctx, req.(*Service))
}
return interceptor(ctx, in, info, handler)
}
func _Register_Deregister_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Service)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RegisterServer).Deregister(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/service.Register/Deregister",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RegisterServer).Deregister(ctx, req.(*Service))
}
return interceptor(ctx, in, info, handler)
}
func _Register_ListServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RegisterServer).ListServices(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/service.Register/ListServices",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RegisterServer).ListServices(ctx, req.(*ListRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Register_Watch_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(WatchRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(RegisterServer).Watch(m, &registerWatchServer{stream})
}
type Register_WatchServer interface {
Send(*Result) error
grpc.ServerStream
}
type registerWatchServer struct {
grpc.ServerStream
}
func (x *registerWatchServer) Send(m *Result) error {
return x.ServerStream.SendMsg(m)
}
var _Register_serviceDesc = grpc.ServiceDesc{
ServiceName: "service.Register",
HandlerType: (*RegisterServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "LookupService",
Handler: _Register_LookupService_Handler,
},
{
MethodName: "Register",
Handler: _Register_Register_Handler,
},
{
MethodName: "Deregister",
Handler: _Register_Deregister_Handler,
},
{
MethodName: "ListServices",
Handler: _Register_ListServices_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "Watch",
Handler: _Register_Watch_Handler,
ServerStreams: true,
},
},
Metadata: "register.proto",
}