11 lines
393 B
Go
11 lines
393 B
Go
|
|
// 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
|