Documentation ¶
Index ¶
- type CustomBinder
- type CustomValidator
- type CustomValueBinder
- type InputErrors
- type Map
- type StaticFunc
- type Template
- func (t *Template) AddFuncs(funcs template.FuncMap)
- func (t *Template) AddStaticFunc(f StaticFunc)
- func (t *Template) AddStaticVar(key string, value any) error
- func (t *Template) LoadTemplates(path string, tfs fs.FS) error
- func (t *Template) Render(w io.Writer, name string, data any, c echo.Context) error
- func (t *Template) Templates() *template.Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomBinder ¶
type CustomBinder struct{}
CustomBinder custom binding functionality
func (*CustomBinder) Bind ¶
func (cb *CustomBinder) Bind(i interface{}, c echo.Context) error
Bind does the default echo binding
type CustomValidator ¶
type CustomValidator struct {
// contains filtered or unexported fields
}
CustomValidator to add additional validation of external input
func (*CustomValidator) Validate ¶
func (cv *CustomValidator) Validate(i interface{}) error
Validate adds the additional validator checking
type CustomValueBinder ¶
type CustomValueBinder struct { *echo.ValueBinder // contains filtered or unexported fields }
CustomValueBinder will help tie form errors to form struct fields in error reporting.
func FormFieldBinder ¶
func FormFieldBinder(c echo.Context, form any) *CustomValueBinder
FormFieldBinder will return a custom value binder
func (*CustomValueBinder) NewBindingError ¶
func (c *CustomValueBinder) NewBindingError(sourceParam string, values []string, message interface{}, internalError error) error
NewBindingError creates new instance of binding error but swaps the `sourceParam` with the struct field name if the `sourceParam` value matches a struct tag on a given form field.
type InputErrors ¶
InputErrors map of many InputError's
func GetInputErrors ¶
func GetInputErrors(errors []error) InputErrors
GetInputErrors generates an input errors map. Expects a slice of echo.BindingErrors (returned from echo.ValueBinder.BindErrors()
func NewInputErrors ¶
func NewInputErrors() InputErrors
NewInputErrors makes an InputError map with default _global_
type StaticFunc ¶
type StaticFunc func(c echo.Context) Map
StaticFunc is a function signature for functions processed to populate template contexts
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
Template defines the template registry struct
func (*Template) AddFuncs ¶
AddFuncs adds template functions to the rendering template
func (*Template) AddStaticFunc ¶
func (t *Template) AddStaticFunc(f StaticFunc)
AddStaticFunc adds a function to be called when building the default template context variables.
func (*Template) AddStaticVar ¶
AddStaticVar adds a constant variable to the template context
func (*Template) LoadTemplates ¶
LoadTemplates parses templates given the glob pattern path
func (*Template) Render ¶
Render implements e.Renderer interface