Documentation
¶
Overview ¶
Package template implements the variable substitution and templating engine used by workflow steps.
The engine resolves Go-style `{{ ... }}` expressions against an execution context that exposes workflow inputs (`{{ .input.* }}`) and prior step results (`{{ steps.<id>.* }}`). It supports both simple variable access (returning the underlying typed value) and full text-template rendering (returning a string), with a dedicated path for each so that argument passing preserves types.
Index ¶
- func MergeContexts(contexts ...map[string]interface{}) map[string]interface{}
- type Engine
- func (e *Engine) ExtractVariables(value interface{}) []string
- func (e *Engine) RenderGoTemplate(templateStr string, context map[string]interface{}) (interface{}, error)
- func (e *Engine) Replace(value interface{}, context map[string]interface{}) (interface{}, error)
- func (e *Engine) ValidateContext(value interface{}, context map[string]interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MergeContexts ¶
MergeContexts merges multiple contexts into a single context Later contexts override values from earlier contexts
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine handles arg templating for service operations
func (*Engine) ExtractVariables ¶
ExtractVariables extracts all template variable names from a value
func (*Engine) RenderGoTemplate ¶
func (e *Engine) RenderGoTemplate(templateStr string, context map[string]interface{}) (interface{}, error)
RenderGoTemplate renders a full Go template with Sprig template functions This is used for complex expressions like {{ eq .input.var "value" }}
func (*Engine) Replace ¶
Replace replaces all template variables in a value with actual values from the context
func (*Engine) ValidateContext ¶
ValidateContext ensures all required variables are present in the context