Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCacheDir ¶ added in v1.24.0
func GetCacheDir() string
GetCacheDir returns the user's cache directory for cagent.
If an override has been set via SetCacheDir it is returned instead.
On Linux this follows XDG: $XDG_CACHE_HOME/cagent (default ~/.cache/cagent). On macOS this uses ~/Library/Caches/cagent. On Windows this uses %LocalAppData%/cagent.
If the cache directory cannot be determined, it falls back to a directory under the system temporary directory.
func GetConfigDir ¶
func GetConfigDir() string
GetConfigDir returns the user's config directory for cagent.
If an override has been set via SetConfigDir it is returned instead.
If the home directory cannot be determined, it falls back to a directory under the system temporary directory. This is a best-effort fallback and not intended to be a security boundary.
func GetDataDir ¶
func GetDataDir() string
GetDataDir returns the user's data directory for cagent (caches, content, logs).
If an override has been set via SetDataDir it is returned instead.
If the home directory cannot be determined, it falls back to a directory under the system temporary directory.
func GetHomeDir ¶ added in v1.8.2
func GetHomeDir() string
GetHomeDir returns the user's home directory.
Returns an empty string if the home directory cannot be determined.
func SetCacheDir ¶ added in v1.29.0
func SetCacheDir(dir string)
SetCacheDir overrides the default cache directory returned by GetCacheDir. An empty value restores the default behaviour. This should be called early (e.g. during CLI flag processing) before any goroutine calls the corresponding getter.
func SetConfigDir ¶ added in v1.29.0
func SetConfigDir(dir string)
SetConfigDir overrides the default config directory returned by GetConfigDir. An empty value restores the default behaviour.
func SetDataDir ¶ added in v1.29.0
func SetDataDir(dir string)
SetDataDir overrides the default data directory returned by GetDataDir. An empty value restores the default behaviour.
Types ¶
This section is empty.