13 lines
223 B
Go
13 lines
223 B
Go
|
package adapters
|
||
|
|
||
|
import "net/http"
|
||
|
|
||
|
// Adapt adds adapters to an HTTP handler.
|
||
|
func Adapt(h http.Handler, adapters ...Adapter) http.Handler {
|
||
|
for i := len(adapters) - 1; i >= 0; i-- {
|
||
|
h = adapters[i](h)
|
||
|
}
|
||
|
|
||
|
return h
|
||
|
}
|