{"id":43298486,"url":"https://github.com/pseudocodes/datacollect","last_synced_at":"2026-02-01T19:15:13.817Z","repository":{"id":334180765,"uuid":"1140381314","full_name":"pseudocodes/datacollect","owner":"pseudocodes","description":"CTP 看穿式终端信息采集库 Go 封装，支持 macOS 和 Linux 平台。","archived":false,"fork":false,"pushed_at":"2026-01-23T08:42:18.000Z","size":3132,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-24T00:45:28.764Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pseudocodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-23T07:44:30.000Z","updated_at":"2026-01-23T08:42:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pseudocodes/datacollect","commit_stats":null,"previous_names":["pseudocodes/datacollect"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/pseudocodes/datacollect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pseudocodes%2Fdatacollect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pseudocodes%2Fdatacollect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pseudocodes%2Fdatacollect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pseudocodes%2Fdatacollect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pseudocodes","download_url":"https://codeload.github.com/pseudocodes/datacollect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pseudocodes%2Fdatacollect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28987174,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T18:17:03.387Z","status":"ssl_error","status_checked_at":"2026-02-01T18:16:57.287Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-01T19:15:13.186Z","updated_at":"2026-02-01T19:15:13.808Z","avatar_url":"https://github.com/pseudocodes.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# datacollect\n\nCTP 看穿式终端信息采集库的 Go 封装，支持 macOS、Linux 和 Windows 平台。\n\n## 安装\n\n```bash\ngo get github.com/pseudocodes/datacollect\n```\n\n## 使用方式\n\n项目提供三种使用方式：\n\n### 方式一：静态链接（需要 cgo）\n\n直接导入 prd 或 tst 包：\n\n```go\nimport datacollect \"github.com/pseudocodes/datacollect/pkg/tst\"\n// 或\nimport datacollect \"github.com/pseudocodes/datacollect/pkg/prd\"\n\nfunc main() {\n    version := datacollect.GetAPIVersion()\n    data, code, err := datacollect.GetSystemInfo()\n    data, code, err := datacollect.GetSystemInfoUnencrypted()\n}\n```\n\n### 方式二：动态加载 - cgo 版本\n\n使用 dyn 包动态加载库，可同时使用 prd 和 tst：\n\n```go\nimport \"github.com/pseudocodes/datacollect/pkg/dyn\"\n\nfunc main() {\n    dc, _ := dyn.NewDataCollector(\"path/to/library\")\n    defer dc.Close()\n\n    version := dc.GetAPIVersion()\n    data, code, err := dc.GetSystemInfo()\n}\n```\n\n### 方式三：动态加载 - 纯 Go 版本（推荐）\n\n使用 pure 包通过 purego 动态加载库，无需 cgo：\n\n```go\nimport \"github.com/pseudocodes/datacollect/pkg/pure\"\n\nfunc main() {\n    // macOS\n    dc, _ := pure.NewDataCollector(\"path/to/MacDataCollect.framework\")\n    // Linux\n    dc, _ := pure.NewDataCollector(\"path/to/libLinuxDataCollect.so\")\n    // Windows\n    dc, _ := pure.NewDataCollector(\"path/to/WinDataCollect.dll\")\n    defer dc.Close()\n\n    version := dc.GetAPIVersion()\n    data, code, err := dc.GetSystemInfo()\n    data, code, err := dc.GetSystemInfoUnencrypted()\n}\n```\n\n## 平台支持\n\n| 函数 | macOS | Linux | Windows |\n|------|-------|-------|---------|\n| GetSystemInfo | ✓ | ✓ | ✓ |\n| GetSystemInfoUnencrypted | ✓ | ✓ (fallback) | ✓ (fallback) |\n| GetAPIVersion | ✓ | ✓ | ✓ |\n\n## 包对比\n\n| 特性 | prd/tst | dyn | pure |\n|------|---------|-----|------|\n| 需要 cgo | ✓ | ✓ | ✗ |\n| 可同时加载多个库 | ✗ | ✓ | ✓ |\n| macOS 支持 | ✓ | ✓ | ✓ |\n| Linux 支持 | ✓ | ✓ | ✓ |\n| Windows 支持 | ✓ | ✓ | ✓ |\n| 依赖 | 无 | 无 | purego, x/sys |\n\n## 注意事项\n\n使用静态链接方式（prd/tst）时，两个包不能同时在一个程序中使用，因为底层库导出相同的符号名会导致冲突。\n\n如需同时使用 prd 和 tst，请使用 dyn 或 pure 包的动态加载方式。\n\n## 构建\n\n```bash\n# 静态链接示例\ngo build -o static_demo ./examples/static\n\n# 动态加载示例 (cgo)\ngo build -o dynamic_demo ./examples/dynamic\n\n# 纯 Go 示例 (推荐)\ngo build -o purego_demo ./examples/purego\n```\n\n## 目录结构\n\n```\n├── pkg/\n│   ├── prd/                # 生产环境包（静态链接，需要 cgo）\n│   ├── tst/                # 测试环境包（静态链接，需要 cgo）\n│   ├── dyn/                # 动态加载包（需要 cgo）\n│   └── pure/               # 纯 Go 动态加载包（推荐）\n├── examples/\n│   ├── static/             # 静态链接示例\n│   ├── dynamic/            # cgo 动态加载示例\n│   └── purego/             # 纯 Go 示例\n├── lib/                    # 原始 SDK 文件\n└── README.md\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpseudocodes%2Fdatacollect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpseudocodes%2Fdatacollect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpseudocodes%2Fdatacollect/lists"}