templater

package
v3.36.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Replace added in v3.36.0

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

func ReplaceGlobs added in v3.36.0

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

func ReplaceVar added in v3.36.0

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

func ReplaceVarWithExtra added in v3.36.0

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

func ReplaceVars added in v3.36.0

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

func ReplaceVarsWithExtra added in v3.36.0

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

func ReplaceWithExtra added in v3.36.0

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

Types

type Cache added in v3.36.0

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 added in v3.36.0

func (r *Cache) Err() error

func (*Cache) ResetCache added in v3.36.0

func (r *Cache) ResetCache()

Jump to

Keyboard shortcuts

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