middleware

package
v0.0.0-...-20aadb4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2018 License: MIT Imports: 6 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NegroniCorsAllowAll

func NegroniCorsAllowAll() negroni.Handler

func NegroniCorsNew

func NegroniCorsNew(opt cors.Options) negroni.Handler

func NegroniJwtHandler

func NegroniJwtHandler(key string, skipper Skipper, signMethod *jwt.SigningMethodHMAC, errHandler func(w http.ResponseWriter, r *http.Request, err string)) negroni.Handler

NegroniJwtHandler returns a JWT middleware as a negroni handler. errHandler will be invoked if a err occurs while check JWT. and the errHandler must write to the response or not the client will be block.

func NegroniLoggerHandler

func NegroniLoggerHandler() negroni.Handler

NegroniLoggerHandler returns a logging handler.

func NegroniRecoverHandler

func NegroniRecoverHandler() negroni.Handler

NegroniRecoverHandler returns a handler for recover from a http request.

Types

type JWTMiddleware

type JWTMiddleware struct {
	*jwtmiddleware.JWTMiddleware
	// contains filtered or unexported fields
}

JWTMiddleware is a wrapper of go-jwt-middleware, but added a skipper func on it.

type Skipper

type Skipper func(path string) bool

Jump to

Keyboard shortcuts

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