1
0

Refactor & fix storing struct-values in redis keyvalue

This commit is contained in:
kolaente
2021-05-28 10:52:32 +02:00
parent df45675df3
commit d48aa101cf
10 changed files with 117 additions and 59 deletions

View File

@ -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)