feat(ws): release generic WebSocket client and server v0.31.0-preview

This commit is contained in:
2026-10-29 19:20:12 +08:00
parent 19ee9746e9
commit 3272974bc1
58 changed files with 7654 additions and 21 deletions

View File

@@ -2,6 +2,7 @@
package handler
import (
"errors"
"fmt"
omni "git.yuntuo.hk/k2safe/go-omni"
"git.yuntuo.hk/k2safe/go-omni/contract"
@@ -66,5 +67,11 @@ func NewApp(deps *svc.ServiceContext) (*omni.App, error) {
}
app.GET(cfg.Endpoints.Readiness.Path, deps.Health.ReadinessHandler(options...))
}
// Optional project-owned extension; no generated file needs hand edits.
if extension, ok := any(deps).(interface{ RegisterCustomRoutes(*omni.App) error }); ok {
if err := extension.RegisterCustomRoutes(app); err != nil {
return nil, errors.Join(err, app.Close())
}
}
return app, nil
}