const DefaultHealthzPath … type HealthChecker … var PingHealthz … type ping … func (ping) Name() string { … } // PingHealthz is a health check that returns true. func (ping) Check(_ *http.Request) error { … } var LogHealthz … type log … func (l *log) Name() string { … } func (l *log) Check(_ *http.Request) error { … } type cacheSyncWaiter … type informerSync … var _ … // NewInformerSyncHealthz returns a new HealthChecker that will pass only if all informers in the given cacheSyncWaiter sync. func NewInformerSyncHealthz(cacheSyncWaiter cacheSyncWaiter) HealthChecker { … } func (i *informerSync) Name() string { … } type shutdown … // NewShutdownHealthz returns a new HealthChecker that will fail if the embedded channel is closed. // This is intended to allow for graceful shutdown sequences. func NewShutdownHealthz(stopCh <-chan struct{ … } func (s *shutdown) Name() string { … } func (s *shutdown) Check(req *http.Request) error { … } func (i *informerSync) Check(_ *http.Request) error { … } // NamedCheck returns a healthz checker for the given name and function. func NamedCheck(name string, check func(r *http.Request) error) HealthChecker { … } // InstallHandler registers handlers for health checking on the path // "/healthz" to mux. *All handlers* for mux must be specified in // exactly one call to InstallHandler. Calling InstallHandler more // than once for the same mux will result in a panic. func InstallHandler(mux mux, checks ...HealthChecker) { … } // InstallReadyzHandler registers handlers for health checking on the path // "/readyz" to mux. *All handlers* for mux must be specified in // exactly one call to InstallHandler. Calling InstallHandler more // than once for the same mux will result in a panic. func InstallReadyzHandler(mux mux, checks ...HealthChecker) { … } // InstallLivezHandler registers handlers for liveness checking on the path // "/livez" to mux. *All handlers* for mux must be specified in // exactly one call to InstallHandler. Calling InstallHandler more // than once for the same mux will result in a panic. func InstallLivezHandler(mux mux, checks ...HealthChecker) { … } // InstallPathHandler registers handlers for health checking on // a specific path to mux. *All handlers* for the path must be // specified in exactly one call to InstallPathHandler. Calling // InstallPathHandler more than once for the same path and mux will // result in a panic. func InstallPathHandler(mux mux, path string, checks ...HealthChecker) { … } // InstallPathHandlerWithHealthyFunc is like InstallPathHandler, but calls firstTimeHealthy exactly once // when the handler succeeds for the first time. func InstallPathHandlerWithHealthyFunc(mux mux, path string, firstTimeHealthy func(), checks ...HealthChecker) { … } type mux … type healthzCheck … var _ … func (c *healthzCheck) Name() string { … } func (c *healthzCheck) Check(r *http.Request) error { … } // getExcludedChecks extracts the health check names to be excluded from the query param func getExcludedChecks(r *http.Request) sets.String { … } // handleRootHealth returns an http.HandlerFunc that serves the provided checks. func handleRootHealth(name string, firstTimeHealthy func(), checks ...HealthChecker) http.HandlerFunc { … } // adaptCheckToHandler returns an http.HandlerFunc that serves the provided checks. func adaptCheckToHandler(c func(r *http.Request) error) http.HandlerFunc { … } // checkerNames returns the names of the checks in the same order as passed in. func checkerNames(checks ...HealthChecker) []string { … } // formatQuoted returns a formatted string of the health check names, // preserving the order passed in. func formatQuoted(names ...string) string { … }