health

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package health provides HTTP liveness and readiness middleware.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler serves health endpoints and delegates all other requests. Readiness is atomic because startup and shutdown race with request handling.

func New

func New(next http.Handler) *Handler

New constructs health middleware around the next request handler.

func NewAll added in v0.50.0

func NewAll(handlers ...*Handler) *Handler

NewAll serves health endpoints that are ready while every one of handlers is, and answers 404 to everything else.

func (*Handler) Ready added in v0.50.0

func (h *Handler) Ready() bool

Ready reports whether the readiness endpoint reports success.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request)

ServeHTTP serves health endpoints and delegates all other requests.

func (*Handler) SetReady

func (h *Handler) SetReady(ready bool)

SetReady changes whether the readiness endpoint reports success.

Jump to

Keyboard shortcuts

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