Documentation ¶
Index ¶
- Constants
- Variables
- func AddPluginToRegistry(plugin Plugin)
- func ConvertConfig(config interface{}, target interface{}) error
- func GetAllPlugins() map[string]Plugin
- func IsJSON(str string) bool
- func ReportError(ctx context.Context, w http.ResponseWriter, status int, msg string, err error)
- func ReportNotFound(w http.ResponseWriter)
- type ContextKey
- type Plugin
- type PluginBase
- type PluginType
Constants ¶
View Source
const ( ConsumerUserHeader = "Direktiv-Consumer-User" ConsumerTagsHeader = "Direktiv-Consumer-Tags" ConsumerGroupsHeader = "Direktiv-Consumer-Groups" )
nolint
Variables ¶
View Source
var ( URLParamCtxKey = &ContextKey{"URLParamContext"} ConsumersParamCtxKey = &ContextKey{"ConsumersParamCtxKey"} NamespaceCtxKey = &ContextKey{"namespace"} EndpointCtxKey = &ContextKey{"endpoint"} RouteCtxKey = &ContextKey{"route"} )
Functions ¶
func AddPluginToRegistry ¶
func AddPluginToRegistry(plugin Plugin)
func ConvertConfig ¶
func ConvertConfig(config interface{}, target interface{}) error
ConvertConfig converts an interface into the config struct of the plugin. It is used in the `Configure` function of the Plugin.
func GetAllPlugins ¶
func ReportError ¶
func ReportNotFound ¶
func ReportNotFound(w http.ResponseWriter)
Types ¶
type ContextKey ¶
type ContextKey struct {
// contains filtered or unexported fields
}
func (*ContextKey) String ¶
func (k *ContextKey) String() string
type Plugin ¶
type Plugin interface { Configure(config interface{}, namespace string) (core.PluginInstance, error) Name() string Type() PluginType }
func GetPluginFromRegistry ¶
func NewPluginBase ¶
func NewPluginBase(pname string, ptype PluginType, configFn func(interface{}, string) (core.PluginInstance, error), ) Plugin
type PluginBase ¶
type PluginBase struct {
// contains filtered or unexported fields
}
PluginBase is a basic implementation of the Plugin interface.
func (PluginBase) Configure ¶
func (p PluginBase) Configure(config interface{}, ns string) (core.PluginInstance, error)
func (PluginBase) Name ¶
func (p PluginBase) Name() string
func (PluginBase) Type ¶
func (p PluginBase) Type() PluginType
type PluginType ¶
type PluginType string
var ( AuthPluginType PluginType = "auth" TargetPluginType PluginType = "target" InboundPluginType PluginType = "inbound" OutboundPluginType PluginType = "outbound" )
Click to show internal directories.
Click to hide internal directories.