Documentation
¶
Index ¶
- type HealthCheck
- type HealthMonitor
- func (hm *HealthMonitor) GetLastCheck() time.Time
- func (hm *HealthMonitor) GetLastError() error
- func (hm *HealthMonitor) GetStatus() HealthStatus
- func (hm *HealthMonitor) IsHealthy() bool
- func (hm *HealthMonitor) IsReady() bool
- func (hm *HealthMonitor) IsStarting() bool
- func (hm *HealthMonitor) ResultsChannel() <-chan HealthCheck
- func (hm *HealthMonitor) SetCheckInterval(interval time.Duration)
- func (hm *HealthMonitor) SetReadinessTimeout(timeout time.Duration)
- func (hm *HealthMonitor) SetTimeout(timeout time.Duration)
- func (hm *HealthMonitor) Start()
- func (hm *HealthMonitor) Stop()
- func (hm *HealthMonitor) WaitForReady() error
- type HealthStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HealthCheck ¶
type HealthCheck struct {
Endpoint string
Status HealthStatus
Latency time.Duration
Error error
Timestamp time.Time
}
HealthCheck represents a health check result
type HealthMonitor ¶
type HealthMonitor struct {
// contains filtered or unexported fields
}
HealthMonitor monitors the health of the core service
func NewHealthMonitor ¶
func NewHealthMonitor(endpoint string, logger *zap.SugaredLogger, stateMachine *state.Machine) *HealthMonitor
NewHealthMonitor creates a new health monitor
func (*HealthMonitor) GetLastCheck ¶
func (hm *HealthMonitor) GetLastCheck() time.Time
GetLastCheck returns the time of the last health check
func (*HealthMonitor) GetLastError ¶
func (hm *HealthMonitor) GetLastError() error
GetLastError returns the last health check error
func (*HealthMonitor) GetStatus ¶
func (hm *HealthMonitor) GetStatus() HealthStatus
GetStatus returns the current health status
func (*HealthMonitor) IsHealthy ¶
func (hm *HealthMonitor) IsHealthy() bool
IsHealthy returns true if the service is healthy
func (*HealthMonitor) IsReady ¶
func (hm *HealthMonitor) IsReady() bool
IsReady returns true if the service is ready
func (*HealthMonitor) IsStarting ¶
func (hm *HealthMonitor) IsStarting() bool
IsStarting returns true if the service is starting up
func (*HealthMonitor) ResultsChannel ¶
func (hm *HealthMonitor) ResultsChannel() <-chan HealthCheck
ResultsChannel returns a channel for receiving health check results
func (*HealthMonitor) SetCheckInterval ¶
func (hm *HealthMonitor) SetCheckInterval(interval time.Duration)
SetCheckInterval sets the health check interval
func (*HealthMonitor) SetReadinessTimeout ¶
func (hm *HealthMonitor) SetReadinessTimeout(timeout time.Duration)
SetReadinessTimeout sets the readiness wait timeout
func (*HealthMonitor) SetTimeout ¶
func (hm *HealthMonitor) SetTimeout(timeout time.Duration)
SetTimeout sets the health check timeout
func (*HealthMonitor) Stop ¶
func (hm *HealthMonitor) Stop()
Stop stops the health monitoring (safe to call multiple times)
func (*HealthMonitor) WaitForReady ¶
func (hm *HealthMonitor) WaitForReady() error
WaitForReady waits for the service to become ready within the timeout
type HealthStatus ¶
type HealthStatus string
HealthStatus represents the health status of the core service
const ( HealthStatusUnknown HealthStatus = "unknown" HealthStatusStarting HealthStatus = "starting" HealthStatusHealthy HealthStatus = "healthy" HealthStatusUnhealthy HealthStatus = "unhealthy" )