templiris

package
v0.0.0-...-0c1db29 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Directory is the folder in which the template files are expected to be
	Directory = "templates"

	// Minify indicates whether or not the resulting HTML pages should be minified by using
	Minify = false

	// NoCache indicates whether or not we should add the Cache-Control header "no-cache"
	NoCache = true
)

Functions

func Preload

func Preload()

Preload loads all the previously registered templates (see `Register`) into memory, to be used by `Render`.

func PreloadTemplate

func PreloadTemplate(name string, r io.Reader) error

PreloadTemplate updates the definition of a single template from any stream, into memory.

func PreloadTemplateFile

func PreloadTemplateFile(templateName string) error

PreloadTemplateFile updates the definition of a single template file into memory.

func Register

func Register(templateName string)

Register adds the given `templateName` to the list of files that need to be loaded on `Preload`

It is by no means thread-safe.

func Render

func Render(c *iris.Context, tmpl string, p map[string]interface{})

func RenderWithStatus

func RenderWithStatus(c *iris.Context, templateName string, p map[string]interface{}, status int)

Types

This section is empty.

Jump to

Keyboard shortcuts

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