templatefuncs

package
v1.235.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 3 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 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