health

package
v0.0.0-...-31f5ead Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendHealthCheckError

func AppendHealthCheckError(err error)

func CloseHTTPServer

func CloseHTTPServer(httpServer *http.Server)

func GetSummaryOfHealthChecks

func GetSummaryOfHealthChecks() []error

func InstallHealthcheck

func InstallHealthcheck(router chi.Router, endpointPath string)

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 StartHTTPServer(addr string) *http.Server

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"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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