Beautify alert (#746)

* update dep

* to make easy edit alert data manually

* fix alert data bug
This commit is contained in:
Tomoya Amachi
2018-12-05 12:30:04 +09:00
committed by Kota Kanbe
parent b3260588c6
commit 9147ec148d
9 changed files with 4480 additions and 4046 deletions

21
alert/util.go Normal file
View File

@@ -0,0 +1,21 @@
package alert
// GenerateAlertDict returns XCERT alert slice by cveID
func GenerateAlertDict(cveID string, lang string) (alerts []Alert) {
if lang == "ja" {
if keys, ok := CveDictJa[cveID]; ok {
for _, key := range keys {
alerts = append(alerts, AlertDictJa[key])
}
}
return alerts
}
// default language is English
if keys, ok := CveDictEn[cveID]; ok {
for _, key := range keys {
alerts = append(alerts, AlertDictEn[key])
}
}
return alerts
}