code wiki / _hdl_build / nx_consul_registry.nx

nx_consul_registry.nx

buildroot/runtime/_hdl_build/nx_consul_registry.nx

1898 B36 linesdepth 2pulls 2 transitivereach 6 importersview sourcekind librarytopic consul
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_consul_registry.nx nx_consul_dns.nx nx_consul_health.nx nx_consul_registry_test.nx nx_consul_suite_test.nx

imports: nx_syscalls.nx

imported by: nx_consul_dns.nxnx_consul_health.nxnx_consul_registry_test.nxnx_consul_suite_test.nx

structs

none

consts

9const SVC_PASSING: i64 = 0
10const SVC_WARNING: i64 = 1
11const SVC_CRITICAL: i64 = 2

functions

14func cs_routable(health: i64) -> i64 { if health == SVC_CRITICAL { return 0 } return 1 }
called by 2: cs_discovermain
17func cs_discover(reg: *i64, names: *i64, healths: *i64, n: i64, qname: i64, out_idx: *i64) -> i64
called by 4: csd_resolvemainmainmain calls 1: cs_routable
28func cs_deregister(reg: *i64, idx: i64) -> i64 { reg[idx] = 0; return 0 }
called by 2: mainmain
31func cs_passing_count(reg: *i64, names: *i64, healths: *i64, n: i64, qname: i64) -> i64