aboutsummaryrefslogtreecommitdiff
path: root/spdx/relationship.go
blob: 91277277fb7075789be2830ff941034faca59266 (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
// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later

package spdx

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

	// 7.1: Relationship
	// Cardinality: optional, one or more; one per Relationship2_1
	//              one mandatory for SPDX Document with multiple packages
	// RefA and RefB are first and second item
	// Relationship is type from 7.1.1
	RefA         DocElementID `json:"spdxElementId"`
	RefB         DocElementID `json:"relatedSpdxElement"`
	Relationship string       `json:"relationshipType"`

	// 7.2: Relationship Comment
	// Cardinality: optional, one
	RelationshipComment string `json:"comment,omitempty"`
}

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

	// 7.1: Relationship
	// Cardinality: optional, one or more; one per Relationship2_2
	//              one mandatory for SPDX Document with multiple packages
	// RefA and RefB are first and second item
	// Relationship is type from 7.1.1
	RefA         DocElementID `json:"spdxElementId"`
	RefB         DocElementID `json:"relatedSpdxElement"`
	Relationship string       `json:"relationshipType"`

	// 7.2: Relationship Comment
	// Cardinality: optional, one
	RelationshipComment string `json:"comment,omitempty"`
}