Skip to content

Commit

Permalink
Option types must propagage missing fields (#2726)
Browse files Browse the repository at this point in the history
* must propagage missing fields

Signed-off-by: Tiago Peczenyj <tpeczenyj@weborama.com>

* remove credentials provider from ring

---------

Signed-off-by: Tiago Peczenyj <tpeczenyj@weborama.com>
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
  • Loading branch information
peczenyj and ofekshenawa authored Oct 30, 2023
1 parent fd13da4 commit a5fe174
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
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

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 @@ 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,

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 @@ 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

0 comments on commit a5fe174

Please sign in to comment.