templater

package
v3.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Templater

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

Templater 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 (*Templater) Err

func (r *Templater) Err() error

func (*Templater) Replace

func (r *Templater) Replace(str string) string

func (*Templater) ReplaceGlobs

func (r *Templater) ReplaceGlobs(globs []*ast.Glob) []*ast.Glob

func (*Templater) ReplaceSlice

func (r *Templater) ReplaceSlice(strs []string) []string

func (*Templater) ReplaceVars

func (r *Templater) ReplaceVars(vars *ast.Vars) *ast.Vars

func (*Templater) ReplaceVarsWithExtra

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

func (*Templater) ReplaceWithExtra

func (r *Templater) ReplaceWithExtra(str string, extra map[string]any) string

func (*Templater) ResetCache

func (r *Templater) ResetCache()

Jump to

Keyboard shortcuts

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