Documentation
¶
Index ¶
- type Interpolator
- func (i *Interpolator) Clear()
- func (i *Interpolator) GetVariables() map[string]string
- func (i *Interpolator) Interpolate(text string) (string, error)
- func (i *Interpolator) InterpolateMap(data map[string]string) (map[string]string, error)
- func (i *Interpolator) SetVariable(name, value string)
- func (i *Interpolator) SetVariables(vars map[string]string)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interpolator ¶
type Interpolator struct {
// contains filtered or unexported fields
}
Interpolator handles variable interpolation
func NewInterpolator ¶
func NewInterpolator(vars map[string]string, opts *Options) *Interpolator
NewInterpolator creates a new interpolator
func (*Interpolator) GetVariables ¶
func (i *Interpolator) GetVariables() map[string]string
GetVariables returns all variables
func (*Interpolator) Interpolate ¶
func (i *Interpolator) Interpolate(text string) (string, error)
Interpolate expands variables in text
func (*Interpolator) InterpolateMap ¶
InterpolateMap interpolates all values in a map
func (*Interpolator) SetVariable ¶
func (i *Interpolator) SetVariable(name, value string)
SetVariable sets a variable value
func (*Interpolator) SetVariables ¶
func (i *Interpolator) SetVariables(vars map[string]string)
SetVariables sets multiple variables
Click to show internal directories.
Click to hide internal directories.