Documentation ¶
Index ¶
- func ChangeDoubleBackSlash(path, changeSeparator string) string
- func ChangeDoubleForwardSlash(path, changeSeparator string) string
- func ChangeSeparator(path, currentSeparator, changeSeparator string) string
- func CreateDirectory(path string, fileMode os.FileMode) *pathhelpercore.DirectoryResult
- func CreateDirectoryAll(path string, fileMode os.FileMode) *pathhelpercore.DirectoryResult
- func GetAbsoluteFromExecutableDirectoryPath(relativePath string, isNormalize bool) string
- func GetAbsolutePath(basePath, relativePath string, isNormalize bool) string
- func GetCombinePathFromGoPath(pathConfig *pathhelpercore.PathConfig, givenPaths ...string) string
- func GetCombinedOfNonEmptyPaths(separator string, paths []string) string
- func GetCombinedPath(separator string, isIgnoreEmptyPath bool, isNormalize bool, paths ...string) string
- func GetCombinedPathUsingConfig(pathConfig *pathhelpercore.PathConfig, paths ...string) string
- func GetCompiledPath(pathTemplate string, compilingMap *map[string]string) string
- func GetExecutableDirectory() string
- func GetExecutablePath() string
- func GetFileInfoWrapper(path string) *pathhelpercore.FileInfoWrapper
- func GetPathAsUri(path string, isNormalizePath bool) string
- func GetPathFromUri(path string, isNormalizePath bool) string
- func GetRelativePath(fullPath, basePath string) string
- func GetSlug(path, separatorOfChoice string) string
- func GetTempDirectory() string
- func GetVariables(stringToCheck string) []string
- func GoBin() string
- func GoPath() string
- func IsDirectoryPath(path string) bool
- func IsFilePath(path string) bool
- func IsGoModuleOn() bool
- func IsPathExist(path string) bool
- func IsPathNotExist(path string) bool
- func IsSlug(path string) bool
- func IsUnix() bool
- func IsUnixCase(os enums.OperatingSystem) bool
- func IsWindows() bool
- func IsWindowsCase(os enums.OperatingSystem) bool
- func NormalizePath(givenPath string) string
- func NormalizePathUsingSeparator(pathSeparator, givenPath string) string
- func NormalizePathUsingSeparatorIf(isNormalize bool, pathSeparator, givenPath string) string
- func PathFromEnvVariable(stringToCheck string) string
- func RemoveAndFixDoubleSeparatorToFinalSeparator(finalSeparator, path string) string
- func RemoveAndFixDoubleSeparatorToOsSeparator(path string) string
- func RemoveDoubleUriSeparator(path, separator string) string
- func RemoveFromPath(pathTemplate string, removingList *[]string, isNormalizePath bool) string
- func RemovingDoubleBackSlash(path string) string
- func RemovingDoubleSlash(path string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangeDoubleBackSlash ¶
func ChangeSeparator ¶
func CreateDirectory ¶
func CreateDirectory(path string, fileMode os.FileMode) *pathhelpercore.DirectoryResult
Create directory and create the final directory
func CreateDirectoryAll ¶
func CreateDirectoryAll(path string, fileMode os.FileMode) *pathhelpercore.DirectoryResult
Create all sub-directories and create the final directory
func GetAbsolutePath ¶
func GetCombinePathFromGoPath ¶
func GetCombinePathFromGoPath(pathConfig *pathhelpercore.PathConfig, givenPaths ...string) string
By defaultPathConfig: Separator = os.PathSeparator IsNormalize = true IsIgnoreEmptyPath = false
func GetCombinedPath ¶
func GetCombinedPath(separator string, isIgnoreEmptyPath bool, isNormalize bool, paths ...string) string
@isIgnoreEmptyPath if true then ignore empty string (nil, "", or any empty spaces " ")
func GetCombinedPathUsingConfig ¶
func GetCombinedPathUsingConfig(pathConfig *pathhelpercore.PathConfig, paths ...string) string
if pathConfig is nil then pathConfig gets created pathhelpercore.NewDefaultPathConfig() By NewDefaultPathConfig: Separator = os.PathSeparator IsNormalize = true IsIgnoreEmptyPath = false
func GetCompiledPath ¶
func GetExecutableDirectory ¶
func GetExecutableDirectory() string
Represents the directory where the application is running from.
func GetExecutablePath ¶
func GetExecutablePath() string
Represents the exact path to the executable file
func GetFileInfoWrapper ¶
func GetFileInfoWrapper(path string) *pathhelpercore.FileInfoWrapper
func GetPathAsUri ¶
func GetPathFromUri ¶
GetPathFromUri function takes a path (string) and a bool input and returns a string after removing Uri prefixes (file:///, file://). If bool is set to true any double separator is also removed from returned string
func GetRelativePath ¶
func GetTempDirectory ¶
func GetTempDirectory() string
func GetVariables ¶
getVariables function takes a string input and identifies every word that begins with "$" in that input string then returns an array of those words. If input has no word starting with "$" then returns nil.
func GoPath ¶
func GoPath() string
Reference: https://stackoverflow.com/a/32650077 Returns env go path : os.Getenv(constants.GoPath) or build.Default.GOPATH
func IsDirectoryPath ¶
Slow performance used os.FileInfo, TODO: improve performance in future
func IsFilePath ¶
func IsPathExist ¶
func IsPathNotExist ¶
func IsWindowsCase ¶
func IsWindowsCase(os enums.OperatingSystem) bool
func NormalizePath ¶
func PathFromEnvVariable ¶
PathFromEnvVariable 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.
func RemoveAndFixDoubleSeparatorToFinalSeparator ¶
Replace both double slashes to single slash (// -> /, \\ -> \) and finally all slashes to finalSeparator
func RemoveAndFixDoubleSeparatorToOsSeparator ¶
Replace both double slashes to single slash (// -> /, \\ -> \) and finally all slashes to os.Separator
func RemoveFromPath ¶
Given removingList array items will be replaced with "" empty string. If pathTemplate is given as empty string or nil or whitespace then returns as is.
func RemovingDoubleBackSlash ¶
func RemovingDoubleSlash ¶
Types ¶
This section is empty.
Source Files ¶
- ChangeDoubleBackSlash.go
- ChangeDoubleForwardSlash.go
- ChangeSeparator.go
- CreateDirectory.go
- CreateDirectoryAll.go
- GetAbsoluteFromExecutableDirectoryPath.go
- GetAbsolutePath.go
- GetCombinePathFromGoPath.go
- GetCombinedOfNonEmptyPaths.go
- GetCombinedPath.go
- GetCombinedPathUsingConfig.go
- GetCompiledPath.go
- GetExecutableDirectory.go
- GetExecutablePath.go
- GetFileInfoWrapper.go
- GetPathAsUri.go
- GetPathFromUri.go
- GetRelativePath.go
- GetSlug.go
- GetTempDirectory.go
- GetVariables.go
- GoBin.go
- GoPath.go
- HasPathIssues.go
- IsDirectoryPath.go
- IsFilePath.go
- IsGoModuleOn.go
- IsPathExist.go
- IsPathNotExist.go
- IsSlug.go
- IsUnix.go
- IsUnixCase.go
- IsWindows.go
- IsWindowsCase.go
- NormalizePath.go
- NormalizePathUsingSeparator.go
- NormalizePathUsingSeparatorIf.go
- PathFromEnvVariable.go
- RemoveAndFixDoubleSeparatorToFinalSeparator.go
- RemoveAndFixDoubleSeparatorToOsSeparator.go
- RemoveDoubleUriSeparator.go
- RemoveFromPath.go
- RemovingDoubleBackSlash.go
- RemovingDoubleSlash.go
- expandEnvironmentVariable.go
- getCombinedPathUsingConfigInternal.go
- isLetter.go
- isNumber.go
- whichPrefix.go