templateutil

package
Version: v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2016 License: MIT Imports: 8 Imported by: 4

Documentation

Overview

Package templateutil features LazyTemplate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustInit

func MustInit(lt *LazyTemplate)

MustInit is a Must func for LazyTemplate.

Types

type LazyTemplate

type LazyTemplate struct {
	Mutex    sync.Mutex // protects everything
	Template *template.Template
	// contains filtered or unexported fields
}

LazyTemplate encloses 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) *LazyTemplate

NewLT constructs LazyTemplate.

func (*LazyTemplate) Apply

func (lt *LazyTemplate) Apply(w http.ResponseWriter, data interface{})

Apply executes enclosed template into w.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL