Documentation ¶
Index ¶
- func URLJoin(paths ...string) (res string)
- func Var(r *http.Request, name string) string
- type RouteClosure
- type Wok
- func (wok *Wok) DELETE(path string, mws ...noodle.Middleware) RouteClosure
- func (wok *Wok) GET(path string, mws ...noodle.Middleware) RouteClosure
- func (wok *Wok) Group(prefix string, mws ...noodle.Middleware) *Wok
- func (wok *Wok) Handle(method, path string, mws ...noodle.Middleware) RouteClosure
- func (wok *Wok) OPTIONS(path string, mws ...noodle.Middleware) RouteClosure
- func (wok *Wok) PATCH(path string, mws ...noodle.Middleware) RouteClosure
- func (wok *Wok) POST(path string, mws ...noodle.Middleware) RouteClosure
- func (wok *Wok) PUT(path string, mws ...noodle.Middleware) RouteClosure
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RouteClosure ¶
type RouteClosure func(http.HandlerFunc)
RouteClosure is a convenience type that allows setting route handlers by calling the function
func (RouteClosure) Handle ¶
func (rc RouteClosure) Handle(h http.Handler)
Handle allows route closure to attach a http.Handler
type Wok ¶
type Wok struct { *httprouter.Router // contains filtered or unexported fields }
Wok is a simple wrapper for httprouter with route groups and native support for http.HandlerFunc
func Default ¶
func Default(mws ...noodle.Middleware) *Wok
Default creates new Wok with the default Noodle middleware chain
func New ¶
func New(mws ...noodle.Middleware) *Wok
New creates new Wok initialized with middlewares. The resulting middleware chain will be called for all routes in Wok
func (*Wok) DELETE ¶
func (wok *Wok) DELETE(path string, mws ...noodle.Middleware) RouteClosure
DELETE is a convenience wrapper over Wok.Handle
func (*Wok) GET ¶
func (wok *Wok) GET(path string, mws ...noodle.Middleware) RouteClosure
GET is a convenience wrapper over Wok.Handle
func (*Wok) Group ¶
Group starts new route group with common prefix. Middleware passed to Group will be used for all routes in it.
func (*Wok) Handle ¶
func (wok *Wok) Handle(method, path string, mws ...noodle.Middleware) RouteClosure
Handle allows to attach some noodle Middlewares and a Handle to a route
func (*Wok) OPTIONS ¶
func (wok *Wok) OPTIONS(path string, mws ...noodle.Middleware) RouteClosure
OPTIONS is a convenience wrapper over Wok.Handle
func (*Wok) PATCH ¶
func (wok *Wok) PATCH(path string, mws ...noodle.Middleware) RouteClosure
PATCH is a convenience wrapper over Wok.Handle
func (*Wok) POST ¶
func (wok *Wok) POST(path string, mws ...noodle.Middleware) RouteClosure
POST is a convenience wrapper over Wok.Handle
func (*Wok) PUT ¶
func (wok *Wok) PUT(path string, mws ...noodle.Middleware) RouteClosure
PUT is a convenience wrapper over Wok.Handle