File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -382,6 +382,19 @@ client, err := rueidis.NewClient(rueidis.ClientOption{
382
382
InitAddress : []string {" 127.0.0.1:6379" },
383
383
})
384
384
385
+ // Connect to a standalone redis with replicas
386
+ client , err := rueidis.NewClient (rueidis.ClientOption {
387
+ InitAddress : []string {" 127.0.0.1:6379" },
388
+ Standalone : rueidis.StandaloneOption {
389
+ // Note that these addresses must be online and can not be promoted.
390
+ // An example use case is the reader endpoint provided by cloud vendors.
391
+ ReplicaAddress: []string {" reader_endpoint:port" },
392
+ },
393
+ SendToReplicas : func (cmd rueidis.Completed ) bool {
394
+ return cmd.IsReadOnly ()
395
+ },
396
+ })
397
+
385
398
// Connect to a redis cluster
386
399
client , err := rueidis.NewClient (rueidis.ClientOption {
387
400
InitAddress : []string {" 127.0.0.1:7001" , " 127.0.0.1:7002" , " 127.0.0.1:7003" },
You can’t perform that action at this time.
0 commit comments