Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct { // Container provides route handlers with access to all services. Container *services.Container }
Controller stores the Container, providing the route handlers with access to all necessary dependencies.
func NewController ¶
func NewController(c *services.Container) Controller
NewController creates a new Controller.
func (*Controller) Redirect ¶
func (c *Controller) Redirect(ctx echo.Context, route string, routeParams ...interface{}) error
func (*Controller) RenderErrorResponse ¶
func (c *Controller) RenderErrorResponse(ctx echo.Context, status int, err error, msg string) error
func (*Controller) RenderJSONResponse ¶
func (c *Controller) RenderJSONResponse(ctx echo.Context, resp JSONResponse) error
type JSONResponse ¶
type JSONResponse struct { StatusCode int Headers map[string]string RequestID string Path string URL string Context echo.Context ToURL func(name string, params ...interface{}) string Body interface{} }
JSONResponse defines the information required to construct a JSON HTTP response.
func NewJSONResponse ¶
func NewJSONResponse(ctx echo.Context) JSONResponse
NewJSONResponse creates a new instance of a JSONResponse struct given an echo context.
Click to show internal directories.
Click to hide internal directories.