mirror of
https://github.com/hanzoai/amqp.git
synced 2026-11-02 19:19:59 +00:00
* feat: cloud Mount() per HIP-0106
Adds pkg/amqp.Mount(*zip.App, cloud.Deps) error so the unified Hanzo
Cloud binary can blank-import and register the AMQP -> NATS
JetStream bridge alongside every other Hanzo subsystem.
AMQP is broker-only — the data plane is raw AMQP 0-9-1 TCP and has
no HTTP surface. Mount() exposes /v1/amqp/health (always 200) and
/v1/amqp/readyz (200 only when the listener has bound + NATS is
reachable) on the parent zip.App and spawns the proxy.Proxy
listener in a background goroutine. Failure to reach NATS at boot
is logged as a warning — the binary continues serving health so
the operator can fix the upstream without restart-looping pods.
- pkg/amqp/mount.go: Mount + MountWithConfig + Shutdown
- pkg/amqp/env.go: env getter indirection (lets tests stub)
- pkg/amqp/mount_test.go: health/readyz contract under
DisableListener
- main.go: rewritten as a HIP-0106 thin shim — cloud.LoadConfig +
zip.New + amqp.Mount + app.Listen. Existing proxy package
(proxy.New, proxy.Start, proxy.Shutdown) unchanged.
- schema/amqp.zap: minimal Health ZAP interface. AMQP-protocol
proper stays outside ZAP.
init() registers with cloud.Register("amqp", 30, …).
* refactor: collapse pkg/amqp/ → root for clean import path
Subsystem code lives in package amqp at repo root. Importers now use
`github.com/hanzoai/amqp` (no /pkg/amqp/ nesting). Standalone shim moved
to cmd/amqp/ where applicable.
Per Hanzo Go-stdlib pattern: repo IS the package.
* refactor: flatten import path — github.com/hanzoai/cloud (drop /pkg/cloud)
33 lines
1.2 KiB
Plaintext
33 lines
1.2 KiB
Plaintext
# Hanzo AMQP — ZAP Schema
|
|
#
|
|
# Server: amqp (Go) embedded via pkg/amqp.Mount(app, deps) per HIP-0106.
|
|
#
|
|
# The data plane is the AMQP 0-9-1 wire protocol (RabbitMQ-compatible)
|
|
# bridged to NATS JetStream — that surface is not ZAP. This schema
|
|
# captures only the management-plane health + readiness ZAP RPCs so
|
|
# the cloud binary can probe AMQP through the canonical Mount() shape.
|
|
#
|
|
# Code generation:
|
|
# zapc generate schema/amqp.zap --lang go --out ./gen/zap/
|
|
|
|
# ── Health ────────────────────────────────────────────────────────────────
|
|
|
|
struct HealthRequest
|
|
|
|
struct HealthResponse
|
|
status Text
|
|
service Text
|
|
version Text
|
|
|
|
struct ReadyResponse
|
|
status Text
|
|
service Text
|
|
version Text
|
|
reason Text
|
|
|
|
# ── Service interface ────────────────────────────────────────────────────
|
|
|
|
interface AMQPService
|
|
health (request HealthRequest) -> (response HealthResponse)
|
|
ready (request HealthRequest) -> (response ReadyResponse)
|