Skip to content
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

Option types must propagage missing fields #2726

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 @@ -82,8 +82,10 @@
DialTimeout time.Duration
ReadTimeout time.Duration
WriteTimeout time.Duration
ContextTimeoutEnabled bool

Check failure on line 85 in ring.go

View workflow job for this annotation

GitHub Actions / build (1.19.x)

other declaration of ContextTimeoutEnabled

Check failure on line 85 in ring.go

View workflow job for this annotation

GitHub Actions / build (1.20.x)

other declaration of ContextTimeoutEnabled

Check failure on line 85 in ring.go

View workflow job for this annotation

GitHub Actions / build (1.21.x)

other declaration of ContextTimeoutEnabled

ContextTimeoutEnabled bool

Check failure on line 87 in ring.go

View workflow job for this annotation

GitHub Actions / build (1.19.x)

ContextTimeoutEnabled redeclared

Check failure on line 87 in ring.go

View workflow job for this annotation

GitHub Actions / build (1.20.x)

ContextTimeoutEnabled redeclared

Check failure on line 87 in ring.go

View workflow job for this annotation

GitHub Actions / build (1.21.x)

ContextTimeoutEnabled redeclared

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

Expand All @@ -97,6 +99,8 @@

TLSConfig *tls.Config
Limiter Limiter

DisableIndentity bool
}

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

ContextTimeoutEnabled: opt.ContextTimeoutEnabled,

Check failure on line 158 in ring.go

View workflow job for this annotation

GitHub Actions / build (1.19.x)

duplicate field name ContextTimeoutEnabled in struct literal

Check failure on line 158 in ring.go

View workflow job for this annotation

GitHub Actions / build (1.20.x)

duplicate field name ContextTimeoutEnabled in struct literal

Check failure on line 158 in ring.go

View workflow job for this annotation

GitHub Actions / build (1.21.x)

duplicate field name ContextTimeoutEnabled in struct literal

PoolFIFO: opt.PoolFIFO,
PoolSize: opt.PoolSize,
PoolTimeout: opt.PoolTimeout,
Expand All @@ -162,6 +168,8 @@

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
Loading