summaryrefslogblamecommitdiff
path: root/middleware/use.go
blob: 6610e2f86f5127bd2f8c31624db14fe0ab3f133c (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                                                        
package middleware

import "net/http"

type Middleware func(http.Handler) http.Handler

func Use(handler http.Handler, middlewares ...Middleware) http.Handler {
	for _, h := range middlewares {
		handler = h(handler)
	}

	return handler
}