Documentation ¶
Overview ¶
Package templateutil features LazyTemplate and TemplateWriter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CombineMaps ¶
CombineMaps makes new template.FuncMap off f implementation and extra.
func FuncMapHTML ¶
func FuncMapJSXL ¶
Types ¶
type HTMLFuncs ¶
type HTMLFuncs struct{}
HTMLFuncs has methods implementing Functor.
func NewHTMLFuncs ¶
func NewHTMLFuncs() HTMLFuncs
type JSXLFuncs ¶
type JSXLFuncs struct{}
JSXLFuncs has methods implementing Functor.
func NewJSXLFuncs ¶
func NewJSXLFuncs() JSXLFuncs
type LazyTemplate ¶
type LazyTemplate struct { MU sync.Mutex // protects everything // arguments to NewLT (all required) ReadFunc ReadFunc InfoFunc InfoFunc Filename string Funcmap template.FuncMap // operationals NonDev bool DevModTime time.Time Template *template.Template Err error }
LazyTemplate has a template.Template. Lazy parse , always clone for bin templates , sometimes re-parse for dev-bins . NewLT is the constructor.
func NewLT ¶
func NewLT(readfunc ReadFunc, infofunc InfoFunc, filename string, funcmap template.FuncMap) *LazyTemplate
NewLT constructs LazyTemplate.
func (*LazyTemplate) Apply ¶
func (lt *LazyTemplate) Apply(w http.ResponseWriter, data interface{})
Apply clones .Template to execute it into w.
Click to show internal directories.
Click to hide internal directories.