forked from quay/goval-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dpkginfo.go
50 lines (44 loc) · 1.27 KB
/
dpkginfo.go
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
package oval
import (
"encoding/xml"
)
// DpkgInfoTest : >tests>dpkginfo_test
type DpkgInfoTest struct {
XMLName xml.Name `xml:"dpkginfo_test"`
ID string `xml:"id,attr"`
Comment string `xml:"comment,attr"`
Check string `xml:"check,attr"`
Version int `xml:"version,attr"`
testRef
}
var _ Test = (*DpkgInfoTest)(nil)
// DpkgName : >objects>dpkginfo_object>name
//
// when parsing ubuntu var_ref is a reference
// to the <variables> section of the document
//
// when parsing debian var_ref is empty and
// the Body field is used directly
type DpkgName struct {
XMLName xml.Name `xml:"name"`
Ref string `xml:"var_ref,attr"`
Body string `xml:",chardata"`
}
// DpkgInfoObject : >objects>dpkginfo_object
type DpkgInfoObject struct {
XMLName xml.Name `xml:"dpkginfo_object"`
ID string `xml:"id,attr"`
Version int `xml:"version,attr"`
Name *DpkgName `xml:"name"`
}
// DpkgInfoState : >states>dpkginfo_state
type DpkgInfoState struct {
XMLName xml.Name `xml:"dpkginfo_state"`
ID string `xml:"id,attr"`
Version int `xml:"version,attr"`
Arch *Arch `xml:"arch"`
Epoch *Epoch `xml:"epoch"`
Release *Release `xml:"release"`
DpkgVersion *Version `xml:"version"`
EVR *EVR `xml:"evr"`
}