forked from regclient/regclient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
repo.go
28 lines (23 loc) · 762 Bytes
/
repo.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package regclient
import (
"context"
"github.com/regclient/regclient/scheme"
"github.com/regclient/regclient/types"
"github.com/regclient/regclient/types/repo"
)
type repoLister interface {
RepoList(ctx context.Context, hostname string, opts ...scheme.RepoOpts) (*repo.RepoList, error)
}
// RepoList returns a list of repositories on a registry
// Note the underlying "_catalog" API is not supported on many cloud registries
func (rc *RegClient) RepoList(ctx context.Context, hostname string, opts ...scheme.RepoOpts) (*repo.RepoList, error) {
schemeAPI, err := rc.schemeGet("reg")
if err != nil {
return nil, err
}
rl, ok := schemeAPI.(repoLister)
if !ok {
return nil, types.ErrNotImplemented
}
return rl.RepoList(ctx, hostname, opts...)
}