Documentation ¶
Index ¶
- Variables
- func BindMiddlewares(app *App, p *Plugin)
- func CustomHTTPErrorHandler(err error, c echo.Context)
- func GetConfiguration() configuration.Configer
- func GetDefaultDatabaseConnection() *gorm.DB
- func GetPathLimitFromReq()
- func GetQueryInt64FromReq(param string, c echo.Context) int64
- func GetQueryIntFromReq(param string, c echo.Context) int
- func GetSanitizer() *bluemonday.Policy
- func HealthCheckHandler(c echo.Context) error
- func InitSanitizer()
- type App
- func (r *App) Bootstrap() error
- func (r *App) Can(permission string, userRoles []string) bool
- func (r *App) GetAPIRouterGroup(name string) *echo.Group
- func (r *App) GetModel(name string) interface{}
- func (r *App) GetRouter() *echo.Echo
- func (r *App) GetRouterGroup(name string) *echo.Group
- func (r *App) GetTemplates() *template.Template
- func (r *App) InitDatabase(name, engine string, isDefault bool) error
- func (r *App) LoadTemplates() error
- func (r *App) RegisterPlugin(p Pluginer)
- func (r *App) SetAPIRouterGroup(name, path string) *echo.Group
- func (r *App) SetModel(name string, f interface{})
- func (r *App) SetResource(name string, httpController HTTPController, routerGroup *echo.Group) error
- func (r *App) SetRouterGroup(name, path string) *echo.Group
- func (r *App) SetTemplateFunction(name string, f interface{})
- func (r *App) StartHTTPServer() error
- type BaseErrorResponse
- type BaseErrorResponseMessage
- type BaseListReponse
- type BaseMetaResponse
- type ContentDates
- type CustomBinder
- type HTMLMetaTags
- type HTTPController
- type HTTPError
- type HTTPResource
- type Plugin
- type PluginManager
- type Pluginer
- type RequestContext
- func (r *RequestContext) AddBodyClass(class string)
- func (r *RequestContext) Can(permission string) bool
- func (r *RequestContext) Get(name string) interface{}
- func (r *RequestContext) GetAuthenticatedRoles() *[]string
- func (r *RequestContext) GetBodyClassText() string
- func (r *RequestContext) GetBool(name string) bool
- func (r *RequestContext) GetLimit() int
- func (r *RequestContext) GetOffset() int
- func (r *RequestContext) GetString(name string) string
- func (r *RequestContext) GetStringMap(name string) []string
- func (r *RequestContext) GetTemplateHTML(name string) template.HTML
- func (r *RequestContext) ParseQueryFromReq(c echo.Context) error
- func (r *RequestContext) RemoveBodyClass(class string)
- func (r *RequestContext) Render(wr io.Writer, name string, data interface{}) error
- func (r *RequestContext) RenderMetaTags() template.HTML
- func (r *RequestContext) RenderPagination(name string) string
- func (r *RequestContext) Set(name string, value interface{})
- func (r *RequestContext) SetAuthenticatedUser(user UserInterface)
- func (r *RequestContext) SetAuthenticatedUserAndFillRoles(user UserInterface)
- type SessionData
- type TemplateCTX
- type TemplateRenderer
- type UserInterface
- type ValidationFieldError
- type ValidationResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var SanitizerDefault *bluemonday.Policy
Functions ¶
func BindMiddlewares ¶ added in v0.0.1
BindMiddlewares - Bind middlewares in order
func CustomHTTPErrorHandler ¶ added in v0.0.1
func CustomHTTPErrorHandler(err error, c echo.Context)
func GetConfiguration ¶ added in v0.0.1
func GetConfiguration() configuration.Configer
func GetDefaultDatabaseConnection ¶ added in v0.0.1
func GetPathLimitFromReq ¶ added in v0.0.1
func GetPathLimitFromReq()
func GetQueryInt64FromReq ¶ added in v0.0.1
func GetQueryIntFromReq ¶ added in v0.0.1
func GetSanitizer ¶ added in v0.0.1
func GetSanitizer() *bluemonday.Policy
func HealthCheckHandler ¶ added in v0.0.1
func HealthCheckHandler(c echo.Context) error
func InitSanitizer ¶ added in v0.0.1
func InitSanitizer()
Types ¶
type App ¶
type App struct { InitTime time.Time Events *event.Manager Configuration configuration.Configer // Default database DB *gorm.DB // avaible databases DBs map[string]*gorm.DB Plugins map[string]Pluginer Models map[string]interface{} Resources map[string]*HTTPResource RolesString string RolesList map[string]acl.Role // contains filtered or unexported fields }
func (*App) GetAPIRouterGroup ¶ added in v0.0.1
func (*App) GetRouterGroup ¶ added in v0.0.1
func (*App) GetTemplates ¶ added in v0.0.1
func (*App) InitDatabase ¶ added in v0.0.1
func (*App) LoadTemplates ¶ added in v0.0.1
func (*App) RegisterPlugin ¶ added in v0.0.1
func (*App) SetAPIRouterGroup ¶ added in v0.0.1
func (*App) SetResource ¶ added in v0.0.6
func (r *App) SetResource(name string, httpController HTTPController, routerGroup *echo.Group) error
Set Resource CRUD. Now we only supports HTTP Resources / Ex Rest
func (*App) SetRouterGroup ¶ added in v0.0.1
func (*App) SetTemplateFunction ¶ added in v0.0.1
func (*App) StartHTTPServer ¶ added in v0.0.1
type BaseErrorResponse ¶ added in v0.0.1
type BaseErrorResponse struct {
Messages []BaseErrorResponseMessage `json:"messages"`
}
type BaseErrorResponseMessage ¶ added in v0.0.1
type BaseListReponse ¶ added in v0.0.1
type BaseListReponse struct {
Meta BaseMetaResponse `json:"meta"`
}
type BaseMetaResponse ¶ added in v0.0.1
type BaseMetaResponse struct {
Count int64 `json:"count"`
}
type ContentDates ¶ added in v0.0.1
type ContentDates interface {
}type CustomBinder ¶ added in v0.0.3
type CustomBinder struct{}
func (*CustomBinder) Bind ¶ added in v0.0.3
func (cb *CustomBinder) Bind(i interface{}, c echo.Context) (err error)
type HTMLMetaTags ¶
type HTTPController ¶ added in v0.0.6
type HTTPError ¶ added in v0.0.4
type HTTPError struct { Code int `json:"code"` Message interface{} `json:"message"` }
type HTTPResource ¶ added in v0.0.6
type HTTPResource struct { Name string Controller *HTTPController }
type Plugin ¶ added in v0.0.1
type Plugin struct {
Name string
}
func (*Plugin) BindMiddlewares ¶ added in v0.0.1
func (*Plugin) SetTemplateFuncMap ¶ added in v0.0.1
type PluginManager ¶ added in v0.0.1
type RequestContext ¶ added in v0.0.6
type RequestContext struct { PathBeforeAlias string Protocol string Domain string AppOrigin string Title string IsAuthenticated bool AuthenticatedUser UserInterface // authenticated user role name list Roles []string Session SessionData // Widgets map[string]map[string]string Layout string BodyClass []string Content template.HTML ContentData map[string]interface{} Query query_parser_to_db.QueryInterface Pager *pagination.Pager MetaTags HTMLMetaTags ResponseContentType string ENV string }
func NewRequestContext ¶ added in v0.0.6
func NewRequestContext() RequestContext
func NewRequestRequestContext ¶ added in v0.0.6
func NewRequestRequestContext(c echo.Context) RequestContext
func (*RequestContext) AddBodyClass ¶ added in v0.0.6
func (r *RequestContext) AddBodyClass(class string)
Add a body class string checking if is unique
func (*RequestContext) Can ¶ added in v0.0.6
func (r *RequestContext) Can(permission string) bool
func (*RequestContext) Get ¶ added in v0.0.6
func (r *RequestContext) Get(name string) interface{}
func (*RequestContext) GetAuthenticatedRoles ¶ added in v0.0.6
func (r *RequestContext) GetAuthenticatedRoles() *[]string
func (*RequestContext) GetBodyClassText ¶ added in v0.0.6
func (r *RequestContext) GetBodyClassText() string
Get body class as string,
func (*RequestContext) GetBool ¶ added in v0.0.6
func (r *RequestContext) GetBool(name string) bool
func (*RequestContext) GetLimit ¶ added in v0.0.6
func (r *RequestContext) GetLimit() int
func (*RequestContext) GetOffset ¶ added in v0.0.6
func (r *RequestContext) GetOffset() int
func (*RequestContext) GetString ¶ added in v0.0.6
func (r *RequestContext) GetString(name string) string
func (*RequestContext) GetStringMap ¶ added in v0.0.6
func (r *RequestContext) GetStringMap(name string) []string
func (*RequestContext) GetTemplateHTML ¶ added in v0.0.6
func (r *RequestContext) GetTemplateHTML(name string) template.HTML
func (*RequestContext) ParseQueryFromReq ¶ added in v0.0.6
func (r *RequestContext) ParseQueryFromReq(c echo.Context) error
func (*RequestContext) RemoveBodyClass ¶ added in v0.0.6
func (r *RequestContext) RemoveBodyClass(class string)
Remove a body class string checking if is unique
func (*RequestContext) Render ¶ added in v0.0.6
func (r *RequestContext) Render(wr io.Writer, name string, data interface{}) error
Render one template, alias to app.templates.ExecuteTemplate()
func (*RequestContext) RenderMetaTags ¶ added in v0.0.6
func (r *RequestContext) RenderMetaTags() template.HTML
func (*RequestContext) RenderPagination ¶ added in v0.0.6
func (r *RequestContext) RenderPagination(name string) string
func (*RequestContext) Set ¶ added in v0.0.6
func (r *RequestContext) Set(name string, value interface{})
func (*RequestContext) SetAuthenticatedUser ¶ added in v0.0.6
func (r *RequestContext) SetAuthenticatedUser(user UserInterface)
func (*RequestContext) SetAuthenticatedUserAndFillRoles ¶ added in v0.0.6
func (r *RequestContext) SetAuthenticatedUserAndFillRoles(user UserInterface)
type SessionData ¶ added in v0.0.1
type SessionData struct {
UserID string
}
type TemplateCTX ¶ added in v0.0.1
type TemplateCTX struct { EchoContext echo.Context Ctx interface{} Record interface{} Records interface{} }
type TemplateRenderer ¶ added in v0.0.1
type TemplateRenderer struct {
// contains filtered or unexported fields
}
type UserInterface ¶ added in v0.0.1
type UserInterface interface { // getters: GetID() string SetID(id string) error GetRoles() []string SetRoles(v []string) error AddRole(role string) error RemoveRole(role string) error GetEmail() string SetEmail(v string) error GetUsername() string SetUsername(v string) error GetDisplayName() string SetDisplayName(v string) error GetFullName() string SetFullName(v string) error GetLanguage() string SetLanguage(v string) error IsActive() bool SetActive(blocked bool) error IsBlocked() bool SetBlocked(blocked bool) error // FillById FillById(ID string) error }
type ValidationFieldError ¶ added in v0.0.3
type ValidationResponse ¶ added in v0.0.3
type ValidationResponse struct {
Errors []*ValidationFieldError `json:"errors"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.