sbom

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const AnyVersion = ""

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifacts

type Artifacts struct {
	Packages          *pkg.Collection
	FileMetadata      map[file.Coordinates]file.Metadata
	FileDigests       map[file.Coordinates][]file.Digest
	FileContents      map[file.Coordinates]string
	FileLicenses      map[file.Coordinates][]file.License
	Executables       map[file.Coordinates]file.Executable
	LinuxDistribution *linux.Release
}

type Descriptor

type Descriptor struct {
	Name          string
	Version       string
	Configuration interface{}
}

type FormatDecoder

type FormatDecoder interface {
	// Decode will return an SBOM from the given reader. If the bytes are not a valid SBOM for the given format
	// then an error will be returned.
	Decode(io.Reader) (*SBOM, FormatID, string, error)

	// Identify will return the format ID and version for the given reader. Note: this does not validate the
	// full SBOM, only pulls the minimal information necessary to identify the format.
	Identify(io.Reader) (FormatID, string)
}

type FormatEncoder

type FormatEncoder interface {
	ID() FormatID
	Aliases() []string
	Version() string
	Encode(io.Writer, SBOM) error
}

type FormatID

type FormatID string

func (FormatID) String

func (f FormatID) String() string

String returns a string representation of the FormatID.

type SBOM

type SBOM struct {
	Artifacts     Artifacts
	Relationships []artifact.Relationship
	Source        source.Description
	Descriptor    Descriptor
}

func (SBOM) AllCoordinates

func (s SBOM) AllCoordinates() []file.Coordinates

func (SBOM) CoordinatesForPackage

func (s SBOM) CoordinatesForPackage(p pkg.Package, rt ...artifact.RelationshipType) []file.Coordinates

CoordinatesForPackage returns all coordinates for the provided package for provided relationship types If no types are provided, all relationship types are considered.

func (SBOM) RelationshipsForPackage

func (s SBOM) RelationshipsForPackage(p pkg.Package, rt ...artifact.RelationshipType) []artifact.Relationship

RelationshipsForPackage returns all relationships for the provided types. If no types are provided, all relationships for the package are returned.

func (SBOM) RelationshipsSorted

func (s SBOM) RelationshipsSorted() []artifact.Relationship

type Writer

type Writer interface {
	Write(SBOM) error
}

Writer an interface to write SBOMs to a destination

Jump to

Keyboard shortcuts

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