Documentation ¶
Index ¶
- Variables
- func AutoMigrate(db *gorm.DB, storageConfig storage.Config) error
- func CheckDBTimeSync(db *gorm.DB, staticConfig config.StaticConfig) error
- func DatabaseOutOfSync(dbTime time.Time, config config.StaticConfig) error
- func LoadConfig(db *gorm.DB, cnf *config.DynamicConfig) error
- func LoadReport(db *gorm.DB) error
- type Store
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTimeDifferenceTooLarge = errors.New("time difference between master host, and database host are is large. The difference should not exceed 2 seconds")
Functions ¶
func AutoMigrate ¶ added in v0.3.8
AutoMigrate migrates all tables
func CheckDBTimeSync ¶ added in v0.3.8
func CheckDBTimeSync(db *gorm.DB, staticConfig config.StaticConfig) error
CheckDBTimeSync gets the current time reported by the database and return an error if out of sync
func DatabaseOutOfSync ¶
func DatabaseOutOfSync(dbTime time.Time, config config.StaticConfig) error
DatabaseOutOfSync ensures that drift between database is not larger than DatabaseMaxTimeDriftSeconds
func LoadConfig ¶
func LoadConfig(db *gorm.DB, cnf *config.DynamicConfig) error
func LoadReport ¶
Types ¶
type Store ¶
type Store struct { Round roundrepo.Repo Host hostrepo.Repo HostGroup hostgrouprepo.Repo Service servicerepo.Repo ServiceGroup servicegrouprepo.Repo Team teamrepo.Repo Check checkrepo.Repo Property propertyrepo.Repo Config configrepo.Repo Report reportrepo.Repo Policy policyrepo.Repo Users userrepo.Repo }
Store is a single collection of all Repositories
func NewRepoStore ¶ added in v0.3.8
func NewRepoStore(roundrepo roundrepo.Repo, hostrepo hostrepo.Repo, hostgrouprepo hostgrouprepo.Repo, servicerepo servicerepo.Repo, servicegrouprepo servicegrouprepo.Repo, teamrepo teamrepo.Repo, checkrepo checkrepo.Repo, propertyrepo propertyrepo.Repo, configrepo configrepo.Repo, reportrepo reportrepo.Repo, policyrepo policyrepo.Repo, userrepo userrepo.Repo) *Store
Click to show internal directories.
Click to hide internal directories.