mirror of
https://github.com/hanzoai/gateway.git
synced 2026-10-30 15:04:44 +00:00
* refactor(gateway): quarantine the Lura/KrakenD engine behind `legacy` build tag (#29) Task #29 — own the framework deps. The gateway module path is already hanzoai-owned (github.com/hanzoai/gateway/v2), but the default build still pulled the upstream github.com/luraproject/lura + github.com/krakend/* graph (105 packages) into `go build ./...` and the shipping ghcr.io/hanzoai/gateway image. This decomplects the KrakenD engine from the default surface. Decomplect (values, not places): the pure host/path reverse-proxy routing table split out of router_engine.go into routes.go (stdlib + gin + yaml, ZERO Lura/KrakenD). The Lura gin-engine builder moved to krakend_engine.go behind `//go:build legacy`. Every remaining file that imports lura/krakend is gated behind the same tag so the two builds are orthogonal: default (go build ./...) — KrakenD-free, ships the HIP-0110 ZAP relay + pure router. 0 krakend pkgs. legacy (go build -tags legacy) — full Lura/KrakenD engine, kept compilable for the Phase-A→C rollout safety window. 105 krakend pkgs. Gated files (all lura/krakend importers): backend_factory, base_ha_backend, base_network_backend, encoding, executor, handler_factory, plugin, proxy_factory, rebrand, sd, zap_backend, zaphttp_listener + their tests, the tests/ Lura integration harness, and cmd/gateway-integration. The default routing/auth/mount/ZAP-relay surface (routes.go, mount.go, build_app.go, gate.go, auth_middleware.go, ...) already had zero krakend imports. Proof: go build ./... -> exit 0 go list -deps ./cmd/gateway | krakend -> 0 (KrakenD-free default/image) go build -tags legacy ./... -> exit 0 go list -tags legacy -deps | krakend -> 105 (quarantined behind the tag) go vet ./... -> exit 0 go test ./... -> all packages ok * docs(gateway): document the Lura/KrakenD fork-ownership boundary + legacy gate (#29) --------- Co-authored-by: Hanzo Dev <[email protected]>
28 lines
389 B
Go
28 lines
389 B
Go
//go:build legacy
|
|
// +build legacy
|
|
|
|
package tests
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
func ExampleNewIntegration() {
|
|
runner, tcs, err := NewIntegration(nil, nil, nil)
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
return
|
|
}
|
|
defer runner.Close()
|
|
|
|
for _, tc := range tcs {
|
|
if err := runner.Check(tc); err != nil {
|
|
fmt.Printf("%s: %s", tc.Name, err.Error())
|
|
return
|
|
}
|
|
}
|
|
|
|
// output:
|
|
// signal: killed
|
|
}
|