Merge pull request #1574 from weaveworks/middleware-identity

Add Indentity middleware
This commit is contained in:
Alfonso Acosta
2016-06-09 15:53:25 +01:00

View File

@@ -18,6 +18,9 @@ func (m Func) Wrap(next http.Handler) http.Handler {
return m(next)
}
// Identity is an Interface which doesn't do anything.
var Identity Interface = Func(func(h http.Handler) http.Handler { return h })
// Merge produces a middleware that applies multiple middlesware in turn;
// ie Merge(f,g,h).Wrap(handler) == f.Wrap(g.Wrap(h.Wrap(handler)))
func Merge(middlesware ...Interface) Interface {