Documentation ¶
Overview ¶
Package cache provides functionalities around the cache
Index ¶
- Constants
- func NewCachingImage(image imgutil.Image, cache *VolumeCache) imgutil.Image
- type CachingImage
- func (c *CachingImage) AddLayer(path string) error
- func (c *CachingImage) AddLayerWithDiffID(path string, diffID string) error
- func (c *CachingImage) AddLayerWithDiffIDAndHistory(path string, diffID string, history v1.History) error
- func (c *CachingImage) GetLayer(diffID string) (io.ReadCloser, error)
- func (c *CachingImage) ReuseLayer(diffID string) error
- func (c *CachingImage) ReuseLayerWithHistory(diffID string, history v1.History) error
- func (c *CachingImage) Save(additionalNames ...string) error
- func (c *CachingImage) SaveAs(name string, additionalNames ...string) error
- type ImageCache
- func (c *ImageCache) AddLayerFile(tarPath string, diffID string) error
- func (c *ImageCache) Commit() error
- func (c *ImageCache) Exists() bool
- func (c *ImageCache) Name() string
- func (c *ImageCache) RetrieveLayer(diffID string) (io.ReadCloser, error)
- func (c *ImageCache) RetrieveMetadata() (platform.CacheMetadata, error)
- func (c *ImageCache) ReuseLayer(diffID string) error
- func (c *ImageCache) SetMetadata(metadata platform.CacheMetadata) error
- func (c *ImageCache) VerifyLayer(_ string) error
- type ImageComparer
- type ImageComparerImpl
- type ImageDeleter
- type ImageDeleterImpl
- type ReadErr
- type VolumeCache
- func (c *VolumeCache) AddLayer(rc io.ReadCloser, diffID string) error
- func (c *VolumeCache) AddLayerFile(tarPath string, diffID string) error
- func (c *VolumeCache) Commit() error
- func (c *VolumeCache) Exists() bool
- func (c *VolumeCache) HasLayer(diffID string) (bool, error)
- func (c *VolumeCache) Name() string
- func (c *VolumeCache) RetrieveLayer(diffID string) (io.ReadCloser, error)
- func (c *VolumeCache) RetrieveLayerFile(diffID string) (string, error)
- func (c *VolumeCache) RetrieveMetadata() (platform.CacheMetadata, error)
- func (c *VolumeCache) ReuseLayer(diffID string) error
- func (c *VolumeCache) SetMetadata(metadata platform.CacheMetadata) error
- func (c *VolumeCache) VerifyLayer(diffID string) error
Constants ¶
const MetadataLabel = "io.buildpacks.lifecycle.cache.metadata"
Variables ¶
This section is empty.
Functions ¶
func NewCachingImage ¶
func NewCachingImage(image imgutil.Image, cache *VolumeCache) imgutil.Image
Types ¶
type CachingImage ¶ added in v0.14.1
func (*CachingImage) AddLayer ¶ added in v0.14.1
func (c *CachingImage) AddLayer(path string) error
func (*CachingImage) AddLayerWithDiffID ¶ added in v0.14.1
func (c *CachingImage) AddLayerWithDiffID(path string, diffID string) error
func (*CachingImage) AddLayerWithDiffIDAndHistory ¶ added in v0.17.0
func (*CachingImage) GetLayer ¶ added in v0.14.1
func (c *CachingImage) GetLayer(diffID string) (io.ReadCloser, error)
func (*CachingImage) ReuseLayer ¶ added in v0.14.1
func (c *CachingImage) ReuseLayer(diffID string) error
func (*CachingImage) ReuseLayerWithHistory ¶ added in v0.17.0
func (c *CachingImage) ReuseLayerWithHistory(diffID string, history v1.History) error
func (*CachingImage) Save ¶ added in v0.14.1
func (c *CachingImage) Save(additionalNames ...string) error
type ImageCache ¶
type ImageCache struct {
// contains filtered or unexported fields
}
func NewImageCache ¶
func NewImageCache(origImage imgutil.Image, newImage imgutil.Image, logger log.Logger, imageDeleter ImageDeleter) *ImageCache
NewImageCache creates a new ImageCache instance
func NewImageCacheFromName ¶
func NewImageCacheFromName(name string, keychain authn.Keychain, logger log.Logger, imageDeleter ImageDeleter) (*ImageCache, error)
NewImageCacheFromName creates a new ImageCache from the name that has been provided
func (*ImageCache) AddLayerFile ¶
func (c *ImageCache) AddLayerFile(tarPath string, diffID string) error
func (*ImageCache) Commit ¶
func (c *ImageCache) Commit() error
func (*ImageCache) Exists ¶ added in v0.10.0
func (c *ImageCache) Exists() bool
func (*ImageCache) Name ¶
func (c *ImageCache) Name() string
func (*ImageCache) RetrieveLayer ¶
func (c *ImageCache) RetrieveLayer(diffID string) (io.ReadCloser, error)
RetrieveLayer retrieves a layer from the cache
func (*ImageCache) RetrieveMetadata ¶
func (c *ImageCache) RetrieveMetadata() (platform.CacheMetadata, error)
func (*ImageCache) ReuseLayer ¶
func (c *ImageCache) ReuseLayer(diffID string) error
func (*ImageCache) SetMetadata ¶
func (c *ImageCache) SetMetadata(metadata platform.CacheMetadata) error
func (*ImageCache) VerifyLayer ¶ added in v0.20.4
func (c *ImageCache) VerifyLayer(_ string) error
VerifyLayer returns an error if the layer contents do not match the provided sha.
type ImageComparer ¶ added in v0.18.0
ImageComparer provides a way to compare images
type ImageComparerImpl ¶ added in v0.18.0
type ImageComparerImpl struct{}
ImageComparerImpl implements the ImageComparer interface
func NewImageComparer ¶ added in v0.18.0
func NewImageComparer() *ImageComparerImpl
NewImageComparer instantiate ImageComparerImpl
type ImageDeleter ¶ added in v0.18.0
type ImageDeleter interface { DeleteOrigImageIfDifferentFromNewImage(origImage, newImage imgutil.Image) DeleteImage(image imgutil.Image) }
ImageDeleter defines the methods available to delete and compare cached images
type ImageDeleterImpl ¶ added in v0.18.0
type ImageDeleterImpl struct {
// contains filtered or unexported fields
}
ImageDeleterImpl is a component to manage cache image deletion
func NewImageDeleter ¶ added in v0.18.0
func NewImageDeleter(comparer ImageComparer, logger log.Logger, deletionEnabled bool) *ImageDeleterImpl
NewImageDeleter creates a new ImageDeleter implementation
func (*ImageDeleterImpl) DeleteImage ¶ added in v0.20.0
func (c *ImageDeleterImpl) DeleteImage(image imgutil.Image)
DeleteImage deletes an image
func (*ImageDeleterImpl) DeleteOrigImageIfDifferentFromNewImage ¶ added in v0.18.0
func (c *ImageDeleterImpl) DeleteOrigImageIfDifferentFromNewImage(origImage, newImage imgutil.Image)
DeleteOrigImageIfDifferentFromNewImage compares the two images, and it tries to delete it if they are not the same
type ReadErr ¶ added in v0.20.0
type ReadErr struct {
// contains filtered or unexported fields
}
ReadErr is an error type for filesystem read errors.
func NewReadErr ¶ added in v0.20.0
NewReadErr creates a new ReadErr.
type VolumeCache ¶
type VolumeCache struct {
// contains filtered or unexported fields
}
func NewVolumeCache ¶
func NewVolumeCache(dir string, logger log.Logger) (*VolumeCache, error)
NewVolumeCache creates a new VolumeCache
func (*VolumeCache) AddLayer ¶
func (c *VolumeCache) AddLayer(rc io.ReadCloser, diffID string) error
func (*VolumeCache) AddLayerFile ¶
func (c *VolumeCache) AddLayerFile(tarPath string, diffID string) error
func (*VolumeCache) Commit ¶
func (c *VolumeCache) Commit() error
func (*VolumeCache) Exists ¶ added in v0.10.0
func (c *VolumeCache) Exists() bool
func (*VolumeCache) Name ¶
func (c *VolumeCache) Name() string
func (*VolumeCache) RetrieveLayer ¶
func (c *VolumeCache) RetrieveLayer(diffID string) (io.ReadCloser, error)
func (*VolumeCache) RetrieveLayerFile ¶
func (c *VolumeCache) RetrieveLayerFile(diffID string) (string, error)
func (*VolumeCache) RetrieveMetadata ¶
func (c *VolumeCache) RetrieveMetadata() (platform.CacheMetadata, error)
func (*VolumeCache) ReuseLayer ¶
func (c *VolumeCache) ReuseLayer(diffID string) error
func (*VolumeCache) SetMetadata ¶
func (c *VolumeCache) SetMetadata(metadata platform.CacheMetadata) error
func (*VolumeCache) VerifyLayer ¶ added in v0.20.4
func (c *VolumeCache) VerifyLayer(diffID string) error
VerifyLayer returns an error if the layer contents do not match the provided sha.