/
common.go
34 lines (27 loc) · 1009 Bytes
/
common.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
package server
const (
APIGroupNVD = "/nvd"
APIPathGetCVE = "/cve"
APIPathGetCPE = "/cpe"
APIPathReady = "/readiness"
// Status... are variables that shows the status for API
// Since api returns 200 for both 'found' and 'not_found' instead of 404,
// it should be another field to inform the status from DB
StatusFound = "found"
StatusNotFound = "not_found"
StatusError = "error"
// Qs... are keys of query string that are valid for API
QsCveId = "cveId"
QsCpeName = "cpeName"
QsCpeMatchStr = "cpeMatchString"
QsKeyword = "keywordSearch"
QsKeywordExact = "keywordExactMatch"
QsStartIndex = "startIndex"
QsResultsPerPage = "resultsPerPage"
)
var (
// CVEQSKeys is the keys of query string. It's expected to provide one of them for CVE API
CVEQSKeys = []string{QsCveId, QsCpeName, QsKeyword}
// CPEQSKeys is the keys of query string. It's expected to provide one of them for CPE API
CPEQSKeys = []string{QsCpeMatchStr, QsCpeName, QsKeyword}
)