mirror of
https://github.com/project-zot/zot.git
synced 2024-12-23 22:27:35 -05:00
4170d2adbc
Moved boltdb to a driver implementation for such interface Added CreateCacheDatabaseDriver in controller Fixed default directory creation (boltDB will only create the file, not the dir Added coverage tests Added example config for boltdb Re-added caching on subpaths, rewrote CreateCacheDatabaseDriver Fix tests Made cacheDriver argument mandatory for NewImageStore, added more validation, added defaults Moved cache interface to own file, removed useRelPaths from config Got rid of cache config, refactored Moved cache to own package and folder Renamed + removed cache factory to backend, replaced CloudCache to RemoteCache Moved storage constants back to storage package moved cache interface and factory to storage package, changed remoteCache defaulting Signed-off-by: Catalin Hofnar <catalin.hofnar@gmail.com>
22 lines
530 B
Go
22 lines
530 B
Go
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
|
|
}
|