Documentation
¶
Overview ¶
Package sbom builds a human-readable software bill of materials for a Factum release: every Go module in the module graph plus production npm packages locked for the Vue GUI.
Index ¶
Constants ¶
const GeneratedMarker = "<!-- factum-sbom: generated -->"
GeneratedMarker is written at the top of a generated inventory so a release binary can tell a real SBOM from the placeholder file that keeps `go build -tags release` compiling between builds.
Variables ¶
This section is empty.
Functions ¶
func FindRepoRoot ¶
FindRepoRoot walks up from dir (or the process cwd) until it finds this module's go.mod.
Types ¶
type GoModule ¶
type GoModule struct {
Path string
Version string
Indirect bool
ReplacePath string
ReplaceVersion string
}
GoModule is one module from `go list -m -json all` (the main module is omitted from the table; it is named in the heading).
type NPMPackage ¶
type NPMPackage struct {
Name string
Version string
License string
// Tree is "direct", "transitive", "development", or
// "development (transitive)".
Tree string
}
NPMPackage is one package from package-lock.json (v2/v3 `packages` map).
func ParseNPMLock ¶
func ParseNPMLock(data []byte) ([]NPMPackage, error)
ParseNPMLock reads an npm lockfile v2/v3 `packages` map and returns every non-link package, unique by name@version.