Documentation
¶
Overview ¶
Pakage router implements simple http routing using net/http.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Root ¶
type Root struct {
// contains filtered or unexported fields
}
func NewRootRouter ¶
func NewRootRouter() *Root
func (*Root) Group ¶
func (router *Root) Group(prefix string) *RouteGroup
Group adds a new RouteGroup to the router.
func (*Root) Use ¶
func (router *Root) Use(middleware Middleware)
Use adds a middleware that is used for all routes in the router. Middlewares are applied in the same order `Use` is called.
type RouteGroup ¶
type RouteGroup struct {
// contains filtered or unexported fields
}
RouteGroup groups related routes under a common prefix and use the same middlewares.
func (*RouteGroup) RouteFunc ¶
func (group *RouteGroup) RouteFunc(route string, f func(http.ResponseWriter, *http.Request))
RouteFunc adds a route that is handled by a function to the group.
func (*RouteGroup) Use ¶
func (group *RouteGroup) Use(middleware Middleware)
Use adds a middleware that is used for all routes in the router. Middlewares are applied in the same order `Use` is called.
Click to show internal directories.
Click to hide internal directories.