middlewares

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package middlewares contains all registered router middlewares.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, mid Middleware) error

Register registers provided middleware within the container

Types

type Chain

type Chain []Middleware

Chain is the middleware executable chain.

func GetChain

func GetChain(names []string) (Chain, error)

GetChain gets the httprouter middleware chain for provided middleware 'names'.

func (Chain) Handle

func (c Chain) Handle(handle httprouter.Handle) httprouter.Handle

Handle handles the chain of middlewares for given 'handle' httprouter.Handle.

type Middleware

type Middleware func(next httprouter.Handle) httprouter.Handle

Middleware is the standard http library middleware function.

func Get

func Get(name string) (Middleware, 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