xdgdirs

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: MIT Imports: 6 Imported by: 6

README

xdgdirs

golang lib returns directories obey xdg specifications.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheHome

func CacheHome() string

CacheHome is a directory that user specific non-essential (cached) data should be written.

func ConfigDirs

func ConfigDirs() []string

ConfigDirs returns a list of directories that config files should be find in this order. ConfigHome() always be the first entry.

func ConfigHome

func ConfigHome() string

ConfigHome is directory stores user specific configuration files.

func DataDirs

func DataDirs() []string

DataDirs returns a list of directories that data files should be find in this order. DataHome() always be the first entry.

func DataHome

func DataHome() string

DataHome returns the directory that user data should written to.

func Home

func Home() string

Home return current user Home directory

func ResolveConfigFile

func ResolveConfigFile(path string) (string, error)

ResolveConfigFile find file in ConfigDirs(), returns first found file. Return error if path not found, or the found path is not a regular file.

func ResolveDataFile

func ResolveDataFile(path string) (string, error)

ResolveDataFile find file in DataDirs(), returns first found file. Return error if path not found, or the found path is not a regular file.

func RuntimeHome

func RuntimeHome() string

RuntimeHome returns xdg runtime directory. Use XDG_RUNTIME_DIR if defined. Default to /tmp/[user]/ for non-root users, /run for root user.

NOTE: /tmp/[user]/ noramlly not exist, RuntimeHome() do not create or check it exists.

Types

This section is empty.

Jump to

Keyboard shortcuts

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