Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EnvVariables = make(map[string]*EnvVariable)
EnvVariables is where environment variables are stored.
Functions ¶
Types ¶
type EnvVariable ¶
EnvVariable contains information about the environment variable, such as key, value, and default value.
func Key ¶
func Key(key string) *EnvVariable
Key is used to determine the path of the environment variable to be accessed.
genv.Key("env-key").String()
func (*EnvVariable) Bool ¶
func (e *EnvVariable) Bool() bool
Bool method is used for environment variables of type bool.
genv.Key("env-key").Bool()
func (*EnvVariable) Default ¶
func (e *EnvVariable) Default(defaultValue interface{}) *EnvVariable
Default is used to specify the default value for the environment variable to be accessed.
genv.Key("env-key").Default("defaultValue").String()
func (*EnvVariable) Float ¶
func (e *EnvVariable) Float() float64
Float method is used for environment variables of type float.
genv.Key("env-key").Float()
func (*EnvVariable) Int ¶
func (e *EnvVariable) Int() int
Int method is used for environment variables of type int.
genv.Key("env-key").Int()
func (*EnvVariable) String ¶
func (e *EnvVariable) String() string
String method is used for environment variables of type string.
genv.Key("env-key").String()
func (*EnvVariable) Update ¶
func (e *EnvVariable) Update(value interface{})
Update is used to update the value of the corresponding environment variable.
genv.Key("env-key").Update("updatedValue")
Click to show internal directories.
Click to hide internal directories.