Help us shape the future of Go! Take the 2026 Go Developer Survey

health

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 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 (*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