Documentation ¶
Overview ¶
Package template holds utilities for working with templates.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶ added in v0.9.3
type Engine interface { // Replace replaces template values using provided storage. Replace(templateValue string, storage map[string]interface{}) (string, error) }
Engine is entity that has ability to work with templates.
type TemplateManager ¶
type TemplateManager struct{}
TemplateManager is entity that has ability to manage templates.
func New ¶
func New() TemplateManager
func (TemplateManager) Replace ¶
func (tm TemplateManager) Replace(templateValue string, storage map[string]interface{}) (string, error)
Replace replaces template values using provided storage. templateValue should exist between two brackets {{ }} preceded with dot, for example: "my name is: {{.NAME}}".
Click to show internal directories.
Click to hide internal directories.