templater

package
v3.38.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Replace

func Replace[T any](v T, cache *Cache) T

func ReplaceGlobs

func ReplaceGlobs(globs []*ast.Glob, cache *Cache) []*ast.Glob

func ReplaceVar

func ReplaceVar(v ast.Var, cache *Cache) ast.Var

func ReplaceVarWithExtra

func ReplaceVarWithExtra(v ast.Var, cache *Cache, extra map[string]any) ast.Var

func ReplaceVars

func ReplaceVars(vars *ast.Vars, cache *Cache) *ast.Vars

func ReplaceVarsWithExtra

func ReplaceVarsWithExtra(vars *ast.Vars, cache *Cache, extra map[string]any) *ast.Vars

func ReplaceWithExtra

func ReplaceWithExtra[T any](v T, cache *Cache, extra map[string]any) T

func ResolveRef

func ResolveRef(ref string, cache *Cache) any

Types

type Cache

type Cache struct {
	Vars *ast.Vars
	// contains filtered or unexported fields
}

Cache is a help struct that allow us to call "replaceX" funcs multiple times, without having to check for error each time. The first error that happen will be assigned to r.err, and consecutive calls to funcs will just return the zero value.

func (*Cache) Err

func (r *Cache) Err() error

func (*Cache) ResetCache

func (r *Cache) ResetCache()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL