Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // The function map to use when rendering templates. FuncMap = DefaultFuncMap() )
Functions ¶
func DefaultFuncMap ¶
DefaultFuncMap returns a map of functions for the template engine. It includes everything from sprig.FuncMap, plus a number of functions from flect.
Types ¶
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
Template is a lightweight wrapper for template strings.
Since it implements the encoding.TextMarshaler and encoding.TextUnmarshaler interfaces, it can be used with JSON or YAML fields containing template strings.
func Compile ¶
Compile parses a template string and returns, if successful, a new Template that can be rendered.
func MustCompile ¶
MustCompile behaves like Compile, but panics on error.
func (*Template) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*Template) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
Click to show internal directories.
Click to hide internal directories.