Refactor & fix storing struct-values in redis keyvalue
This commit is contained in:
parent
df45675df3
commit
d48aa101cf
10 changed files with 117 additions and 59 deletions
|
|
@ -26,6 +26,7 @@ import (
|
|||
type Storage interface {
|
||||
Put(key string, value interface{}) (err error)
|
||||
Get(key string) (value interface{}, exists bool, err error)
|
||||
GetWithValue(key string, value interface{}) (exists bool, err error)
|
||||
Del(key string) (err error)
|
||||
IncrBy(key string, update int64) (err error)
|
||||
DecrBy(key string, update int64) (err error)
|
||||
|
|
@ -55,6 +56,10 @@ func Get(key string) (value interface{}, exists bool, err error) {
|
|||
return store.Get(key)
|
||||
}
|
||||
|
||||
func GetWithValue(key string, value interface{}) (exists bool, err error) {
|
||||
return store.GetWithValue(key, value)
|
||||
}
|
||||
|
||||
// Del removes a save value from a storage backend
|
||||
func Del(key string) (err error) {
|
||||
return store.Del(key)
|
||||
|
|
|
|||
Reference in a new issue