Documentation ¶
Overview ¶
Package bootstrap contains utility functions to read environment variables, if a default is not provided and the value of an environment variable is not set then the application will panic.
Index ¶
- func GetBoolEnvVar(key string) bool
- func GetEnvVar(key string) string
- func GetIntEnvVar(key string) int
- func GetOptionalBoolEnvVar(key string, def bool) bool
- func GetOptionalEnvVar(key string, def string) string
- func GetOptionalFloatEnvVar(key string, def float64) float64
- func GetOptionalIntEnvVar(key string, def int) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBoolEnvVar ¶
GetBoolEnvVar reads an environment variable and returns the value as a bool, if the environment variable is not set then the application will panic.
func GetEnvVar ¶
GetEnvVar reads an environment variable and returns the value as a string, if the environment variable is not set then the application will panic.
func GetIntEnvVar ¶
GetIntEnvVar reads an environment variable and returns the value as an int, if the environment variable is not set then the application will panic.
func GetOptionalBoolEnvVar ¶
GetOptionalBoolEnvVar reads an environment variable and returns the value as a bool, or the default value if the environment variable is not set. If the environment variable is set but cannot be parsed as a bool then the application will panic.
func GetOptionalEnvVar ¶
GetOptionalEnvVar reads an environment variable and returns the value as a string, or the default value if the environment variable is not set.
func GetOptionalFloatEnvVar ¶
GetOptionalFloatEnvVar reads an environment variable and returns the value as a float64, if the environment variable is not set then the application will panic. If the environment variable is set but cannot be parsed as a float64 then the application will panic.
func GetOptionalIntEnvVar ¶
GetOptionalIntEnvVar reads an environment variable and returns the value as an int, or the default value if the environment variable is not set. If the environment variable is set but cannot be parsed as an int then the application will panic.
Types ¶
This section is empty.