osv

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 11 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 *filesystem.ScanInput) lockfile.DepFile

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

Types

type DepGroupMetadata added in v0.1.3

type DepGroupMetadata struct {
	DepGroupVals []string
}

DepGroupMetadata is a metadata struct that only supports DepGroups

func (DepGroupMetadata) DepGroups added in v0.1.3

func (dgm DepGroupMetadata) DepGroups() []string

DepGroups return the dependency groups property in the metadata

type DepGroups added in v0.1.3

type DepGroups interface {
	DepGroups() []string
}

DepGroups provides access to the list of dependency groups an inventory item belongs to. Dependency groups are used by many language package managers as a way to organize dependencies (e.g. development dependencies will be in the "dev" group)

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

	// Optional. A stats.Collector for reporting internal metrics.
	Stats stats.Collector

	// Optional. A config value for the maximum file size this extractor will
	// treat as required in `FileRequired`.
	MaxFileSizeBytes int64
}

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

func (Wrapper) Ecosystem added in v0.1.3

func (e Wrapper) Ecosystem(i *extractor.Inventory) string

Ecosystem returns the OSV Ecosystem of the software extracted by this extractor.

func (Wrapper) Extract

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

Extract wraps the osv Extract method.

func (Wrapper) FileRequired

func (e Wrapper) FileRequired(api filesystem.FileAPI) 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) Requirements added in v0.1.3

func (e Wrapper) Requirements() *plugin.Capabilities

Requirements of the extractor.

func (Wrapper) ToPURL

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

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