go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/swarming/proto/internals/rbe_grpc.pb.go (about)

     1  // Copyright 2022 The LUCI Authors. All rights reserved.
     2  // Use of this source code is governed under the Apache License, Version 2.0
     3  // that can be found in the LICENSE file.
     4  
     5  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     6  // versions:
     7  // - protoc-gen-go-grpc v1.3.0
     8  // - protoc             v3.21.7
     9  // source: go.chromium.org/luci/swarming/proto/internals/rbe.proto
    10  
    11  package internalspb
    12  
    13  import (
    14  	context "context"
    15  	grpc "google.golang.org/grpc"
    16  	codes "google.golang.org/grpc/codes"
    17  	status "google.golang.org/grpc/status"
    18  	emptypb "google.golang.org/protobuf/types/known/emptypb"
    19  )
    20  
    21  // This is a compile-time assertion to ensure that this generated file
    22  // is compatible with the grpc package it is being compiled against.
    23  // Requires gRPC-Go v1.32.0 or later.
    24  const _ = grpc.SupportPackageIsVersion7
    25  
    26  const (
    27  	Internals_ExpireSlice_FullMethodName = "/swarming.internals.rbe.Internals/ExpireSlice"
    28  )
    29  
    30  // InternalsClient is the client API for Internals service.
    31  //
    32  // 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.
    33  type InternalsClient interface {
    34  	// Marks the slice as expired or failed, switches the task to the next slice.
    35  	//
    36  	// Does nothing (and succeeds) if the slice is no longer pending or doesn't
    37  	// exist.
    38  	ExpireSlice(ctx context.Context, in *ExpireSliceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
    39  }
    40  
    41  type internalsClient struct {
    42  	cc grpc.ClientConnInterface
    43  }
    44  
    45  func NewInternalsClient(cc grpc.ClientConnInterface) InternalsClient {
    46  	return &internalsClient{cc}
    47  }
    48  
    49  func (c *internalsClient) ExpireSlice(ctx context.Context, in *ExpireSliceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
    50  	out := new(emptypb.Empty)
    51  	err := c.cc.Invoke(ctx, Internals_ExpireSlice_FullMethodName, in, out, opts...)
    52  	if err != nil {
    53  		return nil, err
    54  	}
    55  	return out, nil
    56  }
    57  
    58  // InternalsServer is the server API for Internals service.
    59  // All implementations must embed UnimplementedInternalsServer
    60  // for forward compatibility
    61  type InternalsServer interface {
    62  	// Marks the slice as expired or failed, switches the task to the next slice.
    63  	//
    64  	// Does nothing (and succeeds) if the slice is no longer pending or doesn't
    65  	// exist.
    66  	ExpireSlice(context.Context, *ExpireSliceRequest) (*emptypb.Empty, error)
    67  	mustEmbedUnimplementedInternalsServer()
    68  }
    69  
    70  // UnimplementedInternalsServer must be embedded to have forward compatible implementations.
    71  type UnimplementedInternalsServer struct {
    72  }
    73  
    74  func (UnimplementedInternalsServer) ExpireSlice(context.Context, *ExpireSliceRequest) (*emptypb.Empty, error) {
    75  	return nil, status.Errorf(codes.Unimplemented, "method ExpireSlice not implemented")
    76  }
    77  func (UnimplementedInternalsServer) mustEmbedUnimplementedInternalsServer() {}
    78  
    79  // UnsafeInternalsServer may be embedded to opt out of forward compatibility for this service.
    80  // Use of this interface is not recommended, as added methods to InternalsServer will
    81  // result in compilation errors.
    82  type UnsafeInternalsServer interface {
    83  	mustEmbedUnimplementedInternalsServer()
    84  }
    85  
    86  func RegisterInternalsServer(s grpc.ServiceRegistrar, srv InternalsServer) {
    87  	s.RegisterService(&Internals_ServiceDesc, srv)
    88  }
    89  
    90  func _Internals_ExpireSlice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    91  	in := new(ExpireSliceRequest)
    92  	if err := dec(in); err != nil {
    93  		return nil, err
    94  	}
    95  	if interceptor == nil {
    96  		return srv.(InternalsServer).ExpireSlice(ctx, in)
    97  	}
    98  	info := &grpc.UnaryServerInfo{
    99  		Server:     srv,
   100  		FullMethod: Internals_ExpireSlice_FullMethodName,
   101  	}
   102  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   103  		return srv.(InternalsServer).ExpireSlice(ctx, req.(*ExpireSliceRequest))
   104  	}
   105  	return interceptor(ctx, in, info, handler)
   106  }
   107  
   108  // Internals_ServiceDesc is the grpc.ServiceDesc for Internals service.
   109  // It's only intended for direct use with grpc.RegisterService,
   110  // and not to be introspected or modified (even as a copy)
   111  var Internals_ServiceDesc = grpc.ServiceDesc{
   112  	ServiceName: "swarming.internals.rbe.Internals",
   113  	HandlerType: (*InternalsServer)(nil),
   114  	Methods: []grpc.MethodDesc{
   115  		{
   116  			MethodName: "ExpireSlice",
   117  			Handler:    _Internals_ExpireSlice_Handler,
   118  		},
   119  	},
   120  	Streams:  []grpc.StreamDesc{},
   121  	Metadata: "go.chromium.org/luci/swarming/proto/internals/rbe.proto",
   122  }