2021-12-29 21:45:28 +00:00
|
|
|
# directories
|
2021-12-29 00:39:43 +00:00
|
|
|
|
2021-12-29 12:01:11 +00:00
|
|
|
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)
|
|
|
|
|
2021-12-29 21:45:28 +00:00
|
|
|
You need to set your project details before using the functions in `directories/project` by calling project.SetProjectName
|
2021-12-29 12:01:11 +00:00
|
|
|
|
2021-12-29 21:45:28 +00:00
|
|
|
`"git.martyn.berlin/martyn/directories/base"` contains :
|
2021-12-29 12:01:11 +00:00
|
|
|
* `Home()`
|
|
|
|
* `Cache()`
|
|
|
|
* `Config()`
|
|
|
|
* `Data()`
|
|
|
|
* `DataLocal()`
|
|
|
|
* `Executable()`
|
|
|
|
* `Preferences()`
|
|
|
|
* `Runtime()`
|
|
|
|
* `State()`
|
|
|
|
|
2021-12-29 21:45:28 +00:00
|
|
|
`"git.martyn.berlin/martyn/directories/user"` contains :
|
2021-12-29 12:01:11 +00:00
|
|
|
* `Home()`
|
|
|
|
* `Audio()`
|
|
|
|
* `Desktop()`
|
|
|
|
* `Documents()`
|
|
|
|
* `Downloads()`
|
|
|
|
* `Fonts()`
|
|
|
|
* `Pictures()`
|
|
|
|
* `Public()`
|
|
|
|
* `Templates()`
|
|
|
|
* `Videos()`
|
|
|
|
|
2021-12-29 21:45:28 +00:00
|
|
|
and `"git.martyn.berlin/martyn/directories/project"` alongside `SetProjectName()` contains :
|
2021-12-29 12:01:11 +00:00
|
|
|
* `Cache()`
|
|
|
|
* `Config()`
|
|
|
|
* `Data()`
|
|
|
|
* `DataLocal()`
|
|
|
|
* `Preferences()`
|