env

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: May 27, 2021 License: Apache-2.0 Imports: 5 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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