summaryrefslogtreecommitdiff
path: root/plugins/kv/interface.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-01-07 01:06:50 +0300
committerValery Piashchynski <[email protected]>2021-01-07 01:06:50 +0300
commitc1465d3bcdf24a78440300aa51e7cfc92ce874a8 (patch)
tree6e0f5107eba90df73724b6611ca6adfa148d2a3f /plugins/kv/interface.go
parentc9f670ee734355cbc5d504186946b7db67cf62b5 (diff)
KV, updated, bug fixed, with intergration tests via plugins
Diffstat (limited to 'plugins/kv/interface.go')
-rw-r--r--plugins/kv/interface.go20
1 files changed, 8 insertions, 12 deletions
diff --git a/plugins/kv/interface.go b/plugins/kv/interface.go
index 3512fd73..c1367cdf 100644
--- a/plugins/kv/interface.go
+++ b/plugins/kv/interface.go
@@ -1,10 +1,6 @@
package kv
// Item represents general storage item
-import (
- "context"
-)
-
type Item struct {
// Key of item
Key string
@@ -17,28 +13,28 @@ type Item struct {
// Storage represents single abstract storage.
type Storage interface {
// Has checks if value exists.
- Has(ctx context.Context, keys ...string) (map[string]bool, error)
+ Has(keys ...string) (map[string]bool, error)
// Get loads value content into a byte slice.
- Get(ctx context.Context, key string) ([]byte, error)
+ Get(key string) ([]byte, error)
// MGet loads content of multiple values
- // If there are no values for keys, key will no be in the map
- MGet(ctx context.Context, keys ...string) (map[string]interface{}, error)
+ // Returns the map with existing keys and associated values
+ MGet(keys ...string) (map[string]interface{}, error)
// Set used to upload item to KV with TTL
// 0 value in TTL means no TTL
- Set(ctx context.Context, items ...Item) error
+ Set(items ...Item) error
// MExpire sets the TTL for multiply keys
- MExpire(ctx context.Context, items ...Item) error
+ MExpire(items ...Item) error
// TTL return the rest time to live for provided keys
// Not supported for the memcached and boltdb
- TTL(ctx context.Context, keys ...string) (map[string]interface{}, error)
+ TTL(keys ...string) (map[string]interface{}, error)
// Delete one or multiple keys.
- Delete(ctx context.Context, keys ...string) error
+ Delete(keys ...string) error
// Close closes the storage and underlying resources.
Close() error