mirror of
https://github.com/genuinetools/reg.git
synced 2024-07-04 12:34:17 -04:00
19 lines
410 B
Go
19 lines
410 B
Go
package registry
|
|
|
|
type catalogResponse struct {
|
|
Repositories []string `json:"repositories"`
|
|
}
|
|
|
|
// Catalog returns the repositories in a registry.
|
|
func (r *Registry) Catalog() ([]string, error) {
|
|
url := r.url("/v2/_catalog")
|
|
r.Logf("registry.catalog url=%s", url)
|
|
|
|
var response catalogResponse
|
|
if _, err := r.getJSON(url, &response); err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return response.Repositories, nil
|
|
}
|