2024-02-11 10:56:21 +00:00
|
|
|
package models
|
|
|
|
|
2024-02-15 22:47:56 +00:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"gorm.io/gorm"
|
|
|
|
)
|
2024-02-12 08:25:11 +00:00
|
|
|
|
|
|
|
type OAuth2State struct {
|
|
|
|
State string `gorm:"primary_key"`
|
|
|
|
Expiry time.Time
|
|
|
|
}
|
|
|
|
|
2024-02-11 10:56:21 +00:00
|
|
|
type Healthcheck struct {
|
2024-02-15 22:47:56 +00:00
|
|
|
gorm.Model
|
2024-02-16 12:41:18 +00:00
|
|
|
Slug string `gorm:"unique"`
|
2024-02-15 22:47:56 +00:00
|
|
|
Name string `gorm:"unique"`
|
2024-02-11 10:56:21 +00:00
|
|
|
Status string // UP, DOWN
|
|
|
|
UptimePercentage float64
|
2024-02-15 22:47:56 +00:00
|
|
|
Schedule string
|
|
|
|
}
|
|
|
|
|
2024-02-16 12:07:29 +00:00
|
|
|
type HealthcheckHttp struct {
|
2024-02-15 22:47:56 +00:00
|
|
|
gorm.Model
|
|
|
|
Healthcheck
|
2024-02-16 12:41:18 +00:00
|
|
|
Url string
|
2024-02-15 22:47:56 +00:00
|
|
|
Method string
|
|
|
|
}
|
|
|
|
|
2024-02-16 12:07:29 +00:00
|
|
|
type HealthcheckTcp struct {
|
2024-02-15 22:47:56 +00:00
|
|
|
gorm.Model
|
|
|
|
Healthcheck
|
|
|
|
Hostname string
|
|
|
|
Port int
|
|
|
|
}
|
|
|
|
|
|
|
|
type Cronjob struct {
|
|
|
|
gorm.Model
|
2024-02-16 12:41:18 +00:00
|
|
|
Slug string `gorm:"unique"`
|
2024-02-15 22:47:56 +00:00
|
|
|
Name string `gorm:"unique"`
|
|
|
|
Schedule string
|
|
|
|
Buffer int
|
2024-02-11 10:56:21 +00:00
|
|
|
}
|
2024-02-16 12:07:29 +00:00
|
|
|
|
|
|
|
type HealthcheckHttpHistory struct {
|
|
|
|
gorm.Model
|
|
|
|
HealthcheckHTTP HealthcheckHttp `gorm:"foreignkey:ID"`
|
|
|
|
Status string
|
|
|
|
}
|
|
|
|
|
|
|
|
type HealthcheckTcpHistory struct {
|
|
|
|
gorm.Model
|
|
|
|
HealthcheckTCP HealthcheckTcp `gorm:"foreignkey:ID"`
|
|
|
|
Status string
|
|
|
|
}
|
|
|
|
|
|
|
|
type CronjobHistory struct {
|
|
|
|
gorm.Model
|
|
|
|
Cronjob Cronjob `gorm:"foreignkey:ID"`
|
|
|
|
Status string
|
|
|
|
}
|