36 lines
633 B
Go
36 lines
633 B
Go
package handlers
|
|
|
|
import (
|
|
"io/fs"
|
|
|
|
"git.dotya.ml/mirre-mt/pcmt/app/settings"
|
|
"git.dotya.ml/mirre-mt/pcmt/slogging"
|
|
"golang.org/x/exp/slog"
|
|
)
|
|
|
|
var (
|
|
setting *settings.Settings
|
|
appver string
|
|
slogger *slogging.Logger
|
|
log slogging.Logger
|
|
tmplPath string
|
|
)
|
|
|
|
func InitHandlers(s *settings.Settings, tmpls fs.FS) {
|
|
slogger = slogging.GetLogger()
|
|
log = *slogger // have a local copy.
|
|
log.Logger = log.Logger.With(
|
|
slog.Group("pcmt extra", slog.String("module", "handlers")),
|
|
)
|
|
|
|
setting = s
|
|
|
|
tmplPath = setting.TemplatesPath()
|
|
|
|
appver = setting.Version()
|
|
|
|
log.Debugf("tmpls: %+v", tmpls)
|
|
|
|
initTemplates(tmpls)
|
|
}
|