Skip to main content

cwe

函数名函数描述/介绍
cwe.AICompleteFieldsAICompleteFields uses AI to complete missing CWE fields like translations Usage: - cwe.AICompleteFields() - use default settings - cwe.AICompleteF...
cwe.ExportExportCWE exports all CWE entries to a JSONL file Each line is a JSON object representing a CWE entry
cwe.Get
cwe.ImportImportCWE imports CWE entries from a JSONL file Each line should be a JSON object representing a CWE entry
cwe.ListAllListAllCWE returns a channel that yields all CWE entries from the database
cwe.UpdateCWEUpdate downloads and updates the CWE database Usage: cwe.Update() or cwe.Update(cwe.proxy("http://127.0.0.1:8080"), cwe.url("https://cu...
cwe.aiConcurrentWithAIConcurrent sets the number of concurrent workers for AI completion
cwe.proxyWithCWEProxy sets the proxy for CWE download
cwe.testLimitWithTestLimit sets the maximum number of CWEs to process (for testing)
cwe.urlWithCWEURL sets the URL for CWE download

函数定义#

AICompleteFields#

详细描述#

AICompleteFields uses AI to complete missing CWE fields like translations Usage:

  • cwe.AICompleteFields() - use default settings
  • cwe.AICompleteFields(ai.type("openai")) - specify AI type
  • cwe.AICompleteFields(cwe.aiConcurrent(10)) - use 10 concurrent workers
  • cwe.AICompleteFields(cwe.testLimit(5)) - only process 5 CWEs for testing
  • cwe.AICompleteFields(cwe.aiConcurrent(10), cwe.testLimit(5), ai.type("openai"))

定义#

AICompleteFields(opts ...any) error

参数#

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

返回值#

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

Export#

详细描述#

ExportCWE exports all CWE entries to a JSONL file Each line is a JSON object representing a CWE entry

定义#

Export(filename string) error

参数#

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

返回值#

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

Get#

详细描述#

定义#

Get(i any) *cveresources.CWE

参数#

参数名参数类型参数解释
iany

返回值#

返回值(顺序)返回值类型返回值解释
r1*cveresources.CWE

Import#

详细描述#

ImportCWE imports CWE entries from a JSONL file Each line should be a JSON object representing a CWE entry

定义#

Import(filename string) error

参数#

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

返回值#

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

ListAll#

详细描述#

ListAllCWE returns a channel that yields all CWE entries from the database

定义#

ListAll() chan *cveresources.CWE

返回值#

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

Update#

详细描述#

CWEUpdate downloads and updates the CWE database Usage: cwe.Update() or cwe.Update(cwe.proxy("http://127.0.0.1:8080";), cwe.url("https://custom-url.com/cwe.zip";))

定义#

Update(opts ...CWEUpdateOption) error

参数#

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

返回值#

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

aiConcurrent#

详细描述#

WithAIConcurrent sets the number of concurrent workers for AI completion

定义#

aiConcurrent(n int) CWEAICompleteOption

参数#

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

返回值#

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

proxy#

详细描述#

WithCWEProxy sets the proxy for CWE download

定义#

proxy(proxy string) CWEUpdateOption

参数#

参数名参数类型参数解释
proxystring

返回值#

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

testLimit#

详细描述#

WithTestLimit sets the maximum number of CWEs to process (for testing)

定义#

testLimit(n int) CWEAICompleteOption

参数#

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

返回值#

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

url#

详细描述#

WithCWEURL sets the URL for CWE download

定义#

url(url string) CWEUpdateOption

参数#

参数名参数类型参数解释
urlstring

返回值#

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