Documentation ¶
Overview ¶
Package router provides a simple wrapper around the echo framework to create a REST API.
Index ¶
- type Controller
- type Router
- func (router *Router) DELETE(urlPath string, handle echo.HandlerFunc)
- func (router *Router) GET(urlPath string, handle echo.HandlerFunc)
- func (router *Router) Group(urlPath string) *Router
- func (router *Router) HEAD(urlPath string, handle echo.HandlerFunc)
- func (router *Router) OPTIONS(urlPath string, handle echo.HandlerFunc)
- func (router *Router) PATCH(urlPath string, handle echo.HandlerFunc)
- func (router *Router) POST(urlPath string, handle echo.HandlerFunc)
- func (router *Router) PUT(urlPath string, handle echo.HandlerFunc)
- func (router *Router) Register(controllers ...Controller)
- func (router *Router) URL() *url.URL
- func (router *Router) Use(middlewares ...echo.MiddlewareFunc)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller interface { // Register is the method called by the router, passing the router // groups to let the controller register its methods Register(router *Router) // URL returns the controller fqdn. URL() *url.URL }
Controller is an interface implemented by a REST controller
type Router ¶
type Router struct { *echo.Echo // contains filtered or unexported fields }
func (*Router) DELETE ¶
DELETE registers a new DELETE route for a path with matching handler in the router with optional route-level middleware.
func (*Router) GET ¶
GET registers a new GET route for a path with matching handler in the router with optional route-level middleware.
func (*Router) HEAD ¶
HEAD registers a new HEAD route for a path with matching handler in the router with optional route-level middleware.
func (*Router) OPTIONS ¶
OPTIONS registers a new OPTIONS route for a path with matching handler in the router with optional route-level middleware.
func (*Router) PATCH ¶
PATCH registers a new PATCH route for a path with matching handler in the router with optional route-level middleware.
func (*Router) POST ¶
POST registers a new POST route for a path with matching handler in the router with optional route-level middleware.
func (*Router) PUT ¶
PUT registers a new PUT route for a path with matching handler in the router with optional route-level middleware.
func (*Router) Register ¶
func (router *Router) Register(controllers ...Controller)
Register registers controller's endpoints