Documentation
¶
Index ¶
- Constants
- Variables
- func AllConfigDirs() []string
- func AllDataDirs() []string
- func CacheHome() string
- func ConfigDirs() []string
- func ConfigHome() string
- func DataDirs() []string
- func DataHome() string
- func FindCacheFile(rel ...string) (string, error)
- func FindConfigFile(rel ...string) (string, error)
- func FindDataFile(rel ...string) (string, error)
- func FindRuntimeFile(rel ...string) (string, error)
- func RuntimeDir() string
Constants ¶
const ( // ConfigHomeEnv is the name of the environment variable holding a user configuration directory path. ConfigHomeEnv = "XDG_CONFIG_HOME" // ConfigDirsEnv is the name of the environment variable holding system configuration directory paths. ConfigDirsEnv = "XDG_CONFIG_DIRS" )
const ( // DataHomeEnv is the name of the environment variable holding a user data directory path. DataHomeEnv = "XDG_DATA_HOME" // DataDirsEnv is the name of the environment variable holding system data directory paths. DataDirsEnv = "XDG_DATA_DIRS" )
const (
// CacheHomeEnv is the name of the environment variable holding a cache directory path.
CacheHomeEnv = "XDG_CACHE_HOME"
)
const (
// RuntimeDirEnv is the name of the environment variable holding a runtime directory path.
RuntimeDirEnv = "XDG_RUNTIME_DIR"
)
Variables ¶
var ErrNotFound = errors.New("not found")
ErrNotFound indicates that a file cannot be found in any directory.
Functions ¶
func AllConfigDirs ¶
func AllConfigDirs() []string
AllConfigDirs returns all XDG configuration directories.
func ConfigDirs ¶
func ConfigDirs() []string
ConfigDirs returns system XDG configuration directories (XDG_CONFIG_DIRS).
func ConfigHome ¶
func ConfigHome() string
ConfigHome returns a user XDG configuration directory (XDG_CONFIG_HOME).
func DataDirs ¶
func DataDirs() []string
DataDirs returns system XDG data directories (XDG_DATA_DIRS).
func FindCacheFile ¶
FindCacheFile finds a file from the XDG data directory. If one cannot be found, an error `ErrNotFound` be returned.
func FindConfigFile ¶
FindConfigFile finds a file from the XDG configuration directory. If one cannot be found, an error `ErrNotFound` be returned.
func FindDataFile ¶
FindDataFile finds a file from the XDG data directory. If one cannot be found, an error `ErrNotFound` be returned.
func FindRuntimeFile ¶
FindRuntimeFile finds a file from the XDG runtime directory. If one cannot be found, an error `ErrNotFound` be returned.
Types ¶
This section is empty.