lib

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(templateStr string, data TemplateData) (string, error)

Render parses and executes a template string using custom delimiters {[ and ]}, sprig template functions, and the provided data. It returns the rendered string.

func RenderFromEnv

func RenderFromEnv(templateStr string) (string, error)

RenderFromEnv parses and executes a template string using the current environment variables as template data.

Types

type TemplateData

type TemplateData map[string]template.ExtendedString

TemplateData is the data that will be passed to the template evaluator.

func EnvMap

func EnvMap() TemplateData

EnvMap returns the current environment variables as a TemplateData map. Windows-style variable references (%VAR%) are expanded to their Unix equivalents.

func (TemplateData) Filter

func (t TemplateData) Filter(pattern string) TemplateData

Filter returns a subset of T where the keys match the passed pattern. It will return an empty map and log an error if the pattern is not a valid one

Jump to

Keyboard shortcuts

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