Files
ca/api/pb/status_grpc.pb.go
2026-10-21 20:56:44 -05:00

164 lines
5.5 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc v7.36.2
// source: status.proto
package pb
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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
Status_Version_FullMethodName = "/pb.Status/Version"
Status_Server_FullMethodName = "/pb.Status/Server"
)
// StatusClient is the client API for Status 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 StatusClient interface {
// Version returns the server version.
Version(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ServerVersion, error)
// Server returns the server status.
Server(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ServerStatusResponse, error)
}
type statusClient struct {
cc grpc.ClientConnInterface
}
func NewStatusClient(cc grpc.ClientConnInterface) StatusClient {
return &statusClient{cc}
}
func (c *statusClient) Version(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ServerVersion, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ServerVersion)
err := c.cc.Invoke(ctx, Status_Version_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *statusClient) Server(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ServerStatusResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ServerStatusResponse)
err := c.cc.Invoke(ctx, Status_Server_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// StatusServer is the server API for Status service.
// All implementations should embed UnimplementedStatusServer
// for forward compatibility.
type StatusServer interface {
// Version returns the server version.
Version(context.Context, *emptypb.Empty) (*ServerVersion, error)
// Server returns the server status.
Server(context.Context, *emptypb.Empty) (*ServerStatusResponse, error)
}
// UnimplementedStatusServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedStatusServer struct{}
func (UnimplementedStatusServer) Version(context.Context, *emptypb.Empty) (*ServerVersion, error) {
return nil, status.Error(codes.Unimplemented, "method Version not implemented")
}
func (UnimplementedStatusServer) Server(context.Context, *emptypb.Empty) (*ServerStatusResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Server not implemented")
}
func (UnimplementedStatusServer) testEmbeddedByValue() {}
// UnsafeStatusServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to StatusServer will
// result in compilation errors.
type UnsafeStatusServer interface {
mustEmbedUnimplementedStatusServer()
}
func RegisterStatusServer(s grpc.ServiceRegistrar, srv StatusServer) {
// If the following call panics, it indicates UnimplementedStatusServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&Status_ServiceDesc, srv)
}
func _Status_Version_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) {
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(StatusServer).Version(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Status_Version_FullMethodName,
}
handler := func(ctx context.Context, req any) (any, error) {
return srv.(StatusServer).Version(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _Status_Server_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) {
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(StatusServer).Server(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Status_Server_FullMethodName,
}
handler := func(ctx context.Context, req any) (any, error) {
return srv.(StatusServer).Server(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
// Status_ServiceDesc is the grpc.ServiceDesc for Status service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Status_ServiceDesc = grpc.ServiceDesc{
ServiceName: "pb.Status",
HandlerType: (*StatusServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Version",
Handler: _Status_Version_Handler,
},
{
MethodName: "Server",
Handler: _Status_Server_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "status.proto",
}