reg/registry/ping.go
Jess Frazelle 3075c58bc1
add vulns command
Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-02-12 18:45:47 -08:00

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
}