redisdb/get_by_key.go

14 lines
217 B
Go
Raw Normal View History

2021-08-09 03:36:09 +00:00
package redisdb
import "context"
// GetValueByKey ...
func GetValueByKey(ctx context.Context, key string) string {
cmd := rdb.Get(ctx, key)
if cmd == nil {
return ""
}
value, _ := cmd.Result()
return value
}