Skip to content

Commit 143859e

Browse files
committed
Rename
1 parent 602b106 commit 143859e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cluster.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,13 +1655,13 @@ func (c *ClusterClient) slotMasterNode(ctx context.Context, slot int) (*clusterN
16551655
return state.slotMasterNode(slot)
16561656
}
16571657

1658-
// ReplicaForKey gets a client for a replica node to run any command on it.
1658+
// SlaveForKey gets a client for a replica node to run any command on it.
16591659
// This is especially useful if we want to run a particular lua script which has
16601660
// only read only commands on the replica.
16611661
// This is because other redis commands generally have a flag that points that
16621662
// they are read only and automatically run on the replica nodes
16631663
// if ClusterOptions.ReadOnly flag is set to true.
1664-
func (c *ClusterClient) ReplicaForKey(ctx context.Context, key string) (*Client, error) {
1664+
func (c *ClusterClient) SlaveForKey(ctx context.Context, key string) (*Client, error) {
16651665
state, err := c.state.Get(ctx)
16661666
if err != nil {
16671667
return nil, err

cluster_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ var _ = Describe("ClusterClient", func() {
865865
})
866866

867867
It("should return correct replica for key", func() {
868-
client, err := client.ReplicaForKey(ctx, "test")
868+
client, err := client.SlaveForKey(ctx, "test")
869869
Expect(err).ToNot(HaveOccurred())
870870
info := client.Info(ctx, "server")
871871
Expect(info.Val()).Should(ContainSubstring("tcp_port:8224"))

0 commit comments

Comments
 (0)