Documentation ¶
Overview ¶
Package locations implements a type that provides cross-platform access to standard filesystem locations, including config, cache and log directories.
Index ¶
- type DefaultProvider
- type Locations
- func (l *Locations) CleanGoIMAPCache() error
- func (l *Locations) Clear(except ...string) error
- func (l *Locations) ClearUpdates() error
- func (l *Locations) GetDependencyLicensesLink() string
- func (l *Locations) GetGuiLockFile() string
- func (l *Locations) GetLicenseFilePath() string
- func (l *Locations) GetLockFile() string
- func (l *Locations) ProvideGUICertPath() (string, error)
- func (l *Locations) ProvideGluonCachePath() (string, error)
- func (l *Locations) ProvideGluonDataPath() (string, error)
- func (l *Locations) ProvideIMAPSyncConfigPath() (string, error)
- func (l *Locations) ProvideLogsPath() (string, error)
- func (l *Locations) ProvideNotificationsCachePath() (string, error)
- func (l *Locations) ProvideSettingsPath() (string, error)
- func (l *Locations) ProvideStatsPath() (string, error)
- func (l *Locations) ProvideUnleashCachePath() (string, error)
- func (l *Locations) ProvideUpdatesPath() (string, error)
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultProvider ¶
type DefaultProvider struct {
// contains filtered or unexported fields
}
DefaultProvider is a locations provider using the system-default storage locations.
func NewDefaultProvider ¶
func NewDefaultProvider(name string) (*DefaultProvider, error)
func (*DefaultProvider) UserCache ¶
func (p *DefaultProvider) UserCache() string
UserCache returns a directory that can be used to store user-specific non-essential data. $XDG_CACHE_HOME/protonmail is used on Unix systems; similar on others.
func (*DefaultProvider) UserConfig ¶
func (p *DefaultProvider) UserConfig() string
UserConfig returns a directory that can be used to store user-specific configuration. $XDG_CONFIG_HOME/protonmail is used on Unix systems; similar on others.
func (*DefaultProvider) UserData ¶
func (p *DefaultProvider) UserData() string
UserData returns a directory that can be used to store user-specific data. $XDG_DATA_HOME/protonmail is used on Unix systems; similar on others.
type Locations ¶
type Locations struct {
// contains filtered or unexported fields
}
Locations provides cross-platform access to standard locations. On linux: - settings: ~/.config/protonmail/<app> - gluon ~/.local/share/protonmail/<app>/gluon - logs: ~/.local/share/protonmail/<app>/logs - updates: ~/.local/share/protonmail/<app>/updates - locks: ~/.cache/protonmail/<app>/*.lock Other OSes are similar.
func (*Locations) CleanGoIMAPCache ¶
CleanGoIMAPCache removes all cache data from the go-imap implementation.
func (*Locations) ClearUpdates ¶
ClearUpdates removes update files.
func (*Locations) GetDependencyLicensesLink ¶
GetDependencyLicensesLink returns link to page listing dependencies.
func (*Locations) GetGuiLockFile ¶
GetGuiLockFile returns the path to the GUI lock file (e.g. ~/.cache/<company>/<app>/<app>.lock).
func (*Locations) GetLicenseFilePath ¶
GetLicenseFilePath returns path to liense file.
func (*Locations) GetLockFile ¶
GetLockFile returns the path to the bridge lock file (e.g. ~/.cache/<company>/<app>/<app>.lock).
func (*Locations) ProvideGUICertPath ¶
ProvideGUICertPath returns a location for TLS certs used for the connection between bridge and the GUI. It creates it if it doesn't already exist.
func (*Locations) ProvideGluonCachePath ¶ added in v3.0.12
ProvideGluonCachePath returns a location for gluon data. It creates it if it doesn't already exist.
func (*Locations) ProvideGluonDataPath ¶ added in v3.0.12
ProvideGluonDataPath returns a location for gluon data. It creates it if it doesn't already exist.
func (*Locations) ProvideIMAPSyncConfigPath ¶ added in v3.5.0
func (*Locations) ProvideLogsPath ¶
ProvideLogsPath returns a location for user logs (e.g. ~/.local/share/<company>/<app>/logs). It creates it if it doesn't already exist.
func (*Locations) ProvideNotificationsCachePath ¶ added in v3.13.0
ProvideNotificationsCachePath returns a location for notification deduplication data. It creates it if it doesn't already exist.
func (*Locations) ProvideSettingsPath ¶
ProvideSettingsPath returns a location for user settings (e.g. ~/.config/<company>/<app>). It creates it if it doesn't already exist.
func (*Locations) ProvideStatsPath ¶ added in v3.3.1
ProvideStatsPath returns a location for statistics files (e.g. ~/.local/share/<company>/<app>/stats). It creates it if it doesn't already exist.
func (*Locations) ProvideUnleashCachePath ¶ added in v3.13.0
ProvideUnleashCachePath returns a location for the unleash cache data (e.g. ~/.cache/protonmail/bridge-v3). It creates it if it doesn't already exist.
func (*Locations) ProvideUpdatesPath ¶
ProvideUpdatesPath returns a location for update files (e.g. ~/.local/share/<company>/<app>/updates). It creates it if it doesn't already exist.