Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrImageNotCached = errors.New("embedded image is not cached locally")
ErrImageNotCached is returned when an image is not present in the local store.
Functions ¶
func ResolveCacheDir ¶
ResolveCacheDir expands the configured cache dir or returns the default cache.
Types ¶
type ImageRef ¶
ImageRef identifies an OCI image by registry, repository, and tag or digest.
func ParseImageRef ¶
ParseImageRef normalizes a Docker/OCI image reference into structured fields.
type ImageStore ¶
type ImageStore struct {
Root string
}
ImageStore persists cached images using the OCI image layout spec.
func (*ImageStore) Delete ¶
func (s *ImageStore) Delete(ref string) error
Delete removes a cached image reference from the local store.
func (*ImageStore) Get ¶
func (s *ImageStore) Get(ref string) (v1.Image, error)
Get returns a cached image by its normalized reference.
func (*ImageStore) List ¶
func (s *ImageStore) List() ([]StoreEntry, error)
List returns all cached image entries sorted by most recent access.
func (*ImageStore) Put ¶
func (s *ImageStore) Put(ref string, img v1.Image) error
Put stores img as a single-image OCI layout keyed by ref.
func (*ImageStore) TotalSize ¶
func (s *ImageStore) TotalSize() (int64, error)
TotalSize returns the total on-disk size of all cached images.
type RegistryClient ¶
RegistryClient pulls OCI images into the local OCI layout cache.
func (*RegistryClient) GC ¶
func (r *RegistryClient) GC(ctx context.Context, keepN int) error
GC removes cached images outside the most recently used keepN entries.
type StoreEntry ¶
type StoreEntry struct {
Ref string `json:"ref"`
Digest string `json:"digest,omitempty"`
Size int64 `json:"size"`
Path string `json:"path"`
StoredAt time.Time `json:"storedAt,omitempty"`
AccessedAt time.Time `json:"accessedAt,omitempty"`
}
StoreEntry describes one cached OCI image.