blob: 3b2cba4b99cf5a57a3e422d6686e3c09379d7dcf [file] [log] [blame]
// Copyright 2018 The LUCI Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v3.21.7
// source: go.chromium.org/luci/cipd/api/admin/v1/admin.proto
package api
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// 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
const (
Admin_LaunchJob_FullMethodName = "/cipd.Admin/LaunchJob"
Admin_AbortJob_FullMethodName = "/cipd.Admin/AbortJob"
Admin_GetJobState_FullMethodName = "/cipd.Admin/GetJobState"
Admin_FixMarkedTags_FullMethodName = "/cipd.Admin/FixMarkedTags"
)
// AdminClient is the client API for Admin 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 AdminClient interface {
// Launches a mapping job that examines and/or fixes datastore entities.
LaunchJob(ctx context.Context, in *JobConfig, opts ...grpc.CallOption) (*JobID, error)
// Initiates an abort of a mapping job.
AbortJob(ctx context.Context, in *JobID, opts ...grpc.CallOption) (*emptypb.Empty, error)
// Returns state of a mapping job.
GetJobState(ctx context.Context, in *JobID, opts ...grpc.CallOption) (*JobState, error)
// Fixes (right inside the handler) tags marked by the given mapper job.
FixMarkedTags(ctx context.Context, in *JobID, opts ...grpc.CallOption) (*TagFixReport, error)
}
type adminClient struct {
cc grpc.ClientConnInterface
}
func NewAdminClient(cc grpc.ClientConnInterface) AdminClient {
return &adminClient{cc}
}
func (c *adminClient) LaunchJob(ctx context.Context, in *JobConfig, opts ...grpc.CallOption) (*JobID, error) {
out := new(JobID)
err := c.cc.Invoke(ctx, Admin_LaunchJob_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *adminClient) AbortJob(ctx context.Context, in *JobID, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, Admin_AbortJob_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *adminClient) GetJobState(ctx context.Context, in *JobID, opts ...grpc.CallOption) (*JobState, error) {
out := new(JobState)
err := c.cc.Invoke(ctx, Admin_GetJobState_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *adminClient) FixMarkedTags(ctx context.Context, in *JobID, opts ...grpc.CallOption) (*TagFixReport, error) {
out := new(TagFixReport)
err := c.cc.Invoke(ctx, Admin_FixMarkedTags_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// AdminServer is the server API for Admin service.
// All implementations must embed UnimplementedAdminServer
// for forward compatibility
type AdminServer interface {
// Launches a mapping job that examines and/or fixes datastore entities.
LaunchJob(context.Context, *JobConfig) (*JobID, error)
// Initiates an abort of a mapping job.
AbortJob(context.Context, *JobID) (*emptypb.Empty, error)
// Returns state of a mapping job.
GetJobState(context.Context, *JobID) (*JobState, error)
// Fixes (right inside the handler) tags marked by the given mapper job.
FixMarkedTags(context.Context, *JobID) (*TagFixReport, error)
mustEmbedUnimplementedAdminServer()
}
// UnimplementedAdminServer must be embedded to have forward compatible implementations.
type UnimplementedAdminServer struct {
}
func (UnimplementedAdminServer) LaunchJob(context.Context, *JobConfig) (*JobID, error) {
return nil, status.Errorf(codes.Unimplemented, "method LaunchJob not implemented")
}
func (UnimplementedAdminServer) AbortJob(context.Context, *JobID) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method AbortJob not implemented")
}
func (UnimplementedAdminServer) GetJobState(context.Context, *JobID) (*JobState, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetJobState not implemented")
}
func (UnimplementedAdminServer) FixMarkedTags(context.Context, *JobID) (*TagFixReport, error) {
return nil, status.Errorf(codes.Unimplemented, "method FixMarkedTags not implemented")
}
func (UnimplementedAdminServer) mustEmbedUnimplementedAdminServer() {}
// UnsafeAdminServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AdminServer will
// result in compilation errors.
type UnsafeAdminServer interface {
mustEmbedUnimplementedAdminServer()
}
func RegisterAdminServer(s grpc.ServiceRegistrar, srv AdminServer) {
s.RegisterService(&Admin_ServiceDesc, srv)
}
func _Admin_LaunchJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(JobConfig)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AdminServer).LaunchJob(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Admin_LaunchJob_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AdminServer).LaunchJob(ctx, req.(*JobConfig))
}
return interceptor(ctx, in, info, handler)
}
func _Admin_AbortJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(JobID)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AdminServer).AbortJob(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Admin_AbortJob_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AdminServer).AbortJob(ctx, req.(*JobID))
}
return interceptor(ctx, in, info, handler)
}
func _Admin_GetJobState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(JobID)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AdminServer).GetJobState(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Admin_GetJobState_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AdminServer).GetJobState(ctx, req.(*JobID))
}
return interceptor(ctx, in, info, handler)
}
func _Admin_FixMarkedTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(JobID)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AdminServer).FixMarkedTags(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Admin_FixMarkedTags_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AdminServer).FixMarkedTags(ctx, req.(*JobID))
}
return interceptor(ctx, in, info, handler)
}
// Admin_ServiceDesc is the grpc.ServiceDesc for Admin service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Admin_ServiceDesc = grpc.ServiceDesc{
ServiceName: "cipd.Admin",
HandlerType: (*AdminServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "LaunchJob",
Handler: _Admin_LaunchJob_Handler,
},
{
MethodName: "AbortJob",
Handler: _Admin_AbortJob_Handler,
},
{
MethodName: "GetJobState",
Handler: _Admin_GetJobState_Handler,
},
{
MethodName: "FixMarkedTags",
Handler: _Admin_FixMarkedTags_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "go.chromium.org/luci/cipd/api/admin/v1/admin.proto",
}