-
Notifications
You must be signed in to change notification settings - Fork 10
/
dummy.go
95 lines (75 loc) · 2.63 KB
/
dummy.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package gokvstores
import (
"context"
"time"
)
// DummyStore is a noop store (caching disabled).
type DummyStore struct{}
// Get returns value for the given key.
func (DummyStore) Get(ctx context.Context, key string) (interface{}, error) {
return nil, nil
}
// MGet returns map of key, value for a list of keys.
func (DummyStore) MGet(ctx context.Context, keys []string) (map[string]interface{}, error) {
return nil, nil
}
// Set sets value for the given key.
func (DummyStore) Set(ctx context.Context, key string, value interface{}) error {
return nil
}
// SetWithExpiration sets the value for the given key for a specified duration.
func (DummyStore) SetWithExpiration(ctx context.Context, key string, value interface{}, expiration time.Duration) error {
return nil
}
// GetMap returns map for the given key.
func (DummyStore) GetMap(ctx context.Context, key string) (map[string]interface{}, error) {
return nil, nil
}
// GetMaps returns maps for the given keys.
func (DummyStore) GetMaps(ctx context.Context, keys []string) (map[string]map[string]interface{}, error) {
return nil, nil
}
// SetMap sets map for the given key.
func (DummyStore) SetMap(ctx context.Context, key string, value map[string]interface{}) error {
return nil
}
// SetMaps sets the given maps.
func (DummyStore) SetMaps(ctx context.Context, maps map[string]map[string]interface{}) error {
return nil
}
// DeleteMap removes the specified fields from the map stored at key.
func (DummyStore) DeleteMap(ctx context.Context, key string, fields ...string) error { return nil }
// GetSlice returns slice for the given key.
func (DummyStore) GetSlice(ctx context.Context, key string) ([]interface{}, error) {
return nil, nil
}
// SetSlice sets slice for the given key.
func (DummyStore) SetSlice(ctx context.Context, key string, value []interface{}) error {
return nil
}
// AppendSlice appends values to an existing slice.
// If key does not exist, creates slice.
func (DummyStore) AppendSlice(ctx context.Context, key string, values ...interface{}) error {
return nil
}
// Exists checks if the given key exists.
func (DummyStore) Exists(ctx context.Context, keys ...string) (bool, error) {
return false, nil
}
// Delete deletes the given key.
func (DummyStore) Delete(ctx context.Context, key string) error {
return nil
}
// Keys returns all keys matching pattern
func (DummyStore) Keys(ctx context.Context, pattern string) ([]interface{}, error) {
return nil, nil
}
// Flush flushes the store.
func (DummyStore) Flush(ctx context.Context) error {
return nil
}
// Close closes the connection to the store.
func (DummyStore) Close() error {
return nil
}
var _ KVStore = &DummyStore{}