Init and optimizations
This commit is contained in:
15
racc_middleware/racc_middleware.go
Normal file
15
racc_middleware/racc_middleware.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package racc_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
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user