Documentation
¶
Index ¶
- Variables
- func FromStdin() bool
- func Read(r io.Reader) []byte
- type Tmplhate
- func (t *Tmplhate) GetReader(location string) io.Reader
- func (t *Tmplhate) Init(tmplLocation string, varsLocation string, dontNormalize bool, varsCase string)
- func (t *Tmplhate) LoadCaser()
- func (t *Tmplhate) LoadEnvVars()
- func (t *Tmplhate) LoadTemplate(r io.Reader)
- func (t *Tmplhate) LoadVars(r io.Reader)
- func (t *Tmplhate) ValidateTemplate()
- func (t *Tmplhate) WriteTemplate(w io.Writer)
- type Tmplhater
Constants ¶
This section is empty.
Variables ¶
View Source
var TmplhateFuncs = template.FuncMap{ "lower": func(s string) string { return cases.Lower(language.English).String(s) }, "upper": func(s string) string { return cases.Upper(language.English).String(s) }, "mul": func(a int, b int) int { return a * b }, }
flags
Functions ¶
Types ¶
type Tmplhate ¶
type Tmplhate struct {
Caser cases.Caser
Language language.Tag
NormalizeVars bool
String string
Tmpl *template.Template
Vars map[string]any `yaml:"vars,omitempty,flow"`
VarsCase string
}
impl of tmplhate interface
func (*Tmplhate) LoadTemplate ¶
method to get template from reader and load
func (*Tmplhate) WriteTemplate ¶
method to output rendered template to io.Writer
Click to show internal directories.
Click to hide internal directories.