Help us shape the future of Go! Take the 2026 Go Developer Survey

scan

package
v1.17.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSBOMScanner

func NewSBOMScanner(purlComparer comparer, cveRepository shared.CveRepository) *sbomScanner

func WithPreloads added in v1.12.5

func WithPreloads(preloads ...func(*gorm.DB) *gorm.DB) func(*PurlComparer)

WithPreloads replaces the default CVE preloads. Callers can customize what gets preloaded.

Types

type AffectedComponentsCache added in v1.12.5

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

func NewAffectedComponentsCache added in v1.12.5

func NewAffectedComponentsCache(cacheSize *int) *AffectedComponentsCache

cache Size is the maximum number of elements held at one time if 0 is provided the cache gets disabled if nil is provided the default is used

func (*AffectedComponentsCache) Flush added in v1.12.5

func (acc *AffectedComponentsCache) Flush()

func (*AffectedComponentsCache) GetByCandidate added in v1.12.5

func (acc *AffectedComponentsCache) GetByCandidate(candidate *candidate) ([]models.AffectedComponent, bool)

func (*AffectedComponentsCache) GetCurrentGeneration added in v1.12.5

func (acc *AffectedComponentsCache) GetCurrentGeneration() int

func (*AffectedComponentsCache) SetForCandidates added in v1.12.5

func (acc *AffectedComponentsCache) SetForCandidates(candidates []*candidate, candidatesGeneration int)

type PurlComparer

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

func NewPurlComparer

func NewPurlComparer(db shared.DB, eventBroker events.Broker, cacheSize *int, opts ...func(*PurlComparer)) *PurlComparer

cache Size is the maximum number of elements held at one time if 0 is provided the cache gets disabled if nil is provided the default is used

func (*PurlComparer) FlushCache added in v1.12.5

func (comparer *PurlComparer) FlushCache()

flush cache externally (e.g. vulndb import)

func (*PurlComparer) GetAffectedComponents

func (comparer *PurlComparer) GetAffectedComponents(ctx context.Context, purl packageurl.PackageURL) ([]models.AffectedComponent, error)

GetAffectedComponents finds the affected components for a single software package.

func (*PurlComparer) GetAffectedComponentsBatch added in v1.12.5

func (comparer *PurlComparer) GetAffectedComponentsBatch(ctx context.Context, purls []packageurl.PackageURL) ([]*candidate, error)

wrapper for calling resolve candidates itself with multiple purls

func (*PurlComparer) GetVulns

func (comparer *PurlComparer) GetVulns(ctx context.Context, purls []packageurl.PackageURL) ([]models.VulnInPackage, error)

GetVulns resolves the vulnerabilities for a set of purls. Callers looking at a single purl pass a one element slice.

Jump to

Keyboard shortcuts

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