summaryrefslogtreecommitdiff
path: root/plugins/kv/storage.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-04-22 22:53:12 +0300
committerValery Piashchynski <[email protected]>2021-04-22 22:53:12 +0300
commit06ee748c1ca23bf489ae707041f0e8f3e67fbaf7 (patch)
tree4249c893d194c779fd7510cef2de7e71b888735f /plugins/kv/storage.go
parent91c1fa2e2693cb662425c1ba7cca2325a8458995 (diff)
- Add redis driver
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/kv/storage.go')
-rw-r--r--plugins/kv/storage.go25
1 files changed, 13 insertions, 12 deletions
diff --git a/plugins/kv/storage.go b/plugins/kv/storage.go
index 42e0ef3e..9f460073 100644
--- a/plugins/kv/storage.go
+++ b/plugins/kv/storage.go
@@ -135,19 +135,20 @@ func (p *Plugin) Serve() chan error {
// save the storage
p.storages[k] = storage
-
case redis:
- // if _, ok := p.drivers[redis]; !ok {
- // continue
- // }
- // storage, err := p.drivers[redis].Configure(configKey)
- // if err != nil {
- // errCh <- errors.E(op, err)
- // return errCh
- // }
- //
- // // save the storage
- // p.storages[k] = storage
+ if _, ok := p.drivers[redis]; !ok {
+ continue
+ }
+
+ storage, err := p.drivers[redis].Provide(configKey)
+ if err != nil {
+ errCh <- errors.E(op, err)
+ return errCh
+ }
+
+ // save the storage
+ p.storages[k] = storage
+
default:
errCh <- errors.E(op, errors.Errorf("unknown storage %s", v.(map[string]interface{})[driver]))
}