diff --git a/model/status.go b/model/status.go index c7b2cbe..655d9b2 100644 --- a/model/status.go +++ b/model/status.go @@ -6,18 +6,20 @@ import ( "gorm.io/gorm" ) +type StatusCode string + const ( - StatusOK = "ok" // Means - response ok, service is alive - StatusFailed = "failed" // Means - response failed, all tries failed, service down - StatusWarn = "warn" // Means - response failed after N tries and still watched + StatusOK StatusCode = "ok" // Means - response ok, service is alive + StatusFailed StatusCode = "failed" // Means - response failed, all tries failed, service down + StatusWarn StatusCode = "warn" // Means - response failed after N tries and still watched ) type Status struct { - ID int `gorm:"primary_key;auto_increment" json:"-"` - ServiceID int `gorm:"one" json:"-"` - Status string `gorm:"size:255;not null" json:"status"` - Description *string `gorm:"size:255" json:"description"` - CreatedAt time.Time `json:"created_at"` + ID int `gorm:"primary_key;auto_increment" json:"-"` + ServiceID int `gorm:"one" json:"-"` + Status StatusCode `gorm:"size:255;not null" json:"status"` + Description *string `gorm:"size:255" json:"description"` + CreatedAt time.Time `json:"created_at"` } func (Status) TableName() string {