wheelegg

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package wheelegg extracts wheel and egg files.

Index

Constants

View Source
const (
	// Name is the unique name of this extractor.
	Name = "python/wheelegg"
)

Variables

View Source
var ErrSizeNotSet = errors.New("input.Info is nil, but should have Size set")

ErrSizeNotSet will trigger when Info.Size() is not set.

Functions

This section is empty.

Types

type Config

type Config struct {
	// MaxFileSizeBytes is the maximum file size this extractor will unmarshal. If
	// `FileRequired` gets a bigger file, it will return false,
	MaxFileSizeBytes int64
	// Stats is a stats collector for reporting metrics.
	Stats stats.Collector
}

Config is the configuration for the Extractor.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configuration for the wheel/egg extractor.

type Extractor

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

Extractor extracts python packages from wheel/egg files.

func New

func New(cfg Config) *Extractor

New returns a wheel/egg extractor.

For most use cases, initialize with: ``` e := New(DefaultConfig()) ```

func (Extractor) Ecosystem added in v0.1.3

func (Extractor) Ecosystem(i *extractor.Inventory) string

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

func (Extractor) Extract

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

Extract extracts packages from wheel/egg files passed through the scan input. For .egg files, input.Info.Size() is required to unzip the file.

func (Extractor) FileRequired

func (e Extractor) FileRequired(api filesystem.FileAPI) bool

FileRequired returns true if the specified file matches python Metadata file patterns.

func (Extractor) Name

func (e Extractor) Name() string

Name of the extractor.

func (Extractor) Requirements added in v0.1.3

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

Requirements of the extractor.

func (Extractor) ToPURL

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

func (Extractor) Version

func (e Extractor) Version() int

Version of the extractor.

type PythonPackageMetadata

type PythonPackageMetadata struct {
	Author      string `json:"author"`
	AuthorEmail string `json:"authorEmail"`
}

PythonPackageMetadata holds parsing information from a python egg or wheel package.

Jump to

Keyboard shortcuts

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