(slot int, target string)
| 206 | } |
| 207 | |
| 208 | func (c *Client) MigrateSlot(slot int, target string) (int, error) { |
| 209 | host, port, err := net.SplitHostPort(target) |
| 210 | if err != nil { |
| 211 | return 0, errors.Trace(err) |
| 212 | } |
| 213 | mseconds := int(c.Timeout / time.Millisecond) |
| 214 | if reply, err := c.Do("SLOTSMGRTTAGSLOT", host, port, mseconds, slot); err != nil { |
| 215 | return 0, errors.Trace(err) |
| 216 | } else { |
| 217 | p, err := redigo.Ints(redigo.Values(reply, nil)) |
| 218 | if err != nil || len(p) != 2 { |
| 219 | return 0, errors.Errorf("invalid response = %v", reply) |
| 220 | } |
| 221 | return p[1], nil |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | type MigrateSlotAsyncOption struct { |
| 226 | MaxBulks int |
no test coverage detected