go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/cipd/api/admin/v1/admin_grpc.pb.go (about)

     1  // Copyright 2018 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/cipd/api/admin/v1/admin.proto
    20  
    21  package api
    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  	emptypb "google.golang.org/protobuf/types/known/emptypb"
    29  )
    30  
    31  // This is a compile-time assertion to ensure that this generated file
    32  // is compatible with the grpc package it is being compiled against.
    33  // Requires gRPC-Go v1.32.0 or later.
    34  const _ = grpc.SupportPackageIsVersion7
    35  
    36  const (
    37  	Admin_LaunchJob_FullMethodName     = "/cipd.Admin/LaunchJob"
    38  	Admin_AbortJob_FullMethodName      = "/cipd.Admin/AbortJob"
    39  	Admin_GetJobState_FullMethodName   = "/cipd.Admin/GetJobState"
    40  	Admin_FixMarkedTags_FullMethodName = "/cipd.Admin/FixMarkedTags"
    41  )
    42  
    43  // AdminClient is the client API for Admin service.
    44  //
    45  // 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.
    46  type AdminClient interface {
    47  	// Launches a mapping job that examines and/or fixes datastore entities.
    48  	LaunchJob(ctx context.Context, in *JobConfig, opts ...grpc.CallOption) (*JobID, error)
    49  	// Initiates an abort of a mapping job.
    50  	AbortJob(ctx context.Context, in *JobID, opts ...grpc.CallOption) (*emptypb.Empty, error)
    51  	// Returns state of a mapping job.
    52  	GetJobState(ctx context.Context, in *JobID, opts ...grpc.CallOption) (*JobState, error)
    53  	// Fixes (right inside the handler) tags marked by the given mapper job.
    54  	FixMarkedTags(ctx context.Context, in *JobID, opts ...grpc.CallOption) (*TagFixReport, error)
    55  }
    56  
    57  type adminClient struct {
    58  	cc grpc.ClientConnInterface
    59  }
    60  
    61  func NewAdminClient(cc grpc.ClientConnInterface) AdminClient {
    62  	return &adminClient{cc}
    63  }
    64  
    65  func (c *adminClient) LaunchJob(ctx context.Context, in *JobConfig, opts ...grpc.CallOption) (*JobID, error) {
    66  	out := new(JobID)
    67  	err := c.cc.Invoke(ctx, Admin_LaunchJob_FullMethodName, in, out, opts...)
    68  	if err != nil {
    69  		return nil, err
    70  	}
    71  	return out, nil
    72  }
    73  
    74  func (c *adminClient) AbortJob(ctx context.Context, in *JobID, opts ...grpc.CallOption) (*emptypb.Empty, error) {
    75  	out := new(emptypb.Empty)
    76  	err := c.cc.Invoke(ctx, Admin_AbortJob_FullMethodName, in, out, opts...)
    77  	if err != nil {
    78  		return nil, err
    79  	}
    80  	return out, nil
    81  }
    82  
    83  func (c *adminClient) GetJobState(ctx context.Context, in *JobID, opts ...grpc.CallOption) (*JobState, error) {
    84  	out := new(JobState)
    85  	err := c.cc.Invoke(ctx, Admin_GetJobState_FullMethodName, in, out, opts...)
    86  	if err != nil {
    87  		return nil, err
    88  	}
    89  	return out, nil
    90  }
    91  
    92  func (c *adminClient) FixMarkedTags(ctx context.Context, in *JobID, opts ...grpc.CallOption) (*TagFixReport, error) {
    93  	out := new(TagFixReport)
    94  	err := c.cc.Invoke(ctx, Admin_FixMarkedTags_FullMethodName, in, out, opts...)
    95  	if err != nil {
    96  		return nil, err
    97  	}
    98  	return out, nil
    99  }
   100  
   101  // AdminServer is the server API for Admin service.
   102  // All implementations must embed UnimplementedAdminServer
   103  // for forward compatibility
   104  type AdminServer interface {
   105  	// Launches a mapping job that examines and/or fixes datastore entities.
   106  	LaunchJob(context.Context, *JobConfig) (*JobID, error)
   107  	// Initiates an abort of a mapping job.
   108  	AbortJob(context.Context, *JobID) (*emptypb.Empty, error)
   109  	// Returns state of a mapping job.
   110  	GetJobState(context.Context, *JobID) (*JobState, error)
   111  	// Fixes (right inside the handler) tags marked by the given mapper job.
   112  	FixMarkedTags(context.Context, *JobID) (*TagFixReport, error)
   113  	mustEmbedUnimplementedAdminServer()
   114  }
   115  
   116  // UnimplementedAdminServer must be embedded to have forward compatible implementations.
   117  type UnimplementedAdminServer struct {
   118  }
   119  
   120  func (UnimplementedAdminServer) LaunchJob(context.Context, *JobConfig) (*JobID, error) {
   121  	return nil, status.Errorf(codes.Unimplemented, "method LaunchJob not implemented")
   122  }
   123  func (UnimplementedAdminServer) AbortJob(context.Context, *JobID) (*emptypb.Empty, error) {
   124  	return nil, status.Errorf(codes.Unimplemented, "method AbortJob not implemented")
   125  }
   126  func (UnimplementedAdminServer) GetJobState(context.Context, *JobID) (*JobState, error) {
   127  	return nil, status.Errorf(codes.Unimplemented, "method GetJobState not implemented")
   128  }
   129  func (UnimplementedAdminServer) FixMarkedTags(context.Context, *JobID) (*TagFixReport, error) {
   130  	return nil, status.Errorf(codes.Unimplemented, "method FixMarkedTags not implemented")
   131  }
   132  func (UnimplementedAdminServer) mustEmbedUnimplementedAdminServer() {}
   133  
   134  // UnsafeAdminServer may be embedded to opt out of forward compatibility for this service.
   135  // Use of this interface is not recommended, as added methods to AdminServer will
   136  // result in compilation errors.
   137  type UnsafeAdminServer interface {
   138  	mustEmbedUnimplementedAdminServer()
   139  }
   140  
   141  func RegisterAdminServer(s grpc.ServiceRegistrar, srv AdminServer) {
   142  	s.RegisterService(&Admin_ServiceDesc, srv)
   143  }
   144  
   145  func _Admin_LaunchJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   146  	in := new(JobConfig)
   147  	if err := dec(in); err != nil {
   148  		return nil, err
   149  	}
   150  	if interceptor == nil {
   151  		return srv.(AdminServer).LaunchJob(ctx, in)
   152  	}
   153  	info := &grpc.UnaryServerInfo{
   154  		Server:     srv,
   155  		FullMethod: Admin_LaunchJob_FullMethodName,
   156  	}
   157  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   158  		return srv.(AdminServer).LaunchJob(ctx, req.(*JobConfig))
   159  	}
   160  	return interceptor(ctx, in, info, handler)
   161  }
   162  
   163  func _Admin_AbortJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   164  	in := new(JobID)
   165  	if err := dec(in); err != nil {
   166  		return nil, err
   167  	}
   168  	if interceptor == nil {
   169  		return srv.(AdminServer).AbortJob(ctx, in)
   170  	}
   171  	info := &grpc.UnaryServerInfo{
   172  		Server:     srv,
   173  		FullMethod: Admin_AbortJob_FullMethodName,
   174  	}
   175  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   176  		return srv.(AdminServer).AbortJob(ctx, req.(*JobID))
   177  	}
   178  	return interceptor(ctx, in, info, handler)
   179  }
   180  
   181  func _Admin_GetJobState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   182  	in := new(JobID)
   183  	if err := dec(in); err != nil {
   184  		return nil, err
   185  	}
   186  	if interceptor == nil {
   187  		return srv.(AdminServer).GetJobState(ctx, in)
   188  	}
   189  	info := &grpc.UnaryServerInfo{
   190  		Server:     srv,
   191  		FullMethod: Admin_GetJobState_FullMethodName,
   192  	}
   193  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   194  		return srv.(AdminServer).GetJobState(ctx, req.(*JobID))
   195  	}
   196  	return interceptor(ctx, in, info, handler)
   197  }
   198  
   199  func _Admin_FixMarkedTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   200  	in := new(JobID)
   201  	if err := dec(in); err != nil {
   202  		return nil, err
   203  	}
   204  	if interceptor == nil {
   205  		return srv.(AdminServer).FixMarkedTags(ctx, in)
   206  	}
   207  	info := &grpc.UnaryServerInfo{
   208  		Server:     srv,
   209  		FullMethod: Admin_FixMarkedTags_FullMethodName,
   210  	}
   211  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   212  		return srv.(AdminServer).FixMarkedTags(ctx, req.(*JobID))
   213  	}
   214  	return interceptor(ctx, in, info, handler)
   215  }
   216  
   217  // Admin_ServiceDesc is the grpc.ServiceDesc for Admin service.
   218  // It's only intended for direct use with grpc.RegisterService,
   219  // and not to be introspected or modified (even as a copy)
   220  var Admin_ServiceDesc = grpc.ServiceDesc{
   221  	ServiceName: "cipd.Admin",
   222  	HandlerType: (*AdminServer)(nil),
   223  	Methods: []grpc.MethodDesc{
   224  		{
   225  			MethodName: "LaunchJob",
   226  			Handler:    _Admin_LaunchJob_Handler,
   227  		},
   228  		{
   229  			MethodName: "AbortJob",
   230  			Handler:    _Admin_AbortJob_Handler,
   231  		},
   232  		{
   233  			MethodName: "GetJobState",
   234  			Handler:    _Admin_GetJobState_Handler,
   235  		},
   236  		{
   237  			MethodName: "FixMarkedTags",
   238  			Handler:    _Admin_FixMarkedTags_Handler,
   239  		},
   240  	},
   241  	Streams:  []grpc.StreamDesc{},
   242  	Metadata: "go.chromium.org/luci/cipd/api/admin/v1/admin.proto",
   243  }