xdgbase

package
v0.0.0-...-841f565 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DataSuffix is a single base directory relative to which user-specific data files should be written.
	// This directory is defined by the environment variable $XDG_DATA_HOME.
	DataSuffix = Suffix("DATA_HOME")

	// ConfigSuffix is a single base directory relative to which user-specific configuration files should be written.
	// This directory is defined by the environment variable $XDG_CONFIG_HOME.
	ConfigSuffix = Suffix("CONFIG_HOME")

	// CacheSuffix is a single base directory relative to which user-specific non-essential (cached) data should be written.
	// This directory is defined by the environment variable $XDG_CACHE_HOME.
	CacheSuffix = Suffix("CACHE_HOME")
)

Variables

This section is empty.

Functions

func Dir

func Dir(vendor string, suffix Suffix) (string, error)

Dir attempts to resolve and respect the XDG Base Directory Specification https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html The resolution to a specific suffix is based on environmental preference

  1. VENDOR_SUFFIX (ARK_CACHE_HOME)
  2. XDG_SUFFIX (XDG_CACHE_HOME)
  3. DEFAULT ($HOME/.cache/ark)

Types

type Suffix

type Suffix string

Suffix should be one of the predefined suffixes in this package

DataSuffix
ConfigSuffix
CacheSuffix

Jump to

Keyboard shortcuts

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