cache

package
v27.0.0-rc.2+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2024 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, store ImageCacheStore, cacheFrom []string) (builder.ImageCache, error)

Types

type ImageCache

type ImageCache struct {
	// contains filtered or unexported fields
}

ImageCache is cache based on history objects. Requires initial set of images.

func (*ImageCache) GetCache

func (ic *ImageCache) GetCache(parentID string, cfg *containertypes.Config, platform ocispec.Platform) (string, error)

GetCache returns the image id found in the cache

func (*ImageCache) Populate

func (ic *ImageCache) Populate(image *image.Image)

Populate adds an image to the cache (to be queried later)

type ImageCacheStore

type ImageCacheStore interface {
	Get(image.ID) (*image.Image, error)
	GetByRef(ctx context.Context, refOrId string) (*image.Image, error)
	SetParent(target, parent image.ID) error
	GetParent(target image.ID) (image.ID, error)
	Create(parent *image.Image, image image.Image, extraLayer layer.DiffID) (image.ID, error)
	IsBuiltLocally(id image.ID) (bool, error)
	Children(id image.ID) []image.ID
}

type LocalImageCache

type LocalImageCache struct {
	// contains filtered or unexported fields
}

LocalImageCache is cache based on parent chain.

func (*LocalImageCache) GetCache

func (lic *LocalImageCache) GetCache(imgID string, config *containertypes.Config, platform ocispec.Platform) (string, error)

GetCache returns the image id found in the cache

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL