The go-redis options requires multiple redis addresses for a cluster.
In some scenarios like AWS ElastiCache, a single configuration endpoint
is used to resolve all cluster nodes.
This change adds an extra step to resolve all nodes and pass them to go-redis.
It remove the need to specify multiple cluster nodes in the configuration.
No tests were added for this scenario since it requires patching
the Go resolver during runtime.
Signed-off-by: Siavash Safi <siavash.safi@gmail.com>
f.StringVar(&cfg.Endpoint,prefix+"redis.endpoint","",description+"Redis Server endpoint to use for caching. A comma-separated list of endpoints for Redis Cluster or Redis Sentinel. If empty, no redis will be used.")
f.StringVar(&cfg.Endpoint,prefix+"redis.endpoint","",description+"Redis Server or Cluster configuration endpoint to use for caching. A comma-separated list of endpoints for Redis Cluster or Redis Sentinel. If empty, no redis will be used.")
f.StringVar(&cfg.MasterName,prefix+"redis.master-name","",description+"Redis Sentinel master name. An empty string for Redis Server or Redis Cluster.")
f.DurationVar(&cfg.Timeout,prefix+"redis.timeout",500*time.Millisecond,description+"Maximum time to wait before giving up on redis requests.")
f.DurationVar(&cfg.Expiration,prefix+"redis.expiration",0,description+"How long keys stay in the redis.")