Golang implementation of https://lib.rs/crates/directories
Go to file
Martyn eed78633aa Rename to remove golang- prefix 2021-12-29 21:45:28 +00:00
base Rename to remove golang- prefix 2021-12-29 21:44:28 +00:00
project Rename to remove golang- prefix 2021-12-29 21:44:28 +00:00
user Rename to remove golang- prefix 2021-12-29 21:44:28 +00:00
.gitignore Initial commit 2021-12-29 00:39:43 +00:00
LICENSE Initial commit 2021-12-29 00:39:43 +00:00
README.md Rename to remove golang- prefix 2021-12-29 21:45:28 +00:00
go.mod Rename to remove golang- prefix 2021-12-29 21:44:28 +00:00
go.sum Initial golang implementation by-the-docs 2021-12-29 12:00:51 +00:00
printall.go Rename to remove golang- prefix 2021-12-29 21:44:28 +00:00

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()