health

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package health provides readiness state tracking and HTTP health check handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	// contains filtered or unexported fields
}

Checker tracks the readiness state of the platform. It is safe for concurrent use.

func NewChecker

func NewChecker() *Checker

NewChecker creates a Checker in the Starting state.

func (*Checker) IsReady

func (c *Checker) IsReady() bool

IsReady returns true when the state is Ready.

func (*Checker) LivenessHandler

func (*Checker) LivenessHandler() http.HandlerFunc

LivenessHandler returns an http.HandlerFunc that always responds 200 OK. Use this for K8s livenessProbe (/healthz).

func (*Checker) ReadinessHandler

func (c *Checker) ReadinessHandler() http.HandlerFunc

ReadinessHandler returns an http.HandlerFunc that responds 200 when ready and 503 when starting or draining. Use this for K8s readinessProbe (/readyz).

func (*Checker) SetDraining

func (c *Checker) SetDraining()

SetDraining transitions to the Draining state.

func (*Checker) SetReady

func (c *Checker) SetReady()

SetReady transitions to the Ready state.

func (*Checker) State

func (c *Checker) State() string

State returns the current state as a human-readable string.

Jump to

Keyboard shortcuts

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