Documentation ¶
Index ¶
- Variables
- func ExpandEnvironmentVariable(envInfos *[]EnvKeyInfo) *map[string]string
- func ExpandVariables(pathContainsEnvVariables string) string
- func ExpandVariablesIf(isExpand bool, pathContainsEnvVariables string) string
- func GetCompiledPath(pathTemplate string, compilingMap map[string]string) string
- func GetEnvironmentVariables(pathContainsEnvVarStartingDollarSymbol string) []string
- func Home(path string) (string, *errorwrapper.Wrapper)
- type EnvKeyInfo
Constants ¶
This section is empty.
Variables ¶
var DisableCache bool
TODO refactor later DisableCache will disable caching of the homeCaps directory. Caching is enabled by default.
Functions ¶
func ExpandEnvironmentVariable ¶ added in v0.2.6
func ExpandEnvironmentVariable(envInfos *[]EnvKeyInfo) *map[string]string
ExpandEnvironmentVariable function takes an array of environment variables (string) as input and outputs a map of expanded path of those variables if the paths exist.
func ExpandVariables ¶ added in v0.2.5
ExpandVariables
function takes a string input and replaces any word that starts with "$" in the input with its expanded path (if exists) and returns the new string.
Acceptable Env paths: ${Java_home} $java_home %{java_home} %java_home all will be expand e
func ExpandVariablesIf ¶ added in v0.2.5
ExpandVariablesIf
Acceptable Env paths: ${Java_home} $java_home %{java_home} %java_home all will be expand e
func GetCompiledPath ¶ added in v0.2.4
func GetEnvironmentVariables ¶
getVariables function takes a string input and identifies every word that begins with "$" or every word within two "%" in that input string then returns an array of those words. If input is empty or has no such word then returns nil.
func Home ¶
func Home(path string) (string, *errorwrapper.Wrapper)
Home expands the path to include the homeCaps directory if the path is prefixed with `~`. If it isn't prefixed with `~`, the path is returned as-is. Reference : https://bit.ly/3rZbbKH
Types ¶
type EnvKeyInfo ¶ added in v0.2.4
type EnvKeyInfo struct { GivenAs, SimplifiedName string }
func GetDollarOrPercentSymbolIdentifierEnvInfos ¶ added in v0.2.6
func GetDollarOrPercentSymbolIdentifierEnvInfos( stringToCheck string, ) []EnvKeyInfo
func GetEnvInfosKeyNames ¶ added in v0.2.6
func GetEnvInfosKeyNames(slice []string) []EnvKeyInfo
GetEnvInfosKeyNames will be retrieved from slice strings
Key Names may be formatter like :
${identifier} or $identifier or %{identifier} or %identifier