env: Move each component into a separate struct
This commit cleans up the distillery code by making each component a distinct struct. Each of these components is also returned by by a new Component() function that replaces the Stacks() function.
This commit is contained in:
parent
2a14d93d3c
commit
09431c4869
16 changed files with 265 additions and 148 deletions
|
|
@ -38,7 +38,8 @@ func (upc updateprefixconfig) Run(context wisski_distillery.Context) error {
|
|||
return errPrefixUpdateFailed.WithMessageF(err)
|
||||
}
|
||||
|
||||
target := dis.ResolverPrefixConfig()
|
||||
resolver := dis.Resolver()
|
||||
target := resolver.ConfigPath()
|
||||
|
||||
// print the configuration
|
||||
config, err := os.OpenFile(target, os.O_WRONLY, fs.ModePerm)
|
||||
|
|
@ -69,7 +70,7 @@ func (upc updateprefixconfig) Run(context wisski_distillery.Context) error {
|
|||
|
||||
// and restart the resolver to apply the config!
|
||||
logging.LogMessage(context.IOStream, "restarting resolver stack")
|
||||
if err := dis.ResolverStack().Restart(context.IOStream); err != nil {
|
||||
if err := resolver.Stack().Restart(context.IOStream); err != nil {
|
||||
return errPrefixUpdateFailed.WithMessageF(err)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue