templator

package module
v0.0.0-...-b05bab5 Latest Latest
Warning

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

Go to latest
Published: May 6, 2019 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Templator

type Templator struct {
	Root      string
	Templates map[string]*template.Template
	// contains filtered or unexported fields
}

Templator parses web/templates and builds them according to directory structure

func NewTemplator

func NewTemplator(root string) (*Templator, error)

NewTemplator initializes Templator with data

func (*Templator) GetTemplates

func (t *Templator) GetTemplates() []string

GetTemplates return slice of available templates

func (*Templator) Render

func (t *Templator) Render(w http.ResponseWriter, name string, data map[string]interface{}) error

Render renders data to template with name and writes it to w

Jump to

Keyboard shortcuts

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