os

package
v0.1.0-rc.24 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBoolFromEnvVar

func GetBoolFromEnvVar(name string, defaultValue bool) (bool, error)

GetBoolFromEnvVar attempts to parse a bool from a string value retrieved from the specified environment variable. An error is returned if the string value cannot successfully be parsed as a bool.

func GetDurationFromEnvVar

func GetDurationFromEnvVar(
	name string,
	defaultValue time.Duration,
) (time.Duration, error)

GetDurationFromEnvVar attempts to parse a time.Duration from a string value retrieved from the specified environment variable. An error is returned if the string value cannot successfully be parsed as a time.Duration.

func GetEnvVar

func GetEnvVar(name, defaultValue string) string

GetEnvVar retrieves the value of an environment variable having the specified name. If that value is the empty string, a specified default is returned instead.

func GetIntFromEnvVar

func GetIntFromEnvVar(name string, defaultValue int) (int, error)

GetIntFromEnvVar attempts to parse an integer from a string value retrieved from the specified environment variable. An error is returned if the string value cannot successfully be parsed as an integer.

func GetRequiredEnvVar

func GetRequiredEnvVar(name string) (string, error)

GetRequiredEnvVar retrieves the value of an environment variable having the specified name. If that value is the empty string, an error is returned.

func GetStringSliceFromEnvVar

func GetStringSliceFromEnvVar(name string, defaultValue []string) []string

GetStringSliceFromEnvVar retrieves comma-delimited values from an environment variable having the specified name and populates a string slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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