mirror of
https://github.com/go-kratos/kratos.git
synced 2025-01-10 00:29:01 +02:00
feature(Redis): add db to config (#616)
Co-authored-by: xialeistudio <xialei@100tal.com>
This commit is contained in:
parent
ee96e00411
commit
9d43e492a8
1
pkg/cache/redis/pool.go
vendored
1
pkg/cache/redis/pool.go
vendored
@ -58,6 +58,7 @@ func NewPool(c *Config, options ...DialOption) (p *Pool) {
|
||||
DialReadTimeout(time.Duration(c.ReadTimeout)),
|
||||
DialWriteTimeout(time.Duration(c.WriteTimeout)),
|
||||
DialPassword(c.Auth),
|
||||
DialDatabase(c.Db),
|
||||
}
|
||||
ops = append(ops, options...)
|
||||
p1 := pool.NewSlice(c.Config)
|
||||
|
1
pkg/cache/redis/redis.go
vendored
1
pkg/cache/redis/redis.go
vendored
@ -34,6 +34,7 @@ type Config struct {
|
||||
Proto string
|
||||
Addr string
|
||||
Auth string
|
||||
Db int
|
||||
DialTimeout xtime.Duration
|
||||
ReadTimeout xtime.Duration
|
||||
WriteTimeout xtime.Duration
|
||||
|
Loading…
Reference in New Issue
Block a user