Documentation ¶
Index ¶
- Variables
- func BindMiddlewares(app App, p *Plugin)
- func CustomHTTPErrorHandler(err error, c echo.Context)
- func GetConfiguration() configuration.ConfigurationInterface
- func GetDefaultDatabaseConnection() *gorm.DB
- 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
- type AppOptions
- type AppStruct
- func (r *AppStruct) Bootstrap() error
- func (r *AppStruct) Can(permission string, userRoles []string) bool
- func (r *AppStruct) Close() error
- func (r *AppStruct) GetConfiguration() configuration.ConfigurationInterface
- func (r *AppStruct) GetDB() *gorm.DB
- func (r *AppStruct) GetEvents() *event.Manager
- func (r *AppStruct) GetLayout() string
- func (r *AppStruct) GetModel(name string) interface{}
- func (r *AppStruct) GetPlugin(name string) Pluginer
- func (r *AppStruct) GetPlugins() map[string]Pluginer
- func (r *AppStruct) GetRouter() *echo.Echo
- func (r *AppStruct) GetRouterGroup(name string) *echo.Group
- func (r *AppStruct) GetTemplates() *template.Template
- func (r *AppStruct) GetTheme() string
- func (r *AppStruct) InitDatabase(name, engine string, isDefault bool) error
- func (r *AppStruct) LoadTemplates() error
- func (r *AppStruct) Migrate() error
- func (app *AppStruct) NewRequestContext(opts *RequestContextOpts) *RequestContext
- func (r *AppStruct) RegisterPlugin(p Pluginer)
- func (app *AppStruct) RenderTemplate(wr io.Writer, name string, data interface{}) error
- func (r *AppStruct) SetDB(db *gorm.DB) error
- func (r *AppStruct) SetLayout(layout string) error
- func (r *AppStruct) SetModel(name string, f interface{})
- func (r *AppStruct) SetPlugin(name string, plugin Pluginer) error
- func (r *AppStruct) SetResource(name string, httpController HTTPController, routerGroup *echo.Group) error
- func (r *AppStruct) SetRouterGroup(name, path string) *echo.Group
- func (r *AppStruct) SetTemplateFunction(name string, f interface{})
- func (r *AppStruct) SetTheme(theme string) error
- func (r *AppStruct) StartHTTPServer() error
- type BaseErrorResponse
- type BaseErrorResponseMessage
- type BaseListReponse
- type BaseMetaResponse
- type ContentDates
- type CustomBinder
- type HTMLMetaTags
- type HTTPController
- type HTTPError
- func (e *HTTPError) Error() string
- func (e *HTTPError) GetCode() int
- func (e *HTTPError) GetInternal() error
- func (e *HTTPError) GetMessage() interface{}
- func (e *HTTPError) SetCode(code int) error
- func (e *HTTPError) SetInternal(internal error) error
- func (e *HTTPError) SetMessage(message interface{}) error
- type HTTPErrorInterface
- type HTTPResource
- type Plugin
- type PluginManager
- type Pluginer
- type RequestContext
- func (r *RequestContext) AddBodyClass(class string)
- func (c *RequestContext) Attachment(file string, name string) error
- func (c *RequestContext) Bind(i interface{}) error
- func (c *RequestContext) Blob(code int, contentType string, b []byte) error
- func (r *RequestContext) Can(permission string) bool
- func (c *RequestContext) Cookie(name string) (*http.Cookie, error)
- func (c *RequestContext) Cookies() []*http.Cookie
- func (c *RequestContext) Echo() *echo.Echo
- func (c *RequestContext) Error(err error)
- func (c *RequestContext) File(file string) error
- func (c *RequestContext) FormFile(name string) (*multipart.FileHeader, error)
- func (c *RequestContext) FormParams() (url.Values, error)
- func (c *RequestContext) FormValue(name string) string
- 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) GetResponseContentType() string
- func (r *RequestContext) GetString(name string) string
- func (r *RequestContext) GetStringMap(name string) []string
- func (r *RequestContext) GetTemplateHTML(name string) template.HTML
- func (c *RequestContext) HTML(code int, html string) error
- func (c *RequestContext) HTMLBlob(code int, b []byte) error
- func (c *RequestContext) Handler() echo.HandlerFunc
- func (c *RequestContext) Inline(file string, name string) error
- func (c *RequestContext) IsTLS() bool
- func (c *RequestContext) IsWebSocket() bool
- func (c *RequestContext) JSON(code int, i interface{}) error
- func (c *RequestContext) JSONBlob(code int, b []byte) error
- func (c *RequestContext) JSONP(code int, callback string, i interface{}) error
- func (c *RequestContext) JSONPBlob(code int, callback string, b []byte) error
- func (c *RequestContext) JSONPretty(code int, i interface{}, indent string) error
- func (c *RequestContext) Logger() echo.Logger
- func (c *RequestContext) MultipartForm() (*multipart.Form, error)
- func (c *RequestContext) NoContent(code int) error
- func (c *RequestContext) Param(name string) string
- func (c *RequestContext) ParamNames() []string
- func (c *RequestContext) ParamValues() []string
- func (r *RequestContext) ParseQueryFromReq(c echo.Context) error
- func (r *RequestContext) Partial(name string, data interface{}) template.HTML
- func (c *RequestContext) Path() string
- func (c *RequestContext) QueryParam(name string) string
- func (c *RequestContext) QueryParams() url.Values
- func (c *RequestContext) QueryString() string
- func (c *RequestContext) RealIP() string
- func (c *RequestContext) Redirect(code int, url string) error
- func (r *RequestContext) RemoveBodyClass(class string)
- func (c *RequestContext) Render(code int, name string, data interface{}) error
- func (r *RequestContext) RenderMetaTags() template.HTML
- func (r *RequestContext) RenderPagination(name string) string
- func (r *RequestContext) RenderTemplate(wr io.Writer, name string, data interface{}) error
- func (c *RequestContext) Request() *http.Request
- func (c *RequestContext) Reset(r *http.Request, w http.ResponseWriter)
- func (c *RequestContext) Response() *echo.Response
- func (c *RequestContext) Scheme() string
- func (r *RequestContext) Set(name string, value interface{})
- func (r *RequestContext) SetAuthenticatedUser(user UserInterface)
- func (r *RequestContext) SetAuthenticatedUserAndFillRoles(user UserInterface)
- func (c *RequestContext) SetCookie(cookie *http.Cookie)
- func (c *RequestContext) SetHandler(h echo.HandlerFunc)
- func (c *RequestContext) SetLogger(l echo.Logger)
- func (c *RequestContext) SetParamNames(names ...string)
- func (c *RequestContext) SetParamValues(values ...string)
- func (c *RequestContext) SetPath(p string)
- func (c *RequestContext) SetRequest(r *http.Request)
- func (c *RequestContext) SetResponse(r *echo.Response)
- func (r *RequestContext) SetResponseContentType(v string) error
- func (c *RequestContext) Stream(code int, contentType string, r io.Reader) error
- func (c *RequestContext) String(code int, s string) error
- func (c *RequestContext) Validate(i interface{}) error
- func (c *RequestContext) XML(code int, i interface{}) error
- func (c *RequestContext) XMLBlob(code int, b []byte) error
- func (c *RequestContext) XMLPretty(code int, i interface{}, indent string) error
- type RequestContextOpts
- type SessionData
- type TemplateCTX
- type TemplateRenderer
- type UserInterface
- type ValidationFieldError
- type ValidationResponse
Constants ¶
This section is empty.
Variables ¶
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.ConfigurationInterface
func GetDefaultDatabaseConnection ¶ added in v0.0.1
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 interface { RegisterPlugin(p Pluginer) GetPlugins() map[string]Pluginer GetPlugin(name string) Pluginer SetPlugin(name string, plugin Pluginer) error GetRouter() *echo.Echo SetRouterGroup(name, path string) *echo.Group GetRouterGroup(name string) *echo.Group SetResource(name string, httpController HTTPController, routerGroup *echo.Group) error StartHTTPServer() error NewRequestContext(opts *RequestContextOpts) *RequestContext // Get default app theme GetTheme() string // Set default app theme SetTheme(theme string) error // Get default app layout GetLayout() string // Set default app layout SetLayout(layout string) error GetTemplates() *template.Template LoadTemplates() error SetTemplateFunction(name string, f interface{}) RenderTemplate(wr io.Writer, name string, data interface{}) error InitDatabase(name, engine string, isDefault bool) error SetModel(name string, f interface{}) GetModel(name string) interface{} Can(permission string, userRoles []string) bool GetEvents() *event.Manager GetConfiguration() configuration.ConfigurationInterface GetDB() *gorm.DB SetDB(db *gorm.DB) error Migrate() error Bootstrap() error Close() error }
func Init ¶
func Init(options *AppOptions) App
type AppOptions ¶ added in v0.3.0
type AppStruct ¶ added in v0.0.11
type AppStruct struct { InitTime time.Time Options *AppOptions Events *event.Manager Configuration configuration.ConfigurationInterface // 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 // default theme for HTML responses Theme string // default layout for HTML responses Layout string // contains filtered or unexported fields }
func (*AppStruct) Close ¶ added in v0.0.15
Method for close and end all app operations, use that before close the app execution
func (*AppStruct) GetConfiguration ¶ added in v0.0.11
func (r *AppStruct) GetConfiguration() configuration.ConfigurationInterface
func (*AppStruct) GetPlugins ¶ added in v0.0.11
func (*AppStruct) GetRouterGroup ¶ added in v0.0.11
func (*AppStruct) GetTemplates ¶ added in v0.0.11
func (*AppStruct) InitDatabase ¶ added in v0.0.11
func (*AppStruct) LoadTemplates ¶ added in v0.0.11
func (*AppStruct) NewRequestContext ¶ added in v0.0.13
func (app *AppStruct) NewRequestContext(opts *RequestContextOpts) *RequestContext
func (*AppStruct) RegisterPlugin ¶ added in v0.0.11
func (*AppStruct) RenderTemplate ¶ added in v0.0.16
RenderTemplate - Render template with default app theme
func (*AppStruct) SetResource ¶ added in v0.0.11
func (r *AppStruct) SetResource(name string, httpController HTTPController, routerGroup *echo.Group) error
Set Resource CRUD. Now we only supports HTTP Resources / Ex Rest
func (*AppStruct) SetRouterGroup ¶ added in v0.0.11
func (*AppStruct) SetTemplateFunction ¶ added in v0.0.11
func (*AppStruct) StartHTTPServer ¶ added in v0.0.11
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"` Internal error `json:"-"` // Stores the error returned by an external dependency }
HTTPError implements HTTP Error interface, default error object
func (*HTTPError) GetInternal ¶ added in v0.2.0
func (*HTTPError) GetMessage ¶ added in v0.2.0
func (e *HTTPError) GetMessage() interface{}
func (*HTTPError) SetInternal ¶ added in v0.2.0
func (*HTTPError) SetMessage ¶ added in v0.2.0
type HTTPErrorInterface ¶ added in v0.2.0
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 { EchoContext echo.Context App App 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 Theme string Layout string BodyClass []string Content template.HTML Query query_parser_to_db.QueryInterface Pager *pagination.Pager MetaTags HTMLMetaTags ENV string }
func NewRequestContext ¶ added in v0.0.6
func NewRequestContext(opts *RequestContextOpts) *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) Attachment ¶ added in v0.0.11
func (c *RequestContext) Attachment(file string, name string) error
Attachment sends a response as attachment, prompting client to save the file.
func (*RequestContext) Bind ¶ added in v0.0.11
func (c *RequestContext) Bind(i interface{}) error
Bind binds the request body into provided type `i`. The default binder does it based on Content-Type header.
func (*RequestContext) Blob ¶ added in v0.0.11
func (c *RequestContext) Blob(code int, contentType string, b []byte) error
Blob sends a blob response with status code and content type.
func (*RequestContext) Can ¶ added in v0.0.6
func (r *RequestContext) Can(permission string) bool
func (*RequestContext) Cookie ¶ added in v0.0.11
func (c *RequestContext) Cookie(name string) (*http.Cookie, error)
Cookie returns the named cookie provided in the request.
func (*RequestContext) Cookies ¶ added in v0.0.11
func (c *RequestContext) Cookies() []*http.Cookie
Cookies returns the HTTP cookies sent with the request.
func (*RequestContext) Echo ¶ added in v0.0.11
func (c *RequestContext) Echo() *echo.Echo
Echo returns the `Echo` instance.
func (*RequestContext) Error ¶ added in v0.0.11
func (c *RequestContext) Error(err error)
Error invokes the registered HTTP error handler. Generally used by middleware.
func (*RequestContext) File ¶ added in v0.0.11
func (c *RequestContext) File(file string) error
File sends a response with the content of the file.
func (*RequestContext) FormFile ¶ added in v0.0.11
func (c *RequestContext) FormFile(name string) (*multipart.FileHeader, error)
FormFile returns the multipart form file for the provided name.
func (*RequestContext) FormParams ¶ added in v0.0.11
func (c *RequestContext) FormParams() (url.Values, error)
FormParams returns the form parameters as `url.Values`.
func (*RequestContext) FormValue ¶ added in v0.0.11
func (c *RequestContext) FormValue(name string) string
FormValue returns the form field value for the provided name.
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
Get value from echo context data in boolean format
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) GetResponseContentType ¶ added in v0.0.11
func (r *RequestContext) GetResponseContentType() string
Get selected response type
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
Get data in string map format ([]string) from echo context data
func (*RequestContext) GetTemplateHTML ¶ added in v0.0.6
func (r *RequestContext) GetTemplateHTML(name string) template.HTML
func (*RequestContext) HTML ¶ added in v0.0.11
func (c *RequestContext) HTML(code int, html string) error
HTML sends an HTTP response with status code.
func (*RequestContext) HTMLBlob ¶ added in v0.0.11
func (c *RequestContext) HTMLBlob(code int, b []byte) error
HTMLBlob sends an HTTP blob response with status code.
func (*RequestContext) Handler ¶ added in v0.0.11
func (c *RequestContext) Handler() echo.HandlerFunc
Handler returns the matched handler by router.
func (*RequestContext) Inline ¶ added in v0.0.11
func (c *RequestContext) Inline(file string, name string) error
Inline sends a response as inline, opening the file in the browser.
func (*RequestContext) IsTLS ¶ added in v0.0.11
func (c *RequestContext) IsTLS() bool
IsTLS returns true if HTTP connection is TLS otherwise false.
func (*RequestContext) IsWebSocket ¶ added in v0.0.11
func (c *RequestContext) IsWebSocket() bool
IsWebSocket returns true if HTTP connection is WebSocket otherwise false.
func (*RequestContext) JSON ¶ added in v0.0.11
func (c *RequestContext) JSON(code int, i interface{}) error
JSON sends a JSON response with status code.
func (*RequestContext) JSONBlob ¶ added in v0.0.11
func (c *RequestContext) JSONBlob(code int, b []byte) error
JSONBlob sends a JSON blob response with status code.
func (*RequestContext) JSONP ¶ added in v0.0.11
func (c *RequestContext) JSONP(code int, callback string, i interface{}) error
JSONP sends a JSONP response with status code. It uses `callback` to construct the JSONP payload.
func (*RequestContext) JSONPBlob ¶ added in v0.0.11
func (c *RequestContext) JSONPBlob(code int, callback string, b []byte) error
JSONPBlob sends a JSONP blob response with status code. It uses `callback` to construct the JSONP payload.
func (*RequestContext) JSONPretty ¶ added in v0.0.11
func (c *RequestContext) JSONPretty(code int, i interface{}, indent string) error
JSONPretty sends a pretty-print JSON with status code.
func (*RequestContext) Logger ¶ added in v0.0.11
func (c *RequestContext) Logger() echo.Logger
Logger returns the `Logger` instance.
func (*RequestContext) MultipartForm ¶ added in v0.0.11
func (c *RequestContext) MultipartForm() (*multipart.Form, error)
MultipartForm returns the multipart form.
func (*RequestContext) NoContent ¶ added in v0.0.11
func (c *RequestContext) NoContent(code int) error
NoContent sends a response with no body and a status code.
func (*RequestContext) Param ¶ added in v0.0.11
func (c *RequestContext) Param(name string) string
Param returns path parameter by name.
func (*RequestContext) ParamNames ¶ added in v0.0.11
func (c *RequestContext) ParamNames() []string
ParamNames returns path parameter names.
func (*RequestContext) ParamValues ¶ added in v0.0.11
func (c *RequestContext) ParamValues() []string
ParamValues returns path parameter values.
func (*RequestContext) ParseQueryFromReq ¶ added in v0.0.6
func (r *RequestContext) ParseQueryFromReq(c echo.Context) error
func (*RequestContext) Partial ¶ added in v0.1.0
func (r *RequestContext) Partial(name string, data interface{}) template.HTML
Partial - Include and render one template inside other
func (*RequestContext) Path ¶ added in v0.0.11
func (c *RequestContext) Path() string
Path returns the registered path for the handler.
func (*RequestContext) QueryParam ¶ added in v0.0.11
func (c *RequestContext) QueryParam(name string) string
QueryParam returns the query param for the provided name.
func (*RequestContext) QueryParams ¶ added in v0.0.11
func (c *RequestContext) QueryParams() url.Values
QueryParams returns the query parameters as `url.Values`.
func (*RequestContext) QueryString ¶ added in v0.0.11
func (c *RequestContext) QueryString() string
QueryString returns the URL query string.
func (*RequestContext) RealIP ¶ added in v0.0.11
func (c *RequestContext) RealIP() string
RealIP returns the client's network address based on `X-Forwarded-For` or `X-Real-IP` request header. The behavior can be configured using `Echo#IPExtractor`.
func (*RequestContext) Redirect ¶ added in v0.0.11
func (c *RequestContext) Redirect(code int, url string) error
Redirect redirects the request to a provided URL with status code.
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 (c *RequestContext) Render(code int, name string, data interface{}) error
Render renders a template with data and sends a text/html response with status code. Renderer must be registered using `Echo.Renderer`.
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) RenderTemplate ¶ added in v0.0.11
func (r *RequestContext) RenderTemplate(wr io.Writer, name string, data interface{}) error
Render one template, with support for themes
func (*RequestContext) Request ¶ added in v0.0.11
func (c *RequestContext) Request() *http.Request
Request returns `*http.Request`.
func (*RequestContext) Reset ¶ added in v0.0.11
func (c *RequestContext) Reset(r *http.Request, w http.ResponseWriter)
Reset resets the context after request completes. It must be called along with `Echo#AcquireContext()` and `Echo#ReleaseContext()`. See `Echo#ServeHTTP()`
func (*RequestContext) Response ¶ added in v0.0.11
func (c *RequestContext) Response() *echo.Response
Response returns `*Response`.
func (*RequestContext) Scheme ¶ added in v0.0.11
func (c *RequestContext) Scheme() string
Scheme returns the HTTP protocol scheme, `http` or `https`.
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)
func (*RequestContext) SetCookie ¶ added in v0.0.11
func (c *RequestContext) SetCookie(cookie *http.Cookie)
SetCookie adds a `Set-Cookie` header in HTTP response.
func (*RequestContext) SetHandler ¶ added in v0.0.11
func (c *RequestContext) SetHandler(h echo.HandlerFunc)
SetHandler sets the matched handler by router.
func (*RequestContext) SetLogger ¶ added in v0.0.11
func (c *RequestContext) SetLogger(l echo.Logger)
Set the logger
func (*RequestContext) SetParamNames ¶ added in v0.0.11
func (c *RequestContext) SetParamNames(names ...string)
SetParamNames sets path parameter names.
func (*RequestContext) SetParamValues ¶ added in v0.0.11
func (c *RequestContext) SetParamValues(values ...string)
SetParamValues sets path parameter values.
func (*RequestContext) SetPath ¶ added in v0.0.11
func (c *RequestContext) SetPath(p string)
SetPath sets the registered path for the handler.
func (*RequestContext) SetRequest ¶ added in v0.0.11
func (c *RequestContext) SetRequest(r *http.Request)
SetRequest sets `*http.Request`.
func (*RequestContext) SetResponse ¶ added in v0.0.11
func (c *RequestContext) SetResponse(r *echo.Response)
SetResponse sets `*Response`.
func (*RequestContext) SetResponseContentType ¶ added in v0.0.11
func (r *RequestContext) SetResponseContentType(v string) error
Set response type, returns error if the type is invalid TODO! add type validation
func (*RequestContext) Stream ¶ added in v0.0.11
Stream sends a streaming response with status code and content type.
func (*RequestContext) String ¶ added in v0.0.11
func (c *RequestContext) String(code int, s string) error
String sends a string response with status code.
func (*RequestContext) Validate ¶ added in v0.0.11
func (c *RequestContext) Validate(i interface{}) error
Validate validates provided `i`. It is usually called after `Context#Bind()`. Validator must be registered using `Echo#Validator`.
func (*RequestContext) XML ¶ added in v0.0.11
func (c *RequestContext) XML(code int, i interface{}) error
XML sends an XML response with status code.
type RequestContextOpts ¶ added in v0.0.11
type RequestContextOpts struct {
EchoContext echo.Context
}
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"`
}