Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
func Handler( version string, releaseID string, serviceID string, checkers []Checker, ) fiber.Handler
Handler godoc @Summary Health check endpoint @Description Returns the health status of the service (RFC Health Check Draft) @Tags Health @Produce json @Success 200 {object} HealthResponse "Service is healthy" @Failure 503 {object} HealthResponse "Service is unhealthy" @Router /health [get]
Types ¶
type Check ¶
type Check struct {
Status HealthStatus `json:"status" example:"pass"`
Component string `json:"component,omitempty" example:"database"`
Observed any `json:"observedValue,omitempty"`
ObservedAt string `json:"observedAt,omitempty" example:"2024-01-15T10:30:00Z"`
Output string `json:"output,omitempty" example:"ok"`
}
Check represents the result of a single health check @Description Result of a health check
type EtherpadChecker ¶
type EtherpadChecker struct {
// contains filtered or unexported fields
}
func (EtherpadChecker) Check ¶
func (e EtherpadChecker) Check() Check
func (EtherpadChecker) Name ¶
func (e EtherpadChecker) Name() string
type HealthResponse ¶
type HealthResponse struct {
Status HealthStatus `json:"status" example:"pass"`
Version string `json:"version,omitempty" example:"1.0.0"`
ReleaseID string `json:"releaseId,omitempty" example:"abc123"`
ServiceID string `json:"serviceId,omitempty" example:"etherpad-api"`
Checks map[string][]Check `json:"checks,omitempty"`
}
HealthResponse represents the response of the health endpoint @Description Complete health check response
type HealthStatus ¶
type HealthStatus string
HealthStatus represents the status of a health check @Description Status of a health check (pass, warn, fail)
const ( StatusPass HealthStatus = "pass" StatusWarn HealthStatus = "warn" StatusFail HealthStatus = "fail" )
Click to show internal directories.
Click to hide internal directories.