API to retrive tag's digests

Add an interface alongside TagStore that provides API to retreive
digests of all manifests that a tag historically pointed to. It also
includes currently linked tag.

Signed-off-by: Manish Tomar <manish.tomar@docker.com>
This commit is contained in:
Manish Tomar 2018-10-29 18:19:05 -07:00
parent 1cb4180b1a
commit 9ebf151ac2
3 changed files with 128 additions and 1 deletions

View file

@ -2,6 +2,8 @@ package distribution
import (
"context"
digest "github.com/opencontainers/go-digest"
)
// TagService provides access to information about tagged objects.
@ -25,3 +27,10 @@ type TagService interface {
// Lookup returns the set of tags referencing the given digest.
Lookup(ctx context.Context, digest Descriptor) ([]string, error)
}
// TagIndexes proves method to retreive all the digests that a tag historically pointed to
type TagIndexes interface {
// Indexes returns set of digests that this tag historically pointed to. This also includes
// currently linked digest. There is no ordering guaranteed
Indexes(ctx context.Context, tag string) ([]digest.Digest, error)
}