plugin

package
v0.0.0-...-6637ac4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2019 License: Apache-2.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUseHttpsToContext

func AddUseHttpsToContext(ctx context.Context, useCtx bool) context.Context

func GetUseHttpsContext

func GetUseHttpsContext(ctx context.Context) bool

func ListMultiBackendAdapters

func ListMultiBackendAdapters() []string

ListMultiBackendAdapters lists the multi backend adapter factories that have been registered.

func ListPlugins

func ListPlugins() []string

ListPlugins lists the plugins currently registered with the package.

func MultiBackendAdapterRegistryContains

func MultiBackendAdapterRegistryContains(name string) bool

MultiBackendAdapterRegistryContains is a predicate that returns true if the named multi backend adapter factory has been registered

func RegisterMultiBackendAdapterFactory

func RegisterMultiBackendAdapterFactory(name string, factory MultiBackendAdapterFactory) error

RegisterMultiBackendAdapterFactory registers the given factory function using the given name.

func RegisterWrapperFactory

func RegisterWrapperFactory(name string, factory WrapperFactory, args ...interface{}) error

RegisterWrapperFactory is a method for registering wrapper factories with the package.

func RegistryContains

func RegistryContains(name string) bool

RegistryContains is a predicate that indicates if the named plugin is registered with this package

func WrapHandlerFunc

func WrapHandlerFunc(hf http.HandlerFunc, wrapperFactories []*WrapperFactoryContext) http.HandlerFunc

WrapHandlerFunc wraps a handler function, which is instantiated using the wrapper factory and arguments to the wrapper factory stored in the wrapper factory context

Types

type BackendHandlerMap

type BackendHandlerMap map[string]http.Handler

BackendHandlerMap provides a map from backend name to the handler associated with the backend.

type MultiBackendAdapter

type MultiBackendAdapter struct {
	BackendHandlerCtx BackendHandlerMap
	Handler           MultiBackendHandler
}

MultiBackendAdapter is a type used to adapt a handler function with an additional context argument to the standard HTTP handler function for use with golang's HTTP functions.

func (*MultiBackendAdapter) ServeHTTP

func (mra *MultiBackendAdapter) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*MultiBackendAdapter) ToHandlerFunc

func (mra *MultiBackendAdapter) ToHandlerFunc() http.HandlerFunc

ToHandlerFunc converts a MultiBackendAdapter to an http.HandlerFunc

type MultiBackendAdapterFactory

type MultiBackendAdapterFactory func(BackendHandlerMap) *MultiBackendAdapter

MultiBackendAdapterFactory defines a function type for instantiating a MultiBackendAdapter given a backend handler map.

func LookupMultiBackendAdapterFactory

func LookupMultiBackendAdapterFactory(name string) (MultiBackendAdapterFactory, error)

LookupMultiBackendAdapterFactory returns the factory function registered for the given name.

type MultiBackendHandler

type MultiBackendHandler interface {
	MultiBackendServeHTTP(BackendHandlerMap, http.ResponseWriter, *http.Request)
}

MultiBackendHandler defines an HTTP handler interface that includes backend handler context.

type MultiBackendHandlerFunc

type MultiBackendHandlerFunc func(BackendHandlerMap, http.ResponseWriter, *http.Request)

MultiBackendHandlerFunc defines a handler function that includes backend handler context

func (MultiBackendHandlerFunc) MultiBackendServeHTTP

func (h MultiBackendHandlerFunc) MultiBackendServeHTTP(bhMap BackendHandlerMap, w http.ResponseWriter, r *http.Request)

MultiBackendServeHTTP is a method that invokes a MultiBackendHandlerFunc handler with the associated context and request/response arguments

type Wrapper

type Wrapper interface {
	Wrap(http.Handler) http.Handler
}

Wrapper defines an interface for things that can wrap http Handlers

type WrapperFactory

type WrapperFactory func(...interface{}) Wrapper

WrapperFactory defines a function that can create something that implements Wrapper

type WrapperFactoryContext

type WrapperFactoryContext struct {
	// contains filtered or unexported fields
}

func LookupWrapperFactoryCtx

func LookupWrapperFactoryCtx(name string) (*WrapperFactoryContext, error)

LookupWrapperFactoryCtx looks up the named wrapper factory in the registry, returning an error if the factory is not registered.

Directories

Path Synopsis
Package timing provides a plugin Xavi wires in as the enclosing wrapper for the user specified plugin chain.
Package timing provides a plugin Xavi wires in as the enclosing wrapper for the user specified plugin chain.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL