data

package
v0.21.1-0...-a3b014d Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	DBSchemaVersion int
	// Data is the specific payload that should be written (usually a grype-db v*.Entry struct)
	Data interface{}
}

Entry is a data structure responsible for capturing an individual writable entry from a data.Processor (written by a data.Writer).

type GitHubTransformer

type GitHubTransformer func(entry unmarshal.GitHubAdvisory) ([]Entry, error)

type MSRCTransformer

type MSRCTransformer func(entry unmarshal.MSRCVulnerability) ([]Entry, error)

type MatchExclusionTransformer

type MatchExclusionTransformer func(entry unmarshal.MatchExclusion) ([]Entry, error)

type NVDTransformer

type NVDTransformer func(entry unmarshal.NVDVulnerability) ([]Entry, error)

type OSTransformer

type OSTransformer func(entry unmarshal.OSVulnerability) ([]Entry, error)

type Processor

type Processor interface {
	IsSupported(schemaURL string) bool
	Process(reader io.Reader) ([]Entry, error)
}

Processor takes individual feed group cache files (for select feed groups) and is responsible to producing data.Entry objects to be written to the DB.

type Severity

type Severity string
const (
	SeverityUnknown    Severity = "Unknown"
	SeverityNegligible Severity = "Negligible"
	SeverityLow        Severity = "Low"
	SeverityMedium     Severity = "Medium"
	SeverityHigh       Severity = "High"
	SeverityCritical   Severity = "Critical"
)

func ParseSeverity

func ParseSeverity(s string) Severity

type Writer

type Writer interface {
	Write(...Entry) error
	Close() error
}

Writer knows how to persist one or more data.Entry objects to a database. Note that the backing implementations may take advantage of bulk writes when possible (positively improving performance), which is why multiple entries can be written at once.

Jump to

Keyboard shortcuts

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