Documentation
¶
Overview ¶
Package vulnmdsrc exposes functions to dynamically register vulnerability metadata sources used to update a Clair database.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAppender ¶
RegisterAppender makes an Appender available by the provided name.
If called twice with the same name, the name is blank, or if the provided Appender is nil, this function panics.
Types ¶
type AppendFunc ¶
type AppendFunc func(metadataKey string, metadata MetadataEnricher, severity database.Severity)
AppendFunc is the type of a callback provided to an Appender.
type Appender ¶
type Appender interface {
// BuildCache loads metadata into memory such that it can be quickly accessed
// for future calls to Append.
BuildCache(database.Datastore) error
// AddMetadata adds metadata to the given database.Vulnerability.
// It is expected that the fetcher uses .Lock.Lock() when manipulating the Metadata map.
// Append
Append(name string, subCVEs []string, callback AppendFunc) error
// PurgeCache deallocates metadata from memory after all calls to Append are
// finished.
PurgeCache()
// Clean deletes any allocated resources.
// It is invoked when Clair stops.
Clean()
}
Appender represents anything that can fetch vulnerability metadata and append it to a Vulnerability.
type MetadataEnricher ¶
type MetadataEnricher interface {
Metadata() interface{}
Summary() string
}
Click to show internal directories.
Click to hide internal directories.