Documentation ¶
Index ¶
Constants ¶
View Source
const ( // LivenessHandlerPath path to process liveness probe. LivenessHandlerPath = "/live" // ReadinessHandlerPath path to process readiness probe. ReadinessHandlerPath = "/ready" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorHandler ¶
ErrorHandler error handler's signature for failed checks.
type Handler ¶
type Handler interface { // Handler is http.Handler, so it can be exposed directly and processed // /live and /ready endpoints. http.Handler // AddLivenessCheck adds a check indicating that this instance // of the application should be destroyed or restarted. A failed liveness check // indicates that this instance is not running. // Each liveness check is also included as a readiness check. AddLivenessCheck(name string, check Check) // AddReadinessCheck adds a check indicating that this // application instance is currently unable to serve requests due to an external // dependency or some kind of temporary failure. If the readiness check fails, this instance // should no longer receive requests, but it should not be restarted or destroyed. AddReadinessCheck(name string, check Check) // LiveEndpoint is an HTTP handler for the /live endpoint only, which // is useful if you need to add it to your own HTTP handler tree. LiveEndpoint(http.ResponseWriter, *http.Request) //ReadyEndpoint is an HTTP handler for the /ready endpoint only, which // is useful if you need to add it to your own HTTP handler tree. ReadyEndpoint(http.ResponseWriter, *http.Request) // AddCheckErrorHandler adds a callback to process a failed check (in order to log errors, etc.). AddCheckErrorHandler(handler ErrorHandler) }
Handler is a wrapper over http.Handler, allowing you to add liveness and readiness checks
Click to show internal directories.
Click to hide internal directories.