github.com/letsencrypt/boulder@v0.20251208.0/nonce/proto/nonce_grpc.pb.go (about)

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  // versions:
     3  // - protoc-gen-go-grpc v1.5.1
     4  // - protoc             v3.20.1
     5  // source: nonce.proto
     6  
     7  package proto
     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  	emptypb "google.golang.org/protobuf/types/known/emptypb"
    15  )
    16  
    17  // This is a compile-time assertion to ensure that this generated file
    18  // is compatible with the grpc package it is being compiled against.
    19  // Requires gRPC-Go v1.64.0 or later.
    20  const _ = grpc.SupportPackageIsVersion9
    21  
    22  const (
    23  	NonceService_Nonce_FullMethodName  = "/nonce.NonceService/Nonce"
    24  	NonceService_Redeem_FullMethodName = "/nonce.NonceService/Redeem"
    25  )
    26  
    27  // NonceServiceClient is the client API for NonceService service.
    28  //
    29  // 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.
    30  type NonceServiceClient interface {
    31  	Nonce(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*NonceMessage, error)
    32  	Redeem(ctx context.Context, in *NonceMessage, opts ...grpc.CallOption) (*ValidMessage, error)
    33  }
    34  
    35  type nonceServiceClient struct {
    36  	cc grpc.ClientConnInterface
    37  }
    38  
    39  func NewNonceServiceClient(cc grpc.ClientConnInterface) NonceServiceClient {
    40  	return &nonceServiceClient{cc}
    41  }
    42  
    43  func (c *nonceServiceClient) Nonce(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*NonceMessage, error) {
    44  	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
    45  	out := new(NonceMessage)
    46  	err := c.cc.Invoke(ctx, NonceService_Nonce_FullMethodName, in, out, cOpts...)
    47  	if err != nil {
    48  		return nil, err
    49  	}
    50  	return out, nil
    51  }
    52  
    53  func (c *nonceServiceClient) Redeem(ctx context.Context, in *NonceMessage, opts ...grpc.CallOption) (*ValidMessage, error) {
    54  	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
    55  	out := new(ValidMessage)
    56  	err := c.cc.Invoke(ctx, NonceService_Redeem_FullMethodName, in, out, cOpts...)
    57  	if err != nil {
    58  		return nil, err
    59  	}
    60  	return out, nil
    61  }
    62  
    63  // NonceServiceServer is the server API for NonceService service.
    64  // All implementations must embed UnimplementedNonceServiceServer
    65  // for forward compatibility.
    66  type NonceServiceServer interface {
    67  	Nonce(context.Context, *emptypb.Empty) (*NonceMessage, error)
    68  	Redeem(context.Context, *NonceMessage) (*ValidMessage, error)
    69  	mustEmbedUnimplementedNonceServiceServer()
    70  }
    71  
    72  // UnimplementedNonceServiceServer must be embedded to have
    73  // forward compatible implementations.
    74  //
    75  // NOTE: this should be embedded by value instead of pointer to avoid a nil
    76  // pointer dereference when methods are called.
    77  type UnimplementedNonceServiceServer struct{}
    78  
    79  func (UnimplementedNonceServiceServer) Nonce(context.Context, *emptypb.Empty) (*NonceMessage, error) {
    80  	return nil, status.Errorf(codes.Unimplemented, "method Nonce not implemented")
    81  }
    82  func (UnimplementedNonceServiceServer) Redeem(context.Context, *NonceMessage) (*ValidMessage, error) {
    83  	return nil, status.Errorf(codes.Unimplemented, "method Redeem not implemented")
    84  }
    85  func (UnimplementedNonceServiceServer) mustEmbedUnimplementedNonceServiceServer() {}
    86  func (UnimplementedNonceServiceServer) testEmbeddedByValue()                      {}
    87  
    88  // UnsafeNonceServiceServer may be embedded to opt out of forward compatibility for this service.
    89  // Use of this interface is not recommended, as added methods to NonceServiceServer will
    90  // result in compilation errors.
    91  type UnsafeNonceServiceServer interface {
    92  	mustEmbedUnimplementedNonceServiceServer()
    93  }
    94  
    95  func RegisterNonceServiceServer(s grpc.ServiceRegistrar, srv NonceServiceServer) {
    96  	// If the following call pancis, it indicates UnimplementedNonceServiceServer was
    97  	// embedded by pointer and is nil.  This will cause panics if an
    98  	// unimplemented method is ever invoked, so we test this at initialization
    99  	// time to prevent it from happening at runtime later due to I/O.
   100  	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
   101  		t.testEmbeddedByValue()
   102  	}
   103  	s.RegisterService(&NonceService_ServiceDesc, srv)
   104  }
   105  
   106  func _NonceService_Nonce_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   107  	in := new(emptypb.Empty)
   108  	if err := dec(in); err != nil {
   109  		return nil, err
   110  	}
   111  	if interceptor == nil {
   112  		return srv.(NonceServiceServer).Nonce(ctx, in)
   113  	}
   114  	info := &grpc.UnaryServerInfo{
   115  		Server:     srv,
   116  		FullMethod: NonceService_Nonce_FullMethodName,
   117  	}
   118  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   119  		return srv.(NonceServiceServer).Nonce(ctx, req.(*emptypb.Empty))
   120  	}
   121  	return interceptor(ctx, in, info, handler)
   122  }
   123  
   124  func _NonceService_Redeem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   125  	in := new(NonceMessage)
   126  	if err := dec(in); err != nil {
   127  		return nil, err
   128  	}
   129  	if interceptor == nil {
   130  		return srv.(NonceServiceServer).Redeem(ctx, in)
   131  	}
   132  	info := &grpc.UnaryServerInfo{
   133  		Server:     srv,
   134  		FullMethod: NonceService_Redeem_FullMethodName,
   135  	}
   136  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   137  		return srv.(NonceServiceServer).Redeem(ctx, req.(*NonceMessage))
   138  	}
   139  	return interceptor(ctx, in, info, handler)
   140  }
   141  
   142  // NonceService_ServiceDesc is the grpc.ServiceDesc for NonceService service.
   143  // It's only intended for direct use with grpc.RegisterService,
   144  // and not to be introspected or modified (even as a copy)
   145  var NonceService_ServiceDesc = grpc.ServiceDesc{
   146  	ServiceName: "nonce.NonceService",
   147  	HandlerType: (*NonceServiceServer)(nil),
   148  	Methods: []grpc.MethodDesc{
   149  		{
   150  			MethodName: "Nonce",
   151  			Handler:    _NonceService_Nonce_Handler,
   152  		},
   153  		{
   154  			MethodName: "Redeem",
   155  			Handler:    _NonceService_Redeem_Handler,
   156  		},
   157  	},
   158  	Streams:  []grpc.StreamDesc{},
   159  	Metadata: "nonce.proto",
   160  }