tpl

package
v0.0.0-...-5dd4c9b Latest Latest
Warning

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

Go to latest
Published: May 21, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context interface {
	// Prepare renders all of the given Files for execution. Some
	// implementations may return a cached executor for the given Files
	Prepare(Files) (*template.Template, error)
}

Context is a group of template files that all live under a directory

func NewCachingContext

func NewCachingContext(baseDir string, funcs template.FuncMap) Context

NewCachingContext creates and returns a new Context implementation that lazily parses a new template on the first call to Prepare, and caches that template on subsequent calls

func NewNonCachingContext

func NewNonCachingContext(baseDir string, funcs template.FuncMap) Context

NewNonCachingContext creates and returns a new Context implementation that parses a new template on each call to prepare. This implementation is useful for development

type Files

type Files struct {
	// contains filtered or unexported fields
}

Files is an ordered list of filenames that comprise a template. The first filename in the list should be the primary template that will be rendered, and the remaining ones should be supporting templates like block definitions

func NewFiles

func NewFiles(file string, files ...string) Files

NewFiles creates a new Files struct from the given filenames

func (Files) First

func (f Files) First() string

First returns the first file listed in f

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL