Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewChain ¶
func NewChain(finalHandler http.Handler, last Middleware, chain ...Middleware) http.Handler
NewChain creates a new chain of middlewares with a final handler
Last is the last Middleware in the call stack, the rest will be called in inverse order- (The last parameter is the first to be called) Final handler is the original handler - not a middleware. it will be called last- after all the Middleware
Types ¶
type LogMiddleware ¶
LogMiddleware log all the requests in the provided log
type Middleware ¶
type Middleware interface {
// contains filtered or unexported methods
}
Middleware define the interface for middleware to implement
func NewMiddlewareChain ¶
func NewMiddlewareChain(last Middleware, secondLast Middleware, chain ...Middleware) Middleware
NewMiddlewareChain creates a new chain of middlewares without a final handler- This works in the same way as NewChain, but returns a Middleware instead of a http Handler
type SecurityHeadersMiddleware ¶
type SecurityHeadersMiddleware struct {
}
SecurityHeadersMiddleware add recomended security headers in the http response
Click to show internal directories.
Click to hide internal directories.