Initial commit
This commit is contained in:
parent
f6c2eafc54
commit
a6377b805d
10 changed files with 799 additions and 2 deletions
42
notice.go
Normal file
42
notice.go
Normal file
|
@ -0,0 +1,42 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
// "encoding/json"
|
||||
"time"
|
||||
)
|
||||
|
||||
type WidNotice struct {
|
||||
// obligatory
|
||||
Uuid string `json:"uuid"`
|
||||
Name string `json:"name"`
|
||||
Title string `json:"title"`
|
||||
Published time.Time `json:"published"`
|
||||
Classification string `json:"classification"`
|
||||
// optional fields (only fully supported by cert-bund)
|
||||
Basescore int `json:"basescore"` // -1 = unknown
|
||||
Status string `json:"status"` // "" = unknown
|
||||
ProductNames []string `json:"productNames"` // empty = unknown
|
||||
Cves []string `json:"cves"` // empty = unknown
|
||||
NoPatch string `json:"noPatch"` // "" = unknown
|
||||
// metadata
|
||||
PortalUrl string
|
||||
}
|
||||
|
||||
// func (n WidNotice) serialized() ([]byte, error) {
|
||||
// return json.Marshal(n)
|
||||
// }
|
||||
|
||||
// func NewWidNoticeFromJSON(data []byte) (WidNotice, error) {
|
||||
// n := WidNotice{}
|
||||
// err := json.Unmarshal(data, &n)
|
||||
// return n, err
|
||||
// }
|
||||
|
||||
func noticeSliceContains(notices []WidNotice, notice WidNotice) bool {
|
||||
for _, x := range notices {
|
||||
if x.Uuid == notice.Uuid {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue