Documentation
¶
Index ¶
Constants ¶
View Source
const ( StatusUnknown Status = 0 StatusHealthy = (1 << iota) StatusNapping StatusStarting StatusUnhealthy StatusError NumStatuses int = iota - 1 HealthyMask = StatusHealthy | StatusNapping | StatusStarting IdlingMask = StatusNapping | StatusStarting )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HealthCheckConfig ¶
type HealthCheckConfig struct { Disable bool `json:"disable,omitempty" aliases:"disabled"` Path string `json:"path,omitempty" validate:"omitempty,uri,startswith=/"` UseGet bool `json:"use_get,omitempty"` Interval time.Duration `json:"interval" validate:"omitempty,min=1s"` Timeout time.Duration `json:"timeout" validate:"omitempty,min=1s"` }
func DefaultHealthConfig ¶
func DefaultHealthConfig() *HealthCheckConfig
type HealthCheckResult ¶
type HealthChecker ¶
type HealthChecker interface { CheckHealth() (result *HealthCheckResult, err error) URL() *url.URL Config() *HealthCheckConfig UpdateURL(url *url.URL) }
type HealthMonCheck ¶ added in v0.11.0
type HealthMonCheck interface { HealthMonitor HealthChecker }
type HealthMonitor ¶
type HealthMonitor interface { task.TaskStarter task.TaskFinisher fmt.Stringer WithHealthInfo Name() string json.Marshaler }
type JSONRepresentation ¶ added in v0.11.0
type JSONRepresentation struct { Name string Config *HealthCheckConfig Status Status Started time.Time Uptime time.Duration Latency time.Duration LastSeen time.Time Detail string URL *url.URL Extra map[string]any }
func (*JSONRepresentation) MarshalJSON ¶ added in v0.11.1
func (jsonRepr *JSONRepresentation) MarshalJSON() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.