Documentation ¶
Index ¶
- func InstallHandler(mux Muxer, checks ...HealthChecker)
- func InstallLivezHandler(mux Muxer, checks ...HealthChecker)
- func InstallPathHandler(mux Muxer, path string, checks ...HealthChecker)
- func InstallPathHandlerWithHealthyFunc(mux Muxer, path string, firstTimeHealthy func(), checks ...HealthChecker)
- func InstallReadyzHandler(mux Muxer, checks ...HealthChecker)
- func InstallReadyzHandlerWithHealthyFunc(mux Muxer, firstTimeReady func(), checks ...HealthChecker)
- type HealthChecker
- func NamedCheck(name string, check func(r *http.Request) error) HealthChecker
- func NamedDeadlineCheck(name string, d time.Time, check func(r *http.Request, d time.Time) error) HealthChecker
- func NamedTimeoutCheck(name string, timeout time.Duration, ...) HealthChecker
- func NewInformerSyncHealthz(cacheSyncWaiter cacheSyncWaiter) HealthChecker
- type Muxer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstallHandler ¶
func InstallHandler(mux Muxer, checks ...HealthChecker)
InstallHandler registers handlers for health checking on the path "/healthz" to Muxer. *All handlers* for Muxer must be specified in exactly one call to InstallHandler. Calling InstallHandler more than once for the same Muxer will result in a panic.
func InstallLivezHandler ¶
func InstallLivezHandler(mux Muxer, checks ...HealthChecker)
InstallLivezHandler registers handlers for liveness checking on the path "/livez" to Muxer. *All handlers* for Muxer must be specified in exactly one call to InstallHandler. Calling InstallHandler more than once for the same Muxer will result in a panic.
func InstallPathHandler ¶
func InstallPathHandler(mux Muxer, path string, checks ...HealthChecker)
InstallPathHandler registers handlers for health checking on a specific path to Muxer. *All handlers* for the path must be specified in exactly one call to InstallPathHandler. Calling InstallPathHandler more than once for the same path and Muxer will result in a panic.
func InstallPathHandlerWithHealthyFunc ¶
func InstallPathHandlerWithHealthyFunc(mux Muxer, path string, firstTimeHealthy func(), checks ...HealthChecker)
InstallPathHandlerWithHealthyFunc is like InstallPathHandler, but calls firstTimeHealthy exactly once when the handler succeeds for the first time.
func InstallReadyzHandler ¶
func InstallReadyzHandler(mux Muxer, checks ...HealthChecker)
InstallReadyzHandler registers handlers for health checking on the path "/readyz" to Muxer. *All handlers* for Muxer must be specified in exactly one call to InstallHandler. Calling InstallHandler more than once for the same Muxer will result in a panic.
func InstallReadyzHandlerWithHealthyFunc ¶
func InstallReadyzHandlerWithHealthyFunc(mux Muxer, firstTimeReady func(), checks ...HealthChecker)
InstallReadyzHandlerWithHealthyFunc is like InstallReadyzHandler, but in addition call firstTimeReady the first time /readyz succeeds.
Types ¶
type HealthChecker ¶
HealthChecker is a named healthz checker.
var LogHealthCheck HealthChecker = &log{}
LogHealthCheck returns true if logging is not blocked
var PingHealthzCheck HealthChecker = ping{}
PingHealthzCheck returns true automatically when checked
func NamedCheck ¶
func NamedCheck(name string, check func(r *http.Request) error) HealthChecker
NamedCheck returns a healthz checker for the given name and function.
func NamedDeadlineCheck ¶
func NamedDeadlineCheck(name string, d time.Time, check func(r *http.Request, d time.Time) error) HealthChecker
NamedDeadlineCheck returns a healthz checker for the given name, deadline and function.
func NamedTimeoutCheck ¶
func NamedTimeoutCheck(name string, timeout time.Duration, check func(r *http.Request, timeout time.Duration) error) HealthChecker
NamedTimeoutCheck returns a healthz checker for the given name , timeout and function.
func NewInformerSyncHealthz ¶
func NewInformerSyncHealthz(cacheSyncWaiter cacheSyncWaiter) HealthChecker
NewInformerSyncHealthz returns a new HealthChecker that will pass only if all informers in the given cacheSyncWaiter sync.