summaryrefslogtreecommitdiff
path: root/plugins/redis
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-06-24 15:31:15 +0300
committerValery Piashchynski <[email protected]>2021-06-24 15:31:15 +0300
commitfdff0ffe41b45d0e919eccc683104987898a4faf (patch)
tree79b242b1af7d283eedfb0ac124e48c5fa47ef461 /plugins/redis
parentce53a8e149b76f15e8a5dd88ac3b953798d57e8b (diff)
- Add Clear method to the storages
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/redis')
-rw-r--r--plugins/redis/kv.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/redis/kv.go b/plugins/redis/kv.go
index 320b7443..2e4b9bfd 100644
--- a/plugins/redis/kv.go
+++ b/plugins/redis/kv.go
@@ -240,3 +240,12 @@ func (d *Driver) TTL(keys ...string) (map[string]string, error) {
}
return m, nil
}
+
+func (d *Driver) Clear() error {
+ fdb := d.universalClient.FlushDB(context.Background())
+ if fdb.Err() != nil {
+ return fdb.Err()
+ }
+
+ return nil
+}