Skip to content

Commit

Permalink
Merge pull request redis#1 from go-redis/master
Browse files Browse the repository at this point in the history
Updating repo w/ master
  • Loading branch information
greggjs authored Jan 31, 2019
2 parents 40336e5 + 0d65bf5 commit 0e69501
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,12 @@ var _ = Describe("ClusterClient", func() {
Expect(hashSlot).To(Equal(int64(hashtag.Slot("somekey"))))
})

It("should CLUSTER GETKEYSINSLOT", func() {
keys, err := client.ClusterGetKeysInSlot(hashtag.Slot("somekey"), 1).Result()
Expect(err).NotTo(HaveOccurred())
Expect(len(keys)).To(Equal(0))
})

It("should CLUSTER COUNT-FAILURE-REPORTS", func() {
n, err := client.ClusterCountFailureReports(cluster.nodeIds[0]).Result()
Expect(err).NotTo(HaveOccurred())
Expand Down
7 changes: 7 additions & 0 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ type Cmdable interface {
ClusterResetHard() *StatusCmd
ClusterInfo() *StringCmd
ClusterKeySlot(key string) *IntCmd
ClusterGetKeysInSlot(slot int, count int) *StringSliceCmd
ClusterCountFailureReports(nodeID string) *IntCmd
ClusterCountKeysInSlot(slot int) *IntCmd
ClusterDelSlots(slots ...int) *StatusCmd
Expand Down Expand Up @@ -2402,6 +2403,12 @@ func (c *cmdable) ClusterKeySlot(key string) *IntCmd {
return cmd
}

func (c *cmdable) ClusterGetKeysInSlot(slot int, count int) *StringSliceCmd {
cmd := NewStringSliceCmd("cluster", "getkeysinslot", slot, count)
c.process(cmd)
return cmd
}

func (c *cmdable) ClusterCountFailureReports(nodeID string) *IntCmd {
cmd := NewIntCmd("cluster", "count-failure-reports", nodeID)
c.process(cmd)
Expand Down

0 comments on commit 0e69501

Please sign in to comment.