github.com/letsencrypt/boulder@v0.20251208.0/grpc/test_proto/interceptors_test_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: interceptors_test.proto
     6  
     7  package test_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  )
    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.64.0 or later.
    19  const _ = grpc.SupportPackageIsVersion9
    20  
    21  const (
    22  	Chiller_Chill_FullMethodName = "/Chiller/Chill"
    23  )
    24  
    25  // ChillerClient is the client API for Chiller 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 ChillerClient interface {
    29  	// Sleep for the given amount of time, and return the amount of time slept.
    30  	Chill(ctx context.Context, in *Time, opts ...grpc.CallOption) (*Time, error)
    31  }
    32  
    33  type chillerClient struct {
    34  	cc grpc.ClientConnInterface
    35  }
    36  
    37  func NewChillerClient(cc grpc.ClientConnInterface) ChillerClient {
    38  	return &chillerClient{cc}
    39  }
    40  
    41  func (c *chillerClient) Chill(ctx context.Context, in *Time, opts ...grpc.CallOption) (*Time, error) {
    42  	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
    43  	out := new(Time)
    44  	err := c.cc.Invoke(ctx, Chiller_Chill_FullMethodName, in, out, cOpts...)
    45  	if err != nil {
    46  		return nil, err
    47  	}
    48  	return out, nil
    49  }
    50  
    51  // ChillerServer is the server API for Chiller service.
    52  // All implementations must embed UnimplementedChillerServer
    53  // for forward compatibility.
    54  type ChillerServer interface {
    55  	// Sleep for the given amount of time, and return the amount of time slept.
    56  	Chill(context.Context, *Time) (*Time, error)
    57  	mustEmbedUnimplementedChillerServer()
    58  }
    59  
    60  // UnimplementedChillerServer must be embedded to have
    61  // forward compatible implementations.
    62  //
    63  // NOTE: this should be embedded by value instead of pointer to avoid a nil
    64  // pointer dereference when methods are called.
    65  type UnimplementedChillerServer struct{}
    66  
    67  func (UnimplementedChillerServer) Chill(context.Context, *Time) (*Time, error) {
    68  	return nil, status.Errorf(codes.Unimplemented, "method Chill not implemented")
    69  }
    70  func (UnimplementedChillerServer) mustEmbedUnimplementedChillerServer() {}
    71  func (UnimplementedChillerServer) testEmbeddedByValue()                 {}
    72  
    73  // UnsafeChillerServer may be embedded to opt out of forward compatibility for this service.
    74  // Use of this interface is not recommended, as added methods to ChillerServer will
    75  // result in compilation errors.
    76  type UnsafeChillerServer interface {
    77  	mustEmbedUnimplementedChillerServer()
    78  }
    79  
    80  func RegisterChillerServer(s grpc.ServiceRegistrar, srv ChillerServer) {
    81  	// If the following call pancis, it indicates UnimplementedChillerServer was
    82  	// embedded by pointer and is nil.  This will cause panics if an
    83  	// unimplemented method is ever invoked, so we test this at initialization
    84  	// time to prevent it from happening at runtime later due to I/O.
    85  	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
    86  		t.testEmbeddedByValue()
    87  	}
    88  	s.RegisterService(&Chiller_ServiceDesc, srv)
    89  }
    90  
    91  func _Chiller_Chill_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    92  	in := new(Time)
    93  	if err := dec(in); err != nil {
    94  		return nil, err
    95  	}
    96  	if interceptor == nil {
    97  		return srv.(ChillerServer).Chill(ctx, in)
    98  	}
    99  	info := &grpc.UnaryServerInfo{
   100  		Server:     srv,
   101  		FullMethod: Chiller_Chill_FullMethodName,
   102  	}
   103  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   104  		return srv.(ChillerServer).Chill(ctx, req.(*Time))
   105  	}
   106  	return interceptor(ctx, in, info, handler)
   107  }
   108  
   109  // Chiller_ServiceDesc is the grpc.ServiceDesc for Chiller service.
   110  // It's only intended for direct use with grpc.RegisterService,
   111  // and not to be introspected or modified (even as a copy)
   112  var Chiller_ServiceDesc = grpc.ServiceDesc{
   113  	ServiceName: "Chiller",
   114  	HandlerType: (*ChillerServer)(nil),
   115  	Methods: []grpc.MethodDesc{
   116  		{
   117  			MethodName: "Chill",
   118  			Handler:    _Chiller_Chill_Handler,
   119  		},
   120  	},
   121  	Streams:  []grpc.StreamDesc{},
   122  	Metadata: "interceptors_test.proto",
   123  }