fs/cache: add ClearConfig method to clear all remotes based on Config #4811

This commit is contained in:
Nick Craig-Wood
2020-11-30 11:52:25 +00:00
parent f4750928ee
commit a10fbf16ea
2 changed files with 23 additions and 0 deletions

7
fs/cache/cache.go vendored
View File

@@ -124,6 +124,13 @@ func Put(fsString string, f fs.Fs) {
addMapping(fsString, canonicalName)
}
// ClearConfig deletes all entries which were based on the config name passed in
//
// Returns number of entries deleted
func ClearConfig(name string) (deleted int) {
return c.DeletePrefix(name + ":")
}
// Clear removes everything from the cache
func Clear() {
c.Clear()