Documentation ¶
Overview ¶
Package appdir provides helpers to compose filenames to be used by applications.
Index ¶
- Constants
- func AllConfigDir(sub ...string) []string
- func Join(base string, sub ...string) string
- func SetSysPrefix(dir string) error
- func SysCacheDir(sub ...string) (string, error)
- func SysConfigDir(sub ...string) (string, error)
- func SysDataDir(sub ...string) (string, error)
- func SysRuntimeDir(sub ...string) (string, error)
- func UserCacheDir(sub ...string) (string, error)
- func UserConfigDir(sub ...string) (string, error)
- func UserDataDir(sub ...string) (string, error)
- func UserRuntimeDir(sub ...string) (string, error)
Constants ¶
const ( // PrefixLocal represent services installed outside // the scope of the package manager PrefixLocal = "/usr/local" // PrefixSystem represent services installed by // the package manager PrefixSystem = "/" // PrefixOptional represent services installed outside // the scope of the package manager but require // a complex hierarchy, usually installed extracting // an archive file. PrefixOptional = "/opt" )
const PrefixUser = "~"
PrefixUser is the prefix used on SetSysPrefix to indicate SysFooDir() will return the same as UserFooDir()
Variables ¶
This section is empty.
Functions ¶
func AllConfigDir ¶
AllConfigDir returns a slice containing the application configuration path on the current working directory, user mode, and system mode.
func Join ¶
Join combines file path parts in a OS specific way. parts are allowed to be multipart themselves, using `/` as delimiter.
func SetSysPrefix ¶
SetSysPrefix specifies what filesystem prefix to use when generating SysFooDir() strings. Default is "~"
func SysCacheDir ¶
SysCacheDir returns where to store application cache, when run in system mode.
func SysConfigDir ¶
SysConfigDir returns where to store application configuration data, when run in system mode.
func SysDataDir ¶
SysDataDir returns where to store application persistent data, when run in system mode.
func SysRuntimeDir ¶
SysRuntimeDir returns where to store application run-time variable data, when run in system mode.
func UserCacheDir ¶
UserCacheDir returns where to store application cache when run in user mode. ${XDG_CACHE_HOME}/...
func UserConfigDir ¶
UserConfigDir returns where to store application configuration, when run in user mode. ${XDG_CONFIG_HOME}/...
func UserDataDir ¶
UserDataDir returns where to store application persistent data, when run in user mode. ${XDG_DATA_HOME}/...
func UserRuntimeDir ¶
UserRuntimeDir returns where to store application run-time variable data, when run in user mode. ${XDG_RUNTIME_DIR}/...
Types ¶
This section is empty.