Documentation ¶
Index ¶
- func DefaultFuncMap(tmpl *Tpl) (err error)
- func DefaultVariables(tmpl *Tpl) (err error)
- type Option
- func AppendFiles(file string) Option
- func AppendFuncMap(name string, value interface{}) Option
- func AppendVariables(name, value string) Option
- func Files(files []string) Option
- func FuncMap(funcMap template.FuncMap) Option
- func Glob(files string) Option
- func MergeVariables(m map[string]string) Option
- func Name(name string) Option
- func TemplateString(templateString string) Option
- func Variables(variable map[string]string) Option
- type Tpl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultFuncMap ¶ added in v0.2.0
DefaultFuncMap is an option function that sets the default values of the FuncMap
func DefaultVariables ¶ added in v0.2.0
DefaultVariables is an option function that sets the default values of Variables map
Types ¶
type Option ¶ added in v0.2.0
Option is an option function used by SetOptions to configure the struct
func AppendFiles ¶ added in v0.2.0
AppendFiles appends file parameter of the tmp struct. Files are the files parsed as templates
func AppendFuncMap ¶ added in v0.2.0
AppendFuncMap appends the funcMap parameter of the tmp struct. FuncMap functions are passed into the template
func AppendVariables ¶ added in v0.2.0
AppendVariables appends the variable parameter of the tmp struct. Variables are passed into the template
func Files ¶ added in v0.2.0
Files sets parameter of the tmp struct. Files are the files parsed as templates
func FuncMap ¶ added in v0.2.0
FuncMap sets the funcMap parameter of the tmp struct. FuncMap functions are passed into the template
func Glob ¶ added in v0.2.0
Glob sets parameter of the tmp struct. Files identified by the pattern are used as the templates
func MergeVariables ¶ added in v0.2.0
MergeVariables merges the variable parameter of the tmp struct with the passed in map. Variables are passed into the template
func Name ¶ added in v0.2.0
Name sets name parameter of the tmp struct. Name is the name of the template
func TemplateString ¶ added in v0.2.0
TemplateString sets parameter of the tmp struct. TemplateString is the parsed as a string template
type Tpl ¶ added in v0.2.0
type Tpl struct { Name string TemplateString string Files []string Glob string Variables map[string]string FuncMap template.FuncMap }
Tpl is the template struct the contains template options
func New ¶ added in v0.2.0
New returns a new Tpl struct in`itialized with the option arguements pass in