mirror of
https://github.com/anchore/syft.git
synced 2026-11-03 16:06:36 +01:00
feat: SPDX 2.3 support (#1311)
This commit is contained in:
@@ -11,6 +11,12 @@ import (
|
||||
"github.com/anchore/syft/syft/source"
|
||||
)
|
||||
|
||||
const (
|
||||
inputImage = "image"
|
||||
inputDirectory = "dir"
|
||||
inputFile = "file"
|
||||
)
|
||||
|
||||
func DocumentNameAndNamespace(srcMetadata source.Metadata) (string, string) {
|
||||
name := DocumentName(srcMetadata)
|
||||
return name, DocumentNamespace(name, srcMetadata)
|
||||
@@ -20,11 +26,11 @@ func DocumentNamespace(name string, srcMetadata source.Metadata) string {
|
||||
input := "unknown-source-type"
|
||||
switch srcMetadata.Scheme {
|
||||
case source.ImageScheme:
|
||||
input = "image"
|
||||
input = inputImage
|
||||
case source.DirectoryScheme:
|
||||
input = "dir"
|
||||
input = inputDirectory
|
||||
case source.FileScheme:
|
||||
input = "file"
|
||||
input = inputFile
|
||||
}
|
||||
|
||||
uniqueID := uuid.Must(uuid.NewRandom())
|
||||
|
||||
Reference in New Issue
Block a user