userdirs

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	EnvDesktopDir     = "XDG_DESKTOP_DIR"
	EnvDownloadDir    = "XDG_DOWNLOAD_DIR"
	EnvDocumentsDir   = "XDG_DOCUMENTS_DIR"
	EnvMusicDir       = "XDG_MUSIC_DIR"
	EnvPicturesDir    = "XDG_PICTURES_DIR"
	EnvVideosDir      = "XDG_VIDEOS_DIR"
	EnvTemplatesDir   = "XDG_TEMPLATES_DIR"
	EnvPublicShareDir = "XDG_PUBLICSHARE_DIR"
)

XDG user directories environment variables.

Variables

This section is empty.

Functions

This section is empty.

Types

type Directories

type Directories struct {
	// Desktop defines the location of the user's desktop directory.
	Desktop string

	// Download defines a suitable location for user downloaded files.
	Download string

	// Documents defines a suitable location for user document files.
	Documents string

	// Music defines a suitable location for user audio files.
	Music string

	// Pictures defines a suitable location for user image files.
	Pictures string

	// VideosDir defines a suitable location for user video files.
	Videos string

	// Templates defines a suitable location for user template files.
	Templates string

	// PublicShare defines a suitable location for user shared files.
	PublicShare string
}

Directories defines the locations of well known user directories.

func ParseConfig

func ParseConfig(r io.Reader) (*Directories, error)

ParseConfig parses the user directories config file contained in the provided reader.

func ParseConfigFile

func ParseConfigFile(name string) (*Directories, error)

ParseConfigFile parses the user directories config file at the specified location.

Jump to

Keyboard shortcuts

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