0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-23 22:27:35 -05:00
zot/pkg/storage/cache/cacheinterface.go

26 lines
639 B
Go
Raw Normal View History

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
// UsesRelativePaths returns if cache is storing blobs relative to cache rootDir
UsesRelativePaths() bool
}