xdgbasedir

package module
v0.0.0-...-9247f82 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2017 License: MIT Imports: 4 Imported by: 0

README

go-xdgbasedir · Build Status Go Report Card Coverage Status

Trivially get XDG Base Directories in Golang.

Install

$ go get "github.com/srishanbhattarai/go-xdgbasedir"

Dependencies

This package depends on go-homedir.

Usage

import (
	// other imports
	"fmt"
	xdg "github.com/srishanbhattarai/go-xdgbasedir"
)

func main() {
	fmt.Println(xdg.Data())
	// ..and so on.
}

API

All exported functions return a string unless otherwise stated.

Data()

User's data files.

Config()

User's config files.

Cache()

Users' cache files.

Runtime()

User's runtime files.

DataDirs()

In addition to Data(), the list of priority-first base dirs for data.

This returns an interface. You'll need to type cast it to a string or a string slice to get the results.

func main() {
	dataDirs = xdg.DataDirs()

	// Use it as follows
	// dataDirs(.string)
}
ConfigDirs()

In addition to Config(), the list of priority-first base dirs for configurations.

This returns an interface. You'll need to type cast it to a string or a string slice to get the results.

func main() {
	configDirs = xdg.configDirs()

	// Use it as follows
	// configDirs(.string)
}

License

MIT ©

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cache

func Cache() string

Cache : Get XDG_CACHE_HOME

func Config

func Config() string

Config : Get XDG_CONFIG_HOME

func ConfigDirs

func ConfigDirs() interface{}

ConfigDirs : Get XDG_CONFIG_DIRS

func Data

func Data() string

Data : Get XDG_DATA_HOME

func DataDirs

func DataDirs() interface{}

DataDirs : Get XDG_DATA_DIRS

func Runtime

func Runtime() string

Runtime : Get XDG_RUNTIME_DIR

Types

This section is empty.

Jump to

Keyboard shortcuts

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