Documentation
¶
Index ¶
- Constants
- func GetAnnotations(sbom *v2_3.Document) (map[string]string, error)
- func GetFiles(sbom *v2_3.Document) ([]string, error)
- func GetPackages(sbom *v2_3.Document) ([]string, error)
- func LoadSBOMFromFile(filename string) (*v2_3.Document, *oci.Descriptor, error)
- func LoadSBOMFromReader(reader io.ReadCloser, size int64) (*v2_3.Document, *oci.Descriptor, error)
- func PushFiles(filename string, reference string, spdx_annotations map[string]string, ...) error
Constants ¶
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" )
const (
APPLICATION_USERAGENT = "obom"
)
Variables ¶
This section is empty.
Functions ¶
func GetAnnotations ¶
GetAnnotations returns the annotations from the SBOM
func GetPackages ¶
GetPackages returns the packages from the SBOM
func LoadSBOMFromFile ¶
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.
Types ¶
This section is empty.