open-consul/proto/pboperator/operator_grpc.pb.go

106 lines
3.9 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc (unknown)
// source: proto/pboperator/operator.proto
package pboperator
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
// OperatorServiceClient is the client API for OperatorService 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 OperatorServiceClient interface {
// Transfer raft leadership to another node
TransferLeader(ctx context.Context, in *TransferLeaderRequest, opts ...grpc.CallOption) (*TransferLeaderResponse, error)
}
type operatorServiceClient struct {
cc grpc.ClientConnInterface
}
func NewOperatorServiceClient(cc grpc.ClientConnInterface) OperatorServiceClient {
return &operatorServiceClient{cc}
}
func (c *operatorServiceClient) TransferLeader(ctx context.Context, in *TransferLeaderRequest, opts ...grpc.CallOption) (*TransferLeaderResponse, error) {
out := new(TransferLeaderResponse)
err := c.cc.Invoke(ctx, "/hashicorp.consul.internal.operator.OperatorService/TransferLeader", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// OperatorServiceServer is the server API for OperatorService service.
// All implementations should embed UnimplementedOperatorServiceServer
// for forward compatibility
type OperatorServiceServer interface {
// Transfer raft leadership to another node
TransferLeader(context.Context, *TransferLeaderRequest) (*TransferLeaderResponse, error)
}
// UnimplementedOperatorServiceServer should be embedded to have forward compatible implementations.
type UnimplementedOperatorServiceServer struct {
}
func (UnimplementedOperatorServiceServer) TransferLeader(context.Context, *TransferLeaderRequest) (*TransferLeaderResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method TransferLeader not implemented")
}
// UnsafeOperatorServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to OperatorServiceServer will
// result in compilation errors.
type UnsafeOperatorServiceServer interface {
mustEmbedUnimplementedOperatorServiceServer()
}
func RegisterOperatorServiceServer(s grpc.ServiceRegistrar, srv OperatorServiceServer) {
s.RegisterService(&OperatorService_ServiceDesc, srv)
}
func _OperatorService_TransferLeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(TransferLeaderRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OperatorServiceServer).TransferLeader(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/hashicorp.consul.internal.operator.OperatorService/TransferLeader",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OperatorServiceServer).TransferLeader(ctx, req.(*TransferLeaderRequest))
}
return interceptor(ctx, in, info, handler)
}
// OperatorService_ServiceDesc is the grpc.ServiceDesc for OperatorService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var OperatorService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "hashicorp.consul.internal.operator.OperatorService",
HandlerType: (*OperatorServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "TransferLeader",
Handler: _OperatorService_TransferLeader_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "proto/pboperator/operator.proto",
}