diff --git a/commands.go b/commands.go index 85262cc..6e873f2 100644 --- a/commands.go +++ b/commands.go @@ -231,6 +231,7 @@ type Cmdable interface { ClientKillByFilter(keys ...string) *IntCmd ClientList() *StringCmd ClientPause(dur time.Duration) *BoolCmd + ClientId() *IntCmd ConfigGet(parameter string) *SliceCmd ConfigResetStat() *StatusCmd ConfigSet(parameter, value string) *StatusCmd @@ -2061,6 +2062,12 @@ func (c *cmdable) ClientPause(dur time.Duration) *BoolCmd { return cmd } +func (c *cmdable) ClientId() *IntCmd { + cmd := NewIntCmd("client", "id") + c.process(cmd) + return cmd +} + // ClientSetName assigns a name to the connection. func (c *statefulCmdable) ClientSetName(name string) *BoolCmd { cmd := NewBoolCmd("client", "setname", name) diff --git a/commands_test.go b/commands_test.go index 2dba77c..ecca35c 100644 --- a/commands_test.go +++ b/commands_test.go @@ -121,6 +121,12 @@ var _ = Describe("Commands", func() { Expect(r.Val()).To(Equal(int64(0))) }) + It("should ClientId", func() { + err := client.ClientId().Err() + Expect(err).NotTo(HaveOccurred()) + Expect(client.ClientId().Val()).To(BeNumerically(">=", 0)) + }) + It("should ClientPause", func() { err := client.ClientPause(time.Second).Err() Expect(err).NotTo(HaveOccurred()) @@ -222,7 +228,7 @@ var _ = Describe("Commands", func() { Expect(tm).To(BeTemporally("~", time.Now(), 3*time.Second)) }) - It("Should Command", func() { + It("should Command", func() { cmds, err := client.Command().Result() Expect(err).NotTo(HaveOccurred()) Expect(len(cmds)).To(BeNumerically("~", 200, 20))