aboutsummaryrefslogtreecommitdiff
path: root/spdx/common/snippet.go
diff options
context:
space:
mode:
authorBrandon Lum <lumjjb@gmail.com>2022-06-06 10:42:27 -0400
committerBrandon Lum <lumjjb@gmail.com>2022-06-06 10:42:27 -0400
commit41d2272711255f5a25e16e3507ec3318bc550189 (patch)
treeace557ed0ffe3fab18f721744448de5936f23976 /spdx/common/snippet.go
parenta532726dbb7a38d0f714075e9a1f1df4cae60230 (diff)
downloadspdx-tools-41d2272711255f5a25e16e3507ec3318bc550189.tar.gz
convert spdx structs to versioned pkgs
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
Diffstat (limited to 'spdx/common/snippet.go')
-rw-r--r--spdx/common/snippet.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/spdx/common/snippet.go b/spdx/common/snippet.go
new file mode 100644
index 0000000..63afac3
--- /dev/null
+++ b/spdx/common/snippet.go
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
+
+package common
+
+type SnippetRangePointer struct {
+ // 5.3: Snippet Byte Range: [start byte]:[end byte]
+ // Cardinality: mandatory, one
+ Offset int `json:"offset,omitempty"`
+
+ // 5.4: Snippet Line Range: [start line]:[end line]
+ // Cardinality: optional, one
+ LineNumber int `json:"lineNumber,omitempty"`
+
+ FileSPDXIdentifier ElementID `json:"reference"`
+}
+
+type SnippetRange struct {
+ StartPointer SnippetRangePointer `json:"startPointer"`
+ EndPointer SnippetRangePointer `json:"endPointer"`
+}