pcmt/handlers/config.go
leo 25335293eb
All checks were successful
continuous-integration/drone/push Build is passing
chore: clean up handlers pkg
2023-04-19 22:08:17 +02:00

38 lines
613 B
Go

package handlers
import (
"io/fs"
"git.dotya.ml/mirre-mt/pcmt/config"
"git.dotya.ml/mirre-mt/pcmt/slogging"
)
var (
conf *config.Config
appver string
log *slogging.Logger
)
func setConfig(c *config.Config) {
if c != nil {
log.Info("setting handler config")
// c = conf
conf = c
log.Infof("set handler config to %#v", c)
} else {
log.Warn("error passing conf to handlers")
}
}
func setAppVer(v string) {
appver = v
}
func InitHandlers(version string, appconf *config.Config, tmpls fs.FS) {
log = slogging.GetLogger()
setConfig(appconf)
setAppVer(version)
initTemplates(tmpls)
}