Documentation ¶
Index ¶
- func Command(src string) (string, []string, error)
- func CommandWithEnv(src string) (string, []string, error)
- func CommandWithMap(src string, vars map[string]string) (string, []string, error)
- func ParseVarsFile(file string) (map[string]string, error)
- func ParseVarsFileWithEnv(file string) (map[string]string, error)
- func ParseVarsFileWithMap(file string, extraEnv map[string]string) (map[string]string, error)
- func StringToMap(src string) (map[string]string, error)
- func StringToMapWithMap(src string, vars map[string]string) (map[string]string, error)
- func StringToSlice(src string) ([]string, error)
- func StringToSliceWithEnv(src string) ([]string, error)
- func StringToSliceWithMap(input string, vars map[string]string) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Command ¶
Command parses string into binary and arguments and removes unnecessary escape runes.
func CommandWithMap ¶ added in v1.0.3
CommandWithMap same as Command, but additionally performs replacement of ${VAR} with provided k/v map.
func ParseVarsFile ¶
ParseVarsFile is helper for parsing dotenv compatible files. If file path is prepended with '-' char, file read error will not be raised
func ParseVarsFileWithEnv ¶ added in v1.0.3
func ParseVarsFileWithMap ¶ added in v1.0.3
ParseVarsFileWithMap same as ParseVarsFile, but additionally performs replacement of ${VAR} with provided k/v map. If file path is prepended with '-' char, file read error will not be raised
func StringToMap ¶
StringToMap parses key value pairs into map. Handles multiline strings and comments.
func StringToMapWithMap ¶ added in v1.0.3
StringToMapWithMap the same as StringToMap, but additionally performs replacement of ${VAR} with provided k/v map.
func StringToSlice ¶
StringToSlice parses string into slice.
func StringToSliceWithEnv ¶ added in v1.0.3
StringToSliceWithEnv same as StringToSlice, but expand current environment variables in string.
Types ¶
This section is empty.