MCPcopy
hub / github.com/CodisLabs/codis / Info

Method Info

pkg/utils/redis/client.go:120–136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

118}
119
120func (c *Client) Info() (map[string]string, error) {
121 text, err := redigo.String(c.Do("INFO"))
122 if err != nil {
123 return nil, errors.Trace(err)
124 }
125 info := make(map[string]string)
126 for _, line := range strings.Split(text, "\n") {
127 kv := strings.SplitN(line, ":", 2)
128 if len(kv) != 2 {
129 continue
130 }
131 if key := strings.TrimSpace(kv[0]); key != "" {
132 info[key] = strings.TrimSpace(kv[1])
133 }
134 }
135 return info, nil
136}
137
138func (c *Client) InfoKeySpace() (map[int]string, error) {
139 text, err := redigo.String(c.Do("INFO", "keyspace"))

Callers 2

InfoFullMethod · 0.95
getSlowMethod · 0.95

Calls 2

DoMethod · 0.95
StringMethod · 0.45

Tested by

no test coverage detected