Documentation ¶
Overview ¶
Package health contains helpers for constructing health checks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDown = errors.New("application down")
ErrDown is the error returned when an HTTP health check returns a non-200 status.
View Source
var Flags = flag.Flags{ &flag.Boolean{ Name: "health-check-disabled", Usage: "Disables the health check endpoint", EnvVar: "HEALTH_CHECK_DISABLED", Destination: &disabled, Hidden: true, }, }
Flags contains all command-line flags that can be used to configure health checks.
Functions ¶
func AddCheck ¶
AddCheck adds a status check to the status status. If the provided function returns an error the check is deemed unhealthy.
func PerformCheck ¶
PerformCheck performs an HTTP health check on localhost:8081/__/health. It returns an error if the health check endpoint returns a non-200 status code.
func RegisterGRPCHealthServer ¶
RegisterGRPCHealthServer registers a gRPC health server implementation onto the provided gRPC server.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.