aboutsummaryrefslogtreecommitdiff
path: root/spdx
diff options
context:
space:
mode:
authorSteve Winslow <steve@swinslow.net>2020-11-08 15:47:20 -0500
committerSteve Winslow <steve@swinslow.net>2020-11-08 15:47:20 -0500
commitc6ca9bd99bbbac08be66713b2a96b7d1eafa6540 (patch)
tree037e65deeb8d2c56c00296b59224126780816190 /spdx
parent5a270f97f4106cf989761f9143e23132c1bffb3c (diff)
downloadspdx-tools-c6ca9bd99bbbac08be66713b2a96b7d1eafa6540.tar.gz
Expand external document ref data structure
Signed-off-by: Steve Winslow <steve@swinslow.net>
Diffstat (limited to 'spdx')
-rw-r--r--spdx/creation_info.go42
1 files changed, 40 insertions, 2 deletions
diff --git a/spdx/creation_info.go b/spdx/creation_info.go
index d256a42..a2b82b0 100644
--- a/spdx/creation_info.go
+++ b/spdx/creation_info.go
@@ -28,7 +28,7 @@ type CreationInfo2_1 struct {
// 2.6: External Document References
// Cardinality: optional, one or many
- ExternalDocumentReferences []string
+ ExternalDocumentReferences map[string]ExternalDocumentRef2_1
// 2.7: License List Version
// Cardinality: optional, one
@@ -54,6 +54,25 @@ type CreationInfo2_1 struct {
DocumentComment string
}
+// ExternalDocumentRef2_1 is a reference to an external SPDX document
+// as defined in section 2.6 for version 2.1 of the spec.
+type ExternalDocumentRef2_1 struct {
+
+ // DocumentRefID is the ID string defined in the start of the
+ // reference. It should _not_ contain the "DocumentRef-" part
+ // of the mandatory ID string.
+ DocumentRefID string
+
+ // URI is the URI defined for the external document
+ URI string
+
+ // Alg is the type of hash algorithm used, e.g. "SHA1", "SHA256"
+ Alg string
+
+ // Checksum is the actual hash data
+ Checksum string
+}
+
// CreationInfo2_2 is a Document Creation Information section of an
// SPDX Document for version 2.2 of the spec.
type CreationInfo2_2 struct {
@@ -80,7 +99,7 @@ type CreationInfo2_2 struct {
// 2.6: External Document References
// Cardinality: optional, one or many
- ExternalDocumentReferences []string
+ ExternalDocumentReferences map[string]ExternalDocumentRef2_2
// 2.7: License List Version
// Cardinality: optional, one
@@ -105,3 +124,22 @@ type CreationInfo2_2 struct {
// Cardinality: optional, one
DocumentComment string
}
+
+// ExternalDocumentRef2_2 is a reference to an external SPDX document
+// as defined in section 2.6 for version 2.2 of the spec.
+type ExternalDocumentRef2_2 struct {
+
+ // DocumentRefID is the ID string defined in the start of the
+ // reference. It should _not_ contain the "DocumentRef-" part
+ // of the mandatory ID string.
+ DocumentRefID string
+
+ // URI is the URI defined for the external document
+ URI string
+
+ // Alg is the type of hash algorithm used, e.g. "SHA1", "SHA256"
+ Alg string
+
+ // Checksum is the actual hash data
+ Checksum string
+}