sbom

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FormatSpec added in v0.0.3

type FormatSpec string
const (
	FormatSpecCycloneDX FormatSpec = "cyclonedx"
	FormatSpecSPDX      FormatSpec = "spdx"
	FormatSpecUnknown   FormatSpec = "unknown"
)

func DetectSBOMSpecAndVersion added in v0.0.3

func DetectSBOMSpecAndVersion(data []byte) (FormatSpec, string, error)

type FormatSpecVersion added in v0.0.3

type FormatSpecVersion string
const (
	FormatSpecVersionCycloneDXV1_3 FormatSpecVersion = "1.3"
	FormatSpecVersionCycloneDXV1_4 FormatSpecVersion = "1.4"
	FormatSpecVersionCycloneDXV1_5 FormatSpecVersion = "1.5"
	FormatSpecVersionCycloneDXV1_6 FormatSpecVersion = "1.6"
	FormatSpecVersionSPDXV2_1      FormatSpecVersion = "SPDX-2.1"
	FormatSpecVersionSPDXV2_2      FormatSpecVersion = "SPDX-2.2"
	FormatSpecVersionSPDXV2_3      FormatSpecVersion = "SPDX-2.3"
)

type PrimaryComponent added in v0.0.3

type PrimaryComponent struct {
	Name    string
	Version string
}

func ExtractPrimaryComponentName added in v0.0.3

func ExtractPrimaryComponentName(content []byte) PrimaryComponent

type SBOMDocument

type SBOMDocument struct {
	Filename    string
	Format      SBOMFormat
	Content     []byte
	SpecVersion string
}

SBOMDocument represents a processed SBOM file

type SBOMFormat

type SBOMFormat string

SBOMFormat represents supported SBOM document formats

const (
	FormatCycloneDXJSON SBOMFormat = "CycloneDX-JSON"
	FormatCycloneDXXML  SBOMFormat = "CycloneDX-XML"
	FormatSPDXJSON      SBOMFormat = "SPDX-JSON"
	FormatSPDXYAML      SBOMFormat = "SPDX-YAML"
	FormatSPDXTag       SBOMFormat = "SPDX-Tag"
	FormatUnknown       SBOMFormat = "Unknown"
)

type SBOMProcessor

type SBOMProcessor struct {
	// contains filtered or unexported fields
}

SBOMProcessor handles SBOM document processing

func NewSBOMProcessor

func NewSBOMProcessor(outputDir string, verbose bool) *SBOMProcessor

NewSBOMProcessor creates a new SBOM processor TODO: outputDir will be used to save files in it TODO: verbose will be used to o/p sbom content on stdout

func (*SBOMProcessor) ProcessSBOMs

func (p *SBOMProcessor) ProcessSBOMs() (SBOMDocument, error)

ProcessSBOMs processes an SBOM directly from memory

func (*SBOMProcessor) Update

func (p *SBOMProcessor) Update(content []byte, repoName, filePath string)

func (*SBOMProcessor) WriteSBOM

func (p *SBOMProcessor) WriteSBOM(doc SBOMDocument, repoName string) error

WriteSBOM writes an SBOM to the output directory

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL