Documentation ¶
Index ¶
- func ReadFile(path string, fs http.FileSystem) ([]byte, error)
- func Walk(fs http.FileSystem, root string, walkFn filepath.WalkFunc) error
- type Engine
- func (e *Engine) AddFunc(name string, fn any)
- func (e *Engine) AddFuncMap(m map[string]any)
- func (e *Engine) Debug(enabled bool)
- func (e *Engine) Delims(left, right string)
- func (e *Engine) FuncMap() map[string]any
- func (e *Engine) Layout(key string)
- func (e *Engine) Reload()
- func (e *Engine) SetPrefixTheme(theme string)
- func (e *Engine) SetTheme(theme string)
- type IEngine
- type IEngineView
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadFile ¶
func ReadFile(path string, fs http.FileSystem) ([]byte, error)
ReadFile returns the raw content of a file
Types ¶
type Engine ¶
type Engine struct { IEngineView http.FileSystem // http.FileSystem supports embedded files Left string // default {{ Right string // default }} Directory string // views folder LayoutName string LayoutFunc string Theme string PrefixTheme string UseTheme bool UsePrefixTheme bool Loaded bool Ext string Verbose bool Mutex sync.RWMutex Helpers map[string]any Binding any }
func (*Engine) AddFunc ¶
AddFunc adds the function to the template's function map. It is legal to overwrite elements of the default actions
func (*Engine) AddFuncMap ¶
AddFuncMap adds the functions from a map to the template's function map. It is legal to overwrite elements of the default actions
func (*Engine) Delims ¶
Delims sets the action delimiters to the specified strings, to be used in templates. An empty delimiter stands for the corresponding default: "{{" and "}}".
func (*Engine) Reload ¶
func (e *Engine) Reload()
Reload if set to true the templates are reloading on each render, use it when you're in development and you don't want to restart the application when you edit a template file.
func (*Engine) SetPrefixTheme ¶
Click to show internal directories.
Click to hide internal directories.