Documentation
¶
Overview ¶
Package requirementsnet extracts requirements files with .
Index ¶
- Constants
- func NewDefault() filesystem.Extractor
- type Config
- type Extractor
- func (Extractor) Ecosystem(i *extractor.Package) string
- func (e Extractor) Extract(ctx context.Context, input *filesystem.ScanInput) (inventory.Inventory, error)
- func (e Extractor) FileRequired(api filesystem.FileAPI) bool
- func (e Extractor) Name() string
- func (e Extractor) Requirements() *plugin.Capabilities
- func (e Extractor) ToPURL(p *extractor.Package) *purl.PackageURL
- func (e Extractor) Version() int
Constants ¶
const (
// Name is the unique name of this extractor.
Name = "python/requirementsnet"
)
Variables ¶
This section is empty.
Functions ¶
func NewDefault ¶
func NewDefault() filesystem.Extractor
NewDefault returns an extractor with the default config settings.
Types ¶
type Config ¶
type Config struct { // This should be an extractor to extract inventories from requirements.txt offline. *requirements.Extractor // Extractor to extract inventories from requirements.txt offline. resolve.Client }
Config is the configuration for the Extractor.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default configuration for the extractor.
type Extractor ¶
type Extractor struct { BaseExtractor *requirements.Extractor // The base extractor that we use to extract direct dependencies. resolve.Client }
Extractor extracts python packages from requirements.txt files.
func New ¶
New returns a requirements.txt transitive extractor.
For most use cases, initialize with: ``` e := New(DefaultConfig()) ```
func (Extractor) Ecosystem ¶
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.Inventory, error)
Extract extracts packages from requirements files passed through the scan input.
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 ¶
func (e Extractor) Requirements() *plugin.Capabilities
Requirements of the extractor.