Go HTTP middleware I like to use.
Checkout the examples directory for usage examples.
As this package only depends on net/http
package APIs, it can be used in any framework or libraries that uses types exposed by net/http
package, e.g., github.com/julienschmidt/httprouter
.
This package exposes middleware functions chain builders for up to 27 functions, i.e., Chain1
up to Chain27
. Although I think this is way more than enough for most of applications, I plan to improve the generator so you can generate your middle.ChainN
up to any number of N
you need by using it. See generator for more.
See gen
command line flags, and ./gen.go
for an example of usage.