env

package
v0.1.0-beta-007 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBoolOrDefault

func GetBoolOrDefault(key string, fallback bool) bool

GetBoolOrDefault returns the bool value of a given environment variable or the fallback value if the environment variable was not present. If the environment variable exists but its value cannot be parsed successfully into a bool value then the function will panic.

func GetDurationOrDefault

func GetDurationOrDefault(key string, fallback time.Duration) time.Duration

GetDurationOrDefault returns the time.Duration value of a given environment variable or the fallback value if the environment variable was not present. If the environment variable exists but its value cannot be parsed successfully into a time.Duration object then the function will panic.

func GetIntOrDefault

func GetIntOrDefault(key string, fallback int) int

GetIntOrDefault returns the int value of a given environment variable or the fallback value if the environment variable was not present. If the environment variable exists but its value cannot be parsed successfully into an integer then the function will panic.

func GetOrDefault

func GetOrDefault(key string, fallback string) string

GetOrDefault returns the value of a given environment variable or the fallback value if the environment variable was not present.

Types

This section is empty.

Jump to

Keyboard shortcuts

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