diff options
author | Valery Piashchynski <[email protected]> | 2021-04-22 22:53:12 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-04-22 22:53:12 +0300 |
commit | 06ee748c1ca23bf489ae707041f0e8f3e67fbaf7 (patch) | |
tree | 4249c893d194c779fd7510cef2de7e71b888735f /plugins/kv/storage.go | |
parent | 91c1fa2e2693cb662425c1ba7cca2325a8458995 (diff) |
- Add redis driver
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/kv/storage.go')
-rw-r--r-- | plugins/kv/storage.go | 25 |
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])) } |