Moved to go 1.22 net/http

This commit is contained in:
2024-04-02 20:34:59 -05:00
parent 97b4c60096
commit 7c1a319b55
13 changed files with 239 additions and 446 deletions

16
middleware/middleware.go Normal file
View 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
}
}