Feat: add local policy

This commit is contained in:
HFO4
2020-02-26 15:11:06 +08:00
parent c1d2b933aa
commit f1ef21e195
13 changed files with 270 additions and 35 deletions

13
pkg/cache/redis.go vendored
View File

@@ -201,3 +201,16 @@ func (store *RedisStore) Delete(keys []string, prefix string) error {
}
return nil
}
// DeleteAll 批量所有键
func (store *RedisStore) DeleteAll() error {
rc := store.pool.Get()
defer rc.Close()
if rc.Err() != nil {
return rc.Err()
}
_, err := rc.Do("FLUSHDB")
return err
}