-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtemplate.go
69 lines (56 loc) · 1.6 KB
/
template.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package main
import "encoding/xml"
const tpl = `#### McAfee
{{- with .Results }}
| Infected | Result | Engine | Updated |
|:-------------:|:-----------:|:-----------:|:------------:|
| {{.Infected}} | {{.Result}} | {{.Engine}} | {{.Updated}} |
{{ end -}}
`
type productName struct {
Value string `xml:"value,attr"`
}
type mVersion struct {
Value string `xml:"value,attr"`
}
type licenseInfo struct {
Value string `xml:"value,attr"`
}
type aVEngineVersion struct {
Value string `xml:"value,attr"`
}
type datSetVersion struct {
Value string `xml:"value,attr"`
}
type preamble struct {
XMLName xml.Name `xml:"Preamble"`
ProductName productName `xml:"Product_name"`
Version mVersion `xml:"Version"`
LicenseInfo licenseInfo `xml:"License_info"`
AVEngineVersion aVEngineVersion `xml:"AV_Engine_version"`
DatSetVersion datSetVersion `xml:"Dat_set_version"`
}
type scanDateTime struct {
Value string `xml:"value,attr"`
}
type scanOptions struct {
Value string `xml:"value,attr"`
}
type fileResults struct {
Name string `xml:"name,attr"`
Status string `xml:"status,attr"`
VirusName string `xml:"virus-name,attr"`
DetectionType string `xml:"detection-type,attr"`
}
type timeToScan struct {
Value string `xml:"value,attr"`
}
// McAfeeResults is the xml data struct
type McAfeeResults struct {
XMLName xml.Name `xml:"Uvscan"`
Preamble preamble `xml:"Preamble"`
DateTime scanDateTime `xml:"Date_Time"`
Options scanOptions `xml:"Options"`
File fileResults `xml:"File"`
Time timeToScan `xml:"Time"`
}