Skip to main content

cve

函数名函数描述/介绍
cve.AICompleteFieldsCVEAICompleteFields uses AI to complete missing CVE fields like translations Usage: - cve.AICompleteFields() - use default settings - cve.AIComple...
cve.DownloadDownLoad 从NVD下载CVE json数据到本地
cve.ExportExportCVE exports all CVE entries to a JSONL file Each line is a JSON object representing a CVE entry
cve.GetCVE
cve.ImportImportCVE imports CVE entries from a JSONL file Each line should be a JSON object representing a CVE entry
cve.LoadCVELoadCVE 从本地的CVE json数据加载构造数据库
cve.NewStatistics
cve.Query
cve.QueryEx
cve.after
cve.aiConcurrentWithCVEAIConcurrent sets the number of concurrent workers for AI completion
cve.before
cve.cpe
cve.cve
cve.cwe
cve.parseToCpe
cve.product
cve.score
cve.severity
cve.testLimitWithCVETestLimit sets the maximum number of CVEs to process (for testing)
cve.vendor

函数定义#

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

参数#

参数名参数类型参数解释
opts...any

返回值#

返回值(顺序)返回值类型返回值解释
r1error

Download#

详细描述#

DownLoad 从NVD下载CVE json数据到本地

定义#

Download(dir string, cached bool) error

参数#

参数名参数类型参数解释
dirstring
cachedbool

返回值#

返回值(顺序)返回值类型返回值解释
r1error

Export#

详细描述#

ExportCVE exports all CVE entries to a JSONL file Each line is a JSON object representing a CVE entry

定义#

Export(filename string) error

参数#

参数名参数类型参数解释
filenamestring

返回值#

返回值(顺序)返回值类型返回值解释
r1error

GetCVE#

详细描述#

定义#

GetCVE(cve string) *cveresources.CVE

参数#

参数名参数类型参数解释
cvestring

返回值#

返回值(顺序)返回值类型返回值解释
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

参数#

参数名参数类型参数解释
filenamestring

返回值#

返回值(顺序)返回值类型返回值解释
r1error

LoadCVE#

详细描述#

LoadCVE 从本地的CVE json数据加载构造数据库

定义#

LoadCVE(fileDir string, DbPath string, years ...int)

参数#

参数名参数类型参数解释
fileDirstring
DbPathstring
years...int

NewStatistics#

详细描述#

定义#

NewStatistics(source string) *Statistics

参数#

参数名参数类型参数解释
sourcestring

返回值#

返回值(顺序)返回值类型返回值解释
r1*Statistics

Query#

详细描述#

定义#

Query(db *gorm.DB, opts ...CVEOption) chan *cveresources.CVE

参数#

参数名参数类型参数解释
db*gorm.DB
opts...CVEOption

返回值#

返回值(顺序)返回值类型返回值解释
r1chan *cveresources.CVE

QueryEx#

详细描述#

定义#

QueryEx(i ...any) chan *cveresources.CVE

参数#

参数名参数类型参数解释
i...any

返回值#

返回值(顺序)返回值类型返回值解释
r1chan *cveresources.CVE

after#

详细描述#

定义#

after(year int, data ...int) CVEOption

参数#

参数名参数类型参数解释
yearint
data...int

返回值#

返回值(顺序)返回值类型返回值解释
r1CVEOption

aiConcurrent#

详细描述#

WithCVEAIConcurrent sets the number of concurrent workers for AI completion

定义#

aiConcurrent(n int) CVEAICompleteOption

参数#

参数名参数类型参数解释
nint

返回值#

返回值(顺序)返回值类型返回值解释
r1CVEAICompleteOption

before#

详细描述#

定义#

before(year int, data ...int) CVEOption

参数#

参数名参数类型参数解释
yearint
data...int

返回值#

返回值(顺序)返回值类型返回值解释
r1CVEOption

cpe#

详细描述#

定义#

cpe(c string) CVEOption

参数#

参数名参数类型参数解释
cstring

返回值#

返回值(顺序)返回值类型返回值解释
r1CVEOption

cve#

详细描述#

定义#

cve(id string) CVEOption

参数#

参数名参数类型参数解释
idstring

返回值#

返回值(顺序)返回值类型返回值解释
r1CVEOption

cwe#

详细描述#

定义#

cwe(cwe string) CVEOption

参数#

参数名参数类型参数解释
cwestring

返回值#

返回值(顺序)返回值类型返回值解释
r1CVEOption

parseToCpe#

详细描述#

定义#

parseToCpe(cpe string) (*CPE, error)

参数#

参数名参数类型参数解释
cpestring

返回值#

返回值(顺序)返回值类型返回值解释
r1*CPE
r2error

product#

详细描述#

定义#

product(p string, v ...string) CVEOption

参数#

参数名参数类型参数解释
pstring
v...string

返回值#

返回值(顺序)返回值类型返回值解释
r1CVEOption

score#

详细描述#

定义#

score(score float64) CVEOption

参数#

参数名参数类型参数解释
scorefloat64

返回值#

返回值(顺序)返回值类型返回值解释
r1CVEOption

severity#

详细描述#

定义#

severity(level string) CVEOption

参数#

参数名参数类型参数解释
levelstring

返回值#

返回值(顺序)返回值类型返回值解释
r1CVEOption

testLimit#

详细描述#

WithCVETestLimit sets the maximum number of CVEs to process (for testing)

定义#

testLimit(n int) CVEAICompleteOption

参数#

参数名参数类型参数解释
nint

返回值#

返回值(顺序)返回值类型返回值解释
r1CVEAICompleteOption

vendor#

详细描述#

定义#

vendor(v string) CVEOption

参数#

参数名参数类型参数解释
vstring

返回值#

返回值(顺序)返回值类型返回值解释
r1CVEOption