mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-18 22:49:52 +02:00
fix: uptime metrics
This commit is contained in:
@@ -16,6 +16,23 @@ const (
|
||||
IdlingMask = StatusNapping | StatusStarting
|
||||
)
|
||||
|
||||
func NewStatus(s string) Status {
|
||||
switch s {
|
||||
case "healthy":
|
||||
return StatusHealthy
|
||||
case "unhealthy":
|
||||
return StatusUnhealthy
|
||||
case "napping":
|
||||
return StatusNapping
|
||||
case "starting":
|
||||
return StatusStarting
|
||||
case "error":
|
||||
return StatusError
|
||||
default:
|
||||
return StatusUnknown
|
||||
}
|
||||
}
|
||||
|
||||
func (s Status) String() string {
|
||||
switch s {
|
||||
case StatusHealthy:
|
||||
|
||||
Reference in New Issue
Block a user