Documentation ¶
Index ¶
- Constants
- func CheckConfigFromEnv(name string, config map[string]string) map[string]string
- func CheckHandler(cfg *CheckConfig) http.HandlerFunc
- func ChecksHandler(cfgs []*CheckConfig) http.HandlerFunc
- func RunCheckForever(cfg *CheckConfig) context.CancelFunc
- func RunChecksForever(cfgs []*CheckConfig) context.CancelFunc
- func ShutdownHandler(cancel context.CancelFunc) http.HandlerFunc
- type CheckConfig
- type Checker
Constants ¶
const CheckConfigEnvPrefix string = "KUBERNARY_"
CheckConfigEnvPrefix is the prefix required by any check configuration environment variables.
Variables ¶
This section is empty.
Functions ¶
func CheckConfigFromEnv ¶
CheckConfigFromEnv provides a standard pattern for reading basic check specific config from environment variables. Pass in a map of keys with default values. If KUBERNARY_CHECKNAME_KEY is set for key its default value will be overwritten.
func CheckHandler ¶
func CheckHandler(cfg *CheckConfig) http.HandlerFunc
CheckHandler returns an HTTP handler that runs the provided check and returns the results.
func ChecksHandler ¶
func ChecksHandler(cfgs []*CheckConfig) http.HandlerFunc
ChecksHandler returns an HTTP handler that runs the provided checks concurrently and returns the results.
func RunCheckForever ¶
func RunCheckForever(cfg *CheckConfig) context.CancelFunc
RunCheckForever causes a check to be run every configured interval, forever.
func RunChecksForever ¶
func RunChecksForever(cfgs []*CheckConfig) context.CancelFunc
RunChecksForever causes a slice of checks to be run every configured interval, forever.
func ShutdownHandler ¶
func ShutdownHandler(cancel context.CancelFunc) http.HandlerFunc
ShutdownHandler shuts down kubernary when called.
Types ¶
type CheckConfig ¶
A CheckConfig specified how a check should be run.