mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
add InfoMap command (#2665)
Add an extended version of Info() to parse the results from a call to redis.Info so that it’s simpler to operate on any given item in the result. Signed-off-by: Nic Gibson <nic.gibson@redis.com>
This commit is contained in:
@ -335,6 +335,20 @@ var _ = Describe("Commands", func() {
|
||||
Expect(info.Val()).NotTo(Equal(""))
|
||||
})
|
||||
|
||||
It("should InfoMap", Label("redis.info"), func() {
|
||||
info := client.InfoMap(ctx)
|
||||
Expect(info.Err()).NotTo(HaveOccurred())
|
||||
Expect(info.Val()).NotTo(BeNil())
|
||||
|
||||
info = client.InfoMap(ctx, "dummy")
|
||||
Expect(info.Err()).NotTo(HaveOccurred())
|
||||
Expect(info.Val()).To(BeNil())
|
||||
|
||||
info = client.InfoMap(ctx, "server")
|
||||
Expect(info.Err()).NotTo(HaveOccurred())
|
||||
Expect(info.Val()).To(HaveLen(1))
|
||||
})
|
||||
|
||||
It("should Info cpu", func() {
|
||||
info := client.Info(ctx, "cpu")
|
||||
Expect(info.Err()).NotTo(HaveOccurred())
|
||||
|
Reference in New Issue
Block a user