templates

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package templates provides utilities for parsing and analyzing Go templates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractReferences

func ExtractReferences(tmplStr string) ([]string, error)

ExtractReferences finds all field references in a template string. Returns the full field paths (e.g., ".steps.step1.output", ".params.message"). It uses FuncMap() to ensure templates with custom functions can be parsed.

func ExtractReferencesFromTemplate

func ExtractReferencesFromTemplate(tmpl *template.Template) []string

ExtractReferencesFromTemplate finds all field references in a parsed template.

func FuncMap added in v0.8.3

func FuncMap() template.FuncMap

FuncMap returns the standard template functions available in composite tools. These functions are used both at validation time and runtime to ensure templates using json, quote, or fromJson are valid.

Smell: It is odd to expose this low-level detail of which functions are available to templating to other packages. Ideally, this would be encapsulated and the higher-level functions like validation would be implemented within this package. However, validation is currently implemented against the config types and not the composer types. We should make this function internal and consolidate all validation capabilities here once we've replaced the composer types for the config types. They are semantically the same and the config types represent the documented API types.

Types

This section is empty.

Jump to

Keyboard shortcuts

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