code wiki / _hdl_build / nx_consul_registry.nx
nx_consul_registry.nx
buildroot/runtime/_hdl_build/nx_consul_registry.nx
about
nx_consul_registry.nx -- sovereign SERVICE REGISTRY + HEALTH-GATED DISCOVERY (HashiCorp Consul-class; the
first rung of the sovereign-Consul arc). Register service instances (name, addr, port, health); discover(name)
returns ONLY routable instances (health != CRITICAL) that are still registered -- so traffic NEVER routes to
a down or deregistered instance. The health gate is the core safety property Consul exists to provide.
Composes toward nx_dns_authoritative (service DNS), nx_reach_probe (the live health source), nx_vault
(service-mesh mTLS, later). Pure logic over the registry arrays. license_tier: ORIGINAL
dependencies 1 imports · 4 importers
imports: nx_syscalls.nx
imported by: nx_consul_dns.nxnx_consul_health.nxnx_consul_registry_test.nxnx_consul_suite_test.nx
structs
| none |
consts
| 9 | const SVC_PASSING: i64 = 0 |
| 10 | const SVC_WARNING: i64 = 1 |
| 11 | const SVC_CRITICAL: i64 = 2 |
functions
| 14 | func cs_routable(health: i64) -> i64 { if health == SVC_CRITICAL { return 0 } return 1 } |
| 17 | func cs_discover(reg: *i64, names: *i64, healths: *i64, n: i64, qname: i64, out_idx: *i64) -> i64 |
| 28 | func cs_deregister(reg: *i64, idx: i64) -> i64 { reg[idx] = 0; return 0 } |
| 31 | func cs_passing_count(reg: *i64, names: *i64, healths: *i64, n: i64, qname: i64) -> i64 |