Documentation
¶
Overview ¶
Package generator generates NOTICE/HTML attribution artifacts from a CycloneDX SBOM.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Component ¶
type Component struct {
Name string `json:"name"`
Version string `json:"version"`
PURL string `json:"purl"`
Copyright string `json:"copyright"`
Licenses []LicenseChoice `json:"licenses"`
}
Component represents a component in the SBOM.
type Config ¶
type Config struct {
RepoName string
SBOMPath string
HTMLTemplatePath string
NoticeTplPath string
OutDir string
OutLicensesDir string
SPDXVersion string
IgnorePURLPatterns []*regexp.Regexp
}
Config the global configuration.
type LicenseBlock ¶
type LicenseBlock struct {
ID string
Name string
Text string
UsedBy []OutComponent
}
LicenseBlock represents a license block in the output model.
type LicenseChoice ¶
type LicenseChoice struct {
Expression string `json:"expression"`
License *struct {
ID string `json:"id"`
Name string `json:"name"`
} `json:"license"`
}
LicenseChoice represents a license in a component.
type Model ¶
type Model struct {
GeneratedAt string
Overview []OverviewItem
Licenses []LicenseBlock
Notices []OutComponent
}
Model represents the data model for the output.
type OutComponent ¶
type OutComponent struct {
Name string
Version string
PURL string
URL string
LicenseIDs []string
Copyright string
}
OutComponent represents a component in the output model.
type OverviewItem ¶
OverviewItem represents an overview item in the output model.
type SBOM ¶
type SBOM struct {
Components []Component `json:"components"`
}
SBOM represents a CycloneDX SBOM structure.
type UnknownLicensesError ¶
type UnknownLicensesError struct {
IDs []string
}
UnknownLicensesError indicates that some license expressions could not be resolved.
func (UnknownLicensesError) Error ¶
func (e UnknownLicensesError) Error() string
Click to show internal directories.
Click to hide internal directories.