Documentation ¶
Overview ¶
Package wheelegg extracts wheel and egg files.
Index ¶
- Constants
- Variables
- type Config
- type Extractor
- func (e Extractor) Extract(ctx context.Context, input *extractor.ScanInput) ([]*extractor.Inventory, error)
- func (e Extractor) FileRequired(path string, _ fs.FileMode) bool
- func (e Extractor) Name() string
- func (e Extractor) ToCPEs(i *extractor.Inventory) ([]string, error)
- func (e Extractor) ToPURL(i *extractor.Inventory) (*purl.PackageURL, error)
- 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 { // MaxFileSize is the maximum file size an extractor will unmarshal. // If Extract gets a bigger file, it will return an error. MaxFileSize int64 }
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) Extract ¶
func (e Extractor) Extract(ctx context.Context, input *extractor.ScanInput) ([]*extractor.Inventory, 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 ¶
FileRequired returns true if the specified file matches python Metadata file patterns.
func (Extractor) ToCPEs ¶
ToCPEs is not applicable as this extractor does not infer CPEs from the Inventory.
type PythonPackageMetadata ¶
type PythonPackageMetadata struct { Author string `json:"author"` AuthorEmail string `json:"authorEmail"` }
PythonPackageMetadata holds parsing information from a python egg or wheel package.