template

package
v0.0.0-...-ece56df Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package template handles template parsing and execution.

Index

Constants

This section is empty.

Variables

View Source
var (
	NotYet     = `not yet`
	JustNow    = `just now`
	LastMinute = `1 minute ago`
	Minutes    = `%d minutes ago`
	LastHour   = `1 hour ago`
	Hours      = `%d hours ago`
	Yesterday  = `yesterday`
	Days       = `%d days ago`
	Weeks      = `%d weeks ago`
	Months     = `%d months ago`
	Years      = `%d years ago`
)

Texts to be translated if necessary.

Functions

This section is empty.

Types

type Engine

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

Engine handles the templating system.

func NewEngine

func NewEngine(cfg *config.Config, router *mux.Router, translator *locale.Translator) *Engine

NewEngine returns a new template engine.

func (*Engine) Execute

func (e *Engine) Execute(w io.Writer, name string, data interface{})

Execute process a template.

func (*Engine) SetLanguage

func (e *Engine) SetLanguage(language string)

SetLanguage change the language for template processing.

Jump to

Keyboard shortcuts

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