Add balancer: & refactor

This commit is contained in:
Fangliding
2026-09-15 01:33:26 +08:00
parent 52a412d9e2
commit bf3230ec51
3 changed files with 120 additions and 73 deletions
+8
View File
@@ -165,3 +165,11 @@ func (r *Router) GetOverrideTarget(tag string) (string, error) {
}
return "", errors.New("cannot find tag")
}
// PickOutbound implements routing.BalancerPicker
func (r *Router) GetBalancerOutboundTag(balancerTag string) (string, error) {
if b, ok := (*r.balancers.Load())[balancerTag]; ok {
return b.PickOutbound()
}
return "", errors.New("cannot find tag")
}