Documentation ¶
Overview ¶
Package templateutil features LazyTemplate and TemplateWriter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
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.