feat(01-02): implement layered compass config
- Merge plugin defaults, sorted YAML, SUMMER_ env, overrides and Set - Persist atomically to env overrides; Reload clears runtime Set - Discover HasConfig before Register and print layered hello values
This commit is contained in:
@@ -29,10 +29,14 @@ func (p *Plugin) Commands() []bonfire.Command {
|
||||
Description: "Print the configured application name",
|
||||
Run: func(ctx context.Context, in bonfire.Input, out bonfire.Output) error {
|
||||
name := ""
|
||||
posts := 0
|
||||
debug := false
|
||||
if p.app != nil && p.app.Config != nil {
|
||||
name = p.app.Config.String("app.name")
|
||||
posts = p.app.Config.Int("golem15.hello.posts_per_page")
|
||||
debug = p.app.Config.Bool("app.debug")
|
||||
}
|
||||
out.Println(name)
|
||||
out.Printf("name=%s posts_per_page=%d debug=%t\n", name, posts, debug)
|
||||
return nil
|
||||
},
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user