aboutsummaryrefslogtreecommitdiff
path: root/spdx/snippet.go
blob: 5fe37ca3ad8bc2d2f75e8c208309a5b168d6b231 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later

package spdx

// Snippet2_1 is a Snippet section of an SPDX Document for version 2.1 of the spec.
type Snippet2_1 struct {

	// 5.1: Snippet SPDX Identifier: "SPDXRef-[idstring]"
	// Cardinality: mandatory, one
	SnippetSPDXIdentifier ElementID

	// 5.2: Snippet from File SPDX Identifier
	// Cardinality: mandatory, one
	SnippetFromFileSPDXIdentifier DocElementID

	// 5.3: Snippet Byte Range: [start byte]:[end byte]
	// Cardinality: mandatory, one
	SnippetByteRangeStart int
	SnippetByteRangeEnd   int

	// 5.4: Snippet Line Range: [start line]:[end line]
	// Cardinality: optional, one
	SnippetLineRangeStart int
	SnippetLineRangeEnd   int

	// 5.5: Snippet Concluded License: SPDX License Expression, "NONE" or "NOASSERTION"
	// Cardinality: mandatory, one
	SnippetLicenseConcluded string

	// 5.6: License Information in Snippet: SPDX License Expression, "NONE" or "NOASSERTION"
	// Cardinality: optional, one or many
	LicenseInfoInSnippet []string

	// 5.7: Snippet Comments on License
	// Cardinality: optional, one
	SnippetLicenseComments string

	// 5.8: Snippet Copyright Text: copyright notice(s) text, "NONE" or "NOASSERTION"
	// Cardinality: mandatory, one
	SnippetCopyrightText string

	// 5.9: Snippet Comment
	// Cardinality: optional, one
	SnippetComment string

	// 5.10: Snippet Name
	// Cardinality: optional, one
	SnippetName string
}

// Snippet2_2 is a Snippet section of an SPDX Document for version 2.2 of the spec.
type Snippet2_2 struct {

	// 5.1: Snippet SPDX Identifier: "SPDXRef-[idstring]"
	// Cardinality: mandatory, one
	SnippetSPDXIdentifier ElementID

	// 5.2: Snippet from File SPDX Identifier
	// Cardinality: mandatory, one
	SnippetFromFileSPDXIdentifier DocElementID

	// 5.3: Snippet Byte Range: [start byte]:[end byte]
	// Cardinality: mandatory, one
	SnippetByteRangeStart int
	SnippetByteRangeEnd   int

	// 5.4: Snippet Line Range: [start line]:[end line]
	// Cardinality: optional, one
	SnippetLineRangeStart int
	SnippetLineRangeEnd   int

	// 5.5: Snippet Concluded License: SPDX License Expression, "NONE" or "NOASSERTION"
	// Cardinality: mandatory, one
	SnippetLicenseConcluded string

	// 5.6: License Information in Snippet: SPDX License Expression, "NONE" or "NOASSERTION"
	// Cardinality: optional, one or many
	LicenseInfoInSnippet []string

	// 5.7: Snippet Comments on License
	// Cardinality: optional, one
	SnippetLicenseComments string

	// 5.8: Snippet Copyright Text: copyright notice(s) text, "NONE" or "NOASSERTION"
	// Cardinality: mandatory, one
	SnippetCopyrightText string

	// 5.9: Snippet Comment
	// Cardinality: optional, one
	SnippetComment string

	// 5.10: Snippet Name
	// Cardinality: optional, one
	SnippetName string

	// 5.11: Snippet Attribution Text
	// Cardinality: optional, one or many
	SnippetAttributionTexts []string
}