spdx / tools-golang

Collection of Go packages to work with SPDX files
Other
122 stars 56 forks source link

Consider whether to add top-level map of all IDs #27

Open swinslow opened 4 years ago

swinslow commented 4 years ago

Separate tracking issue for @goneall's comment at https://github.com/spdx/tools-golang/issues/24#issuecomment-626220481:

This means that probably this should just be replaced with a top-level "UnpackagedFiles" map of ElementIDs to Files at the Document level, and pull it out of the "Packages" map altogether.

For the Java code, there is simply a map of all SpdxElements within a document which includes both packages and files (since they subclass elements). There is a separate property for the Package that references the files.

Consider whether to add this to the Document structure. It would enable quickly finding an element. In particular, for documents with multiple Packages and Files within each one, it would enable quickly finding a File by ID with a single lookup, rather than crawling through each Package's set of Files.

djfemz commented 3 years ago

Hey, @swinslow can I try my hand on this issue? I would like to give it a go.

swinslow commented 2 years ago

Marking this as part of 0.4.0, so we can consider it together with some other potential API changes for that release.