health

package
v0.0.0-...-0c576d6 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSystemHealthCheck = &SystemHealthCheck{}

Functions

func Handler

func Handler() http.Handler

func Register

func Register(c ...any) error

Types

type Checkable

type Checkable interface {
	Health(context.Context) models.ServiceHealthResp
}

type HealthResp

type HealthResp struct {
	Status   string                     `json:"status"` // general app health
	Services []models.ServiceHealthResp `json:"services"`

} // .HealthResp

HealthResp, app health response

type SystemHealthCheck

type SystemHealthCheck struct {
	Services []Checkable
}

func (*SystemHealthCheck) Register

func (hc *SystemHealthCheck) Register(checks ...any) error

func (*SystemHealthCheck) ServeHTTP

func (hc *SystemHealthCheck) ServeHTTP(w http.ResponseWriter, r *http.Request)

health responds to /health endpoint with the health of the app including dependency services

Jump to

Keyboard shortcuts

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