matcher

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareVersions

func CompareVersions(a, b string) int

CompareVersions compares two version strings. Returns -1 if a < b, 0 if a == b, 1 if a > b. Handles semver (1.2.3), calver (2024.01.15), and numeric versions.

func IsInRange

func IsInRange(version string, introduced, fixed, lastAffected string) bool

IsInRange checks if a version falls within an affected range.

Types

type Matcher

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

Matcher matches project dependencies against CVE databases.

func New

func New(nvdAPIKey, githubToken, cacheDir string, cacheTTLHours int) *Matcher

func NewOffline

func NewOffline(db *cve.OfflineDB) *Matcher

NewOffline creates a Matcher backed by the offline OSV database.

func (*Matcher) Close

func (m *Matcher) Close()

Close releases resources held by the Matcher (e.g. the SQLite cache).

func (*Matcher) Match

func (m *Matcher) Match(ctx context.Context, depList *deps.DependencyList) ([]cve.Finding, error)

Match queries CVE databases for all dependencies using batch queries.

Jump to

Keyboard shortcuts

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