{"id":21043531,"url":"https://github.com/thingspanel/go-sl427","last_synced_at":"2025-09-14T06:45:40.483Z","repository":{"id":260593590,"uuid":"878549908","full_name":"ThingsPanel/go-sl427","owner":"ThingsPanel","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-10T13:07:24.000Z","size":88,"stargazers_count":8,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-15T17:47:15.519Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThingsPanel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-10-25T15:42:42.000Z","updated_at":"2025-01-09T03:05:40.000Z","dependencies_parsed_at":"2024-11-01T08:53:59.419Z","dependency_job_id":"42f6a6b0-1a58-4741-b8bc-fb2824a13828","html_url":"https://github.com/ThingsPanel/go-sl427","commit_stats":null,"previous_names":["thingspanel/go-sl427"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ThingsPanel/go-sl427","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThingsPanel%2Fgo-sl427","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThingsPanel%2Fgo-sl427/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThingsPanel%2Fgo-sl427/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThingsPanel%2Fgo-sl427/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThingsPanel","download_url":"https://codeload.github.com/ThingsPanel/go-sl427/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThingsPanel%2Fgo-sl427/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275071555,"owners_count":25400398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2024-11-19T14:13:10.928Z","updated_at":"2025-09-14T06:45:40.462Z","avatar_url":"https://github.com/ThingsPanel.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-sl427\n\n[![License](https://img.shields.io/github/license/ThingsPanel/go-sl427)](LICENSE)\n[![Release](https://img.shields.io/github/release/ThingsPanel/go-sl427.svg)](https://github.com/ThingsPanel/go-sl427/releases)\n[![GitHub Issues](https://img.shields.io/github/issues/ThingsPanel/go-sl427.svg)](https://github.com/ThingsPanel/go-sl427/issues)\n[![Go Report Card](https://goreportcard.com/badge/github.com/ThingsPanel/go-sl427)](https://goreportcard.com/report/github.com/ThingsPanel/go-sl427)\n[![Go Reference](https://pkg.go.dev/badge/github.com/ThingsPanel/go-sl427.svg)](https://pkg.go.dev/github.com/ThingsPanel/go-sl427)\n[![Go Version](https://img.shields.io/github/go-mod/go-version/ThingsPanel/go-sl427)](https://go.dev/doc/devel/release)\n\ngo-sl427是一个用Go语言实现的SL427-2021水资源监测数据传输规约库。该库提供了协议实现，支持监测站和数据中心服务器的开发。\n\n## 特性\n\n- 实现SL427-2021的S1链路协议规范\n- 支持监测站和服务器端开发\n- 提供灵活的配置选项\n- 内置监控指标收集\n- 支持自定义日志接口\n- 线程安全设计\n- 详细的错误处理\n\n## 完整性说明\n\n目前完成了协议框架的实现\n具体功能待完善\n\n- [x] S1 链路协议\n- [ ] S2 链路协议\n- [ ] S3 链路协议\n\n## 安装\n\n```bash\ngo get github.com/ThingsPanel/go-sl427\n```\n\n## 快速开始\n\n### 监测站示例\n\n### 服务器示例\n\n## 核心组件\n\n- **station**: 监测站实现\n- **transport**: 网络传输层\n- **codec**: 数据编解码\n- **packet**: 数据包定义\n- **types**: 基础类型定义\n- **metrics**: 监控指标收集\n\n## 监控指标\n\n内置的监控指标包括：\n\n- 接收的数据包数量\n- 发送的数据包数量\n- 丢弃的数据包数量\n- 最后接收时间\n- 最后发送时间\n- 处理延迟\n\n## 错误处理\n\n库提供了统一的错误处理机制：\n\n```go\nif sl427.IsErrorCode(err, sl427.ErrCodeInvalidData) {\n    // 处理无效数据错误\n}\n```\n\n## 配置选项\n\n## 日志接口\n\n支持自定义日志实现：\n\n```go\ntype CustomLogger struct {\n    // 自定义日志实现\n}\n\nfunc (l *CustomLogger) Printf(format string, v ...interface{}) {\n    // 实现日志记录\n}\n\n// 设置日志接口\ntypes.SetLogger(\u0026CustomLogger{})\n```\n\n## 示例程序\n\n在 `cmd/examples` 目录下提供了完整的示例程序\n\n\n## 文档\n\n详细的文档和API参考请访问：[pkg.go.dev](https://pkg.go.dev/github.com/ThingsPanel/go-sl427)\n\n## 贡献指南\n\n1. Fork 项目\n2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)\n3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)\n4. 推送到分支 (`git push origin feature/AmazingFeature`)\n5. 打开Pull Request\n\n## 许可证\n\n采用 MIT 许可证。详见 [LICENSE](LICENSE) 文件。\n\n## 支持\n\n如有问题或建议，请提交 [Issue](https://github.com/ThingsPanel/go-sl427/issues)。\n\n## 致谢\n\n感谢所有贡献者对项目的支持。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthingspanel%2Fgo-sl427","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthingspanel%2Fgo-sl427","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthingspanel%2Fgo-sl427/lists"}