Initial golang implementation by-the-docs

This commit is contained in:
Martyn 2021-12-29 12:01:11 +00:00
parent ed20d843c2
commit b027424b86
1 changed files with 43 additions and 1 deletions

View File

@ -1,3 +1,45 @@
# golang-directories
Golang implementation of https://lib.rs/crates/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 `golang-directories/project` by calling project.SetProjectName
`"git.martyn.berlin/martyn/golang-directories/base"` contains :
* `Home()`
* `Cache()`
* `Config()`
* `Data()`
* `DataLocal()`
* `Executable()`
* `Preferences()`
* `Runtime()`
* `State()`
`"git.martyn.berlin/martyn/golang-directories/user"` contains :
* `Home()`
* `Audio()`
* `Desktop()`
* `Documents()`
* `Downloads()`
* `Fonts()`
* `Pictures()`
* `Public()`
* `Templates()`
* `Videos()`
and `"git.martyn.berlin/martyn/golang-directories/project"` alongside `SetProjectName()` contains :
* `Cache()`
* `Config()`
* `Data()`
* `DataLocal()`
* `Preferences()`