Documentation ¶
Overview ¶
Package models contains any structs used throughout kissbom
Index ¶
Constants ¶
const ( OptionJSON = "json" // OptionDefault represents the default output format (kissbom format, json encoding). OptionYAML = "yaml" // OptionYAML represents the YAML output format (kissbom format, json encoding). OptionMinimal = "minimal" // OptionMinimal represents a minimal output format (kissbom format, but only Purls). OptionCompatible = "compatible" // OptionCompatible represents a compatible output format (CycloneDX formatted output, but only Purls). OptionCSV = "csv" // OptionCSV represents a CSV (Comma-Separated Values) output format (all kissbom elements) )
Enumeration of valid output formats for kissbom.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KissBOM ¶
type KissBOM struct {
Packages []Package `json:"packages"` // Packages is a slice of Package structs, serialized as "packages" in JSON.
}
KissBOM represents a collection of packages.
func NewKissBOMFromCycloneDX ¶
func NewKissBOMFromCycloneDX(cdx *cyclonedx.BOM) (kissbom KissBOM)
NewKissBOMFromCycloneDX creates a new KissBOM (Keep It Simple Software Bill of Materials) from a CycloneDX Bill of Materials (BOM). It iterates over the components in the CycloneDX BOM and constructs a simplified representation in the KissBOM format, with essential information such as Package URL and Description.
Parameters:
- cdx: A pointer to a CycloneDX BOM containing information about software components.
Returns:
- kissbom: A KissBOM representation derived from the CycloneDX BOM.
NewKissBOMFromCycloneDX converts a CycloneDX BOM (Bill of Materials) to a KissBOM (KISS Build of Materials) by extracting relevant information from each component.
func (*KissBOM) Compatible ¶
Compatible generates a CycloneDX Bill of Materials (BOM) based on the packages stored in the KissBOM instance. Each package's PackageURL is used to create corresponding CycloneDX components, and these components are added to the BOM. The resulting BOM is then encoded to a byte slice using the JSON format.
Returns:
- The encoded BOM as a byte slice.
- An error if there was any issue during encoding.
type Package ¶
type Package struct { Purl string `json:"purl" csv:"purl" yaml:"purl"` // Purl is the Package URL, a unique identifier for the package. License string `json:"license,omitempty" csv:"license" yaml:"license,omitempty"` // License is the software license associated with the package, omitempty allows for optional serialization. Copyright string `json:"copyright,omitempty" csv:"copyright" yaml:"copyright,omitempty"` // Copyright is information about the package's copyright, omitempty allows for optional serialization. Notes string `json:"notes,omitempty" csv:"notes" yaml:"notes,omitempty"` // Notes is additional notes or comments about the package, omitempty allows for optional serialization. }
Package represents information about a software package.