From c1465d3bcdf24a78440300aa51e7cfc92ce874a8 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Thu, 7 Jan 2021 01:06:50 +0300 Subject: KV, updated, bug fixed, with intergration tests via plugins --- plugins/kv/interface.go | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'plugins/kv/interface.go') 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 -- cgit v1.2.3