Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SystemConstructors ¶
func SystemConstructors() map[string]*Constructor
SystemConstructors returns all system plugins.
Types ¶
type AgentHandler ¶
type AgentHandler interface { // If the plugin doesn't handle the request, it should return false. HandleAgentRequest(w http.ResponseWriter, r *http.Request) bool }
AgentHandler is the handler to handle requests from agent port (default 9900).
type Constructor ¶
type Constructor struct { // Kind is the kind of the plugin. Kind string // DefaultSpec returns a default spec for the plugin, with default values. // The function should always return a new spec copy, since it will be // modified and used by next moves. // // NOTE1: The DefaultSpec must returns complete spec (including name) for system plugins. DefaultSpec func() Spec // SystemPlugin being true value indicates the plugin is system-level, // which means it will always be loaded even if not specified in the config. SystemPlugin bool // NewInstance creates a new plugin instance for the kind. // NOTE: The spec has the same type with the one which DefaultSpec returns. NewInstance func(spec Spec) (Plugin, error) }
Constructor contains metadata and contruction resources of a kind of plugin.
type ConstructorsByKind ¶
type ConstructorsByKind []*Constructor
ConstructorsByKind is a slice of Constructor, which is sortable by Kind.
func (ConstructorsByKind) Len ¶
func (c ConstructorsByKind) Len() int
func (ConstructorsByKind) Less ¶
func (c ConstructorsByKind) Less(i, j int) bool
func (ConstructorsByKind) Swap ¶
func (c ConstructorsByKind) Swap(i, j int)
type Plugin ¶
Plugin is the plugin interface.
func NewFromJSON ¶
NewFromJSON creates a plugin instance according to the JSON spec.
type Spec ¶
type Spec interface { // Name returns name. Name() string // Kind returns kind. Kind() string // Validate validates the spec. Validate() error }
Spec is the common interface of filter specs
type UserClientRequestWrapper ¶
type UserClientRequestWrapper interface {
WrapUserClientRequest(parent context.Context, req *http.Request) *http.Request
}
UserClientRequestWrapper wraps the user client.
type UserClientWrapper ¶
UserClientWrapper wraps the user client.
type UserHandlerFuncWrapper ¶
type UserHandlerFuncWrapper interface { // If the plugin doesn't wrap the user handler, it should not implement this method. WrapUserHandlerFunc(fn http.HandlerFunc) http.HandlerFunc }
UserHandlerFuncWrapper wraps the user HandleFunc.
Click to show internal directories.
Click to hide internal directories.