go: add a setting val for whether db is set up
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
leo 2023-05-05 22:58:13 +02:00
parent b1ab686493
commit f1bb52c58f
Signed by: wanderer
SSH Key Fingerprint: SHA256:Dp8+iwKHSlrMEHzE3bJnPng70I7LEsa3IJXRH/U+idQ
2 changed files with 13 additions and 0 deletions

@ -16,6 +16,7 @@ type Settings struct {
assetsPath string assetsPath string
templatesPath string templatesPath string
version string version string
dbIsSetUp bool
} }
// New returns a new instance of the settings struct. // New returns a new instance of the settings struct.
@ -119,6 +120,11 @@ func (s *Settings) Version() string {
return s.version return s.version
} }
// DbIsSetUp returns the dbIsSetUp.
func (s *Settings) DbIsSetUp() bool {
return s.dbIsSetUp
}
// SetHost sets the host. // SetHost sets the host.
func (s *Settings) SetHost(host string) { func (s *Settings) SetHost(host string) {
s.host = host s.host = host
@ -168,3 +174,8 @@ func (s *Settings) SetTemplatesPath(templatesPath string) {
func (s *Settings) SetVersion(version string) { func (s *Settings) SetVersion(version string) {
s.version = version s.version = version
} }
// SetDbIsSetUp sets the dbIsSetUp.
func (s *Settings) SetDbIsSetUp(is bool) {
s.dbIsSetUp = is
}

2
run.go

@ -118,6 +118,8 @@ func run() error {
setting := settings.New() setting := settings.New()
setting.SetDbIsSetUp(true)
setting.Consolidate( setting.Consolidate(
conf, host, port, devel, version, conf, host, port, devel, version,
) )