Skip to content

Option types must propagage missing fields #2726

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ type Options struct {
// Enables read only queries on slave/follower nodes.
readOnly bool

// // Disable set-lib on connect. Default is false.
// Disable set-lib on connect. Default is false.
DisableIndentity bool
}

Expand Down
8 changes: 8 additions & 0 deletions ring.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ type RingOptions struct {
WriteTimeout time.Duration
ContextTimeoutEnabled bool

ContextTimeoutEnabled bool

// PoolFIFO uses FIFO mode for each node connection pool GET/PUT (default LIFO).
PoolFIFO bool

Expand All @@ -97,6 +99,8 @@ type RingOptions struct {

TLSConfig *tls.Config
Limiter Limiter

DisableIndentity bool
}

func (opt *RingOptions) init() {
Expand Down Expand Up @@ -151,6 +155,8 @@ func (opt *RingOptions) clientOptions() *Options {
WriteTimeout: opt.WriteTimeout,
ContextTimeoutEnabled: opt.ContextTimeoutEnabled,

ContextTimeoutEnabled: opt.ContextTimeoutEnabled,

PoolFIFO: opt.PoolFIFO,
PoolSize: opt.PoolSize,
PoolTimeout: opt.PoolTimeout,
Expand All @@ -162,6 +168,8 @@ func (opt *RingOptions) clientOptions() *Options {

TLSConfig: opt.TLSConfig,
Limiter: opt.Limiter,

DisableIndentity: opt.DisableIndentity,
}
}

Expand Down
4 changes: 4 additions & 0 deletions sentinel.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ type FailoverOptions struct {
ConnMaxLifetime time.Duration

TLSConfig *tls.Config

DisableIndentity bool
}

func (opt *FailoverOptions) clientOptions() *Options {
Expand Down Expand Up @@ -113,6 +115,8 @@ func (opt *FailoverOptions) clientOptions() *Options {
ConnMaxLifetime: opt.ConnMaxLifetime,

TLSConfig: opt.TLSConfig,

DisableIndentity: opt.DisableIndentity,
}
}

Expand Down
8 changes: 8 additions & 0 deletions universal.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ type UniversalOptions struct {
// Only failover clients.

MasterName string

DisableIndentity bool
}

// Cluster returns cluster options created from the universal options.
Expand Down Expand Up @@ -108,6 +110,8 @@ func (o *UniversalOptions) Cluster() *ClusterOptions {
ConnMaxLifetime: o.ConnMaxLifetime,

TLSConfig: o.TLSConfig,

DisableIndentity: o.DisableIndentity,
}
}

Expand Down Expand Up @@ -151,6 +155,8 @@ func (o *UniversalOptions) Failover() *FailoverOptions {
ConnMaxLifetime: o.ConnMaxLifetime,

TLSConfig: o.TLSConfig,

DisableIndentity: o.DisableIndentity,
}
}

Expand Down Expand Up @@ -191,6 +197,8 @@ func (o *UniversalOptions) Simple() *Options {
ConnMaxLifetime: o.ConnMaxLifetime,

TLSConfig: o.TLSConfig,

DisableIndentity: o.DisableIndentity,
}
}

Expand Down