Documentation
¶
Overview ¶
Package wheelegg extracts wheel and egg files.
Index ¶
- Constants
- Variables
- type Config
- type Extractor
- func (Extractor) Ecosystem(i *extractor.Inventory) string
- func (e Extractor) Extract(ctx context.Context, input *filesystem.ScanInput) (inventory []*extractor.Inventory, err error)
- func (e Extractor) FileRequired(api filesystem.FileAPI) bool
- func (e Extractor) Name() string
- func (e Extractor) Requirements() *plugin.Capabilities
- func (e Extractor) ToPURL(i *extractor.Inventory) *purl.PackageURL
- func (e Extractor) Version() int
- type PythonPackageMetadata
Constants ¶
const (
// Name is the unique name of this extractor.
Name = "python/wheelegg"
)
Variables ¶
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 ¶
New returns a wheel/egg extractor.
For most use cases, initialize with: ``` e := New(DefaultConfig()) ```
func (Extractor) Ecosystem ¶ added in v0.1.3
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) Requirements ¶ added in v0.1.3
func (e Extractor) Requirements() *plugin.Capabilities
Requirements 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.