envutils

package
v1.18.0-beta25 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOrDefault added in v1.17.4

func GetOrDefault(key, fallback string, allowEmpty bool) string

GetOrDefault returns the value of the environment variable for the given key, or the default value if the environment variable is not set. A value of "" will only be returned if allowEmpty is true. Otherwise, the empty value is ignored and the default is returned.

func IsEnvDefined

func IsEnvDefined(envVarName string) bool

IsEnvDefined returns true if a given environment variable has any value

func IsEnvTruthy

func IsEnvTruthy(envVarName string) bool

IsEnvTruthy returns true if a given environment variable has a truthy value Examples of truthy values are: "1", "t", "T", "true", "TRUE", "True". Anything else is considered false.

func IsTruthyValue added in v1.17.4

func IsTruthyValue(value string) bool

IsTruthyValue returns true if a given value is "truthy". Examples of truthy values are: "1", "t", "T", "true", "TRUE", "True". Anything else is considered false.

func LookupOrDefault added in v1.17.4

func LookupOrDefault(key, fallback string) (string, bool)

LookupOrDefault returns the value of the environment variable for the given key, or the default value if the environment variable is not set. Also returns whether the value existed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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