| | |
| | | sources := []interface{}{} |
| | | for _, value := range dat["hits"].([]interface{}) { |
| | | source := value.(map[string]interface{})["_source"].(map[string]interface{}) |
| | | source["id"] = value.(map[string]interface{})["id"] |
| | | //source["id"] = source["id"] |
| | | /*sdkType := source["sdkType"] |
| | | if sdkType != nil { |
| | | sdk, _ := strconv.Atoi(sdkType.(string)) |
| | |
| | | } |
| | | return sources, nil |
| | | } |
| | | |
| | | func HttpGet(str string) ([]byte){ |
| | | resp, err := http.Get(str) |
| | | if err != nil { |
| | | // handle error |
| | | } |
| | | |
| | | defer resp.Body.Close() |
| | | body, err := ioutil.ReadAll(resp.Body) |
| | | if err != nil { |
| | | // handle error |
| | | } |
| | | return body |
| | | } |