Option types must propagage missing fields (#2726)

* 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>
This commit is contained in:
Tiago Peczenyj 2023-10-30 13:36:44 +01:00 committed by GitHub
parent fd13da4fea
commit a5fe17472a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 1 deletions

View File

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

View File

@ -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
@ -97,6 +99,8 @@ type RingOptions struct {
TLSConfig *tls.Config
Limiter Limiter
DisableIndentity bool
}
func (opt *RingOptions) init() {
@ -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,
@ -162,6 +168,8 @@ func (opt *RingOptions) clientOptions() *Options {
TLSConfig: opt.TLSConfig,
Limiter: opt.Limiter,
DisableIndentity: opt.DisableIndentity,
}
}

View File

@ -79,6 +79,8 @@ type FailoverOptions struct {
ConnMaxLifetime time.Duration
TLSConfig *tls.Config
DisableIndentity bool
}
func (opt *FailoverOptions) clientOptions() *Options {
@ -113,6 +115,8 @@ func (opt *FailoverOptions) clientOptions() *Options {
ConnMaxLifetime: opt.ConnMaxLifetime,
TLSConfig: opt.TLSConfig,
DisableIndentity: opt.DisableIndentity,
}
}

View File

@ -65,6 +65,8 @@ type UniversalOptions struct {
// Only failover clients.
MasterName string
DisableIndentity bool
}
// Cluster returns cluster options created from the universal options.
@ -108,6 +110,8 @@ func (o *UniversalOptions) Cluster() *ClusterOptions {
ConnMaxLifetime: o.ConnMaxLifetime,
TLSConfig: o.TLSConfig,
DisableIndentity: o.DisableIndentity,
}
}
@ -151,6 +155,8 @@ func (o *UniversalOptions) Failover() *FailoverOptions {
ConnMaxLifetime: o.ConnMaxLifetime,
TLSConfig: o.TLSConfig,
DisableIndentity: o.DisableIndentity,
}
}
@ -191,6 +197,8 @@ func (o *UniversalOptions) Simple() *Options {
ConnMaxLifetime: o.ConnMaxLifetime,
TLSConfig: o.TLSConfig,
DisableIndentity: o.DisableIndentity,
}
}