mirror of
https://github.com/redis/go-redis.git
synced 2025-07-31 05:04:23 +03:00
feat: support Elasticache cluster mode by introducing IsClusterMode config param (#3255)
Co-authored-by: Rushikesh Joshi <rushikesh.joshi@sap.com> Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
This commit is contained in:
@ -69,6 +69,9 @@ type UniversalOptions struct {
|
||||
DisableIndentity bool
|
||||
IdentitySuffix string
|
||||
UnstableResp3 bool
|
||||
|
||||
// IsClusterMode can be used when only one Addrs is provided (e.g. Elasticache supports setting up cluster mode with configuration endpoint).
|
||||
IsClusterMode bool
|
||||
}
|
||||
|
||||
// Cluster returns cluster options created from the universal options.
|
||||
@ -244,7 +247,7 @@ var (
|
||||
func NewUniversalClient(opts *UniversalOptions) UniversalClient {
|
||||
if opts.MasterName != "" {
|
||||
return NewFailoverClient(opts.Failover())
|
||||
} else if len(opts.Addrs) > 1 {
|
||||
} else if len(opts.Addrs) > 1 || opts.IsClusterMode {
|
||||
return NewClusterClient(opts.Cluster())
|
||||
}
|
||||
return NewClient(opts.Simple())
|
||||
|
Reference in New Issue
Block a user