Skip to content

Commit

Permalink
feat:support lane (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
chuntaojun authored Mar 8, 2024
1 parent 2ef5fb9 commit b98680e
Show file tree
Hide file tree
Showing 6 changed files with 288 additions and 331 deletions.
2 changes: 2 additions & 0 deletions api/v1/service_manage/request.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ message DiscoverRequest {
reserved 7 to 11;
NAMESPACES = 12;
FAULT_DETECTOR = 13;
reserved 14 to 99;
LANE = 100;
}

DiscoverRequestType type = 1;
Expand Down
16 changes: 7 additions & 9 deletions api/v1/service_manage/response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import "configrelease.proto";
import "fault_detector.proto";
import "auth.proto";
import "contract.proto";
import "lane.proto";

option go_package = "github.com/polarismesh/specification/source/go/api/v1/service_manage";
option java_package = "com.tencent.polaris.specification.api.v1.service.manage";
Expand Down Expand Up @@ -73,7 +74,7 @@ message BatchQueryResponse {
repeated UserGroup userGroups = 19;
repeated AuthStrategy authStrategies = 20;
repeated Client clients = 21;

repeated google.protobuf.Any data = 22;
Summary summary = 23;
}
Expand All @@ -94,6 +95,8 @@ message DiscoverResponse {
reserved "MESH", "MESH_CONFIG", "FLUX_DBREFRESH", "FLUX_SDK", "FLUX_SERVER";
NAMESPACES = 12;
FAULT_DETECTOR = 13;
reserved 14 to 99;
LANE = 100;
}

DiscoverResponseType type = 3;
Expand All @@ -107,14 +110,9 @@ message DiscoverResponse {
FaultDetector faultDetector = 11;
reserved 12 to 20;
Service aliasFor = 21;
repeated LaneGroup lanes = 22;
}

message OptionSwitch { map<string, string> options = 1; }

message OptionSwitch {
map<string, string> options = 1;
}

message InstanceLabels {
map<string, StringList> labels = 1;
}

message InstanceLabels { map<string, StringList> labels = 1; }
40 changes: 16 additions & 24 deletions api/v1/traffic_manage/lane.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,12 @@ option java_outer_classname = "LaneProto";
// 流量入口
message TrafficEntry {
// 标记流量入口类型
// type == "polarismesh.cn/gateway/tse-gateway, 则 selector 为
// TSEGatewaySelector type == "polarismesh.cn/gateway/spring-cloud-gateway",
// 则 selector 为 ServiceGatewaySelector type == "polarismesh.cn/service, 则
// selector 为 ServiceSelector
// type == "polarismesh.cn/gateway/spring-cloud-gateway", 则 selector 为 ServiceGatewaySelector
// type == "polarismesh.cn/service, 则 selector 为 ServiceSelector
string type = 1;
google.protobuf.Any selector = 2;
}

// 网关入口定义
message TSEGatewaySelector {
string instance_id = 1;
repeated string services = 2;
}

// 微服务网关入口定义
message ServiceGatewaySelector {
string namespace = 1;
Expand Down Expand Up @@ -54,11 +46,15 @@ message LaneGroup {
// 在泳道组内的服务列表信息
repeated DestinationGroup destinations = 4;
// 泳道组描述信息
string revision = 7;
// 泳道组描述信息
string description = 8;
// 泳道组的创建时间
string ctime = 9;
// 泳道组的更新时间
string mtime = 10;
// 泳道组内的流量入口信息
repeated LaneRule rules = 11;
}

// TrafficMatchRule 流量匹配规则
Expand All @@ -81,33 +77,29 @@ message LaneRule {
string name = 2;
// 所属泳道组的名称
string group_name = 3;
// 泳道入口
repeated TrafficEntry traffic_entries = 4;
// 流量匹配规则
TrafficMatchRule traffic_match_rule = 5;
TrafficMatchRule traffic_match_rule = 4;
// 保存这个泳道的默认实例标签
string default_label_value = 6;
// 在泳道内的服务
repeated DestinationGroup destinations = 7;
string default_label_value = 5;
// 泳道规则是否启用
bool enable = 8;
bool enable = 6;
enum LaneMatchMode {
// 严格匹配模式
STRICT = 0;
// 宽松匹配模式
PERMISSIVE = 1;
}
LaneMatchMode match_mode = 9;
LaneMatchMode match_mode = 7;
// revision routing version
string revision = 10;
string revision = 8;
// ctime create time of the rules
string ctime = 11;
string ctime = 9;
// mtime modify time of the rules
string mtime = 12;
string mtime = 10;
// etime enable time of the rules
string etime = 13;
string etime = 11;
// priority rules priority
uint32 priority = 14;
uint32 priority = 12;
// description simple description rules
string description = 15;
string description = 13;
}
90 changes: 47 additions & 43 deletions source/go/api/v1/service_manage/request.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b98680e

Please sign in to comment.