Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsOSEcosystem ¶ added in v1.2.0
IsOSEcosystem returns true if the ecosystem represents an OS-level package manager.
Types ¶
type DistroInfo ¶ added in v1.2.0
type DistroInfo struct {
Name string `json:"name"` // "alpine", "debian", "ubuntu", "centos", etc.
Version string `json:"version"` // "3.18", "12", "22.04"
}
DistroInfo holds the detected OS distribution from a container image SBOM.
type GoModCollector ¶
type GoModCollector struct{}
GoModCollector collects components from go.mod and go.sum files.
type MultiCollector ¶
type MultiCollector struct{}
MultiCollector discovers package manifests in a directory and dispatches to the appropriate collector for each one.
type NPMCollector ¶
type NPMCollector struct{}
NPMCollector collects components from package-lock.json.
type PipCollector ¶
type PipCollector struct{}
PipCollector collects components from requirements.txt.
type SBOMCollector ¶
type SBOMCollector struct {
Format string // "cyclonedx" or "spdx"
}
SBOMCollector collects components from CycloneDX or SPDX SBOM files.
type SBOMResult ¶ added in v1.2.0
type SBOMResult struct {
Components []model.Component
RawSBOM []byte
Distro *DistroInfo
}
SBOMResult holds both the raw SBOM bytes and parsed components from syft.
func ParseCycloneDXBytes ¶ added in v1.2.0
func ParseCycloneDXBytes(data []byte) (*SBOMResult, error)
ParseCycloneDXBytes parses raw CycloneDX JSON bytes and returns an SBOMResult containing both the raw bytes and parsed components.
type SyftCollector ¶
type SyftCollector struct{}
SyftCollector collects components from a container image using syft.
func (*SyftCollector) Collect ¶
Collect runs syft and returns parsed components (implements the Collector pattern).
func (*SyftCollector) CollectSBOM ¶ added in v1.2.0
func (c *SyftCollector) CollectSBOM(ctx context.Context, imageRef string) (*SBOMResult, error)
CollectSBOM runs syft and returns both the raw CycloneDX SBOM and parsed components.