go-scopes/examples/demo/etc/etc.go

33 lines
689 B
Go

package etc
import (
lib "git.sr.ht/~cco/go-scopes"
"git.sr.ht/~cco/go-scopes/app"
"git.sr.ht/~cco/go-scopes/config"
"git.sr.ht/~cco/go-scopes/logging"
)
func Config() lib.Config {
ovr := Overrides().Use
b := config.Base
app_c := app.Cfg{
BaseCfg: b("dummy", app.Start),
Home: ovr(".", HOME),
AppType: "standard",
Logging: &logging.Cfg{
Logfile: ovr("log/scopes.log", LOGFILE),
},
}
app_c.Add(config.Cfg{
BaseCfg: b("config", config.Start),
ConfigFormat: "etc",
})
return &app_c
}
// collect here the names of fields that may be overridden via
// explicit Override() or SCOPES_* environment settings.
const (
HOME = "home"
LOGFILE = "logfile"
)