cns/grpc/v1alpha/server_grpc.pb.go (108 lines of code) (raw):
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v3.12.4
// source: cns/grpc/proto/server.proto
package v1alpha
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
const (
CNS_SetOrchestratorInfo_FullMethodName = "/cns.CNS/SetOrchestratorInfo"
CNS_GetNodeInfo_FullMethodName = "/cns.CNS/GetNodeInfo"
)
// CNSClient is the client API for CNS 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 CNSClient interface {
// Sets the orchestrator information for a node.
SetOrchestratorInfo(ctx context.Context, in *SetOrchestratorInfoRequest, opts ...grpc.CallOption) (*SetOrchestratorInfoResponse, error)
// Retrieves detailed information about a specific node.
// Primarily used for health checks.
GetNodeInfo(ctx context.Context, in *NodeInfoRequest, opts ...grpc.CallOption) (*NodeInfoResponse, error)
}
type cNSClient struct {
cc grpc.ClientConnInterface
}
func NewCNSClient(cc grpc.ClientConnInterface) CNSClient {
return &cNSClient{cc}
}
func (c *cNSClient) SetOrchestratorInfo(ctx context.Context, in *SetOrchestratorInfoRequest, opts ...grpc.CallOption) (*SetOrchestratorInfoResponse, error) {
out := new(SetOrchestratorInfoResponse)
err := c.cc.Invoke(ctx, CNS_SetOrchestratorInfo_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *cNSClient) GetNodeInfo(ctx context.Context, in *NodeInfoRequest, opts ...grpc.CallOption) (*NodeInfoResponse, error) {
out := new(NodeInfoResponse)
err := c.cc.Invoke(ctx, CNS_GetNodeInfo_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// CNSServer is the server API for CNS service.
// All implementations must embed UnimplementedCNSServer
// for forward compatibility
type CNSServer interface {
// Sets the orchestrator information for a node.
SetOrchestratorInfo(context.Context, *SetOrchestratorInfoRequest) (*SetOrchestratorInfoResponse, error)
// Retrieves detailed information about a specific node.
// Primarily used for health checks.
GetNodeInfo(context.Context, *NodeInfoRequest) (*NodeInfoResponse, error)
mustEmbedUnimplementedCNSServer()
}
// UnimplementedCNSServer must be embedded to have forward compatible implementations.
type UnimplementedCNSServer struct {
}
func (UnimplementedCNSServer) SetOrchestratorInfo(context.Context, *SetOrchestratorInfoRequest) (*SetOrchestratorInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetOrchestratorInfo not implemented")
}
func (UnimplementedCNSServer) GetNodeInfo(context.Context, *NodeInfoRequest) (*NodeInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetNodeInfo not implemented")
}
func (UnimplementedCNSServer) mustEmbedUnimplementedCNSServer() {}
// UnsafeCNSServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to CNSServer will
// result in compilation errors.
type UnsafeCNSServer interface {
mustEmbedUnimplementedCNSServer()
}
func RegisterCNSServer(s grpc.ServiceRegistrar, srv CNSServer) {
s.RegisterService(&CNS_ServiceDesc, srv)
}
func _CNS_SetOrchestratorInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SetOrchestratorInfoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CNSServer).SetOrchestratorInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: CNS_SetOrchestratorInfo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CNSServer).SetOrchestratorInfo(ctx, req.(*SetOrchestratorInfoRequest))
}
return interceptor(ctx, in, info, handler)
}
func _CNS_GetNodeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(NodeInfoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CNSServer).GetNodeInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: CNS_GetNodeInfo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CNSServer).GetNodeInfo(ctx, req.(*NodeInfoRequest))
}
return interceptor(ctx, in, info, handler)
}
// CNS_ServiceDesc is the grpc.ServiceDesc for CNS service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var CNS_ServiceDesc = grpc.ServiceDesc{
ServiceName: "cns.CNS",
HandlerType: (*CNSServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "SetOrchestratorInfo",
Handler: _CNS_SetOrchestratorInfo_Handler,
},
{
MethodName: "GetNodeInfo",
Handler: _CNS_GetNodeInfo_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "cns/grpc/proto/server.proto",
}