Skip to content

Commit a74180e

Browse files
committed
完善CPE库功能和文档: 添加详细API注释和使用示例,增强匹配搜索和存储功能,实现NVD集成和CVE关联查询,添加高级匹配和集合操作,创建完整示例代码,配置GitHub Action,完善README文档
1 parent 07935b0 commit a74180e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+14184
-43
lines changed

.github/workflows/go-tests.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Go Tests and Examples
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
test:
11+
name: Test and Run Examples
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Set up Go
15+
uses: actions/setup-go@v4
16+
with:
17+
go-version: '1.20'
18+
cache: true
19+
20+
- name: Check out code
21+
uses: actions/checkout@v3
22+
23+
- name: Get dependencies
24+
run: go mod download
25+
26+
- name: Run unit tests
27+
run: go test -v ./...
28+
29+
- name: Build examples
30+
run: |
31+
for dir in examples/*; do
32+
if [ -d "$dir" ]; then
33+
echo "Building example: $dir"
34+
cd "$dir"
35+
go build -v
36+
cd -
37+
fi
38+
done
39+
40+
- name: Run examples
41+
run: |
42+
for dir in examples/*; do
43+
if [ -d "$dir" ]; then
44+
echo "Running example: $dir"
45+
cd "$dir"
46+
if [ -f "$(basename $dir)" ]; then
47+
timeout 30s ./$(basename $dir) || echo "Example $dir timed out after 30 seconds"
48+
fi
49+
cd -
50+
fi
51+
done

.gitignore

Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,83 @@
1-
.idea
2-
config.yaml
1+
# Go编译产物
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
*.test
8+
*.out
9+
10+
# 编译文件
11+
bin/
12+
build/
13+
dist/
14+
15+
# 示例可执行文件
16+
examples/**/*.exe
17+
18+
# 依赖目录
19+
vendor/
20+
21+
# IDE配置
22+
.idea/
23+
.vscode/
24+
*.swp
25+
*.swo
26+
.DS_Store
27+
*~
28+
.project
29+
.classpath
30+
.settings/
31+
*.sublime-workspace
32+
*.sublime-project
33+
34+
# 日志文件
35+
*.log
36+
logs/
37+
38+
# 临时文件和目录
39+
tmp/
40+
temp/
41+
.tmp/
42+
43+
# 本地配置文件
44+
*.local
45+
*.env
46+
.env
47+
48+
# 包管理文件
49+
go.work
50+
51+
# 覆盖率报告
52+
coverage.txt
53+
coverage.out
54+
profile.out
55+
*.coverprofile
56+
57+
# 调试文件
58+
__debug_bin
59+
debug
60+
61+
# 自动生成的文件
62+
*.pb.go
63+
*.pb.gw.go
64+
*_string.go
65+
66+
# macOS系统文件
67+
.DS_Store
68+
.AppleDouble
69+
.LSOverride
70+
._*
71+
72+
# Windows系统文件
73+
Thumbs.db
74+
ehthumbs.db
75+
Desktop.ini
76+
$RECYCLE.BIN/
77+
78+
# Linux系统文件
79+
*~
80+
.fuse_hidden*
81+
.directory
82+
.Trash-*
83+
.nfs*

0 commit comments

Comments
 (0)