template

package
v0.92.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package template provides pipeline template rendering engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct{}

Engine renders Go text/template strings with helper functions and caching. Each RenderString call captures its own data via closures so concurrent invocations are safe without locking.

func New

func New() *Engine

New returns a new template Engine.

func (*Engine) Render

func (e *Engine) Render(params map[string]any, data *TemplateData) (map[string]any, error)

Render traverses a map of parameters and renders any template strings found within using the given TemplateData.

func (*Engine) RenderString

func (*Engine) RenderString(tmpl string, data *TemplateData) (string, error)

RenderString renders a template string with the given TemplateData. Templates are cached by their preprocessed string; on cache hit the cached parse tree is cloned and fresh data-dependent functions (event, input, step) are attached via closures for the current call.

type TemplateData

type TemplateData struct {
	Event map[string]any
	Steps map[string]map[string]any
	Env   map[string]string
	Input map[string]any
}

TemplateData holds the execution context for template rendering.

Jump to

Keyboard shortcuts

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