Documentation
¶
Index ¶
- func CalcKey(id string, analyzerVersions analyzer.Versions, hookVersions map[string]int, ...) (string, error)
- func DefaultDir() string
- func GetTLSConfig(caCertPath, certPath, keyPath string) (*x509.CertPool, tls.Certificate, error)
- type ArtifactCache
- type Cache
- type FSCache
- func (fs FSCache) Clear() error
- func (fs FSCache) Close() error
- func (fs FSCache) DeleteBlobs(blobIDs []string) error
- func (fs FSCache) GetArtifact(artifactID string) (types.ArtifactInfo, error)
- func (fs FSCache) GetBlob(blobID string) (types.BlobInfo, error)
- func (fs FSCache) MissingBlobs(artifactID string, blobIDs []string) (bool, []string, error)
- func (fs FSCache) PutArtifact(artifactID string, artifactInfo types.ArtifactInfo) (err error)
- func (fs FSCache) PutBlob(blobID string, blobInfo types.BlobInfo) error
- type LocalArtifactCache
- type MemoryCache
- func (c *MemoryCache) BlobIDs() []string
- func (c *MemoryCache) Clear() error
- func (c *MemoryCache) Close() error
- func (c *MemoryCache) DeleteBlobs(blobIDs []string) error
- func (c *MemoryCache) GetArtifact(artifactID string) (types.ArtifactInfo, error)
- func (c *MemoryCache) GetBlob(blobID string) (types.BlobInfo, error)
- func (c *MemoryCache) MissingBlobs(artifactID string, blobIDs []string) (bool, []string, error)
- func (c *MemoryCache) PutArtifact(artifactID string, artifactInfo types.ArtifactInfo) error
- func (c *MemoryCache) PutBlob(blobID string, blobInfo types.BlobInfo) error
- type NopCache
- type Options
- type RedisCache
- func (c RedisCache) Clear() error
- func (c RedisCache) Close() error
- func (c RedisCache) DeleteBlobs(blobIDs []string) error
- func (c RedisCache) GetArtifact(artifactID string) (types.ArtifactInfo, error)
- func (c RedisCache) GetBlob(blobID string) (types.BlobInfo, error)
- func (c RedisCache) MissingBlobs(artifactID string, blobIDs []string) (bool, []string, error)
- func (c RedisCache) PutArtifact(artifactID string, artifactConfig types.ArtifactInfo) error
- func (c RedisCache) PutBlob(blobID string, blobInfo types.BlobInfo) error
- type RedisOptions
- type RedisTLSOptions
- type RemoteCache
- func (c RemoteCache) DeleteBlobs(blobIDs []string) error
- func (c RemoteCache) MissingBlobs(imageID string, layerIDs []string) (bool, []string, error)
- func (c RemoteCache) PutArtifact(imageID string, artifactInfo types.ArtifactInfo) error
- func (c RemoteCache) PutBlob(diffID string, blobInfo types.BlobInfo) error
- type RemoteOptions
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultDir ¶ added in v0.53.0
func DefaultDir() string
DefaultDir returns/creates the cache-dir to be used for trivy operations
func GetTLSConfig ¶ added in v0.53.0
GetTLSConfig gets tls config from CA, Cert and Key file
Types ¶
type ArtifactCache ¶ added in v0.53.0
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 }
ArtifactCache uses local or remote cache
type Cache ¶ added in v0.53.0
type Cache interface { ArtifactCache LocalArtifactCache }
type FSCache ¶ added in v0.53.0
type FSCache struct {
// contains filtered or unexported fields
}
func NewFSCache ¶ added in v0.53.0
func (FSCache) DeleteBlobs ¶ added in v0.53.0
DeleteBlobs removes blobs by IDs
func (FSCache) GetArtifact ¶ added in v0.53.0
func (fs FSCache) GetArtifact(artifactID string) (types.ArtifactInfo, error)
GetArtifact gets artifact information such as image metadata from local cache
func (FSCache) GetBlob ¶ added in v0.53.0
GetBlob gets blob information such as layer data from local cache
func (FSCache) MissingBlobs ¶ added in v0.53.0
MissingBlobs returns missing blob IDs such as layer IDs
func (FSCache) PutArtifact ¶ added in v0.53.0
func (fs FSCache) PutArtifact(artifactID string, artifactInfo types.ArtifactInfo) (err error)
PutArtifact stores artifact information such as image metadata in local cache
type LocalArtifactCache ¶ added in v0.53.0
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) }
LocalArtifactCache always uses local cache
type MemoryCache ¶ added in v0.53.0
type MemoryCache struct {
// contains filtered or unexported fields
}
func NewMemoryCache ¶ added in v0.53.0
func NewMemoryCache() *MemoryCache
func (*MemoryCache) BlobIDs ¶ added in v0.60.0
func (c *MemoryCache) BlobIDs() []string
BlobIDs returns all the blob IDs in the memory cache for testing
func (*MemoryCache) Clear ¶ added in v0.53.0
func (c *MemoryCache) Clear() error
Clear clears the artifact and blob information from the memory cache
func (*MemoryCache) Close ¶ added in v0.53.0
func (c *MemoryCache) Close() error
Close clears the artifact and blob information from the memory cache
func (*MemoryCache) DeleteBlobs ¶ added in v0.53.0
func (c *MemoryCache) DeleteBlobs(blobIDs []string) error
DeleteBlobs removes the specified blobs from the memory cache
func (*MemoryCache) GetArtifact ¶ added in v0.53.0
func (c *MemoryCache) GetArtifact(artifactID string) (types.ArtifactInfo, error)
GetArtifact retrieves the artifact information from the memory cache
func (*MemoryCache) GetBlob ¶ added in v0.53.0
func (c *MemoryCache) GetBlob(blobID string) (types.BlobInfo, error)
GetBlob retrieves the blob information from the memory cache
func (*MemoryCache) MissingBlobs ¶ added in v0.53.0
MissingBlobs determines the missing artifact and blob information in the memory cache
func (*MemoryCache) PutArtifact ¶ added in v0.53.0
func (c *MemoryCache) PutArtifact(artifactID string, artifactInfo types.ArtifactInfo) error
PutArtifact stores the artifact information in the memory cache
type NopCache ¶ added in v0.25.0
type NopCache struct{}
func NewNopCache ¶ added in v0.53.0
func NewNopCache() NopCache
func (NopCache) GetArtifact ¶ added in v0.53.0
func (NopCache) GetArtifact(string) (types.ArtifactInfo, error)
type RedisCache ¶ added in v0.53.0
type RedisCache struct {
// contains filtered or unexported fields
}
func NewRedisCache ¶ added in v0.53.0
func (RedisCache) Clear ¶ added in v0.53.0
func (c RedisCache) Clear() error
func (RedisCache) Close ¶ added in v0.53.0
func (c RedisCache) Close() error
func (RedisCache) DeleteBlobs ¶ added in v0.53.0
func (c RedisCache) DeleteBlobs(blobIDs []string) error
func (RedisCache) GetArtifact ¶ added in v0.53.0
func (c RedisCache) GetArtifact(artifactID string) (types.ArtifactInfo, error)
func (RedisCache) GetBlob ¶ added in v0.53.0
func (c RedisCache) GetBlob(blobID string) (types.BlobInfo, error)
func (RedisCache) MissingBlobs ¶ added in v0.53.0
func (RedisCache) PutArtifact ¶ added in v0.53.0
func (c RedisCache) PutArtifact(artifactID string, artifactConfig types.ArtifactInfo) error
type RedisOptions ¶ added in v0.53.0
type RedisOptions struct { Backend string TLS bool TLSOptions RedisTLSOptions }
func NewRedisOptions ¶ added in v0.53.0
func NewRedisOptions(backend, caCert, cert, key string, enableTLS bool) (RedisOptions, error)
func (*RedisOptions) BackendMasked ¶ added in v0.53.0
func (o *RedisOptions) BackendMasked() string
BackendMasked returns the redis connection string masking credentials
type RedisTLSOptions ¶ added in v0.53.0
RedisTLSOptions holds the options for redis cache
func NewRedisTLSOptions ¶ added in v0.53.0
func NewRedisTLSOptions(caCert, cert, key string) (RedisTLSOptions, error)
type RemoteCache ¶
type RemoteCache struct {
// contains filtered or unexported fields
}
RemoteCache implements remote cache
func NewRemoteCache ¶
func NewRemoteCache(opts RemoteOptions) *RemoteCache
NewRemoteCache is the factory method for RemoteCache
func (RemoteCache) DeleteBlobs ¶ added in v0.25.0
func (c RemoteCache) DeleteBlobs(blobIDs []string) error
DeleteBlobs removes blobs by IDs from RemoteCache
func (RemoteCache) MissingBlobs ¶ added in v0.9.0
MissingBlobs fetches missing blobs from RemoteCache
func (RemoteCache) PutArtifact ¶ added in v0.9.0
func (c RemoteCache) PutArtifact(imageID string, artifactInfo types.ArtifactInfo) error
PutArtifact sends artifact to remote client