Allow conditional fetching of manifests with the registry client.

Add a functional argument to pass a digest to (ManifestService).GetByTag().
If the digest matches an empty manifest and nil error are returned.

See 1bc740b0d5 for server implementation.

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
This commit is contained in:
Richard Scothern 2015-07-14 16:25:37 -07:00
parent 79a4ca2abe
commit 48a2010ac3
6 changed files with 116 additions and 24 deletions

View file

@ -37,6 +37,9 @@ type Namespace interface {
Repository(ctx context.Context, name string) (Repository, error)
}
// ManifestServiceOption is a function argument for Manifest Service methods
type ManifestServiceOption func(ManifestService) error
// Repository is a named collection of manifests and layers.
type Repository interface {
// Name returns the name of the repository.
@ -84,7 +87,7 @@ type ManifestService interface {
ExistsByTag(tag string) (bool, error)
// GetByTag retrieves the named manifest, if it exists.
GetByTag(tag string) (*manifest.SignedManifest, error)
GetByTag(tag string, options ...ManifestServiceOption) (*manifest.SignedManifest, error)
// TODO(stevvooe): There are several changes that need to be done to this
// interface: