main.go
626 Bytes
package middleware
import (
"net/http"
)
func Headers(h http.HandlerFunc) http.HandlerFunc {
return SetAccessControlHeaders(IgnoreOptionsRequests(ParseForm(h)))
}
func AuthUser(roles string, h http.HandlerFunc) http.HandlerFunc {
return SetAccessControlHeaders(IgnoreOptionsRequests(ParseForm(Auth(roles, h))))
}
func AuthUserLogTraffic(roles string, h http.HandlerFunc) http.HandlerFunc {
return SetAccessControlHeaders(IgnoreOptionsRequests(ParseForm(LogHTTP(Auth(roles, h)))))
}
func LogTraffic(h http.HandlerFunc) http.HandlerFunc {
return SetAccessControlHeaders(IgnoreOptionsRequests(ParseForm(LogHTTP(h))))
}