Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithDocument ¶
WithDocument adds all the statements in a document to the index
func WithStatements ¶
WithStatements adds statements to a newly created index
Types ¶
type Filter ¶
Filter is an internal object that abstracs a function that when called, extracts vex statements from an index, returning them in a slice ordered by pointers so the matching vex statements.
Filters are used by the index `Matches()` function which calls the filters, deduplicates the results and returns the collection of matching statements.
type FilterFunc ¶
type FilterFunc func(*StatementIndex) Filter
A FilterFunc is a function that returns a Filter when called. FilterFuncs are meant to be used as arguments to the `Matches()` index function.
func WithProduct ¶
func WithProduct(prod *vex.Product) FilterFunc
WithProduct returns a filter that indexes a product by its ID, identifiers and hashes.
func WithSubcomponent ¶
func WithSubcomponent(subc *vex.Subcomponent) FilterFunc
WithSubcomponent adds a subcomponent filter to the search criteria, indexing by ID, identifiers and hashes.
func WithVulnerability ¶
func WithVulnerability(vuln *vex.Vulnerability) FilterFunc
WithVulnerability returns a filter that matches a vulnerability.
type StatementIndex ¶
type StatementIndex struct {
// contains filtered or unexported fields
}
StatementIndex is the OpenVEX statement indexer. An index reads into memory vex statements and catalogs them by the fields in their components (vulnerability, product, subcomponents).
The index exposes a StatementIndex.Match() function that takes in Filters to return indexed statements that match the filter criteria.
func New ¶
func New(funcs ...constructorFunc) (*StatementIndex, error)
New creates a new VEX index with the specified functions
func (*StatementIndex) IndexStatements ¶
func (si *StatementIndex) IndexStatements(statements []*vex.Statement)
IndexStatements indexes all the passed statements by cataloguing the fields in the product, vulnerability and subcomponents.
func (*StatementIndex) Matches ¶
func (si *StatementIndex) Matches(filterfunc ...FilterFunc) []*vex.Statement
Matches applies filters to the index to look for matching statements