Files
zogo/README.md
T

29 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# zogo
zeroone Go 通用库(单仓多包)。被各后端服务以 Go module 依赖引用:
`go get git.zeroonesoft.cn/golib/zogo/xxx`
## 包清单
| 包 | 用途 | 主要依赖 |
|---|---|---|
| `httpx` | Gin 统一出入参:OkJson/ErrorJson(CodeMsg 错误码透传)、Handle/HandleResult、Parse(uri→query→header→json 顺序绑定 + binding 校验收口) | gin, validator |
| `logger` | logrus 日志初始化(文件轮转) | logrus, rotatelogs |
| `wsc` | WebSocket 服务框架(会话/房间/路由/反射绑定) | gin, gorilla/websocket, uuid, logrus |
| `wscclient` | WebSocket 客户端(自动重连) | gorilla/websocket |
| `jwtx` | 轻量 HMAC-SHA256 JWT 签发与校验 | 无 |
## 约定
- 通用性准入:被 ≥2 个服务复制使用过的包才进入本仓库;仅单服务使用的留在服务内。
- 改动流程:在本仓库修复/演进 → 打 tag(如 v0.1.1)→ 各服务 `go get -u git.zeroonesoft.cn/golib/zogo@v0.1.1`。
- 本地联动开发:在 `D:\zomaintain\backend\go.work` 中 `use D:/golib/zogo`(go.work 不提交)。
- go.mod 声明 go 1.24(不高于最低版本消费方),不要随意上调。
## 私有模块拉取配置(每台开发机/CI 一次)
```
go env -w GOPRIVATE=git.zeroonesoft.cn/*
```
git 凭据需能访问 git.zeroonesoft.cn(Git Credential Manager 存 PAT)。