2022-11-02 17:53:08 -05:00
|
|
|
package cache
|
|
|
|
|
|
|
|
import (
|
|
|
|
godigest "github.com/opencontainers/go-digest"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Cache interface {
|
|
|
|
// Returns the human-readable "name" of the driver.
|
|
|
|
Name() string
|
|
|
|
|
|
|
|
// Retrieves the blob matching provided digest.
|
|
|
|
GetBlob(digest godigest.Digest) (string, error)
|
|
|
|
|
|
|
|
// Uploads blob to cachedb.
|
|
|
|
PutBlob(digest godigest.Digest, path string) error
|
|
|
|
|
|
|
|
// Check if blob exists in cachedb.
|
|
|
|
HasBlob(digest godigest.Digest, path string) bool
|
|
|
|
|
|
|
|
// Delete a blob from the cachedb.
|
|
|
|
DeleteBlob(digest godigest.Digest, path string) error
|
2023-09-01 12:54:39 -05:00
|
|
|
|
|
|
|
// UsesRelativePaths returns if cache is storing blobs relative to cache rootDir
|
|
|
|
UsesRelativePaths() bool
|
2022-11-02 17:53:08 -05:00
|
|
|
}
|