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()
- func SendManyJSONApi(c echo.Context, count int64, pointerArr interface{}) error
- func SendOneJSONApi(c echo.Context, record interface{}) error
- 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) SetRouterGroup(name, path string) *echo.Group
- func (r *App) SetTemplateFunction(name string, f interface{})
- func (r *App) StartHTTPServer() error
- type AppContext
- func (r *AppContext) AddBodyClass(class string)
- func (r *AppContext) Can(permission string) bool
- func (r *AppContext) Get(name string) interface{}
- func (r *AppContext) GetAuthenticatedRoles() *[]string
- func (r *AppContext) GetBodyClassText() string
- func (r *AppContext) GetBool(name string) bool
- func (r *AppContext) GetLimit() int
- func (r *AppContext) GetOffset() int
- func (r *AppContext) GetString(name string) string
- func (r *AppContext) GetStringMap(name string) []string
- func (r *AppContext) GetTemplateHTML(name string) template.HTML
- func (r *AppContext) ParseQueryFromReq(c echo.Context) error
- func (r *AppContext) RemoveBodyClass(class string)
- func (r *AppContext) Render(wr io.Writer, name string, data interface{}) error
- func (r *AppContext) RenderMetaTags() template.HTML
- func (r *AppContext) RenderPagination(name string) string
- func (r *AppContext) Set(name string, value interface{})
- func (r *AppContext) SetAuthenticatedUser(user UserInterface)
- func (r *AppContext) SetAuthenticatedUserAndFillRoles(user UserInterface)
- type BaseErrorResponse
- type BaseErrorResponseMessage
- type BaseListReponse
- type BaseMetaResponse
- type ContentDates
- type HTMLMetaTags
- type Plugin
- type PluginManager
- type Pluginer
- type Query
- type QueryAttr
- type SessionData
- type TemplateCTX
- type TemplateRenderer
- type UserInterface
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()
func SendManyJSONApi ¶ added in v0.0.1
func SendOneJSONApi ¶ added in v0.0.1
func SendOneJSONApi(c echo.Context, record interface{}) error
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{} 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) SetRouterGroup ¶ added in v0.0.1
func (*App) SetTemplateFunction ¶ added in v0.0.1
func (*App) StartHTTPServer ¶ added in v0.0.1
type AppContext ¶ added in v0.0.1
type AppContext struct { PathBeforeAlias string Protocol string Hostname 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 Pager *pagination.Pager MetaTags HTMLMetaTags ResponseContentType string ENV string }
func NewAppContext ¶ added in v0.0.1
func NewAppContext() AppContext
func NewRequestAppContext ¶ added in v0.0.1
func NewRequestAppContext(c echo.Context) AppContext
func (*AppContext) AddBodyClass ¶ added in v0.0.1
func (r *AppContext) AddBodyClass(class string)
Add a body class string checking if is unique
func (*AppContext) Can ¶ added in v0.0.1
func (r *AppContext) Can(permission string) bool
func (*AppContext) Get ¶ added in v0.0.1
func (r *AppContext) Get(name string) interface{}
func (*AppContext) GetAuthenticatedRoles ¶ added in v0.0.1
func (r *AppContext) GetAuthenticatedRoles() *[]string
func (*AppContext) GetBodyClassText ¶ added in v0.0.1
func (r *AppContext) GetBodyClassText() string
Get body class as string,
func (*AppContext) GetBool ¶ added in v0.0.1
func (r *AppContext) GetBool(name string) bool
func (*AppContext) GetLimit ¶ added in v0.0.1
func (r *AppContext) GetLimit() int
func (*AppContext) GetOffset ¶ added in v0.0.1
func (r *AppContext) GetOffset() int
func (*AppContext) GetString ¶ added in v0.0.1
func (r *AppContext) GetString(name string) string
func (*AppContext) GetStringMap ¶ added in v0.0.1
func (r *AppContext) GetStringMap(name string) []string
func (*AppContext) GetTemplateHTML ¶ added in v0.0.1
func (r *AppContext) GetTemplateHTML(name string) template.HTML
func (*AppContext) ParseQueryFromReq ¶ added in v0.0.1
func (r *AppContext) ParseQueryFromReq(c echo.Context) error
func (*AppContext) RemoveBodyClass ¶ added in v0.0.1
func (r *AppContext) RemoveBodyClass(class string)
Remove a body class string checking if is unique
func (*AppContext) Render ¶ added in v0.0.1
func (r *AppContext) Render(wr io.Writer, name string, data interface{}) error
Render one template, alias to app.templates.ExecuteTemplate()
func (*AppContext) RenderMetaTags ¶ added in v0.0.1
func (r *AppContext) RenderMetaTags() template.HTML
func (*AppContext) RenderPagination ¶ added in v0.0.1
func (r *AppContext) RenderPagination(name string) string
func (*AppContext) Set ¶ added in v0.0.1
func (r *AppContext) Set(name string, value interface{})
func (*AppContext) SetAuthenticatedUser ¶ added in v0.0.1
func (r *AppContext) SetAuthenticatedUser(user UserInterface)
func (*AppContext) SetAuthenticatedUserAndFillRoles ¶ added in v0.0.1
func (r *AppContext) SetAuthenticatedUserAndFillRoles(user UserInterface)
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 HTMLMetaTags ¶
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 Query ¶
func (*Query) AddQueryParamFromRaw ¶
func (*Query) AddQueryString ¶
func (*Query) GetParamValue ¶
func (*Query) GetQueryString ¶
type SessionData ¶ added in v0.0.1
type SessionData struct {
UserID int64
}
type TemplateCTX ¶ added in v0.0.1
type TemplateCTX struct { 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 {
GetRoles() []string
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.