Documentation
¶
Overview ¶
Package manifests parses dependency manifest and lockfile formats across package ecosystems.
It supports 40+ ecosystems including npm, gem, pypi, cargo, maven, and more. Each ecosystem uses its PURL type as the identifier.
Basic usage:
result, err := manifests.Parse("package.json", content)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Ecosystem: %s, Kind: %s\n", result.Ecosystem, result.Kind)
for _, dep := range result.Dependencies {
fmt.Printf(" %s %s\n", dep.Name, dep.Version)
}
Index ¶
Constants ¶
View Source
const ( Manifest Kind = core.Manifest Lockfile Kind = core.Lockfile Runtime Scope = core.Runtime Development Scope = core.Development Test Scope = core.Test Build Scope = core.Build Optional Scope = core.Optional )
Re-export constants.
Variables ¶
This section is empty.
Functions ¶
func Ecosystems ¶
func Ecosystems() []string
Ecosystems returns a list of all supported PURL ecosystem types.
Types ¶
type Dependency ¶
type Dependency = core.Dependency
Re-export types from internal/core for public API.
type Match ¶
Match represents a file type match.
func IdentifyAll ¶
IdentifyAll returns all matching ecosystems for a filename.
type ParseResult ¶
type ParseResult struct {
Ecosystem string
Kind Kind
Dependencies []Dependency
}
ParseResult contains the parsed dependencies from a manifest or lockfile.
type UnknownFileError ¶
type UnknownFileError struct {
Filename string
}
UnknownFileError is returned when a file type is not recognized.
func (*UnknownFileError) Error ¶
func (e *UnknownFileError) Error() string
Click to show internal directories.
Click to hide internal directories.