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 2024-03-29 19:17:36 +04:00 committed by GitHub
parent 8a439bf3f2
commit 53e5814d19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 901 additions and 269 deletions

View file

@ -7,6 +7,7 @@ option java_package = "com.xray.app.router.command";
option java_multiple_files = true;
import "common/net/network.proto";
import "common/serial/typed_message.proto";
// RoutingContext is the context with information relative to routing process.
// It conforms to the structure of xray.features.routing.Context and
@ -88,6 +89,18 @@ message OverrideBalancerTargetRequest {
message OverrideBalancerTargetResponse {}
message AddRuleRequest {
xray.common.serial.TypedMessage config = 1;
bool shouldAppend = 2;
}
message AddRuleResponse {}
message RemoveRuleRequest {
string ruleTag = 1;
}
message RemoveRuleResponse {}
service RoutingService {
rpc SubscribeRoutingStats(SubscribeRoutingStatsRequest)
returns (stream RoutingContext) {}
@ -95,6 +108,9 @@ service RoutingService {
rpc GetBalancerInfo(GetBalancerInfoRequest) returns (GetBalancerInfoResponse){}
rpc OverrideBalancerTarget(OverrideBalancerTargetRequest) returns (OverrideBalancerTargetResponse) {}
rpc AddRule(AddRuleRequest) returns (AddRuleResponse) {}
rpc RemoveRule(RemoveRuleRequest) returns (RemoveRuleResponse) {}
}
message Config {}