scalibrextract

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package scalibrextract provides functions to easily use scalibr extractors within osv-scanner.

Index

Constants

This section is empty.

Variables

View Source
var ErrExtractorNotFound = errors.New("could not determine extractor suitable to this file")
View Source
var ErrIncompatibleFileFormat = errors.New("file format is incompatible, but this is expected")
View Source
var ErrNotImplemented = errors.New("not implemented")
View Source
var ErrWrongExtractor = errors.New("this extractor did not create this inventory")

Functions

func ExtractWithExtractor

func ExtractWithExtractor(ctx context.Context, localPath string, ext filesystem.Extractor) ([]*extractor.Package, error)

ExtractWithExtractor attempts to extract the file at the given path with the extractor passed in

Extract attempts to extract the file at the given path

Args:

  • ctx: the context to use for extraction
  • localPath: the path to the lockfile
  • ext: the extractor to use

Returns:

  • []*extractor.Package: the extracted lockfile data
  • error: any errors encountered during extraction

func ExtractWithExtractors

func ExtractWithExtractors(ctx context.Context, localPath string, plugins []plugin.Plugin) ([]*extractor.Package, error)

ExtractWithExtractors attempts to extract the file at the given path by choosing the extractor which passes the FileRequired test TODO: Optimise to pass in FileInfo here. TODO: Remove reporter

Args: - ctx: the context to use for extraction - localPath: the path to the lockfile - extractors: a slice of extractors to try - r: reporter to output logs to

Returns:

  • []*extractor.Package: the extracted lockfile data
  • error: any errors encountered during extraction

If no extractors are found, then ErrExtractorNotFound is returned.

Types

This section is empty.

Directories

Path Synopsis
filesystem
vendored
Package vendored provides an extractor for vendored C/C++ code.
Package vendored provides an extractor for vendored C/C++ code.
language
java/pomxmlenhanceable
Package pomxmlenhanceable provides an extractor for pom.xml files that can both do offline and transitive scanning.
Package pomxmlenhanceable provides an extractor for pom.xml files that can both do offline and transitive scanning.
javascript/nodemodules
Package nodemodules provides an extractor for node_modules directories by reading the .package-lock.json file.
Package nodemodules provides an extractor for node_modules directories by reading the .package-lock.json file.
osv/osvscannerjson
Package osvscannerjson extracts osv-scanner's json output.
Package osvscannerjson extracts osv-scanner's json output.
python/requirementsenhancable
Package requirementsenhancable provides an extractor for requirements.txt that can both do offline and transitive scanning.
Package requirementsenhancable provides an extractor for requirements.txt that can both do offline and transitive scanning.
vcs
gitrepo
Package gitrepo provides an extractor for git repositories and submodules.
Package gitrepo provides an extractor for git repositories and submodules.

Jump to

Keyboard shortcuts

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