API - Add | Remove Routing Rules (#3189)

* add RuleTag to routing rules

* add router pb commands

* add and remove routing rules api

* cleanup

* fix

* improve error msg

* add append flag
apply balancer config
This commit is contained in:
Hossin Asaadi authored and GitHub committed 2024-03-29 11:17:36 -04:00
1 parent 8a439bf3f2
commit 53e5814d19
13 files changed
+901 -269

No files matched your search

+3 -2
View File
@@ -11,6 +11,7 @@ import (
type Rule struct {
Tag string
RuleTag string
Balancer *Balancer
Condition Condition
}
@@ -150,7 +151,7 @@ func (br *BalancingRule) Build(ohm outbound.Manager, dispatcher routing.Dispatch
leastLoadStrategy := NewLeastLoadStrategy(s)
return &Balancer{
selectors: br.OutboundSelector,
ohm: ohm,
ohm: ohm,
fallbackTag: br.FallbackTag,
strategy: leastLoadStrategy,
}, nil
@@ -159,7 +160,7 @@ func (br *BalancingRule) Build(ohm outbound.Manager, dispatcher routing.Dispatch
case "":
return &Balancer{
selectors: br.OutboundSelector,
ohm: ohm,
ohm: ohm,
fallbackTag: br.FallbackTag,
strategy: &RandomStrategy{},
}, nil