template

package
v0.0.0-...-5365f31 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 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) Render

func (e *Engine) Render(name, language string, data interface{}) []byte

Render process a template and write the ouput.

Jump to

Keyboard shortcuts

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