Documentation
¶
Overview ¶
Package health provides health check functionality for API components.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
Checker performs health checks for a component.
func NewChecker ¶
NewChecker creates a new health checker.
func (*Checker) Handler ¶
func (c *Checker) Handler() http.HandlerFunc
Handler returns an HTTP handler for health checks.
func (*Checker) SetTimeout ¶
SetTimeout sets the timeout for health checks.
type ComponentStatus ¶
type ComponentStatus struct {
Status Status `json:"status"`
Message string `json:"message,omitempty"`
}
ComponentStatus represents the health status of a single component.
type Response ¶
type Response struct {
Status Status `json:"status"`
Components map[string]ComponentStatus `json:"components"`
Version string `json:"version"`
Uptime string `json:"uptime"`
}
Response represents the health check response.
type Status ¶
type Status string
Status represents the health status of a component.
const ( // StatusHealthy indicates the component is fully operational. StatusHealthy Status = "healthy" // StatusDegraded indicates the component is operational but with issues. StatusDegraded Status = "degraded" // StatusUnhealthy indicates the component is not operational. StatusUnhealthy Status = "unhealthy" )
Click to show internal directories.
Click to hide internal directories.