Documentation ¶
Index ¶
Constants ¶
View Source
const ( LivenessEndpoint = statusRoot + "/liveness" ReadinessEndpoint = statusRoot + "/readiness" HealthEndpoint = statusRoot + "/health" )
Variables ¶
View Source
var HealthStateStatusCodes = map[health.HealthState]int{ health.HealthStateHealthy: http.StatusOK, health.HealthStateDeferring: 518, health.HealthStateSuspended: 519, health.HealthStateRepairing: 520, health.HealthStateWarning: 521, health.HealthStateError: 522, health.HealthStateTerminal: 523, }
Functions ¶
func HealthStatusCode ¶ added in v1.26.0
func HealthStatusCode(metadata health.HealthStatus) int
func NewHealthCheckHandler ¶
func NewHealthCheckHandler(checkSource HealthCheckSource, sharedSecret refreshable.String, healthStatusChangeHandlers []HealthStatusChangeHandler) http.Handler
Types ¶
type HealthCheckSource ¶
type HealthCheckSource interface {
HealthStatus(ctx context.Context) health.HealthStatus
}
HealthCheckSource provides the SLS health status that should be sent as a response. Refer to the SLS specification for more information.
func NewCombinedHealthCheckSource ¶
func NewCombinedHealthCheckSource(healthCheckSources ...HealthCheckSource) HealthCheckSource
type HealthStatusChangeHandler ¶ added in v1.26.0
type HealthStatusChangeHandler interface {
HandleHealthStatusChange(ctx context.Context, prevStatus, currStatus health.HealthStatus)
}
func NewDiagnosticLoggingChangeHandler ¶ added in v1.26.0
func NewDiagnosticLoggingChangeHandler() HealthStatusChangeHandler
NewDiagnosticLoggingChangeHandler will emit a diagnostic log whenever the latest health status' state is more severe than HealthStateRepairing.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.