Versions in this module Expand all Collapse all v1 v1.0.1 Jan 21, 2024 v1.0.0 Feb 25, 2023 Changes in this version + func CoerceBool(v Value) bool + func CoerceNumber(v Value) float64 + func CoerceString(v Value) string + func Contains(haystack Value, needle Value) (bool, error) + func Equal(left Value, right Value) bool + func IsArray(val Value) bool + func IsIterable(val Value) bool + func IsMap(val Value) bool + func Iterate(val Value, it Iteratee) (int, error) + func Len(val Value) (int, error) + type Boolean interface + Boolean func() bool + type Context interface + Env func() *Env + Meta func() ContextMetadata + Name func() string + Scope func() ContextScope + type ContextMetadata interface + All func() map[string]string + Get func(name string) (string, bool) + Set func(name, val string) + type ContextScope interface + All func() map[string]Value + Get func(string) (Value, bool) + Set func(string, Value) + type Env struct + Filters map[string]Filter + Functions map[string]Func + Loader Loader + Tests map[string]Test + Visitors []parse.NodeVisitor + func New(loader Loader) *Env + func (env *Env) Execute(tpl string, out io.Writer, ctx map[string]Value) error + func (env *Env) Parse(name string) (*parse.Tree, error) + func (env *Env) Register(e Extension) error + type Extension interface + Init func(*Env) error + type FilesystemLoader struct + func NewFilesystemLoader(rootDir string) *FilesystemLoader + func (l *FilesystemLoader) Load(name string) (Template, error) + type Filter func(ctx Context, val Value, args ...Value) Value + type Func func(ctx Context, args ...Value) Value + type Iteratee func(k, v Value, l Loop) (brk bool, err error) + type Loader interface + Load func(name string) (Template, error) + type Loop struct + Index int + Index0 int + Last bool + type MemoryLoader struct + Templates map[string]string + func (l *MemoryLoader) Load(name string) (Template, error) + type Number interface + Number func() float64 + type SafeValue interface + IsSafe func(typ string) bool + SafeFor func() []string + Value func() Value + func NewSafeValue(val Value, types ...string) SafeValue + type StringLoader struct + func (l *StringLoader) Load(name string) (Template, error) + type Stringer interface + type Template interface + Contents func() io.Reader + Name func() string + type Test func(ctx Context, val Value, args ...Value) bool + type Value interface + func GetAttr(v Value, attr Value, args ...Value) (Value, error)