Documentation
¶
Index ¶
Constants ¶
View Source
const (
DefaultDir = "/cache"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) File ¶
File places the file identified by key at dest. The file is copied from the cache when present. Otherwise downloaded and placed into cache when the settings allow it
func (*Cache) Image ¶
func (c *Cache) Image(ctx context.Context, ref string, platform containerregistry.Platform, fetch ImageFetcher) (containerregistry.Image, error)
Image returns the container image identified by ref for the given platform. The image is served from the cache when present. Otherwise downloaded and cached when policy allows it.
type FileFetcher ¶
type FileFetcher func(ctx context.Context) (io.ReadCloser, error)
type ImageFetcher ¶
type ImageFetcher func(ctx context.Context) (containerregistry.Image, error)
type Mode ¶
type Mode string
const ( // Auto automatically pulls and caches artifacts into the image. Auto Mode = "auto" // Offline only uses cached artifacts in the image, does not download anything and fails when something is missing. Offline Mode = "offline" // Refresh checks to see if any cached artifacts are outdated and refreshes them. Refresh Mode = "refresh" // Off no writes or reads from the cache. Off Mode = "off" )
Click to show internal directories.
Click to hide internal directories.