env

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildArgsEnvMap

func BuildArgsEnvMap(
	args executable.ArgumentList,
	execArgs []string,
	env map[string]string,
) (map[string]string, error)

func BuildArgsFromEnv added in v1.0.3

func BuildArgsFromEnv(
	argsList executable.ArgumentList,
	inputEnv map[string]string,
) []string

BuildArgsFromEnv builds a list of arguments from the provided environment and expected args list. It will return the positional arguments in the order they are expected and then append any flag arguments at the end.

TODO: Add support for overriding flag values.

func BuildEnvMap

func BuildEnvMap(
	currentVault string,
	exec *executable.ExecutableEnvironment,
	inputArgs []string,
	inputEnv map[string]string,
	defaultEnv map[string]string,
) (map[string]string, error)

BuildEnvMap constructs a map of environment variables based on the executable parameters and arguments.

func CreateTempEnvFiles

func CreateTempEnvFiles(
	currentVault, flowfilePath, wsPath string,
	exec *executable.ExecutableEnvironment,
	args []string,
	promptedEnv map[string]string,
) (func(ctx *context.Context) error, error)

CreateTempEnvFiles creates temporary files for parameters and arguments that have an OutputFile defined. It returns a cleanup function that should be called to remove these files after use.

func DefaultEnv

func DefaultEnv(ctx *context.Context, executable *executable.Executable) map[string]string

func EnvListToEnvMap

func EnvListToEnvMap(envList []string) map[string]string

EnvListToEnvMap converts a slice of strings in the format "KEY=VALUE" to a map of environment variables.

func EnvMapToEnvList

func EnvMapToEnvList(envMap map[string]string) []string

EnvMapToEnvList converts a map of environment variables to a slice of strings in the format "KEY=VALUE".

func LoadEnvFromFiles added in v1.1.0

func LoadEnvFromFiles(files []string, expansionFallbackDir string) (map[string]string, error)

func ResolveParameterValue

func ResolveParameterValue(
	currentVault string,
	param executable.Parameter,
	promptedEnv map[string]string,
) (string, error)

func SetEnv

func SetEnv(
	currentVault string,
	exec *executable.ExecutableEnvironment,
	inputArgs []string,
	inputEnv map[string]string,
) error

SetEnv sets environment variables based on the parameters and arguments defined in the executable environment.

Types

This section is empty.

Jump to

Keyboard shortcuts

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