Documentation ¶
Overview ¶
xdg implements helpers for you to use the XDG spec in your apps.
For now, that's just the base directory spec, http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type XDGDir ¶
type XDGDir struct {
// contains filtered or unexported fields
}
An XDGDir holds configuration for and can be used to access the XDG-specified base directories relative to which user-specific files of a given type should be stored.
Typically you wouldn't use XDGDir directly, but one of the predefined ones which implement the spec: Data, Config and Cache.
func (*XDGDir) Dirs ¶
Dirs returns the preference-ordered set of base directories to search for files of the given type, starting with the user-specific one, as specified (or not) by the user's environment.
func (*XDGDir) Ensure ¶
Ensure takes the path suffix given, and ensures that a matching file exists in the home XDG directory. If it doesn't exist it is created. If it can't be created, or exists but is unreadable, an error is returned.