status

package
v1.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LivenessEndpoint  = statusRoot + "/liveness"
	ReadinessEndpoint = statusRoot + "/readiness"
	HealthEndpoint    = statusRoot + "/health"
)

Variables

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.

type Source

type Source interface {
	Status() (respStatus int, metadata interface{})
}

Source provides status that should be sent as a response.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL