mirror of
https://github.com/genuinetools/reg.git
synced 2024-09-11 22:01:02 -04:00
13 lines
282 B
Go
13 lines
282 B
Go
![]() |
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
|
||
|
}
|