global

package
v0.5.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package global manages the shared folders feature

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAndGet

func CreateAndGet(tag string) string

CreateAndGet creates a new shared folder and returns the path to it

func CreateFile

func CreateFile(path string, tag string) (string, error)

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

func CreateFolder(path string) error

CreateFolder creates a new folder at the given path

func CreateTaggedFolder

func CreateTaggedFolder(tag string) error

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

func GetLastPathPart(path string) string

GetLastPathPart get last part of a path. Example: /home/user/Downloads -> Downloads

func GetPathBeforeLastPart

func GetPathBeforeLastPart(path string) string

GetPathBeforeLastPart gets everything before the last part of a path. Example: /home/user/Downloads -> /home/user

func GetTaggedFolder

func GetTaggedFolder(tag string) string

GetTaggedFolder returns the path to a shared folder at $XDG_DATA_HOME/develbox/shared/<name>

func HashPath

func HashPath(path string) string

HashPath returns a hash of a path and mantains the "/" at the end of the path if it exists.

func HashPathAndCreate

func HashPathAndCreate(path string, tag string) (string, error)

HashPathAndCreate is wrapper around HashPath that creates the folder if it doesn't exist inside the shared folder

func IsFolder

func IsFolder(path string) bool

IsFolder checks if a path is a folder or a file.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL