Files
zeekay 1943f1c093 Hanzo Commerce
Multi-tenant commerce and billing: orders, subscriptions, invoices, plans,
usage metering and a credit ledger. One Go binary. MIT OR Apache-2.0.

Claude-Session: https://claude.ai/code/session_01SAtaDFm8VDiWrhYHNNtxMw
2026-09-23 21:52:16 -07:00

28 lines
835 B
Go

package api
import (
"github.com/zap-proto/zip"
)
// RouteFn is an optional side-car wirer for API routes that don't ship
// in-tree — typically sub-modules like luxfi/cevm which would
// otherwise transitively pull heavy deps (geth, warp, etc.) into consumers
// that don't need them.
type RouteFn func(r *zip.Group, args ...zip.Handler)
var extraRoutes []RouteFn
// RegisterRoute wires an additional route function. The parent api.Route
// invokes every registered function after its own wiring is done. Consumers
// who want the route must blank-import the sub-module (e.g.
// `import _ "github.com/hanzoai/commerce/luxfi/cevm/api"`).
func RegisterRoute(fn RouteFn) {
extraRoutes = append(extraRoutes, fn)
}
func applyExtraRoutes(r *zip.Group, args ...zip.Handler) {
for _, fn := range extraRoutes {
fn(r, args...)
}
}