Documentation
¶
Overview ¶
Packege environment implements setting up and handling environment variables.
Any varible implementing the Formatter interface can be set as value to Map.
Example usage:
envMap := environment.Map{
"OS": environemnt.String("linux"),
"GOLANG": environment.True,
"CORES": environment.Int(6),
}
env := envMap.IntoEnv()
// converted to environment.Env the result is
// env = {}string{"OS=linux", "GOLANG", "CORES=6"}
// alternatively the Map above could be created like so:
envMap := make(environment.Map)
envMap.Set("OS", "linux")
envMap.Use("GOLANG")
envMap.SetInt("CORES", 6)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
Env is a struct representing a set of environment values.
type Formatter ¶
type Formatter interface {
// FormatEnv will return with the string representation of an environment
// variable given a specific key.
FormatEnv(key string) string
}
Formatter is the value type for Map.
var True Formatter = trueVal{}
True represents that the environemnt variable is set.
Click to show internal directories.
Click to hide internal directories.