Documentation
¶
Index ¶
- func InitTemplateSet() error
- type TemplateSet
- func (t *TemplateSet) IsExist(templateName string) (tmpl *template.Template, ok bool)
- func (t *TemplateSet) ReloadTemplates(quiet bool)
- func (t *TemplateSet) Render(ctx *fasthttp.RequestCtx, templateName string, data map[string]interface{})
- func (t *TemplateSet) RenderError(ctx *fasthttp.RequestCtx, status int)
- type TemplateSetError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitTemplateSet ¶ added in v0.0.8
func InitTemplateSet() error
InitTemplateSet creates templateSet instance
Types ¶
type TemplateSet ¶
type TemplateSet struct {
// contains filtered or unexported fields
}
TemplateSet proccessed templates container
var Templates *TemplateSet
Templates global templateset
func (*TemplateSet) IsExist ¶ added in v0.0.14
func (t *TemplateSet) IsExist(templateName string) (tmpl *template.Template, ok bool)
IsExist checks if a given template exist and returns it
func (*TemplateSet) ReloadTemplates ¶ added in v0.0.8
func (t *TemplateSet) ReloadTemplates(quiet bool)
ReloadTemplates reloads all templates from templateDir
func (*TemplateSet) Render ¶
func (t *TemplateSet) Render(ctx *fasthttp.RequestCtx, templateName string, data map[string]interface{})
Render todo
func (*TemplateSet) RenderError ¶ added in v0.0.13
func (t *TemplateSet) RenderError(ctx *fasthttp.RequestCtx, status int)
RenderError renders error page with status code set
type TemplateSetError ¶
type TemplateSetError struct {
Err error
}
func (*TemplateSetError) Error ¶
func (tse *TemplateSetError) Error() string
Click to show internal directories.
Click to hide internal directories.