Documentation ¶
Index ¶
- func Execute(t Template, ctx Context) (buf bytes.Buffer, err error)
- func ExecuteList(templates []Template, ctx Context) (res []string, err error)
- func ExecuteToBytes(t Template, ctx Context) (res []byte, err error)
- func ExecuteToString(t Template, ctx Context) (res string, err error)
- type Context
- type Map
- type MapNode
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteList ¶
ExecuteList - Executes a list of templates to strings.
func ExecuteToBytes ¶
ExecuteToBytes - Executes template with context and returns string result.
Types ¶
type Context ¶
type Context map[string]interface{}
Context - Template context.
func (Context) Get ¶
Get - Gets value by key. It might deep traverse if key doesnt exist and contains a dot.
func (Context) WithDefaults ¶
WithDefaults - Sets values from `source` only if previously didnt exist. It may return a new map if called on nil Context.
type Map ¶
Map - Template map.
type Template ¶
Template - Template structure.
func FromString ¶
FromString - Creates a new template structure from string.
Click to show internal directories.
Click to hide internal directories.