go-scopes/scopes.go

26 lines
407 B
Go

package scopes
import (
"git.sr.ht/~cco/go-scopes/common"
"git.sr.ht/~cco/go-scopes/config"
)
type Cfg struct {
*config.Base
AppType string
Home string
}
func Start(ctx common.Context) {
for _, cfg := range ctx.Config().Children() {
cctx := ctx.ChildContext(cfg)
cfg.Starter()(cctx)
}
}
// definitions
func RunApp(cfg common.Config) {
ctx := common.AppContext(cfg)
cfg.Starter()(ctx)
}