template

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvalBool

func EvalBool(rendered string) bool

EvalBool evaluates a `when` expression; empty string/"false"/"0" = false, else true.

func ExtractExpressions

func ExtractExpressions(text string) ([]string, error)

ExtractExpressions returns each {{ ... }} inner expression (trimmed) in order.

func Render

func Render(text string, results map[string]*types.StepResult, order []string) (string, error)

Render resolves {{ }} expressions using completed step results. results is keyed by step name; order gives index access.

Types

type Ref

type Ref struct {
	ByIndex bool
	Index   int
	Name    string
	Prop    string // output | error | exitcode
	Raw     string // full token (e.g. steps.foo.output)
	ExprRaw string // full {{ ... }} inner expression this ref appears in
}

func ExtractRefs

func ExtractRefs(text string) ([]Ref, error)

ExtractRefs scans text for {{ }} blocks and returns parsed refs. Supports comparison expressions like `{{ steps.foo.output != ” }}` by extracting any step references found inside the expression.

Jump to

Keyboard shortcuts

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