-
Notifications
You must be signed in to change notification settings - Fork 9
/
template.go
32 lines (30 loc) · 901 Bytes
/
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
package main
// escaped data
const tpl = `#### VirusTotal
{{- if eq .ResponseCode 1 }}
| Ratio | Link | API | Scanned |
|------------|--------------|-------------|-------------|
| {{.Ratio}} | [link]({{.Permalink}}) | {{if .FirstSeen}}Private{{else}}Public{{end}} | {{.ScanDate}} |
{{- else }}
- Not found
{{- end }}
`
// var vt ResultsData
// err := mapstructure.Decode(virustotal, &vt)
// utils.Assert(err)
//
// fmt.Println("#### VirusTotal")
// if vt.ResponseCode == 0 {
// fmt.Println(" - Not found")
// } else {
// table := clitable.New([]string{"Ratio", "Link", "API", "Scanned"})
// table.AddRow(map[string]interface{}{
// "Ratio": getRatio(vt.Positives, vt.Total),
// "Link": fmt.Sprintf("[link](%s)", vt.Permalink),
// "API": "Public",
// // "API": vt.ApiType,
// "Scanned": vt.ScanDate,
// })
// table.Markdown = true
// table.Print()
// }