vulnmdsrc

package
v2.0.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

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 Appenders

func Appenders() map[string]Appender

Appenders returns the list of the registered Appenders.

func RegisterAppender

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.

Types

type AppendFunc

type AppendFunc func(metadataKey string, metadata interface{}, 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(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

Path Synopsis
Package nvd implements a vulnerability metadata appender using the NIST NVD database.
Package nvd implements a vulnerability metadata appender using the NIST NVD database.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL