env

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseBoolFromEnv

func ParseBoolFromEnv(envVar string, defaultValue bool) bool

ParseBoolFromEnv retrieves a boolean value from given environment envVar. Returns default value if envVar is not set.

func ParseDurationFromEnv

func ParseDurationFromEnv(env string, defaultValue, min, max timelib.Duration) timelib.Duration

ParseDurationFromEnv helper function to parse a time duration from an environment variable. Returns a default if env is not set, is not parseable to a duration, exceeds max (if max is greater than 0) or is less than min.

func ParseNumFromEnv

func ParseNumFromEnv(env string, defaultValue, min, max int) int

ParseNumFromEnv helper function to parse a number from an environment variable. Returns a default if env is not set, is not parseable to a number, exceeds max (if max is greater than 0) or is less than min.

func StringFromEnv

func StringFromEnv(key, defaultValue string) string

StringFromEnv returns the env variable for the given key and falls back to the given defaultValue if not set

Types

This section is empty.

Jump to

Keyboard shortcuts

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