Documentation
¶
Index ¶
Constants ¶
View Source
const ( StatusUnknown = "unknown" StatusOnline = "online" StatusError = "error" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
Conn maintains a connection to the database.
type Event ¶
type Event struct {
ID int64 `gorm:"primaryKey" json:"id"`
Time *time.Time `gorm:"not null" json:"time"`
SiteID int64 `gorm:"not null" json:"site_id"`
Site Site `gorm:"constraint:OnDelete:CASCADE;" json:"-"`
OldStatus string `gorm:"not null" json:"old_status"`
NewStatus string `gorm:"not null" json:"new_status"`
Details string `gorm:"not null" json:"details"`
}
Event represents an error that occurs
type Site ¶
type Site struct {
SiteWritable
ID int64 `gorm:"primaryKey" json:"id"`
LastCheck *time.Time `json:"last_check"`
Status string `gorm:"index;not null" json:"status"`
Details string `gorm:"not null" json:"details"`
}
Site is a URL that needs to be monitored.
type SiteWritable ¶
type SiteWritable struct {
Name string `gorm:"not null" json:"name"`
URL string `gorm:"not null" json:"url"`
Public bool `gorm:"not null" json:"public"`
Enabled bool `gorm:"not null" json:"enabled"`
Timeout int `gorm:"not null" json:"timeout"`
IgnoreHTTPErrors bool `gorm:"not null" json:"ignore_http_errors"`
OnlineInterval int `gorm:"not null" json:"online_interval"`
OfflineInterval int `gorm:"not null" json:"offline_interval"`
}
SiteWritable represents the writable fields of a site.
type User ¶
type User struct {
ID int64 `gorm:"primaryKey" json:"id"`
Email string `gorm:"not null;uniqueIndex" json:"email"`
Password string `gorm:"not null" json:"-"`
}
User is a user that can login.
func (*User) Authenticate ¶
Authenticate compares the provided password to the one stored in the database. An error is returned if the values do not match.
func (*User) SetPassword ¶
SetPassword salts and hashes the user's password. It does not store the new value in the database.
Click to show internal directories.
Click to hide internal directories.