github.com/nextlinux/gosbom@v0.81.1-0.20230627115839-1ff50c281391/gosbom/formats/common/spdxhelpers/external_ref.go (about)

     1  package spdxhelpers
     2  
     3  type ReferenceCategory string
     4  
     5  const (
     6  	SecurityReferenceCategory       ReferenceCategory = "SECURITY"
     7  	PackageManagerReferenceCategory ReferenceCategory = "PACKAGE-MANAGER"
     8  	OtherReferenceCategory          ReferenceCategory = "OTHER"
     9  )
    10  
    11  // source: https://spdx.github.io/spdx-spec/appendix-VI-external-repository-identifiers/
    12  
    13  type ExternalRefType string
    14  
    15  const (
    16  	// see https://nvd.nist.gov/cpe
    17  	Cpe22ExternalRefType ExternalRefType = "cpe22Type"
    18  	// see https://nvd.nist.gov/cpe
    19  	Cpe23ExternalRefType ExternalRefType = "cpe23Type"
    20  	// see http://repo1.maven.org/maven2/
    21  	MavenCentralExternalRefType ExternalRefType = "maven-central"
    22  	// see https://www.npmjs.com/
    23  	NpmExternalRefType ExternalRefType = "npm"
    24  	// see https://www.nuget.org/
    25  	NugetExternalRefType ExternalRefType = "nuget"
    26  	// see http://bower.io/
    27  	BowerExternalRefType ExternalRefType = "bower"
    28  	// see https://github.com/package-url/purl-spec
    29  	PurlExternalRefType ExternalRefType = "purl"
    30  	// These point to objects present in the Software Heritage archive by the means of SoftWare Heritage persistent Identifiers (SWHID)
    31  	SwhExternalRefType ExternalRefType = "swh"
    32  )
    33  
    34  type ExternalRef struct {
    35  	Comment string `json:"comment,omitempty"`
    36  	// Category for the external reference.
    37  	ReferenceCategory ReferenceCategory `json:"referenceCategory"`
    38  	// The unique string with no spaces necessary to access the package-specific information, metadata, or content
    39  	// within the target location. The format of the locator is subject to constraints defined by the <type>.
    40  	ReferenceLocator string `json:"referenceLocator"`
    41  	// Type of the external reference. These are defined in an appendix in the SPDX specification.
    42  	ReferenceType ExternalRefType `json:"referenceType"`
    43  }