diff options
-rw-r--r-- | spdx/creation_info.go | 42 |
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 +} |