Blame view
middleware/main.go
547 Bytes
776b4c95b refactored middle... |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
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))) } |