sbom

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package sbom implements the unpacker that reads dependency data from a software bill of materials.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Subject

type Subject struct {
	// Reader is the SBOM document stream.
	Reader io.ReadSeeker
	// Path is the path to an SBOM document on disk. It is opened lazily by the
	// unpacker when Reader is not set.
	Path string
}

Subject is the DecomposableSubject consumed by the SBOM unpacker. It wraps a software bill of materials in any of the formats protobom understands. Either Reader or Path must be set; when both are set Reader takes precedence.

func (*Subject) DecomposableType

func (s *Subject) DecomposableType() string

DecomposableType identifies this subject as an SBOM, routing it to the SBOM unpacker through the registry.

type Unpacker

type Unpacker struct{}

Unpacker reads dependency data out of an existing SBOM document. It has no decomposers: the SBOM format itself is the subject matter, parsed directly.

func NewUnpacker

func NewUnpacker() *Unpacker

NewUnpacker returns a ready-to-use SBOM unpacker.

func (*Unpacker) Extract

func (u *Unpacker) Extract(_ context.Context, subject api.DecomposableSubject) ([]*protosbom.NodeList, error)

Extract parses the SBOM in the subject and returns its node list.

func (*Unpacker) RegisterDecomposer

func (u *Unpacker) RegisterDecomposer(api.Decomposer)

RegisterDecomposer is a no-op: the SBOM unpacker has no decomposers.

func (*Unpacker) UnregisterDecomposer

func (u *Unpacker) UnregisterDecomposer(api.Decomposer)

UnregisterDecomposer is a no-op: the SBOM unpacker has no decomposers.

Jump to

Keyboard shortcuts

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