forked from Silverfish/proton-bridge
Other: Update docstrings for locations
This commit is contained in:
@ -31,10 +31,11 @@ import (
|
|||||||
// Locations provides cross-platform access to standard locations.
|
// Locations provides cross-platform access to standard locations.
|
||||||
// On linux:
|
// On linux:
|
||||||
// - settings: ~/.config/protonmail/<app>
|
// - settings: ~/.config/protonmail/<app>
|
||||||
// - logs: ~/.cache/protonmail/<app>/logs
|
// - gluon ~/.local/share/protonmail/<app>/gluon
|
||||||
// - cache: ~/.config/protonmail/<app>/cache
|
// - logs: ~/.local/share/protonmail/<app>/logs
|
||||||
// - updates: ~/.config/protonmail/<app>/updates
|
// - updates: ~/.local/share/protonmail/<app>/updates
|
||||||
// - lockfile: ~/.cache/protonmail/<app>/<app>.lock .
|
// - locks: ~/.cache/protonmail/<app>/*.lock
|
||||||
|
// Other OSes are similar.
|
||||||
type Locations struct {
|
type Locations struct {
|
||||||
// userConfig is the path to the user config directory, for storing persistent config data.
|
// userConfig is the path to the user config directory, for storing persistent config data.
|
||||||
userConfig string
|
userConfig string
|
||||||
@ -147,7 +148,7 @@ func (l *Locations) ProvideGluonPath() (string, error) {
|
|||||||
return l.getGluonPath(), nil
|
return l.getGluonPath(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProvideLogsPath returns a location for user logs (e.g. ~/.cache/<company>/<app>/logs).
|
// ProvideLogsPath returns a location for user logs (e.g. ~/.local/share/<company>/<app>/logs).
|
||||||
// It creates it if it doesn't already exist.
|
// It creates it if it doesn't already exist.
|
||||||
func (l *Locations) ProvideLogsPath() (string, error) {
|
func (l *Locations) ProvideLogsPath() (string, error) {
|
||||||
if err := os.MkdirAll(l.getLogsPath(), 0o700); err != nil {
|
if err := os.MkdirAll(l.getLogsPath(), 0o700); err != nil {
|
||||||
@ -167,7 +168,7 @@ func (l *Locations) ProvideGUICertPath() (string, error) {
|
|||||||
return l.getGUICertPath(), nil
|
return l.getGUICertPath(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProvideUpdatesPath returns a location for update files (e.g. ~/.cache/<company>/<app>/updates).
|
// ProvideUpdatesPath returns a location for update files (e.g. ~/.local/share/<company>/<app>/updates).
|
||||||
// It creates it if it doesn't already exist.
|
// It creates it if it doesn't already exist.
|
||||||
func (l *Locations) ProvideUpdatesPath() (string, error) {
|
func (l *Locations) ProvideUpdatesPath() (string, error) {
|
||||||
if err := os.MkdirAll(l.getUpdatesPath(), 0o700); err != nil {
|
if err := os.MkdirAll(l.getUpdatesPath(), 0o700); err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user