template

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package template provides tools to render template strings and template files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderFile

func RenderFile(file string, data interface{}) (string, error)

RenderFile renders a template file with data.

func RenderText

func RenderText(templateText string, data interface{}) (string, error)

Render renders template text with data.

Types

type Values

type Values map[string]interface{}

Values are passed to templates while rendering.

func MergeValues

func MergeValues(lhs, rhs Values) (Values, error)

MergeValues merges rhs on top of lhs without altering lhs. Returns a new Values map.

func (Values) Merge

func (v Values) Merge(other Values) error

Merge merges other on top of v. Non-zero fields in other will override the same fields in v.

Jump to

Keyboard shortcuts

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