reg/registry/ping.go

13 lines
282 B
Go
Raw Normal View History

package registry
// Ping tries to contact a registry URL to make sure it is up and accessible.
func (r *Registry) Ping() error {
url := r.url("/v2/")
r.Logf("registry.ping url=%s", url)
resp, err := r.Client.Get(url)
if resp != nil {
defer resp.Body.Close()
}
return err
}