Documentation
¶
Overview ¶
Package xdgbase is an implementation of the XDG Basedir Specification version 0.8, as published at https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.8.html .
This package has no checks for the host operating system, so it can in principle function on any operating system but in practice XDG conventions are followed only on some Unix-like systems, so using this library elsewhere would not be very useful and will produce undefined results.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheHome ¶
func CacheHome() string
CacheHome returns the value of XDG_CACHE_HOME, or the specification-defined fallback value of $HOME/.cache.
func ConfigDirs ¶
func ConfigDirs() []string
ConfigDirs returns the combination of ConfigHome and OtherConfigDirs, giving the full set of config directories to search, in preference order.
func ConfigHome ¶
func ConfigHome() string
ConfigHome returns the value of XDG_CONFIG_HOME, or the specification-defined fallback value of $HOME/.config.
func DataDirs ¶
func DataDirs() []string
DataDirs returns the combination of DataHome and OtherDataDirs, giving the full set of data directories to search, in preference order.
func DataHome ¶
func DataHome() string
DataHome returns the value of XDG_DATA_HOME, or the specification-defined fallback value of $HOME/.local/share.
func MaybeRuntimeDir ¶
func MaybeRuntimeDir() string
MaybeRuntimeDir returns the value of XDG_RUNTIME_DIR, or an empty string if it is not set.
Calling applications MUST check that the return value is non-empty before using it, because there is no reasonable default behavior when no runtime directory is defined.
func OtherConfigDirs ¶
func OtherConfigDirs() []string
OtherConfigDirs returns the values from XDG_CONFIG_DIRS, or the specification-defined fallback value "/etc/xdg".
func OtherDataDirs ¶
func OtherDataDirs() []string
OtherDataDirs returns the values from XDG_DATA_DIRS, or the specification-defined fallback values "/usr/local/share/" and "/usr/share/".
Types ¶
This section is empty.