File: location_relationship.go

package info (click to toggle)
golang-github-owenrumney-go-sarif 2.3.3-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 712 kB
  • sloc: makefile: 13
file content (29 lines) | stat: -rw-r--r-- 685 bytes parent folder | download
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
package sarif

// LocationRelationship ...
type LocationRelationship struct {
	PropertyBag
	Target      uint     `json:"target"`
	Kinds       []string `json:"kinds,omitempty"`
	Description *Message `json:"description,omitempty"`
}

// NewLocationRelationship ...
func NewLocationRelationship(target int) *LocationRelationship {
	t := uint(target)
	return &LocationRelationship{
		Target: t,
	}
}

// WithKind ...
func (l *LocationRelationship) WithKind(kind string) *LocationRelationship {
	l.Kinds = append(l.Kinds, kind)
	return l
}

// WithDescription ...
func (l *LocationRelationship) WithDescription(message *Message) *LocationRelationship {
	l.Description = message
	return l
}