templates

package
v0.69.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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