grpc_health_v1
v1.85.0
Documentation
pkg.go.dev ↗Constants
Health_Check_FullMethodName (3 declarations)
const ( Health_Check_FullMethodName = "/grpc.health.v1.Health/Check" Health_List_FullMethodName = "/grpc.health.v1.Health/List" Health_Watch_FullMethodName = "/grpc.health.v1.Health/Watch" )
Variables
HealthCheckResponse_ServingStatus_name (2 declarations)
var (
HealthCheckResponse_ServingStatus_name = map[int32]string{
0: "UNKNOWN",
1: "SERVING",
2: "NOT_SERVING",
3: "SERVICE_UNKNOWN",
}
HealthCheckResponse_ServingStatus_value = map[string]int32{
"UNKNOWN": 0,
"SERVING": 1,
"NOT_SERVING": 2,
"SERVICE_UNKNOWN": 3,
}
)
Enum value maps for HealthCheckResponse_ServingStatus.
File_grpc_health_v1_health_proto
var File_grpc_health_v1_health_proto protoreflect.FileDescriptor
Health_ServiceDesc
var Health_ServiceDesc = grpc.ServiceDesc{
ServiceName: "grpc.health.v1.Health",
HandlerType: (*HealthServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Check",
Handler: _Health_Check_Handler,
},
{
MethodName: "List",
Handler: _Health_List_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "Watch",
Handler: _Health_Watch_Handler,
ServerStreams: true,
},
},
Metadata: "grpc/health/v1/health.proto",
}
Health_ServiceDesc is the grpc.ServiceDesc for Health service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions
RegisterHealthServer
func RegisterHealthServer(s grpc.ServiceRegistrar, srv HealthServer)
Types
HealthCheckRequest
type HealthCheckRequest struct {
Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
// contains filtered or unexported fields
}
HealthCheckRequest.Descriptor
func (*HealthCheckRequest) Descriptor() ([]byte, []int)
Deprecated: Use HealthCheckRequest.ProtoReflect.Descriptor instead.
HealthCheckRequest.GetService
func (x *HealthCheckRequest) GetService() string
HealthCheckRequest.ProtoMessage
func (*HealthCheckRequest) ProtoMessage()
HealthCheckRequest.ProtoReflect
func (x *HealthCheckRequest) ProtoReflect() protoreflect.Message
HealthCheckRequest.Reset
func (x *HealthCheckRequest) Reset()
HealthCheckRequest.String
func (x *HealthCheckRequest) String() string
HealthCheckResponse
type HealthCheckResponse struct {
Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=grpc.health.v1.HealthCheckResponse_ServingStatus" json:"status,omitempty"`
// contains filtered or unexported fields
}
HealthCheckResponse.Descriptor
func (*HealthCheckResponse) Descriptor() ([]byte, []int)
Deprecated: Use HealthCheckResponse.ProtoReflect.Descriptor instead.
HealthCheckResponse.GetStatus
func (x *HealthCheckResponse) GetStatus() HealthCheckResponse_ServingStatus
HealthCheckResponse.ProtoMessage
func (*HealthCheckResponse) ProtoMessage()
HealthCheckResponse.ProtoReflect
func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message
HealthCheckResponse.Reset
func (x *HealthCheckResponse) Reset()
HealthCheckResponse.String
func (x *HealthCheckResponse) String() string
HealthCheckResponse_ServingStatus
type HealthCheckResponse_ServingStatus int32
HealthCheckResponse_UNKNOWN (4 declarations)
const ( HealthCheckResponse_UNKNOWN HealthCheckResponse_ServingStatus = 0 HealthCheckResponse_SERVING HealthCheckResponse_ServingStatus = 1 HealthCheckResponse_NOT_SERVING HealthCheckResponse_ServingStatus = 2 HealthCheckResponse_SERVICE_UNKNOWN HealthCheckResponse_ServingStatus = 3 // Used only by the Watch method. )
HealthCheckResponse_ServingStatus.Descriptor
func (HealthCheckResponse_ServingStatus) Descriptor() protoreflect.EnumDescriptor
HealthCheckResponse_ServingStatus.Enum
func (x HealthCheckResponse_ServingStatus) Enum() *HealthCheckResponse_ServingStatus
HealthCheckResponse_ServingStatus.EnumDescriptor
func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use HealthCheckResponse_ServingStatus.Descriptor instead.
HealthCheckResponse_ServingStatus.Number
func (x HealthCheckResponse_ServingStatus) Number() protoreflect.EnumNumber
HealthCheckResponse_ServingStatus.String
func (x HealthCheckResponse_ServingStatus) String() string
HealthCheckResponse_ServingStatus.Type
func (HealthCheckResponse_ServingStatus) Type() protoreflect.EnumType
HealthClient
type HealthClient interface {
// Check gets the health of the specified service. If the requested service
// is unknown, the call will fail with status NOT_FOUND. If the caller does
// not specify a service name, the server should respond with its overall
// health status.
//
// Clients should set a deadline when calling Check, and can declare the
// server unhealthy if they do not receive a timely response.
Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
// List provides a non-atomic snapshot of the health of all the available
// services.
//
// The server may respond with a RESOURCE_EXHAUSTED error if too many services
// exist.
//
// Clients should set a deadline when calling List, and can declare the server
// unhealthy if they do not receive a timely response.
//
// Clients should keep in mind that the list of health services exposed by an
// application can change over the lifetime of the process.
List(ctx context.Context, in *HealthListRequest, opts ...grpc.CallOption) (*HealthListResponse, error)
// Performs a watch for the serving status of the requested service.
// The server will immediately send back a message indicating the current
// serving status. It will then subsequently send a new message whenever
// the service's serving status changes.
//
// If the requested service is unknown when the call is received, the
// server will send a message setting the serving status to
// SERVICE_UNKNOWN but will *not* terminate the call. If at some
// future point, the serving status of the service becomes known, the
// server will send a new message with the service's serving status.
//
// If the call terminates with status UNIMPLEMENTED, then clients
// should assume this method is not supported and should not retry the
// call. If the call terminates with any other status (including OK),
// clients should retry the call with appropriate exponential backoff.
Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[HealthCheckResponse], error)
}
HealthClient is the client API for Health 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.
Health is gRPC's mechanism for checking whether a server is able to handle RPCs. Its semantics are documented in https://github.com/grpc/grpc/blob/master/doc/health-checking.md.
NewHealthClient
func NewHealthClient(cc grpc.ClientConnInterface) HealthClient
HealthListRequest
type HealthListRequest struct {
// contains filtered or unexported fields
}
HealthListRequest.Descriptor
func (*HealthListRequest) Descriptor() ([]byte, []int)
Deprecated: Use HealthListRequest.ProtoReflect.Descriptor instead.
HealthListRequest.ProtoMessage
func (*HealthListRequest) ProtoMessage()
HealthListRequest.ProtoReflect
func (x *HealthListRequest) ProtoReflect() protoreflect.Message
HealthListRequest.Reset
func (x *HealthListRequest) Reset()
HealthListRequest.String
func (x *HealthListRequest) String() string
HealthListResponse
type HealthListResponse struct {
// statuses contains all the services and their respective status.
Statuses map[string]*HealthCheckResponse `protobuf:"bytes,1,rep,name=statuses,proto3" json:"statuses,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
// contains filtered or unexported fields
}
HealthListResponse.Descriptor
func (*HealthListResponse) Descriptor() ([]byte, []int)
Deprecated: Use HealthListResponse.ProtoReflect.Descriptor instead.
HealthListResponse.GetStatuses
func (x *HealthListResponse) GetStatuses() map[string]*HealthCheckResponse
HealthListResponse.ProtoMessage
func (*HealthListResponse) ProtoMessage()
HealthListResponse.ProtoReflect
func (x *HealthListResponse) ProtoReflect() protoreflect.Message
HealthListResponse.Reset
func (x *HealthListResponse) Reset()
HealthListResponse.String
func (x *HealthListResponse) String() string
HealthServer
type HealthServer interface {
// Check gets the health of the specified service. If the requested service
// is unknown, the call will fail with status NOT_FOUND. If the caller does
// not specify a service name, the server should respond with its overall
// health status.
//
// Clients should set a deadline when calling Check, and can declare the
// server unhealthy if they do not receive a timely response.
Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
// List provides a non-atomic snapshot of the health of all the available
// services.
//
// The server may respond with a RESOURCE_EXHAUSTED error if too many services
// exist.
//
// Clients should set a deadline when calling List, and can declare the server
// unhealthy if they do not receive a timely response.
//
// Clients should keep in mind that the list of health services exposed by an
// application can change over the lifetime of the process.
List(context.Context, *HealthListRequest) (*HealthListResponse, error)
// Performs a watch for the serving status of the requested service.
// The server will immediately send back a message indicating the current
// serving status. It will then subsequently send a new message whenever
// the service's serving status changes.
//
// If the requested service is unknown when the call is received, the
// server will send a message setting the serving status to
// SERVICE_UNKNOWN but will *not* terminate the call. If at some
// future point, the serving status of the service becomes known, the
// server will send a new message with the service's serving status.
//
// If the call terminates with status UNIMPLEMENTED, then clients
// should assume this method is not supported and should not retry the
// call. If the call terminates with any other status (including OK),
// clients should retry the call with appropriate exponential backoff.
Watch(*HealthCheckRequest, grpc.ServerStreamingServer[HealthCheckResponse]) error
}
HealthServer is the server API for Health service. All implementations should embed UnimplementedHealthServer for forward compatibility.
Health is gRPC's mechanism for checking whether a server is able to handle RPCs. Its semantics are documented in https://github.com/grpc/grpc/blob/master/doc/health-checking.md.
Health_WatchClient
type Health_WatchClient = grpc.ServerStreamingClient[HealthCheckResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
Health_WatchServer
type Health_WatchServer = grpc.ServerStreamingServer[HealthCheckResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
UnimplementedHealthServer
type UnimplementedHealthServer struct{}
UnimplementedHealthServer 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.
UnimplementedHealthServer.Check
func (UnimplementedHealthServer) Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
UnimplementedHealthServer.List
func (UnimplementedHealthServer) List(context.Context, *HealthListRequest) (*HealthListResponse, error)
UnimplementedHealthServer.Watch
func (UnimplementedHealthServer) Watch(*HealthCheckRequest, grpc.ServerStreamingServer[HealthCheckResponse]) error
UnsafeHealthServer
type UnsafeHealthServer interface {
// contains filtered or unexported methods
}
UnsafeHealthServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HealthServer will result in compilation errors.