Documentation
¶
Overview ¶
Package envparser contains environment parsing and functions around it
Package envparser contains environment parsing and functions around it ¶
Package envparser contains environment parsing and functions around it
Index ¶
- func CreateDefaultEnvs(envName *string) error
- func CreateEnvDirAndFiles(fileName string) (string, error)
- func GenerateSecretsMap(envFromFlag string) (map[string]any, error)
- func LoadEnvVars(filePath string) (map[string]any, error)
- func SubstituteVariables(strToChange string, secretsMap map[string]any) (any, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDefaultEnvs ¶
CreateDefaultEnvs Creates environment folder and a default global.env file in it. Optional: File names as a *string
func CreateEnvDirAndFiles ¶
CreateEnvDirAndFiles Creates an env directory and a fileName inside it. Returns envfilePath and errors associated with it
func GenerateSecretsMap ¶
GenerateSecretsMap creates final map of environment variables and it's values User's Choice > Global. When user has custom env they want to use, it merges custom with global env. Replaces global key with custom when keys repeat
func LoadEnvVars ¶
LoadEnvVars returns map of the key-value pair from the provided .env filepath
func SubstituteVariables ¶
SubstituteVariables Substitutes template variables in a given string strToChange using the secretsMap. It first prepares the map by resolving all nested variables using prepareMap and then applies replaceVariables to the input string. Returns the final substituted string or an error if any step fails.
Types ¶
This section is empty.