refactor(entrypoint): move route registry into entrypoint context

Replace global routes registry with entrypoint-scoped pools and
context lookups, and centralize API/metrics startup in config state.
This commit is contained in:
yusing
2026-02-06 00:23:12 +08:00
parent bd49f1b348
commit f9ee33f464
47 changed files with 916 additions and 835 deletions

View File

@@ -74,6 +74,19 @@ type (
Config *LoadBalancerConfig `json:"config"`
Pool map[string]any `json:"pool"`
} // @name HealthExtra
HealthInfoWithoutDetail struct {
Status HealthStatus `json:"status" swaggertype:"string" enums:"healthy,unhealthy,napping,starting,error,unknown"`
Uptime time.Duration `json:"uptime" swaggertype:"number"` // uptime in milliseconds
Latency time.Duration `json:"latency" swaggertype:"number"` // latency in microseconds
} // @name HealthInfoWithoutDetail
HealthInfo struct {
HealthInfoWithoutDetail
Detail string `json:"detail"`
} // @name HealthInfo
HealthMap = map[string]HealthStatusString // @name HealthMap
)
const (

View File

@@ -20,6 +20,7 @@ type (
pool.Object
ProviderName() string
GetProvider() RouteProvider
ListenURL() *nettypes.URL
TargetURL() *nettypes.URL
HealthMonitor() HealthMonitor
SetHealthMonitor(m HealthMonitor)