| 函数名 | 函数描述/介绍 |
|---|
| cwe.AICompleteFields | AICompleteFields uses AI to complete missing CWE fields like translations Usage: - cwe.AICompleteFields() - use default settings - cwe.AICompleteF... |
| cwe.Export | ExportCWE exports all CWE entries to a JSONL file Each line is a JSON object representing a CWE entry |
| cwe.Get | |
| cwe.Import | ImportCWE imports CWE entries from a JSONL file Each line should be a JSON object representing a CWE entry |
| cwe.ListAll | ListAllCWE returns a channel that yields all CWE entries from the database |
| 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://cu... |
| cwe.aiConcurrent | WithAIConcurrent sets the number of concurrent workers for AI completion |
| cwe.proxy | WithCWEProxy sets the proxy for CWE download |
| cwe.testLimit | WithTestLimit sets the maximum number of CWEs to process (for testing) |
| cwe.url | WithCWEURL 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
返回值#
Export#
详细描述#
ExportCWE exports all CWE entries to a JSONL file
Each line is a JSON object representing a CWE entry
Export(filename string) error
| 参数名 | 参数类型 | 参数解释 |
|---|
| filename | string | |
返回值#
Get#
详细描述#
Get(i any) *cveresources.CWE
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| 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
| 参数名 | 参数类型 | 参数解释 |
|---|
| filename | string | |
返回值#
ListAll#
详细描述#
ListAllCWE returns a channel that yields all CWE entries from the database
ListAll() chan *cveresources.CWE
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | chan *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 | |
返回值#
aiConcurrent#
详细描述#
WithAIConcurrent sets the number of concurrent workers for AI completion
aiConcurrent(n int) CWEAICompleteOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | CWEAICompleteOption | |
proxy#
详细描述#
WithCWEProxy sets the proxy for CWE download
proxy(proxy string) CWEUpdateOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | CWEUpdateOption | |
testLimit#
详细描述#
WithTestLimit sets the maximum number of CWEs to process (for testing)
testLimit(n int) CWEAICompleteOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | CWEAICompleteOption | |
url#
详细描述#
WithCWEURL sets the URL for CWE download
url(url string) CWEUpdateOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | CWEUpdateOption | |