Documentation
¶
Index ¶
Constants ¶
View Source
const ( LockfileAsBomSpdx = customParserSpdxSBOM LockfileAsBomCycloneDx = customParserCycloneDXSBOM LockfileAsGitHubActions = customParserGitHubActions )
Exporting as constants for use outside this package to refer to specific parsers. For example: Github reader
Variables ¶
This section is empty.
Functions ¶
func FindLockFileAsByExtension ¶ added in v1.7.0
func ResolveParseTarget ¶ added in v1.7.0
func ResolveParseTarget(path, lockfileAs string, scopes []TargetScopeType) (string, string, error)
ResolveParseTarget resolves the actual path and lockfileAs based on the provided path and lockfileAs. It supports some conventions such as embedded lockfileAs in path and auto-detection of lockfileAs based on file extension
Types ¶
type Metadata ¶ added in v1.9.6
type Metadata struct {
RequiresDist []RequiresDist `toml:"requires-dist"`
}
type Parser ¶
type Parser interface {
Ecosystem() string
Parse(lockfilePath string) (*models.PackageManifest, error)
ParseWithConfig(lockfilePath string, config *ParserConfig) (*models.PackageManifest, error)
}
func FindParser ¶
type ParserConfig ¶ added in v1.5.6
type ParserConfig struct {
// A generic config flag (not specific to npm even though the name sounds like that) to indicate
// if the parser should include non-production dependencies as well. But this will work
// only for supported parsers such as npm graph parser
IncludeDevDependencies bool
}
type RequiresDist ¶ added in v1.9.6
type TargetScopeType ¶ added in v1.7.0
type TargetScopeType string
const ( TargetScopeAll TargetScopeType = "all" TargetScopeEmbeddedType TargetScopeType = "embedded" TargetScopeResolveByExtension TargetScopeType = "extension" )
Source Files
¶
Click to show internal directories.
Click to hide internal directories.