Documentation
¶
Index ¶
- Variables
- func ParsePdmLock(pathToLockfile string) ([]lockfile.PackageDetails, error)
- func ParsePipenvLock(pathToLockfile string) ([]lockfile.PackageDetails, error)
- func ParsePoetryLock(pathToLockfile string) ([]lockfile.PackageDetails, error)
- func ParseRequirementsTxt(pathToLockfile string) ([]lockfile.PackageDetails, error)
- func ParseUvLock(pathToLockfile string) ([]lockfile.PackageDetails, error)
- type Comment
- type CommentParser
- type CommentType
- type PdmLockExtractor
- type PdmLockFile
- type PdmLockPackage
- type PipenvLock
- type PipenvLockExtractor
- func (e PipenvLockExtractor) Extract(f lockfile.DepFile, context lockfile.ScanContext) ([]lockfile.PackageDetails, error)
- func (e PipenvLockExtractor) IsOfficiallySupported() bool
- func (e PipenvLockExtractor) PackageManager() models.PackageManager
- func (e PipenvLockExtractor) ShouldExtract(path string) bool
- type PipenvPackage
- type PipfileMatcher
- type PoetryLockExtractor
- func (e PoetryLockExtractor) Extract(f lockfile.DepFile, context lockfile.ScanContext) ([]lockfile.PackageDetails, error)
- func (e PoetryLockExtractor) IsOfficiallySupported() bool
- func (e PoetryLockExtractor) PackageManager() models.PackageManager
- func (e PoetryLockExtractor) ShouldExtract(path string) bool
- type PoetryLockFile
- type PoetryLockPackage
- type PoetryLockPackageSource
- type PyprojectTOMLMatcher
- type RequirementsTxtExtractor
- func (e RequirementsTxtExtractor) Extract(f lockfile.DepFile, context lockfile.ScanContext) ([]lockfile.PackageDetails, error)
- func (e RequirementsTxtExtractor) IsOfficiallySupported() bool
- func (e RequirementsTxtExtractor) PackageManager() models.PackageManager
- func (e RequirementsTxtExtractor) ShouldExtract(path string) bool
- type UvLockExtractor
- type UvLockFile
- type UvLockPackage
- type UvLockPackageSource
Constants ¶
This section is empty.
Variables ¶
View Source
var PipenvExtractor = PipenvLockExtractor{ lockfile.WithMatcher{Matchers: []lockfile.Matcher{&PipfileMatcher{}}}, }
View Source
var PoetryExtractor = PoetryLockExtractor{ lockfile.WithMatcher{Matchers: []lockfile.Matcher{&PyprojectTOMLMatcher{}}}, }
View Source
var UvExtractor = UvLockExtractor{ lockfile.WithMatcher{Matchers: []lockfile.Matcher{&PyprojectTOMLMatcher{}}}, }
Functions ¶
func ParsePdmLock ¶
func ParsePdmLock(pathToLockfile string) ([]lockfile.PackageDetails, error)
func ParsePipenvLock ¶
func ParsePipenvLock(pathToLockfile string) ([]lockfile.PackageDetails, error)
func ParsePoetryLock ¶
func ParsePoetryLock(pathToLockfile string) ([]lockfile.PackageDetails, error)
func ParseRequirementsTxt ¶
func ParseRequirementsTxt(pathToLockfile string) ([]lockfile.PackageDetails, error)
func ParseUvLock ¶
func ParseUvLock(pathToLockfile string) ([]lockfile.PackageDetails, error)
Types ¶
type Comment ¶
type Comment struct {
Content string
Type CommentType
}
Comment represents a parsed requirements.txt comment
type CommentParser ¶
type CommentParser struct {
// contains filtered or unexported fields
}
CommentParser handles parsing of requirements.txt comments
func (*CommentParser) IsDirect ¶
func (p *CommentParser) IsDirect() bool
func (*CommentParser) ParseComment ¶
func (p *CommentParser) ParseComment(line string) *Comment
ParseComment parses a single comment line and returns the parsed comment
type CommentType ¶
type CommentType int
CommentType represents the type of dependency comment
const ( // CommentTypeNone represents a comment that doesn't have any special meaning, // and signifies we're parsing a multiline comment. CommentTypeNone CommentType = iota // CommentTypeIndirect represents a comment that signifies a package is an // indirect dependency. CommentTypeIndirect // CommentTypeDirect represents a comment that signifies a package is a direct // dependency. CommentTypeDirect )
type PdmLockExtractor ¶
type PdmLockExtractor struct{}
func (PdmLockExtractor) Extract ¶
func (p PdmLockExtractor) Extract(f lockfile.DepFile, context lockfile.ScanContext) ([]lockfile.PackageDetails, error)
func (PdmLockExtractor) IsOfficiallySupported ¶
func (p PdmLockExtractor) IsOfficiallySupported() bool
func (PdmLockExtractor) PackageManager ¶
func (p PdmLockExtractor) PackageManager() models.PackageManager
func (PdmLockExtractor) ShouldExtract ¶
func (p PdmLockExtractor) ShouldExtract(path string) bool
type PdmLockFile ¶
type PdmLockFile struct {
Version string `toml:"lock-version"`
Packages []PdmLockPackage `toml:"package"`
}
type PdmLockPackage ¶
type PipenvLock ¶
type PipenvLock struct {
Packages map[string]PipenvPackage `json:"default"`
PackagesDev map[string]PipenvPackage `json:"develop"`
}
type PipenvLockExtractor ¶
type PipenvLockExtractor struct {
lockfile.WithMatcher
}
func (PipenvLockExtractor) Extract ¶
func (e PipenvLockExtractor) Extract(f lockfile.DepFile, context lockfile.ScanContext) ([]lockfile.PackageDetails, error)
func (PipenvLockExtractor) IsOfficiallySupported ¶
func (e PipenvLockExtractor) IsOfficiallySupported() bool
func (PipenvLockExtractor) PackageManager ¶
func (e PipenvLockExtractor) PackageManager() models.PackageManager
func (PipenvLockExtractor) ShouldExtract ¶
func (e PipenvLockExtractor) ShouldExtract(path string) bool
type PipenvPackage ¶
type PipenvPackage struct {
Version string `json:"version"`
}
type PipfileMatcher ¶
type PipfileMatcher struct{}
func (PipfileMatcher) GetSourceFile ¶
func (PipfileMatcher) Match ¶
func (m PipfileMatcher) Match(sourceFile lockfile.DepFile, packages []lockfile.PackageDetails, context lockfile.ScanContext) error
type PoetryLockExtractor ¶
type PoetryLockExtractor struct {
lockfile.WithMatcher
}
func (PoetryLockExtractor) Extract ¶
func (e PoetryLockExtractor) Extract(f lockfile.DepFile, context lockfile.ScanContext) ([]lockfile.PackageDetails, error)
func (PoetryLockExtractor) IsOfficiallySupported ¶
func (e PoetryLockExtractor) IsOfficiallySupported() bool
func (PoetryLockExtractor) PackageManager ¶
func (e PoetryLockExtractor) PackageManager() models.PackageManager
func (PoetryLockExtractor) ShouldExtract ¶
func (e PoetryLockExtractor) ShouldExtract(path string) bool
type PoetryLockFile ¶
type PoetryLockFile struct {
Version int `toml:"version"`
Packages []*PoetryLockPackage `toml:"package"`
}
type PoetryLockPackage ¶
type PoetryLockPackage struct {
Name string `toml:"name"`
Version string `toml:"version"`
Optional bool `toml:"optional"`
Source PoetryLockPackageSource `toml:"source"`
}
type PoetryLockPackageSource ¶
type PyprojectTOMLMatcher ¶
type PyprojectTOMLMatcher struct{}
func (PyprojectTOMLMatcher) GetSourceFile ¶
func (PyprojectTOMLMatcher) Match ¶
func (m PyprojectTOMLMatcher) Match(sourceFile lockfile.DepFile, packages []lockfile.PackageDetails, context lockfile.ScanContext) error
type RequirementsTxtExtractor ¶
type RequirementsTxtExtractor struct{}
func (RequirementsTxtExtractor) Extract ¶
func (e RequirementsTxtExtractor) Extract(f lockfile.DepFile, context lockfile.ScanContext) ([]lockfile.PackageDetails, error)
func (RequirementsTxtExtractor) IsOfficiallySupported ¶
func (e RequirementsTxtExtractor) IsOfficiallySupported() bool
func (RequirementsTxtExtractor) PackageManager ¶
func (e RequirementsTxtExtractor) PackageManager() models.PackageManager
func (RequirementsTxtExtractor) ShouldExtract ¶
func (e RequirementsTxtExtractor) ShouldExtract(path string) bool
type UvLockExtractor ¶
type UvLockExtractor struct {
lockfile.WithMatcher
}
func (UvLockExtractor) Extract ¶
func (e UvLockExtractor) Extract(f lockfile.DepFile, context lockfile.ScanContext) ([]lockfile.PackageDetails, error)
func (UvLockExtractor) IsOfficiallySupported ¶
func (e UvLockExtractor) IsOfficiallySupported() bool
func (UvLockExtractor) PackageManager ¶
func (e UvLockExtractor) PackageManager() models.PackageManager
func (UvLockExtractor) ShouldExtract ¶
func (e UvLockExtractor) ShouldExtract(path string) bool
type UvLockFile ¶
type UvLockFile struct {
Version int `toml:"version"`
Packages []*UvLockPackage `toml:"package"`
Metadata uvPackageMetadata `toml:"package.metadata"`
}
type UvLockPackage ¶
type UvLockPackage struct {
Name string `toml:"name"`
Version string `toml:"version"`
Source UvLockPackageSource `toml:"source"`
Dependencies []uvDependency `toml:"dependencies"`
DevDependencies map[string][]uvDependency `toml:"dev-dependencies"`
}
Click to show internal directories.
Click to hide internal directories.