Некоторые проверки не удались
CI / test (push) Successful in 2m5s
Docker / Build and publish worker image (push) Failing after 31s
33 строки
1.3 KiB
Go
33 строки
1.3 KiB
Go
package models
|
|
|
|
import (
|
|
"rocketgit.ru/rsmon/worker/app/models/concerns"
|
|
)
|
|
|
|
// Domain represents a customer-facing DNS name. The shape mirrors
|
|
// rstuff's `domains` table — see docs/parity/rstuff-inventory.md §2
|
|
// and docs/plans/inventory-management.md §4.
|
|
//
|
|
// Distinct from RknDomain (the RKN blocklist cache, see
|
|
// app/models/rkn_domain.go): RknDomain is read-only data about
|
|
// blocked domains; Domain is the customer-side name→site/server
|
|
// pointer that monitoring reasons about.
|
|
type Domain struct {
|
|
concerns.Model
|
|
|
|
AccountID int64 `gorm:"type:bigint REFERENCES accounts(id);not null;index" json:"account_id"`
|
|
Account *Account `json:"-"`
|
|
ServerID *int64 `gorm:"type:bigint REFERENCES servers(id) ON DELETE SET NULL;index" json:"server_id,omitempty"`
|
|
Server *Server `json:"-"`
|
|
SiteID *int64 `gorm:"type:bigint REFERENCES sites(id) ON DELETE SET NULL;index" json:"site_id,omitempty"`
|
|
Site *Site `json:"site,omitempty"`
|
|
Name string `gorm:"size:255;not null" json:"name"`
|
|
Env string `gorm:"size:32;not null;default:'production'" json:"env"`
|
|
IsActive bool `gorm:"not null;default:true" json:"is_active"`
|
|
|
|
concerns.Timestamped
|
|
}
|
|
|
|
// TableName provides functionality.
|
|
func (Domain) TableName() string { return "domains" }
|