| // Code generated by protoc-gen-go-grpc. DO NOT EDIT. | |
| // versions: | |
| // - protoc-gen-go-grpc v1.2.0 | |
| // - protoc v3.20.1 | |
| // source: interceptors_test.proto | |
| package test_proto | |
| 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. | |
| // Requires gRPC-Go v1.32.0 or later. | |
| const _ = grpc.SupportPackageIsVersion7 | |
| // ChillerClient is the client API for Chiller 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 ChillerClient interface { | |
| // Sleep for the given amount of time, and return the amount of time slept. | |
| Chill(ctx context.Context, in *Time, opts ...grpc.CallOption) (*Time, error) | |
| } | |
| type chillerClient struct { | |
| cc grpc.ClientConnInterface | |
| } | |
| func NewChillerClient(cc grpc.ClientConnInterface) ChillerClient { | |
| return &chillerClient{cc} | |
| } | |
| func (c *chillerClient) Chill(ctx context.Context, in *Time, opts ...grpc.CallOption) (*Time, error) { | |
| out := new(Time) | |
| err := c.cc.Invoke(ctx, "/Chiller/Chill", in, out, opts...) | |
| if err != nil { | |
| return nil, err | |
| } | |
| return out, nil | |
| } | |
| // ChillerServer is the server API for Chiller service. | |
| // All implementations must embed UnimplementedChillerServer | |
| // for forward compatibility | |
| type ChillerServer interface { | |
| // Sleep for the given amount of time, and return the amount of time slept. | |
| Chill(context.Context, *Time) (*Time, error) | |
| mustEmbedUnimplementedChillerServer() | |
| } | |
| // UnimplementedChillerServer must be embedded to have forward compatible implementations. | |
| type UnimplementedChillerServer struct { | |
| } | |
| func (UnimplementedChillerServer) Chill(context.Context, *Time) (*Time, error) { | |
| return nil, status.Errorf(codes.Unimplemented, "method Chill not implemented") | |
| } | |
| func (UnimplementedChillerServer) mustEmbedUnimplementedChillerServer() {} | |
| // UnsafeChillerServer may be embedded to opt out of forward compatibility for this service. | |
| // Use of this interface is not recommended, as added methods to ChillerServer will | |
| // result in compilation errors. | |
| type UnsafeChillerServer interface { | |
| mustEmbedUnimplementedChillerServer() | |
| } | |
| func RegisterChillerServer(s grpc.ServiceRegistrar, srv ChillerServer) { | |
| s.RegisterService(&Chiller_ServiceDesc, srv) | |
| } | |
| func _Chiller_Chill_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | |
| in := new(Time) | |
| if err := dec(in); err != nil { | |
| return nil, err | |
| } | |
| if interceptor == nil { | |
| return srv.(ChillerServer).Chill(ctx, in) | |
| } | |
| info := &grpc.UnaryServerInfo{ | |
| Server: srv, | |
| FullMethod: "/Chiller/Chill", | |
| } | |
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { | |
| return srv.(ChillerServer).Chill(ctx, req.(*Time)) | |
| } | |
| return interceptor(ctx, in, info, handler) | |
| } | |
| // Chiller_ServiceDesc is the grpc.ServiceDesc for Chiller service. | |
| // It's only intended for direct use with grpc.RegisterService, | |
| // and not to be introspected or modified (even as a copy) | |
| var Chiller_ServiceDesc = grpc.ServiceDesc{ | |
| ServiceName: "Chiller", | |
| HandlerType: (*ChillerServer)(nil), | |
| Methods: []grpc.MethodDesc{ | |
| { | |
| MethodName: "Chill", | |
| Handler: _Chiller_Chill_Handler, | |
| }, | |
| }, | |
| Streams: []grpc.StreamDesc{}, | |
| Metadata: "interceptors_test.proto", | |
| } |