Skip to content

Latest commit

 

History

History
9 lines (7 loc) · 1.08 KB

README.md

File metadata and controls

9 lines (7 loc) · 1.08 KB

Go Middleware Example

A collection of basic HTTP middleware implementation examples in Go

  1. loopchain: An extremely simple middleware implementation using a for loop
  2. recursivechain: Middleware implementation using recursion that allows for a short-circuiting the middleware chain
  3. finalhandler: Variant on the recursive implementation, but using a final logic handler in the chain as the first chain parameter
  4. customstate: Middleware implementation using recursion with a custom http.ResponseWriter implementation to manage custom state along the request chain
  5. apiexample: A slightly more organized example JSON API using previous middleware techniques