Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveCanary ¶
func ResolveCanary(rules []config.CanaryRuleConfig, defaultService string, req *http.Request) string
ResolveCanary 根据灰度规则决定目标服务名。 决策树: 1. 遍历 canary 规则,检查 match.headers 条件 2. Header 匹配且 weight > 0:按权重概率决定是否走灰度服务 3. Header 匹配且 weight == 0:100% 走灰度服务(纯 Header 匹配模式) 4. 无 Header 条件但 weight > 0:按权重概率对所有流量随机分流 5. 所有规则都不命中:返回默认服务
Types ¶
Click to show internal directories.
Click to hide internal directories.