mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-12-10 01:20:26 +08:00
实现路径规则部分功能
This commit is contained in:
@@ -5,4 +5,8 @@ package pb;
|
||||
|
||||
message RPCUpdateSuccess {
|
||||
|
||||
}
|
||||
|
||||
message RPCDeleteSuccess {
|
||||
|
||||
}
|
||||
@@ -13,7 +13,7 @@ service APINodeService {
|
||||
rpc updateAPINode (UpdateAPINodeRequest) returns (RPCUpdateSuccess);
|
||||
|
||||
// 删除API节点
|
||||
rpc deleteAPINode (DeleteAPINodeRequest) returns (DeleteAPINodeResponse);
|
||||
rpc deleteAPINode (DeleteAPINodeRequest) returns (RPCDeleteSuccess);
|
||||
|
||||
// 列出所有可用API节点
|
||||
rpc findAllEnabledAPINodes (FindAllEnabledAPINodesRequest) returns (FindAllEnabledAPINodesResponse);
|
||||
@@ -54,10 +54,6 @@ message DeleteAPINodeRequest {
|
||||
int64 nodeId = 1;
|
||||
}
|
||||
|
||||
message DeleteAPINodeResponse {
|
||||
|
||||
}
|
||||
|
||||
// 列出所有可用API节点
|
||||
message FindAllEnabledAPINodesRequest {
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ message FindEnabledGzipConfigRequest {
|
||||
}
|
||||
|
||||
message FindEnabledGzipConfigResponse {
|
||||
bytes config = 1;
|
||||
bytes gzipJSON = 1;
|
||||
}
|
||||
|
||||
// 修改Gzip配置
|
||||
|
||||
@@ -39,5 +39,5 @@ message FindEnabledHTTPHeaderConfigRequest {
|
||||
}
|
||||
|
||||
message FindEnabledHTTPHeaderConfigResponse {
|
||||
bytes config = 1;
|
||||
bytes headerJSON = 1;
|
||||
}
|
||||
@@ -34,7 +34,7 @@ message FindEnabledHTTPHeaderPolicyConfigRequest {
|
||||
}
|
||||
|
||||
message FindEnabledHTTPHeaderPolicyConfigResponse {
|
||||
bytes config = 1;
|
||||
bytes headerPolicyJSON = 1;
|
||||
}
|
||||
|
||||
// 创建策略
|
||||
|
||||
82
pkg/rpc/protos/service_http_location.proto
Normal file
82
pkg/rpc/protos/service_http_location.proto
Normal file
@@ -0,0 +1,82 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
import "rpc_messages.proto";
|
||||
|
||||
service HTTPLocationService {
|
||||
// 创建路径规则
|
||||
rpc createHTTPLocation (CreateHTTPLocationRequest) returns (CreateHTTPLocationResponse);
|
||||
|
||||
// 修改路径规则
|
||||
rpc updateHTTPLocation (UpdateHTTPLocationRequest) returns (RPCUpdateSuccess);
|
||||
|
||||
// 查找路径规则配置
|
||||
rpc findEnabledHTTPLocationConfig (FindEnabledHTTPLocationConfigRequest) returns (FindEnabledHTTPLocationConfigResponse);
|
||||
|
||||
// 删除路径规则
|
||||
rpc deleteHTTPLocation (DeleteHTTPLocationRequest) returns (RPCDeleteSuccess);
|
||||
|
||||
// 查找反向代理设置
|
||||
rpc findAndInitHTTPLocationReverseProxyConfig (FindAndInitHTTPLocationReverseProxyConfigRequest) returns (FindAndInitHTTPLocationReverseProxyConfigResponse);
|
||||
|
||||
// 初始化Web设置
|
||||
rpc findAndInitHTTPLocationWebConfig (FindAndInitHTTPLocationWebConfigRequest) returns (FindAndInitHTTPLocationWebConfigResponse);
|
||||
}
|
||||
|
||||
// 创建路径规则
|
||||
message CreateHTTPLocationRequest {
|
||||
int64 parentId = 1;
|
||||
string name = 2;
|
||||
string description = 3;
|
||||
string pattern = 4;
|
||||
bool isBreak = 5;
|
||||
}
|
||||
|
||||
message CreateHTTPLocationResponse {
|
||||
int64 locationId = 1;
|
||||
}
|
||||
|
||||
// 修改路径规则
|
||||
message UpdateHTTPLocationRequest {
|
||||
int64 locationId = 1;
|
||||
string name = 2;
|
||||
string description = 3;
|
||||
string pattern = 4;
|
||||
bool isOn = 5;
|
||||
bool isBreak = 6;
|
||||
}
|
||||
|
||||
// 查找路径规则配置
|
||||
message FindEnabledHTTPLocationConfigRequest {
|
||||
int64 locationId = 1;
|
||||
}
|
||||
|
||||
message FindEnabledHTTPLocationConfigResponse {
|
||||
bytes locationJSON = 1;
|
||||
}
|
||||
|
||||
// 删除路径规则
|
||||
message DeleteHTTPLocationRequest {
|
||||
int64 locationId = 1;
|
||||
}
|
||||
|
||||
// 查找反向代理设置
|
||||
message FindAndInitHTTPLocationReverseProxyConfigRequest {
|
||||
int64 locationId = 1;
|
||||
}
|
||||
|
||||
message FindAndInitHTTPLocationReverseProxyConfigResponse {
|
||||
bytes reverseProxyJSON = 1;
|
||||
bytes reverseProxyRefJSON = 2;
|
||||
}
|
||||
|
||||
// 初始化Web设置
|
||||
message FindAndInitHTTPLocationWebConfigRequest {
|
||||
int64 locationId = 1;
|
||||
}
|
||||
|
||||
message FindAndInitHTTPLocationWebConfigResponse {
|
||||
bytes webJSON = 1;
|
||||
}
|
||||
@@ -41,5 +41,5 @@ message FindEnabledHTTPPageConfigRequest {
|
||||
}
|
||||
|
||||
message FindEnabledHTTPPageConfigResponse {
|
||||
bytes config = 1;
|
||||
bytes pageJSON = 1;
|
||||
}
|
||||
@@ -10,9 +10,12 @@ service HTTPWebService {
|
||||
// 创建Web配置
|
||||
rpc createHTTPWeb (CreateHTTPWebRequest) returns (CreateHTTPWebResponse);
|
||||
|
||||
// 查找Web配置
|
||||
// 查找Web信息
|
||||
rpc findEnabledHTTPWeb (FindEnabledHTTPWebRequest) returns (FindEnabledHTTPWebResponse);
|
||||
|
||||
// 查找Web配置
|
||||
rpc findEnabledHTTPWebConfig (FindEnabledHTTPWebConfigRequest) returns (FindEnabledHTTPWebConfigResponse);
|
||||
|
||||
// 更改Web配置
|
||||
rpc updateHTTPWeb (UpdateHTTPWebRequest) returns (RPCUpdateSuccess);
|
||||
|
||||
@@ -35,16 +38,19 @@ service HTTPWebService {
|
||||
rpc updateHTTPWebPages (UpdateHTTPWebPagesRequest) returns (RPCUpdateSuccess);
|
||||
|
||||
// 更改访问日志配置
|
||||
rpc updateHTTPAccessLog (UpdateHTTPAccessLogRequest) returns (RPCUpdateSuccess);
|
||||
rpc updateHTTPWebAccessLog (UpdateHTTPWebAccessLogRequest) returns (RPCUpdateSuccess);
|
||||
|
||||
// 更改统计配置
|
||||
rpc updateHTTPStat (UpdateHTTPStatRequest) returns (RPCUpdateSuccess);
|
||||
rpc updateHTTPWebStat (UpdateHTTPWebStatRequest) returns (RPCUpdateSuccess);
|
||||
|
||||
// 更改缓存配置
|
||||
rpc updateHTTPCache (UpdateHTTPCacheRequest) returns (RPCUpdateSuccess);
|
||||
rpc updateHTTPWebCache (UpdateHTTPWebCacheRequest) returns (RPCUpdateSuccess);
|
||||
|
||||
// 更改防火墙设置
|
||||
rpc updateHTTPFirewall (UpdateHTTPFirewallRequest) returns (RPCUpdateSuccess);
|
||||
rpc updateHTTPWebFirewall (UpdateHTTPWebFirewallRequest) returns (RPCUpdateSuccess);
|
||||
|
||||
// 更改路径规则配置
|
||||
rpc updateHTTPWebLocations (UpdateHTTPWebLocationsRequest) returns (RPCUpdateSuccess);
|
||||
}
|
||||
|
||||
// 创建Web配置
|
||||
@@ -56,7 +62,7 @@ message CreateHTTPWebResponse {
|
||||
int64 webId = 1;
|
||||
}
|
||||
|
||||
// 查找Web配置
|
||||
// 查找Web信息
|
||||
message FindEnabledHTTPWebRequest {
|
||||
int64 webId = 1;
|
||||
}
|
||||
@@ -65,6 +71,15 @@ message FindEnabledHTTPWebResponse {
|
||||
HTTPWeb web = 1;
|
||||
}
|
||||
|
||||
// 查找Web配置
|
||||
message FindEnabledHTTPWebConfigRequest {
|
||||
int64 webId = 1;
|
||||
}
|
||||
|
||||
message FindEnabledHTTPWebConfigResponse {
|
||||
bytes webJSON = 1;
|
||||
}
|
||||
|
||||
// 更改Web配置
|
||||
message UpdateHTTPWebRequest {
|
||||
int64 webId = 1;
|
||||
@@ -108,25 +123,31 @@ message UpdateHTTPWebPagesRequest {
|
||||
}
|
||||
|
||||
// 更改访问日志配置
|
||||
message UpdateHTTPAccessLogRequest {
|
||||
message UpdateHTTPWebAccessLogRequest {
|
||||
int64 webId = 1;
|
||||
bytes accessLogJSON = 2;
|
||||
}
|
||||
|
||||
// 更改统计配置
|
||||
message UpdateHTTPStatRequest {
|
||||
message UpdateHTTPWebStatRequest {
|
||||
int64 webId = 1;
|
||||
bytes statJSON = 2;
|
||||
}
|
||||
|
||||
// 更改缓存配置
|
||||
message UpdateHTTPCacheRequest {
|
||||
message UpdateHTTPWebCacheRequest {
|
||||
int64 webId = 1;
|
||||
bytes cacheJSON = 2;
|
||||
}
|
||||
|
||||
// 更改防火墙设置
|
||||
message UpdateHTTPFirewallRequest {
|
||||
message UpdateHTTPWebFirewallRequest {
|
||||
int64 webId = 1;
|
||||
bytes firewallJSON = 2;
|
||||
}
|
||||
}
|
||||
|
||||
// 更改路径规则配置
|
||||
message UpdateHTTPWebLocationsRequest {
|
||||
int64 webId = 1;
|
||||
bytes locationsJSON = 3;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ message ComposeNodeConfigRequest {
|
||||
}
|
||||
|
||||
message ComposeNodeConfigResponse {
|
||||
bytes configJSON = 1;
|
||||
bytes nodeJSON = 1;
|
||||
}
|
||||
|
||||
// 节点stream
|
||||
|
||||
@@ -55,5 +55,5 @@ message FindEnabledOriginServerConfigRequest {
|
||||
}
|
||||
|
||||
message FindEnabledOriginServerConfigResponse {
|
||||
bytes config = 1;
|
||||
bytes originJSON = 1;
|
||||
}
|
||||
@@ -55,7 +55,7 @@ message FindEnabledReverseProxyConfigRequest {
|
||||
}
|
||||
|
||||
message FindEnabledReverseProxyConfigResponse {
|
||||
bytes config = 1;
|
||||
bytes reverseProxyJSON = 1;
|
||||
}
|
||||
|
||||
// 修改反向代理调度算法
|
||||
|
||||
@@ -59,7 +59,7 @@ service ServerService {
|
||||
rpc findAndInitServerReverseProxyConfig (FindAndInitServerReverseProxyConfigRequest) returns (FindAndInitServerReverseProxyConfigResponse);
|
||||
|
||||
// 初始化Web设置
|
||||
rpc findAndInitServerWebConfig (FindAndInitServerWebRequest) returns (FindAndInitServerWebResponse);
|
||||
rpc findAndInitServerWebConfig (FindAndInitServerWebConfigRequest) returns (FindAndInitServerWebConfigResponse);
|
||||
}
|
||||
|
||||
// 创建服务
|
||||
@@ -196,15 +196,15 @@ message FindAndInitServerReverseProxyConfigRequest {
|
||||
}
|
||||
|
||||
message FindAndInitServerReverseProxyConfigResponse {
|
||||
bytes reverseProxy = 1;
|
||||
bytes reverseProxyRef = 2;
|
||||
bytes reverseProxyJSON = 1;
|
||||
bytes reverseProxyRefJSON = 2;
|
||||
}
|
||||
|
||||
// 初始化Web设置
|
||||
message FindAndInitServerWebRequest {
|
||||
message FindAndInitServerWebConfigRequest {
|
||||
int64 serverId = 1;
|
||||
}
|
||||
|
||||
message FindAndInitServerWebResponse {
|
||||
bytes config = 1;
|
||||
message FindAndInitServerWebConfigResponse {
|
||||
bytes webJSON = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user