Documentation
¶
Index ¶
- Constants
- func GetXDGCacheDir(subpath string, perm os.FileMode) (string, error)
- func GetXDGConfigDir(subpath string, perm os.FileMode) (string, error)
- func GetXDGDataDir(subpath string, perm os.FileMode) (string, error)
- func LookupCacheHomeBase() (value, source string)
- func LookupXDGCacheDir(subpath string) string
- func LookupXDGConfigDir(subpath string) string
Constants ¶
const ( // EnvXDGCacheHome is the standard XDG cache base directory variable. EnvXDGCacheHome = "XDG_CACHE_HOME" // EnvAtmosXDGCacheHome is the Atmos-specific cache base override. EnvAtmosXDGCacheHome = "ATMOS_XDG_CACHE_HOME" // EnvXDGDataHome is the standard XDG data base directory variable. EnvXDGDataHome = "XDG_DATA_HOME" // EnvAtmosXDGDataHome is the Atmos-specific data base override. EnvAtmosXDGDataHome = "ATMOS_XDG_DATA_HOME" // EnvXDGConfigHome is the standard XDG config base directory variable. EnvXDGConfigHome = "XDG_CONFIG_HOME" // EnvAtmosXDGConfigHome is the Atmos-specific config base override. EnvAtmosXDGConfigHome = "ATMOS_XDG_CONFIG_HOME" )
Environment variable names for the XDG base directories. Each standard XDG variable has an Atmos-specific override that takes precedence over it.
const DefaultCacheDirPerm = 0o755
DefaultCacheDirPerm is the default permission for cache directories.
Variables ¶
This section is empty.
Functions ¶
func GetXDGCacheDir ¶
GetXDGCacheDir returns the Atmos cache directory following XDG Base Directory Specification. It respects ATMOS_XDG_CACHE_HOME and XDG_CACHE_HOME environment variables. The directory is created if it doesn't exist.
func GetXDGConfigDir ¶
GetXDGConfigDir returns the Atmos config directory following XDG Base Directory Specification. It respects ATMOS_XDG_CONFIG_HOME and XDG_CONFIG_HOME environment variables. The directory is created if it doesn't exist.
func GetXDGDataDir ¶
GetXDGDataDir returns the Atmos data directory following XDG Base Directory Specification. It respects ATMOS_XDG_DATA_HOME and XDG_DATA_HOME environment variables. The directory is created if it doesn't exist.
func LookupCacheHomeBase ¶ added in v1.222.0
func LookupCacheHomeBase() (value, source string)
LookupCacheHomeBase returns the cache base directory configured via the environment, plus the name of the variable that supplied it (ATMOS_XDG_CACHE_HOME wins over XDG_CACHE_HOME). Both values are empty when neither variable is set, meaning the platform default applies. Use this for safety checks that need to report which variable configured the base.
func LookupXDGCacheDir ¶ added in v1.222.0
LookupXDGCacheDir resolves the Atmos cache directory path without creating it. Use this for read-only checks where directory creation is not desired.
func LookupXDGConfigDir ¶ added in v1.206.1
LookupXDGConfigDir resolves the Atmos config directory path without creating it. Use this for read-only checks where directory creation is not desired.
Types ¶
This section is empty.