函数定义#
AICompleteFields#
详细描述#
CVEAICompleteFields uses AI to complete missing CVE fields like translations
Usage:
- cve.AICompleteFields() - use default settings
- cve.AICompleteFields(ai.type("openai")) - specify AI type
- cve.AICompleteFields(cve.aiConcurrent(10)) - use 10 concurrent workers
- cve.AICompleteFields(cve.testLimit(5)) - only process 5 CVEs for testing
- cve.AICompleteFields(cve.aiConcurrent(10), cve.testLimit(5), ai.type("openai"))
AICompleteFields(opts ...any) error
返回值#
Download#
详细描述#
DownLoad 从NVD下载CVE json数据到本地
Download(dir string, cached bool) error
| 参数名 | 参数类型 | 参数解释 |
|---|
| dir | string | |
| cached | bool | |
返回值#
Export#
详细描述#
ExportCVE exports all CVE entries to a JSONL file
Each line is a JSON object representing a CVE entry
Export(filename string) error
| 参数名 | 参数类型 | 参数解释 |
|---|
| filename | string | |
返回值#
GetCVE#
详细描述#
GetCVE(cve string) *cveresources.CVE
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | *cveresources.CVE | |
Import#
详细描述#
ImportCVE imports CVE entries from a JSONL file
Each line should be a JSON object representing a CVE entry
Import(filename string) error
| 参数名 | 参数类型 | 参数解释 |
|---|
| filename | string | |
返回值#
LoadCVE#
详细描述#
LoadCVE 从本地的CVE json数据加载构造数据库
LoadCVE(fileDir string, DbPath string, years ...int)
| 参数名 | 参数类型 | 参数解释 |
|---|
| fileDir | string | |
| DbPath | string | |
| years | ...int | |
NewStatistics#
详细描述#
NewStatistics(source string) *Statistics
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | *Statistics | |
Query#
详细描述#
Query(db *gorm.DB, opts ...CVEOption) chan *cveresources.CVE
| 参数名 | 参数类型 | 参数解释 |
|---|
| db | *gorm.DB | |
| opts | ...CVEOption | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | chan *cveresources.CVE | |
QueryEx#
详细描述#
QueryEx(i ...any) chan *cveresources.CVE
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | chan *cveresources.CVE | |
after#
详细描述#
after(year int, data ...int) CVEOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| year | int | |
| data | ...int | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | CVEOption | |
aiConcurrent#
详细描述#
WithCVEAIConcurrent sets the number of concurrent workers for AI completion
aiConcurrent(n int) CVEAICompleteOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | CVEAICompleteOption | |
before#
详细描述#
before(year int, data ...int) CVEOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| year | int | |
| data | ...int | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | CVEOption | |
cpe#
详细描述#
cpe(c string) CVEOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | CVEOption | |
cve#
详细描述#
cve(id string) CVEOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | CVEOption | |
cwe#
详细描述#
cwe(cwe string) CVEOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | CVEOption | |
parseToCpe#
详细描述#
parseToCpe(cpe string) (*CPE, error)
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | *CPE | |
| r2 | error | |
product#
详细描述#
product(p string, v ...string) CVEOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| p | string | |
| v | ...string | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | CVEOption | |
score#
详细描述#
score(score float64) CVEOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | CVEOption | |
severity#
详细描述#
severity(level string) CVEOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | CVEOption | |
testLimit#
详细描述#
WithCVETestLimit sets the maximum number of CVEs to process (for testing)
testLimit(n int) CVEAICompleteOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | CVEAICompleteOption | |
vendor#
详细描述#
vendor(v string) CVEOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | CVEOption | |