Copyright 2019 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Package middleware implements a simple middleware pattern for http handlers, along with implementations for some common middlewares.
package middleware

import 
A Middleware is a func that wraps an http.Handler.
Chain creates a new Middleware that applies a sequence of Middlewares, so that they execute in the given order when handling an http request. In other words, Chain(m1, m2)(handler) = m1(m2(handler)) A similar pattern is used in e.g. github.com/justinas/alice: https://github.com/justinas/alice/blob/ce87934/chain.go#L45
func ( ...Middleware) Middleware {
	return func( http.Handler) http.Handler {
		for  := range  {
			 = [len()-1-]()
		}
		return 
	}
}
Identity is a middleware that does nothing. It can be used as a helper when building middleware chains.
func () Middleware {
	return func( http.Handler) http.Handler {
		return 
	}