main: add CreateHooks() method for ConfigFile

This change simplifies middleware.Logic to having only one list of
PreHooks and one list of PostHooks.
This commit is contained in:
Jimmy Zelinskie
2016-08-31 21:09:46 -04:00
parent 6e790eed74
commit e39da6b4e6
3 changed files with 59 additions and 31 deletions

View File

@@ -54,8 +54,12 @@ func rootCmdRun(cmd *cobra.Command, args []string) error {
return err
}
// TODO create Hooks
logic := middleware.NewLogic(cfg.Config, peerStore, nil, nil, nil, nil)
preHooks, postHooks, err := configFile.CreateHooks()
if err != nil {
return err
}
logic := middleware.NewLogic(cfg.Config, peerStore, preHooks, postHooks)
if err != nil {
return err
}