mirror of
https://github.com/regclient/regclient.git
synced 2025-04-17 11:37:11 +03:00
- Adds a struct to the return so headers can be inspected. - Puts Ping into the scheme interface. - Adds an ocidir implementation to verify directory is accessible. - Fixes some http/auth handling. - Warns on `regctl registry config` and `login` of Ping failure. Signed-off-by: Brandon Mitchell <git@bmitch.net>
19 lines
390 B
Go
19 lines
390 B
Go
package regclient
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/regclient/regclient/types/ping"
|
|
"github.com/regclient/regclient/types/ref"
|
|
)
|
|
|
|
// Ping verifies access to a registry or equivalent.
|
|
func (rc *RegClient) Ping(ctx context.Context, r ref.Ref) (ping.Result, error) {
|
|
schemeAPI, err := rc.schemeGet(r.Scheme)
|
|
if err != nil {
|
|
return ping.Result{}, err
|
|
}
|
|
|
|
return schemeAPI.Ping(ctx, r)
|
|
}
|