(url string, filters runtime.Filters)
| 109 | } |
| 110 | |
| 111 | func testURL(url string, filters runtime.Filters) (runtime.Result, error) { |
| 112 | resp, err := http.Get(url) |
| 113 | if err != nil { |
| 114 | return runtime.Result{}, err |
| 115 | } |
| 116 | defer resp.Body.Close() |
| 117 | |
| 118 | body, err := ioutil.ReadAll(resp.Body) |
| 119 | if err != nil { |
| 120 | return runtime.Result{}, err |
| 121 | } |
| 122 | |
| 123 | s := suite.ParseYAML(body, "") |
| 124 | |
| 125 | return execute(s, filters) |
| 126 | } |
| 127 | |
| 128 | func isURL(s string) bool { |
| 129 | return strings.HasPrefix(s, "http://") || strings.HasPrefix(s, "https://") |