feat: release generic composition mapping and middleware factories

This commit is contained in:
2026-09-25 12:43:34 +08:00
parent 8493f9dae9
commit 8b588a24cd
40 changed files with 2203 additions and 62 deletions

View File

@@ -51,6 +51,16 @@ This project is generated from an editable API contract. Business code uses
standard context.Context; generated HTTP handlers use Omni's transport-neutral httpx.
main.go and HTTP composition are continuously generator-owned.
omni.gen.json selects repository: none (default) or group, and middleware:
factories for new projects. Named middleware factories run after svc.Init;
implement Dependencies accessors on ServiceContext and New<Name>(deps) once.
Unimplemented/nil factories fail startup and clean registered dependencies.
Existing projects retain middleware: handlers until explicitly migrated.
Optional mappings generate typed assignments in internal/mapping/mappingsGen.go;
configure source/target types and explicit conversion rules after resolving module
dependencies. Missing fields fail generation and --check. See GENERATION.md in
the framework repository for composition, null/reference semantics and migration.
## Run
`+"```sh"+`
@@ -133,8 +143,10 @@ internal/svc/runtimeGen.go # GENERATED lifecycle and infrastructure startup
internal/apierrors/errorsGen.go # generated fresh error constructors, when declared
internal/handler/<group>/ # generated binding and Logic adapters
internal/logic/<group>/ # developer-owned business operations
internal/repository/<group>/ # developer-owned persistence contracts
internal/middleware/ # named hooks and generated registry
internal/repository/<group>/ # optional; repository: group creates editable seeds
internal/middleware/ # typed dependency interface, factories and registry
omni.gen.json # developer-owned generator options and mappings
internal/mapping/*Gen.go # optional compile-checked struct mappings
docs/openapi.json # generated OpenAPI 3.0.3
.goOmni/apiManifest.json # ownership and content hashes
`+"```"+`