xdg

package
v0.0.0-...-7b48451 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package xdg provides functions for handling cross-platform configuration, data and state directories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cache

func Cache(name string) (string, error)

Cache returns the path to the named file found in the cache directory obtained from CacheHome. If no file is found Cache returns ENOENT.

func CacheHome

func CacheHome() (string, bool)

CacheHome returns the path corresponding to XDG_CACHE_HOME.

func Config

func Config(name string, local bool) (string, error)

Config returns the path to the named file found first in the list of config directories obtained from ConfigHome, and ConfigDirs if local is false. If no file is found Config returns ENOENT.

func ConfigDirs

func ConfigDirs() (string, bool)

ConfigDirs returns the path list corresponding to XDG_CONFIG_DIRS.

func ConfigHome

func ConfigHome() (string, bool)

ConfigHome returns the path corresponding to XDG_CONFIG_HOME.

func Data

func Data(name string, local bool) (string, error)

Data returns the path to the named file found first in the list of data directories obtained from DataHome, and DataDirs if local is false. If no file is found Data returns ENOENT.

func DataDirs

func DataDirs() (string, bool)

DataDirs returns the path list corresponding to XDG_DATA_DIRS.

func DataHome

func DataHome() (string, bool)

DataHome returns the path corresponding to XDG_DATA_HOME.

func Runtime

func Runtime(name string) (string, error)

Runtime returns the path to the named file found in the runtime directory obtained from RuntimeDir. If no file is found Runtime returns ENOENT.

func RuntimeDir

func RuntimeDir() (string, bool)

RuntimeDir returns the path corresponding to XDG_RUNTIME_DIR.

func State

func State(name string) (string, error)

State returns the path to the named file found in the state directory obtained from StateHome. If no file is found State returns ENOENT.

func StateHome

func StateHome() (string, bool)

StateHome returns the path corresponding to XDG_STATE_HOME.

Types

This section is empty.

Jump to

Keyboard shortcuts

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