utils

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InterpolateEnvVars

func InterpolateEnvVars(input string, strict bool) (string, error)

InterpolateEnvVars replaces environment variable references in strings with their values. Supports ${VAR}, $VAR, and ${VAR:-default} syntax.

If a variable doesn't exist: - In strict mode: returns an error - In normal mode: uses default value if provided, otherwise empty string

func InterpolateEnvVarsRecursive

func InterpolateEnvVarsRecursive(data any, strict bool) (any, error)

InterpolateEnvVarsRecursive performs recursive interpolation on all string values in a data structure (useful for JSON objects)

Types

type MissingEnvVarsError

type MissingEnvVarsError struct {
	Variables []string
}

MissingEnvVarsError is returned when required environment variables are missing

func (*MissingEnvVarsError) Error

func (e *MissingEnvVarsError) Error() string

Jump to

Keyboard shortcuts

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