Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrViewNotFound = errors.New("view not found")
Functions ¶
func AlwaysReload ¶ added in v0.3.0
func NeverReload ¶ added in v0.3.0
func ReloadOnViewNotFound ¶ added in v0.3.0
Types ¶
type LoadOption ¶ added in v0.2.0
type LoadOption func(loadInfos) loadInfos
func WithFileExt ¶ added in v0.2.0
func WithFileExt(ext string) LoadOption
option to use an alternate extension to filter loaded file (default is ".html")
func WithFs ¶ added in v0.2.0
func WithFs(fs afero.Fs) LoadOption
option to use an alternate file system
func WithFuncs ¶ added in v0.2.0
func WithFuncs(customFuncs template.FuncMap) LoadOption
allow to load a template.FuncMap before parsing the go templates
func WithReloadRule ¶ added in v0.3.0
func WithReloadRule(rule ReloadRule) LoadOption
option to change the rule to reload on error (default is ReloadOnViewNotFound)
type PartRenderer ¶
type PartRenderer struct { Separator string RootName string // contains filtered or unexported fields }
func MakePartRenderer ¶
func MakePartRenderer(componentsPath string, viewsPath string, opts ...LoadOption) (PartRenderer, error)
The componentsPath argument indicates a directory to walk in order to load all component templates
The viewsPath argument indicates a directory to walk in order to load all view templates (which can see components)
func (PartRenderer) ExecuteTemplate ¶
Find a template and render it, global and partial rendering depend on PartRenderer.RootName and PartRenderer.Separator. Could try a reload on error depending on the ReloadRule option.
Click to show internal directories.
Click to hide internal directories.