blobcache

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: Apache-2.0 Imports: 21 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheLookupReferenceFunc added in v1.21.0

func CacheLookupReferenceFunc(directory string, compress types.LayerCompression) libimage.LookupReferenceFunc

CacheLookupReferenceFunc wraps a BlobCache into a libimage.LookupReferenceFunc to allow for using a BlobCache during image-copy operations.

Types

type BlobCache

type BlobCache interface {
	types.ImageReference
	// HasBlob checks if a blob that matches the passed-in digest (and
	// size, if not -1), is present in the cache.
	HasBlob(types.BlobInfo) (bool, int64, error)
	// Directories returns the list of cache directories.
	Directory() string
	// ClearCache() clears the contents of the cache directories.  Note
	// that this also clears content which was not placed there by this
	// cache implementation.
	ClearCache() error
}

BlobCache is an object which saves copies of blobs that are written to it while passing them through to some real destination, and which can be queried directly in order to read them back.

func NewBlobCache

func NewBlobCache(ref types.ImageReference, directory string, compress types.LayerCompression) (BlobCache, error)

NewBlobCache creates a new blob cache that wraps an image reference. Any blobs which are written to the destination image created from the resulting reference will also be stored as-is to the specified directory or a temporary directory. The cache directory's contents can be cleared by calling the returned BlobCache()'s ClearCache() method. The compress argument controls whether or not the cache will try to substitute a compressed or different version of a blob when preparing the list of layers when reading an image.

Jump to

Keyboard shortcuts

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