Improve plugins builder.
This commit is contained in:
parent
1dbee90d34
commit
66d151df77
4 changed files with 22 additions and 10 deletions
|
@ -5,8 +5,14 @@ import (
|
|||
"fmt"
|
||||
|
||||
"github.com/containous/traefik/v2/pkg/config/dynamic"
|
||||
"github.com/containous/traefik/v2/pkg/plugins"
|
||||
)
|
||||
|
||||
// PluginsBuilder the plugin's builder interface.
|
||||
type PluginsBuilder interface {
|
||||
Build(pName string, config map[string]interface{}, middlewareName string) (plugins.Constructor, error)
|
||||
}
|
||||
|
||||
func findPluginConfig(rawConfig map[string]dynamic.PluginConf) (string, map[string]interface{}, error) {
|
||||
if len(rawConfig) != 1 {
|
||||
return "", nil, errors.New("plugin: invalid configuration: no configuration or too many plugin definition")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue