obom

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MEDIATYPE_SPDX                    = "application/spdx+json"
	OCI_ANNOTATION_DOCUMENT_NAME      = "org.spdx.name"
	OCI_ANNOTATION_DATA_LICENSE       = "org.spdx.license"
	OCI_ANNOTATION_DOCUMENT_NAMESPACE = "org.spdx.namespace"
	OCI_ANNOTATION_SPDX_VERSION       = "org.spdx.version"
	OCI_ANNOTATION_CREATION_DATE      = "org.spdx.created"
	OCI_ANNOTATION_ANNOTATOR          = "org.spdx.annotator"
	OCI_ANNOTATION_ANNOTATION_DATE    = "org.spdx.annotation_date"
)
View Source
const (
	APPLICATION_USERAGENT = "obom"
)

Variables

This section is empty.

Functions

func GetAnnotations

func GetAnnotations(sbom *v2_3.Document) (map[string]string, error)

GetAnnotations returns the annotations from the SBOM

func GetFiles

func GetFiles(sbom *v2_3.Document) ([]string, error)

func GetPackages

func GetPackages(sbom *v2_3.Document) ([]string, error)

GetPackages returns the packages from the SBOM

func LoadSBOMFromFile

func LoadSBOMFromFile(filename string) (*v2_3.Document, *oci.Descriptor, error)

LoadSBOMFromFile opens a file given by filename, reads its contents, and loads it into an SPDX document. It also calculates the file size and generates an OCI descriptor for the file. It returns the loaded SPDX document, the OCI descriptor, and any error encountered.

func LoadSBOMFromReader

func LoadSBOMFromReader(reader io.ReadCloser, size int64) (*v2_3.Document, *oci.Descriptor, error)

LoadSBOMFromReader reads an SPDX document from an io.ReadCloser, generates an OCI descriptor for the document, and returns the loaded SPDX document and the OCI descriptor. The size parameter is the size of the document in bytes. If an error occurs during reading the document or generating the descriptor, the error will be returned.

func PushFiles

func PushFiles(filename string, reference string, spdx_annotations map[string]string, username string, password string) error

PushFiles pushes the SPDX SBOM file to the registry

Types

This section is empty.

Jump to

Keyboard shortcuts

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