Documentation ¶
Index ¶
- func NewLogger() *log.Logger
- type Context
- func (ctx *Context) ActiveTransaction() *dbx.Trx
- func (ctx *Context) AddRenderVar(name string, value interface{})
- func (ctx *Context) AuthEndpoint() string
- func (ctx *Context) BadRequest(dict echo.Map) error
- func (ctx *Context) BaseURL() string
- func (ctx *Context) Failure(err error) error
- func (ctx *Context) IsAjax() bool
- func (ctx *Context) IsAuthenticated() bool
- func (ctx *Context) NotFound() error
- func (ctx *Context) Ok(dict echo.Map) error
- func (ctx *Context) Page(dict echo.Map) error
- func (ctx *Context) ParamAsInt(name string) (int, error)
- func (ctx *Context) RenderVars() echo.Map
- func (ctx *Context) Services() *app.Services
- func (ctx *Context) SetActiveTransaction(trx *dbx.Trx)
- func (ctx *Context) SetServices(services *app.Services)
- func (ctx *Context) SetTenant(tenant *models.Tenant)
- func (ctx *Context) SetUser(user *models.User)
- func (ctx *Context) Tenant() *models.Tenant
- func (ctx *Context) User() *models.User
- type Engine
- type Group
- type HTMLRenderer
- type HandlerFunc
- type MiddlewareFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
Context wraps echo.context to provide userful information
func (*Context) ActiveTransaction ¶
ActiveTransaction returns current active Database transaction
func (*Context) AddRenderVar ¶
AddRenderVar register given key/value to RenderVar map
func (*Context) BadRequest ¶
BadRequest returns 400 BadRequest with JSON result
func (*Context) IsAuthenticated ¶
IsAuthenticated returns true if user is authenticated
func (*Context) ParamAsInt ¶
ParamAsInt returns parameter as int
func (*Context) RenderVars ¶
RenderVars returns all registered RenderVar
func (*Context) SetActiveTransaction ¶
SetActiveTransaction adds transaction to context
func (*Context) SetServices ¶
SetServices update current context with app.Services
type Engine ¶
Engine is our web engine wrapper
func (*Engine) HandleError ¶
HandleError redirect error to router
func (*Engine) NewContext ¶
NewContext creates and return a new context
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group is our router group wrapper
func (*Group) Get ¶
func (g *Group) Get(path string, handler HandlerFunc)
Get handles HTTP GET requests
func (*Group) Post ¶
func (g *Group) Post(path string, handler HandlerFunc)
Post handles HTTP POST requests
func (*Group) Use ¶
func (g *Group) Use(middleware MiddlewareFunc)
Use add middleware to sub-routes within the Group
type HTMLRenderer ¶
type HTMLRenderer struct {
// contains filtered or unexported fields
}
HTMLRenderer renderer
func NewHTMLRenderer ¶
func NewHTMLRenderer(settings *models.AppSettings, logger echo.Logger) *HTMLRenderer
NewHTMLRenderer creates a new HTMLRenderer
type MiddlewareFunc ¶
type MiddlewareFunc func(HandlerFunc) HandlerFunc
MiddlewareFunc represents an HTTP middleware