Use a better method to reload command presets

This commit is contained in:
NI
2020-03-12 21:18:08 +08:00
parent b2210ce2b6
commit 1009cd4284
12 changed files with 206 additions and 374 deletions

View File

@@ -21,11 +21,8 @@ import (
"github.com/niruix/sshwifty/application/log"
)
// Reconfigurator reloads configuration
type Reconfigurator func(p Configuration) Configuration
// PresetReloader reloads preset
type PresetReloader func(p Preset) (Preset, error)
// Loader Configuration loader
type Loader func(
log log.Logger,
r Reconfigurator,
) (name string, cfg Configuration, err error)
type Loader func(log log.Logger) (name string, cfg Configuration, err error)