package dbstore import ( "github.com/pablotron/cvez/feed" "github.com/pablotron/cvez/rfc3339" ) // CisaSearch() result type CisaSearchRow struct { Id int64 `json:"vuln_id"` // CISA vulnerability ID CatId int64 `json:"cat_id"` // CISA catalog ID CveId feed.CveId `json:"cve_id"` // NVD CVE ID Vendor string `json:"vendor"` // Vendor name Product string `json:"product"` // Product name Name string `json:"name"` // Vulnerability name Description string `json:"description"` // Vulnerability description AddedAt rfc3339.Date `json:"added_at"` // Date added to catalog Action string `json:"action"` // Action required DueAt rfc3339.Date `json:"due_at"` // Date due Rank float32 `json:"rank"` // search result rank } // sort.Interface for CisaSearchRow slice, sorted by rank. type byRank []CisaSearchRow // Required by sort.Interface. func (r byRank) Len() int { return len(r) } // Required by sort.Interface. func (r byRank) Less(i, j int) bool { return r[i].Rank < r[j].Rank } // Required by sort.Interface. func (r byRank) Swap(i, j int) { r[i], r[j] = r[j], r[i] }