实现修改缓存配置

This commit is contained in:
刘祥超
2020-09-20 16:27:59 +08:00
parent f238078054
commit ffb06e5b74
15 changed files with 802 additions and 191 deletions

View File

@@ -0,0 +1,10 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message HTTPCachePolicy {
int64 id = 1;
string name = 2;
bool isOn = 3;
}

View File

@@ -7,8 +7,7 @@ message HTTPWeb {
int64 id = 1;
bool isOn = 2;
string root = 3;
int64 gzipId = 4;
string charset = 5;
int64 requestHeaderPolicyId = 6;
int64 responseHeaderPolicyId = 7;
string charset = 4;
int64 requestHeaderPolicyId = 5;
int64 responseHeaderPolicyId = 6;
}

View File

@@ -0,0 +1,21 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "model_http_cache_policy.proto";
service HTTPCachePolicyService {
// 获取所有可用策略
rpc findAllEnabledHTTPCachePolicies (FindAllEnabledHTTPCachePoliciesRequest) returns (FindAllEnabledHTTPCachePoliciesResponse);
}
// 获取所有可用策略
message FindAllEnabledHTTPCachePoliciesRequest {
}
message FindAllEnabledHTTPCachePoliciesResponse {
repeated HTTPCachePolicy cachePolicies = 1;
}

View File

@@ -39,6 +39,9 @@ service HTTPWebService {
// 更改统计配置
rpc updateHTTPStat (UpdateHTTPStatRequest) returns (RPCUpdateSuccess);
// 更改缓存配置
rpc updateHTTPCache (UpdateHTTPCacheRequest) returns (RPCUpdateSuccess);
}
// 创建Web配置
@@ -68,7 +71,7 @@ message UpdateHTTPWebRequest {
// 更改Gzip配置
message UpdateHTTPWebGzipRequest {
int64 webId = 1;
int64 gzipId = 2;
bytes gzipJSON = 2;
}
// 更改字符集配置
@@ -111,4 +114,10 @@ message UpdateHTTPAccessLogRequest {
message UpdateHTTPStatRequest {
int64 webId = 1;
bytes statJSON = 2;
}
// 更改缓存配置
message UpdateHTTPCacheRequest {
int64 webId = 1;
bytes cacheJSON = 2;
}