Documentation
¶
Overview ¶
Package sbomattr provides a high-level API for extracting attribution information from Software Bill of Materials (SBOM) files in SPDX and CycloneDX formats.
Supported formats:
- SPDX 2.3 (JSON)
- CycloneDX 1.4 (JSON)
- GitHub-wrapped SBOMs (JSON)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Process ¶
func Process(ctx context.Context, data []byte, logger *slog.Logger) ([]attribution.Attribution, error)
Process processes a single SBOM file provided as a byte slice. It automatically detects the SBOM format (SPDX or CycloneDX), parses it, and extracts attribution information.
The context parameter can be used for cancellation. The logger parameter is optional; pass nil to disable logging.
Returns a slice of Attribution structs or an error if the SBOM cannot be processed.
func ProcessFiles ¶
func ProcessFiles(ctx context.Context, filenames []string, logger *slog.Logger) ([]attribution.Attribution, error)
ProcessFiles processes multiple SBOM files from the filesystem. It reads each file, processes the SBOM, aggregates the results, and deduplicates attributions based on Package URL (purl) or name if purl is not available.
The context parameter can be used for cancellation. The logger parameter is optional; pass nil to disable logging. Errors processing individual files are logged but do not stop processing of other files.
Returns the deduplicated attributions or an error if no valid attributions could be extracted.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package attribution provides types and functions for working with attribution information.
|
Package attribution provides types and functions for working with attribution information. |
|
cmd
|
|
|
sbomattr
command
|
|
|
Package cyclonedxextract provides parsing and extraction functionality for CycloneDX SBOMs.
|
Package cyclonedxextract provides parsing and extraction functionality for CycloneDX SBOMs. |
|
Package format provides output formatters for attribution data.
|
Package format provides output formatters for attribution data. |
|
internal
|
|
|
sbom
Package sbom provides internal utilities for working with SBOM (Software Bill of Materials) formats.
|
Package sbom provides internal utilities for working with SBOM (Software Bill of Materials) formats. |
|
Package spdxextract provides parsing and extraction functionality for SPDX SBOMs.
|
Package spdxextract provides parsing and extraction functionality for SPDX SBOMs. |