middleware

package
v0.0.0-...-83625b3 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WrapHandler

func WrapHandler(h http.Handler, dependencies ...string) http.Handler

func WrapHandlerFunc

func WrapHandlerFunc(f func(http.ResponseWriter, *http.Request), dependencies ...string) http.Handler

Types

type DependencyError

type DependencyError struct {
	NotFound string
	Provided []string
}

func (DependencyError) Error

func (de DependencyError) Error() string

type Func

type Func func(http.Handler) http.Handler

func (Func) Dependencies

func (mf Func) Dependencies() []string

func (Func) Wrap

func (mf Func) Wrap(next http.Handler) http.Handler

type HandlerWrapper

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

type HasMiddlewareDependencies

type HasMiddlewareDependencies interface {
	Dependencies() []string
}

type Middleware

type Middleware interface {
	HandlerWrapper
	HasMiddlewareDependencies
}

type NoDependencies

type NoDependencies struct{}

func (NoDependencies) Dependencies

func (n NoDependencies) Dependencies() []string

type Stack

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

func NewStack

func NewStack(parent *Stack) *Stack

func (*Stack) Push

func (ms *Stack) Push(m Middleware) error

func (*Stack) Shift

func (ms *Stack) Shift(m Middleware) error

func (*Stack) ValidateHandler

func (ms *Stack) ValidateHandler(h http.Handler) error

func (*Stack) Wrap

func (ms *Stack) Wrap(handler http.Handler) http.Handler

Jump to

Keyboard shortcuts

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