template

package
v3.7.11 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: Apache-2.0 Imports: 21 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvMap added in v3.3.0

func EnvMap(replaceMap map[string]string) map[string]interface{}

func IsMissingVariableErr added in v3.7.11

func IsMissingVariableErr(err error) bool

func IsPlaceholder added in v3.7.11

func IsPlaceholder(s string) bool

IsPlaceholder reports whether s is an internal Argo placeholder value.

func NewPlaceholder added in v3.7.11

func NewPlaceholder(index int) string

NewPlaceholder generates an internal Argo placeholder string for the given index.

func Replace

func Replace(s string, replaceMap map[string]string, allowUnresolved bool) (string, error)

Replace takes a json-formatted string and performs variable replacement.

func ReplaceStrict added in v3.7.11

func ReplaceStrict(s string, replaceMap map[string]string, strictPrefixes []string) (string, error)

ReplaceStrict behaves like Replace but enforces that tags starting with any of strictPrefixes MUST be resolved, even if allowUnresolved behavior is otherwise active (implicit).

func ResolveVar

func ResolveVar(s string, m map[string]interface{}) (interface{}, error)

func Validate

func Validate(s string, validator func(tag string) error) error

Types

type Template

type Template interface {
	Replace(replaceMap map[string]interface{}, allowUnresolved bool) (string, error)
	ReplaceStrict(replaceMap map[string]any, strictPrefixes []string) (string, error)
}

func NewTemplate

func NewTemplate(s string) (Template, error)

Jump to

Keyboard shortcuts

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