sbom

package
v0.97.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 9 Imported by: 98

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
	Secrets           map[file.Coordinates][]file.SearchResult
	LinuxDistribution *linux.Release
}

type Descriptor added in v0.31.0

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

type FormatDecoder added in v0.95.0

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.ReadSeeker) (*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.ReadSeeker) (FormatID, string)
}

type FormatEncoder added in v0.95.0

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

type FormatID added in v0.41.0

type FormatID string

func (FormatID) String added in v0.42.4

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 added in v0.57.0

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

func (SBOM) CoordinatesForPackage added in v0.64.0

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 added in v0.64.0

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 added in v0.57.0

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

type Writer added in v0.35.0

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