templatefuncs

package
v1.226.0-test.11 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package templatefuncs holds Go text/template functions Atmos authors itself (as opposed to Sprig's or Gomplate's), meant to be registered alongside them in every FuncMap Atmos builds -- scaffold templates, stack config templates, locals, secrets/store reference templates, and toolchain asset templates alike.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectKeys

func CollectKeys(v any, nestedKey ...string) ([]string, error)

CollectKeys is the "collectKeys" template function. With no extra argument it returns v's top-level keys, sorted. With a nestedKey argument, it collects nestedKey's own keys from every one of v's values, flattening and deduplicating across all of them -- e.g. collectKeys(environments, "regions") returns every region used by any environment.

Sprig's own "keys" takes multiple maps and returns their union unsorted, with no nested-key mode -- CollectKeys is registered under its own name so it doesn't shadow it.

func FuncMap

func FuncMap() map[string]any

FuncMap returns every template function this package exports, keyed by the name it's registered under. Callers merge it into a text/template FuncMap the same way they merge Sprig's or Gomplate's.

Types

This section is empty.

Jump to

Keyboard shortcuts

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