healthz

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GinMuxer

func GinMuxer(muxer gin.IRouter) mux

func InstallHandler

func InstallHandler(mux mux, checks ...HealthCheck)

InstallHandler registers handlers for health checking on the path "/healthz" to mux. *All handlers* for mux must be specified in exactly one call to InstallHandler. Calling InstallHandler more than once for the same mux will result in a panic.

func InstallLivezHandler

func InstallLivezHandler(mux mux, checks ...HealthCheck)

InstallLivezHandler registers handlers for liveness checking on the path "/livez" to mux. *All handlers* for mux must be specified in exactly one call to InstallHandler. Calling InstallHandler more than once for the same mux will result in a panic.

func InstallPathHandler

func InstallPathHandler(mux mux, path string, checks ...HealthCheck)

InstallPathHandler registers handlers for health checking on a specific path to mux. *All handlers* for the path must be specified in exactly one call to InstallPathHandler. Calling InstallPathHandler more than once for the same path and mux will result in a panic.

func InstallReadyzHandler

func InstallReadyzHandler(mux mux, checks ...HealthCheck)

InstallReadyzHandler registers handlers for health checking on the path "/readyz" to mux. *All handlers* for mux must be specified in exactly one call to InstallHandler. Calling InstallHandler more than once for the same mux will result in a panic.

Types

type HealthCheck

type HealthCheck interface {
	Name() string
	Check(req *http.Request) error
}

HealthCheck is a named healthz checker.

var LogHealthCheck HealthCheck = &log{}

LogHealthCheck returns true if logging is not blocked

var PingHealthCheck HealthCheck = ping{}

PingHealthCheck returns true automatically when checked

func NamedCheck

func NamedCheck(name string, check func(r *http.Request) error) HealthCheck

NamedCheck returns a healthz checker for the given name and function.

Jump to

Keyboard shortcuts

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