go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/cv/api/v0/service_runs_grpc.pb.go (about)

     1  // Copyright 2021 The LUCI Authors.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
    16  // versions:
    17  // - protoc-gen-go-grpc v1.3.0
    18  // - protoc             v3.21.7
    19  // source: go.chromium.org/luci/cv/api/v0/service_runs.proto
    20  
    21  package cvpb
    22  
    23  import (
    24  	context "context"
    25  	grpc "google.golang.org/grpc"
    26  	codes "google.golang.org/grpc/codes"
    27  	status "google.golang.org/grpc/status"
    28  )
    29  
    30  // This is a compile-time assertion to ensure that this generated file
    31  // is compatible with the grpc package it is being compiled against.
    32  // Requires gRPC-Go v1.32.0 or later.
    33  const _ = grpc.SupportPackageIsVersion7
    34  
    35  const (
    36  	Runs_GetRun_FullMethodName     = "/cv.v0.Runs/GetRun"
    37  	Runs_SearchRuns_FullMethodName = "/cv.v0.Runs/SearchRuns"
    38  )
    39  
    40  // RunsClient is the client API for Runs service.
    41  //
    42  // 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.
    43  type RunsClient interface {
    44  	// GetRun returns Run details.
    45  	GetRun(ctx context.Context, in *GetRunRequest, opts ...grpc.CallOption) (*Run, error)
    46  	// SearchRuns searches for Runs.
    47  	SearchRuns(ctx context.Context, in *SearchRunsRequest, opts ...grpc.CallOption) (*SearchRunsResponse, error)
    48  }
    49  
    50  type runsClient struct {
    51  	cc grpc.ClientConnInterface
    52  }
    53  
    54  func NewRunsClient(cc grpc.ClientConnInterface) RunsClient {
    55  	return &runsClient{cc}
    56  }
    57  
    58  func (c *runsClient) GetRun(ctx context.Context, in *GetRunRequest, opts ...grpc.CallOption) (*Run, error) {
    59  	out := new(Run)
    60  	err := c.cc.Invoke(ctx, Runs_GetRun_FullMethodName, in, out, opts...)
    61  	if err != nil {
    62  		return nil, err
    63  	}
    64  	return out, nil
    65  }
    66  
    67  func (c *runsClient) SearchRuns(ctx context.Context, in *SearchRunsRequest, opts ...grpc.CallOption) (*SearchRunsResponse, error) {
    68  	out := new(SearchRunsResponse)
    69  	err := c.cc.Invoke(ctx, Runs_SearchRuns_FullMethodName, in, out, opts...)
    70  	if err != nil {
    71  		return nil, err
    72  	}
    73  	return out, nil
    74  }
    75  
    76  // RunsServer is the server API for Runs service.
    77  // All implementations must embed UnimplementedRunsServer
    78  // for forward compatibility
    79  type RunsServer interface {
    80  	// GetRun returns Run details.
    81  	GetRun(context.Context, *GetRunRequest) (*Run, error)
    82  	// SearchRuns searches for Runs.
    83  	SearchRuns(context.Context, *SearchRunsRequest) (*SearchRunsResponse, error)
    84  	mustEmbedUnimplementedRunsServer()
    85  }
    86  
    87  // UnimplementedRunsServer must be embedded to have forward compatible implementations.
    88  type UnimplementedRunsServer struct {
    89  }
    90  
    91  func (UnimplementedRunsServer) GetRun(context.Context, *GetRunRequest) (*Run, error) {
    92  	return nil, status.Errorf(codes.Unimplemented, "method GetRun not implemented")
    93  }
    94  func (UnimplementedRunsServer) SearchRuns(context.Context, *SearchRunsRequest) (*SearchRunsResponse, error) {
    95  	return nil, status.Errorf(codes.Unimplemented, "method SearchRuns not implemented")
    96  }
    97  func (UnimplementedRunsServer) mustEmbedUnimplementedRunsServer() {}
    98  
    99  // UnsafeRunsServer may be embedded to opt out of forward compatibility for this service.
   100  // Use of this interface is not recommended, as added methods to RunsServer will
   101  // result in compilation errors.
   102  type UnsafeRunsServer interface {
   103  	mustEmbedUnimplementedRunsServer()
   104  }
   105  
   106  func RegisterRunsServer(s grpc.ServiceRegistrar, srv RunsServer) {
   107  	s.RegisterService(&Runs_ServiceDesc, srv)
   108  }
   109  
   110  func _Runs_GetRun_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   111  	in := new(GetRunRequest)
   112  	if err := dec(in); err != nil {
   113  		return nil, err
   114  	}
   115  	if interceptor == nil {
   116  		return srv.(RunsServer).GetRun(ctx, in)
   117  	}
   118  	info := &grpc.UnaryServerInfo{
   119  		Server:     srv,
   120  		FullMethod: Runs_GetRun_FullMethodName,
   121  	}
   122  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   123  		return srv.(RunsServer).GetRun(ctx, req.(*GetRunRequest))
   124  	}
   125  	return interceptor(ctx, in, info, handler)
   126  }
   127  
   128  func _Runs_SearchRuns_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   129  	in := new(SearchRunsRequest)
   130  	if err := dec(in); err != nil {
   131  		return nil, err
   132  	}
   133  	if interceptor == nil {
   134  		return srv.(RunsServer).SearchRuns(ctx, in)
   135  	}
   136  	info := &grpc.UnaryServerInfo{
   137  		Server:     srv,
   138  		FullMethod: Runs_SearchRuns_FullMethodName,
   139  	}
   140  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   141  		return srv.(RunsServer).SearchRuns(ctx, req.(*SearchRunsRequest))
   142  	}
   143  	return interceptor(ctx, in, info, handler)
   144  }
   145  
   146  // Runs_ServiceDesc is the grpc.ServiceDesc for Runs service.
   147  // It's only intended for direct use with grpc.RegisterService,
   148  // and not to be introspected or modified (even as a copy)
   149  var Runs_ServiceDesc = grpc.ServiceDesc{
   150  	ServiceName: "cv.v0.Runs",
   151  	HandlerType: (*RunsServer)(nil),
   152  	Methods: []grpc.MethodDesc{
   153  		{
   154  			MethodName: "GetRun",
   155  			Handler:    _Runs_GetRun_Handler,
   156  		},
   157  		{
   158  			MethodName: "SearchRuns",
   159  			Handler:    _Runs_SearchRuns_Handler,
   160  		},
   161  	},
   162  	Streams:  []grpc.StreamDesc{},
   163  	Metadata: "go.chromium.org/luci/cv/api/v0/service_runs.proto",
   164  }