()
| 247 | } |
| 248 | |
| 249 | func (c *Client) SlotsInfo() (map[int]int, error) { |
| 250 | if reply, err := c.Do("SLOTSINFO"); err != nil { |
| 251 | return nil, errors.Trace(err) |
| 252 | } else { |
| 253 | infos, err := redigo.Values(reply, nil) |
| 254 | if err != nil { |
| 255 | return nil, errors.Trace(err) |
| 256 | } |
| 257 | slots := make(map[int]int) |
| 258 | for i, info := range infos { |
| 259 | p, err := redigo.Ints(info, nil) |
| 260 | if err != nil || len(p) != 2 { |
| 261 | return nil, errors.Errorf("invalid response[%d] = %v", i, info) |
| 262 | } |
| 263 | slots[p[0]] = p[1] |
| 264 | } |
| 265 | return slots, nil |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | func (c *Client) Role() (string, error) { |
| 270 | if reply, err := c.Do("ROLE"); err != nil { |
no test coverage detected