healthz

package
v0.0.0-...-d691e2b Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultHealthz

func DefaultHealthz(checks ...HealthzChecker)

DefaultHealthz installs the default healthz check to the http.DefaultServeMux.

func InstallHandler

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

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.

Types

type HealthzChecker

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

HealthzChecker is a named healthz checker.

var PingHealthz HealthzChecker = ping{}

PingHealthz returns true automatically when checked

func NamedCheck

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

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