util

package
v0.3.7-alpha3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2022 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

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

func AutoMigrate(db *gorm.DB, storageConfig storage.Config) error

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

func LoadReport(db *gorm.DB) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL