Documentation
¶
Index ¶
- func GetEnvBool(variableName string, defaultValue bool) bool
- func GetEnvBoolWithWarning(variableName string, defaultValue bool) (val bool, warning bool)
- func GetEnvFloat32(variableName string, defaultValue float32) float32
- func GetEnvFloat32WithWarning(variableName string, defaultValue float32) (val float32, warning bool)
- func GetEnvFloat64(variableName string, defaultValue float64) float64
- func GetEnvFloat64WithWarning(variableName string, defaultValue float64) (val float64, warning bool)
- func GetEnvInt(variableName string, defaultValue int) int
- func GetEnvInt8(variableName string, defaultValue int8) int8
- func GetEnvInt8WithWarning(variableName string, defaultValue int8) (val int8, warning bool)
- func GetEnvInt16(variableName string, defaultValue int16) int16
- func GetEnvInt16WithWarning(variableName string, defaultValue int16) (val int16, warning bool)
- func GetEnvInt32(variableName string, defaultValue int32) int32
- func GetEnvInt32WithWarning(variableName string, defaultValue int32) (val int32, warning bool)
- func GetEnvInt64(variableName string, defaultValue int64) int64
- func GetEnvInt64WithWarning(variableName string, defaultValue int64) (val int64, warning bool)
- func GetEnvIntWithWarning(variableName string, defaultValue int) (val int, warning bool)
- func GetEnvString(variableName string, defaultValue string) string
- func GetEnvStringNonEmpty(variableName string, defaultValue string) string
- func GetEnvUint(variableName string, defaultValue uint) uint
- func GetEnvUint8(variableName string, defaultValue uint8) uint8
- func GetEnvUint8WithWarning(variableName string, defaultValue uint8) (val uint8, warning bool)
- func GetEnvUint16(variableName string, defaultValue uint16) uint16
- func GetEnvUint16WithWarning(variableName string, defaultValue uint16) (val uint16, warning bool)
- func GetEnvUint32(variableName string, defaultValue uint32) uint32
- func GetEnvUint32WithWarning(variableName string, defaultValue uint32) (val uint32, warning bool)
- func GetEnvUint64(variableName string, defaultValue uint64) uint64
- func GetEnvUint64WithWarning(variableName string, defaultValue uint64) (val uint64, warning bool)
- func GetEnvUintWithWarning(variableName string, defaultValue uint) (val uint, warning bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEnvBool ¶
Gets environment variable as boolean.
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
The value for the variable must be (case insensitive):
- "TRUE" or "YES" to be true
- "FALSE" or "NO" to be false
Returns the parsed value of the variable. If empty, or the value does not match the format, the default value will be returned.
func GetEnvBoolWithWarning ¶
Gets environment variable as boolean. Also gets a warning flag if the value is invalid
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
The value for the variable must be (case insensitive):
- "TRUE" or "YES" to be true
- "FALSE" or "NO" to be false
Returns
- val - The parsed value or the default value (if empty or cannot be parsed)
- warning - True only if the value is set, but has invalid format
func GetEnvFloat32 ¶
Gets environment variable as float (float32).
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns the parsed value of the variable. If empty, or the value cannot be parsed, the default value will be returned
func GetEnvFloat32WithWarning ¶
func GetEnvFloat32WithWarning(variableName string, defaultValue float32) (val float32, warning bool)
Gets environment variable as float (float32). Also gets a warning flag if the value is invalid
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns
- val - The parsed value or the default value (if empty or cannot be parsed)
- warning - True only if the value is set, but has invalid format
func GetEnvFloat64 ¶
Gets environment variable as float (float64).
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns the parsed value of the variable. If empty, or the value cannot be parsed, the default value will be returned
func GetEnvFloat64WithWarning ¶
func GetEnvFloat64WithWarning(variableName string, defaultValue float64) (val float64, warning bool)
Gets environment variable as float (float64). Also gets a warning flag if the value is invalid
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns
- val - The parsed value or the default value (if empty or cannot be parsed)
- warning - True only if the value is set, but has invalid format
func GetEnvInt ¶
Gets environment variable as integer.
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns the parsed value of the variable. If empty, or the value cannot be parsed, the default value will be returned
func GetEnvInt8 ¶
Gets environment variable as integer (int8).
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns the parsed value of the variable. If empty, or the value cannot be parsed, the default value will be returned
func GetEnvInt8WithWarning ¶
Gets environment variable as integer (int8). Also gets a warning flag if the value is invalid
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns
- val - The parsed value or the default value (if empty or cannot be parsed)
- warning - True only if the value is set, but has invalid format
func GetEnvInt16 ¶
Gets environment variable as integer (int16).
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns the parsed value of the variable. If empty, or the value cannot be parsed, the default value will be returned
func GetEnvInt16WithWarning ¶
Gets environment variable as integer (int16). Also gets a warning flag if the value is invalid
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns
- val - The parsed value or the default value (if empty or cannot be parsed)
- warning - True only if the value is set, but has invalid format
func GetEnvInt32 ¶
Gets environment variable as integer (int32).
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns the parsed value of the variable. If empty, or the value cannot be parsed, the default value will be returned
func GetEnvInt32WithWarning ¶
Gets environment variable as integer (int32). Also gets a warning flag if the value is invalid
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns
- val - The parsed value or the default value (if empty or cannot be parsed)
- warning - True only if the value is set, but has invalid format
func GetEnvInt64 ¶
Gets environment variable as integer (int64).
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns the parsed value of the variable. If empty, or the value cannot be parsed, the default value will be returned
func GetEnvInt64WithWarning ¶
Gets environment variable as integer (int64). Also gets a warning flag if the value is invalid
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns
- val - The parsed value or the default value (if empty or cannot be parsed)
- warning - True only if the value is set, but has invalid format
func GetEnvIntWithWarning ¶
Gets environment variable as integer. Also gets a warning flag if the value is invalid
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns
- val - The parsed value or the default value (if empty or cannot be parsed)
- warning - True only if the value is set, but has invalid format
func GetEnvString ¶
Gets environment variable as string.
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns the value of the variable. If the variable is not set, the default value will be returned.
func GetEnvStringNonEmpty ¶
Gets environment variable as string. If the variable is set, but empty, the default value is returned.
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns the value of the variable. If the variable is not set, or it is empty, the default value will be returned.
func GetEnvUint ¶
Gets environment variable as unsigned integer.
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns the parsed value of the variable. If empty, or the value cannot be parsed, the default value will be returned
func GetEnvUint8 ¶
Gets environment variable as unsigned integer (uint8).
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns the parsed value of the variable. If empty, or the value cannot be parsed, the default value will be returned
func GetEnvUint8WithWarning ¶
Gets environment variable as unsigned integer (uint8). Also gets a warning flag if the value is invalid
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns
- val - The parsed value or the default value (if empty or cannot be parsed)
- warning - True only if the value is set, but has invalid format
func GetEnvUint16 ¶
Gets environment variable as unsigned integer (uint16).
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns the parsed value of the variable. If empty, or the value cannot be parsed, the default value will be returned
func GetEnvUint16WithWarning ¶
Gets environment variable as unsigned integer (uint16). Also gets a warning flag if the value is invalid
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns
- val - The parsed value or the default value (if empty or cannot be parsed)
- warning - True only if the value is set, but has invalid format
func GetEnvUint32 ¶
Gets environment variable as unsigned integer (uint32).
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns the parsed value of the variable. If empty, or the value cannot be parsed, the default value will be returned
func GetEnvUint32WithWarning ¶
Gets environment variable as unsigned integer (uint32). Also gets a warning flag if the value is invalid
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns
- val - The parsed value or the default value (if empty or cannot be parsed)
- warning - True only if the value is set, but has invalid format
func GetEnvUint64 ¶
Gets environment variable as unsigned integer (uint64).
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns the parsed value of the variable. If empty, or the value cannot be parsed, the default value will be returned
func GetEnvUint64WithWarning ¶
Gets environment variable as unsigned integer (uint64). Also gets a warning flag if the value is invalid
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns
- val - The parsed value or the default value (if empty or cannot be parsed)
- warning - True only if the value is set, but has invalid format
func GetEnvUintWithWarning ¶
Gets environment variable as integer. Also gets a warning flag if the value is invalid
Parameters
- variableName: Name of the environment variable
- defaultValue: Default value
Returns
- val - The parsed value or the default value (if empty or cannot be parsed)
- warning - True only if the value is set, but has invalid format
Types ¶
This section is empty.