Documentation ¶
Index ¶
- Constants
- Variables
- func ListParsers() []string
- type CargoLockFile
- type CargoLockPackage
- type ComposerLock
- type ComposerPackage
- type ConanGraphLock
- type ConanGraphNode
- type ConanLockFile
- type ConanReference
- type Ecosystem
- type Lockfile
- func FromApkInstalled(pathToInstalled string) (Lockfile, error)
- func FromCSVFile(pathToCSV string, parseAs string) (Lockfile, error)
- func FromCSVRows(filePath string, parseAs string, rows []string) (Lockfile, error)
- func FromDpkgStatus(pathToStatus string) (Lockfile, error)
- func Parse(pathToLockfile string, parseAs string) (Lockfile, error)
- type MavenLockDependency
- type MavenLockFile
- type MavenLockProperties
- type NpmLockDependency
- type NpmLockPackage
- type NpmLockfile
- type NuGetLockPackage
- type NuGetLockfile
- type PackageDetails
- func ParseApkInstalled(pathToLockfile string) ([]PackageDetails, error)
- func ParseCargoLock(pathToLockfile string) ([]PackageDetails, error)
- func ParseComposerLock(pathToLockfile string) ([]PackageDetails, error)
- func ParseConanLock(pathToLockfile string) ([]PackageDetails, error)
- func ParseDpkgStatus(pathToLockfile string) ([]PackageDetails, error)
- func ParseGemfileLock(pathToLockfile string) ([]PackageDetails, error)
- func ParseGoLock(pathToLockfile string) ([]PackageDetails, error)
- func ParseGradleLock(pathToLockfile string) ([]PackageDetails, error)
- func ParseMavenLock(pathToLockfile string) ([]PackageDetails, error)
- func ParseMixLock(pathToLockfile string) ([]PackageDetails, error)
- func ParseNpmLock(pathToLockfile string) ([]PackageDetails, error)
- func ParseNuGetLock(pathToLockfile string) ([]PackageDetails, error)
- func ParsePipenvLock(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 PipenvLock
- type PipenvPackage
- type PnpmLockPackage
- type PnpmLockPackageResolution
- type PnpmLockfile
- type PoetryLockFile
- type PoetryLockPackage
- type PoetryLockPackageSource
- type PubspecLockDescription
- type PubspecLockPackage
- type PubspecLockfile
Constants ¶
View Source
const PipenvEcosystem = PipEcosystem
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 ConanGraphLock ¶
type ConanGraphLock struct {
Nodes map[string]ConanGraphNode `json:"nodes"`
}
type ConanGraphNode ¶
type ConanLockFile ¶
type ConanLockFile struct { Version string `json:"version"` // conan v0.4- lockfiles use "graph_lock", "profile_host" and "profile_build" GraphLock ConanGraphLock `json:"graph_lock,omitempty"` ProfileHost string `json:"profile_host,omitempty"` ProfileBuild string `json:"profile_build,omitempty"` // conan v0.5+ lockfiles use "requires", "build_requires" and "python_requires" Requires []string `json:"requires,omitempty"` BuildRequires []string `json:"build_requires,omitempty"` PythonRequires []string `json:"python_requires,omitempty"` }
type ConanReference ¶
type Ecosystem ¶
type Ecosystem string
const AlpineEcosystem Ecosystem = "Alpine"
const BundlerEcosystem Ecosystem = "RubyGems"
const CargoEcosystem Ecosystem = "crates.io"
const ComposerEcosystem Ecosystem = "Packagist"
const ConanEcosystem Ecosystem = "ConanCenter"
TODO this is tentative and subject to change depending on the OSV schema
const DebianEcosystem Ecosystem = "Debian"
const GoEcosystem Ecosystem = "Go"
const MavenEcosystem Ecosystem = "Maven"
const MixEcosystem Ecosystem = "Hex"
const NpmEcosystem Ecosystem = "npm"
const NuGetEcosystem Ecosystem = "NuGet"
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 FromApkInstalled ¶
FromApkInstalled attempts to parse the given file as an "apk-installed" lockfile used by the Alpine Package Keeper (apk) to record installed packages.
func FromCSVRows ¶
func FromDpkgStatus ¶
FromDpkgStatus attempts to parse the given file as an "dpkg-status" lockfile used by the Debian Package (dpkg) to record installed packages.
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"` ManagedDependencies []MavenLockDependency `xml:"dependencyManagement>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 NuGetLockPackage ¶
type NuGetLockPackage struct {
Resolved string `json:"resolved"`
}
type NuGetLockfile ¶
type NuGetLockfile struct { Version int `json:"version"` Dependencies map[string]map[string]NuGetLockPackage `json:"dependencies"` }
NuGetLockfile contains the required dependency information as defined in https://github.com/NuGet/NuGet.Client/blob/6.5.0.136/src/NuGet.Core/NuGet.ProjectModel/ProjectLockFile/PackagesLockFileFormat.cs
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 ParseApkInstalled ¶
func ParseApkInstalled(pathToLockfile string) ([]PackageDetails, error)
func ParseCargoLock ¶
func ParseCargoLock(pathToLockfile string) ([]PackageDetails, error)
func ParseComposerLock ¶
func ParseComposerLock(pathToLockfile string) ([]PackageDetails, error)
func ParseConanLock ¶
func ParseConanLock(pathToLockfile string) ([]PackageDetails, error)
func ParseDpkgStatus ¶
func ParseDpkgStatus(pathToLockfile string) ([]PackageDetails, error)
func ParseGemfileLock ¶
func ParseGemfileLock(pathToLockfile string) ([]PackageDetails, error)
func ParseGoLock ¶
func ParseGoLock(pathToLockfile string) ([]PackageDetails, error)
func ParseGradleLock ¶
func ParseGradleLock(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 ParseNuGetLock ¶
func ParseNuGetLock(pathToLockfile string) ([]PackageDetails, error)
func ParsePipenvLock ¶
func ParsePipenvLock(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 PipenvLock ¶
type PipenvLock struct { Packages map[string]PipenvPackage `json:"default"` PackagesDev map[string]PipenvPackage `json:"develop"` }
type PipenvPackage ¶
type PipenvPackage struct {
Version string `json:"version"`
}
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(value *yaml.Node) 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 ¶
- apk-installed.go
- csv.go
- dpkg-status.go
- ecosystems.go
- parse-cargo-lock.go
- parse-composer-lock.go
- parse-conan-lock.go
- parse-gemfile-lock.go
- parse-go-lock.go
- parse-gradle-lock.go
- parse-maven-lock.go
- parse-mix-lock.go
- parse-npm-lock.go
- parse-nuget-lock.go
- parse-pipenv-lock.go
- parse-pnpm-lock.go
- parse-poetry-lock.go
- parse-pubspec-lock.go
- parse-requirements-txt.go
- parse-yarn-lock.go
- parse.go
- types.go
Click to show internal directories.
Click to hide internal directories.