增加SysLockerService等;提供多个便捷函数

This commit is contained in:
GoEdgeLab
2021-01-14 16:34:16 +08:00
parent 3bf931d8dc
commit facd88e8fd
11 changed files with 1580 additions and 541 deletions

View File

@@ -103,6 +103,9 @@ service NodeClusterService {
// 查找集群的系统服务设置
rpc findNodeClusterSystemService (FindNodeClusterSystemServiceRequest) returns (FindNodeClusterSystemServiceResponse);
// 获取集群中可以使用的端口
rpc findFreePortInNodeCluster (FindFreePortInNodeClusterRequest) returns (FindFreePortInNodeClusterResponse);
}
// 获取所有集群的信息
@@ -365,4 +368,13 @@ message FindNodeClusterSystemServiceRequest {
message FindNodeClusterSystemServiceResponse {
bytes paramsJSON = 1;
}
}
// 获取集群中可以使用的端口
message FindFreePortInNodeClusterRequest {
int64 nodeClusterId = 1;
}
message FindFreePortInNodeClusterResponse {
int32 port = 1;
}

View File

@@ -101,6 +101,12 @@ service ServerService {
// 查找一个用户下的所有域名列表
rpc findAllEnabledServerNamesWithUserId (FindAllEnabledServerNamesWithUserIdRequest) returns (FindAllEnabledServerNamesWithUserIdResponse);
// 查找用户服务基本信息
rpc findEnabledUserServerBasic (FindEnabledUserServerBasicRequest) returns (FindEnabledUserServerBasicResponse);
// 修改用户服务基本信息
rpc updateEnabledUserServerBasic (UpdateEnabledUserServerBasicRequest) returns (RPCSuccess);
}
// 创建服务
@@ -220,6 +226,7 @@ message CountAllEnabledServersMatchRequest {
int64 userId = 3;
int64 clusterId = 4;
int32 auditingFlag = 5;
string protocolFamily = 6;
}
// 列出单页服务
@@ -231,6 +238,7 @@ message ListEnabledServersMatchRequest {
int64 userId = 5;
int64 clusterId = 6;
int32 auditingFlag = 7;
string protocolFamily = 8;
}
message ListEnabledServersMatchResponse {
@@ -359,3 +367,18 @@ message FindAllEnabledServerNamesWithUserIdRequest {
message FindAllEnabledServerNamesWithUserIdResponse {
repeated string serverNames = 1;
}
// 查找用户服务基本信息
message FindEnabledUserServerBasicRequest {
int64 serverId = 1;
}
message FindEnabledUserServerBasicResponse {
Server server = 1;
}
// 修改用户服务基本信息
message UpdateEnabledUserServerBasicRequest {
int64 serverId = 1;
string name = 2;
}

View File

@@ -0,0 +1,30 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "rpc_messages.proto";
// 互斥锁管理
service SysLockerService {
// 获得锁
rpc SysLockerLock (SysLockerLockRequest) returns (SysLockerLockResponse);
// 释放锁
rpc SysLockerUnlock (SysLockerUnlockRequest) returns (RPCSuccess);
}
// 获得锁
message SysLockerLockRequest {
string key = 1;
int64 timeoutSeconds = 2;
}
message SysLockerLockResponse {
bool ok = 1;
}
// 释放锁
message SysLockerUnlockRequest {
string key = 1;
}