Logo
Explore Help
Sign In
go/health
1
0
Fork 0
You've already forked health
Code Issues Pull Requests Packages Releases 1 Activity
Files
main
health/doc.go

11 lines
393 B
Go
Raw Permalink Normal View History

feat(health): initial stable release v0.9.0 HTTP health check handler with parallel goroutine-per-check execution, 5 s request-derived timeout, and two-level criticality (LevelCritical → 503, LevelDegraded → 200). What's included: - `Checkable` interface (HealthCheck / Name / Priority) and `Level` type with LevelCritical and LevelDegraded constants - `NewHandler(logger, checks...)` returning http.Handler; runs all checks concurrently via buffered channel, returns JSON with per-component status and latency - `ComponentStatus` and `Response` types for the JSON response body Tested-via: todo-api POC integration Reviewed-against: docs/adr/
2026-03-18 14:06:17 -06:00
// Package health provides a stdlib http.Handler for service health checks.
//
// Register checkable components and mount the handler at a health endpoint:
//
// handler := health.NewHandler(logger, db, cache, queue)
// r.Get("/health", handler)
//
// The handler runs all checks concurrently with a 5-second timeout.
// It returns HTTP 200 (UP or DEGRADED) or HTTP 503 (DOWN).
package health
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.4 Page: 20ms Template: 2ms
English
English
Licenses API