mirror of
https://github.com/distribution/distribution
synced 2024-09-06 02:48:53 +00:00
![Stephen J Day](/assets/img/avatar_default.png)
Back in the before time, the best practices surrounding usage of Context weren't quite worked out. We defined our own type to make usage easier. As this packaged was used elsewhere, it make it more and more challenging to integrate with the forked `Context` type. Now that it is available in the standard library, we can just use that one directly. To make usage more consistent, we now use `dcontext` when referring to the distribution context package. Signed-off-by: Stephen J Day <stephen.day@docker.com>
27 lines
959 B
Go
27 lines
959 B
Go
package distribution
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
// TagService provides access to information about tagged objects.
|
|
type TagService interface {
|
|
// Get retrieves the descriptor identified by the tag. Some
|
|
// implementations may differentiate between "trusted" tags and
|
|
// "untrusted" tags. If a tag is "untrusted", the mapping will be returned
|
|
// as an ErrTagUntrusted error, with the target descriptor.
|
|
Get(ctx context.Context, tag string) (Descriptor, error)
|
|
|
|
// Tag associates the tag with the provided descriptor, updating the
|
|
// current association, if needed.
|
|
Tag(ctx context.Context, tag string, desc Descriptor) error
|
|
|
|
// Untag removes the given tag association
|
|
Untag(ctx context.Context, tag string) error
|
|
|
|
// All returns the set of tags managed by this tag service
|
|
All(ctx context.Context) ([]string, error)
|
|
|
|
// Lookup returns the set of tags referencing the given digest.
|
|
Lookup(ctx context.Context, digest Descriptor) ([]string, error)
|
|
}
|