main.go
547 Bytes
package middleware
import (
"net/http"
web "git.to-net.rs/marko.tikvic/webutility"
)
func Headers(h http.HandlerFunc) http.HandlerFunc {
return web.SetHeaders(web.ParseForm(h))
}
func AuthOnly(roles string, h http.HandlerFunc) http.HandlerFunc {
return web.SetHeaders(web.ParseForm(web.Auth(roles, h)))
}
func Full(roles string, h http.HandlerFunc) http.HandlerFunc {
return web.SetHeaders(web.ParseForm(web.Log(web.Auth(roles, h))))
}
func Log(h http.HandlerFunc) http.HandlerFunc {
return web.SetHeaders(web.ParseForm(web.Log(h)))
}