leo
c4d0cb209b
All checks were successful
continuous-integration/drone/push Build is passing
* let the settings struct be the single source of truth * rm app fields that are covered by settings * pass around a pointer to settings instead of config * consolidate config+flags into settings on start-up * update tests * rm empty settings.go file fixes #4
30 lines
443 B
Go
30 lines
443 B
Go
package handlers
|
|
|
|
import (
|
|
"io/fs"
|
|
|
|
"git.dotya.ml/mirre-mt/pcmt/app/settings"
|
|
"git.dotya.ml/mirre-mt/pcmt/slogging"
|
|
)
|
|
|
|
var (
|
|
setting *settings.Settings
|
|
appver string
|
|
log *slogging.Logger
|
|
tmplPath string
|
|
)
|
|
|
|
func InitHandlers(s *settings.Settings, tmpls fs.FS) {
|
|
log = slogging.GetLogger()
|
|
|
|
setting = s
|
|
|
|
tmplPath = setting.TemplatesPath()
|
|
|
|
appver = setting.Version()
|
|
|
|
log.Debugf("tmpls: %+v", tmpls)
|
|
|
|
initTemplates(tmpls)
|
|
}
|