Documentation
¶
Index ¶
- func ArrFromFile(name string) ([]string, error)
- func ArrFromReader(r io.Reader) ([]string, error)
- func ArrToMap(a []string) map[string]string
- func MapFromFile(name string) (map[string]string, error)
- func MapFromReader(r io.Reader) (map[string]string, error)
- func MapToArr(m map[string]string) []string
- func PathFromFile(name string) (string, error)
- func PathFromReader(r io.Reader) (string, error)
- func ToMap(ss ...string) map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrFromFile ¶
ArrFromFile takes a path to a file with the content of a .env file e.g.
FOO=bar KEY=val
and returns a corresponding environment array
["FOO=bar", "KEY=val"].
func ArrFromReader ¶
ArrFromReader takes a Reader with the content of a .env file e.g.
FOO=bar KEY=val
and returns a corresponding environment array
["FOO=bar", "KEY=val"].
func ArrToMap ¶
ArrToMap takes an environment array of the form
["KEY1=val1", "KEY2=val2"]
and returns a corresponding map of the form
{
"KEY1": "val1",
"KEY2": "val2"
}
func MapFromFile ¶
MapFromFile takes a path to a file with the content of a .env file e.g.
FOO=bar KEY=val
and returns a corresponding map
{
"FOO": "bar",
"KEY": "val"
}
func MapFromReader ¶
MapFromReader takes a Reader with the content of a .env file e.g.
FOO=bar KEY=val
and returns a corresponding map
{
"FOO": "bar",
"KEY": "val"
}
func MapToArr ¶
MapToArr takes an map of the form
{
"KEY1": "val1",
"KEY2": "val2"
}
and returns a corresponding array of the form
["KEY1=val1", "KEY2=val2"].
func PathFromFile ¶
PathFromReader takes a path to a file with newline-delimited directory paths e.g.
/usr/local/bin /usr/bin
and returns a corresponding PATH environment variable
/usr/local/bin:/usr/bin.
func PathFromReader ¶
PathFromReader takes a Reader with newline-delimited directory paths e.g.
/usr/local/bin /usr/bin
and returns a corresponding PATH environment variable
/usr/local/bin:/usr/bin.
Types ¶
This section is empty.