mirror of
https://github.com/sot-tech/mochi.git
synced 2026-04-26 23:50:00 -07:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user