1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-31 22:45:39 -05:00

apply coding style

This commit is contained in:
Shelikhoo
2021-04-08 20:56:04 +01:00
parent 5a61749328
commit 459a914ab7
8 changed files with 38 additions and 28 deletions

View File

@@ -160,9 +160,21 @@ func (rr *RoutingRule) BuildCondition() (Condition, error) {
}
func (br *BalancingRule) Build(ohm outbound.Manager) (*Balancer, error) {
return &Balancer{
selectors: br.OutboundSelector,
strategy: &RandomStrategy{},
ohm: ohm,
}, nil
switch br.Strategy {
case "leastPing":
return &Balancer{
selectors: br.OutboundSelector,
strategy: &LeastPingStrategy{},
ohm: ohm,
}, nil
case "random":
fallthrough
default:
return &Balancer{
selectors: br.OutboundSelector,
strategy: &RandomStrategy{},
ohm: ohm,
}, nil
}
}