Documentation
¶
Overview ¶
Package global contains global variables and functions
Package global contains global variables and functions
Index ¶
- func CreateAndGet(tag string) string
- func CreateFile(path string, tag string) (string, error)
- func CreateFolder(path string) error
- func CreateTaggedFolder(tag string) error
- func GetCacheHome() string
- func GetConfigHome() string
- func GetDataHome() string
- func GetLastPathPart(path string) string
- func GetPathBeforeLastPart(path string) string
- func GetTaggedFolder(tag string) string
- func HashPath(path string) string
- func HashPathAndCreate(path string, tag string) (string, error)
- func IsFolder(path string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAndGet ¶
CreateAndGet creates a new shared folder and returns the path to it
func CreateFile ¶
CreateFile adds the shared folder path to the beginning of the path and in case of a file, it creates the folder for the file.
func CreateFolder ¶
CreateFolder creates a new folder at the given path
func CreateTaggedFolder ¶
CreateTaggedFolder creates a new shared folder at $XDG_DATA_HOME/develbox/shared/<name>
func GetCacheHome ¶
func GetCacheHome() string
GetCacheHome gets XDG_CACHE_HOME, if not set, use ~/.cache and set it
func GetConfigHome ¶
func GetConfigHome() string
GetConfigHome gets XDG_CONFIG_HOME, if not set, use ~/.config and set it
func GetDataHome ¶
func GetDataHome() string
GetDataHome gets XDG_DATA_HOME, if not set, use ~/.local/share and set it
func GetLastPathPart ¶
GetLastPathPart get last part of a path. Example: /home/user/Downloads -> Downloads
func GetPathBeforeLastPart ¶
GetPathBeforeLastPart gets everything before the last part of a path. Example: /home/user/Downloads -> /home/user
func GetTaggedFolder ¶
GetTaggedFolder returns the path to a shared folder at $XDG_DATA_HOME/develbox/shared/<name>
func HashPath ¶
HashPath returns a hash of a path and mantains the "/" at the end of the path if it exists.
func HashPathAndCreate ¶
HashPathAndCreate is wrapper around HashPath that creates the folder if it doesn't exist inside the shared folder
Types ¶
This section is empty.