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

20
examples/basic/main.go Normal file
View File

@@ -0,0 +1,20 @@
package main
import "git.yuntuo.hk/k2safe/go-omni"
func main() {
app := omni.New(omni.WithLogger(true))
app.GET("/health", func(ctx *omni.Context) error {
return ctx.OK(map[string]string{"status": "ok"})
})
api := app.Group("/api")
api.GET("/users/:id", func(ctx *omni.Context) error {
return ctx.OK(map[string]string{
"id": ctx.Param("id"),
})
})
_ = app.Run(":8080")
}