Documentation ¶
Overview ¶
Package middlewares implments a collection of useful and commonly used middlewares for http servers that are based on go's standard net/http library
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JWT ¶
func JWT(secret string) func(next http.HandlerFunc) http.HandlerFunc
JWT - uses the popular dgrijalva/jwt-go to handle request authentication via jwt using the HMAC signing method. in its argument, you must pass in the secret used when signing the returned value is your middleware
func Log ¶
func Log(next http.HandlerFunc) http.HandlerFunc
Log - uses logrus library to handles logging of common request fields
Types ¶
type ContextKey ¶
type ContextKey string
ContextKey implements type for context key
const ContextJWTKey ContextKey = "jwt"
ContextJWTKey is the key for the jwt context value
Click to show internal directories.
Click to hide internal directories.