Add labels and fileters to content

Update list content command to support filters
Add label subcommand to content in dist tool to update labels
Add uncompressed label on unpack

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan
2017-07-05 17:00:11 -07:00
parent 1a49f5ea79
commit fba7463ed3
14 changed files with 973 additions and 160 deletions

View File

@@ -32,6 +32,8 @@ type Info struct {
Digest digest.Digest
Size int64
CommittedAt time.Time
UpdatedAt time.Time
Labels map[string]string
}
type Status struct {
@@ -53,8 +55,17 @@ type Manager interface {
// If the content is not present, ErrNotFound will be returned.
Info(ctx context.Context, dgst digest.Digest) (Info, error)
// Walk will call fn for each item in the content store.
Walk(ctx context.Context, fn WalkFunc) error
// Update updates mutable information related to content.
// If one or more fieldpaths are provided, only those
// fields will be updated.
// Mutable fields:
// labels.*
Update(ctx context.Context, info Info, fieldpaths ...string) error
// Walk will call fn for each item in the content store which
// match the provided filters. If no filters are given all
// items will be walked.
Walk(ctx context.Context, fn WalkFunc, filters ...string) error
// Delete removes the content from the store.
Delete(ctx context.Context, dgst digest.Digest) error