Documentation
¶
Overview ¶
Package sbom generates a CycloneDX software bill of materials for the module's dependency graph, so a release can attach an SBOM whose package list matches go.mod. It shells out to `go list -m -json all` (the authoritative module list) rather than parsing go.mod directly, so it captures the full resolved graph including transitive dependencies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Component ¶
type Component struct {
Type string `json:"type"`
BOMRef string `json:"bom-ref"`
Name string `json:"name"`
Version string `json:"version"`
PURL string `json:"purl"`
}
Component is one CycloneDX component (a Go module dependency).
type Document ¶
type Document struct {
BOMFormat string `json:"bomFormat"`
SpecVersion string `json:"specVersion"`
Version int `json:"version"`
Components []Component `json:"components"`
}
Document is the minimal CycloneDX 1.5 BOM shape needed to enumerate the dependency components.
func BuildDocument ¶
BuildDocument decodes the `go list -m -json all` stream into a CycloneDX BOM. The main module is excluded (it is the subject, not a dependency), as are modules without a resolved version.