filter

package
v2.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package filter provides an annotator that filters out unscannable, non-container-relevant, or ignored packages from the scan results before matching begins.

Index

Constants

View Source
const (
	// Name is the unique name of this annotator.
	Name = "osv-scanner/filter"
	// Version is the version of this annotator.
	Version = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotator

type Annotator struct {
	// contains filtered or unexported fields
}

Annotator implements annotator.Annotator to filter packages.

func NewAnnotator

func NewAnnotator(configManager *config.Manager, isContainerScan bool, showAllPackages bool) *Annotator

NewAnnotator returns a new Annotator.

func (*Annotator) Annotate

func (a *Annotator) Annotate(_ context.Context, _ *annotator.ScanInput, results *inventory.Inventory) error

Annotate filters the package list inside the inventory.

func (*Annotator) FilteredPackages

func (a *Annotator) FilteredPackages() []*extractor.Package

FilteredPackages returns the list of packages filtered out that should be preserved.

func (*Annotator) Name

func (a *Annotator) Name() string

Name returns the unique name of the annotator.

func (*Annotator) PreFilteredPackageCount

func (a *Annotator) PreFilteredPackageCount() int

PreFilteredPackageCount returns the number of packages found before filtering.

func (*Annotator) Requirements

func (a *Annotator) Requirements() *plugin.Capabilities

Requirements returns the requirements of this annotator.

func (*Annotator) Version

func (a *Annotator) Version() int

Version returns the version of the annotator.

Jump to

Keyboard shortcuts

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