template

package
v4.0.2 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: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvMap

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

func IsMissingVariableErr

func IsMissingVariableErr(err error) bool

func IsPlaceholder

func IsPlaceholder(s string) bool

IsPlaceholder reports whether s is an internal Argo placeholder value.

func NewPlaceholder

func NewPlaceholder(index int) string

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

func Replace

func Replace(ctx context.Context, s string, replaceMap map[string]string, allowUnresolved bool) (string, error)

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

func ReplaceStrict

func ReplaceStrict(ctx context.Context, 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(ctx context.Context, replaceMap map[string]interface{}, allowUnresolved bool) (string, error)
	ReplaceStrict(ctx context.Context, 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