clair: github.com/coreos/clair/ext/vulnmdsrc Index | Files | Directories

package vulnmdsrc

import "github.com/coreos/clair/ext/vulnmdsrc"

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

Index

Package Files

driver.go

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.
    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.

Directories

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

Package vulnmdsrc imports 2 packages (graph) and is imported by 12 packages. Updated 2019-03-22. Refresh now. Tools for package owners.