health

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package health provides liveness and readiness tracking for the router.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

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

State tracks liveness and readiness atomically.

func New

func New() *State

New returns a State with live=true and ready=true.

func (*State) Handler

func (s *State) Handler() http.Handler

Handler returns an http.Handler for the health check endpoint. Returns {"status":"UP"} with HTTP 200 when healthy, {"status":"DOWN"} with HTTP 503 when unhealthy.

func (*State) IsLive

func (s *State) IsLive() bool

IsLive reports whether the router is live.

func (*State) IsReady

func (s *State) IsReady() bool

IsReady reports whether the router is ready to serve requests.

func (*State) SetLive

func (s *State) SetLive(v bool)

SetLive sets the liveness state.

func (*State) SetReady

func (s *State) SetReady(v bool)

SetReady sets the readiness state.

Jump to

Keyboard shortcuts

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