1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-31 05:04:23 +03:00

Rework Options initialisation.

This commit is contained in:
Vladimir Mihailenco
2016-06-05 11:10:30 +00:00
parent 08d3790ec5
commit 079b7ce393
5 changed files with 34 additions and 51 deletions

View File

@ -39,6 +39,8 @@ type RingOptions struct {
IdleCheckFrequency time.Duration
}
func (opt *RingOptions) init() {}
func (opt *RingOptions) clientOptions() *Options {
return &Options{
DB: opt.DB,
@ -127,6 +129,7 @@ type Ring struct {
func NewRing(opt *RingOptions) *Ring {
const nreplicas = 100
opt.init()
ring := &Ring{
opt: opt,
nreplicas: nreplicas,