对服务增加基础的数据统计/部分代码分Package

This commit is contained in:
GoEdgeLab
2021-01-25 16:41:30 +08:00
parent 1e85ba4679
commit 1e6297a169
245 changed files with 13026 additions and 8836 deletions

View File

@@ -0,0 +1,25 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_acme_user.proto";
import "models/model_dns_provider.proto";
import "models/model_ssl_cert.proto";
import "models/model_acme_task_log.proto";
message ACMETask {
int64 id = 1;
bool isOn = 2;
string dnsDomain = 3;
repeated string domains = 4;
int64 createdAt = 5;
bool autoRenew = 6;
string authType = 7;
ACMEUser acmeUser = 30;
DNSProvider dnsProvider = 31;
SSLCert sslCert = 32;
ACMETaskLog latestACMETaskLog = 33;
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// ACME任务日志
message ACMETaskLog {
int64 id = 1;
bool isOk = 2;
string error = 3;
int64 createdAt = 4;
}

View File

@@ -0,0 +1,11 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message ACMEUser {
int64 id = 1;
string email = 2;
string description = 3;
int64 createdAt = 4;
}

View File

@@ -0,0 +1,18 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_admin_module.proto";
import "models/model_login.proto";
message Admin {
int64 id = 1;
string fullname = 2;
string username = 3;
bool isOn = 4;
bool isSuper = 5;
int64 createdAt = 6;
repeated AdminModule Modules = 7;
Login otpLogin = 8; // OTP认证
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_admin_module.proto";
message AdminModuleList {
int64 adminId = 1;
bool isSuper = 2;
repeated AdminModule Modules = 3;
string fullname = 4;
}

View File

@@ -0,0 +1,10 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message AdminModule {
bool allowAll = 1;
string code = 2;
repeated string actions = 3;
}

View File

@@ -0,0 +1,22 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message APINode {
int64 id = 1;
bool isOn = 2;
int64 nodeClusterId = 3;
string uniqueId = 4;
string secret = 5;
string name = 6;
string description = 7;
bytes httpJSON = 8;
bytes httpsJSON = 9;
bool RestIsOn = 13;
bytes restHTTPJSON = 14;
bytes restHTTPSJSON = 15;
bytes accessAddrsJSON = 10;
repeated string accessAddrs = 11;
bytes statusJSON = 12;
}

View File

@@ -0,0 +1,9 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message ClientBrowser {
int64 id = 1;
string name = 2;
}

View File

@@ -0,0 +1,9 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message ClientSystem {
int64 id = 1;
string name = 2;
}

View File

@@ -0,0 +1,24 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message DBNode {
int64 id = 1;
string name = 2;
string description = 3;
bool isOn = 4;
string host = 5;
int32 port = 6;
string database = 7;
string username = 8;
string password = 9;
string charset = 10;
DBNodeStatus status = 30;
}
message DBNodeStatus {
bool isOk = 1;
int64 size = 2;
string error = 3;
}

View File

@@ -0,0 +1,20 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// 数据表信息
message DBTable {
string name = 1;
string schema = 2;
string type = 3;
string engine = 4;
int64 rows = 5;
int64 dataLength = 6;
int64 indexLength = 7;
string comment = 8;
string collation = 9;
bool isBaseTable = 10;
bool canClean = 11;
bool canDelete = 12;
}

View File

@@ -0,0 +1,23 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_dns_route.proto";
message DNSDomain {
int64 id = 1;
string name = 2;
bool isOn = 3;
int64 dataUpdatedAt = 4;
string dataError = 5;
int64 countServerRecords = 6;
int64 countAllServers = 13;
bool serversChanged = 7;
int64 countNodeRecords = 8;
int64 countAllNodes = 14;
bool nodesChanged = 9;
repeated DNSRoute routes = 10;
int64 providerId = 11;
int64 countNodeClusters = 12;
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message DNSProvider {
int64 id = 1;
string name = 2;
string type = 3;
string typeName = 4;
bytes apiParamsJSON = 5;
int64 dataUpdatedAt = 6;
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message DNSRecord {
string id = 1;
string name = 2;
string value = 3;
string type = 4;
string route = 5;
}

View File

@@ -0,0 +1,9 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message DNSRoute {
string name = 1;
string code = 2;
}

View File

@@ -0,0 +1,10 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message File {
int64 id = 1;
string filename = 2;
int64 size = 3;
}

View File

@@ -0,0 +1,8 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message FileChunk {
bytes data = 1;
}

View File

@@ -0,0 +1,70 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// HTTP访问日志
message HTTPAccessLog {
string requestId = 48;
int64 serverId = 1;
int64 nodeId = 2;
int64 locationId = 3;
int64 rewriteId = 4;
int64 originId = 5;
string remoteAddr = 6;
string rawRemoteAddr = 7;
int32 remotePort = 8;
string remoteUser = 9;
string requestURI = 10;
string requestPath = 11;
int64 requestLength = 12;
double requestTime = 13;
string requestMethod = 14;
string requestFilename = 15;
string scheme = 16;
string proto = 17;
int64 bytesSent = 18;
int64 bodyBytesSent = 19;
int32 status = 20;
string statusMessage = 21;
map<string, Strings> sentHeader = 22;
string timeISO8601 = 23;
string timeLocal = 24;
double msec = 25;
int64 timestamp = 26;
string host = 27;
string referer = 28;
string userAgent = 29;
string request = 30;
string contentType = 31;
map<string, string> cookie = 32;
string args = 34;
string queryString = 35;
map<string, Strings> header = 36;
string serverName = 37;
int32 serverPort = 38;
string serverProtocol = 39;
string hostname = 40;
// 代理相关
string originAddress = 41;
// 错误信息
repeated string errors = 42;
// 扩展
map<string, string> attrs = 43;
// WAF相关
int64 firewallPolicyId = 44;
int64 firewallRuleGroupId = 45;
int64 firewallRuleSetId = 46;
int64 firewallRuleId = 47;
}
message Strings {
repeated string values = 1;
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message HTTPAccessLogPolicy {
int64 id = 1;
string name = 2;
bool isOn = 3;
string type = 4;
bytes optionsJSON = 5;
bytes condsJSON = 6;
}

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

@@ -0,0 +1,13 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message HTTPFirewallPolicy {
int64 id = 1;
string name = 2;
bool isOn = 3;
string description = 4;
bytes inboundJSON = 5;
bytes outboundJSON = 6;
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message HTTPFirewallRuleGroup {
int64 id = 1;
string name = 2;
bool isOn = 3;
string description = 4;
string code = 5;
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message HTTPFirewallRuleSet {
int64 id = 1;
string name = 2;
bool isOn = 3;
string description = 4;
string code = 5;
}

View File

@@ -0,0 +1,15 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_size_capacity.proto";
message HTTPGzip {
int64 id = 1;
bool isOn = 2;
int32 level = 3;
SizeCapacity minLength = 4;
SizeCapacity maxLength = 5;
bytes condsJSON = 6;
}

View File

@@ -0,0 +1,9 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message HTTPWeb {
int64 id = 1;
bool isOn = 2;
}

View File

@@ -0,0 +1,15 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message IPItem {
int64 id = 1;
string ipFrom = 2;
string ipTo = 3;
int64 version = 4;
int64 expiredAt = 5;
string reason = 6;
int64 listId = 7;
bool isDeleted = 8;
}

View File

@@ -0,0 +1,14 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_file.proto";
message IPLibrary {
int64 id = 1;
string type = 2;
int64 createdAt = 3;
File file = 30;
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message IPList {
int64 id = 1;
bool isOn = 2;
string type = 3;
string name = 4;
string code = 5;
bytes timeoutJSON = 6;
}

View File

@@ -0,0 +1,18 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message Log {
int64 id = 1;
string level = 2;
string action = 3;
int64 adminId = 4;
int64 userId = 5;
int64 providerId = 6;
int64 createdAt = 7;
string type = 8;
string ip = 9;
string userName = 10;
string description = 11;
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message Login {
int64 id = 1;
string type = 2;
bytes paramsJSON = 3;
bool isOn = 4;
int64 adminId = 5;
int64 userId = 6;
}

View File

@@ -0,0 +1,20 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_node_cluster.proto";
import "models/model_node.proto";
message Message {
int64 id = 1;
string type = 2;
string body = 3;
string level = 4;
bytes paramsJSON = 5;
bool isRead = 6;
int64 createdAt = 7;
NodeCluster nodeCluster = 30;
Node node = 31;
}

View File

@@ -0,0 +1,10 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NetworkAddress {
string protocol = 1;
string host = 2;
string portRange = 3;
}

View File

@@ -0,0 +1,38 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_node_cluster.proto";
import "models/model_node_login.proto";
import "models/model_node_install_status.proto";
import "models/model_node_ip_address.proto";
import "models/model_node_group.proto";
import "models/model_node_region.proto";
import "models/model_dns_route.proto";
message Node {
int64 id = 1;
string name = 2;
bytes statusJSON = 3;
string installDir = 4;
bool isInstalled = 5;
string code = 6;
string uniqueId = 7;
string secret = 8;
int64 version = 9;
int64 latestVersion = 10;
repeated int64 connectedAPINodeIds = 11;
int32 maxCPU = 12;
bool isOn = 13;
bool isUp = 14;
repeated DNSRoute dnsRoutes = 15;
bool isActive = 16;
NodeCluster nodeCluster = 32;
NodeLogin login = 33;
NodeInstallStatus installStatus = 34;
repeated NodeIPAddress ipAddresses = 35;
NodeGroup group = 36;
NodeRegion region = 37;
}

View File

@@ -0,0 +1,18 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodeCluster {
int64 id = 1;
string name = 2;
int64 createdAt = 3;
int64 grantId = 4;
string installDir = 5;
string uniqueId = 6;
string secret = 7;
string dnsName = 8;
int64 dnsDomainId = 9;
int64 httpCachePolicyId = 10;
int64 httpFirewallPolicyId = 11;
}

View File

@@ -0,0 +1,16 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodeGrant {
int64 id = 1;
string name = 2;
string method = 3;
string username = 4;
string password = 5;
bool su = 6;
string privateKey = 7;
string description = 8;
int64 nodeId = 9;
}

View File

@@ -0,0 +1,9 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodeGroup {
int64 id = 1;
string name = 2;
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodeInstallStatus {
bool isRunning = 1;
bool isFinished = 2;
bool isOk = 3;
string error = 4;
string errorCode = 6;
int64 updatedAt = 5;
}

View File

@@ -0,0 +1,15 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodeIPAddress {
int64 id = 1;
int64 nodeId = 2;
string name = 3;
string ip = 4;
string description = 5;
int64 state = 6;
int64 order = 7;
bool canAccess = 8;
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodeLog {
string role = 1;
string tag = 2;
string description = 3;
string level = 4;
int64 nodeId = 5;
int64 createdAt = 6;
}

View File

@@ -0,0 +1,11 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodeLogin {
int64 id = 1;
string name = 2;
string type = 3;
bytes params = 4;
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodePriceItem {
int64 id = 1;
bool isOn = 2;
string name = 3;
string type = 4;
int64 bitsFrom = 5;
int64 bitsTo = 6;
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodeRegion {
int64 id = 1;
bool isOn = 2;
string name = 3;
string description = 4;
bytes pricesJSON = 5;
}

View File

@@ -0,0 +1,20 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_node.proto";
import "models/model_node_cluster.proto";
// 节点相关同步任务
message NodeTask {
int64 id = 1;
string type = 2;
bool isDone = 3;
bool isOk = 4;
string error = 5;
int64 updatedAt = 6;
Node node = 30;
NodeCluster nodeCluster = 31;
}

View File

@@ -0,0 +1,14 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_network_address.proto";
message Origin {
int64 id = 1;
bool isOn = 2;
string name = 3;
NetworkAddress addr = 4;
string description = 5;
}

View File

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

View File

@@ -0,0 +1,11 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message RegionCountry {
int64 id = 1;
string name = 2;
repeated string codes = 3;
repeated string pinyin = 4;
}

View File

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

View File

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

View File

@@ -0,0 +1,11 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message ReverseProxy {
int64 id = 1;
bytes schedulingJSON = 2;
bytes primaryOriginsJSON = 3;
bytes backupOriginsJSON = 4;
}

View File

@@ -0,0 +1,42 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_node_cluster.proto";
import "models/model_server_group.proto";
import "models/model_user.proto";
import "models/model_server_name_auditing_result.proto";
message Server {
int64 id = 1;
bool isOn = 18;
string type = 2;
string name = 3;
string description = 4;
bytes includeNodes = 5;
bytes excludeNodes = 6;
int64 createdAt = 7;
string dnsName = 19;
// 配置相关
bytes config = 17;
bytes serverNamesJSON = 8;
bool isAuditing = 20;
bytes auditingServerNamesJSON = 21;
ServerNameAuditingResult auditingResult = 22;
bytes httpJSON = 9;
bytes httpsJSON = 10;
bytes tcpJSON = 11;
bytes tlsJSON = 12;
bytes unixJSON = 13;
bytes udpJSON = 14;
int64 webId = 15;
bytes reverseProxyJSON = 16;
NodeCluster nodeCluster = 30;
repeated ServerGroup groups = 31;
User user = 32;
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// 服务每日统计
message ServerDailyStat {
int64 serverId = 1;
int64 regionId = 2;
int64 bytes = 3;
int64 createdAt = 4;
}

View File

@@ -0,0 +1,9 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message ServerGroup {
int64 id = 1;
string name = 2;
}

View File

@@ -0,0 +1,10 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message ServerNameAuditingResult {
bool isOk = 1;
string reason = 2;
int64 createdAt = 3;
}

View File

@@ -0,0 +1,9 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message SizeCapacity {
int64 count = 1;
string unit = 2;
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message SSLCert {
int64 id = 1;
bool isOn = 2;
string name = 3;
int64 timeBeginAt = 4;
int64 timeEndAt = 5;
}

View File

@@ -0,0 +1,21 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_node_cluster.proto";
import "models/model_user_feature.proto";
message User {
int64 id = 1;
string username = 2;
string fullname = 3;
string mobile = 4;
string tel = 5;
string email = 6;
string remark = 7;
bool isOn = 8;
int64 createdAt = 9;
NodeCluster nodeCluster = 10;
repeated UserFeature features = 11;
}

View File

@@ -0,0 +1,15 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// 用户AccessKey
message UserAccessKey {
int64 id = 1;
int64 userId = 2;
int64 subUserId = 3;
bool isOn = 4;
string uniqueId = 5;
string secret = 6;
string description = 7;
}

View File

@@ -0,0 +1,18 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_user.proto";
message UserBill {
int64 id = 1;
User user = 2;
string type = 3;
string typeName = 4;
string description = 5;
float amount = 6;
string month = 7;
bool isPaid = 8;
int64 paidAt = 9;
}

View File

@@ -0,0 +1,10 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message UserFeature {
string code = 1;
string name = 2;
string description = 3;
}

View File

@@ -0,0 +1,18 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message UserNode {
int64 id = 1;
bool isOn = 2;
string uniqueId = 3;
string secret = 4;
string name = 5;
string description = 6;
bytes httpJSON = 7;
bytes httpsJSON = 8;
bytes accessAddrsJSON = 9;
repeated string accessAddrs = 10;
bytes statusJSON = 11;
}

View File

@@ -0,0 +1,14 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// 操作成功
message RPCSuccess {
}
// 返回数量
message RPCCountResponse {
int64 count = 1;
}