feat(agent): unify service statuses across monitor impls
This commit is contained in:
@@ -1,6 +1,22 @@
|
||||
package models
|
||||
|
||||
// ServiceStatus represents the unified status of a service across all monitor types.
|
||||
type ServiceStatus string
|
||||
|
||||
const (
|
||||
StatusRunning ServiceStatus = "running"
|
||||
StatusStopped ServiceStatus = "stopped"
|
||||
StatusDegraded ServiceStatus = "degraded"
|
||||
StatusPending ServiceStatus = "pending"
|
||||
StatusUnknown ServiceStatus = "unknown"
|
||||
)
|
||||
|
||||
// IsHealthy reports whether the service is stable enough for dependents to rely on.
|
||||
func (s ServiceStatus) IsHealthy() bool {
|
||||
return s == StatusRunning
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
Name string
|
||||
Status string
|
||||
Status ServiceStatus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user