Skip to content

Commit

Permalink
use the same key for loading one or several http handler plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
kpacha committed Nov 20, 2019
1 parent d8e2a77 commit 1b88f8c
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions transport/http/server/plugin/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func New(logger logging.Logger, next RunServer) RunServer {
}

name, nameOk := extra["name"].(string)
fifoRaw, fifoOk := extra["fifo"].([]interface{})
fifoRaw, fifoOk := extra["name"].([]interface{})
if !nameOk && !fifoOk {
logger.Debug("http-server-handler: no plugins required in the extra config")
return next(ctx, cfg, handler)
Expand Down Expand Up @@ -75,26 +75,3 @@ func New(logger logging.Logger, next RunServer) RunServer {
return next(ctx, cfg, handler)
}
}

// func singlePlugin(name string) error {
// rawHf, ok := r.Get(name)
// if !ok {
// logger.Debug("http-server-handler: no plugin resgistered as", name)
// return next(ctx, cfg, handler)
// }

// hf, ok := rawHf.(func(context.Context, map[string]interface{}, http.Handler) (http.Handler, error))
// if !ok {
// logger.Warning("http-server-handler: wrong plugin handler type:", name)
// return next(ctx, cfg, handler)
// }

// handlerWrapper, err := hf(context.Background(), extra, handler)
// if err != nil {
// logger.Warning("http-server-handler: error getting the plugin handler:", err.Error())
// return next(ctx, cfg, handler)
// }

// logger.Debug("http-server-handler: injecting plugin", name)
// return next(ctx, cfg, handlerWrapper)
// }

0 comments on commit 1b88f8c

Please sign in to comment.