A simple middleware collection to work with http.Handler implementations, and maybe go-kit.
Inspired by go-kit's middleware chaining.
Like other similar efforts that inspired by go1.7 release and the changes in net/http and context, this is a collection of opiniated middlewares that fulfill this signature:
type Middleware func(http.Handler) http.Handler
Along with some utils to chain middleware and to rewrite functions, this collection of middleware passes variables into http.Request.Context, or rewrites request for inner http.Handler implmentations, or both.
The current collection includes:
- gormcontext: put *gorm.DB into context.