content: add InfoProvider interface

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan 2023-08-31 10:55:33 -07:00
parent b0a7f08aa7
commit f8c789f319
No known key found for this signature in database
GPG Key ID: F58C5D0A4405ACDB

View File

@ -87,9 +87,6 @@ type IngestManager interface {
} }
// Info holds content specific information // Info holds content specific information
//
// TODO(stevvooe): Consider a very different name for this struct. Info is way
// to general. It also reads very weird in certain context, like pluralization.
type Info struct { type Info struct {
Digest digest.Digest Digest digest.Digest
Size int64 Size int64
@ -111,12 +108,17 @@ type Status struct {
// WalkFunc defines the callback for a blob walk. // WalkFunc defines the callback for a blob walk.
type WalkFunc func(Info) error type WalkFunc func(Info) error
// Manager provides methods for inspecting, listing and removing content. // InfoProvider provides info for content inspection.
type Manager interface { type InfoProvider interface {
// Info will return metadata about content available in the content store. // Info will return metadata about content available in the content store.
// //
// If the content is not present, ErrNotFound will be returned. // If the content is not present, ErrNotFound will be returned.
Info(ctx context.Context, dgst digest.Digest) (Info, error) Info(ctx context.Context, dgst digest.Digest) (Info, error)
}
// Manager provides methods for inspecting, listing and removing content.
type Manager interface {
InfoProvider
// Update updates mutable information related to content. // Update updates mutable information related to content.
// If one or more fieldpaths are provided, only those // If one or more fieldpaths are provided, only those