Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Auth ¶
type Auth struct {
Resolver *jwtresolver.JWTResolver
}
Auth is a stateful middleware that checks if user is authorized. If user is authorized, it adds user ID to the requests context. Otherwise, it returns an error.
type Middleware ¶
Middleware is a function that takes an http.Handler and returns an http.Handler.
func MakeChain ¶
func MakeChain(mws ...Middleware) Middleware
MakeChain wraps a list of middlewares in a chain. Chain works like FIFO stack of middlewares.
Click to show internal directories.
Click to hide internal directories.