Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Incident ¶
type Incident struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey" json:"id"`
MonitorID uuid.UUID `gorm:"type:uuid;index;not null" json:"monitor_id"`
Monitor Monitor `gorm:"foreignKey:MonitorID" json:"-"`
StartedAt time.Time `gorm:"not null" json:"started_at"`
ResolvedAt *time.Time `json:"resolved_at,omitempty"`
Cause string `gorm:"type:text" json:"cause"`
Status IncidentStatus `gorm:"type:varchar(50);default:'OPEN';not null" json:"status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Incident tracks outages, degraded performance events, and resolution workflows.
type IncidentStatus ¶
type IncidentStatus string
IncidentStatus defines the resolution lifecycle of an incident.
const ( IncidentOpen IncidentStatus = "OPEN" IncidentInvestigating IncidentStatus = "INVESTIGATING" IncidentResolved IncidentStatus = "RESOLVED" )
type Monitor ¶
type Monitor struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey" json:"id"`
UserID uuid.UUID `gorm:"type:uuid;index;not null" json:"user_id"`
User User `gorm:"foreignKey:UserID" json:"-"`
Name string `gorm:"type:varchar(255);not null" json:"name"`
URL string `gorm:"type:text;not null" json:"url"`
CheckIntervalSeconds int `gorm:"default:60;not null" json:"check_interval_seconds"`
Status MonitorStatus `gorm:"type:varchar(50);default:'PAUSED';not null" json:"status"`
SSLExpirationDate *time.Time `gorm:"index" json:"ssl_expiration_date,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
PingLogs []PingLog `gorm:"foreignKey:MonitorID;constraint:OnDelete:CASCADE" json:"ping_logs,omitempty"`
Incidents []Incident `gorm:"foreignKey:MonitorID;constraint:OnDelete:CASCADE" json:"incidents,omitempty"`
}
Monitor represents an external uptime or synthetic monitoring target.
type MonitorStatus ¶
type MonitorStatus string
MonitorStatus defines the operational status of a monitor target.
const ( StatusUp MonitorStatus = "UP" StatusDown MonitorStatus = "DOWN" StatusDegraded MonitorStatus = "DEGRADED" StatusPaused MonitorStatus = "PAUSED" )
type PingLog ¶
type PingLog struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey" json:"id"`
MonitorID uuid.UUID `gorm:"type:uuid;index;not null" json:"monitor_id"`
Monitor Monitor `gorm:"foreignKey:MonitorID" json:"-"`
StatusCode int `gorm:"not null" json:"status_code"`
ResponseTimeMS int `gorm:"not null" json:"response_time_ms"`
ErrorMessage string `gorm:"type:text" json:"error_message,omitempty"`
CreatedAt time.Time `gorm:"index" json:"created_at"`
}
PingLog records the result of an individual synthetic probe or HTTP check execution.
type User ¶
type User struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey" json:"id"`
Email string `gorm:"type:varchar(255);uniqueIndex;not null" json:"email"`
PasswordHash string `gorm:"type:varchar(255);not null" json:"-"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Monitors []Monitor `gorm:"foreignKey:UserID;constraint:OnDelete:CASCADE" json:"monitors,omitempty"`
}
User represents tenant user accounts.
Click to show internal directories.
Click to hide internal directories.