feat(BRIDGE-119): added support for Feature Flags

This commit is contained in:
Atanas Janeshliev
2024-08-07 17:04:54 +02:00
parent 3d53bf7477
commit e290cd308b
11 changed files with 377 additions and 1 deletions

View File

@ -206,6 +206,16 @@ func (l *Locations) ProvideIMAPSyncConfigPath() (string, error) {
return l.getIMAPSyncConfigPath(), nil
}
// 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 (l *Locations) ProvideUnleashCachePath() (string, error) {
if err := os.MkdirAll(l.getUnleashCachePath(), 0o700); err != nil {
return "", err
}
return l.getUnleashCachePath(), nil
}
func (l *Locations) getGluonCachePath() string {
return filepath.Join(l.userData, "gluon")
}
@ -242,6 +252,8 @@ func (l *Locations) getStatsPath() string {
return filepath.Join(l.userData, "stats")
}
func (l *Locations) getUnleashCachePath() string { return filepath.Join(l.userCache, "unleash_cache") }
// Clear removes everything except the lock and update files.
func (l *Locations) Clear(except ...string) error {
return files.Remove(