xdg

package
v1.223.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
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.

View Source
const DefaultCacheDirPerm = 0o755

DefaultCacheDirPerm is the default permission for cache directories.

Variables

This section is empty.

Functions

func GetXDGCacheDir

func GetXDGCacheDir(subpath string, perm os.FileMode) (string, error)

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

func GetXDGConfigDir(subpath string, perm os.FileMode) (string, error)

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

func GetXDGDataDir(subpath string, perm os.FileMode) (string, error)

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

func LookupXDGCacheDir(subpath string) string

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

func LookupXDGConfigDir(subpath string) string

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.

Jump to

Keyboard shortcuts

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