Documentation
¶
Index ¶
- func AppendHealthCheckError(err error)
- func CloseHTTPServer(httpServer *http.Server)
- func GetSummaryOfHealthChecks() []error
- func InstallHealthcheck(router chi.Router, endpointPath string)
- func LoopOverHealthChecks(dependencies []Dependency, close chan struct{})
- func ResetSummaryOfHealthChecks()
- func StartHTTPServer(addr string) *http.Server
- func WrapHealthCheckWithATimeout(name string, timeout time.Duration, check func() (HealthCheckResult, error)) func() (HealthCheckResult, error)
- type Dependency
- type HealthCheckResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendHealthCheckError ¶
func AppendHealthCheckError(err error)
func CloseHTTPServer ¶
func GetSummaryOfHealthChecks ¶
func GetSummaryOfHealthChecks() []error
func InstallHealthcheck ¶
func LoopOverHealthChecks ¶
func LoopOverHealthChecks(dependencies []Dependency, close chan struct{})
LoopOverHealthChecks loops FOREVER over the HealthChecks that are given.
func ResetSummaryOfHealthChecks ¶
func ResetSummaryOfHealthChecks()
func StartHTTPServer ¶
func WrapHealthCheckWithATimeout ¶
func WrapHealthCheckWithATimeout(name string, timeout time.Duration, check func() (HealthCheckResult, error)) func() (HealthCheckResult, error)
Types ¶
type Dependency ¶
type Dependency struct { CheckIsWorking func() (HealthCheckResult, error) Timeout time.Duration Name string }
type HealthCheckResult ¶
type HealthCheckResult string
const ( HC_OK HealthCheckResult = "OK" HC_WARN HealthCheckResult = "WARN" HC_CRIT HealthCheckResult = "CRIT" )
Click to show internal directories.
Click to hide internal directories.