template

package
v0.1.46 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeContexts

func MergeContexts(contexts ...map[string]interface{}) map[string]interface{}

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 New

func New() *Engine

New creates a new template engine

func (*Engine) ExtractVariables

func (e *Engine) ExtractVariables(value interface{}) []string

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

func (e *Engine) Replace(value interface{}, context map[string]interface{}) (interface{}, error)

Replace replaces all template variables in a value with actual values from the context

func (*Engine) ValidateContext

func (e *Engine) ValidateContext(value interface{}, context map[string]interface{}) error

ValidateContext ensures all required variables are present in the context

Jump to

Keyboard shortcuts

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