Allow creation of Cluster client#27
Open
esimonov wants to merge 3 commits intogo-chi:masterfrom
Open
Conversation
namigaliyev
approved these changes
Jan 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This PR adds
IsClusterModefield tohttprateredis.Config, which mirrors the eponymous setting fromgithub.com/redis/go-redis/v9. In order to process the new parameter, that dependency also had to be updated to at least v9.8.0 where this feature was introduced.Why
Same motivation as they had when adding this field in
go-redis: there's a use case when you have a single host:port pair, yet your Redis deployment is operating in cluster mode. For example, Elasticache supports setting up a Redis cluster with a single configuration endpoint. This PR makes it possible to use such clusters inhttprateredis.Other observations
The slice of addresses passed to
redis.NewUniversalClientalways has length 1:while
go-redisdocumentation says thatThis effectively means that
IsClusterModewould provide the only way to create a cluster client inhttprateredis.Would you be interested in superseding the
HostandPortconfig values with a singleAddrsfield of type[]string?