healthz

package
v1.25.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 6 Imported by: 49

Documentation

Index

Constants

View Source
const DefaultHealthManagerName = "default"

DefaultHealthManagerName is the name of the default health manager.

View Source
const PeriodicHealthManagerName = "periodic"

PeriodicHealthManagerName is the name of the periodic health manager.

Variables

This section is empty.

Functions

func HandlerFunc

func HandlerFunc(h Manager) func(w http.ResponseWriter, r *http.Request)

HandlerFunc returns a HTTP handler that responds with 200 OK status code if the given health manager returns true, otherwise 500 Internal Server Error status code will be returned.

func NewCacheSyncHealthz added in v1.18.0

func NewCacheSyncHealthz(cacheSyncWaiter cacheSyncWaiter) healthz.Checker

NewCacheSyncHealthz returns a new healthz.Checker that will pass only if all informers in the given cacheSyncWaiter sync.

Types

type Manager

type Manager interface {
	// Name returns the name of the health manager.
	Name() string
	// Start starts the health manager.
	Start()
	// Stop stops the health manager.
	Stop()
	// Get returns the current health status.
	Get() bool
	// Set updates the current health status with the given value.
	Set(bool)
}

Manager is an interface for health managers.

func NewDefaultHealthz

func NewDefaultHealthz() Manager

NewDefaultHealthz returns a default health manager that stores the given health status and returns it.

func NewPeriodicHealthz

func NewPeriodicHealthz(resetDuration time.Duration) Manager

NewPeriodicHealthz returns a health manager that automatically sets the health status to false after the given reset duration. The timer is reset again when the health status is true (i.e., a running timer is reset and starts again from the beginning).

Jump to

Keyboard shortcuts

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