mirror of
https://gitlab.durp.info/durfy/modules/durpify.git
synced 2026-05-07 16:10:28 -05:00
update
This commit is contained in:
parent
35fa88b45b
commit
9f6d8ac621
13 changed files with 3 additions and 4 deletions
16
middleware/main.go
Normal file
16
middleware/main.go
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
package middleware
|
||||
|
||||
import "net/http"
|
||||
|
||||
type Middleware func(http.Handler) http.Handler
|
||||
|
||||
func CreateStack(xs ...Middleware) Middleware {
|
||||
return func(next http.Handler) http.Handler {
|
||||
for i := len(xs) - 1; i >= 0; i-- {
|
||||
x := xs[i]
|
||||
next = x(next)
|
||||
}
|
||||
|
||||
return next
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue