Documentation ¶
Overview ¶
Package health provides functionality for constructing a health check endpoint.
Index ¶
Constants ¶
View Source
const ( // OK is a healthy status OK = "Healthy" // WARNING is a warning status WARNING = "Warning" // CRITICAL is a critical status CRITICAL = "Critical" )
Variables ¶
This section is empty.
Functions ¶
func AddServiceCheck ¶
func AddServiceCheck(checks Checks)
AddServiceCheck inspects all other checks in the map and adds a "service" entry with the highest error level found.
func CreateHealthHandler ¶
func CreateHealthHandler(checker Checker) func(http.ResponseWriter, *http.Request)
CreateHealthHandler takes a health checker and returns an endpoint for health checks
func CreateProbeHandler ¶
func CreateProbeHandler(checker Checker) func(http.ResponseWriter, *http.Request)
CreateProbeHandler takes a health checker and returns an endpoint for probe checks which return different http statuses
Types ¶
type Check ¶
type Check struct { Name string `json:"name"` Status string `json:"status"` Description string `json:"description"` Data map[string]interface{} `json:"data"` }
Check represents each individual health check
Click to show internal directories.
Click to hide internal directories.