getenvs

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: MIT Imports: 2 Imported by: 14

README

getenvs

A small package for getting the environment values and also providing a default value which if the environment value hasn't been set the package returns the default value.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnvBool

func GetEnvBool(key string, defaultVal bool) (bool, error)

GetEnvBool gets the environment variable for a key and if that env-var hasn't been set it returns the default value

func GetEnvFloat

func GetEnvFloat(key string, defaultVal float64) (float64, error)

GetEnvFloat gets the environment variable for a key and if that env-var hasn't been set it returns the default value. This function uses bitSize of 64 to convert string to float64.

func GetEnvInt

func GetEnvInt(key string, defaultVal int) (int, error)

GetEnvInt gets the environment variable for a key and if that env-var hasn't been set it returns the default value. This function is equivalent to ParseInt(s, 10, 0) to convert env-vars to type int

func GetEnvString

func GetEnvString(key string, defaultVal string) string

GetEnvString gets the environment variable for a key and if that env-var hasn't been set it returns the default value

Types

This section is empty.

Jump to

Keyboard shortcuts

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