| 213 | } |
| 214 | |
| 215 | func getBootIps(bootStrapUrl string) []string { |
| 216 | req, err := http.NewRequest("GET", bootStrapUrl, nil) |
| 217 | client := &http.Client{} |
| 218 | resp, err := client.Do(req) |
| 219 | if err != nil { |
| 220 | return nil |
| 221 | } |
| 222 | defer resp.Body.Close() |
| 223 | r, err := ioutil.ReadAll(resp.Body) |
| 224 | |
| 225 | str := string(r) |
| 226 | strlist := strings.Split(str, ",") |
| 227 | nodeIPs := make([]string, len(strlist)-1) |
| 228 | for i := 0; i < len(strlist)-1; i++ { |
| 229 | nodeIPs[i] = strlist[i] |
| 230 | } |
| 231 | return nodeIPs |
| 232 | } |
| 233 | |
| 234 | func unique(intSlice []string) []string { |
| 235 | keys := make(map[string]bool) |