env

package
v0.0.93 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 4 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TLS_VERIFY = os.Getenv("TLS_VERIFY") == "true"
	DEBUG      = os.Getenv("DEBUG") == "true"
)

Functions

func ExpandWithEnv

func ExpandWithEnv(variables ...*string)

ExpandWithEnv updates string variables to their corresponding environment values. If the variables does not exist, they're set to empty strings.

func GetEnvOrDefault added in v0.0.58

func GetEnvOrDefault[T EnvType](key string, defaultValue T) T

GetEnvOrDefault returns the value of the environment variable or the default value if the variable is not set. in requested type.

Types

type EnvType added in v0.0.58

type EnvType interface {
	~string | ~int | ~bool | ~float64 | time.Duration
}

EnvType is a type that can be used as a type for environment variables.

Jump to

Keyboard shortcuts

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