middlewares

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMiddlewareAlreadyRegistered error = errors.New("Middleware already registered")
	ErrMiddlewareNotRegistered     error = errors.New("Middleware not registered.")
)

Errors used for the middlewares

Functions

func RegisterMiddleware

func RegisterMiddleware(name string, mid MiddlewareFunc) error

RegisterMiddleware registers provided middleware within the container

Types

type MiddlewareFunc

type MiddlewareFunc func(next http.Handler) http.Handler

MiddlewareFunc is the function used as a middlewares for the gateway handlers

func Get

func Get(name string) (MiddlewareFunc, error)

Get returns the middleware function by it's name If the middleware with provided name doesn't exists returns an error

Jump to

Keyboard shortcuts

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