Documentation
¶
Overview ¶
Package registrycatalog implements a minimal client for the Docker Registry HTTP API v2's catalog endpoints (_catalog, <name>/tags/list), used to browse repositories and tags in Levelrail's own built-in registry (internal/reconcile/registry) from the app-creation UI. Deliberately scoped to that one registry: see internal/api's RegistryCatalogClient interface doc comment for why an arbitrary external registry's catalog isn't queried the same way.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("registrycatalog: repository not found")
ErrNotFound reports that the registry has no such repository, the v2 API's own signal (a 404 from tags/list) for a name nothing has ever been pushed to, distinct from an unreachable registry or a rejected credential.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client queries a Docker Registry HTTP API v2 server's catalog endpoints over Basic Auth.
func NewClient ¶
func NewClient() *Client
NewClient returns a Client with a bounded per-request timeout: every call here is a single small JSON request, not a long-lived stream, the same shape githubapp.NewClient establishes for its own client.
func (*Client) ListRepositories ¶
func (c *Client) ListRepositories(ctx context.Context, baseURL, username, password string) ([]string, error)
ListRepositories queries GET {baseURL}/v2/_catalog, returning every repository name the registry knows about, sorted for a stable UI order (the wire response's own ordering is unspecified).
func (*Client) ListTags ¶
func (c *Client) ListTags(ctx context.Context, baseURL, username, password, repository string) ([]string, error)
ListTags queries GET {baseURL}/v2/{repository}/tags/list. repository may itself contain slashes (a namespaced name like "org/app"): it is path-escaped per segment, not as a whole, so those slashes still separate real path segments on the wire.