-
Release v1.0.0 Stable
released this
2026-05-11 19:06:12 -06:00 | 1 commits to main since this releasev1.0.0
code.nochebuena.dev/go/healthOverview
healthv1.0.0 commits the HTTP health check API as stable. All v0.9.0 roadmap
items are resolved. The module ships a parallel check handler with two-level
criticality, a configurable check timeout, and a pure stdlib footprint. No
external or internal micro-lib imports required.What Changed Since v0.9.0
New:
ConfigandNewHandlerWithConfigtype Config struct { CheckTimeout time.Duration // 0 → 5s default } func NewHandlerWithConfig(logger Logger, cfg Config, checks ...Checkable) http.HandlerThe check timeout is now configurable.
NewHandlerremains unchanged and
continues to use the 5-second default.// Default — identical to v0.9.0 h := health.NewHandler(logger, db, cache) // Custom 2-second timeout for SLO-sensitive probes h := health.NewHandlerWithConfig(logger, health.Config{CheckTimeout: 2 * time.Second}, db, cache)Roadmap items resolved
Item Resolution Configurable check timeout ✅ Config.CheckTimeoutviaNewHandlerWithConfigResult caching (TTL-based) ❌ No — load balancer probe spacing controls frequency Timeout vs error distinction in JSON ❌ No — the errorfield is sufficient for current useBuffer channel goroutine-leak documentation ✅ Validated — checks are fixed at construction time (correct by design) Parallel checks under probe traffic ✅ Validated in production Full API (stable)
Level—LevelCritical(0, default) andLevelDegraded(1).Checkable—HealthCheck(ctx) error,Name() string,Priority() Level.Logger— duck-typed interface satisfied bylogz.Loggerwith no import required.ComponentStatus—{ status, latency, error }JSON fields.Response—{ status, components }JSON fields.Config—CheckTimeout time.Duration; zero value → 5 seconds.NewHandler(logger, checks...) http.Handler— backward-compatible constructor, 5s timeout.NewHandlerWithConfig(logger, cfg, checks...) http.Handler— constructor with explicit config.Migration from v0.9.0
No breaking changes.
NewHandleris unchanged.go get code.nochebuena.dev/go/health@v1.0.0Downloads