From 91c1fa2e2693cb662425c1ba7cca2325a8458995 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Thu, 22 Apr 2021 22:03:59 +0300 Subject: - Rework storage drivers Signed-off-by: Valery Piashchynski --- plugins/kv/interface.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'plugins/kv/interface.go') diff --git a/plugins/kv/interface.go b/plugins/kv/interface.go index 6c2a66f2..20dbb8b3 100644 --- a/plugins/kv/interface.go +++ b/plugins/kv/interface.go @@ -35,11 +35,15 @@ type Storage interface { // Delete one or multiple keys. Delete(keys ...string) error +} - // Close closes the storage and underlying resources. - Close() error +// StorageDriver interface provide storage +type StorageDriver interface { + Provider +} - // Configure used to configure storage - // key - yaml config key, for example kv.boltdb-north - Configure(key string) (Storage, error) +// Provider provides storage based on the config +type Provider interface { + // Provide provides Storage based on the config key + Provide(key string) (Storage, error) } -- cgit v1.2.3