github.com/godaddy-x/freego@v1.0.156/rpcx/pb/pub_worker_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.21.5
     5  // source: rpcx/proto/pub_worker.proto
     6  
     7  package pb
     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  // PubWorkerClient is the client API for PubWorker 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 PubWorkerClient interface {
    25  	GenerateId(ctx context.Context, in *GenerateIdReq, opts ...grpc.CallOption) (*GenerateIdRes, error)
    26  	Authorize(ctx context.Context, in *AuthorizeReq, opts ...grpc.CallOption) (*AuthorizeRes, error)
    27  	PublicKey(ctx context.Context, in *PublicKeyReq, opts ...grpc.CallOption) (*PublicKeyRes, error)
    28  }
    29  
    30  type pubWorkerClient struct {
    31  	cc grpc.ClientConnInterface
    32  }
    33  
    34  func NewPubWorkerClient(cc grpc.ClientConnInterface) PubWorkerClient {
    35  	return &pubWorkerClient{cc}
    36  }
    37  
    38  func (c *pubWorkerClient) GenerateId(ctx context.Context, in *GenerateIdReq, opts ...grpc.CallOption) (*GenerateIdRes, error) {
    39  	out := new(GenerateIdRes)
    40  	err := c.cc.Invoke(ctx, "/pub_worker.PubWorker/GenerateId", in, out, opts...)
    41  	if err != nil {
    42  		return nil, err
    43  	}
    44  	return out, nil
    45  }
    46  
    47  func (c *pubWorkerClient) Authorize(ctx context.Context, in *AuthorizeReq, opts ...grpc.CallOption) (*AuthorizeRes, error) {
    48  	out := new(AuthorizeRes)
    49  	err := c.cc.Invoke(ctx, "/pub_worker.PubWorker/Authorize", in, out, opts...)
    50  	if err != nil {
    51  		return nil, err
    52  	}
    53  	return out, nil
    54  }
    55  
    56  func (c *pubWorkerClient) PublicKey(ctx context.Context, in *PublicKeyReq, opts ...grpc.CallOption) (*PublicKeyRes, error) {
    57  	out := new(PublicKeyRes)
    58  	err := c.cc.Invoke(ctx, "/pub_worker.PubWorker/PublicKey", in, out, opts...)
    59  	if err != nil {
    60  		return nil, err
    61  	}
    62  	return out, nil
    63  }
    64  
    65  // PubWorkerServer is the server API for PubWorker service.
    66  // All implementations must embed UnimplementedPubWorkerServer
    67  // for forward compatibility
    68  type PubWorkerServer interface {
    69  	GenerateId(context.Context, *GenerateIdReq) (*GenerateIdRes, error)
    70  	Authorize(context.Context, *AuthorizeReq) (*AuthorizeRes, error)
    71  	PublicKey(context.Context, *PublicKeyReq) (*PublicKeyRes, error)
    72  	mustEmbedUnimplementedPubWorkerServer()
    73  }
    74  
    75  // UnimplementedPubWorkerServer must be embedded to have forward compatible implementations.
    76  type UnimplementedPubWorkerServer struct {
    77  }
    78  
    79  func (UnimplementedPubWorkerServer) GenerateId(context.Context, *GenerateIdReq) (*GenerateIdRes, error) {
    80  	return nil, status.Errorf(codes.Unimplemented, "method GenerateId not implemented")
    81  }
    82  func (UnimplementedPubWorkerServer) Authorize(context.Context, *AuthorizeReq) (*AuthorizeRes, error) {
    83  	return nil, status.Errorf(codes.Unimplemented, "method Authorize not implemented")
    84  }
    85  func (UnimplementedPubWorkerServer) PublicKey(context.Context, *PublicKeyReq) (*PublicKeyRes, error) {
    86  	return nil, status.Errorf(codes.Unimplemented, "method PublicKey not implemented")
    87  }
    88  func (UnimplementedPubWorkerServer) mustEmbedUnimplementedPubWorkerServer() {}
    89  
    90  // UnsafePubWorkerServer may be embedded to opt out of forward compatibility for this service.
    91  // Use of this interface is not recommended, as added methods to PubWorkerServer will
    92  // result in compilation errors.
    93  type UnsafePubWorkerServer interface {
    94  	mustEmbedUnimplementedPubWorkerServer()
    95  }
    96  
    97  func RegisterPubWorkerServer(s grpc.ServiceRegistrar, srv PubWorkerServer) {
    98  	s.RegisterService(&PubWorker_ServiceDesc, srv)
    99  }
   100  
   101  func _PubWorker_GenerateId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   102  	in := new(GenerateIdReq)
   103  	if err := dec(in); err != nil {
   104  		return nil, err
   105  	}
   106  	if interceptor == nil {
   107  		return srv.(PubWorkerServer).GenerateId(ctx, in)
   108  	}
   109  	info := &grpc.UnaryServerInfo{
   110  		Server:     srv,
   111  		FullMethod: "/pub_worker.PubWorker/GenerateId",
   112  	}
   113  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   114  		return srv.(PubWorkerServer).GenerateId(ctx, req.(*GenerateIdReq))
   115  	}
   116  	return interceptor(ctx, in, info, handler)
   117  }
   118  
   119  func _PubWorker_Authorize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   120  	in := new(AuthorizeReq)
   121  	if err := dec(in); err != nil {
   122  		return nil, err
   123  	}
   124  	if interceptor == nil {
   125  		return srv.(PubWorkerServer).Authorize(ctx, in)
   126  	}
   127  	info := &grpc.UnaryServerInfo{
   128  		Server:     srv,
   129  		FullMethod: "/pub_worker.PubWorker/Authorize",
   130  	}
   131  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   132  		return srv.(PubWorkerServer).Authorize(ctx, req.(*AuthorizeReq))
   133  	}
   134  	return interceptor(ctx, in, info, handler)
   135  }
   136  
   137  func _PubWorker_PublicKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   138  	in := new(PublicKeyReq)
   139  	if err := dec(in); err != nil {
   140  		return nil, err
   141  	}
   142  	if interceptor == nil {
   143  		return srv.(PubWorkerServer).PublicKey(ctx, in)
   144  	}
   145  	info := &grpc.UnaryServerInfo{
   146  		Server:     srv,
   147  		FullMethod: "/pub_worker.PubWorker/PublicKey",
   148  	}
   149  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   150  		return srv.(PubWorkerServer).PublicKey(ctx, req.(*PublicKeyReq))
   151  	}
   152  	return interceptor(ctx, in, info, handler)
   153  }
   154  
   155  // PubWorker_ServiceDesc is the grpc.ServiceDesc for PubWorker service.
   156  // It's only intended for direct use with grpc.RegisterService,
   157  // and not to be introspected or modified (even as a copy)
   158  var PubWorker_ServiceDesc = grpc.ServiceDesc{
   159  	ServiceName: "pub_worker.PubWorker",
   160  	HandlerType: (*PubWorkerServer)(nil),
   161  	Methods: []grpc.MethodDesc{
   162  		{
   163  			MethodName: "GenerateId",
   164  			Handler:    _PubWorker_GenerateId_Handler,
   165  		},
   166  		{
   167  			MethodName: "Authorize",
   168  			Handler:    _PubWorker_Authorize_Handler,
   169  		},
   170  		{
   171  			MethodName: "PublicKey",
   172  			Handler:    _PubWorker_PublicKey_Handler,
   173  		},
   174  	},
   175  	Streams:  []grpc.StreamDesc{},
   176  	Metadata: "rpcx/proto/pub_worker.proto",
   177  }