Golang implementation of https://lib.rs/crates/directories
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Martyn fae7fac52c
removing the android exclusion for now
11 months ago
base removing the android exclusion for now 11 months ago
project Rename to remove golang- prefix 11 months ago
user Moved the windows stuff to separate file 11 months ago
.gitignore Initial commit 11 months ago
LICENSE Initial commit 11 months ago
README.md Rename to remove golang- prefix 11 months ago
go.mod Rename to remove golang- prefix 11 months ago
go.sum Initial golang implementation by-the-docs 11 months ago
printall.go Rename to remove golang- prefix 11 months ago

README.md

directories

Golang implementation of https://lib.rs/crates/directories

Per-user/per-application WRITEABLE paths for cross-platform idiomatic locations.

Currently supports Linux, Windows and mac. Future additions: iOS,Android, plan9?

All functions have the same signature :

function user.Fonts() (string, error)

and return an Error if they cannot satisfy the request on a particular platform (e.g. Windows doesn't have a per-user font directory)

You need to set your project details before using the functions in directories/project by calling project.SetProjectName

"git.martyn.berlin/martyn/directories/base" contains :

  • Home()
  • Cache()
  • Config()
  • Data()
  • DataLocal()
  • Executable()
  • Preferences()
  • Runtime()
  • State()

"git.martyn.berlin/martyn/directories/user" contains :

  • Home()
  • Audio()
  • Desktop()
  • Documents()
  • Downloads()
  • Fonts()
  • Pictures()
  • Public()
  • Templates()
  • Videos()

and "git.martyn.berlin/martyn/directories/project" alongside SetProjectName() contains :

  • Cache()
  • Config()
  • Data()
  • DataLocal()
  • Preferences()