templater

package
v3.52.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSH deprecated added in v3.44.0

func IsSH() bool

Deprecated: now always returns true

func MaskSecrets added in v3.52.0

func MaskSecrets(cmdTemplate string, vars *ast.Vars) string

MaskSecrets replaces template placeholders with their values, masking secrets. This function uses the Go templater to resolve all variables ({{.VAR}}) while masking secret ones as "*****".

func MaskSecretsWithExtra added in v3.52.0

func MaskSecretsWithExtra(cmdTemplate string, vars *ast.Vars, extra map[string]any) string

MaskSecretsWithExtra is like MaskSecrets but also resolves extra variables (e.g., loop vars).

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

func ResolveRef added in v3.37.0

func ResolveRef(ref string, cache *Cache) any

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