mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-03 23:33:37 -07:00
(wip) rework configuration to support multiple frontends
This commit is contained in:
@@ -23,10 +23,10 @@ func init() {
|
||||
middleware.RegisterBuilder(Name, build)
|
||||
}
|
||||
|
||||
func build(options conf.MapConfig, _ storage.PeerStorage) (h middleware.Hook, err error) {
|
||||
func build(config conf.MapConfig, _ storage.PeerStorage) (h middleware.Hook, err error) {
|
||||
var cfg Config
|
||||
|
||||
if err = options.Unmarshal(&cfg); err != nil {
|
||||
if err = config.Unmarshal(&cfg); err != nil {
|
||||
err = fmt.Errorf("middleware %s: %w", Name, err)
|
||||
} else {
|
||||
if err := checkConfig(cfg); err == nil {
|
||||
|
||||
Reference in New Issue
Block a user