osv

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package osv provides a Wrapper for osv plugins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WrapInput

func WrapInput(input *extractor.ScanInput) lockfile.DepFile

WrapInput returns an implementation of OSVs DepFile using a scalibr ScanInput.

Types

type Metadata

type Metadata struct {
	PURLType  string
	Commit    string
	Ecosystem string
	CompareAs string
}

Metadata holds parsing information for packages extracted by an OSV extractor wrapper.

type Wrapper

type Wrapper struct {
	ExtractorName    string
	ExtractorVersion int
	PURLType         string
	Extractor        lockfile.Extractor
}

Wrapper contains all the data to wrap a osv extractor to a scalibr extractor.

func (Wrapper) Extract

func (e Wrapper) Extract(ctx context.Context, input *extractor.ScanInput) ([]*extractor.Inventory, error)

Extract wrapps the osv Extract method.

func (Wrapper) FileRequired

func (e Wrapper) FileRequired(path string, _ fs.FileMode) bool

FileRequired returns true if the specified file matches the extractor pattern.

func (Wrapper) Name

func (e Wrapper) Name() string

Name of the extractor.

func (Wrapper) ToCPEs

func (e Wrapper) ToCPEs(i *extractor.Inventory) ([]string, error)

ToCPEs is not applicable as this extractor does not infer CPEs from the Inventory.

func (Wrapper) ToPURL

func (e Wrapper) ToPURL(i *extractor.Inventory) (*purl.PackageURL, error)

ToPURL converts an inventory created by this extractor into a PURL.

func (Wrapper) Version

func (e Wrapper) Version() int

Version of the extractor.

Jump to

Keyboard shortcuts

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