Documentation
¶
Index ¶
- Constants
- Variables
- func ListParsers() []string
- type CargoLockFile
- type CargoLockPackage
- type ComposerLock
- type ComposerPackage
- type Ecosystem
- type Lockfile
- type MavenLockDependency
- type MavenLockFile
- type MavenLockProperties
- type NpmLockDependency
- type NpmLockPackage
- type NpmLockfile
- type PackageDetails
- func ParseCargoLock(pathToLockfile string) ([]PackageDetails, error)
- func ParseComposerLock(pathToLockfile string) ([]PackageDetails, error)
- func ParseGemfileLock(pathToLockfile string) ([]PackageDetails, error)
- func ParseGoLock(pathToLockfile string) ([]PackageDetails, error)
- func ParseMavenLock(pathToLockfile string) ([]PackageDetails, error)
- func ParseMixLock(pathToLockfile string) ([]PackageDetails, error)
- func ParseNpmLock(pathToLockfile string) ([]PackageDetails, error)
- func ParsePnpmLock(pathToLockfile string) ([]PackageDetails, error)
- func ParsePoetryLock(pathToLockfile string) ([]PackageDetails, error)
- func ParsePubspecLock(pathToLockfile string) ([]PackageDetails, error)
- func ParseRequirementsTxt(pathToLockfile string) ([]PackageDetails, error)
- func ParseYarnLock(pathToLockfile string) ([]PackageDetails, error)
- type PackageDetailsParser
- type Packages
- type PnpmLockPackage
- type PnpmLockPackageResolution
- type PnpmLockfile
- type PoetryLockFile
- type PoetryLockPackage
- type PoetryLockPackageSource
- type PubspecLockDescription
- type PubspecLockPackage
- type PubspecLockfile
Constants ¶
View Source
const PnpmEcosystem = NpmEcosystem
View Source
const PoetryEcosystem = PipEcosystem
View Source
const YarnEcosystem = NpmEcosystem
Variables ¶
View Source
var ErrParserNotFound = errors.New("could not determine parser")
Functions ¶
func ListParsers ¶
func ListParsers() []string
Types ¶
type CargoLockFile ¶
type CargoLockFile struct {
Version int `toml:"version"`
Packages []CargoLockPackage `toml:"package"`
}
type CargoLockPackage ¶
type ComposerLock ¶
type ComposerLock struct {
Packages []ComposerPackage `json:"packages"`
PackagesDev []ComposerPackage `json:"packages-dev"`
}
type ComposerPackage ¶
type Ecosystem ¶
type Ecosystem string
const BundlerEcosystem Ecosystem = "RubyGems"
const CargoEcosystem Ecosystem = "crates.io"
const ComposerEcosystem Ecosystem = "Packagist"
const GoEcosystem Ecosystem = "Go"
const MavenEcosystem Ecosystem = "Maven"
const MixEcosystem Ecosystem = "Hex"
const NpmEcosystem Ecosystem = "npm"
const PipEcosystem Ecosystem = "PyPI"
const PubEcosystem Ecosystem = "Pub"
func KnownEcosystems ¶
func KnownEcosystems() []Ecosystem
type Lockfile ¶
type Lockfile struct {
FilePath string `json:"filePath"`
ParsedAs string `json:"parsedAs"`
Packages Packages `json:"packages"`
}
func FromCSVRows ¶
type MavenLockDependency ¶
type MavenLockDependency struct {
XMLName xml.Name `xml:"dependency"`
GroupID string `xml:"groupId"`
ArtifactID string `xml:"artifactId"`
Version string `xml:"version"`
}
func (MavenLockDependency) ResolveVersion ¶
func (mld MavenLockDependency) ResolveVersion(lockfile MavenLockFile) string
type MavenLockFile ¶
type MavenLockFile struct {
XMLName xml.Name `xml:"project"`
ModelVersion string `xml:"modelVersion"`
Properties MavenLockProperties `xml:"properties"`
Dependencies []MavenLockDependency `xml:"dependencies>dependency"`
}
type MavenLockProperties ¶
type MavenLockProperties struct {
// contains filtered or unexported fields
}
func (*MavenLockProperties) UnmarshalXML ¶
func (p *MavenLockProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type NpmLockDependency ¶
type NpmLockDependency struct {
Version string `json:"version"`
Dependencies map[string]NpmLockDependency `json:"dependencies,omitempty"`
}
type NpmLockPackage ¶
type NpmLockfile ¶
type NpmLockfile struct {
Version int `json:"lockfileVersion"`
// npm v1- lockfiles use "dependencies"
Dependencies map[string]NpmLockDependency `json:"dependencies"`
// npm v2+ lockfiles use "packages"
Packages map[string]NpmLockPackage `json:"packages,omitempty"`
}
type PackageDetails ¶
type PackageDetails struct {
Name string `json:"name"`
Version string `json:"version"`
Commit string `json:"commit,omitempty"`
Ecosystem Ecosystem `json:"ecosystem,omitempty"`
CompareAs Ecosystem `json:"compareAs,omitempty"`
}
func ParseCargoLock ¶
func ParseCargoLock(pathToLockfile string) ([]PackageDetails, error)
func ParseComposerLock ¶
func ParseComposerLock(pathToLockfile string) ([]PackageDetails, error)
func ParseGemfileLock ¶
func ParseGemfileLock(pathToLockfile string) ([]PackageDetails, error)
func ParseGoLock ¶
func ParseGoLock(pathToLockfile string) ([]PackageDetails, error)
func ParseMavenLock ¶
func ParseMavenLock(pathToLockfile string) ([]PackageDetails, error)
func ParseMixLock ¶
func ParseMixLock(pathToLockfile string) ([]PackageDetails, error)
func ParseNpmLock ¶
func ParseNpmLock(pathToLockfile string) ([]PackageDetails, error)
func ParsePnpmLock ¶
func ParsePnpmLock(pathToLockfile string) ([]PackageDetails, error)
func ParsePoetryLock ¶
func ParsePoetryLock(pathToLockfile string) ([]PackageDetails, error)
func ParsePubspecLock ¶
func ParsePubspecLock(pathToLockfile string) ([]PackageDetails, error)
func ParseRequirementsTxt ¶
func ParseRequirementsTxt(pathToLockfile string) ([]PackageDetails, error)
func ParseYarnLock ¶
func ParseYarnLock(pathToLockfile string) ([]PackageDetails, error)
type PackageDetailsParser ¶
type PackageDetailsParser = func(pathToLockfile string) ([]PackageDetails, error)
func FindParser ¶
func FindParser(pathToLockfile string, parseAs string) (PackageDetailsParser, string)
type PnpmLockPackage ¶
type PnpmLockPackage struct {
Resolution PnpmLockPackageResolution `yaml:"resolution"`
Name string `yaml:"name"`
Version string `yaml:"version"`
}
type PnpmLockfile ¶
type PnpmLockfile struct {
Version float64 `yaml:"lockfileVersion"`
Packages map[string]PnpmLockPackage `yaml:"packages,omitempty"`
}
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"`
Source PoetryLockPackageSource `toml:"source"`
}
type PoetryLockPackageSource ¶
type PubspecLockDescription ¶
type PubspecLockDescription struct {
Name string `yaml:"name"`
URL string `yaml:"url"`
Path string `yaml:"path"`
Ref string `yaml:"resolved-ref"`
}
func (*PubspecLockDescription) UnmarshalYAML ¶
func (pld *PubspecLockDescription) UnmarshalYAML(unmarshal func(interface{}) error) error
type PubspecLockPackage ¶
type PubspecLockPackage struct {
Source string `yaml:"source"`
Description PubspecLockDescription `yaml:"description"`
Version string `yaml:"version"`
}
type PubspecLockfile ¶
type PubspecLockfile struct {
Packages map[string]PubspecLockPackage `yaml:"packages,omitempty"`
Sdks map[string]string `yaml:"sdks"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.