readiness

package
v0.0.0-...-6294969 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 10

Documentation

Overview

package readiness implements a minimal health-checking mechanism for use as k8s readiness probes. It will always return a "ready" state after the conditions have been met for the first time - it's not meant for monitoring.

Uses a global singleton registry (similar to the Prometheus client's default behavior).

Index

Constants

This section is empty.

Variables

View Source
var (
	// TODO is a hack to support running multiple guardians in one process;
	// This package should be rewritten to support multiple registries in one process instead of using a global registry
	NoPanic = false
)

Functions

func Handler

func Handler(w http.ResponseWriter, r *http.Request)

Handler returns a net/http handler for the readiness check. It returns 200 OK if all components are ready, or 412 Precondition Failed otherwise. For operator convenience, a list of components and their states is returned as plain text (not meant for machine consumption!).

func RegisterComponent

func RegisterComponent(component Component)

RegisterComponent registers the given component name such that it is required to be ready for the global check to succeed.

func SetReady

func SetReady(component Component)

SetReady sets the given global component state.

Types

type Component

type Component string

Jump to

Keyboard shortcuts

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