Closed leesio closed 4 years ago
I don't have such plans and it is not clear how hash/set can be useful for caching.
It seems like it would be useful to cache hash/set values for same reason it's useful to cache string values: to avoid a trip to redis for every read.
Maybe I'm misunderstanding something?
I am not sure what you mean - an example may help...
I think I might have slightly misunderstood this library on first glance.
I understood that the primary use of this library was to add a process local cache in front of redis.
cache := &cache.Cache{Redis: redisClient}
var result map[string]interface{}
err := cache.Get(ctx, "some-key", &result) // requires a round trip to redis
At another call point, a round trip to redis could be avoided
var otherResult map[string]interface{}
err := cache.Get(ctx, "some-key", &otherResult) // does not require a round trip to redis, since the value is cached locally
I imagined that this could be applicable to other data structure.
No, this is a key/value cache based on Redis, not for Redis.
I now understand why my initial comment didn't make much sense. Sorry for wasting your time!
Firstly, thanks for building this. I like the design of the library as a wrapper around the redis client.
I'm curious whether you have any plans to support other redis data types (e.g. hash/set)? If there aren't fundamental issues supporting other data types I might be interested in implementing them.