Merge pull request #1 from go-redis/master

Updating repo w/ master
This commit is contained in:
Jake Gregg 2019-01-31 15:41:25 -08:00 committed by GitHub
commit 0e69501b5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -637,6 +637,12 @@ var _ = Describe("ClusterClient", func() {
Expect(hashSlot).To(Equal(int64(hashtag.Slot("somekey")))) 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() { It("should CLUSTER COUNT-FAILURE-REPORTS", func() {
n, err := client.ClusterCountFailureReports(cluster.nodeIds[0]).Result() n, err := client.ClusterCountFailureReports(cluster.nodeIds[0]).Result()
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred())

View File

@ -270,6 +270,7 @@ type Cmdable interface {
ClusterResetHard() *StatusCmd ClusterResetHard() *StatusCmd
ClusterInfo() *StringCmd ClusterInfo() *StringCmd
ClusterKeySlot(key string) *IntCmd ClusterKeySlot(key string) *IntCmd
ClusterGetKeysInSlot(slot int, count int) *StringSliceCmd
ClusterCountFailureReports(nodeID string) *IntCmd ClusterCountFailureReports(nodeID string) *IntCmd
ClusterCountKeysInSlot(slot int) *IntCmd ClusterCountKeysInSlot(slot int) *IntCmd
ClusterDelSlots(slots ...int) *StatusCmd ClusterDelSlots(slots ...int) *StatusCmd
@ -2402,6 +2403,12 @@ func (c *cmdable) ClusterKeySlot(key string) *IntCmd {
return cmd 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 { func (c *cmdable) ClusterCountFailureReports(nodeID string) *IntCmd {
cmd := NewIntCmd("cluster", "count-failure-reports", nodeID) cmd := NewIntCmd("cluster", "count-failure-reports", nodeID)
c.process(cmd) c.process(cmd)