Documentation ¶
Index ¶
- Variables
- func HTTPStatusCodeHealthChecker(method string, url string, header http.Header, timeout time.Duration, ...) health.Checker
- func PeriodicHealthChecker(checker health.Checker, period time.Duration) health.Checker
- func RegisterHealthCheckers()
- type ComponentHealthStatus
- type Controller
- type OverallHealthStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Ctl is a global health controller Ctl = NewController() )
Functions ¶
func HTTPStatusCodeHealthChecker ¶
func HTTPStatusCodeHealthChecker(method string, url string, header http.Header, timeout time.Duration, statusCode int) health.Checker
HTTPStatusCodeHealthChecker implements a Checker to check that the HTTP status code returned matches the expected one
func PeriodicHealthChecker ¶
PeriodicHealthChecker implements a Checker to check status periodically
Types ¶
type ComponentHealthStatus ¶
type ComponentHealthStatus struct { Name string `json:"name"` Status string `json:"status"` Error string `json:"error,omitempty"` }
ComponentHealthStatus defines the specific component health status
type Controller ¶
type Controller interface {
GetHealth(ctx context.Context) *OverallHealthStatus
}
Controller defines the health related operations
func NewController ¶
func NewController() Controller
NewController returns a health controller instance
type OverallHealthStatus ¶
type OverallHealthStatus struct { Status string `json:"status"` Components []*ComponentHealthStatus `json:"components"` }
OverallHealthStatus defines the overall health status of the system
Click to show internal directories.
Click to hide internal directories.