Adds WrapF() and WrapH()
This commit is contained in:
8
utils.go
8
utils.go
@ -13,12 +13,18 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func Wrap(f http.HandlerFunc) HandlerFunc {
|
||||
func WrapF(f http.HandlerFunc) HandlerFunc {
|
||||
return func(c *Context) {
|
||||
f(c.Writer, c.Request)
|
||||
}
|
||||
}
|
||||
|
||||
func WrapH(h http.Handler) HandlerFunc {
|
||||
return func(c *Context) {
|
||||
h.ServeHTTP(c.Writer, c.Request)
|
||||
}
|
||||
}
|
||||
|
||||
type H map[string]interface{}
|
||||
|
||||
// Allows type H to be used with xml.Marshal
|
||||
|
Reference in New Issue
Block a user