add redis database selection (#100)

*  add redis database selection

* 📝 update docs

* 📝 readme
This commit is contained in:
maxlerebourg
2023-05-25 17:20:14 +02:00
committed by GitHub
parent abae7ee028
commit 0c2668d578
10 changed files with 57 additions and 33 deletions
+2 -2
View File
@@ -82,9 +82,9 @@ type Client struct {
}
// New Initialize cache client.
func (client *Client) New(isRedis bool, host string, pass string) {
func (client *Client) New(isRedis bool, host, pass, database string) {
if isRedis {
redis.Init(host, pass)
redis.Init(host, pass, database)
client.cache = &redisCache{}
} else {
client.cache = &localCache{}