Documentation ¶
Overview ¶
Package plugin provides tools for loading and registering proxy plugins
Index ¶
- Constants
- func Load(path, pattern string, rmf RegisterModifierFunc) (int, error)
- func LoadWithLogger(path, pattern string, rmf RegisterModifierFunc, logger logging.Logger) (int, error)
- func RegisterModifier(name string, ...)
- type LoggerRegisterer
- type ModifierFactory
- type Plugin
- type RegisterModifierFunc
- type Registerer
Constants ¶
const (
// Namespace is the namespace for the extra_config section
Namespace = "github.com/devopsfaith/krakend/proxy/plugin"
)
Variables ¶
This section is empty.
Functions ¶
func Load ¶
func Load(path, pattern string, rmf RegisterModifierFunc) (int, error)
Load scans the given path using the pattern and registers all the found modifier plugins into the rmf
func LoadWithLogger ¶
func LoadWithLogger(path, pattern string, rmf RegisterModifierFunc, logger logging.Logger) (int, error)
LoadWithLogger scans the given path using the pattern and registers all the found modifier plugins into the rmf
Types ¶
type LoggerRegisterer ¶
type LoggerRegisterer interface {
RegisterLogger(interface{})
}
type ModifierFactory ¶
ModifierFactory is a function that, given a config passed as a map, returns a modifier
func GetRequestModifier ¶
func GetRequestModifier(name string) (ModifierFactory, bool)
GetRequestModifier returns a ModifierFactory from the request namespace by name
func GetResponseModifier ¶
func GetResponseModifier(name string) (ModifierFactory, bool)
GetResponseModifier returns a ModifierFactory from the response namespace by name
type RegisterModifierFunc ¶
type RegisterModifierFunc func( name string, modifierFactory func(map[string]interface{}) func(interface{}) (interface{}, error), appliesToRequest bool, appliesToResponse bool, )
RegisterModifierFunc type is the function passed to the loaded Registerers
type Registerer ¶
type Registerer interface { RegisterModifiers(func( name string, modifierFactory func(map[string]interface{}) func(interface{}) (interface{}, error), appliesToRequest bool, appliesToResponse bool, )) }
Registerer defines the interface for the plugins to expose in order to be able to be loaded/registered