clair: Index | Files | Directories

package vulnmdsrc

import ""

Package vulnmdsrc exposes functions to dynamically register vulnerability metadata sources used to update a Clair database.


Package Files


func Appenders Uses

func Appenders() map[string]Appender

Appenders returns the list of the registered Appenders.

func CleanAll Uses

func CleanAll()

CleanAll is a utility function that calls Clean() on every registered Appender.

func RegisterAppender Uses

func RegisterAppender(name string, a Appender)

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.

type AppendFunc Uses

type AppendFunc func(metadataKey string, metadata interface{}, severity database.Severity)

AppendFunc is the type of a callback provided to an Appender.

type Appender Uses

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(vulnName string, callback AppendFunc) error

    // PurgeCache deallocates metadata from memory after all calls to Append are
    // finished.

    // Clean deletes any allocated resources.
    // It is invoked when Clair stops.

Appender represents anything that can fetch vulnerability metadata and append it to a Vulnerability.


nvdPackage nvd implements a vulnerability metadata appender using the NIST NVD database.

Package vulnmdsrc imports 2 packages (graph) and is imported by 23 packages. Updated 2020-06-03. Refresh now. Tools for package owners.