/
githubmirror
/
trivy
Обзор
Документация
Войти
/
githubmirror
/
trivy
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
v0.63.0
pkg/cache/cache.go
49 строк
1 KB
Teppei Fukuda
refactor: use google/wire for cache (#7024)
27 июн 2024, 10:04
Не верифицирован
27 июн 2024, 10:04
4be02ba
Код
Авторство
О чём код?
package cache import ( "github.com/aquasecurity/trivy/pkg/fanal/types" ) const ( scanCacheDirName = "fanal" // artifactBucket stores artifact information with artifact ID such as image ID artifactBucket = "artifact" // blobBucket stores os, package and library information per blob ID such as layer ID blobBucket = "blob" ) type Cache interface { ArtifactCache LocalArtifactCache } // ArtifactCache uses local or remote cache type ArtifactCache interface { // MissingBlobs returns missing blob IDs such as layer IDs in cache MissingBlobs(artifactID string, blobIDs []string) (missingArtifact bool, missingBlobIDs []string, err error) // PutArtifact stores artifact information such as image metadata in cache PutArtifact(artifactID string, artifactInfo types.ArtifactInfo) (err error) // PutBlob stores blob information such as layer information in local cache PutBlob(blobID string, blobInfo types.BlobInfo) (err error) // DeleteBlobs removes blobs by IDs DeleteBlobs(blobIDs []string) error } // LocalArtifactCache always uses local cache type LocalArtifactCache interface { // GetArtifact gets artifact information such as image metadata from local cache GetArtifact(artifactID string) (artifactInfo types.ArtifactInfo, err error) // GetBlob gets blob information such as layer data from local cache GetBlob(blobID string) (blobInfo types.BlobInfo, err error) // Close closes the local database Close() (err error) // Clear deletes the local database Clear() (err error) }