Catalog for V2 API Implementation

This change adds a basic catalog endpoint to the API, which returns a list,
or partial list, of all of the repositories contained in the registry.  Calls
to this endpoint are somewhat expensive, as every call requires walking a
large part of the registry.

Instead, to maintain a list of repositories, you would first call the catalog
endpoint to get an initial list, and then use the events API to maintain
any future repositories.

Signed-off-by: Patrick Devine <patrick.devine@docker.com>
This commit is contained in:
Patrick Devine 2015-07-13 13:08:13 -07:00
parent 006214d902
commit 74563efe98
12 changed files with 577 additions and 1 deletions

View file

@ -35,6 +35,9 @@ type Namespace interface {
// registry may or may not have the repository but should always return a
// reference.
Repository(ctx context.Context, name string) (Repository, error)
// Catalog returns a reference which can be used for listing repositories
Catalog(ctx context.Context) CatalogService
}
// ManifestServiceOption is a function argument for Manifest Service methods
@ -112,3 +115,9 @@ type SignatureService interface {
// Put stores the signature for the provided digest.
Put(dgst digest.Digest, signatures ...[]byte) error
}
// CatalogService provides a way of retrieving the names of each of the repositories
type CatalogService interface {
// Get retrieves repository names from the registry.
Get(n int, q string) (p []string, moreEntries bool, err error)
}