MCPcopy Create free account
hub / github.com/docker/go-plugins-helpers / callURL

Function callURL

authorization/api_test.go:193–214  ·  view source on GitHub ↗
(url string)

Source from the content-addressed store, hash-verified

191}
192
193func callURL(url string) {
194 c := http.Client{
195 Timeout: 10 * time.Millisecond,
196 }
197 res := make(chan interface{}, 1)
198 go func() {
199 for {
200 _, err := c.Get(url)
201 if err == nil {
202 res <- nil
203 }
204 }
205 }()
206
207 select {
208 case <-res:
209 return
210 case <-time.After(5 * time.Second):
211 fmt.Printf("Timeout connecting to %s\n", url)
212 os.Exit(1)
213 }
214}
215
216func TestMain(m *testing.M) {
217 d := &TestPlugin{}

Callers 1

TestMainFunction · 0.70

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…