@gidea/gateway-mount
v0.0.4
Published
Gateway service mount types, Redis key helpers, and YAML parsing (Nacos-style namespace support)
Readme
@gidea/gateway-mount
Gateway service mount types, Redis key helpers, and YAML parsing. Used by g-gateway and g-gateway-admin for Nacos-style namespace-scoped layout.
Exports
- Types:
ServiceMount,ServiceInstance,AuthStrategy,SubRouteAuth,ServiceRegistryYaml,ServiceRegistryYamlEntry,ServiceRegistrationOptions,ConfigFetchOptions - Constants:
HEARTBEAT_TTL_SEC,HEARTBEAT_INTERVAL_MS,EVICTION_INTERVAL_MS,DEFAULT_NAMESPACE_ID - Legacy keys (flat layout):
registryHashKey(prefix, serviceKey),configHashKey(prefix, namespace) - Namespace-scoped keys (Nacos-style):
nsServicesKey(nsId),nsConfigsKey(nsId),nsServiceInstancesKey(nsId, serviceKey),configHashField(group, dataId),parseConfigHashField(field) - YAML:
parseServiceRegistry(yaml)→ServiceMount[]
Redis key layout (namespace-scoped)
gidea:ns:{nsId}:services→ JSON array ofServiceMountgidea:ns:{nsId}:configs→ Hash, fieldgroup::dataId, value JSON config itemgidea:ns:{nsId}:svc:{serviceKey}:instances→ Hash, instanceId → JSONServiceInstance
Build
pnpm buildWorkspace usage
In this monorepo, g-gateway and g-gateway-admin depend on workspace:*. After adding the package, run pnpm install from the repo root.
