feat: bootstrap reusable GoOmni framework

This commit is contained in:
2026-09-20 22:06:24 +08:00
commit 8b19aa79ee
60 changed files with 4923 additions and 0 deletions

17
health/README.md Normal file
View File

@@ -0,0 +1,17 @@
# health
`health` 提供与网络层无关的存活和就绪 Handler。业务项目只需要注册依赖探针,路由仍通过 `omni.App` 或项目自己的 transport 注册:
```go
checker, err := health.New(health.Probe{
Name: "database",
Check: db.PingContext,
})
if err != nil {
return err
}
app.GET("/health/live", checker.LivenessHandler())
app.GET("/health/ready", checker.ReadinessHandler())
```
就绪探针会保留每项检查结果,并在至少一项失败时返回 `503` 和 `NOT_READY`。