Documentation ¶
Index ¶
- type CollTmpl
- type Tmpl
- func (t *Tmpl) Delims(left, right string)
- func (t *Tmpl) Execute(wr io.Writer, data interface{}) (err error)
- func (t *Tmpl) FuncAdd(name string, function interface{})
- func (t *Tmpl) FuncsAdd(funcMap template.FuncMap)
- func (t *Tmpl) FuncsRemove(names ...string)
- func (t *Tmpl) Option(opt ...string)
- func (t *Tmpl) ParseFile(filename string) error
- func (t *Tmpl) Reload() error
- type TmplColl
- func (t *TmplColl) Close()
- func (t *TmplColl) Delims(left, right string)
- func (t *TmplColl) ExecuteTemplate(wr io.Writer, filename string, data interface{}) error
- func (t *TmplColl) FuncAdd(name string, function interface{})
- func (t *TmplColl) FuncsAdd(funcMap template.FuncMap)
- func (t *TmplColl) FuncsRemove(names ...string)
- func (t *TmplColl) Lookup(filename string) CollTmpl
- func (t *TmplColl) Option(opt ...string)
- func (t *TmplColl) ParseFiles(filenames ...string) error
- func (t *TmplColl) ParseGlob(pattern string) error
- func (t *TmplColl) ReloadFiles(filenames ...string) error
- func (t *TmplColl) RemoveFiles(filenames ...string)
- func (t *TmplColl) RemoveStaleFiles()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CollTmpl ¶
type CollTmpl interface { Delims(left, right string) FuncAdd(name string, function interface{}) FuncsAdd(funcMap template.FuncMap) FuncsRemove(names ...string) Option(opt ...string) Reload() error Execute(wr io.Writer, data interface{}) (err error) }
A collection template.
type Tmpl ¶
type Tmpl struct {
// contains filtered or unexported fields
}
A template that reloads itself when the underlying file changes.
func (*Tmpl) FuncsRemove ¶
Removes the template functions from the function map.
type TmplColl ¶
type TmplColl struct {
// contains filtered or unexported fields
}
A struct that manages a collection of templates.
func NewTmplColl ¶
Creates a new TmplColl. e. g. NewTmplColl(60, 1)
func (*TmplColl) Close ¶
func (t *TmplColl) Close()
Stops the TmplColl from removing stale templates.
func (*TmplColl) ExecuteTemplate ¶
Executes the template associated with the given filename.
func (*TmplColl) FuncsRemove ¶
Removes the template functions from the function map.
func (*TmplColl) ParseFiles ¶
Parses the files and associates the resulting templates with filenames.
func (*TmplColl) ParseGlob ¶
Parses the files and associates the resulting templates with filenames.
func (*TmplColl) ReloadFiles ¶
Reloads the templates associated with the given filenames.
func (*TmplColl) RemoveFiles ¶
Removes the templates associated with the given filenames.
func (*TmplColl) RemoveStaleFiles ¶
func (t *TmplColl) RemoveStaleFiles()
Removes templates that no longer exist.