(client *Client, names []string)
| 219 | } |
| 220 | |
| 221 | func (s *Sentinel) existsCommand(client *Client, names []string) (map[string]bool, error) { |
| 222 | go func() { |
| 223 | for _, name := range names { |
| 224 | client.Send("SENTINEL", "get-master-addr-by-name", name) |
| 225 | } |
| 226 | if len(names) != 0 { |
| 227 | client.Flush() |
| 228 | } |
| 229 | }() |
| 230 | exists := make(map[string]bool, len(names)) |
| 231 | for _, name := range names { |
| 232 | r, err := client.Receive() |
| 233 | if err != nil { |
| 234 | return nil, errors.Trace(err) |
| 235 | } |
| 236 | exists[name] = (r != nil) |
| 237 | } |
| 238 | return exists, nil |
| 239 | } |
| 240 | |
| 241 | func (s *Sentinel) slavesCommand(client *Client, names []string) (map[string][]map[string]string, error) { |
| 242 | exists, err := s.existsCommand(client, names) |
no test coverage detected