env

package
v2.1.14 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: Apache-2.0 Imports: 6 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseBoolFromEnv added in v2.1.0

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 time.Duration) time.Duration

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

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.

nolint:unparam

func StringFromEnv

func StringFromEnv(env string, defaultValue string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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