Compare commits

..

183 Commits

Author SHA1 Message Date
刘祥超
0863912e0c 用户界面设置中增加“在流量图表中显示缓存相关信息”选项 2023-01-08 11:49:45 +08:00
刘祥超
b19c7f5aa6 用户Dashboard中增加缓存、攻击相关信息 2023-01-08 11:49:30 +08:00
刘祥超
f5bdf33618 WAF增加“在IP列表内”操作符/优化部分操作符代号 2023-01-08 10:15:57 +08:00
刘祥超
c6face62b1 集群服务设置增加自动读超时选项 2023-01-07 20:04:13 +08:00
刘祥超
d3c8d8fd04 调整WAF操作符顺序 2023-01-07 09:35:09 +08:00
刘祥超
16e418447a WAF增加包含任一字符串、包含所有字符串操作符 2023-01-06 20:06:57 +08:00
刘祥超
c77724cf9e IP范围支持多行 2023-01-06 19:13:37 +08:00
刘祥超
606a73f6dd 优化请求条件操作符描述 2023-01-06 16:12:14 +08:00
刘祥超
f48a441f23 集群服务设置中增加性能设置 2023-01-01 19:27:09 +08:00
刘祥超
8d55c38459 优化证书加载速度 2022-12-31 18:34:09 +08:00
刘祥超
37e045876e 优化证书加载速度 2022-12-31 17:22:10 +08:00
刘祥超
bd5a1c5eda 优化证书数量很多时的页面加载速度 2022-12-31 17:12:55 +08:00
刘祥超
bd4cc6f5f5 实现UA名单功能 2022-12-30 20:48:44 +08:00
刘祥超
d417f6f751 内容压缩支持例外扩展名 2022-12-30 12:04:23 +08:00
刘祥超
d48697f4ce 默认情况下内容压缩不支持Partial Content 2022-12-30 11:43:53 +08:00
刘祥超
841a98349d 增加CORS自适应跨域 2022-12-29 17:16:11 +08:00
刘祥超
24d710d39c 用户系统增加自定义页脚 2022-12-28 16:36:37 +08:00
刘祥超
1ed754f285 增加修改服务所属用户API 2022-12-22 11:42:44 +08:00
刘祥超
243ceab3db DNS完善实现SRV和CAA记录 2022-12-15 16:18:00 +08:00
刘祥超
eaca98ee3e 智能DNS初步支持搜索引擎线路 2022-12-13 18:39:11 +08:00
刘祥超
11b0a12304 实现用户通过邮件重置密码功能 2022-12-10 15:54:39 +08:00
刘祥超
ce7911c3fe 初步完成用户电子邮箱绑定(激活) 2022-12-08 20:26:20 +08:00
刘祥超
44a3952f05 实现线路优先级/多个NS接口增加用户ID参数 2022-12-03 20:49:10 +08:00
刘祥超
a8340b8a8a 增加查询某个集群已验证域名API 2022-12-01 19:39:53 +08:00
刘祥超
b4f56c044c 优化WAF操作符提示 2022-12-01 15:20:03 +08:00
刘祥超
8b2088d498 用户可以使用管理员设置的公用线路 2022-11-24 17:20:26 +08:00
刘祥超
e7bf608552 导出API列表时对数据进行排序,以保证每次输出的稳定性 2022-11-22 16:45:14 +08:00
刘祥超
2c06c8932d 优化API角色提取 2022-11-22 14:36:06 +08:00
刘祥超
789aeab579 节点状态中增加API调用统计 2022-11-22 14:35:31 +08:00
刘祥超
a95d202ef0 在节点详情中显示API节点地址/DNS节点也支持自定义API节点地址 2022-11-21 21:08:17 +08:00
刘祥超
64f54d462e 节点可以单独设置所使用的API节点地址 2022-11-21 19:55:09 +08:00
刘祥超
52a20b9915 DNS API支持查询多个同名记录 2022-11-17 17:34:10 +08:00
刘祥超
69ab70b750 优化代码 2022-11-17 14:45:41 +08:00
刘祥超
890296c88b 请求变量增加${cname},WAF checkpoint增加cname和isCNAME 2022-11-16 15:01:00 +08:00
刘祥超
e5ba474419 改进变量分析测试用例 2022-11-16 14:27:20 +08:00
刘祥超
0f7482511e 只有边缘节点有自定义缓存目录时才会更新缓存策略 2022-11-15 20:40:59 +08:00
刘祥超
ea58e6094c 边缘节点支持设置多个缓存目录 2022-11-15 20:35:39 +08:00
刘祥超
4d5fd28f97 增加操作系统和浏览器信息维护接口 2022-11-11 17:46:27 +08:00
刘祥超
7a139b43a9 域名匹配增加通配符端口 2022-11-09 18:21:05 +08:00
刘祥超
0d1108387d 智能DNS:用户添加域名时,可以不需要经过TXT验证 2022-11-09 15:47:17 +08:00
刘祥超
e67af97487 MX记录支持优先级设置 2022-11-06 20:21:11 +08:00
刘祥超
629a2a5a8e 获取单节点同步任务接口增加版本号(version)参数 2022-11-06 11:51:58 +08:00
刘祥超
884776fb85 域名跳转增加忽略跳转前端口选项 2022-11-04 20:59:29 +08:00
刘祥超
f0e9b5c7e1 带宽相关数据增加百分位 2022-11-04 20:29:56 +08:00
刘祥超
3849b651af 用户看板增加带宽百分位 2022-11-04 17:39:33 +08:00
刘祥超
4d550577ee 删除不必要的文件 2022-11-04 16:56:14 +08:00
刘祥超
b3e64f7241 时钟同步增加是否检查chrony选项 2022-11-03 14:58:25 +08:00
刘祥超
f315b7b1d6 NSDomainService.FindNSDomainWithNameRequest()增加userId参数 2022-11-01 09:47:13 +08:00
刘祥超
2de1a8aa4e 增加默认集群DNS设置 2022-10-28 15:26:44 +08:00
刘祥超
cb3bf14df8 节点SSH登录自动使用集群设置 2022-10-26 19:23:29 +08:00
刘祥超
1d66029ef0 集群全局服务配置中增加多个访问日志相关选项 2022-10-26 17:49:45 +08:00
刘祥超
b795f60672 URL跳转中增加域名跳转、端口跳转 2022-10-26 16:07:32 +08:00
刘祥超
76e98174ee 节点设置中增加“通过IP名单”选项 2022-10-26 10:42:02 +08:00
刘祥超
18765d29f2 优化从API实现代码中提取角色的方法 2022-10-25 16:32:16 +08:00
刘祥超
9a38d40937 IP名单增加模糊搜索 2022-10-25 12:27:23 +08:00
刘祥超
43ad1ff67e proto文件增加注释 2022-10-24 18:33:51 +08:00
刘祥超
9f4e838f1d WAF参数定义增加优先级 2022-10-24 17:56:37 +08:00
刘祥超
e95909e293 修复域名解析--集群中单节点多IP时无法修改IP的Bug 2022-10-24 16:34:12 +08:00
刘祥超
759189bca1 添加、修改、删除HTTP Header时增加通用Header提示 2022-10-24 15:42:23 +08:00
刘祥超
3dd24dc5e7 集群服务设置--访问日志中可以设置是否只记录通用Header 2022-10-24 14:39:27 +08:00
刘祥超
156172dacf 防盗链功能增加禁止的来源域名 2022-10-24 10:21:13 +08:00
刘祥超
b6e0740b27 更新用户服务可用状态时同时返回状态 2022-10-23 20:12:33 +08:00
刘祥超
57f3c72058 修改部分小数数字精度(float->double),增加用户服务状态API 2022-10-23 16:29:08 +08:00
刘祥超
a9789c2f22 用户账单接口增加多个参数 2022-10-21 15:44:36 +08:00
刘祥超
ca02782ba5 增加操作节点区域相关接口 2022-10-20 15:14:22 +08:00
刘祥超
1e75f61464 增加流量包相关接口 2022-10-20 10:24:52 +08:00
刘祥超
e98de100b9 增加修改和读取用户计费方式和计费周期接口 2022-10-15 19:15:36 +08:00
刘祥超
387ee8d9c9 增加流量带宽子账单接口/把 regionId 改为 nodeRegionId 2022-10-14 16:17:18 +08:00
刘祥超
a5af5e0597 可以使用账单号获取账单信息 2022-10-14 10:56:01 +08:00
刘祥超
9af8721d8d 优化代码 2022-10-14 10:03:49 +08:00
刘祥超
0d8c8064bf 增加多个服务带宽、流量统计接口 2022-10-03 19:26:47 +08:00
刘祥超
010a9b61d5 删除不必要的代码 2022-10-01 07:17:41 +08:00
刘祥超
b277af4ac2 优化服务列表API 2022-09-30 19:04:36 +08:00
刘祥超
b85016d6c9 完善订单、DNS套餐服务API 2022-09-29 19:21:35 +08:00
刘祥超
10ea8911bc 完善订单、支付相关接口定义 2022-09-29 10:22:51 +08:00
刘祥超
fbfcc8d2c0 阶段性提交 2022-09-28 17:39:28 +08:00
刘祥超
11c2682f59 删除不必要的文件 2022-09-28 09:03:52 +08:00
刘祥超
8a005850db 查询5分钟流量接口增加timeFrom和timeTo参数 2022-09-24 18:55:25 +08:00
刘祥超
a0acc54565 服务流量接口增加5分钟查询接口 2022-09-24 18:36:34 +08:00
刘祥超
8234d0301f 优化智能DNS相关接口 2022-09-24 14:07:59 +08:00
刘祥超
59de46d34f 智能DNS支持应答模式配置 2022-09-23 19:02:21 +08:00
刘祥超
0dcdde06e0 删除不必要的文件 2022-09-23 14:42:52 +08:00
刘祥超
b9b7ca4c41 智能DNS访问日志增加只记录失败查询选项 2022-09-22 18:41:51 +08:00
刘祥超
5244b53270 增加防盗链功能 2022-09-22 16:33:42 +08:00
刘祥超
dd460bc40d 每个服务只初始化一次 2022-09-22 11:09:11 +08:00
刘祥超
d9fb6a2c84 优化代码 2022-09-21 15:09:23 +08:00
刘祥超
c05072d12e 增加查找NS集群主机地址的API 2022-09-21 15:06:01 +08:00
刘祥超
caba96bfeb DNS集群设置时区 2022-09-19 17:00:27 +08:00
刘祥超
a36344f3bb 同步域名解析时不再强制要求修复节点问题 2022-09-18 10:40:43 +08:00
刘祥超
5db4568d7e 优化代码/DNS域名增加分页 2022-09-18 10:22:47 +08:00
刘祥超
4e219b09e0 集群增加自动安装nftables配置 2022-09-18 09:26:01 +08:00
刘祥超
1d7986289d 集群增加是否远程启动选项 2022-09-17 15:11:25 +08:00
刘祥超
710ec09b14 检查域名是否存在时同时检查泛域名 2022-09-17 11:38:51 +08:00
刘祥超
324d24fe5a 创建集群的时候初始化全局服务配置 2022-09-16 19:34:24 +08:00
刘祥超
0f060002e3 集群设置中增加服务设置 2022-09-16 18:41:10 +08:00
刘祥超
2eb19348cc 访问日志中增加源站状态码 2022-09-16 10:07:29 +08:00
刘祥超
a92d8887e3 集群增加自动同步时钟选项 2022-09-15 15:57:16 +08:00
刘祥超
f914802b06 可以修改界面上显示的组件 2022-09-13 19:55:07 +08:00
刘祥超
a2f21e8d58 用户系统可以切换CDN和智能DNS 2022-09-13 19:04:07 +08:00
刘祥超
cf4b9a49ed 增加DNS套餐相关API 2022-09-13 10:50:26 +08:00
刘祥超
da02e6df4a 优化代码 2022-09-11 14:41:14 +08:00
刘祥超
a092f496dd NS域名可以使用状态筛选 2022-09-10 17:00:24 +08:00
刘祥超
98ad80e1cb 实现DNS域名验证 2022-09-10 16:13:26 +08:00
刘祥超
6ed4e2315f NS域名增加状态 2022-09-09 15:25:46 +08:00
刘祥超
55ce6570f8 增加一些NS相关API 2022-09-08 19:36:13 +08:00
刘祥超
70fa03e93b 创建集群的时候可以设置DNS记录的默认TTL 2022-09-08 11:02:36 +08:00
刘祥超
8fe1480d8d 增加获取NS节点最新版本API 2022-09-08 10:42:33 +08:00
刘祥超
f796dc5921 支持中文域名(转换punycode后)访问 2022-09-07 17:08:59 +08:00
刘祥超
f725f3bb07 增加简化的缓存条件设置 2022-09-03 18:15:56 +08:00
刘祥超
f3db0d5b69 NS记录可以按照名称、类型、TTL排序 2022-09-03 16:00:20 +08:00
刘祥超
b6fe3df3d6 DDoS防护增加秒级连接速率限制 2022-08-31 10:01:00 +08:00
刘祥超
5c885050fa 优化鉴权 2022-08-30 11:24:07 +08:00
刘祥超
b54c44bfb9 用户系统也可以申请ACME证书 2022-08-28 20:02:20 +08:00
刘祥超
78664a9218 增加修改全体用户功能API 2022-08-28 17:00:59 +08:00
刘祥超
def814ff5c 提供按小时、按天查询带宽峰值的API 2022-08-28 15:56:33 +08:00
刘祥超
1bf13d381d 服务列表带宽使用新的算法 2022-08-27 18:37:51 +08:00
刘祥超
2975ba8701 WAF默认不启用SQL注释,减少错误检测 2022-08-26 21:08:24 +08:00
刘祥超
14759c3621 可以修改服务的CNAME 2022-08-26 19:51:12 +08:00
刘祥超
5ae65edd0a DDoS防护增加单IP TCP新连接速率黑名单 2022-08-26 11:31:50 +08:00
刘祥超
184d6f97bf Ln节点可以指定访问IP 2022-08-25 20:37:15 +08:00
刘祥超
8972acdfd7 集群DNS设置中增加”包含Ln节点“选项 2022-08-25 19:18:25 +08:00
刘祥超
a957903b98 节点运行日志可以按照节点ID设置为已读 2022-08-25 18:26:40 +08:00
刘祥超
b029c1e95a 优化JS Cookie验证文字提示 2022-08-25 16:03:18 +08:00
刘祥超
095ff97149 增加Javascript Cookie验证 2022-08-25 15:36:01 +08:00
刘祥超
d00ebb31aa NS批量操作时增加用户ID选项 2022-08-25 11:36:45 +08:00
刘祥超
1c7f51c5e0 优化代码 2022-08-24 16:13:16 +08:00
刘祥超
acc70669f1 修复从API代码中提取角色时无法查找子目录的Bug 2022-08-23 21:55:59 +08:00
刘祥超
2add42a284 从API代码中提取节点角色时可以保留多个 2022-08-23 21:41:54 +08:00
刘祥超
225d03a65f 实现IP库制品管理API、自动更新程序 2022-08-23 14:54:53 +08:00
刘祥超
f851212a55 NS节点基本的DDoS防护 2022-08-22 15:10:48 +08:00
刘祥超
199794a63a 优化IP库内存 2022-08-22 08:31:53 +08:00
刘祥超
49129ea227 优化IP库内存使用 2022-08-21 23:09:25 +08:00
刘祥超
91b865dd23 在Daemon模式下不初始化IP库 2022-08-21 21:13:03 +08:00
刘祥超
0e311496b6 实现集成的IP库/初步完成IP库制作API 2022-08-21 20:36:56 +08:00
刘祥超
ed0f627ae4 延长WAF默认封禁时间:阻止动作从60秒增加到300秒;SYN Flood从600秒延长到1800秒 2022-08-20 22:38:12 +08:00
刘祥超
569f27918a 智能DNS增加若干查询记录统计接口 2022-08-20 19:58:38 +08:00
刘祥超
ec02d83ee6 IP库阶段性提交(未完成) 2022-08-14 19:42:05 +08:00
刘祥超
debf4a5249 IP库阶段性提交(未完成) 2022-08-14 16:33:11 +08:00
刘祥超
4ddc1ac89f 新版IP库管理阶段性提交(未完成) 2022-08-13 23:55:59 +08:00
刘祥超
507457dec1 增加批量操作NS域名和记录相关接口 2022-08-09 21:03:04 +08:00
刘祥超
525429bbb0 访问日志ES存储增加Data Stream模式 2022-08-09 18:12:15 +08:00
刘祥超
25e33ac1ee 缓存条件增加If-None-Match和If-Modified-Since是否回源选项 2022-08-07 16:37:03 +08:00
刘祥超
f428cb2de9 优化代码 2022-08-07 15:09:39 +08:00
刘祥超
86070bc8aa 增加NS域名分组、批量添加域名和记录接口 2022-08-06 20:29:26 +08:00
刘祥超
afef00b473 增加查找使用某个证书的NS集群数量的API 2022-08-04 16:25:00 +08:00
刘祥超
812e9482af 自动从代码中分析接口方法所适用的角色 2022-08-04 16:01:57 +08:00
刘祥超
fa5dc80426 优化代码 2022-08-04 11:52:28 +08:00
刘祥超
76b6a5c847 优化代码 2022-08-04 11:24:50 +08:00
刘祥超
a19b738d73 源站读取错误时自动尝试下一个源站 2022-08-03 20:33:31 +08:00
刘祥超
526d72fd99 增加工单相关接口定义 2022-08-03 10:45:23 +08:00
刘祥超
7ea8189c19 服务带宽API增加按月、按日查询接口 2022-08-01 15:41:07 +08:00
刘祥超
c453222774 实现用户订单、在线支付接口(商业版可用) 2022-07-31 19:57:28 +08:00
刘祥超
905163880c EdgeDNS:访问日志增加集群和记录类型筛选 2022-07-27 20:19:19 +08:00
刘祥超
ac106ca4f0 NS节点也增加DDoS配置 2022-07-27 19:41:51 +08:00
刘祥超
262dcf0c8d 智能DNS支持自定义端口 2022-07-27 16:56:32 +08:00
刘祥超
f6b3a0b829 修改文字 2022-07-26 11:28:09 +08:00
刘祥超
ac7ab51dbb 智能DNS增加中国香港、中国澳门、中国台湾、中国大陆、海外等线路 2022-07-26 11:15:05 +08:00
刘祥超
41ea2d0dda 用户实现OTP登录 2022-07-24 16:45:07 +08:00
刘祥超
a4b68cd21c 用户列表中显示实名审核状态 2022-07-24 11:57:38 +08:00
刘祥超
70d864191e 相关接口增加实名认证参数 2022-07-24 11:29:28 +08:00
刘祥超
9fdbaf92cc 可以重置用户实名认证状态 2022-07-24 10:08:13 +08:00
刘祥超
a75e57a8f7 实现基础的实名认证功能 2022-07-24 09:56:34 +08:00
刘祥超
9b187dadbe API节点信息增加instanceCode(实例代号)字段 2022-07-21 19:20:06 +08:00
刘祥超
3ab783bbd0 节点状态中增加主程序位置字段 2022-07-21 15:17:42 +08:00
刘祥超
0e95a5a4bc 增加proto相关注释 2022-07-20 18:14:57 +08:00
刘祥超
dcec62a1a2 服务配置中增加CNAME相关信息 2022-07-18 09:12:58 +08:00
刘祥超
9117af3021 增加用户身份认证相关接口 2022-07-17 10:59:55 +08:00
刘祥超
65095d1290 WAF策略增加记录区域封禁日志选项 2022-07-16 18:45:50 +08:00
刘祥超
380bf3e1c2 集群DNS设置增加允许通过CNAME访问网站服务选项 2022-07-14 09:49:41 +08:00
刘祥超
0090cf1e30 安全设置中增加禁止搜索引擎、禁止爬虫、允许访问的域名等选项 2022-07-07 19:59:00 +08:00
刘祥超
a24cbe43b6 服务看板中增加峰值带宽数据 2022-07-07 17:07:24 +08:00
刘祥超
0976b35357 用户界面设置中增加流量、带宽相关设置 2022-07-07 12:40:19 +08:00
刘祥超
84f8a7192e 增加按用户统计带宽/升级Go为1.18 2022-07-07 09:19:15 +08:00
刘祥超
22479278b9 增加服务带宽统计 2022-07-05 20:09:19 +08:00
刘祥超
f27a55c2b6 增加UAM(5秒盾)集群设置 2022-07-03 22:10:18 +08:00
刘祥超
106bd2ae87 反向代理设置中增加移除回源主机名端口功能 2022-06-30 12:11:30 +08:00
刘祥超
ef4eb23226 实现源站端口跟随功能 2022-06-29 21:55:37 +08:00
刘祥超
d9a2284936 DNS自定义线路中增加CIDR、区域以及排除功能 2022-06-28 20:26:44 +08:00
刘祥超
62027e95b2 支持ZSTD压缩 2022-06-27 22:41:11 +08:00
刘祥超
551cb2f3c1 增加修改服务所在分组API/proto文件增加若干注释 2022-06-25 19:22:19 +08:00
刘祥超
75dcaa7e7e 优化rpc json生成程序 2022-06-22 14:36:33 +08:00
刘祥超
c6952e794a 编译proto文件时自动生成RPC列表JSON 2022-06-21 21:26:22 +08:00
刘祥超
7ad94bff2f fix typo 2022-06-21 09:58:56 +08:00
393 changed files with 89307 additions and 11312 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*_plus.go
*_plus_test.go

View File

@@ -14,6 +14,7 @@ pkg/
userconfigs - 用户相关配置
configutils/ - 配置公共函数等
iplibrary/ - IP库
errors/ - 错误处理
rpc/ - RPC通讯
protos/ RPC数据和接口定义

View File

@@ -1,5 +1,23 @@
#!/usr/bin/env bash
echo "starting ..."
#rm -f ../pkg/rpc/pb/*.pb.go
protoc --go_out=plugins=grpc:../pkg/rpc --proto_path=../pkg/rpc/protos ../pkg/rpc/protos/*.proto
protoc --go_out=plugins=grpc:../pkg/rpc --proto_path=../pkg/rpc/protos ../pkg/rpc/protos/models/*.proto
RESULT=$?
if [ "${RESULT}" != "0" ]; then
exit
fi
RESULT=`protoc --go_out=plugins=grpc:../pkg/rpc --proto_path=../pkg/rpc/protos ../pkg/rpc/protos/models/*.proto`
RESULT=$?
if [ "${RESULT}" != "0" ]; then
exit
fi
# generate rpc.json
./proto-json.sh --quiet
echo "ok"

3
build/proto-json.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
go run ../cmd/proto-json/main.go $1

21140
build/rpc.json Normal file

File diff suppressed because it is too large Load Diff

448
cmd/proto-json/main.go Normal file
View File

@@ -0,0 +1,448 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"github.com/iwind/TeaGo/Tea"
_ "github.com/iwind/TeaGo/bootstrap"
"github.com/iwind/TeaGo/logs"
"github.com/iwind/TeaGo/types"
"os"
"path/filepath"
"regexp"
"sort"
"strings"
)
type ServiceInfo struct {
Name string `json:"name"`
Methods []*MethodInfo `json:"methods"`
Filename string `json:"filename"`
Doc string `json:"doc"`
}
type MethodInfo struct {
Name string `json:"name"`
RequestMessageName string `json:"requestMessageName"`
ResponseMessageName string `json:"responseMessageName"`
Code string `json:"code"`
Doc string `json:"doc"`
Roles []string `json:"roles"`
IsDeprecated bool `json:"isDeprecated"`
}
type MessageInfo struct {
Name string `json:"name"`
Code string `json:"code"`
Doc string `json:"doc"`
}
type LinkInfo struct {
Name string `json:"name"`
Content string `json:"content"`
}
type RPCList struct {
Services []*ServiceInfo `json:"services"`
Messages []*MessageInfo `json:"messages"`
Links []*LinkInfo `json:"links"`
}
func readComments(data []byte) string {
var lines = bytes.Split(data, []byte{'\n'})
var comments = [][]byte{}
for i := len(lines) - 1; i >= 0; i-- {
var line = bytes.TrimLeft(lines[i], " \t")
if len(line) == 0 {
comments = append([][]byte{{' '}}, comments...)
continue
}
if bytes.HasPrefix(line, []byte("//")) {
line = bytes.TrimSpace(bytes.TrimLeft(line, "/"))
comments = append([][]byte{line}, comments...)
} else {
break
}
}
return string(bytes.TrimSpace(bytes.Join(comments, []byte{'\n'})))
}
func removeDuplicates(s []string) []string {
if len(s) == 0 {
return s
}
var m = map[string]bool{}
var result = []string{}
for _, item := range s {
_, ok := m[item]
if ok {
continue
}
result = append(result, item)
m[item] = true
}
return result
}
// 生成JSON格式API列表
func main() {
var quiet = false
flag.BoolVar(&quiet, "quiet", false, "")
flag.Parse()
var methodRolesMap = map[string][]string{} // method => roles
{
var rootDir = filepath.Clean(Tea.Root + "/../../EdgeAPI/internal/rpc/services")
entries, err := os.ReadDir(rootDir)
if err != nil {
logs.Println("[ERROR]read api services from '" + rootDir + "' failed: " + err.Error())
return
}
var rootDirs = []string{rootDir}
for _, entry := range entries {
if entry.IsDir() {
rootDirs = append(rootDirs, rootDir+string(os.PathSeparator)+entry.Name())
}
}
// 排序以保证输出内容的稳定性
sort.Strings(rootDirs)
for _, rootDir := range rootDirs {
files, err := filepath.Glob(rootDir + "/service_*.go")
if err != nil {
fmt.Println("[ERROR]list service implementation files failed: " + err.Error())
return
}
// 排序以保证输出内容的稳定性
sort.Strings(files)
var methodNameReg = regexp.MustCompile(`func\s*\(\w+\s+\*\s*(\w+Service)\)\s*(\w+)\s*\(`) // $1: serviceName, $2 methodName
for _, file := range files {
data, err := os.ReadFile(file)
if err != nil {
fmt.Println("[ERROR]read file '" + file + "' failed: " + err.Error())
return
}
var sourceCode = string(data)
var locList = methodNameReg.FindAllStringIndex(sourceCode, -1)
for index, loc := range locList {
var methodSource = ""
if index == len(locList)-1 { // last one
methodSource = sourceCode[loc[0]:]
} else {
methodSource = sourceCode[loc[0]:locList[index+1][0]]
}
// 方法名
var submatch = methodNameReg.FindStringSubmatch(methodSource)
if len(submatch) == 0 {
continue
}
var serviceName = submatch[1]
if serviceName == "BaseService" {
continue
}
var methodName = submatch[2]
if methodName[0] < 'A' || methodName[0] > 'Z' {
continue
}
var roles = []string{}
if strings.Contains(methodSource, ".ValidateNode(") {
roles = append(roles, "node")
}
if strings.Contains(methodSource, ".ValidateUserNode(") {
var hasRoles = false
var wordIndex = strings.Index(methodSource, ".ValidateUserNode(")
if wordIndex > 0 {
if len(methodSource[wordIndex:]) > 100 {
if strings.Contains(methodSource[wordIndex:wordIndex+100], ".ValidateUserNode(ctx, false)") {
hasRoles = true
}
}
if !hasRoles {
roles = append(roles, "user")
}
}
}
if strings.Contains(methodSource, ".ValidateAdmin(") {
roles = append(roles, "admin")
}
if strings.Contains(methodSource, ".ValidateAdminAndUser(") {
var hasRoles = false
var wordIndex = strings.Index(methodSource, ".ValidateAdminAndUser(")
if wordIndex > 0 {
if len(methodSource[wordIndex:]) > 100 {
if strings.Contains(methodSource[wordIndex:wordIndex+100], ".ValidateAdminAndUser(ctx, false)") {
roles = append(roles, "admin")
hasRoles = true
}
}
if !hasRoles {
roles = append(roles, "admin", "user")
}
}
}
if strings.Contains(methodSource, ".ValidateNSNode(") {
roles = append(roles, "dns")
}
if strings.Contains(methodSource, ".ValidateMonitorNode(") {
roles = append(roles, "monitor")
}
if strings.Contains(methodSource, "rpcutils.UserTypeDNS") {
roles = append(roles, "dns")
}
if strings.Contains(methodSource, "rpcutils.UserTypeUser") {
roles = append(roles, "user")
}
if strings.Contains(methodSource, "rpcutils.UserTypeNode") {
roles = append(roles, "node")
}
if strings.Contains(methodSource, "rpcutils.UserTypeMonitor") {
roles = append(roles, "monitor")
}
if strings.Contains(methodSource, "rpcutils.UserTypeReport") {
roles = append(roles, "report")
}
if strings.Contains(methodSource, "rpcutils.UserTypeCluster") {
roles = append(roles, "cluster")
}
if strings.Contains(methodSource, "rpcutils.UserTypeAdmin") {
roles = append(roles, "admin")
}
methodRolesMap[strings.ToLower(methodName)] = removeDuplicates(roles)
}
}
}
}
var services = []*ServiceInfo{}
var messages = []*MessageInfo{}
{
var dirs = []string{Tea.Root + "/../pkg/rpc/protos/", Tea.Root + "/../pkg/rpc/protos/models"}
for _, dir := range dirs {
func(dir string) {
dir = filepath.Clean(dir)
files, err := filepath.Glob(dir + "/*.proto")
if err != nil {
fmt.Println("[ERROR]list proto files failed: " + err.Error())
return
}
// 排序以保持稳定性
sort.Strings(files)
for _, path := range files {
func(path string) {
var filename = filepath.Base(path)
if filename == "service_authority_key.proto" || filename == "service_authority_node.proto" {
return
}
data, err := os.ReadFile(path)
if err != nil {
fmt.Println("[ERROR]" + err.Error())
return
}
// 先将rpc代码替换成临时代码
var methodCodeMap = map[string][]byte{} // code => method
var methodIndex = 0
var methodReg = regexp.MustCompile(`(?s)rpc\s+(\w+)\s*\(\s*(\w+)\s*\)\s*returns\s*\(\s*(\w+)\s*\)\s*(\{.+})?\s*;`)
data = methodReg.ReplaceAllFunc(data, func(methodData []byte) []byte {
methodIndex++
var code = "METHOD" + types.String(methodIndex)
methodCodeMap[code] = methodData
return []byte("\n" + code)
})
// 服务列表
// TODO 这里需要改进一下,当前实现方法如果方法注释里有括号(}),就会导致部分方法解析不到
var serviceNameReg = regexp.MustCompile(`(?sU)\n\s*service\s+(\w+)\s*\{(.+)}`)
var serviceMatches = serviceNameReg.FindAllSubmatch(data, -1)
var serviceNamePositions = serviceNameReg.FindAllIndex(data, -1)
for serviceMatchIndex, serviceMatch := range serviceMatches {
var serviceName = string(serviceMatch[1])
var serviceNamePosition = serviceNamePositions[serviceMatchIndex][0]
var comment = readComments(data[:serviceNamePosition])
// 方法列表
var methods = []*MethodInfo{}
var serviceData = serviceMatch[2]
var methodCodeReg = regexp.MustCompile(`\b(METHOD\d+)\b`)
var methodCodeMatches = methodCodeReg.FindAllSubmatch(serviceData, -1)
var methodCodePositions = methodCodeReg.FindAllIndex(serviceData, -1)
for methodMatchIndex, methodMatch := range methodCodeMatches {
var methodCode = string(methodMatch[1])
var methodData = methodCodeMap[methodCode]
var methodPieces = methodReg.FindSubmatch(methodData)
var methodCodePosition = methodCodePositions[methodMatchIndex]
var roles = methodRolesMap[strings.ToLower(string(methodPieces[1]))]
if roles == nil {
roles = []string{}
}
methods = append(methods, &MethodInfo{
Name: string(methodPieces[1]),
RequestMessageName: string(methodPieces[2]),
ResponseMessageName: string(methodPieces[3]),
IsDeprecated: strings.Contains(string(methodPieces[4]), "deprecated"),
Code: string(methodData),
Doc: readComments(serviceData[:methodCodePosition[0]]),
Roles: roles,
})
}
services = append(services, &ServiceInfo{
Name: serviceName,
Methods: methods,
Filename: filename,
Doc: comment,
})
}
// 消息列表
var topMessageCodeMap = map[string][]byte{} // code => message
var allMessageCodeMap = map[string][]byte{}
var messageCodeIndex = 0
var messagesReg = regexp.MustCompile(`(?sU)\n\s*message\s+(\w+)\s*\{([^{}]+)\n\s*}`)
var firstMessagesReg = regexp.MustCompile(`message\s+(\w+)`)
var messageCodeREG = regexp.MustCompile(`MESSAGE\d+`)
for {
var hasMessage = false
data = messagesReg.ReplaceAllFunc(data, func(messageData []byte) []byte {
messageCodeIndex++
hasMessage = true
// 是否包含子Message
var subMatches = messageCodeREG.FindAllSubmatch(messageData, -1)
for _, subMatch := range subMatches {
var subMatchCode = string(subMatch[0])
delete(topMessageCodeMap, subMatchCode)
}
var code = "MESSAGE" + types.String(messageCodeIndex)
topMessageCodeMap[code] = messageData
allMessageCodeMap[code] = messageData
return []byte("\n" + code)
})
if !hasMessage {
break
}
}
for messageCode, messageData := range topMessageCodeMap {
// 替换其中的子Message
for {
if messageCodeREG.Match(messageData) {
messageData = messageCodeREG.ReplaceAllFunc(messageData, func(messageCodeData []byte) []byte {
return allMessageCodeMap[string(messageCodeData)]
})
} else {
break
}
}
// 注释
var index = bytes.Index(data, []byte(messageCode))
var messageName = string(firstMessagesReg.FindSubmatch(messageData)[1])
messages = append(messages, &MessageInfo{
Name: messageName,
Code: string(bytes.TrimSpace(messageData)),
Doc: readComments(data[:index]),
})
}
}(path)
}
}(dir)
}
}
var countServices = len(services)
var countMethods = 0
var countMessages = len(messages)
for _, service := range services {
countMethods += len(service.Methods)
}
// 链接
var links = []*LinkInfo{}
// json links
{
var dirs = []string{Tea.Root + "/../pkg/rpc/jsons"}
for _, dir := range dirs {
func(dir string) {
dir = filepath.Clean(dir)
files, err := filepath.Glob(dir + "/*.md")
if err != nil {
fmt.Println("[ERROR]list .md files failed: " + err.Error())
return
}
// 排序以保持稳定性
sort.Strings(files)
for _, path := range files {
func(path string) {
var name = strings.TrimSuffix(filepath.Base(path), ".md")
data, err := os.ReadFile(path)
if err != nil {
fmt.Println("[ERROR]read '" + path + "' failed: " + err.Error())
return
}
links = append(links, &LinkInfo{
Name: "json:" + name,
Content: string(data),
})
}(path)
}
}(dir)
}
}
// 对消息进行排序,以保持稳定性
sort.Slice(messages, func(i, j int) bool {
return messages[i].Name < messages[j].Name
})
var rpcList = &RPCList{
Services: services,
Messages: messages,
Links: links,
}
jsonData, err := json.MarshalIndent(rpcList, "", " ")
if err != nil {
fmt.Println("[ERROR]marshal to json failed: " + err.Error())
return
}
var jsonFile = Tea.Root + "/rpc.json"
err = os.WriteFile(jsonFile, jsonData, 0666)
if err != nil {
fmt.Println("[ERROR]write json to file failed: " + err.Error())
return
}
if !quiet {
fmt.Println("services:", countServices, "methods:", countMethods, "messages:", countMessages)
fmt.Println("===")
fmt.Println("generated " + filepath.Base(jsonFile) + " successfully")
}
}

13
go.mod
View File

@@ -1,15 +1,18 @@
module github.com/TeaOSLab/EdgeCommon
go 1.15
go 1.18
require (
github.com/cespare/xxhash/v2 v2.1.1
github.com/golang/protobuf v1.5.2
github.com/iwind/TeaGo v0.0.0-20220304043459-0dd944a5b475
golang.org/x/net v0.0.0-20220225172249-27dd8689420f
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 // indirect
google.golang.org/genproto v0.0.0-20220317150908-0efb43f6373e // indirect
golang.org/x/net v0.2.0
google.golang.org/grpc v1.45.0
google.golang.org/protobuf v1.27.1
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
)
require (
golang.org/x/sys v0.2.0 // indirect
golang.org/x/text v0.4.0 // indirect
google.golang.org/genproto v0.0.0-20220317150908-0efb43f6373e // indirect
)

16
go.sum
View File

@@ -7,7 +7,6 @@ github.com/DataDog/sketches-go v0.0.0-20190923095040-43f19ad77ff7/go.mod h1:Q5Db
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
@@ -114,8 +113,8 @@ golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -137,18 +136,15 @@ golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 h1:OH54vjqzRWmbJ62fjuhxy7AxFFgoHN0/DPc/UrL8cAs=
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=

View File

@@ -50,8 +50,8 @@ func MatchDomain(pattern string, domain string) (isMatched bool) {
}
// 其他匹配
patternPieces := strings.Split(pattern, ".")
domainPieces := strings.Split(domain, ".")
var patternPieces = strings.Split(pattern, ".")
var domainPieces = strings.Split(domain, ".")
if len(patternPieces) != len(domainPieces) {
return
}
@@ -60,6 +60,15 @@ func MatchDomain(pattern string, domain string) (isMatched bool) {
if patternPiece == "" || patternPiece == "*" || patternPiece == domainPieces[index] {
continue
}
if strings.HasSuffix(patternPiece, ":*") {
var portIndex = strings.LastIndex(patternPiece, ":*")
if portIndex >= 0 {
var prefix = patternPiece[:portIndex]
if strings.HasPrefix(domainPieces[index], prefix+":") {
continue
}
}
}
isMatched = false
break
}

View File

@@ -6,86 +6,102 @@ import (
)
func TestMatchDomain(t *testing.T) {
a := assert.NewAssertion(t)
var a = assert.NewAssertion(t)
{
ok := MatchDomains([]string{}, "example.com")
var ok = MatchDomains([]string{}, "example.com")
a.IsFalse(ok)
}
{
ok := MatchDomains([]string{"example.com"}, "example.com")
var ok = MatchDomains([]string{"example.com"}, "example.com")
a.IsTrue(ok)
}
{
ok := MatchDomains([]string{"www.example.com"}, "example.com")
var ok = MatchDomains([]string{"www.example.com"}, "example.com")
a.IsFalse(ok)
}
{
ok := MatchDomains([]string{".example.com"}, "www.example.com")
var ok = MatchDomains([]string{".example.com"}, "www.example.com")
a.IsTrue(ok)
}
{
ok := MatchDomains([]string{".example.com"}, "a.www.example.com")
var ok = MatchDomains([]string{".example.com"}, "a.www.example.com")
a.IsTrue(ok)
}
{
ok := MatchDomains([]string{".example.com"}, "a.www.example123.com")
var ok = MatchDomains([]string{".example.com"}, "a.www.example123.com")
a.IsFalse(ok)
}
{
ok := MatchDomains([]string{"*.example.com"}, "www.example.com")
var ok = MatchDomains([]string{"*.example.com"}, "www.example.com")
a.IsTrue(ok)
}
{
ok := MatchDomains([]string{"*.*.com"}, "www.example.com")
var ok = MatchDomains([]string{"*.*.com"}, "www.example.com")
a.IsTrue(ok)
}
{
ok := MatchDomains([]string{"www.*.com"}, "www.example.com")
var ok = MatchDomains([]string{"www.*.com"}, "www.example.com")
a.IsTrue(ok)
}
{
ok := MatchDomains([]string{"gallery.*.com"}, "www.example.com")
var ok = MatchDomains([]string{"gallery.*.com"}, "www.example.com")
a.IsFalse(ok)
}
{
ok := MatchDomains([]string{"~\\w+.example.com"}, "www.example.com")
var ok = MatchDomains([]string{"~\\w+.example.com"}, "www.example.com")
a.IsTrue(ok)
}
{
ok := MatchDomains([]string{"~\\w+.example.com"}, "a.www.example.com")
var ok = MatchDomains([]string{"~\\w+.example.com"}, "a.www.example.com")
a.IsTrue(ok)
}
{
ok := MatchDomains([]string{"~^\\d+.example.com$"}, "www.example.com")
var ok = MatchDomains([]string{"~^\\d+.example.com$"}, "www.example.com")
a.IsFalse(ok)
}
{
ok := MatchDomains([]string{"~^\\d+.example.com$"}, "123.example.com")
var ok = MatchDomains([]string{"~^\\d+.example.com$"}, "123.example.com")
a.IsTrue(ok)
}
{
ok := MatchDomains([]string{"*"}, "example.com")
var ok = MatchDomains([]string{"*"}, "example.com")
a.IsTrue(ok)
}
// port
{
ok := MatchDomains([]string{"example.com:8001"}, "example.com:8001")
var ok = MatchDomains([]string{"example.com:8001"}, "example.com:8001")
a.IsTrue(ok)
}
{
var ok = MatchDomains([]string{"example.com:8002"}, "example.com:8001")
a.IsFalse(ok)
}
{
var ok = MatchDomains([]string{"*.example.com:8001"}, "a.example.com:8001")
a.IsTrue(ok)
}
{
var ok = MatchDomains([]string{"*.example.com:*"}, "a.example.com:8001")
a.IsTrue(ok)
}
{
var ok = MatchDomains([]string{"*.example.com:8002"}, "a.example.com:8001")
a.IsFalse(ok)
}
}
func TestIsSpecialDomain(t *testing.T) {

View File

@@ -2,27 +2,71 @@ package configutils
import (
"encoding/binary"
"github.com/cespare/xxhash/v2"
"math"
"math/big"
"net"
"strings"
)
// IP2Long 将IP转换为整型
// IPString2Long 将IP转换为整型
// 注意IPv6没有顺序
func IP2Long(ip string) uint64 {
func IPString2Long(ip string) uint64 {
if len(ip) == 0 {
return 0
}
s := net.ParseIP(ip)
if len(s) == 0 {
var netIP = net.ParseIP(ip)
if len(netIP) == 0 {
return 0
}
return IP2Long(netIP)
}
// IP2Long 将IP对象转换为整型
func IP2Long(netIP net.IP) uint64 {
if len(netIP) == 0 {
return 0
}
if strings.Contains(ip, ":") {
return math.MaxUint32 + xxhash.Sum64(s)
var b4 = netIP.To4()
if b4 != nil {
return uint64(binary.BigEndian.Uint32(b4.To4()))
}
return uint64(binary.BigEndian.Uint32(s.To4()))
var i = big.NewInt(0)
i.SetBytes(netIP.To16())
return i.Uint64()
}
// IsIPv4 检查是否为IPv4
func IsIPv4(netIP net.IP) bool {
if len(netIP) == 0 {
return false
}
return netIP.To4() != nil
}
// IsIPv6 检查是否为IPv6
func IsIPv6(netIP net.IP) bool {
if len(netIP) == 0 {
return false
}
return netIP.To4() == nil && netIP.To16() != nil
}
// IPVersion 获取IP版本号
func IPVersion(netIP net.IP) int {
if len(netIP) == 0 {
return 0
}
if netIP.To4() != nil {
return 4
}
if netIP.To16() != nil {
return 6
}
return 0
}
// ParseCIDR 计算CIDR最大值

View File

@@ -1,11 +1,41 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package configutils
package configutils_test
import "testing"
import (
"fmt"
"github.com/TeaOSLab/EdgeCommon/pkg/configutils"
"github.com/iwind/TeaGo/assert"
"net"
"testing"
)
func TestParseCIDR(t *testing.T) {
t.Log(ParseCIDR("192.168.1.1/32"))
t.Log(ParseCIDR("192.168.1.1/24"))
t.Log(ParseCIDR("192.168.1.1/16"))
t.Log(configutils.ParseCIDR("192.168.1.1/32"))
t.Log(configutils.ParseCIDR("192.168.1.1/24"))
t.Log(configutils.ParseCIDR("192.168.1.1/16"))
}
func TestIPString2Long(t *testing.T) {
for _, ip := range []string{"127.0.0.1", "192.168.1.100", "::1", "fd00:6868:6868:0:10ac:d056:3bf6:7452", "fd00:6868:6868:0:10ac:d056:3bf6:7453", "2001:0db8:85a3:0000:0000:8a2e:0370:7334", "wrong ip"} {
t.Log(fmt.Sprintf("%42s", ip), "=>", configutils.IPString2Long(ip))
}
}
func TestIsIPv4(t *testing.T) {
t.Log(configutils.IsIPv4(net.ParseIP("192.168.1.100")))
t.Log(configutils.IsIPv4(net.ParseIP("::1")))
}
func TestIsIPv6(t *testing.T) {
t.Log(configutils.IsIPv6(net.ParseIP("192.168.1.100")))
t.Log(configutils.IsIPv6(net.ParseIP("::1")))
}
func TestIPVersion(t *testing.T) {
var a = assert.NewAssertion(t)
a.IsTrue(configutils.IPVersion(net.ParseIP("192.168.1.100")) == 4)
a.IsTrue(configutils.IPVersion(net.ParseIP("1.2.3")) == 0)
a.IsTrue(configutils.IPVersion(net.ParseIP("::1")) == 6)
a.IsTrue(configutils.IPVersion(net.ParseIP("2001:0db8:85a3:0000:0000:8a2e:0370:7334")) == 6)
}

View File

@@ -55,11 +55,13 @@ func BenchmarkParseVariables(b *testing.B) {
b.ResetTimer()
for i := 0; i < b.N; i++ {
_ = ParseVariables("hello, ${name}, ${age}, ${gender}, ${home}, world", func(s string) string {
return "Lu"
})
}
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
_ = ParseVariables("hello, ${name}, ${age}, ${gender}, ${home}, world", func(s string) string {
return "Lu"
})
}
})
}
func BenchmarkParseVariablesFromHolders(b *testing.B) {

View File

@@ -2,11 +2,11 @@ package configutils
import (
"gopkg.in/yaml.v3"
"io/ioutil"
"os"
)
func UnmarshalYamlFile(file string, ptr interface{}) error {
data, err := ioutil.ReadFile(file)
data, err := os.ReadFile(file)
if err != nil {
return err
}

1
pkg/dnsconfigs/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
ns_*

View File

@@ -2,9 +2,18 @@ package dnsconfigs
// ClusterDNSConfig 集群的DNS设置
type ClusterDNSConfig struct {
CNameRecords []string `yaml:"cnameRecords" json:"cnameRecords"` // 自动加入的CNAME
TTL int32 `yaml:"ttl" json:"ttl"` // 默认TTL各个DNS服务商对记录的TTL的限制各有不同
CNAMERecords []string `yaml:"cnameRecords" json:"cnameRecords"` // 自动加入的CNAME
TTL int32 `yaml:"ttl" json:"ttl"` // 默认TTL各个DNS服务商对记录的TTL的限制各有不同
CNAMEAsDomain bool `yaml:"cnameAsDomain" json:"cnameAsDomain"` // 是否可以像域名一样直接访问CNAME
IncludingLnNodes bool `yaml:"includingLnNodes" json:"includingLnNodes"` // 是否包含Ln节点
NodesAutoSync bool `yaml:"nodesAutoSync" json:"nodesAutoSync"` // 是否自动同步节点状态
ServersAutoSync bool `yaml:"serversAutoSync" json:"serversAutoSync"` // 是否自动同步服务状态
}
func DefaultClusterDNSConfig() *ClusterDNSConfig {
return &ClusterDNSConfig{
CNAMEAsDomain: true,
IncludingLnNodes: true,
}
}

View File

@@ -1,13 +0,0 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package dnsconfigs
type NSAccessLogRef struct {
IsPrior bool `yaml:"isPrior" json:"isPrior"` // 是否覆盖
IsOn bool `yaml:"isOn" json:"isOn"` // 是否启用
LogMissingDomains bool `yaml:"logMissingDomains" json:"logMissingDomains"` // 是否记录找不到的域名
}
func (this *NSAccessLogRef) Init() error {
return nil
}

View File

@@ -1,69 +0,0 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package dnsconfigs
type KeyAlgorithmType = string
const (
KeyAlgorithmTypeHmacSHA1 KeyAlgorithmType = "hmac-sha1."
KeyAlgorithmTypeHmacSHA224 KeyAlgorithmType = "hmac-sha224."
KeyAlgorithmTypeHmacSHA256 KeyAlgorithmType = "hmac-sha256."
KeyAlgorithmTypeHmacSHA384 KeyAlgorithmType = "hmac-sha384."
KeyAlgorithmTypeHmacSHA512 KeyAlgorithmType = "hmac-sha512."
)
type KeyAlgorithmDefinition struct {
Name string `json:"name"`
Code string `json:"code"`
}
func FindAllKeyAlgorithmTypes() []*KeyAlgorithmDefinition {
return []*KeyAlgorithmDefinition{
{
Name: "HmacSHA1",
Code: KeyAlgorithmTypeHmacSHA1,
},
{
Name: "HmacSHA224",
Code: KeyAlgorithmTypeHmacSHA224,
},
{
Name: "HmacSHA256",
Code: KeyAlgorithmTypeHmacSHA256,
},
{
Name: "HmacSHA384",
Code: KeyAlgorithmTypeHmacSHA384,
},
{
Name: "HmacSHA512",
Code: KeyAlgorithmTypeHmacSHA512,
},
}
}
func FindKeyAlgorithmTypeName(algoType KeyAlgorithmType) string {
for _, def := range FindAllKeyAlgorithmTypes() {
if def.Code == algoType {
return def.Name
}
}
return ""
}
type NSKeySecretType = string
const (
NSKeySecretTypeClear NSKeySecretType = "clear"
NSKeySecretTypeBase64 NSKeySecretType = "base64"
)
func FindKeySecretTypeName(secretType NSKeySecretType) string {
switch secretType {
case NSKeySecretTypeClear:
return "明文"
case NSKeySecretTypeBase64:
return "BASE64"
}
return ""
}

View File

@@ -1,34 +0,0 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package dnsconfigs
import "fmt"
type NSNodeConfig struct {
Id int64 `yaml:"id" json:"id"`
NodeId string `yaml:"nodeId" json:"nodeId"`
Secret string `yaml:"secret" json:"secret"`
ClusterId int64 `yaml:"clusterId" json:"clusterId"`
AccessLogRef *NSAccessLogRef `yaml:"accessLogRef" json:"accessLogRef"`
RecursionConfig *RecursionConfig `yaml:"recursionConfig" json:"recursionConfig"`
paddedId string
}
func (this *NSNodeConfig) Init() error {
this.paddedId = fmt.Sprintf("%08d", this.Id)
// accessLog
if this.AccessLogRef != nil {
err := this.AccessLogRef.Init()
if err != nil {
return err
}
}
return nil
}
func (this *NSNodeConfig) PaddedId() string {
return this.paddedId
}

View File

@@ -1,6 +0,0 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package dnsconfigs
type NSSetting struct {
}

View File

@@ -1,65 +0,0 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package dnsconfigs
type RecordTTL struct {
Name string `json:"name"`
Value int `json:"value"`
}
func FindAllRecordTTL() []*RecordTTL {
return []*RecordTTL{
{
Name: "5秒",
Value: 5,
},
{
Name: "10秒",
Value: 10,
},
{
Name: "30秒",
Value: 30,
},
{
Name: "1分钟",
Value: 60,
},
{
Name: "3分钟",
Value: 3 * 60,
},
{
Name: "5分钟",
Value: 5 * 60,
},
{
Name: "10分钟",
Value: 10 * 60,
},
{
Name: "30分钟",
Value: 30 * 60,
},
{
Name: "1小时",
Value: 3600,
},
{
Name: "12小时",
Value: 12 * 3600,
},
{
Name: "1天",
Value: 86400,
},
{
Name: "30天",
Value: 30 * 86400,
},
{
Name: "一年",
Value: 365 * 86400,
},
}
}

View File

@@ -13,11 +13,13 @@ const (
RecordTypeSRV RecordType = "SRV"
RecordTypeTXT RecordType = "TXT"
RecordTypeCAA RecordType = "CAA"
RecordTypeSOA RecordType = "SOA"
)
type RecordTypeDefinition struct {
Type RecordType `json:"type"`
Description string `json:"description"`
CanDefine bool `json:"canDefine"` // 用户是否可以自定义
}
func FindAllRecordTypeDefinitions() []*RecordTypeDefinition {
@@ -25,34 +27,57 @@ func FindAllRecordTypeDefinitions() []*RecordTypeDefinition {
{
Type: RecordTypeA,
Description: "将域名指向一个IPV4地址",
CanDefine: true,
},
{
Type: RecordTypeCNAME,
Description: "将域名指向另外一个域名",
CanDefine: true,
},
{
Type: RecordTypeAAAA,
Description: "将域名指向一个IPV6地址",
CanDefine: true,
},
{
Type: RecordTypeNS,
Description: "将子域名指定其他DNS服务器解析",
CanDefine: false,
},
{
Type: RecordTypeSOA,
Description: "起始授权机构记录",
CanDefine: false,
},
{
Type: RecordTypeMX,
Description: "将域名指向邮件服务器地址",
CanDefine: true,
},
{
Type: RecordTypeSRV,
Description: "记录提供特定的服务的服务器",
CanDefine: true,
},
{
Type: RecordTypeTXT,
Description: "文本长度限制512通常做SPF记录或者校验域名所有者",
CanDefine: true,
},
{
Type: RecordTypeCAA,
Description: "CA证书颁发机构授权校验",
CanDefine: true,
},
}
}
func FindAllUserRecordTypeDefinitions() []*RecordTypeDefinition {
var result = []*RecordTypeDefinition{}
for _, r := range FindAllRecordTypeDefinitions() {
if r.CanDefine {
result = append(result, r)
}
}
return result
}

View File

@@ -1,18 +0,0 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package dnsconfigs
type DNSHost struct {
Host string `json:"host"`
Port int `json:"port"`
Protocol string `json:"protocol"`
}
// RecursionConfig 递归DNS设置
type RecursionConfig struct {
IsOn bool `json:"isOn"`
Hosts []*DNSHost `json:"hosts"`
UseLocalHosts bool `json:"useLocalHosts"` // 自动从本机读取DNS
AllowDomains []string `json:"allowDomains"`
DenyDomains []string `json:"denyDomains"`
}

View File

@@ -1,40 +0,0 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package dnsconfigs
import "github.com/TeaOSLab/EdgeCommon/pkg/configutils"
type RouteRangeType = string
const (
RouteRangeTypeIP RouteRangeType = "ipRange"
)
type RouteRangeInterface interface {
Init() error
Contains(ip uint64) bool
}
// RouteRangeIPRange IP范围配置
type RouteRangeIPRange struct {
IPFrom string `json:"ipFrom"`
IPTo string `json:"ipTo"`
ipFromLong uint64
ipToLong uint64
}
func (this *RouteRangeIPRange) Init() error {
this.ipFromLong = configutils.IP2Long(this.IPFrom)
this.ipToLong = configutils.IP2Long(this.IPTo)
if this.ipFromLong > this.ipToLong {
this.ipFromLong, this.ipToLong = this.ipToLong, this.ipFromLong
}
return nil
}
func (this *RouteRangeIPRange) Contains(ip uint64) bool {
return this.ipFromLong <= ip && this.ipToLong >= ip
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,86 +0,0 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package dnsconfigs
import (
"strings"
"testing"
)
func TestRoutes(t *testing.T) {
// 检查代号是否有空,或者代号是否重复
var codeMap = map[string]bool{} // code => true
for _, routes := range [][]*Route{
AllDefaultChinaProvinceRoutes,
AllDefaultISPRoutes,
AllDefaultWorldRegionRoutes,
} {
for _, route := range routes {
if len(route.Name) == 0 {
t.Fatal("route name should not empty:", route)
}
if len(route.AliasNames) == 0 {
t.Fatal("route alias names should not empty:", route)
}
if len(route.Code) == 0 || route.Code == "world:" {
t.Fatal("route code should not empty:", route)
}
_, ok := codeMap[route.Code]
if ok {
t.Fatal("code duplicated:", route)
}
codeMap[route.Code] = true
if strings.HasPrefix(route.Code, "world:sp:") || (strings.HasPrefix(route.Code, "world:") && route.Code != "world:UAR" && len(route.Code) != 8) {
t.Log("no shorten code:", route)
}
}
}
}
func TestFindDefaultRoute(t *testing.T) {
t.Log(FindDefaultRoute("isp:china_unicom"))
t.Log(FindDefaultRoute("china:province:beijing"))
t.Log(FindDefaultRoute("world:CN"))
t.Log(FindDefaultRoute("world:US"))
}
func TestRoutes_Markdown(t *testing.T) {
var markdown = ""
for index, routes := range [][]*Route{
AllDefaultRoutes,
AllDefaultChinaProvinceRoutes,
AllDefaultISPRoutes,
AllDefaultWorldRegionRoutes,
} {
switch index {
case 0:
markdown += "## 默认线路\n"
case 1:
markdown += "## 中国地区\n"
case 2:
markdown += "## 运营商\n"
case 3:
markdown += "## 全球地区\n"
}
markdown += "| 名称 | 代号 |\n"
markdown += "|-----------|-----------|\n"
for _, route := range routes {
markdown += "| " + route.Name + " | " + route.Code + " |\n"
}
markdown += "\n"
}
t.Log(markdown)
}
func BenchmarkFindDefaultRoute(b *testing.B) {
for i := 0; i < b.N; i++ {
_ = FindDefaultRoute("world:CN")
}
}

View File

@@ -1,8 +0,0 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package dnsconfigs
// TSIGConfig 配置
type TSIGConfig struct {
IsOn bool `yaml:"isOn" json:"isOn"`
}

View File

@@ -29,7 +29,7 @@ func (this *errorObj) Error() string {
return s
}
// 新错误
// New 新错误
func New(errText string) error {
ptr, file, line, ok := runtime.Caller(1)
funcName := ""
@@ -45,7 +45,7 @@ func New(errText string) error {
}
}
// 包装已有错误
// Wrap 包装已有错误
func Wrap(err error) error {
if err == nil {
return nil

1
pkg/iplibrary/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
ip.db

View File

@@ -0,0 +1,86 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary
import (
"bytes"
"compress/gzip"
_ "embed"
"net"
)
//go:embed internal-ip-library.db
var ipLibraryData []byte
var defaultLibrary = NewIPLibrary()
func DefaultIPLibraryData() []byte {
return ipLibraryData
}
func InitDefault() error {
defaultLibrary.reader = nil
return defaultLibrary.InitFromData(ipLibraryData)
}
func Lookup(ip net.IP) *QueryResult {
return defaultLibrary.Lookup(ip)
}
func LookupIP(ip string) *QueryResult {
return defaultLibrary.LookupIP(ip)
}
type IPLibrary struct {
reader *Reader
}
func NewIPLibrary() *IPLibrary {
return &IPLibrary{}
}
func NewIPLibraryWithReader(reader *Reader) *IPLibrary {
return &IPLibrary{reader: reader}
}
func (this *IPLibrary) InitFromData(data []byte) error {
if len(data) == 0 || this.reader != nil {
return nil
}
var reader = bytes.NewReader(data)
gzipReader, err := gzip.NewReader(reader)
if err != nil {
return err
}
defer func() {
_ = gzipReader.Close()
}()
libReader, err := NewReader(gzipReader)
if err != nil {
return err
}
this.reader = libReader
return nil
}
func (this *IPLibrary) Lookup(ip net.IP) *QueryResult {
if this.reader == nil {
return &QueryResult{}
}
var result = this.reader.Lookup(ip)
if result == nil {
result = &QueryResult{}
}
return result
}
func (this *IPLibrary) LookupIP(ip string) *QueryResult {
if this.reader == nil {
return &QueryResult{}
}
return this.Lookup(net.ParseIP(ip))
}

View File

@@ -0,0 +1,91 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary_test
import (
"fmt"
"github.com/TeaOSLab/EdgeCommon/pkg/iplibrary"
"net"
"runtime"
"runtime/debug"
"testing"
"time"
)
func TestIPLibrary_Init(t *testing.T) {
var lib = iplibrary.NewIPLibrary()
err := lib.InitFromData(iplibrary.DefaultIPLibraryData())
if err != nil {
t.Fatal(err)
}
}
func TestIPLibrary_Lookup(t *testing.T) {
var stat1 = &runtime.MemStats{}
runtime.ReadMemStats(stat1)
var lib = iplibrary.NewIPLibrary()
var before = time.Now()
err := lib.InitFromData(iplibrary.DefaultIPLibraryData())
if err != nil {
t.Fatal(err)
}
var costMs = time.Since(before).Seconds() * 1000
runtime.GC()
debug.FreeOSMemory()
var stat2 = &runtime.MemStats{}
runtime.ReadMemStats(stat2)
t.Log((stat2.Alloc-stat1.Alloc)/1024/1024, "M", fmt.Sprintf("%.2f", costMs), "ms")
for _, ip := range []string{
"127.0.0.1",
"8.8.8.8",
"4.4.4.4",
"202.96.0.20",
"66.249.66.69",
"2222", // wrong ip
"2406:8c00:0:3401:133:18:168:70", // ipv6
} {
var result = lib.Lookup(net.ParseIP(ip))
t.Log(ip, "=>", result.IsOk(), "[", result.CountryName(), result.CountryId(), "][", result.ProvinceName(), result.ProvinceId(), "][", result.TownName(), result.TownId(), "][", result.ProviderName(), result.ProviderId(), "]")
}
}
func TestIPLibrary_LookupIP(t *testing.T) {
var lib = iplibrary.NewIPLibrary()
err := lib.InitFromData(iplibrary.DefaultIPLibraryData())
if err != nil {
t.Fatal(err)
}
for _, ip := range []string{
"66.249.66.69",
} {
var result = lib.LookupIP(ip)
if result.IsOk() {
t.Log(ip, "=>", result.IsOk(), "[", result.CountryName(), result.CountryId(), "][", result.ProvinceName(), result.ProvinceId(), "][", result.TownName(), result.TownId(), "][", result.ProviderName(), result.ProviderId(), "]")
} else {
t.Log(ip, "=>", result.IsOk())
}
}
}
func BenchmarkIPLibrary_Lookup(b *testing.B) {
var lib = iplibrary.NewIPLibrary()
err := lib.InitFromData(iplibrary.DefaultIPLibraryData())
if err != nil {
b.Fatal(err)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
_ = lib.LookupIP("66.249.66.69")
}
}

Binary file not shown.

51
pkg/iplibrary/ip_item.go Normal file
View File

@@ -0,0 +1,51 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary
import (
"bytes"
"encoding/binary"
"github.com/iwind/TeaGo/types"
)
type ipItem struct {
IPFrom uint64
IPTo uint64
Region *ipRegion
}
type ipRegion struct {
CountryId uint32
ProvinceId uint32
CityId uint32
TownId uint32
ProviderId uint32
}
func (this *ipItem) AsBinary() ([]byte, error) {
var buf = &bytes.Buffer{}
err := binary.Write(buf, binary.BigEndian, this)
if err != nil {
return nil, err
}
return buf.Bytes(), nil
}
func HashRegion(countryId uint32, provinceId uint32, cityId uint32, townId uint32, providerId uint32) string {
var providerHash = ""
if providerId > 0 {
providerHash = "_" + types.String(providerId)
}
if townId > 0 {
return "t" + types.String(townId) + providerHash
}
if cityId > 0 {
return "c" + types.String(cityId) + providerHash
}
if provinceId > 0 {
return "p" + types.String(provinceId) + providerHash
}
return "a" + types.String(countryId) + providerHash
}

95
pkg/iplibrary/meta.go Normal file
View File

@@ -0,0 +1,95 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary
type Country struct {
Id uint32 `json:"id"`
Name string `json:"name"`
Codes []string `json:"codes"`
}
type Province struct {
Id uint32 `json:"id"`
Name string `json:"name"`
Codes []string `json:"codes"`
}
type City struct {
Id uint32 `json:"id"`
Name string `json:"name"`
Codes []string `json:"codes"`
}
type Town struct {
Id uint32 `json:"id"`
Name string `json:"name"`
Codes []string `json:"codes"`
}
type Provider struct {
Id uint32 `json:"id"`
Name string `json:"name"`
Codes []string `json:"codes"`
}
type Meta struct {
Version int `json:"version"` // IP库版本
Code string `json:"code"` // 代号用来区分不同的IP库
Author string `json:"author"`
Countries []*Country `json:"countries"`
Provinces []*Province `json:"provinces"`
Cities []*City `json:"cities"`
Towns []*Town `json:"towns"`
Providers []*Provider `json:"providers"`
CreatedAt int64 `json:"createdAt"`
countryMap map[uint32]*Country // id => *Country
provinceMap map[uint32]*Province // id => *Province
cityMap map[uint32]*City // id => *City
townMap map[uint32]*Town // id => *Town
providerMap map[uint32]*Provider // id => *Provider
}
func (this *Meta) Init() {
this.countryMap = map[uint32]*Country{}
this.provinceMap = map[uint32]*Province{}
this.cityMap = map[uint32]*City{}
this.townMap = map[uint32]*Town{}
this.providerMap = map[uint32]*Provider{}
for _, country := range this.Countries {
this.countryMap[country.Id] = country
}
for _, province := range this.Provinces {
this.provinceMap[province.Id] = province
}
for _, city := range this.Cities {
this.cityMap[city.Id] = city
}
for _, town := range this.Towns {
this.townMap[town.Id] = town
}
for _, provider := range this.Providers {
this.providerMap[provider.Id] = provider
}
}
func (this *Meta) CountryWithId(countryId uint32) *Country {
return this.countryMap[countryId]
}
func (this *Meta) ProvinceWithId(provinceId uint32) *Province {
return this.provinceMap[provinceId]
}
func (this *Meta) CityWithId(cityId uint32) *City {
return this.cityMap[cityId]
}
func (this *Meta) TownWithId(townId uint32) *Town {
return this.townMap[townId]
}
func (this *Meta) ProviderWithId(providerId uint32) *Provider {
return this.providerMap[providerId]
}

View File

@@ -0,0 +1,3 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary_test

64
pkg/iplibrary/parser.go Normal file
View File

@@ -0,0 +1,64 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary
import (
"bytes"
"errors"
)
type Parser struct {
config *ParserConfig
data []byte
}
func NewParser(config *ParserConfig) (*Parser, error) {
if config == nil {
config = &ParserConfig{}
}
if config.Template == nil {
return nil, errors.New("template must not be nil")
}
return &Parser{
config: config,
}, nil
}
func (this *Parser) Write(data []byte) {
this.data = append(this.data, data...)
}
func (this *Parser) Parse() error {
if len(this.data) == 0 {
return nil
}
for {
var index = bytes.IndexByte(this.data, '\n')
if index >= 0 {
var line = this.data[:index+1]
values, found := this.config.Template.Extract(string(line), this.config.EmptyValues)
if found {
if this.config.Iterator != nil {
err := this.config.Iterator(values)
if err != nil {
return err
}
}
} else {
// 防止错误信息太长
if len(line) > 256 {
line = line[:256]
}
return errors.New("invalid line '" + string(line) + "'")
}
this.data = this.data[index+1:]
} else {
break
}
}
return nil
}

View File

@@ -0,0 +1,9 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary
type ParserConfig struct {
Template *Template
EmptyValues []string
Iterator func(values map[string]string) error
}

View File

@@ -0,0 +1,54 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary
import (
"errors"
"io"
)
type ReaderParser struct {
reader io.Reader
rawParser *Parser
}
func NewReaderParser(reader io.Reader, config *ParserConfig) (*ReaderParser, error) {
if config == nil {
config = &ParserConfig{}
}
if config.Template == nil {
return nil, errors.New("template must not be nil")
}
parser, err := NewParser(config)
if err != nil {
return nil, err
}
return &ReaderParser{
reader: reader,
rawParser: parser,
}, nil
}
func (this *ReaderParser) Parse() error {
var buf = make([]byte, 1024)
for {
n, err := this.reader.Read(buf)
if n > 0 {
this.rawParser.Write(buf[:n])
parseErr := this.rawParser.Parse()
if parseErr != nil {
return parseErr
}
}
if err != nil {
if err != io.EOF {
return err
}
break
}
}
return nil
}

View File

@@ -0,0 +1,62 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary_test
import (
"bytes"
"github.com/TeaOSLab/EdgeCommon/pkg/iplibrary"
"testing"
)
func TestNewReaderParser(t *testing.T) {
template, err := iplibrary.NewTemplate("${ipFrom}|${ipTo}|${country}|${any}|${province}|${city}|${provider}")
if err != nil {
t.Fatal(err)
}
var buf = &bytes.Buffer{}
buf.WriteString(`8.45.160.0|8.45.161.255|美国|0|华盛顿|西雅图|Level3
8.45.162.0|8.45.162.255|美国|0|马萨诸塞|0|Level3
8.45.163.0|8.45.164.255|美国|0|俄勒冈|0|Level3
8.45.165.0|8.45.165.255|美国|0|华盛顿|0|Level3
8.45.166.0|8.45.167.255|美国|0|华盛顿|西雅图|Level3
8.45.168.0|8.127.255.255|美国|0|0|0|Level3
8.128.0.0|8.128.3.255|中国|0|上海|上海市|阿里巴巴
8.128.4.0|8.128.255.255|中国|0|0|0|阿里巴巴
8.129.0.0|8.129.255.255|中国|0|广东省|深圳市|阿里云
8.130.0.0|8.130.55.255|中国|0|北京|北京市|阿里云
8.130.56.0|8.131.255.255|中国|0|北京|北京市|阿里巴巴
8.132.0.0|8.133.255.255|中国|0|上海|上海市|阿里巴巴
8.134.0.0|8.134.20.63|中国|0|0|0|阿里云
8.134.20.64|8.134.79.255|中国|0|广东省|深圳市|阿里云
8.134.80.0|8.191.255.255|中国|0|0|0|阿里巴巴
8.192.0.0|8.192.0.255|美国|0|0|0|Level3
8.192.1.0|8.192.1.255|美国|0|马萨诸塞|波士顿|Level3
8.192.2.0|8.207.255.255|美国|0|0|0|Level3
8.208.0.0|8.208.127.255|英国|0|伦敦|伦敦|阿里云
8.208.128.0|8.208.255.255|英国|0|伦敦|伦敦|阿里巴巴
8.209.0.0|8.209.15.255|俄罗斯|0|莫斯科|莫斯科|阿里云
8.209.16.0|8.209.31.255|俄罗斯|0|莫斯科|莫斯科|阿里巴巴
8.209.32.0|8.209.32.15|中国|0|台湾省|台北|阿里云
8.209.32.16|8.209.32.255|中国|0|台湾省|台北|阿里巴巴
8.209.33.0|8.209.34.255|中国|0|台湾省|台北|阿里云
8.209.35.0|8.209.35.255|中国|0|台湾省|台北|阿里巴巴`)
var count int
parser, err := iplibrary.NewReaderParser(buf, &iplibrary.ParserConfig{
Template: template,
EmptyValues: []string{"0"},
Iterator: func(values map[string]string) error {
count++
t.Log(count, values)
return nil
},
})
if err != nil {
t.Fatal(err)
}
err = parser.Parse()
if err != nil {
t.Fatal(err)
}
}

View File

@@ -0,0 +1,44 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary_test
import (
"github.com/TeaOSLab/EdgeCommon/pkg/iplibrary"
"testing"
)
func TestNewParser(t *testing.T) {
template, err := iplibrary.NewTemplate("${ipFrom}|${ipTo}|${country}|${any}|${province}|${city}|${provider}")
if err != nil {
t.Fatal(err)
}
parser, err := iplibrary.NewParser(&iplibrary.ParserConfig{
Template: template,
EmptyValues: []string{"0"},
Iterator: func(values map[string]string) error {
t.Log(values)
return nil
},
})
if err != nil {
t.Fatal(err)
}
parser.Write([]byte(`0.0.0.0|0.255.255.255|0|0|0|内网IP|内网IP
1.0.0.0|1.0.0.255|澳大利亚|0|0|0|0
1.0.1.0|1.0.3.255|中国|0|福建省|福州市|电信
1.0.4.0|1.0.7.255|澳大利亚|0|维多利亚|墨尔本|0
1.0.8.0|1.0.15.255|中国|0|广东省|广州市|电信
1.0.16.0|1.0.31.255|日本|0|0|0|0
1.0.32.0|1.0.63.255|中国|0|广东省|广州市|电信
1.0.64.0|1.0.79.255|日本|0|广岛县|0|0
1.0.80.0|1.0.127.255|日本|0|冈山县|0|0
1.0.128.0|1.0.128.255|泰国|0|清莱府|0|TOT
1.0.129.0|1.0.132.191|泰国|0|曼谷|曼谷|TOT`))
err = parser.Parse()
if err != nil {
t.Fatal(err)
}
}

233
pkg/iplibrary/reader.go Normal file
View File

@@ -0,0 +1,233 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary
import (
"bytes"
"encoding/json"
"errors"
"github.com/TeaOSLab/EdgeCommon/pkg/configutils"
"github.com/iwind/TeaGo/types"
"io"
"net"
"sort"
"strings"
)
type Reader struct {
meta *Meta
regionMap map[string]*ipRegion
ipV4Items []*ipItem
ipV6Items []*ipItem
}
func NewReader(reader io.Reader) (*Reader, error) {
var libReader = &Reader{
regionMap: map[string]*ipRegion{},
}
err := libReader.load(reader)
if err != nil {
return nil, err
}
return libReader, nil
}
func (this *Reader) load(reader io.Reader) error {
var buf = make([]byte, 1024)
var metaLine = []byte{}
var metaLineFound = false
var dataBuf = []byte{}
for {
n, err := reader.Read(buf)
if n > 0 {
var data = buf[:n]
dataBuf = append(dataBuf, data...)
if metaLineFound {
left, err := this.parse(dataBuf)
if err != nil {
return err
}
dataBuf = left
} else {
var index = bytes.IndexByte(dataBuf, '\n')
if index > 0 {
metaLine = dataBuf[:index]
dataBuf = dataBuf[index+1:]
metaLineFound = true
var meta = &Meta{}
err = json.Unmarshal(metaLine, &meta)
if err != nil {
return err
}
meta.Init()
this.meta = meta
left, err := this.parse(dataBuf)
if err != nil {
return err
}
dataBuf = left
}
}
}
if err != nil {
if err != io.EOF {
return err
}
break
}
}
sort.Slice(this.ipV4Items, func(i, j int) bool {
var from0 = this.ipV4Items[i].IPFrom
var to0 = this.ipV4Items[i].IPTo
var from1 = this.ipV4Items[j].IPFrom
var to1 = this.ipV4Items[j].IPTo
if from0 == from1 {
return to0 < to1
}
return from0 < from1
})
sort.Slice(this.ipV6Items, func(i, j int) bool {
var from0 = this.ipV6Items[i].IPFrom
var to0 = this.ipV6Items[i].IPTo
var from1 = this.ipV6Items[j].IPFrom
var to1 = this.ipV6Items[j].IPTo
if from0 == from1 {
return to0 < to1
}
return from0 < from1
})
return nil
}
func (this *Reader) Lookup(ip net.IP) *QueryResult {
if ip == nil {
return &QueryResult{}
}
var ipLong = configutils.IP2Long(ip)
var isV4 = configutils.IsIPv4(ip)
var resultItem *ipItem
if isV4 {
sort.Search(len(this.ipV4Items), func(i int) bool {
var item = this.ipV4Items[i]
if item.IPFrom <= ipLong {
if item.IPTo >= ipLong {
resultItem = item
return false
}
return false
}
return true
})
} else {
sort.Search(len(this.ipV6Items), func(i int) bool {
var item = this.ipV6Items[i]
if item.IPFrom <= ipLong {
if item.IPTo >= ipLong {
resultItem = item
return false
}
return false
}
return true
})
}
return &QueryResult{
item: resultItem,
meta: this.meta,
}
}
func (this *Reader) Meta() *Meta {
return this.meta
}
func (this *Reader) IPv4Items() []*ipItem {
return this.ipV4Items
}
func (this *Reader) IPv6Items() []*ipItem {
return this.ipV6Items
}
func (this *Reader) parse(data []byte) (left []byte, err error) {
if len(data) == 0 {
return
}
for {
var index = bytes.IndexByte(data, '\n')
if index >= 0 {
var line = data[:index]
var pieces = strings.Split(string(line), "|")
if len(pieces) != 8 {
return nil, errors.New("invalid ip definition '" + string(line) + "'")
}
var version = pieces[0]
if len(version) == 0 {
version = "4"
}
if version != "4" && version != "6" {
return nil, errors.New("invalid ip version '" + string(line) + "'")
}
var ipFrom uint64
var ipTo uint64
if len(pieces[2]) == 0 {
pieces[2] = pieces[1]
ipFrom = types.Uint64(pieces[1])
ipTo = types.Uint64(pieces[2])
} else {
ipFrom = types.Uint64(pieces[1])
ipTo = types.Uint64(pieces[2]) + ipFrom
}
var countryId = types.Uint32(pieces[3])
var provinceId = types.Uint32(pieces[4])
var cityId = types.Uint32(pieces[5])
var townId = types.Uint32(pieces[6])
var providerId = types.Uint32(pieces[7])
var hash = HashRegion(countryId, provinceId, cityId, townId, providerId)
region, ok := this.regionMap[hash]
if !ok {
region = &ipRegion{
CountryId: countryId,
ProvinceId: provinceId,
CityId: cityId,
TownId: townId,
ProviderId: providerId,
}
this.regionMap[hash] = region
}
if version == "4" {
this.ipV4Items = append(this.ipV4Items, &ipItem{
IPFrom: ipFrom,
IPTo: ipTo,
Region: region,
})
} else {
this.ipV6Items = append(this.ipV6Items, &ipItem{
IPFrom: ipFrom,
IPTo: ipTo,
Region: region,
})
}
data = data[index+1:]
} else {
left = data
break
}
}
return
}

View File

@@ -0,0 +1,55 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary
import (
"compress/gzip"
"errors"
"io"
"net"
"os"
)
type FileReader struct {
rawReader *Reader
}
func NewFileReader(path string) (*FileReader, error) {
fp, err := os.Open(path)
if err != nil {
return nil, err
}
defer func() {
_ = fp.Close()
}()
return NewFileDataReader(fp)
}
func NewFileDataReader(dataReader io.Reader) (*FileReader, error) {
gzReader, err := gzip.NewReader(dataReader)
if err != nil {
return nil, errors.New("create gzip reader failed: " + err.Error())
}
reader, err := NewReader(gzReader)
if err != nil {
return nil, err
}
return &FileReader{
rawReader: reader,
}, nil
}
func (this *FileReader) Meta() *Meta {
return this.rawReader.meta
}
func (this *FileReader) Lookup(ip net.IP) *QueryResult {
return this.rawReader.Lookup(ip)
}
func (this *FileReader) RawReader() *Reader {
return this.rawReader
}

View File

@@ -0,0 +1,51 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary_test
import (
"encoding/json"
"github.com/TeaOSLab/EdgeCommon/pkg/iplibrary"
"github.com/iwind/TeaGo/maps"
"net"
"testing"
)
func TestNewFileReader(t *testing.T) {
reader, err := iplibrary.NewFileReader("./ip")
if err != nil {
t.Fatal(err)
}
for _, ip := range []string{
"127.0.0.1",
"192.168.0.1",
"192.168.0.150",
"8.8.8.8",
"111.197.165.199",
"175.178.206.125",
} {
var result = reader.Lookup(net.ParseIP(ip))
if result.IsOk() {
var data = maps.Map{
"countryId": result.CountryId(),
"countryName": result.CountryName(),
"provinceId": result.ProvinceId(),
"provinceName": result.ProvinceName(),
"cityId": result.CityId(),
"cityName": result.CityName(),
"townId": result.TownId(),
"townName": result.TownName(),
"providerId": result.ProviderId(),
"providerName": result.ProviderName(),
"summary": result.Summary(),
}
dataJSON, err := json.MarshalIndent(data, "", " ")
if err != nil {
t.Fatal(err)
}
t.Log(ip, "=>", string(dataJSON))
} else {
t.Log(ip+":", "not found")
}
}
}

View File

@@ -0,0 +1,191 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary
import (
"github.com/iwind/TeaGo/lists"
"strings"
)
type QueryResult struct {
item *ipItem
meta *Meta
}
func (this *QueryResult) IsOk() bool {
return this.item != nil
}
func (this *QueryResult) CountryId() int64 {
if this.item != nil {
return int64(this.item.Region.CountryId)
}
return 0
}
func (this *QueryResult) CountryName() string {
if this.item == nil {
return ""
}
if this.item.Region.CountryId > 0 {
var country = this.meta.CountryWithId(this.item.Region.CountryId)
if country != nil {
return country.Name
}
}
return ""
}
func (this *QueryResult) CountryCodes() []string {
if this.item == nil {
return nil
}
if this.item.Region.CountryId > 0 {
var country = this.meta.CountryWithId(this.item.Region.CountryId)
if country != nil {
return country.Codes
}
}
return nil
}
func (this *QueryResult) ProvinceId() int64 {
if this.item != nil {
return int64(this.item.Region.ProvinceId)
}
return 0
}
func (this *QueryResult) ProvinceName() string {
if this.item == nil {
return ""
}
if this.item.Region.ProvinceId > 0 {
var province = this.meta.ProvinceWithId(this.item.Region.ProvinceId)
if province != nil {
return province.Name
}
}
return ""
}
func (this *QueryResult) ProvinceCodes() []string {
if this.item == nil {
return nil
}
if this.item.Region.ProvinceId > 0 {
var province = this.meta.ProvinceWithId(this.item.Region.ProvinceId)
if province != nil {
return province.Codes
}
}
return nil
}
func (this *QueryResult) CityId() int64 {
if this.item != nil {
return int64(this.item.Region.CityId)
}
return 0
}
func (this *QueryResult) CityName() string {
if this.item == nil {
return ""
}
if this.item.Region.CityId > 0 {
var city = this.meta.CityWithId(this.item.Region.CityId)
if city != nil {
return city.Name
}
}
return ""
}
func (this *QueryResult) TownId() int64 {
if this.item != nil {
return int64(this.item.Region.TownId)
}
return 0
}
func (this *QueryResult) TownName() string {
if this.item == nil {
return ""
}
if this.item.Region.TownId > 0 {
var town = this.meta.TownWithId(this.item.Region.TownId)
if town != nil {
return town.Name
}
}
return ""
}
func (this *QueryResult) ProviderId() int64 {
if this.item != nil {
return int64(this.item.Region.ProviderId)
}
return 0
}
func (this *QueryResult) ProviderName() string {
if this.item == nil {
return ""
}
if this.item.Region.ProviderId > 0 {
var provider = this.meta.ProviderWithId(this.item.Region.ProviderId)
if provider != nil {
return provider.Name
}
}
return ""
}
func (this *QueryResult) ProviderCodes() []string {
if this.item == nil {
return nil
}
if this.item.Region.ProviderId > 0 {
var provider = this.meta.ProviderWithId(this.item.Region.ProviderId)
if provider != nil {
return provider.Codes
}
}
return nil
}
func (this *QueryResult) Summary() string {
if this.item == nil {
return ""
}
var pieces = []string{}
var countryName = this.CountryName()
var provinceName = this.ProvinceName()
var cityName = this.CityName()
var townName = this.TownName()
var providerName = this.ProviderName()
if len(countryName) > 0 {
pieces = append(pieces, countryName)
}
if len(provinceName) > 0 && !lists.ContainsString(pieces, provinceName) {
pieces = append(pieces, provinceName)
}
if len(cityName) > 0 && !lists.ContainsString(pieces, cityName) && !lists.ContainsString(pieces, strings.TrimSuffix(cityName, "市")) {
pieces = append(pieces, cityName)
}
if len(townName) > 0 && !lists.ContainsString(pieces, townName) && !lists.ContainsString(pieces, strings.TrimSuffix(townName, "县")) {
pieces = append(pieces, cityName)
}
if len(providerName) > 0 && !lists.ContainsString(pieces, providerName) {
if len(pieces) > 0 {
pieces = append(pieces, "|")
}
pieces = append(pieces, providerName)
}
return strings.Join(pieces, " ")
}

View File

@@ -0,0 +1,149 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary_test
import (
"bytes"
"github.com/TeaOSLab/EdgeCommon/pkg/iplibrary"
"github.com/iwind/TeaGo/rands"
"github.com/iwind/TeaGo/types"
timeutil "github.com/iwind/TeaGo/utils/time"
"net"
"runtime"
"testing"
"time"
)
func TestNewReader(t *testing.T) {
var buf = &bytes.Buffer{}
var writer = iplibrary.NewWriter(buf, &iplibrary.Meta{
Author: "GoEdge <https://goedge.cn>",
})
err := writer.WriteMeta()
if err != nil {
t.Fatal(err)
}
err = writer.Write("192.168.1.100", "192.168.1.100", 1, 200, 300, 400, 500)
if err != nil {
t.Fatal(err)
}
err = writer.Write("192.168.2.100", "192.168.3.100", 2, 201, 301, 401, 501)
if err != nil {
t.Fatal(err)
}
err = writer.Write("192.168.3.101", "192.168.3.101", 3, 201, 301, 401, 501)
if err != nil {
t.Fatal(err)
}
err = writer.Write("192.168.0.101", "192.168.0.200", 4, 201, 301, 401, 501)
if err != nil {
t.Fatal(err)
}
err = writer.Write("::1", "::5", 5, 201, 301, 401, 501)
if err != nil {
t.Fatal(err)
}
/**var n = func() string {
return types.String(rands.Int(0, 255))
}
for i := 0; i < 1_000_000; i++ {
err = writer.Write(n()+"."+n()+"."+n()+"."+n(), n()+"."+n()+"."+n()+"."+n(), int64(i)+100, 201, 301, 401, 501)
if err != nil {
t.Fatal(err)
}
}**/
var stat = &runtime.MemStats{}
runtime.ReadMemStats(stat)
reader, err := iplibrary.NewReader(buf)
var stat2 = &runtime.MemStats{}
runtime.ReadMemStats(stat2)
t.Log((stat2.Alloc-stat.Alloc)/1024/1024, "M")
if err != nil {
t.Fatal(err)
}
t.Log("version:", reader.Meta().Version, "author:", reader.Meta().Author, "createdTime:", timeutil.FormatTime("Y-m-d H:i:s", reader.Meta().CreatedAt))
if len(reader.IPv4Items()) < 10 {
t.Log("===")
for _, item := range reader.IPv4Items() {
t.Logf("%+v", item)
}
t.Log("===")
}
if len(reader.IPv6Items()) < 10 {
t.Log("===")
for _, item := range reader.IPv6Items() {
t.Logf("%+v", item)
}
t.Log("===")
}
var before = time.Now()
for _, ip := range []string{
"192.168.0.1",
"192.168.0.150",
"192.168.1.100",
"192.168.2.100",
"192.168.3.50",
"192.168.0.150",
"192.168.4.80",
"::3",
"::8",
} {
var result = reader.Lookup(net.ParseIP(ip))
if result.IsOk() {
t.Log(ip+":", "countryId:", result.CountryId())
} else {
t.Log(ip+":", "not found")
}
}
t.Log(time.Since(before).Seconds()*1000, "ms")
}
func BenchmarkNewReader(b *testing.B) {
runtime.GOMAXPROCS(1)
var buf = &bytes.Buffer{}
var writer = iplibrary.NewWriter(buf, &iplibrary.Meta{
Author: "GoEdge <https://goedge.cn>",
})
err := writer.WriteMeta()
if err != nil {
b.Fatal(err)
}
var n = func() string {
return types.String(rands.Int(0, 255))
}
for i := 0; i < 1_000_000; i++ {
err = writer.Write(n()+"."+n()+"."+n()+"."+n(), n()+"."+n()+"."+n()+"."+n(), int64(i)+100, 201, 301, 401, 501)
if err != nil {
b.Fatal(err)
}
}
reader, err := iplibrary.NewReader(buf)
if err != nil {
b.Fatal(err)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
var ip = "192.168.1.100"
reader.Lookup(net.ParseIP(ip))
}
}

75
pkg/iplibrary/template.go Normal file
View File

@@ -0,0 +1,75 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary
import (
"github.com/iwind/TeaGo/lists"
"regexp"
)
type Template struct {
templateString string
reg *regexp.Regexp
}
func NewTemplate(templateString string) (*Template, error) {
var t = &Template{
templateString: templateString,
}
err := t.init()
if err != nil {
return nil, err
}
return t, nil
}
func (this *Template) init() error {
var template = regexp.QuoteMeta(this.templateString)
var keywordReg = regexp.MustCompile(`\\\$\\{(\w+)\\}`)
template = keywordReg.ReplaceAllStringFunc(template, func(keyword string) string {
var matches = keywordReg.FindStringSubmatch(keyword)
if len(matches) > 1 {
switch matches[1] {
case "ipFrom", "ipTo", "country", "province", "city", "town", "provider":
return "(?P<" + matches[1] + ">.*)"
}
return ".*"
}
return keyword
})
reg, err := regexp.Compile(template)
if err != nil {
return err
}
this.reg = reg
return nil
}
func (this *Template) Extract(text string, emptyValues []string) (values map[string]string, ok bool) {
var matches = this.reg.FindStringSubmatch(text)
if len(matches) == 0 {
return
}
values = map[string]string{}
for index, name := range this.reg.SubexpNames() {
if len(name) == 0 {
continue
}
var v = matches[index]
if name != "ipFrom" && name != "ipTo" && (v == "0" || v == "无" || v == "空" || lists.ContainsString(emptyValues, v)) {
v = ""
}
values[name] = v
}
for _, keyword := range []string{"ipFrom", "ipTo", "country", "province", "city", "town", "provider"} {
_, hasKeyword := values[keyword]
if !hasKeyword {
values[keyword] = ""
}
}
ok = true
return
}

View File

@@ -0,0 +1,25 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary_test
import (
"github.com/TeaOSLab/EdgeCommon/pkg/iplibrary"
"testing"
)
func TestNewTemplate(t *testing.T) {
template, err := iplibrary.NewTemplate("${ipFrom}|${ipTo}|${country}|${any}|${province}|${city}|${provider}")
if err != nil {
t.Fatal(err)
}
for _, s := range []string{
"42.0.32.0|42.0.63.255|中国|0|广东省|广州市|电信",
"42.0.32.0|42.0.63.255|中国|0|广东省|广州市|电信\n123",
"42.0.32.0|42.0.63.255|中国||广东省|广州市|电信",
"42.0.32.0|42.0.63.255|中国|0||广州市|电信",
"42.0.32.0|42.0.63.255|中国|0|广东省|广州市",
} {
values, _ := template.Extract(s, []string{})
t.Log(s, "=>\n", values)
}
}

268
pkg/iplibrary/updater.go Normal file
View File

@@ -0,0 +1,268 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary
import (
"errors"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"io"
"os"
"strings"
"time"
)
type UpdaterSource interface {
// DataDir 文件目录
DataDir() string
// FindLatestFile 检查最新的IP库文件
FindLatestFile() (code string, fileId int64, err error)
// DownloadFile 下载文件
DownloadFile(fileId int64, writer io.Writer) error
// LogInfo 普通日志
LogInfo(message string)
// LogError 错误日志
LogError(err error)
}
type Updater struct {
source UpdaterSource
currentCode string
ticker *time.Ticker
isUpdating bool
}
func NewUpdater(source UpdaterSource, interval time.Duration) *Updater {
return &Updater{
source: source,
ticker: time.NewTicker(interval),
}
}
func (this *Updater) Start() {
// 初始化
err := this.Init()
if err != nil {
this.source.LogError(err)
}
// 先运行一次
err = this.Loop()
if err != nil {
this.source.LogError(err)
}
// 开始定时运行
for range this.ticker.C {
err = this.Loop()
if err != nil {
this.source.LogError(err)
}
}
}
func (this *Updater) Init() error {
// 检查当前正在使用的IP库
var path = this.source.DataDir() + "/ip-library.db"
fp, err := os.Open(path)
if err != nil {
if os.IsNotExist(err) {
return nil
}
return errors.New("read ip library file failed '" + err.Error() + "'")
}
defer func() {
_ = fp.Close()
}()
return this.loadFile(fp)
}
func (this *Updater) Loop() error {
if this.isUpdating {
return nil
}
this.isUpdating = true
defer func() {
this.isUpdating = false
}()
code, fileId, err := this.source.FindLatestFile()
if err != nil {
// 不提示连接错误
if this.isConnError(err) {
return nil
}
return err
}
if len(code) == 0 || fileId <= 0 {
// 还原到内置IP库
if len(this.currentCode) > 0 {
this.currentCode = ""
this.source.LogInfo("resetting to default ip library ...")
var defaultPath = this.source.DataDir() + "/ip-library.db"
_, err = os.Stat(defaultPath)
if err == nil {
err = os.Remove(defaultPath)
if err != nil {
this.source.LogError(errors.New("can not remove default 'ip-library.db'"))
}
}
err = InitDefault()
if err != nil {
this.source.LogError(errors.New("initialize default ip library failed: " + err.Error()))
}
}
return nil
}
// 下载
if this.currentCode == code {
// 不再重复下载
return nil
}
// 检查是否存在
var dir = this.source.DataDir()
var path = dir + "/ip-" + code + ".db"
stat, err := os.Stat(path)
if err == nil && !stat.IsDir() && stat.Size() > 0 {
fp, err := os.Open(path)
if err != nil {
return err
}
defer func() {
_ = fp.Close()
}()
err = this.loadFile(fp)
if err != nil {
// 尝试删除
_ = os.Remove(path)
} else {
this.currentCode = code
// 拷贝到 ip-library.db
err = this.createDefaultFile(path, dir)
if err != nil {
this.source.LogError(err)
}
}
return err
}
// write to file
fp, err := os.OpenFile(path, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0666)
if err != nil {
return errors.New("create ip library file failed: " + err.Error())
}
var isOk = false
defer func() {
if !isOk {
_ = os.Remove(path)
}
}()
err = this.source.DownloadFile(fileId, fp)
if err != nil {
_ = fp.Close()
return err
}
err = fp.Close()
if err != nil {
return nil
}
// load library from file
fp, err = os.Open(path)
if err != nil {
return nil
}
err = this.loadFile(fp)
_ = fp.Close()
if err != nil {
return errors.New("load file failed: " + err.Error())
}
isOk = true
this.currentCode = code
// 拷贝到 ip-library.db
err = this.createDefaultFile(path, dir)
if err != nil {
this.source.LogError(err)
}
return nil
}
func (this *Updater) loadFile(fp *os.File) error {
this.source.LogInfo("load ip library from '" + fp.Name() + "' ...")
fileReader, err := NewFileDataReader(fp)
if err != nil {
return errors.New("load ip library from reader failed: " + err.Error())
}
var reader = fileReader.RawReader()
defaultLibrary = NewIPLibraryWithReader(reader)
this.currentCode = reader.Meta().Code
return nil
}
func (this *Updater) createDefaultFile(sourcePath string, dir string) error {
sourceFp, err := os.Open(sourcePath)
if err != nil {
return errors.New("prepare to copy file to 'ip-library.db' failed: " + err.Error())
}
defer func() {
_ = sourceFp.Close()
}()
dstFp, err := os.Create(dir + "/ip-library.db")
if err != nil {
return errors.New("prepare to copy file to 'ip-library.db' failed: " + err.Error())
}
defer func() {
_ = dstFp.Close()
}()
_, err = io.Copy(dstFp, sourceFp)
if err != nil {
return errors.New("copy file to 'ip-library.db' failed: " + err.Error())
}
return nil
}
// isConnError 是否为连接错误
func (this *Updater) isConnError(err error) bool {
if err == nil {
return false
}
// 检查是否为连接错误
statusErr, ok := status.FromError(err)
if ok {
var errorCode = statusErr.Code()
return errorCode == codes.Unavailable || errorCode == codes.Canceled
}
if strings.Contains(err.Error(), "code = Canceled") {
return true
}
return false
}

View File

@@ -0,0 +1,53 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary_test
import (
"github.com/TeaOSLab/EdgeCommon/pkg/iplibrary"
"github.com/iwind/TeaGo/Tea"
_ "github.com/iwind/TeaGo/bootstrap"
"io"
"testing"
"time"
)
type updaterSource struct {
t *testing.T
}
func (this *updaterSource) DataDir() string {
return Tea.Root + "/data"
}
func (this *updaterSource) FindLatestFile() (code string, fileId int64, err error) {
return "CODE", 1, nil
}
func (this *updaterSource) DownloadFile(fileId int64, writer io.Writer) error {
this.t.Log("downloading file:", fileId, "writer:", writer)
_, err := writer.Write(iplibrary.DefaultIPLibraryData())
return err
}
func (this *updaterSource) LogInfo(message string) {
this.t.Log(message)
}
func (this *updaterSource) LogError(err error) {
this.t.Fatal(err)
}
func TestNewUpdater(t *testing.T) {
var updater = iplibrary.NewUpdater(&updaterSource{
t: t,
}, 1*time.Minute)
err := updater.Init()
if err != nil {
t.Fatal(err)
}
err = updater.Loop()
if err != nil {
t.Fatal(err)
}
}

9
pkg/iplibrary/version.go Normal file
View File

@@ -0,0 +1,9 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary
type Version = int
const (
Version1 Version = 1
)

161
pkg/iplibrary/writer.go Normal file
View File

@@ -0,0 +1,161 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary
import (
"crypto/md5"
"encoding/json"
"errors"
"fmt"
"github.com/TeaOSLab/EdgeCommon/pkg/configutils"
"github.com/iwind/TeaGo/types"
"hash"
"io"
"net"
"strings"
"time"
)
type hashWriter struct {
rawWriter io.Writer
hash hash.Hash
}
func newHashWriter(writer io.Writer) *hashWriter {
return &hashWriter{
rawWriter: writer,
hash: md5.New(),
}
}
func (this *hashWriter) Write(p []byte) (n int, err error) {
n, err = this.rawWriter.Write(p)
this.hash.Write(p)
return
}
func (this *hashWriter) Sum() string {
return fmt.Sprintf("%x", this.hash.Sum(nil))
}
type Writer struct {
writer *hashWriter
meta *Meta
}
func NewWriter(writer io.Writer, meta *Meta) *Writer {
if meta == nil {
meta = &Meta{}
}
meta.Version = Version1
meta.CreatedAt = time.Now().Unix()
var libWriter = &Writer{
writer: newHashWriter(writer),
meta: meta,
}
return libWriter
}
func (this *Writer) WriteMeta() error {
metaJSON, err := json.Marshal(this.meta)
if err != nil {
return err
}
_, err = this.writer.Write(metaJSON)
if err != nil {
return err
}
_, err = this.writer.Write([]byte("\n"))
return err
}
func (this *Writer) Write(ipFrom string, ipTo string, countryId int64, provinceId int64, cityId int64, townId int64, providerId int64) error {
// validate IP
var fromIP = net.ParseIP(ipFrom)
if fromIP == nil {
return errors.New("invalid 'ipFrom': '" + ipFrom + "'")
}
var fromIsIPv4 = configutils.IsIPv4(fromIP)
var toIP = net.ParseIP(ipTo)
if toIP == nil {
return errors.New("invalid 'ipTo': " + ipTo)
}
var toIsIPv4 = configutils.IsIPv4(toIP)
if fromIsIPv4 != toIsIPv4 {
return errors.New("'ipFrom(" + ipFrom + ")' and 'ipTo(" + ipTo + ")' should have the same IP version")
}
var pieces = []string{}
// 0
if fromIsIPv4 {
pieces = append(pieces, "")
} else {
pieces = append(pieces, "6")
}
// 1
var fromIPLong = configutils.IP2Long(fromIP)
var toIPLong = configutils.IP2Long(toIP)
if toIPLong < fromIPLong {
fromIPLong, toIPLong = toIPLong, fromIPLong
}
pieces = append(pieces, types.String(fromIPLong))
if ipFrom == ipTo {
// 2
pieces = append(pieces, "")
} else {
// 2
pieces = append(pieces, types.String(toIPLong-fromIPLong))
}
// 3
if countryId > 0 {
pieces = append(pieces, types.String(countryId))
} else {
pieces = append(pieces, "")
}
// 4
if provinceId > 0 {
pieces = append(pieces, types.String(provinceId))
} else {
pieces = append(pieces, "")
}
// 5
if cityId > 0 {
pieces = append(pieces, types.String(cityId))
} else {
pieces = append(pieces, "")
}
// 6
if townId > 0 {
pieces = append(pieces, types.String(townId))
} else {
pieces = append(pieces, "")
}
// 7
if providerId > 0 {
pieces = append(pieces, types.String(providerId))
} else {
pieces = append(pieces, "")
}
_, err := this.writer.Write([]byte(strings.Join(pieces, "|")))
if err != nil {
return err
}
_, err = this.writer.Write([]byte("\n"))
return err
}
func (this *Writer) Sum() string {
return this.writer.Sum()
}

View File

@@ -0,0 +1,58 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary
import (
"compress/gzip"
"os"
)
type FileWriter struct {
fp *os.File
gzWriter *gzip.Writer
rawWriter *Writer
}
func NewFileWriter(path string, meta *Meta) (*FileWriter, error) {
fp, err := os.OpenFile(path, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0666)
if err != nil {
return nil, err
}
gzWriter, err := gzip.NewWriterLevel(fp, gzip.BestCompression)
if err != nil {
return nil, err
}
var writer = &FileWriter{
fp: fp,
gzWriter: gzWriter,
rawWriter: NewWriter(gzWriter, meta),
}
return writer, nil
}
func (this *FileWriter) WriteMeta() error {
return this.rawWriter.WriteMeta()
}
func (this *FileWriter) Write(ipFrom string, ipTo string, countryId int64, provinceId int64, cityId int64, townId int64, providerId int64) error {
return this.rawWriter.Write(ipFrom, ipTo, countryId, provinceId, cityId, townId, providerId)
}
func (this *FileWriter) Sum() string {
return this.rawWriter.Sum()
}
func (this *FileWriter) Close() error {
err1 := this.gzWriter.Close()
err2 := this.fp.Close()
if err1 != nil {
return err1
}
if err2 != nil {
return err2
}
return nil
}

View File

@@ -0,0 +1,56 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary_test
import (
"github.com/TeaOSLab/EdgeCommon/pkg/iplibrary"
"github.com/iwind/TeaGo/rands"
"github.com/iwind/TeaGo/types"
"testing"
)
func TestNewFileWriter(t *testing.T) {
writer, err := iplibrary.NewFileWriter("./internal-ip-library.db", &iplibrary.Meta{
Author: "GoEdge",
})
if err != nil {
t.Fatal(err)
}
err = writer.WriteMeta()
if err != nil {
t.Fatal(err)
}
err = writer.Write("192.168.1.100", "192.168.1.100", 100, 200, 300, 400, 500)
if err != nil {
t.Fatal(err)
}
err = writer.Write("192.168.2.100", "192.168.3.100", 101, 201, 301, 401, 501)
if err != nil {
t.Fatal(err)
}
err = writer.Write("192.168.3.101", "192.168.3.101", 101, 201, 301, 401, 501)
if err != nil {
t.Fatal(err)
}
var n = func() string {
return types.String(rands.Int(0, 255))
}
for i := 0; i < 1_000_000; i++ {
err = writer.Write(n()+"."+n()+"."+n()+"."+n(), n()+"."+n()+"."+n()+"."+n(), int64(i)+100, 201, 301, 401, 501)
if err != nil {
t.Fatal(err)
}
}
err = writer.Close()
if err != nil {
t.Fatal(err)
}
t.Log("ok", writer.Sum())
}

View File

@@ -0,0 +1,44 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package iplibrary_test
import (
"bytes"
"github.com/TeaOSLab/EdgeCommon/pkg/iplibrary"
"testing"
)
func TestNewWriter(t *testing.T) {
var buf = &bytes.Buffer{}
var writer = iplibrary.NewWriter(buf, &iplibrary.Meta{
Author: "GoEdge <https://goedge.cn>",
})
err := writer.WriteMeta()
if err != nil {
t.Fatal(err)
}
err = writer.Write("192.168.1.100", "192.168.1.100", 100, 200, 300, 400, 500)
if err != nil {
t.Fatal(err)
}
err = writer.Write("192.168.2.100", "192.168.3.100", 101, 201, 301, 401, 501)
if err != nil {
t.Fatal(err)
}
err = writer.Write("192.168.3.101", "192.168.3.101", 101, 201, 301, 401, 501)
if err != nil {
t.Fatal(err)
}
err = writer.Write("::1", "::2", 101, 201, 301, 401, 501)
if err != nil {
t.Fatal(err)
}
t.Log(buf.String())
t.Log("sum:", writer.Sum())
}

View File

@@ -0,0 +1,22 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package nodeconfigs
func DefaultClockConfig() *ClockConfig {
return &ClockConfig{
AutoSync: true,
Server: "",
CheckChrony: true,
}
}
// ClockConfig 时钟相关配置
type ClockConfig struct {
AutoSync bool `yaml:"autoSync" json:"autoSync"` // 自动尝试同步时钟
Server string `yaml:"server" json:"server"` // 时钟同步服务器
CheckChrony bool `yaml:"checkChrony" json:"checkChrony"` // 检查 chronyd 是否在运行
}
func (this *ClockConfig) Init() error {
return nil
}

View File

@@ -12,19 +12,26 @@ const (
DefaultMaxThreadsMin = 1000 // 单节点最大线程数最小值
DefaultMaxThreadsMax = 100_000 // 单节点最大线程数最大值
DefaultTCPMaxConnections = 100_000 // 单节点TCP最大连接数
DefaultTCPMaxConnectionsPerIP = 1000 // 单IP最大连接数
DefaultTCPMinConnectionsPerIP = 5 // 单IP最小连接数
DefaultTCPNewConnectionsRate = 500 // 单IP连接速率限制按分钟
DefaultTCPNewConnectionsMinRate = 5 // 单IP最小连接速率
DefaultTCPLinger = 3 // 单节点TCP Linger值
DefaultTLSHandshakeTimeout = 3 // TLS握手超时时间
DefaultTCPMaxConnections = 100_000 // 单节点TCP最大连接数
DefaultTCPMaxConnectionsPerIP = 1000 // 单IP最大连接数
DefaultTCPMinConnectionsPerIP = 5 // 单IP最小连接数
DefaultTCPNewConnectionsMinutelyRate = 500 // 单IP连接速率限制(按分钟)
DefaultTCPNewConnectionsMinMinutelyRate = 3 // 单IP最小连接速率
DefaultTCPNewConnectionsSecondlyRate = 300 // 单IP连接速率限制按秒
DefaultTCPNewConnectionsMinSecondlyRate = 3 // 单IP最小连接速率
DefaultTCPLinger = 3 // 单节点TCP Linger值
DefaultTLSHandshakeTimeout = 3 // TLS握手超时时间
)
var DefaultConfigs = maps.Map{
"tcpMaxConnections": DefaultTCPMaxConnections,
"tcpMaxConnectionsPerIP": DefaultTCPMaxConnectionsPerIP,
"tcpMinConnectionsPerIP": DefaultTCPMinConnectionsPerIP,
"tcpNewConnectionsRate": DefaultTCPNewConnectionsRate,
"tcpNewConnectionsMinRate": DefaultTCPNewConnectionsMinRate,
"tcpMaxConnections": DefaultTCPMaxConnections,
"tcpMaxConnectionsPerIP": DefaultTCPMaxConnectionsPerIP,
"tcpMinConnectionsPerIP": DefaultTCPMinConnectionsPerIP,
"tcpNewConnectionsMinutelyRate": DefaultTCPNewConnectionsMinutelyRate,
"tcpNewConnectionsMinMinutelyRate": DefaultTCPNewConnectionsMinMinutelyRate,
"tcpNewConnectionsSecondlyRate": DefaultTCPNewConnectionsSecondlyRate,
"tcpNewConnectionsMinSecondlyRate": DefaultTCPNewConnectionsMinSecondlyRate,
}

View File

@@ -11,7 +11,7 @@ import (
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
"github.com/iwind/TeaGo/Tea"
"github.com/iwind/TeaGo/maps"
"io/ioutil"
"os"
"reflect"
"strconv"
)
@@ -42,29 +42,38 @@ type NodeConfig struct {
OCSPVersion int64 `yaml:"ocspVersion" json:"ocspVersion"`
// 性能
MaxCPU int32 `yaml:"maxCPU" json:"maxCPU"`
CacheDiskDir string `yaml:"cacheDiskDir" json:"cacheDiskDir"` // 文件缓存目录
MaxCacheDiskCapacity *shared.SizeCapacity `yaml:"maxCacheDiskCapacity" json:"maxCacheDiskCapacity"` // 文件缓存容量
MaxCPU int32 `yaml:"maxCPU" json:"maxCPU"`
APINodeAddrs []*serverconfigs.NetworkAddressConfig `yaml:"apiNodeAddrs" json:"apiNodeAddrs"`
CacheDiskDir string `yaml:"cacheDiskDir" json:"cacheDiskDir"` // 文件缓存目录
MaxCacheDiskCapacity *shared.SizeCapacity `yaml:"maxCacheDiskCapacity" json:"maxCacheDiskCapacity"` // 文件缓存容量
CacheDiskSubDirs []*serverconfigs.CacheDir `yaml:"cacheDiskSubDirs" json:"cacheDiskSubDirs"` // 其余缓存目录
MaxCacheMemoryCapacity *shared.SizeCapacity `yaml:"maxCacheMemoryCapacity" json:"maxCacheMemoryCapacity"` // 内容缓存容量
MaxThreads int `yaml:"maxThreads" json:"maxThreads"` // 最大线程数
DDOSProtection *ddosconfigs.ProtectionConfig `yaml:"ddosProtection" json:"ddosProtection"`
DDoSProtection *ddosconfigs.ProtectionConfig `yaml:"ddosProtection" json:"ddosProtection"` // DDoS防护
EnableIPLists bool `yaml:"enableIPLists" json:"enableIPLists"` // 启用IP名单
// 级别
Level int32 `yaml:"level" json:"level"`
ParentNodes map[int64][]*ParentNodeConfig `yaml:"parentNodes" json:"parentNodes"` // clusterId => []*ParentNodeConfig
// 全局配置
GlobalConfig *serverconfigs.GlobalConfig `yaml:"globalConfig" json:"globalConfig"` // 全局配置
ProductConfig *ProductConfig `yaml:"productConfig" json:"productConfig"`
GlobalConfig *serverconfigs.GlobalConfig `yaml:"globalConfig" json:"globalConfig"` // 全局配置
GlobalServerConfig *serverconfigs.GlobalServerConfig `yaml:"globalServerConfig" json:"globalServerConfig"` // 服务全局配置,用来替代 GlobalConfig
ProductConfig *ProductConfig `yaml:"productConfig" json:"productConfig"`
// 集群统一配置
HTTPFirewallPolicies []*firewallconfigs.HTTPFirewallPolicy `yaml:"httpFirewallPolicies" json:"httpFirewallPolicies"`
HTTPCachePolicies []*serverconfigs.HTTPCachePolicy `yaml:"httpCachePolicies" json:"httpCachePolicies"`
TOA *TOAConfig `yaml:"toa" json:"toa"`
SystemServices map[string]maps.Map `yaml:"systemServices" json:"systemServices"` // 系统服务配置 type => params
FirewallActions []*firewallconfigs.FirewallActionConfig `yaml:"firewallActions" json:"firewallActions"`
TimeZone string `yaml:"timeZone" json:"timeZone"`
AutoOpenPorts bool `yaml:"autoOpenPorts" json:"autoOpenPorts"`
SystemServices map[string]maps.Map `yaml:"systemServices" json:"systemServices"` // 系统服务配置 type => params
FirewallActions []*firewallconfigs.FirewallActionConfig `yaml:"firewallActions" json:"firewallActions"` // 防火墙动作
TimeZone string `yaml:"timeZone" json:"timeZone"` // 自动设置时区
AutoOpenPorts bool `yaml:"autoOpenPorts" json:"autoOpenPorts"` // 自动开放所需端口
Clock *ClockConfig `yaml:"clock" json:"clock"` // 时钟配置
AutoInstallNftables bool `yaml:"autoInstallNftables" json:"autoInstallNftables"` // 自动安装nftables
// 指标
MetricItems []*serverconfigs.MetricItemConfig `yaml:"metricItems" json:"metricItems"`
@@ -78,6 +87,9 @@ type NodeConfig struct {
// WebP
WebPImagePolicies map[int64]*WebPImagePolicy `yaml:"webpImagePolicies" json:"webpImagePolicies"` // clusterId => *WebPImagePolicy
// UAM相关配置
UAMPolicies map[int64]*UAMPolicy `yaml:"uamPolicies" yaml:"uamPolicies" json:"uamPolicies"` // clusterId => *UAMPolicy
// DNS
DNSResolver *DNSResolverConfig `yaml:"dnsResolver" json:"dnsResolver"`
@@ -110,12 +122,12 @@ func SharedNodeConfig() (*NodeConfig, error) {
return sharedNodeConfig, nil
}
data, err := ioutil.ReadFile(Tea.ConfigFile("node.json"))
data, err := os.ReadFile(Tea.ConfigFile("node.json"))
if err != nil {
return &NodeConfig{}, err
}
config := &NodeConfig{}
var config = &NodeConfig{}
err = json.Unmarshal(data, &config)
if err != nil {
return &NodeConfig{}, err
@@ -166,6 +178,11 @@ func (this *NodeConfig) Init() (err error, serverErrors []*ServerError) {
// servers
for _, server := range this.Servers {
// 避免在运行时重新初始化
if server.IsInitialized() {
continue
}
// 初始化
errs := server.Init()
if len(errs) > 0 {
@@ -310,6 +327,16 @@ func (this *NodeConfig) Init() (err error, serverErrors []*ServerError) {
}
}
// uam policy
if this.UAMPolicies != nil {
for _, policy := range this.UAMPolicies {
err = policy.Init()
if err != nil {
return
}
}
}
// dns resolver
if this.DNSResolver != nil {
err = this.DNSResolver.Init()
@@ -318,6 +345,24 @@ func (this *NodeConfig) Init() (err error, serverErrors []*ServerError) {
}
}
// 全局服务设置
if this.GlobalServerConfig != nil {
err = this.GlobalServerConfig.Init()
if err != nil {
return
}
}
// api node addrs
if len(this.APINodeAddrs) > 0 {
for _, addr := range this.APINodeAddrs {
err := addr.Init()
if err != nil {
return err, nil
}
}
}
return
}
@@ -390,7 +435,7 @@ func (this *NodeConfig) Save() error {
return err
}
return ioutil.WriteFile(Tea.ConfigFile("node.json"), data, 0777)
return os.WriteFile(Tea.ConfigFile("node.json"), data, 0777)
}
// PaddedId 获取填充后的ID
@@ -508,6 +553,14 @@ func (this *NodeConfig) FindWebPImagePolicyWithClusterId(clusterId int64) *WebPI
return this.WebPImagePolicies[clusterId]
}
// FindUAMPolicyWithClusterId 使用集群ID查找UAM策略
func (this *NodeConfig) FindUAMPolicyWithClusterId(clusterId int64) *UAMPolicy {
if this.UAMPolicies == nil {
return nil
}
return this.UAMPolicies[clusterId]
}
// SecretHash 对Id和Secret的Hash计算
func (this *NodeConfig) SecretHash() string {
return this.secretHash

View File

@@ -24,7 +24,10 @@ type NodeStatus struct {
Load1m float64 `json:"load1m"`
Load5m float64 `json:"load5m"`
Load15m float64 `json:"load15m"`
ConnectionCount int `json:"connectionCount"` // 连接数
ConnectionCount int `json:"connectionCount"` // 连接数
ExePath string `json:"exePath"` // 可执行文件路径
APISuccessPercent float64 `json:"apiSuccessPercent"` // API成功比例
APIAvgCostSeconds float64 `json:"apiAvgCostSeconds"` // API平均耗时
TrafficInBytes uint64 `json:"trafficInBytes"`
TrafficOutBytes uint64 `json:"trafficOutBytes"`

View File

@@ -0,0 +1,11 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package nodeconfigs
func DefaultSSHParams() *SSHParams {
return &SSHParams{Port: 22}
}
type SSHParams struct {
Port int `json:"port"`
}

View File

@@ -0,0 +1,28 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package nodeconfigs
func init() {
_ = DefaultUAMPolicy.Init()
}
var DefaultUAMPolicy = &UAMPolicy{
IsOn: true,
AllowSearchEngines: true,
DenySpiders: true,
UITitle: "",
UIBody: "",
}
type UAMPolicy struct {
IsOn bool `yaml:"isOn" json:"isOn"`
AllowSearchEngines bool `yaml:"allowSearchEngines" json:"allowSearchEngines"` // 直接跳过常见搜索引擎
DenySpiders bool `yaml:"denySpiders" json:"denySpiders"` // 拦截常见爬虫
UITitle string `yaml:"uiTitle" json:"uiTitle"` // 页面标题
UIBody string `yaml:"uiBody" json:"uiBody"` // 页面内容
}
func (this *UAMPolicy) Init() error {
return nil
}

View File

@@ -12,7 +12,6 @@ type RPCClient interface {
SysSettingRPC() pb.SysSettingServiceClient
NodeClusterRPC() pb.NodeClusterServiceClient
NodeRegionRPC() pb.NodeRegionServiceClient
NodePriceItemRPC() pb.NodePriceItemServiceClient
ServerRPC() pb.ServerServiceClient
ServerGroupRPC() pb.ServerGroupServiceClient
OriginRPC() pb.OriginServiceClient
@@ -46,6 +45,4 @@ type RPCClient interface {
ACMEUserRPC() pb.ACMEUserServiceClient
ACMETaskRPC() pb.ACMETaskServiceClient
UserRPC() pb.UserServiceClient
UserBillRPC() pb.UserBillServiceClient
UserNodeRPC() pb.UserNodeServiceClient
}

View File

@@ -0,0 +1,43 @@
# 访问日志引用
## 定义
~~~json
{
"isPrior": "是否覆盖父级应用",
"isOn": "是否启用配置",
"fields": ["字段1", "字段2", ...] // 可以留空
"status1": "是否启用状态1xx",
"status2": "是否启用状态2xx",
"status3": "是否启用状态3xx",
"status4": "是否启用状态4xx",
"status5": "是否启用状态5xx",
"enableClientClosed": "是否记录客户端关闭事件",
"firewallOnly": "是否只记录防火墙WAF相关日志"
}
~~~
### 字段值
* `1` - 请求Header
* `2` - 响应Header
* `3` - 请求URL参数
* `4` - Cookie
* `5` - 扩展信息
* `6` - Referer
* `7` - UserAgent
* `8` - 请求Body
* `9` - 响应Body目前不支持
## 示例
~~~json
{
"isPrior": true,
"isOn": true,
"fields": [],
"status1": true,
"status2": true,
"status3": true,
"status4": true,
"status5": true,
"enableClientClosed": true,
"firewallOnly": true
}
~~~

View File

@@ -0,0 +1,92 @@
# HTTP缓存配置
## 定义
~~~json
{
"isPrior": "是否覆盖上级配置",
"isOn": "是否启用配置",
"addStatusHeader": "是否增加命中状态HeaderX-Cache",
"addAgeHeader": "是否增加Age Header",
"enableCacheControlMaxAge": "是否支持Cache-Control: max-age=...",
"disablePolicyRefs": "是否停用策略中定义的条件",
"purgeIsOn": "是否允许使用Purge方法清理",
"purgeKey": "Purge时使用的X-Edge-Purge-Key",
"stale": "陈旧缓存使用策略",
"cacheRefs": ["缓存条件1", "缓存条件2", ...]
}
~~~
其中:
* `缓存条件` - 参考 {json:http_cache_ref}
## 示例
### 无缓存条件
~~~json
{
"isPrior": true,
"isOn": true,
"addStatusHeader": true,
"addAgeHeader": true,
"enableCacheControlMaxAge": true,
"disablePolicyRefs": false,
"purgeIsOn": false,
"purgeKey": "",
"stale": null,
"cacheRefs": []
}
~~~
### 加入缓存条件
~~~json
{
"isPrior": true,
"isOn": true,
"addStatusHeader": true,
"addAgeHeader": true,
"enableCacheControlMaxAge": true,
"disablePolicyRefs": false,
"purgeIsOn": false,
"purgeKey": "",
"stale": null,
"cacheRefs": [
{
"id": 0,
"isOn": true,
"key": "${scheme}://${host}${requestPath}${isArgs}${args}",
"life": {"count": 2, "unit": "hour"},
"status": [200],
"maxSize": {"count": 32, "unit": "mb"},
"minSize": {"count": 0, "unit": "kb"},
"skipCacheControlValues": ["private", "no-cache", "no-store"],
"skipSetCookie": true,
"enableRequestCachePragma": false,
"conds": {
"isOn": true,
"connector": "or",
"groups": [
{
"isOn": true,
"connector": "and",
"conds": [
{
"type": "url-extension",
"isRequest": true,
"param": "${requestPathExtension}",
"operator": "in",
"value": "[\".css\",\".png\",\".js\",\".woff2\"]",
"isReverse": false,
"isCaseInsensitive": false,
"typeName": "URL扩展名"
}
],
"isReverse": false,
"description": ""
}
]
},
"allowChunkedEncoding": true,
"allowPartialContent": false,
"isReverse": false,
"methods": []
}
]
}
~~~

View File

@@ -0,0 +1,91 @@
# 缓存条件设置
## 定义
~~~json
{
"isOn": "是否启用配置",
"key": "每个缓存的Key规则里面可以有变量",
"life": "缓存时长",
"expiresTime": "客户端过期时间",
"status": ["缓存的状态码1", "缓存的状态码2", ...],
"minSize": "能够缓存的最小尺寸",
"maxSize": "能够缓存的最大尺寸",
"methods": ["支持的请求方法1", "支持的请求方法2", ...],
"skipCacheControlValues": "可以跳过的响应的Cache-Control值",
"skipSetCookie": "是否跳过响应的Set-Cookie Header",
"enableRequestCachePragma": "是否支持客户端的Pragma: no-cache",
"allowChunkedEncoding": "是否允许分片内容",
"allowPartialContent": "支持分段内容缓存",
"conds": "请求条件",
"isReverse": "是否为反向条件,反向条件的不缓存"
}
~~~
## 示例
~~~json
{
"isOn": true,
"key": "${scheme}://${host}${requestURI}",
"life": {
"count": 1,
"unit": "day"
},
"expiresTime": {
"isPrior": true,
"isOn": true,
"overwrite": true,
"autoCalculate": false,
"duration": {
"count": 1,
"unit": "day"
}
},
"status": [
200
],
"minSize": {
"count": 0,
"unit": "kb"
},
"maxSize": {
"count": 32,
"unit": "mb"
},
"methods": [],
"skipCacheControlValues": [
"private",
"no-cache",
"no-store"
],
"skipSetCookie": true,
"enableRequestCachePragma": false,
"allowChunkedEncoding": true,
"allowPartialContent": false,
"conds": {
"isOn": true,
"connector": "or",
"groups": [
{
"isOn": true,
"connector": "and",
"conds": [
{
"type": "url-extension",
"isRequest": true,
"param": "${requestPathExtension}",
"operator": "in",
"value": "[\".css\",\".png\",\".js\",\".woff2\"]",
"isReverse": false,
"isCaseInsensitive": false,
"typeName": "URL扩展名"
}
],
"isReverse": false,
"description": ""
}
]
},
"cachePolicy": null,
"isReverse": false,
"id": 1
}
~~~

View File

@@ -0,0 +1,18 @@
# HTTP防火墙即WAF引用
## 定义
~~~json
{
"isPrior": "是否覆盖上级配置",
"isOn": "是否启用配置",
"firewallPolicyId": "WAF策略ID"
}
~~~
## 示例
~~~json
{
"isPrior": true,
"isOn": true,
"firewallPolicyId": 123
}
~~~

View File

@@ -0,0 +1,31 @@
# HTTP获取客户端IP地址方式配置
## 定义
~~~json
{
"isPrior": "是否覆盖父级应用",
"isOn": "是否启用配置",
"value": "自定义值变量",
"isCustomized": "是否自定义"
}
~~~
## 示例
### 不启用自定义
~~~json
{
"isPrior": false,
"isOn": false,
"value": "",
"isCustomized": false
}
~~~
### 启用自定义
~~~json
{
"isPrior": true,
"isOn": true,
"value": "${remoteAddr}",
"isCustomized": true
}
~~~

View File

@@ -0,0 +1,16 @@
# 统计引用
## 定义
~~~json
{
"isPrior": "是否覆盖父级配置",
"isOn": "是否启用配置"
}
~~~
## 示例
~~~json
{
"isPrior": true,
"isOn": true
}
~~~

View File

@@ -0,0 +1,21 @@
# WebSocket引用
## 定义
~~~json
{
"isPrior": "是否覆盖上级配置true|false",
"isOn": "是否启用true|false",
"websocketId": "Websocket配置ID"
}
~~~
其中:
* `Websocket配置ID` - 需要调用 `HTTPWebsocketService.CreateHTTPWebsocketRequest()` 生成
## 示例
~~~json
{
"isPrior": true,
"isOn": true,
"websocketId": 123
}
~~~

View File

@@ -0,0 +1,9 @@
# 域名信息
## 示例
~~~json
{
"name": "example.com",
"type": "full"
}
~~~

View File

@@ -0,0 +1,48 @@
# 域名信息列表
## 定义
~~~
[ 域名信息1, 域名信息2, ... ]
~~~
其中 `域名信息N` 等是单个域名信息定义,具体请参考 {json:server_name}
## 示例
### 示例1单个域名
~~~json
[
{
"name": "example.com",
"type": "full"
}
]
~~~
### 示例2多个域名
~~~json
[
{
"name": "example.com",
"type": "full"
},
{
"name": "google.com",
"type": "full"
},
{
"name": "facebook.com",
"type": "full"
}
]
~~~
### 示例3域名合集
域名合集效果跟多个域名是一样的,只不过在界面上以一个目录的形式呈现。
~~~json
[
{
"name": "",
"type": "full",
"subNames": ["example.com", "google.com", "facebook.com"]
}
]
~~~

View File

@@ -0,0 +1,18 @@
# SSL证书引用
## 示例
~~~
[
{
"isOn": true,
"certId": 12345
},
{
"isOn": true,
"certId": 12346
}
]
~~~
其中:
* `certId` - 证书的ID

View File

@@ -47,6 +47,7 @@ type APINode struct {
StatusJSON []byte `protobuf:"bytes,12,opt,name=statusJSON,proto3" json:"statusJSON,omitempty"`
IsPrimary bool `protobuf:"varint,16,opt,name=isPrimary,proto3" json:"isPrimary,omitempty"`
Debug bool `protobuf:"varint,30,opt,name=debug,proto3" json:"debug,omitempty"`
InstanceCode string `protobuf:"bytes,31,opt,name=instanceCode,proto3" json:"instanceCode,omitempty"`
}
func (x *APINode) Reset() {
@@ -200,12 +201,19 @@ func (x *APINode) GetDebug() bool {
return false
}
func (x *APINode) GetInstanceCode() string {
if x != nil {
return x.InstanceCode
}
return ""
}
var File_models_model_api_node_proto protoreflect.FileDescriptor
var file_models_model_api_node_proto_rawDesc = []byte{
0x0a, 0x1b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x61,
0x70, 0x69, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70,
0x62, 0x22, 0xfd, 0x03, 0x0a, 0x07, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a,
0x62, 0x22, 0xa1, 0x04, 0x0a, 0x07, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a,
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a,
0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f,
0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72,
@@ -237,8 +245,10 @@ var file_models_model_api_node_proto_rawDesc = []byte{
0x09, 0x69, 0x73, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08,
0x52, 0x09, 0x69, 0x73, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x64,
0x65, 0x62, 0x75, 0x67, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x64, 0x65, 0x62, 0x75,
0x67, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
0x67, 0x12, 0x22, 0x0a, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x64,
0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63,
0x65, 0x43, 0x6f, 0x64, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -0,0 +1,185 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.19.4
// source: models/model_client_agent.proto
package pb
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type ClientAgent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Code string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"`
Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
CountIPs int64 `protobuf:"varint,5,opt,name=countIPs,proto3" json:"countIPs,omitempty"`
}
func (x *ClientAgent) Reset() {
*x = ClientAgent{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_client_agent_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ClientAgent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ClientAgent) ProtoMessage() {}
func (x *ClientAgent) ProtoReflect() protoreflect.Message {
mi := &file_models_model_client_agent_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ClientAgent.ProtoReflect.Descriptor instead.
func (*ClientAgent) Descriptor() ([]byte, []int) {
return file_models_model_client_agent_proto_rawDescGZIP(), []int{0}
}
func (x *ClientAgent) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *ClientAgent) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ClientAgent) GetCode() string {
if x != nil {
return x.Code
}
return ""
}
func (x *ClientAgent) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
func (x *ClientAgent) GetCountIPs() int64 {
if x != nil {
return x.CountIPs
}
return 0
}
var File_models_model_client_agent_proto protoreflect.FileDescriptor
var file_models_model_client_agent_proto_rawDesc = []byte{
0x0a, 0x1f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x63,
0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x83, 0x01, 0x0a, 0x0b, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74,
0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a,
0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01,
0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12,
0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x50, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28,
0x03, 0x52, 0x08, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x50, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e,
0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_models_model_client_agent_proto_rawDescOnce sync.Once
file_models_model_client_agent_proto_rawDescData = file_models_model_client_agent_proto_rawDesc
)
func file_models_model_client_agent_proto_rawDescGZIP() []byte {
file_models_model_client_agent_proto_rawDescOnce.Do(func() {
file_models_model_client_agent_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_client_agent_proto_rawDescData)
})
return file_models_model_client_agent_proto_rawDescData
}
var file_models_model_client_agent_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_client_agent_proto_goTypes = []interface{}{
(*ClientAgent)(nil), // 0: pb.ClientAgent
}
var file_models_model_client_agent_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_models_model_client_agent_proto_init() }
func file_models_model_client_agent_proto_init() {
if File_models_model_client_agent_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_models_model_client_agent_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ClientAgent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_models_model_client_agent_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_models_model_client_agent_proto_goTypes,
DependencyIndexes: file_models_model_client_agent_proto_depIdxs,
MessageInfos: file_models_model_client_agent_proto_msgTypes,
}.Build()
File_models_model_client_agent_proto = out.File
file_models_model_client_agent_proto_rawDesc = nil
file_models_model_client_agent_proto_goTypes = nil
file_models_model_client_agent_proto_depIdxs = nil
}

View File

@@ -0,0 +1,181 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.19.4
// source: models/model_client_agent_ip.proto
package pb
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type ClientAgentIP struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"`
Ptr string `protobuf:"bytes,3,opt,name=ptr,proto3" json:"ptr,omitempty"`
ClientAgent *ClientAgent `protobuf:"bytes,30,opt,name=clientAgent,proto3" json:"clientAgent,omitempty"`
}
func (x *ClientAgentIP) Reset() {
*x = ClientAgentIP{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_client_agent_ip_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ClientAgentIP) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ClientAgentIP) ProtoMessage() {}
func (x *ClientAgentIP) ProtoReflect() protoreflect.Message {
mi := &file_models_model_client_agent_ip_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ClientAgentIP.ProtoReflect.Descriptor instead.
func (*ClientAgentIP) Descriptor() ([]byte, []int) {
return file_models_model_client_agent_ip_proto_rawDescGZIP(), []int{0}
}
func (x *ClientAgentIP) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *ClientAgentIP) GetIp() string {
if x != nil {
return x.Ip
}
return ""
}
func (x *ClientAgentIP) GetPtr() string {
if x != nil {
return x.Ptr
}
return ""
}
func (x *ClientAgentIP) GetClientAgent() *ClientAgent {
if x != nil {
return x.ClientAgent
}
return nil
}
var File_models_model_client_agent_ip_proto protoreflect.FileDescriptor
var file_models_model_client_agent_ip_proto_rawDesc = []byte{
0x0a, 0x22, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x63,
0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x70, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x1f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73,
0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x67,
0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x74, 0x0a, 0x0d, 0x43, 0x6c, 0x69,
0x65, 0x6e, 0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x50, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x74,
0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x74, 0x72, 0x12, 0x31, 0x0a, 0x0b,
0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x18, 0x1e, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x67, 0x65,
0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x42,
0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_models_model_client_agent_ip_proto_rawDescOnce sync.Once
file_models_model_client_agent_ip_proto_rawDescData = file_models_model_client_agent_ip_proto_rawDesc
)
func file_models_model_client_agent_ip_proto_rawDescGZIP() []byte {
file_models_model_client_agent_ip_proto_rawDescOnce.Do(func() {
file_models_model_client_agent_ip_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_client_agent_ip_proto_rawDescData)
})
return file_models_model_client_agent_ip_proto_rawDescData
}
var file_models_model_client_agent_ip_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_client_agent_ip_proto_goTypes = []interface{}{
(*ClientAgentIP)(nil), // 0: pb.ClientAgentIP
(*ClientAgent)(nil), // 1: pb.ClientAgent
}
var file_models_model_client_agent_ip_proto_depIdxs = []int32{
1, // 0: pb.ClientAgentIP.clientAgent:type_name -> pb.ClientAgent
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_models_model_client_agent_ip_proto_init() }
func file_models_model_client_agent_ip_proto_init() {
if File_models_model_client_agent_ip_proto != nil {
return
}
file_models_model_client_agent_proto_init()
if !protoimpl.UnsafeEnabled {
file_models_model_client_agent_ip_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ClientAgentIP); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_models_model_client_agent_ip_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_models_model_client_agent_ip_proto_goTypes,
DependencyIndexes: file_models_model_client_agent_ip_proto_depIdxs,
MessageInfos: file_models_model_client_agent_ip_proto_msgTypes,
}.Build()
File_models_model_client_agent_ip_proto = out.File
file_models_model_client_agent_ip_proto_rawDesc = nil
file_models_model_client_agent_ip_proto_goTypes = nil
file_models_model_client_agent_ip_proto_depIdxs = nil
}

View File

@@ -35,6 +35,8 @@ type File struct {
Size int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
CreatedAt int64 `protobuf:"varint,4,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
IsPublic bool `protobuf:"varint,5,opt,name=isPublic,proto3" json:"isPublic,omitempty"`
MimeType string `protobuf:"bytes,6,opt,name=mimeType,proto3" json:"mimeType,omitempty"`
Type string `protobuf:"bytes,7,opt,name=type,proto3" json:"type,omitempty"`
}
func (x *File) Reset() {
@@ -104,11 +106,25 @@ func (x *File) GetIsPublic() bool {
return false
}
func (x *File) GetMimeType() string {
if x != nil {
return x.MimeType
}
return ""
}
func (x *File) GetType() string {
if x != nil {
return x.Type
}
return ""
}
var File_models_model_file_proto protoreflect.FileDescriptor
var file_models_model_file_proto_rawDesc = []byte{
0x0a, 0x17, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x66,
0x69, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x80, 0x01,
0x69, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xb0, 0x01,
0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61,
@@ -117,6 +133,9 @@ var file_models_model_file_proto_rawDesc = []byte{
0x64, 0x41, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74,
0x65, 0x64, 0x41, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63,
0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63,
0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01,
0x28, 0x09, 0x52, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04,
0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65,
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}

View File

@@ -0,0 +1,185 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.19.4
// source: models/model_formal_client_browser.proto
package pb
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type FormalClientBrowser struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Codes []string `protobuf:"bytes,3,rep,name=codes,proto3" json:"codes,omitempty"`
DataId string `protobuf:"bytes,4,opt,name=dataId,proto3" json:"dataId,omitempty"`
State int32 `protobuf:"varint,5,opt,name=state,proto3" json:"state,omitempty"`
}
func (x *FormalClientBrowser) Reset() {
*x = FormalClientBrowser{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_formal_client_browser_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *FormalClientBrowser) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FormalClientBrowser) ProtoMessage() {}
func (x *FormalClientBrowser) ProtoReflect() protoreflect.Message {
mi := &file_models_model_formal_client_browser_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use FormalClientBrowser.ProtoReflect.Descriptor instead.
func (*FormalClientBrowser) Descriptor() ([]byte, []int) {
return file_models_model_formal_client_browser_proto_rawDescGZIP(), []int{0}
}
func (x *FormalClientBrowser) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *FormalClientBrowser) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *FormalClientBrowser) GetCodes() []string {
if x != nil {
return x.Codes
}
return nil
}
func (x *FormalClientBrowser) GetDataId() string {
if x != nil {
return x.DataId
}
return ""
}
func (x *FormalClientBrowser) GetState() int32 {
if x != nil {
return x.State
}
return 0
}
var File_models_model_formal_client_browser_proto protoreflect.FileDescriptor
var file_models_model_formal_client_browser_proto_rawDesc = []byte{
0x0a, 0x28, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x66,
0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x72, 0x6f,
0x77, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x7d,
0x0a, 0x13, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x72,
0x6f, 0x77, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64,
0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x12,
0x16, 0x0a, 0x06, 0x64, 0x61, 0x74, 0x61, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x06, 0x64, 0x61, 0x74, 0x61, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65,
0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_models_model_formal_client_browser_proto_rawDescOnce sync.Once
file_models_model_formal_client_browser_proto_rawDescData = file_models_model_formal_client_browser_proto_rawDesc
)
func file_models_model_formal_client_browser_proto_rawDescGZIP() []byte {
file_models_model_formal_client_browser_proto_rawDescOnce.Do(func() {
file_models_model_formal_client_browser_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_formal_client_browser_proto_rawDescData)
})
return file_models_model_formal_client_browser_proto_rawDescData
}
var file_models_model_formal_client_browser_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_formal_client_browser_proto_goTypes = []interface{}{
(*FormalClientBrowser)(nil), // 0: pb.FormalClientBrowser
}
var file_models_model_formal_client_browser_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_models_model_formal_client_browser_proto_init() }
func file_models_model_formal_client_browser_proto_init() {
if File_models_model_formal_client_browser_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_models_model_formal_client_browser_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FormalClientBrowser); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_models_model_formal_client_browser_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_models_model_formal_client_browser_proto_goTypes,
DependencyIndexes: file_models_model_formal_client_browser_proto_depIdxs,
MessageInfos: file_models_model_formal_client_browser_proto_msgTypes,
}.Build()
File_models_model_formal_client_browser_proto = out.File
file_models_model_formal_client_browser_proto_rawDesc = nil
file_models_model_formal_client_browser_proto_goTypes = nil
file_models_model_formal_client_browser_proto_depIdxs = nil
}

View File

@@ -0,0 +1,185 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.19.4
// source: models/model_formal_client_system.proto
package pb
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type FormalClientSystem struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Codes []string `protobuf:"bytes,3,rep,name=codes,proto3" json:"codes,omitempty"`
DataId string `protobuf:"bytes,4,opt,name=dataId,proto3" json:"dataId,omitempty"`
State int32 `protobuf:"varint,5,opt,name=state,proto3" json:"state,omitempty"`
}
func (x *FormalClientSystem) Reset() {
*x = FormalClientSystem{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_formal_client_system_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *FormalClientSystem) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FormalClientSystem) ProtoMessage() {}
func (x *FormalClientSystem) ProtoReflect() protoreflect.Message {
mi := &file_models_model_formal_client_system_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use FormalClientSystem.ProtoReflect.Descriptor instead.
func (*FormalClientSystem) Descriptor() ([]byte, []int) {
return file_models_model_formal_client_system_proto_rawDescGZIP(), []int{0}
}
func (x *FormalClientSystem) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *FormalClientSystem) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *FormalClientSystem) GetCodes() []string {
if x != nil {
return x.Codes
}
return nil
}
func (x *FormalClientSystem) GetDataId() string {
if x != nil {
return x.DataId
}
return ""
}
func (x *FormalClientSystem) GetState() int32 {
if x != nil {
return x.State
}
return 0
}
var File_models_model_formal_client_system_proto protoreflect.FileDescriptor
var file_models_model_formal_client_system_proto_rawDesc = []byte{
0x0a, 0x27, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x66,
0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x73,
0x74, 0x65, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x7c, 0x0a,
0x12, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x79, 0x73,
0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73,
0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x16, 0x0a,
0x06, 0x64, 0x61, 0x74, 0x61, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64,
0x61, 0x74, 0x61, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x05,
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e,
0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_models_model_formal_client_system_proto_rawDescOnce sync.Once
file_models_model_formal_client_system_proto_rawDescData = file_models_model_formal_client_system_proto_rawDesc
)
func file_models_model_formal_client_system_proto_rawDescGZIP() []byte {
file_models_model_formal_client_system_proto_rawDescOnce.Do(func() {
file_models_model_formal_client_system_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_formal_client_system_proto_rawDescData)
})
return file_models_model_formal_client_system_proto_rawDescData
}
var file_models_model_formal_client_system_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_formal_client_system_proto_goTypes = []interface{}{
(*FormalClientSystem)(nil), // 0: pb.FormalClientSystem
}
var file_models_model_formal_client_system_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_models_model_formal_client_system_proto_init() }
func file_models_model_formal_client_system_proto_init() {
if File_models_model_formal_client_system_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_models_model_formal_client_system_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FormalClientSystem); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_models_model_formal_client_system_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_models_model_formal_client_system_proto_goTypes,
DependencyIndexes: file_models_model_formal_client_system_proto_depIdxs,
MessageInfos: file_models_model_formal_client_system_proto_msgTypes,
}.Build()
File_models_model_formal_client_system_proto = out.File
file_models_model_formal_client_system_proto_rawDesc = nil
file_models_model_formal_client_system_proto_goTypes = nil
file_models_model_formal_client_system_proto_depIdxs = nil
}

View File

@@ -72,8 +72,9 @@ type HTTPAccessLog struct {
ServerPort int32 `protobuf:"varint,38,opt,name=serverPort,proto3" json:"serverPort,omitempty"`
ServerProtocol string `protobuf:"bytes,39,opt,name=serverProtocol,proto3" json:"serverProtocol,omitempty"`
Hostname string `protobuf:"bytes,40,opt,name=hostname,proto3" json:"hostname,omitempty"`
// 代理相关
// 源站相关
OriginAddress string `protobuf:"bytes,41,opt,name=originAddress,proto3" json:"originAddress,omitempty"`
OriginStatus int32 `protobuf:"varint,52,opt,name=originStatus,proto3" json:"originStatus,omitempty"`
// 错误信息
Errors []string `protobuf:"bytes,42,rep,name=errors,proto3" json:"errors,omitempty"`
// 扩展
@@ -415,6 +416,13 @@ func (x *HTTPAccessLog) GetOriginAddress() string {
return ""
}
func (x *HTTPAccessLog) GetOriginStatus() int32 {
if x != nil {
return x.OriginStatus
}
return 0
}
func (x *HTTPAccessLog) GetErrors() []string {
if x != nil {
return x.Errors
@@ -532,7 +540,7 @@ var file_models_model_http_access_log_proto_rawDesc = []byte{
0x74, 0x74, 0x70, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x17, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73,
0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x22, 0xdd, 0x0f, 0x0a, 0x0d, 0x48, 0x54, 0x54, 0x50, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73,
0x6f, 0x22, 0x81, 0x10, 0x0a, 0x0d, 0x48, 0x54, 0x54, 0x50, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73,
0x4c, 0x6f, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64,
0x18, 0x30, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49,
0x64, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20,
@@ -619,49 +627,51 @@ var file_models_model_http_access_log_proto_rawDesc = []byte{
0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x28, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f,
0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e,
0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x29, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6f,
0x72, 0x69, 0x67, 0x69, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06,
0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x2a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72,
0x72, 0x6f, 0x72, 0x73, 0x12, 0x32, 0x0a, 0x05, 0x61, 0x74, 0x74, 0x72, 0x73, 0x18, 0x2b, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x41, 0x63, 0x63,
0x65, 0x73, 0x73, 0x4c, 0x6f, 0x67, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72,
0x79, 0x52, 0x05, 0x61, 0x74, 0x74, 0x72, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x66, 0x69, 0x72, 0x65,
0x77, 0x61, 0x6c, 0x6c, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x64, 0x18, 0x2c, 0x20, 0x01,
0x28, 0x03, 0x52, 0x10, 0x66, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x50, 0x6f, 0x6c, 0x69,
0x63, 0x79, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x13, 0x66, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c,
0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x2d, 0x20, 0x01, 0x28,
0x03, 0x52, 0x13, 0x66, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x47,
0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x66, 0x69, 0x72, 0x65, 0x77, 0x61,
0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x65, 0x74, 0x49, 0x64, 0x18, 0x2e, 0x20, 0x01, 0x28,
0x03, 0x52, 0x11, 0x66, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x53,
0x65, 0x74, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x66, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c,
0x52, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x2f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x66, 0x69,
0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x0f,
0x66, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18,
0x31, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x66, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x41,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x32,
0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x1c, 0x0a, 0x04, 0x6e, 0x6f,
0x64, 0x65, 0x18, 0x64, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f,
0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x1a, 0x4a, 0x0a, 0x0f, 0x53, 0x65, 0x6e, 0x74,
0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b,
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x21, 0x0a,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70,
0x62, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0b, 0x43, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x45, 0x6e,
0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a,
0x46, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79,
0x12, 0x21, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x05, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x38, 0x0a, 0x0a, 0x41, 0x74, 0x74, 0x72, 0x73,
0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38,
0x01, 0x22, 0x21, 0x0a, 0x07, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x16, 0x0a, 0x06,
0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
0x72, 0x69, 0x67, 0x69, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x22, 0x0a, 0x0c,
0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x34, 0x20, 0x01,
0x28, 0x05, 0x52, 0x0c, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x2a, 0x20, 0x03, 0x28, 0x09,
0x52, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x12, 0x32, 0x0a, 0x05, 0x61, 0x74, 0x74, 0x72,
0x73, 0x18, 0x2b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x54, 0x54,
0x50, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x6f, 0x67, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x73,
0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x61, 0x74, 0x74, 0x72, 0x73, 0x12, 0x2a, 0x0a, 0x10,
0x66, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x64,
0x18, 0x2c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x66, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c,
0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x13, 0x66, 0x69, 0x72, 0x65,
0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18,
0x2d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x66, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52,
0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x66, 0x69,
0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x65, 0x74, 0x49, 0x64, 0x18,
0x2e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x66, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52,
0x75, 0x6c, 0x65, 0x53, 0x65, 0x74, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x66, 0x69, 0x72, 0x65,
0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x2f, 0x20, 0x01, 0x28, 0x03,
0x52, 0x0e, 0x66, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x49, 0x64,
0x12, 0x28, 0x0a, 0x0f, 0x66, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x41, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x18, 0x31, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x66, 0x69, 0x72, 0x65, 0x77,
0x61, 0x6c, 0x6c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61,
0x67, 0x73, 0x18, 0x32, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x1c,
0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x64, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70,
0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x1a, 0x4a, 0x0a, 0x0f,
0x53, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12,
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65,
0x79, 0x12, 0x21, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0b, 0x43, 0x6f, 0x6f, 0x6b,
0x69, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
0x02, 0x38, 0x01, 0x1a, 0x46, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74,
0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x03, 0x6b, 0x65, 0x79, 0x12, 0x21, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73,
0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x38, 0x0a, 0x0a, 0x41,
0x74, 0x74, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x21, 0x0a, 0x07, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73,
0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09,
0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -0,0 +1,205 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.19.4
// source: models/model_ip_library_artifact.proto
package pb
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type IPLibraryArtifact struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
FileId int64 `protobuf:"varint,2,opt,name=fileId,proto3" json:"fileId,omitempty"`
CreatedAt int64 `protobuf:"varint,3,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
MetaJSON []byte `protobuf:"bytes,4,opt,name=metaJSON,proto3" json:"metaJSON,omitempty"`
IsPublic bool `protobuf:"varint,5,opt,name=isPublic,proto3" json:"isPublic,omitempty"`
Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"`
Code string `protobuf:"bytes,7,opt,name=code,proto3" json:"code,omitempty"`
}
func (x *IPLibraryArtifact) Reset() {
*x = IPLibraryArtifact{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_ip_library_artifact_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *IPLibraryArtifact) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IPLibraryArtifact) ProtoMessage() {}
func (x *IPLibraryArtifact) ProtoReflect() protoreflect.Message {
mi := &file_models_model_ip_library_artifact_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use IPLibraryArtifact.ProtoReflect.Descriptor instead.
func (*IPLibraryArtifact) Descriptor() ([]byte, []int) {
return file_models_model_ip_library_artifact_proto_rawDescGZIP(), []int{0}
}
func (x *IPLibraryArtifact) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *IPLibraryArtifact) GetFileId() int64 {
if x != nil {
return x.FileId
}
return 0
}
func (x *IPLibraryArtifact) GetCreatedAt() int64 {
if x != nil {
return x.CreatedAt
}
return 0
}
func (x *IPLibraryArtifact) GetMetaJSON() []byte {
if x != nil {
return x.MetaJSON
}
return nil
}
func (x *IPLibraryArtifact) GetIsPublic() bool {
if x != nil {
return x.IsPublic
}
return false
}
func (x *IPLibraryArtifact) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *IPLibraryArtifact) GetCode() string {
if x != nil {
return x.Code
}
return ""
}
var File_models_model_ip_library_artifact_proto protoreflect.FileDescriptor
var file_models_model_ip_library_artifact_proto_rawDesc = []byte{
0x0a, 0x26, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x69,
0x70, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x5f, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61,
0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xb9, 0x01, 0x0a,
0x11, 0x49, 0x50, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61,
0x63, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02,
0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01,
0x28, 0x03, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72,
0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63,
0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61,
0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61,
0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63,
0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63,
0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x07, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_models_model_ip_library_artifact_proto_rawDescOnce sync.Once
file_models_model_ip_library_artifact_proto_rawDescData = file_models_model_ip_library_artifact_proto_rawDesc
)
func file_models_model_ip_library_artifact_proto_rawDescGZIP() []byte {
file_models_model_ip_library_artifact_proto_rawDescOnce.Do(func() {
file_models_model_ip_library_artifact_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_ip_library_artifact_proto_rawDescData)
})
return file_models_model_ip_library_artifact_proto_rawDescData
}
var file_models_model_ip_library_artifact_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_ip_library_artifact_proto_goTypes = []interface{}{
(*IPLibraryArtifact)(nil), // 0: pb.IPLibraryArtifact
}
var file_models_model_ip_library_artifact_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_models_model_ip_library_artifact_proto_init() }
func file_models_model_ip_library_artifact_proto_init() {
if File_models_model_ip_library_artifact_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_models_model_ip_library_artifact_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*IPLibraryArtifact); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_models_model_ip_library_artifact_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_models_model_ip_library_artifact_proto_goTypes,
DependencyIndexes: file_models_model_ip_library_artifact_proto_depIdxs,
MessageInfos: file_models_model_ip_library_artifact_proto_msgTypes,
}.Build()
File_models_model_ip_library_artifact_proto = out.File
file_models_model_ip_library_artifact_proto_rawDesc = nil
file_models_model_ip_library_artifact_proto_goTypes = nil
file_models_model_ip_library_artifact_proto_depIdxs = nil
}

View File

@@ -0,0 +1,532 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.19.4
// source: models/model_ip_library_file.proto
package pb
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type IPLibraryFile struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
FileId int64 `protobuf:"varint,3,opt,name=fileId,proto3" json:"fileId,omitempty"`
Template string `protobuf:"bytes,4,opt,name=template,proto3" json:"template,omitempty"`
EmptyValues []string `protobuf:"bytes,5,rep,name=emptyValues,proto3" json:"emptyValues,omitempty"`
GeneratedFileId int64 `protobuf:"varint,6,opt,name=generatedFileId,proto3" json:"generatedFileId,omitempty"`
GeneratedAt int64 `protobuf:"varint,7,opt,name=generatedAt,proto3" json:"generatedAt,omitempty"`
IsFinished bool `protobuf:"varint,8,opt,name=isFinished,proto3" json:"isFinished,omitempty"`
CreatedAt int64 `protobuf:"varint,9,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
CountryNames []string `protobuf:"bytes,10,rep,name=countryNames,proto3" json:"countryNames,omitempty"`
Provinces []*IPLibraryFile_Province `protobuf:"bytes,11,rep,name=provinces,proto3" json:"provinces,omitempty"`
Cities []*IPLibraryFile_City `protobuf:"bytes,12,rep,name=cities,proto3" json:"cities,omitempty"`
Towns []*IPLibraryFile_Town `protobuf:"bytes,13,rep,name=towns,proto3" json:"towns,omitempty"`
ProviderNames []string `protobuf:"bytes,14,rep,name=providerNames,proto3" json:"providerNames,omitempty"`
}
func (x *IPLibraryFile) Reset() {
*x = IPLibraryFile{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_ip_library_file_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *IPLibraryFile) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IPLibraryFile) ProtoMessage() {}
func (x *IPLibraryFile) ProtoReflect() protoreflect.Message {
mi := &file_models_model_ip_library_file_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use IPLibraryFile.ProtoReflect.Descriptor instead.
func (*IPLibraryFile) Descriptor() ([]byte, []int) {
return file_models_model_ip_library_file_proto_rawDescGZIP(), []int{0}
}
func (x *IPLibraryFile) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *IPLibraryFile) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *IPLibraryFile) GetFileId() int64 {
if x != nil {
return x.FileId
}
return 0
}
func (x *IPLibraryFile) GetTemplate() string {
if x != nil {
return x.Template
}
return ""
}
func (x *IPLibraryFile) GetEmptyValues() []string {
if x != nil {
return x.EmptyValues
}
return nil
}
func (x *IPLibraryFile) GetGeneratedFileId() int64 {
if x != nil {
return x.GeneratedFileId
}
return 0
}
func (x *IPLibraryFile) GetGeneratedAt() int64 {
if x != nil {
return x.GeneratedAt
}
return 0
}
func (x *IPLibraryFile) GetIsFinished() bool {
if x != nil {
return x.IsFinished
}
return false
}
func (x *IPLibraryFile) GetCreatedAt() int64 {
if x != nil {
return x.CreatedAt
}
return 0
}
func (x *IPLibraryFile) GetCountryNames() []string {
if x != nil {
return x.CountryNames
}
return nil
}
func (x *IPLibraryFile) GetProvinces() []*IPLibraryFile_Province {
if x != nil {
return x.Provinces
}
return nil
}
func (x *IPLibraryFile) GetCities() []*IPLibraryFile_City {
if x != nil {
return x.Cities
}
return nil
}
func (x *IPLibraryFile) GetTowns() []*IPLibraryFile_Town {
if x != nil {
return x.Towns
}
return nil
}
func (x *IPLibraryFile) GetProviderNames() []string {
if x != nil {
return x.ProviderNames
}
return nil
}
type IPLibraryFile_Province struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
CountryName string `protobuf:"bytes,1,opt,name=countryName,proto3" json:"countryName,omitempty"`
ProvinceName string `protobuf:"bytes,2,opt,name=provinceName,proto3" json:"provinceName,omitempty"`
}
func (x *IPLibraryFile_Province) Reset() {
*x = IPLibraryFile_Province{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_ip_library_file_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *IPLibraryFile_Province) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IPLibraryFile_Province) ProtoMessage() {}
func (x *IPLibraryFile_Province) ProtoReflect() protoreflect.Message {
mi := &file_models_model_ip_library_file_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use IPLibraryFile_Province.ProtoReflect.Descriptor instead.
func (*IPLibraryFile_Province) Descriptor() ([]byte, []int) {
return file_models_model_ip_library_file_proto_rawDescGZIP(), []int{0, 0}
}
func (x *IPLibraryFile_Province) GetCountryName() string {
if x != nil {
return x.CountryName
}
return ""
}
func (x *IPLibraryFile_Province) GetProvinceName() string {
if x != nil {
return x.ProvinceName
}
return ""
}
type IPLibraryFile_City struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
CountryName string `protobuf:"bytes,1,opt,name=countryName,proto3" json:"countryName,omitempty"`
ProvinceName string `protobuf:"bytes,2,opt,name=provinceName,proto3" json:"provinceName,omitempty"`
CityName string `protobuf:"bytes,3,opt,name=cityName,proto3" json:"cityName,omitempty"`
}
func (x *IPLibraryFile_City) Reset() {
*x = IPLibraryFile_City{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_ip_library_file_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *IPLibraryFile_City) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IPLibraryFile_City) ProtoMessage() {}
func (x *IPLibraryFile_City) ProtoReflect() protoreflect.Message {
mi := &file_models_model_ip_library_file_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use IPLibraryFile_City.ProtoReflect.Descriptor instead.
func (*IPLibraryFile_City) Descriptor() ([]byte, []int) {
return file_models_model_ip_library_file_proto_rawDescGZIP(), []int{0, 1}
}
func (x *IPLibraryFile_City) GetCountryName() string {
if x != nil {
return x.CountryName
}
return ""
}
func (x *IPLibraryFile_City) GetProvinceName() string {
if x != nil {
return x.ProvinceName
}
return ""
}
func (x *IPLibraryFile_City) GetCityName() string {
if x != nil {
return x.CityName
}
return ""
}
type IPLibraryFile_Town struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
CountryName string `protobuf:"bytes,1,opt,name=countryName,proto3" json:"countryName,omitempty"`
ProvinceName string `protobuf:"bytes,2,opt,name=provinceName,proto3" json:"provinceName,omitempty"`
CityName string `protobuf:"bytes,3,opt,name=cityName,proto3" json:"cityName,omitempty"`
TownName string `protobuf:"bytes,4,opt,name=townName,proto3" json:"townName,omitempty"`
}
func (x *IPLibraryFile_Town) Reset() {
*x = IPLibraryFile_Town{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_ip_library_file_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *IPLibraryFile_Town) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IPLibraryFile_Town) ProtoMessage() {}
func (x *IPLibraryFile_Town) ProtoReflect() protoreflect.Message {
mi := &file_models_model_ip_library_file_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use IPLibraryFile_Town.ProtoReflect.Descriptor instead.
func (*IPLibraryFile_Town) Descriptor() ([]byte, []int) {
return file_models_model_ip_library_file_proto_rawDescGZIP(), []int{0, 2}
}
func (x *IPLibraryFile_Town) GetCountryName() string {
if x != nil {
return x.CountryName
}
return ""
}
func (x *IPLibraryFile_Town) GetProvinceName() string {
if x != nil {
return x.ProvinceName
}
return ""
}
func (x *IPLibraryFile_Town) GetCityName() string {
if x != nil {
return x.CityName
}
return ""
}
func (x *IPLibraryFile_Town) GetTownName() string {
if x != nil {
return x.TownName
}
return ""
}
var File_models_model_ip_library_file_proto protoreflect.FileDescriptor
var file_models_model_ip_library_file_proto_rawDesc = []byte{
0x0a, 0x22, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x69,
0x70, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xb8, 0x06, 0x0a, 0x0d, 0x49, 0x50, 0x4c,
0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16,
0x0a, 0x06, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06,
0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65,
0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x56, 0x61,
0x6c, 0x75, 0x65, 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65,
0x64, 0x46, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x67,
0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x20,
0x0a, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x07, 0x20,
0x01, 0x28, 0x03, 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74,
0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x08,
0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64,
0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x09, 0x20,
0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x22,
0x0a, 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x0a,
0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x4e, 0x61, 0x6d,
0x65, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x73, 0x18,
0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x50, 0x4c, 0x69, 0x62,
0x72, 0x61, 0x72, 0x79, 0x46, 0x69, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63,
0x65, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x06,
0x63, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70,
0x62, 0x2e, 0x49, 0x50, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x46, 0x69, 0x6c, 0x65, 0x2e,
0x43, 0x69, 0x74, 0x79, 0x52, 0x06, 0x63, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x05,
0x74, 0x6f, 0x77, 0x6e, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x62,
0x2e, 0x49, 0x50, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x46, 0x69, 0x6c, 0x65, 0x2e, 0x54,
0x6f, 0x77, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x77, 0x6e, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x72,
0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28,
0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x73,
0x1a, 0x50, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22,
0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x4e, 0x61,
0x6d, 0x65, 0x1a, 0x68, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f,
0x75, 0x6e, 0x74, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c,
0x70, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65,
0x12, 0x1a, 0x0a, 0x08, 0x63, 0x69, 0x74, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x08, 0x63, 0x69, 0x74, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0x84, 0x01, 0x0a,
0x04, 0x54, 0x6f, 0x77, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79,
0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x75, 0x6e,
0x74, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x76, 0x69,
0x6e, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70,
0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63,
0x69, 0x74, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63,
0x69, 0x74, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x6f, 0x77, 0x6e, 0x4e,
0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x77, 0x6e, 0x4e,
0x61, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
file_models_model_ip_library_file_proto_rawDescOnce sync.Once
file_models_model_ip_library_file_proto_rawDescData = file_models_model_ip_library_file_proto_rawDesc
)
func file_models_model_ip_library_file_proto_rawDescGZIP() []byte {
file_models_model_ip_library_file_proto_rawDescOnce.Do(func() {
file_models_model_ip_library_file_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_ip_library_file_proto_rawDescData)
})
return file_models_model_ip_library_file_proto_rawDescData
}
var file_models_model_ip_library_file_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_models_model_ip_library_file_proto_goTypes = []interface{}{
(*IPLibraryFile)(nil), // 0: pb.IPLibraryFile
(*IPLibraryFile_Province)(nil), // 1: pb.IPLibraryFile.Province
(*IPLibraryFile_City)(nil), // 2: pb.IPLibraryFile.City
(*IPLibraryFile_Town)(nil), // 3: pb.IPLibraryFile.Town
}
var file_models_model_ip_library_file_proto_depIdxs = []int32{
1, // 0: pb.IPLibraryFile.provinces:type_name -> pb.IPLibraryFile.Province
2, // 1: pb.IPLibraryFile.cities:type_name -> pb.IPLibraryFile.City
3, // 2: pb.IPLibraryFile.towns:type_name -> pb.IPLibraryFile.Town
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_models_model_ip_library_file_proto_init() }
func file_models_model_ip_library_file_proto_init() {
if File_models_model_ip_library_file_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_models_model_ip_library_file_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*IPLibraryFile); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_models_model_ip_library_file_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*IPLibraryFile_Province); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_models_model_ip_library_file_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*IPLibraryFile_City); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_models_model_ip_library_file_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*IPLibraryFile_Town); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_models_model_ip_library_file_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_models_model_ip_library_file_proto_goTypes,
DependencyIndexes: file_models_model_ip_library_file_proto_depIdxs,
MessageInfos: file_models_model_ip_library_file_proto_msgTypes,
}.Build()
File_models_model_ip_library_file_proto = out.File
file_models_model_ip_library_file_proto_rawDesc = nil
file_models_model_ip_library_file_proto_goTypes = nil
file_models_model_ip_library_file_proto_depIdxs = nil
}

View File

@@ -49,7 +49,11 @@ type Node struct {
MaxCacheDiskCapacity *SizeCapacity `protobuf:"bytes,17,opt,name=maxCacheDiskCapacity,proto3" json:"maxCacheDiskCapacity,omitempty"`
MaxCacheMemoryCapacity *SizeCapacity `protobuf:"bytes,18,opt,name=maxCacheMemoryCapacity,proto3" json:"maxCacheMemoryCapacity,omitempty"`
CacheDiskDir string `protobuf:"bytes,19,opt,name=cacheDiskDir,proto3" json:"cacheDiskDir,omitempty"`
CacheDiskSubDirsJSON []byte `protobuf:"bytes,23,opt,name=cacheDiskSubDirsJSON,proto3" json:"cacheDiskSubDirsJSON,omitempty"`
Level int32 `protobuf:"varint,20,opt,name=level,proto3" json:"level,omitempty"`
LnAddrs []string `protobuf:"bytes,21,rep,name=lnAddrs,proto3" json:"lnAddrs,omitempty"` // Ln访问地址
EnableIPLists bool `protobuf:"varint,22,opt,name=enableIPLists,proto3" json:"enableIPLists,omitempty"`
ApiNodeAddrsJSON []byte `protobuf:"bytes,24,opt,name=apiNodeAddrsJSON,proto3" json:"apiNodeAddrsJSON,omitempty"`
NodeCluster *NodeCluster `protobuf:"bytes,32,opt,name=nodeCluster,proto3" json:"nodeCluster,omitempty"` // 主集群
NodeLogin *NodeLogin `protobuf:"bytes,33,opt,name=nodeLogin,proto3" json:"nodeLogin,omitempty"`
InstallStatus *NodeInstallStatus `protobuf:"bytes,34,opt,name=installStatus,proto3" json:"installStatus,omitempty"`
@@ -224,6 +228,13 @@ func (x *Node) GetCacheDiskDir() string {
return ""
}
func (x *Node) GetCacheDiskSubDirsJSON() []byte {
if x != nil {
return x.CacheDiskSubDirsJSON
}
return nil
}
func (x *Node) GetLevel() int32 {
if x != nil {
return x.Level
@@ -231,6 +242,27 @@ func (x *Node) GetLevel() int32 {
return 0
}
func (x *Node) GetLnAddrs() []string {
if x != nil {
return x.LnAddrs
}
return nil
}
func (x *Node) GetEnableIPLists() bool {
if x != nil {
return x.EnableIPLists
}
return false
}
func (x *Node) GetApiNodeAddrsJSON() []byte {
if x != nil {
return x.ApiNodeAddrsJSON
}
return nil
}
func (x *Node) GetNodeCluster() *NodeCluster {
if x != nil {
return x.NodeCluster
@@ -388,7 +420,7 @@ var file_models_model_node_proto_rawDesc = []byte{
0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x64, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d,
0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69,
0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8e, 0x08, 0x0a, 0x04, 0x4e, 0x6f, 0x64,
0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xae, 0x09, 0x0a, 0x04, 0x4e, 0x6f, 0x64,
0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69,
0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a,
@@ -428,9 +460,19 @@ var file_models_model_node_proto_rawDesc = []byte{
0x79, 0x52, 0x16, 0x6d, 0x61, 0x78, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x72,
0x79, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x63, 0x61, 0x63,
0x68, 0x65, 0x44, 0x69, 0x73, 0x6b, 0x44, 0x69, 0x72, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0c, 0x63, 0x61, 0x63, 0x68, 0x65, 0x44, 0x69, 0x73, 0x6b, 0x44, 0x69, 0x72, 0x12, 0x14, 0x0a,
0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65,
0x76, 0x65, 0x6c, 0x12, 0x31, 0x0a, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74,
0x0c, 0x63, 0x61, 0x63, 0x68, 0x65, 0x44, 0x69, 0x73, 0x6b, 0x44, 0x69, 0x72, 0x12, 0x32, 0x0a,
0x14, 0x63, 0x61, 0x63, 0x68, 0x65, 0x44, 0x69, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x44, 0x69, 0x72,
0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x14, 0x63, 0x61, 0x63,
0x68, 0x65, 0x44, 0x69, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x44, 0x69, 0x72, 0x73, 0x4a, 0x53, 0x4f,
0x4e, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x14, 0x20, 0x01, 0x28, 0x05,
0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x6e, 0x41, 0x64, 0x64,
0x72, 0x73, 0x18, 0x15, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x6e, 0x41, 0x64, 0x64, 0x72,
0x73, 0x12, 0x24, 0x0a, 0x0d, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x50, 0x4c, 0x69, 0x73,
0x74, 0x73, 0x18, 0x16, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65,
0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x61, 0x70, 0x69, 0x4e, 0x6f,
0x64, 0x65, 0x41, 0x64, 0x64, 0x72, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x18, 0x20, 0x01, 0x28,
0x0c, 0x52, 0x10, 0x61, 0x70, 0x69, 0x4e, 0x6f, 0x64, 0x65, 0x41, 0x64, 0x64, 0x72, 0x73, 0x4a,
0x53, 0x4f, 0x4e, 0x12, 0x31, 0x0a, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74,
0x65, 0x72, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f,
0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x43,
0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4c, 0x6f,

View File

@@ -46,6 +46,10 @@ type NodeCluster struct {
NodeMaxThreads int32 `protobuf:"varint,14,opt,name=nodeMaxThreads,proto3" json:"nodeMaxThreads,omitempty"`
AutoOpenPorts bool `protobuf:"varint,16,opt,name=autoOpenPorts,proto3" json:"autoOpenPorts,omitempty"`
IsPinned bool `protobuf:"varint,17,opt,name=isPinned,proto3" json:"isPinned,omitempty"`
ClockJSON []byte `protobuf:"bytes,18,opt,name=clockJSON,proto3" json:"clockJSON,omitempty"`
AutoRemoteStart bool `protobuf:"varint,19,opt,name=autoRemoteStart,proto3" json:"autoRemoteStart,omitempty"`
AutoInstallNftables bool `protobuf:"varint,20,opt,name=autoInstallNftables,proto3" json:"autoInstallNftables,omitempty"`
SshParamsJSON []byte `protobuf:"bytes,21,opt,name=sshParamsJSON,proto3" json:"sshParamsJSON,omitempty"`
}
func (x *NodeCluster) Reset() {
@@ -192,12 +196,40 @@ func (x *NodeCluster) GetIsPinned() bool {
return false
}
func (x *NodeCluster) GetClockJSON() []byte {
if x != nil {
return x.ClockJSON
}
return nil
}
func (x *NodeCluster) GetAutoRemoteStart() bool {
if x != nil {
return x.AutoRemoteStart
}
return false
}
func (x *NodeCluster) GetAutoInstallNftables() bool {
if x != nil {
return x.AutoInstallNftables
}
return false
}
func (x *NodeCluster) GetSshParamsJSON() []byte {
if x != nil {
return x.SshParamsJSON
}
return nil
}
var File_models_model_node_cluster_proto protoreflect.FileDescriptor
var file_models_model_node_cluster_proto_rawDesc = []byte{
0x0a, 0x1f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e,
0x6f, 0x64, 0x65, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xfd, 0x03, 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c,
0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x9d, 0x05, 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c,
0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65,
@@ -229,7 +261,17 @@ var file_models_model_node_cluster_proto_rawDesc = []byte{
0x6f, 0x72, 0x74, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x61, 0x75, 0x74, 0x6f,
0x4f, 0x70, 0x65, 0x6e, 0x50, 0x6f, 0x72, 0x74, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x50,
0x69, 0x6e, 0x6e, 0x65, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x50,
0x69, 0x6e, 0x6e, 0x65, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70,
0x69, 0x6e, 0x6e, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x4a, 0x53,
0x4f, 0x4e, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x4a,
0x53, 0x4f, 0x4e, 0x12, 0x28, 0x0a, 0x0f, 0x61, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x6d, 0x6f, 0x74,
0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x61, 0x75,
0x74, 0x6f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x30, 0x0a,
0x13, 0x61, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x4e, 0x66, 0x74, 0x61,
0x62, 0x6c, 0x65, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x75, 0x74, 0x6f,
0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x4e, 0x66, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12,
0x24, 0x0a, 0x0d, 0x73, 0x73, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x4a, 0x53, 0x4f, 0x4e,
0x18, 0x15, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x73, 0x73, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d,
0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}

View File

@@ -40,6 +40,7 @@ type NodeTask struct {
Version int64 `protobuf:"varint,7,opt,name=version,proto3" json:"version,omitempty"`
IsPrimary bool `protobuf:"varint,8,opt,name=isPrimary,proto3" json:"isPrimary,omitempty"` // 是否为主节点,非主节点稍等再同步有利于提升同步速度
ServerId int64 `protobuf:"varint,9,opt,name=serverId,proto3" json:"serverId,omitempty"`
UserId int64 `protobuf:"varint,10,opt,name=userId,proto3" json:"userId,omitempty"`
Node *Node `protobuf:"bytes,30,opt,name=node,proto3" json:"node,omitempty"`
NodeCluster *NodeCluster `protobuf:"bytes,31,opt,name=nodeCluster,proto3" json:"nodeCluster,omitempty"`
Server *NodeCluster `protobuf:"bytes,32,opt,name=server,proto3" json:"server,omitempty"`
@@ -140,6 +141,13 @@ func (x *NodeTask) GetServerId() int64 {
return 0
}
func (x *NodeTask) GetUserId() int64 {
if x != nil {
return x.UserId
}
return 0
}
func (x *NodeTask) GetNode() *Node {
if x != nil {
return x.Node
@@ -169,7 +177,7 @@ var file_models_model_node_task_proto_rawDesc = []byte{
0x70, 0x62, 0x1a, 0x17, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x6d, 0x6f, 0x64,
0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x63,
0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdc, 0x02, 0x0a,
0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf4, 0x02, 0x0a,
0x08, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a,
@@ -184,15 +192,17 @@ var file_models_model_node_task_proto_rawDesc = []byte{
0x6d, 0x61, 0x72, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x50, 0x72,
0x69, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49,
0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49,
0x64, 0x12, 0x1c, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x08, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x12,
0x31, 0x0a, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x1f,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c,
0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74,
0x65, 0x72, 0x12, 0x27, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x20, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73,
0x74, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e,
0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28,
0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x04, 0x6e, 0x6f, 0x64,
0x65, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64,
0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x12, 0x31, 0x0a, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x43,
0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70,
0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x0b, 0x6e,
0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x06, 0x73, 0x65,
0x72, 0x76, 0x65, 0x72, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e,
0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (

View File

@@ -31,10 +31,20 @@ type NSCluster struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
IsOn bool `protobuf:"varint,2,opt,name=isOn,proto3" json:"isOn,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
InstallDir string `protobuf:"bytes,4,opt,name=installDir,proto3" json:"installDir,omitempty"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
IsOn bool `protobuf:"varint,2,opt,name=isOn,proto3" json:"isOn,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
InstallDir string `protobuf:"bytes,4,opt,name=installDir,proto3" json:"installDir,omitempty"`
TcpJSON []byte `protobuf:"bytes,5,opt,name=tcpJSON,proto3" json:"tcpJSON,omitempty"`
TlsJSON []byte `protobuf:"bytes,6,opt,name=tlsJSON,proto3" json:"tlsJSON,omitempty"`
UdpJSON []byte `protobuf:"bytes,7,opt,name=udpJSON,proto3" json:"udpJSON,omitempty"`
Hosts []string `protobuf:"bytes,8,rep,name=hosts,proto3" json:"hosts,omitempty"`
SoaJSON []byte `protobuf:"bytes,12,opt,name=soaJSON,proto3" json:"soaJSON,omitempty"`
Email string `protobuf:"bytes,13,opt,name=email,proto3" json:"email,omitempty"`
AutoRemoteStart bool `protobuf:"varint,9,opt,name=autoRemoteStart,proto3" json:"autoRemoteStart,omitempty"`
TimeZone string `protobuf:"bytes,10,opt,name=timeZone,proto3" json:"timeZone,omitempty"`
AnswerJSON []byte `protobuf:"bytes,11,opt,name=answerJSON,proto3" json:"answerJSON,omitempty"`
DetectAgents bool `protobuf:"varint,14,opt,name=detectAgents,proto3" json:"detectAgents,omitempty"`
}
func (x *NSCluster) Reset() {
@@ -97,19 +107,107 @@ func (x *NSCluster) GetInstallDir() string {
return ""
}
func (x *NSCluster) GetTcpJSON() []byte {
if x != nil {
return x.TcpJSON
}
return nil
}
func (x *NSCluster) GetTlsJSON() []byte {
if x != nil {
return x.TlsJSON
}
return nil
}
func (x *NSCluster) GetUdpJSON() []byte {
if x != nil {
return x.UdpJSON
}
return nil
}
func (x *NSCluster) GetHosts() []string {
if x != nil {
return x.Hosts
}
return nil
}
func (x *NSCluster) GetSoaJSON() []byte {
if x != nil {
return x.SoaJSON
}
return nil
}
func (x *NSCluster) GetEmail() string {
if x != nil {
return x.Email
}
return ""
}
func (x *NSCluster) GetAutoRemoteStart() bool {
if x != nil {
return x.AutoRemoteStart
}
return false
}
func (x *NSCluster) GetTimeZone() string {
if x != nil {
return x.TimeZone
}
return ""
}
func (x *NSCluster) GetAnswerJSON() []byte {
if x != nil {
return x.AnswerJSON
}
return nil
}
func (x *NSCluster) GetDetectAgents() bool {
if x != nil {
return x.DetectAgents
}
return false
}
var File_models_model_ns_cluster_proto protoreflect.FileDescriptor
var file_models_model_ns_cluster_proto_rawDesc = []byte{
0x0a, 0x1d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e,
0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x02, 0x70, 0x62, 0x22, 0x63, 0x0a, 0x09, 0x4e, 0x53, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72,
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64,
0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04,
0x69, 0x73, 0x4f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x6e, 0x73, 0x74,
0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e,
0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x02, 0x70, 0x62, 0x22, 0x81, 0x03, 0x0a, 0x09, 0x4e, 0x53, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65,
0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69,
0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52,
0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x6e, 0x73,
0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69,
0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x63, 0x70,
0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x63, 0x70, 0x4a,
0x53, 0x4f, 0x4e, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x6c, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x06,
0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x6c, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x18, 0x0a,
0x07, 0x75, 0x64, 0x70, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07,
0x75, 0x64, 0x70, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x14, 0x0a, 0x05, 0x68, 0x6f, 0x73, 0x74, 0x73,
0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x68, 0x6f, 0x73, 0x74, 0x73, 0x12, 0x18, 0x0a,
0x07, 0x73, 0x6f, 0x61, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07,
0x73, 0x6f, 0x61, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c,
0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x28, 0x0a,
0x0f, 0x61, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74,
0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x61, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x6d, 0x6f,
0x74, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x5a,
0x6f, 0x6e, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x5a,
0x6f, 0x6e, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x4a, 0x53, 0x4f,
0x4e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x4a,
0x53, 0x4f, 0x4e, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x41, 0x67, 0x65,
0x6e, 0x74, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x64, 0x65, 0x74, 0x65, 0x63,
0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -31,15 +31,19 @@ type NSDomain struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
IsOn bool `protobuf:"varint,3,opt,name=isOn,proto3" json:"isOn,omitempty"`
CreatedAt int64 `protobuf:"varint,4,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
IsDeleted bool `protobuf:"varint,5,opt,name=isDeleted,proto3" json:"isDeleted,omitempty"`
Version int64 `protobuf:"varint,6,opt,name=version,proto3" json:"version,omitempty"`
TsigJSON []byte `protobuf:"bytes,7,opt,name=tsigJSON,proto3" json:"tsigJSON,omitempty"`
NsCluster *NSCluster `protobuf:"bytes,30,opt,name=nsCluster,proto3" json:"nsCluster,omitempty"`
User *User `protobuf:"bytes,31,opt,name=user,proto3" json:"user,omitempty"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
IsOn bool `protobuf:"varint,3,opt,name=isOn,proto3" json:"isOn,omitempty"`
CreatedAt int64 `protobuf:"varint,4,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
IsDeleted bool `protobuf:"varint,5,opt,name=isDeleted,proto3" json:"isDeleted,omitempty"`
Version int64 `protobuf:"varint,6,opt,name=version,proto3" json:"version,omitempty"`
TsigJSON []byte `protobuf:"bytes,7,opt,name=tsigJSON,proto3" json:"tsigJSON,omitempty"`
NsDomainGroupIds []int64 `protobuf:"varint,8,rep,packed,name=nsDomainGroupIds,proto3" json:"nsDomainGroupIds,omitempty"`
Status string `protobuf:"bytes,9,opt,name=status,proto3" json:"status,omitempty"`
UserId int64 `protobuf:"varint,10,opt,name=userId,proto3" json:"userId,omitempty"` // 用户ID
NsCluster *NSCluster `protobuf:"bytes,30,opt,name=nsCluster,proto3" json:"nsCluster,omitempty"`
User *User `protobuf:"bytes,31,opt,name=user,proto3" json:"user,omitempty"`
NsDomainGroups []*NSDomainGroup `protobuf:"bytes,32,rep,name=nsDomainGroups,proto3" json:"nsDomainGroups,omitempty"`
}
func (x *NSDomain) Reset() {
@@ -123,6 +127,27 @@ func (x *NSDomain) GetTsigJSON() []byte {
return nil
}
func (x *NSDomain) GetNsDomainGroupIds() []int64 {
if x != nil {
return x.NsDomainGroupIds
}
return nil
}
func (x *NSDomain) GetStatus() string {
if x != nil {
return x.Status
}
return ""
}
func (x *NSDomain) GetUserId() int64 {
if x != nil {
return x.UserId
}
return 0
}
func (x *NSDomain) GetNsCluster() *NSCluster {
if x != nil {
return x.NsCluster
@@ -137,6 +162,13 @@ func (x *NSDomain) GetUser() *User {
return nil
}
func (x *NSDomain) GetNsDomainGroups() []*NSDomainGroup {
if x != nil {
return x.NsDomainGroups
}
return nil
}
var File_models_model_ns_domain_proto protoreflect.FileDescriptor
var file_models_model_ns_domain_proto_rawDesc = []byte{
@@ -144,25 +176,37 @@ var file_models_model_ns_domain_proto_rawDesc = []byte{
0x73, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02,
0x70, 0x62, 0x1a, 0x1d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
0x5f, 0x6e, 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x1a, 0x17, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f,
0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xff, 0x01, 0x0a, 0x08, 0x4e,
0x53, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69,
0x73, 0x4f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12,
0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x04, 0x20, 0x01,
0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1c, 0x0a,
0x09, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08,
0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76,
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x65,
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x73, 0x69, 0x67, 0x4a, 0x53, 0x4f,
0x4e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x74, 0x73, 0x69, 0x67, 0x4a, 0x53, 0x4f,
0x4e, 0x12, 0x2b, 0x0a, 0x09, 0x6e, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x1e,
0x6f, 0x1a, 0x22, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f,
0x6e, 0x73, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f,
0x64, 0x65, 0x6c, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x96,
0x03, 0x0a, 0x08, 0x4e, 0x53, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69,
0x73, 0x4f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74,
0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41,
0x74, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x05,
0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12,
0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03,
0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x73, 0x69,
0x67, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x74, 0x73, 0x69,
0x67, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x2a, 0x0a, 0x10, 0x6e, 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69,
0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x03, 0x52,
0x10, 0x6e, 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64,
0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28,
0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65,
0x72, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49,
0x64, 0x12, 0x2b, 0x0a, 0x09, 0x6e, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x1e,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x53, 0x43, 0x6c, 0x75, 0x73,
0x74, 0x65, 0x72, 0x52, 0x09, 0x6e, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1c,
0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70,
0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x42, 0x06, 0x5a, 0x04,
0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x39, 0x0a, 0x0e,
0x6e, 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x20,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x53, 0x44, 0x6f, 0x6d, 0x61,
0x69, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x0e, 0x6e, 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69,
0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -179,18 +223,20 @@ func file_models_model_ns_domain_proto_rawDescGZIP() []byte {
var file_models_model_ns_domain_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_ns_domain_proto_goTypes = []interface{}{
(*NSDomain)(nil), // 0: pb.NSDomain
(*NSCluster)(nil), // 1: pb.NSCluster
(*User)(nil), // 2: pb.User
(*NSDomain)(nil), // 0: pb.NSDomain
(*NSCluster)(nil), // 1: pb.NSCluster
(*User)(nil), // 2: pb.User
(*NSDomainGroup)(nil), // 3: pb.NSDomainGroup
}
var file_models_model_ns_domain_proto_depIdxs = []int32{
1, // 0: pb.NSDomain.nsCluster:type_name -> pb.NSCluster
2, // 1: pb.NSDomain.user:type_name -> pb.User
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
3, // 2: pb.NSDomain.nsDomainGroups:type_name -> pb.NSDomainGroup
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_models_model_ns_domain_proto_init() }
@@ -199,6 +245,7 @@ func file_models_model_ns_domain_proto_init() {
return
}
file_models_model_ns_cluster_proto_init()
file_models_model_ns_domain_group_proto_init()
file_models_model_user_proto_init()
if !protoimpl.UnsafeEnabled {
file_models_model_ns_domain_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {

View File

@@ -0,0 +1,176 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.19.4
// source: models/model_ns_domain_group.proto
package pb
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
// 域名分组
type NSDomainGroup struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
IsOn bool `protobuf:"varint,3,opt,name=isOn,proto3" json:"isOn,omitempty"`
UserId int64 `protobuf:"varint,4,opt,name=userId,proto3" json:"userId,omitempty"`
}
func (x *NSDomainGroup) Reset() {
*x = NSDomainGroup{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_ns_domain_group_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *NSDomainGroup) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NSDomainGroup) ProtoMessage() {}
func (x *NSDomainGroup) ProtoReflect() protoreflect.Message {
mi := &file_models_model_ns_domain_group_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NSDomainGroup.ProtoReflect.Descriptor instead.
func (*NSDomainGroup) Descriptor() ([]byte, []int) {
return file_models_model_ns_domain_group_proto_rawDescGZIP(), []int{0}
}
func (x *NSDomainGroup) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *NSDomainGroup) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *NSDomainGroup) GetIsOn() bool {
if x != nil {
return x.IsOn
}
return false
}
func (x *NSDomainGroup) GetUserId() int64 {
if x != nil {
return x.UserId
}
return 0
}
var File_models_model_ns_domain_group_proto protoreflect.FileDescriptor
var file_models_model_ns_domain_group_proto_rawDesc = []byte{
0x0a, 0x22, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e,
0x73, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x5f, 0x0a, 0x0d, 0x4e, 0x53, 0x44, 0x6f,
0x6d, 0x61, 0x69, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a,
0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f,
0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28,
0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70,
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_models_model_ns_domain_group_proto_rawDescOnce sync.Once
file_models_model_ns_domain_group_proto_rawDescData = file_models_model_ns_domain_group_proto_rawDesc
)
func file_models_model_ns_domain_group_proto_rawDescGZIP() []byte {
file_models_model_ns_domain_group_proto_rawDescOnce.Do(func() {
file_models_model_ns_domain_group_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_ns_domain_group_proto_rawDescData)
})
return file_models_model_ns_domain_group_proto_rawDescData
}
var file_models_model_ns_domain_group_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_ns_domain_group_proto_goTypes = []interface{}{
(*NSDomainGroup)(nil), // 0: pb.NSDomainGroup
}
var file_models_model_ns_domain_group_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_models_model_ns_domain_group_proto_init() }
func file_models_model_ns_domain_group_proto_init() {
if File_models_model_ns_domain_group_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_models_model_ns_domain_group_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*NSDomainGroup); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_models_model_ns_domain_group_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_models_model_ns_domain_group_proto_goTypes,
DependencyIndexes: file_models_model_ns_domain_group_proto_depIdxs,
MessageInfos: file_models_model_ns_domain_group_proto_msgTypes,
}.Build()
File_models_model_ns_domain_group_proto = out.File
file_models_model_ns_domain_group_proto_rawDesc = nil
file_models_model_ns_domain_group_proto_goTypes = nil
file_models_model_ns_domain_group_proto_depIdxs = nil
}

View File

@@ -31,19 +31,21 @@ type NSNode struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
IsOn bool `protobuf:"varint,3,opt,name=isOn,proto3" json:"isOn,omitempty"`
UniqueId string `protobuf:"bytes,4,opt,name=uniqueId,proto3" json:"uniqueId,omitempty"`
Secret string `protobuf:"bytes,5,opt,name=secret,proto3" json:"secret,omitempty"`
StatusJSON []byte `protobuf:"bytes,6,opt,name=statusJSON,proto3" json:"statusJSON,omitempty"`
IsInstalled bool `protobuf:"varint,7,opt,name=isInstalled,proto3" json:"isInstalled,omitempty"`
InstallDir string `protobuf:"bytes,9,opt,name=installDir,proto3" json:"installDir,omitempty"`
IsUp bool `protobuf:"varint,8,opt,name=isUp,proto3" json:"isUp,omitempty"`
IsActive bool `protobuf:"varint,10,opt,name=isActive,proto3" json:"isActive,omitempty"`
NsCluster *NSCluster `protobuf:"bytes,32,opt,name=nsCluster,proto3" json:"nsCluster,omitempty"`
NodeLogin *NodeLogin `protobuf:"bytes,33,opt,name=nodeLogin,proto3" json:"nodeLogin,omitempty"`
InstallStatus *NodeInstallStatus `protobuf:"bytes,34,opt,name=installStatus,proto3" json:"installStatus,omitempty"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
IsOn bool `protobuf:"varint,3,opt,name=isOn,proto3" json:"isOn,omitempty"`
UniqueId string `protobuf:"bytes,4,opt,name=uniqueId,proto3" json:"uniqueId,omitempty"`
Secret string `protobuf:"bytes,5,opt,name=secret,proto3" json:"secret,omitempty"`
StatusJSON []byte `protobuf:"bytes,6,opt,name=statusJSON,proto3" json:"statusJSON,omitempty"`
IsInstalled bool `protobuf:"varint,7,opt,name=isInstalled,proto3" json:"isInstalled,omitempty"`
InstallDir string `protobuf:"bytes,9,opt,name=installDir,proto3" json:"installDir,omitempty"`
IsUp bool `protobuf:"varint,8,opt,name=isUp,proto3" json:"isUp,omitempty"`
IsActive bool `protobuf:"varint,10,opt,name=isActive,proto3" json:"isActive,omitempty"`
ConnectedAPINodeIds []int64 `protobuf:"varint,11,rep,packed,name=connectedAPINodeIds,proto3" json:"connectedAPINodeIds,omitempty"`
ApiNodeAddrsJSON []byte `protobuf:"bytes,12,opt,name=apiNodeAddrsJSON,proto3" json:"apiNodeAddrsJSON,omitempty"`
NsCluster *NSCluster `protobuf:"bytes,32,opt,name=nsCluster,proto3" json:"nsCluster,omitempty"`
NodeLogin *NodeLogin `protobuf:"bytes,33,opt,name=nodeLogin,proto3" json:"nodeLogin,omitempty"`
InstallStatus *NodeInstallStatus `protobuf:"bytes,34,opt,name=installStatus,proto3" json:"installStatus,omitempty"`
}
func (x *NSNode) Reset() {
@@ -148,6 +150,20 @@ func (x *NSNode) GetIsActive() bool {
return false
}
func (x *NSNode) GetConnectedAPINodeIds() []int64 {
if x != nil {
return x.ConnectedAPINodeIds
}
return nil
}
func (x *NSNode) GetApiNodeAddrsJSON() []byte {
if x != nil {
return x.ApiNodeAddrsJSON
}
return nil
}
func (x *NSNode) GetNsCluster() *NSCluster {
if x != nil {
return x.NsCluster
@@ -180,7 +196,7 @@ var file_models_model_ns_node_proto_rawDesc = []byte{
0x64, 0x65, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75,
0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f,
0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9d, 0x03, 0x0a, 0x06, 0x4e, 0x53, 0x4e, 0x6f, 0x64,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfb, 0x03, 0x0a, 0x06, 0x4e, 0x53, 0x4e, 0x6f, 0x64,
0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69,
0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x03, 0x20,
@@ -197,17 +213,23 @@ var file_models_model_ns_node_proto_rawDesc = []byte{
0x12, 0x0a, 0x04, 0x69, 0x73, 0x55, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69,
0x73, 0x55, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18,
0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12,
0x2b, 0x0a, 0x09, 0x6e, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x20, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x53, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65,
0x72, 0x52, 0x09, 0x6e, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x09,
0x6e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x21, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x09,
0x6e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x3b, 0x0a, 0x0d, 0x69, 0x6e, 0x73,
0x74, 0x61, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x22, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c,
0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c,
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x30, 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e,
0x6f, 0x64, 0x65, 0x49, 0x64, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x03, 0x52, 0x13, 0x63, 0x6f,
0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64,
0x73, 0x12, 0x2a, 0x0a, 0x10, 0x61, 0x70, 0x69, 0x4e, 0x6f, 0x64, 0x65, 0x41, 0x64, 0x64, 0x72,
0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x61, 0x70, 0x69,
0x4e, 0x6f, 0x64, 0x65, 0x41, 0x64, 0x64, 0x72, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x2b, 0x0a,
0x09, 0x6e, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x53, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52,
0x09, 0x6e, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x09, 0x6e, 0x6f,
0x64, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x21, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e,
0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x09, 0x6e, 0x6f,
0x64, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x3b, 0x0a, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61,
0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x22, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15,
0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x53,
0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x53, 0x74,
0x61, 0x74, 0x75, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -0,0 +1,195 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.19.4
// source: models/model_ns_plan.proto
package pb
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type NSPlan struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
IsOn bool `protobuf:"varint,3,opt,name=isOn,proto3" json:"isOn,omitempty"`
MonthlyPrice float32 `protobuf:"fixed32,4,opt,name=monthlyPrice,proto3" json:"monthlyPrice,omitempty"`
YearlyPrice float32 `protobuf:"fixed32,5,opt,name=yearlyPrice,proto3" json:"yearlyPrice,omitempty"`
ConfigJSON []byte `protobuf:"bytes,6,opt,name=configJSON,proto3" json:"configJSON,omitempty"`
}
func (x *NSPlan) Reset() {
*x = NSPlan{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_ns_plan_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *NSPlan) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NSPlan) ProtoMessage() {}
func (x *NSPlan) ProtoReflect() protoreflect.Message {
mi := &file_models_model_ns_plan_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NSPlan.ProtoReflect.Descriptor instead.
func (*NSPlan) Descriptor() ([]byte, []int) {
return file_models_model_ns_plan_proto_rawDescGZIP(), []int{0}
}
func (x *NSPlan) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *NSPlan) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *NSPlan) GetIsOn() bool {
if x != nil {
return x.IsOn
}
return false
}
func (x *NSPlan) GetMonthlyPrice() float32 {
if x != nil {
return x.MonthlyPrice
}
return 0
}
func (x *NSPlan) GetYearlyPrice() float32 {
if x != nil {
return x.YearlyPrice
}
return 0
}
func (x *NSPlan) GetConfigJSON() []byte {
if x != nil {
return x.ConfigJSON
}
return nil
}
var File_models_model_ns_plan_proto protoreflect.FileDescriptor
var file_models_model_ns_plan_proto_rawDesc = []byte{
0x0a, 0x1a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e,
0x73, 0x5f, 0x70, 0x6c, 0x61, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62,
0x22, 0xa6, 0x01, 0x0a, 0x06, 0x4e, 0x53, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69,
0x73, 0x4f, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x50, 0x72,
0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68,
0x6c, 0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x79, 0x65, 0x61, 0x72, 0x6c,
0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x79, 0x65,
0x61, 0x72, 0x6c, 0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x63,
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4a, 0x53, 0x4f, 0x4e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70,
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_models_model_ns_plan_proto_rawDescOnce sync.Once
file_models_model_ns_plan_proto_rawDescData = file_models_model_ns_plan_proto_rawDesc
)
func file_models_model_ns_plan_proto_rawDescGZIP() []byte {
file_models_model_ns_plan_proto_rawDescOnce.Do(func() {
file_models_model_ns_plan_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_ns_plan_proto_rawDescData)
})
return file_models_model_ns_plan_proto_rawDescData
}
var file_models_model_ns_plan_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_ns_plan_proto_goTypes = []interface{}{
(*NSPlan)(nil), // 0: pb.NSPlan
}
var file_models_model_ns_plan_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_models_model_ns_plan_proto_init() }
func file_models_model_ns_plan_proto_init() {
if File_models_model_ns_plan_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_models_model_ns_plan_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*NSPlan); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_models_model_ns_plan_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_models_model_ns_plan_proto_goTypes,
DependencyIndexes: file_models_model_ns_plan_proto_depIdxs,
MessageInfos: file_models_model_ns_plan_proto_msgTypes,
}.Build()
File_models_model_ns_plan_proto = out.File
file_models_model_ns_plan_proto_rawDesc = nil
file_models_model_ns_plan_proto_goTypes = nil
file_models_model_ns_plan_proto_depIdxs = nil
}

View File

@@ -36,6 +36,12 @@ type NSRecord struct {
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"`
Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"`
MxPriority int32 `protobuf:"varint,12,opt,name=mxPriority,proto3" json:"mxPriority,omitempty"` // mx优先级
SrvPriority int32 `protobuf:"varint,13,opt,name=srvPriority,proto3" json:"srvPriority,omitempty"` // SRV优先级
SrvWeight int32 `protobuf:"varint,14,opt,name=srvWeight,proto3" json:"srvWeight,omitempty"` // SRV权重
SrvPort int32 `protobuf:"varint,15,opt,name=srvPort,proto3" json:"srvPort,omitempty"` // SRV端口
CaaFlag int32 `protobuf:"varint,16,opt,name=caaFlag,proto3" json:"caaFlag,omitempty"` // CAA Flag
CaaTag string `protobuf:"bytes,17,opt,name=caaTag,proto3" json:"caaTag,omitempty"` // CAA TAG
Ttl int32 `protobuf:"varint,6,opt,name=ttl,proto3" json:"ttl,omitempty"`
Weight int32 `protobuf:"varint,7,opt,name=weight,proto3" json:"weight,omitempty"`
CreatedAt int64 `protobuf:"varint,8,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
@@ -113,6 +119,48 @@ func (x *NSRecord) GetValue() string {
return ""
}
func (x *NSRecord) GetMxPriority() int32 {
if x != nil {
return x.MxPriority
}
return 0
}
func (x *NSRecord) GetSrvPriority() int32 {
if x != nil {
return x.SrvPriority
}
return 0
}
func (x *NSRecord) GetSrvWeight() int32 {
if x != nil {
return x.SrvWeight
}
return 0
}
func (x *NSRecord) GetSrvPort() int32 {
if x != nil {
return x.SrvPort
}
return 0
}
func (x *NSRecord) GetCaaFlag() int32 {
if x != nil {
return x.CaaFlag
}
return 0
}
func (x *NSRecord) GetCaaTag() string {
if x != nil {
return x.CaaTag
}
return ""
}
func (x *NSRecord) GetTtl() int32 {
if x != nil {
return x.Ttl
@@ -177,7 +225,7 @@ var file_models_model_ns_record_proto_rawDesc = []byte{
0x70, 0x62, 0x1a, 0x1c, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
0x5f, 0x6e, 0x73, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x1b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e,
0x73, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe1, 0x02,
0x73, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x04,
0x0a, 0x08, 0x4e, 0x53, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65,
0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
@@ -185,23 +233,33 @@ var file_models_model_ns_record_proto_rawDesc = []byte{
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20,
0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74,
0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x74, 0x74, 0x6c, 0x12, 0x16, 0x0a, 0x06,
0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x77, 0x65,
0x69, 0x67, 0x68, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41,
0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64,
0x41, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18,
0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64,
0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28,
0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73,
0x4f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x28,
0x0a, 0x08, 0x6e, 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x53, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x08,
0x6e, 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x27, 0x0a, 0x08, 0x6e, 0x73, 0x52, 0x6f,
0x75, 0x74, 0x65, 0x73, 0x18, 0x1f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e,
0x4e, 0x53, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x08, 0x6e, 0x73, 0x52, 0x6f, 0x75, 0x74, 0x65,
0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x78,
0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a,
0x6d, 0x78, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x72,
0x76, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52,
0x0b, 0x73, 0x72, 0x76, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09,
0x73, 0x72, 0x76, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52,
0x09, 0x73, 0x72, 0x76, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x72,
0x76, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x72, 0x76,
0x50, 0x6f, 0x72, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x61, 0x61, 0x46, 0x6c, 0x61, 0x67, 0x18,
0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x61, 0x61, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x16,
0x0a, 0x06, 0x63, 0x61, 0x61, 0x54, 0x61, 0x67, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
0x63, 0x61, 0x61, 0x54, 0x61, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18, 0x06, 0x20,
0x01, 0x28, 0x05, 0x52, 0x03, 0x74, 0x74, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x77, 0x65, 0x69, 0x67,
0x68, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74,
0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x08, 0x20,
0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1c,
0x0a, 0x09, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28,
0x08, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07,
0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x76,
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x0b,
0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x28, 0x0a, 0x08, 0x6e, 0x73,
0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70,
0x62, 0x2e, 0x4e, 0x53, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x08, 0x6e, 0x73, 0x44, 0x6f,
0x6d, 0x61, 0x69, 0x6e, 0x12, 0x27, 0x0a, 0x08, 0x6e, 0x73, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x73,
0x18, 0x1f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x53, 0x52, 0x6f,
0x75, 0x74, 0x65, 0x52, 0x08, 0x6e, 0x73, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -30,13 +30,14 @@ type NSRecordHourlyStat struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
NsClusterId int64 `protobuf:"varint,1,opt,name=nsClusterId,proto3" json:"nsClusterId,omitempty"`
NsNodeId int64 `protobuf:"varint,2,opt,name=nsNodeId,proto3" json:"nsNodeId,omitempty"`
NsDomainId int64 `protobuf:"varint,3,opt,name=nsDomainId,proto3" json:"nsDomainId,omitempty"`
NsRecordId int64 `protobuf:"varint,4,opt,name=nsRecordId,proto3" json:"nsRecordId,omitempty"`
Bytes int64 `protobuf:"varint,5,opt,name=bytes,proto3" json:"bytes,omitempty"`
CountRequests int64 `protobuf:"varint,6,opt,name=countRequests,proto3" json:"countRequests,omitempty"`
CreatedAt int64 `protobuf:"varint,7,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
NsClusterId int64 `protobuf:"varint,1,opt,name=nsClusterId,proto3" json:"nsClusterId,omitempty"`
NsNodeId int64 `protobuf:"varint,2,opt,name=nsNodeId,proto3" json:"nsNodeId,omitempty"`
NsDomainId int64 `protobuf:"varint,3,opt,name=nsDomainId,proto3" json:"nsDomainId,omitempty"`
NsRecordId int64 `protobuf:"varint,4,opt,name=nsRecordId,proto3" json:"nsRecordId,omitempty"`
Bytes int64 `protobuf:"varint,5,opt,name=bytes,proto3" json:"bytes,omitempty"`
CountRequests int64 `protobuf:"varint,6,opt,name=countRequests,proto3" json:"countRequests,omitempty"`
CreatedAt int64 `protobuf:"varint,7,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
Hour string `protobuf:"bytes,8,opt,name=hour,proto3" json:"hour,omitempty"`
}
func (x *NSRecordHourlyStat) Reset() {
@@ -120,13 +121,20 @@ func (x *NSRecordHourlyStat) GetCreatedAt() int64 {
return 0
}
func (x *NSRecordHourlyStat) GetHour() string {
if x != nil {
return x.Hour
}
return ""
}
var File_models_model_ns_record_hourly_stat_proto protoreflect.FileDescriptor
var file_models_model_ns_record_hourly_stat_proto_rawDesc = []byte{
0x0a, 0x28, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e,
0x73, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x68, 0x6f, 0x75, 0x72, 0x6c, 0x79, 0x5f,
0x73, 0x74, 0x61, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xec,
0x01, 0x0a, 0x12, 0x4e, 0x53, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x6f, 0x75, 0x72, 0x6c,
0x73, 0x74, 0x61, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x80,
0x02, 0x0a, 0x12, 0x4e, 0x53, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x6f, 0x75, 0x72, 0x6c,
0x79, 0x53, 0x74, 0x61, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74,
0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6e, 0x73, 0x43, 0x6c,
0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x73, 0x4e, 0x6f, 0x64,
@@ -140,8 +148,10 @@ var file_models_model_ns_record_hourly_stat_proto_rawDesc = []byte{
0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03,
0x52, 0x0d, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12,
0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x07, 0x20, 0x01,
0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x12, 0x0a,
0x04, 0x68, 0x6f, 0x75, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x75,
0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (

View File

@@ -31,16 +31,20 @@ type NSRoute struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
IsOn bool `protobuf:"varint,2,opt,name=isOn,proto3" json:"isOn,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
RangesJSON []byte `protobuf:"bytes,4,opt,name=rangesJSON,proto3" json:"rangesJSON,omitempty"`
IsDeleted bool `protobuf:"varint,5,opt,name=isDeleted,proto3" json:"isDeleted,omitempty"`
Order int64 `protobuf:"varint,6,opt,name=order,proto3" json:"order,omitempty"`
Version int64 `protobuf:"varint,7,opt,name=version,proto3" json:"version,omitempty"`
Code string `protobuf:"bytes,8,opt,name=code,proto3" json:"code,omitempty"`
NsCluster *NSCluster `protobuf:"bytes,30,opt,name=nsCluster,proto3" json:"nsCluster,omitempty"`
NsDomain *NSDomain `protobuf:"bytes,31,opt,name=nsDomain,proto3" json:"nsDomain,omitempty"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
IsOn bool `protobuf:"varint,2,opt,name=isOn,proto3" json:"isOn,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
RangesJSON []byte `protobuf:"bytes,4,opt,name=rangesJSON,proto3" json:"rangesJSON,omitempty"`
IsDeleted bool `protobuf:"varint,5,opt,name=isDeleted,proto3" json:"isDeleted,omitempty"`
Order int32 `protobuf:"varint,6,opt,name=order,proto3" json:"order,omitempty"`
Version int64 `protobuf:"varint,7,opt,name=version,proto3" json:"version,omitempty"`
Code string `protobuf:"bytes,8,opt,name=code,proto3" json:"code,omitempty"`
IsPublic bool `protobuf:"varint,9,opt,name=isPublic,proto3" json:"isPublic,omitempty"`
Priority int32 `protobuf:"varint,10,opt,name=priority,proto3" json:"priority,omitempty"` // 优先级
UserId int64 `protobuf:"varint,11,opt,name=userId,proto3" json:"userId,omitempty"` // 所属用户ID
NsCluster *NSCluster `protobuf:"bytes,30,opt,name=nsCluster,proto3" json:"nsCluster,omitempty"`
NsDomain *NSDomain `protobuf:"bytes,31,opt,name=nsDomain,proto3" json:"nsDomain,omitempty"`
NsRouteCategory *NSRouteCategory `protobuf:"bytes,32,opt,name=nsRouteCategory,proto3" json:"nsRouteCategory,omitempty"`
}
func (x *NSRoute) Reset() {
@@ -110,7 +114,7 @@ func (x *NSRoute) GetIsDeleted() bool {
return false
}
func (x *NSRoute) GetOrder() int64 {
func (x *NSRoute) GetOrder() int32 {
if x != nil {
return x.Order
}
@@ -131,6 +135,27 @@ func (x *NSRoute) GetCode() string {
return ""
}
func (x *NSRoute) GetIsPublic() bool {
if x != nil {
return x.IsPublic
}
return false
}
func (x *NSRoute) GetPriority() int32 {
if x != nil {
return x.Priority
}
return 0
}
func (x *NSRoute) GetUserId() int64 {
if x != nil {
return x.UserId
}
return 0
}
func (x *NSRoute) GetNsCluster() *NSCluster {
if x != nil {
return x.NsCluster
@@ -145,6 +170,13 @@ func (x *NSRoute) GetNsDomain() *NSDomain {
return nil
}
func (x *NSRoute) GetNsRouteCategory() *NSRouteCategory {
if x != nil {
return x.NsRouteCategory
}
return nil
}
var File_models_model_ns_route_proto protoreflect.FileDescriptor
var file_models_model_ns_route_proto_rawDesc = []byte{
@@ -153,26 +185,37 @@ var file_models_model_ns_route_proto_rawDesc = []byte{
0x62, 0x1a, 0x1d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f,
0x6e, 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x1c, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e,
0x73, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a,
0x02, 0x0a, 0x07, 0x4e, 0x53, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73,
0x4f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x12,
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x4a, 0x53, 0x4f, 0x4e,
0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x4a, 0x53,
0x4f, 0x4e, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18,
0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64,
0x12, 0x14, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52,
0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x63, 0x6f, 0x64, 0x65, 0x12, 0x2b, 0x0a, 0x09, 0x6e, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65,
0x72, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x53, 0x43,
0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x09, 0x6e, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65,
0x72, 0x12, 0x28, 0x0a, 0x08, 0x6e, 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x1f, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x53, 0x44, 0x6f, 0x6d, 0x61, 0x69,
0x6e, 0x52, 0x08, 0x6e, 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x42, 0x06, 0x5a, 0x04, 0x2e,
0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x73, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x24,
0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x73, 0x5f,
0x72, 0x6f, 0x75, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa9, 0x03, 0x0a, 0x07, 0x4e, 0x53, 0x52, 0x6f, 0x75, 0x74, 0x65,
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64,
0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04,
0x69, 0x73, 0x4f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x61, 0x6e, 0x67,
0x65, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x72, 0x61,
0x6e, 0x67, 0x65, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x44, 0x65,
0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x44,
0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18,
0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07,
0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x76,
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73,
0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73,
0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69,
0x74, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69,
0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x0b, 0x20, 0x01,
0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2b, 0x0a, 0x09, 0x6e, 0x73,
0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e,
0x70, 0x62, 0x2e, 0x4e, 0x53, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x09, 0x6e, 0x73,
0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x28, 0x0a, 0x08, 0x6e, 0x73, 0x44, 0x6f, 0x6d,
0x61, 0x69, 0x6e, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x4e,
0x53, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x08, 0x6e, 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69,
0x6e, 0x12, 0x3d, 0x0a, 0x0f, 0x6e, 0x73, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65,
0x67, 0x6f, 0x72, 0x79, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x62, 0x2e,
0x4e, 0x53, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52,
0x0f, 0x6e, 0x73, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79,
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -189,18 +232,20 @@ func file_models_model_ns_route_proto_rawDescGZIP() []byte {
var file_models_model_ns_route_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_ns_route_proto_goTypes = []interface{}{
(*NSRoute)(nil), // 0: pb.NSRoute
(*NSCluster)(nil), // 1: pb.NSCluster
(*NSDomain)(nil), // 2: pb.NSDomain
(*NSRoute)(nil), // 0: pb.NSRoute
(*NSCluster)(nil), // 1: pb.NSCluster
(*NSDomain)(nil), // 2: pb.NSDomain
(*NSRouteCategory)(nil), // 3: pb.NSRouteCategory
}
var file_models_model_ns_route_proto_depIdxs = []int32{
1, // 0: pb.NSRoute.nsCluster:type_name -> pb.NSCluster
2, // 1: pb.NSRoute.nsDomain:type_name -> pb.NSDomain
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
3, // 2: pb.NSRoute.nsRouteCategory:type_name -> pb.NSRouteCategory
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_models_model_ns_route_proto_init() }
@@ -210,6 +255,7 @@ func file_models_model_ns_route_proto_init() {
}
file_models_model_ns_cluster_proto_init()
file_models_model_ns_domain_proto_init()
file_models_model_ns_route_category_proto_init()
if !protoimpl.UnsafeEnabled {
file_models_model_ns_route_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*NSRoute); i {

View File

@@ -0,0 +1,176 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.19.4
// source: models/model_ns_route_category.proto
package pb
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
// 线路分类
type NSRouteCategory struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
IsOn bool `protobuf:"varint,3,opt,name=isOn,proto3" json:"isOn,omitempty"`
Order int32 `protobuf:"varint,4,opt,name=order,proto3" json:"order,omitempty"`
}
func (x *NSRouteCategory) Reset() {
*x = NSRouteCategory{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_ns_route_category_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *NSRouteCategory) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NSRouteCategory) ProtoMessage() {}
func (x *NSRouteCategory) ProtoReflect() protoreflect.Message {
mi := &file_models_model_ns_route_category_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NSRouteCategory.ProtoReflect.Descriptor instead.
func (*NSRouteCategory) Descriptor() ([]byte, []int) {
return file_models_model_ns_route_category_proto_rawDescGZIP(), []int{0}
}
func (x *NSRouteCategory) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *NSRouteCategory) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *NSRouteCategory) GetIsOn() bool {
if x != nil {
return x.IsOn
}
return false
}
func (x *NSRouteCategory) GetOrder() int32 {
if x != nil {
return x.Order
}
return 0
}
var File_models_model_ns_route_category_proto protoreflect.FileDescriptor
var file_models_model_ns_route_category_proto_rawDesc = []byte{
0x0a, 0x24, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e,
0x73, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x5f, 0x0a, 0x0f, 0x4e, 0x53,
0x52, 0x6f, 0x75, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x0e, 0x0a,
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52,
0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x04,
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e,
0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_models_model_ns_route_category_proto_rawDescOnce sync.Once
file_models_model_ns_route_category_proto_rawDescData = file_models_model_ns_route_category_proto_rawDesc
)
func file_models_model_ns_route_category_proto_rawDescGZIP() []byte {
file_models_model_ns_route_category_proto_rawDescOnce.Do(func() {
file_models_model_ns_route_category_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_ns_route_category_proto_rawDescData)
})
return file_models_model_ns_route_category_proto_rawDescData
}
var file_models_model_ns_route_category_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_ns_route_category_proto_goTypes = []interface{}{
(*NSRouteCategory)(nil), // 0: pb.NSRouteCategory
}
var file_models_model_ns_route_category_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_models_model_ns_route_category_proto_init() }
func file_models_model_ns_route_category_proto_init() {
if File_models_model_ns_route_category_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_models_model_ns_route_category_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*NSRouteCategory); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_models_model_ns_route_category_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_models_model_ns_route_category_proto_goTypes,
DependencyIndexes: file_models_model_ns_route_category_proto_depIdxs,
MessageInfos: file_models_model_ns_route_category_proto_msgTypes,
}.Build()
File_models_model_ns_route_category_proto = out.File
file_models_model_ns_route_category_proto_rawDesc = nil
file_models_model_ns_route_category_proto_goTypes = nil
file_models_model_ns_route_category_proto_depIdxs = nil
}

View File

@@ -0,0 +1,224 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.19.4
// source: models/model_ns_user_plan.proto
package pb
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type NSUserPlan struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
NsPlanId int64 `protobuf:"varint,2,opt,name=nsPlanId,proto3" json:"nsPlanId,omitempty"`
UserId int64 `protobuf:"varint,3,opt,name=userId,proto3" json:"userId,omitempty"`
DayFrom string `protobuf:"bytes,4,opt,name=dayFrom,proto3" json:"dayFrom,omitempty"`
DayTo string `protobuf:"bytes,5,opt,name=dayTo,proto3" json:"dayTo,omitempty"`
PeriodUnit string `protobuf:"bytes,6,opt,name=periodUnit,proto3" json:"periodUnit,omitempty"`
NsPlan *NSPlan `protobuf:"bytes,30,opt,name=nsPlan,proto3" json:"nsPlan,omitempty"`
User *User `protobuf:"bytes,31,opt,name=user,proto3" json:"user,omitempty"`
}
func (x *NSUserPlan) Reset() {
*x = NSUserPlan{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_ns_user_plan_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *NSUserPlan) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NSUserPlan) ProtoMessage() {}
func (x *NSUserPlan) ProtoReflect() protoreflect.Message {
mi := &file_models_model_ns_user_plan_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NSUserPlan.ProtoReflect.Descriptor instead.
func (*NSUserPlan) Descriptor() ([]byte, []int) {
return file_models_model_ns_user_plan_proto_rawDescGZIP(), []int{0}
}
func (x *NSUserPlan) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *NSUserPlan) GetNsPlanId() int64 {
if x != nil {
return x.NsPlanId
}
return 0
}
func (x *NSUserPlan) GetUserId() int64 {
if x != nil {
return x.UserId
}
return 0
}
func (x *NSUserPlan) GetDayFrom() string {
if x != nil {
return x.DayFrom
}
return ""
}
func (x *NSUserPlan) GetDayTo() string {
if x != nil {
return x.DayTo
}
return ""
}
func (x *NSUserPlan) GetPeriodUnit() string {
if x != nil {
return x.PeriodUnit
}
return ""
}
func (x *NSUserPlan) GetNsPlan() *NSPlan {
if x != nil {
return x.NsPlan
}
return nil
}
func (x *NSUserPlan) GetUser() *User {
if x != nil {
return x.User
}
return nil
}
var File_models_model_ns_user_plan_proto protoreflect.FileDescriptor
var file_models_model_ns_user_plan_proto_rawDesc = []byte{
0x0a, 0x1f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e,
0x73, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x70, 0x6c, 0x61, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x1a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f,
0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x73, 0x5f, 0x70, 0x6c, 0x61, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x1a, 0x17, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f,
0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe2, 0x01, 0x0a, 0x0a, 0x4e,
0x53, 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x73, 0x50,
0x6c, 0x61, 0x6e, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6e, 0x73, 0x50,
0x6c, 0x61, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18,
0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a,
0x07, 0x64, 0x61, 0x79, 0x46, 0x72, 0x6f, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
0x64, 0x61, 0x79, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x61, 0x79, 0x54, 0x6f,
0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x61, 0x79, 0x54, 0x6f, 0x12, 0x1e, 0x0a,
0x0a, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x55, 0x6e, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x22, 0x0a,
0x06, 0x6e, 0x73, 0x50, 0x6c, 0x61, 0x6e, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e,
0x70, 0x62, 0x2e, 0x4e, 0x53, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x06, 0x6e, 0x73, 0x50, 0x6c, 0x61,
0x6e, 0x12, 0x1c, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x08, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x42,
0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_models_model_ns_user_plan_proto_rawDescOnce sync.Once
file_models_model_ns_user_plan_proto_rawDescData = file_models_model_ns_user_plan_proto_rawDesc
)
func file_models_model_ns_user_plan_proto_rawDescGZIP() []byte {
file_models_model_ns_user_plan_proto_rawDescOnce.Do(func() {
file_models_model_ns_user_plan_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_ns_user_plan_proto_rawDescData)
})
return file_models_model_ns_user_plan_proto_rawDescData
}
var file_models_model_ns_user_plan_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_ns_user_plan_proto_goTypes = []interface{}{
(*NSUserPlan)(nil), // 0: pb.NSUserPlan
(*NSPlan)(nil), // 1: pb.NSPlan
(*User)(nil), // 2: pb.User
}
var file_models_model_ns_user_plan_proto_depIdxs = []int32{
1, // 0: pb.NSUserPlan.nsPlan:type_name -> pb.NSPlan
2, // 1: pb.NSUserPlan.user:type_name -> pb.User
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_models_model_ns_user_plan_proto_init() }
func file_models_model_ns_user_plan_proto_init() {
if File_models_model_ns_user_plan_proto != nil {
return
}
file_models_model_ns_plan_proto_init()
file_models_model_user_proto_init()
if !protoimpl.UnsafeEnabled {
file_models_model_ns_user_plan_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*NSUserPlan); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_models_model_ns_user_plan_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_models_model_ns_user_plan_proto_goTypes,
DependencyIndexes: file_models_model_ns_user_plan_proto_depIdxs,
MessageInfos: file_models_model_ns_user_plan_proto_msgTypes,
}.Build()
File_models_model_ns_user_plan_proto = out.File
file_models_model_ns_user_plan_proto_rawDesc = nil
file_models_model_ns_user_plan_proto_goTypes = nil
file_models_model_ns_user_plan_proto_depIdxs = nil
}

View File

@@ -0,0 +1,244 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.19.4
// source: models/model_order_method.proto
package pb
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
// 订单支付方式
type OrderMethod struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Code string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"`
Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
Secret string `protobuf:"bytes,6,opt,name=secret,proto3" json:"secret,omitempty"`
IsOn bool `protobuf:"varint,7,opt,name=isOn,proto3" json:"isOn,omitempty"`
Url string `protobuf:"bytes,5,opt,name=url,proto3" json:"url,omitempty"`
ParentCode string `protobuf:"bytes,8,opt,name=parentCode,proto3" json:"parentCode,omitempty"`
Params []byte `protobuf:"bytes,9,opt,name=params,proto3" json:"params,omitempty"`
ClientType string `protobuf:"bytes,10,opt,name=clientType,proto3" json:"clientType,omitempty"`
QrcodeTitle string `protobuf:"bytes,11,opt,name=qrcodeTitle,proto3" json:"qrcodeTitle,omitempty"`
}
func (x *OrderMethod) Reset() {
*x = OrderMethod{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_order_method_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *OrderMethod) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*OrderMethod) ProtoMessage() {}
func (x *OrderMethod) ProtoReflect() protoreflect.Message {
mi := &file_models_model_order_method_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use OrderMethod.ProtoReflect.Descriptor instead.
func (*OrderMethod) Descriptor() ([]byte, []int) {
return file_models_model_order_method_proto_rawDescGZIP(), []int{0}
}
func (x *OrderMethod) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *OrderMethod) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *OrderMethod) GetCode() string {
if x != nil {
return x.Code
}
return ""
}
func (x *OrderMethod) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
func (x *OrderMethod) GetSecret() string {
if x != nil {
return x.Secret
}
return ""
}
func (x *OrderMethod) GetIsOn() bool {
if x != nil {
return x.IsOn
}
return false
}
func (x *OrderMethod) GetUrl() string {
if x != nil {
return x.Url
}
return ""
}
func (x *OrderMethod) GetParentCode() string {
if x != nil {
return x.ParentCode
}
return ""
}
func (x *OrderMethod) GetParams() []byte {
if x != nil {
return x.Params
}
return nil
}
func (x *OrderMethod) GetClientType() string {
if x != nil {
return x.ClientType
}
return ""
}
func (x *OrderMethod) GetQrcodeTitle() string {
if x != nil {
return x.QrcodeTitle
}
return ""
}
var File_models_model_order_method_proto protoreflect.FileDescriptor
var file_models_model_order_method_proto_rawDesc = []byte{
0x0a, 0x1f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6f,
0x72, 0x64, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x9f, 0x02, 0x0a, 0x0b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x4d,
0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a,
0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01,
0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12,
0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52,
0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18,
0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x75,
0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1e, 0x0a,
0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a,
0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70,
0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54,
0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e,
0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x71, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x54,
0x69, 0x74, 0x6c, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x71, 0x72, 0x63, 0x6f,
0x64, 0x65, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_models_model_order_method_proto_rawDescOnce sync.Once
file_models_model_order_method_proto_rawDescData = file_models_model_order_method_proto_rawDesc
)
func file_models_model_order_method_proto_rawDescGZIP() []byte {
file_models_model_order_method_proto_rawDescOnce.Do(func() {
file_models_model_order_method_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_order_method_proto_rawDescData)
})
return file_models_model_order_method_proto_rawDescData
}
var file_models_model_order_method_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_order_method_proto_goTypes = []interface{}{
(*OrderMethod)(nil), // 0: pb.OrderMethod
}
var file_models_model_order_method_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_models_model_order_method_proto_init() }
func file_models_model_order_method_proto_init() {
if File_models_model_order_method_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_models_model_order_method_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*OrderMethod); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_models_model_order_method_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_models_model_order_method_proto_goTypes,
DependencyIndexes: file_models_model_order_method_proto_depIdxs,
MessageInfos: file_models_model_order_method_proto_msgTypes,
}.Build()
File_models_model_order_method_proto = out.File
file_models_model_order_method_proto_rawDesc = nil
file_models_model_order_method_proto_goTypes = nil
file_models_model_order_method_proto_depIdxs = nil
}

View File

@@ -37,6 +37,7 @@ type Origin struct {
Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
Domains []string `protobuf:"bytes,6,rep,name=domains,proto3" json:"domains,omitempty"`
Host string `protobuf:"bytes,7,opt,name=host,proto3" json:"host,omitempty"`
FollowPort bool `protobuf:"varint,8,opt,name=followPort,proto3" json:"followPort,omitempty"`
}
func (x *Origin) Reset() {
@@ -120,6 +121,13 @@ func (x *Origin) GetHost() string {
return ""
}
func (x *Origin) GetFollowPort() bool {
if x != nil {
return x.FollowPort
}
return false
}
var File_models_model_origin_proto protoreflect.FileDescriptor
var file_models_model_origin_proto_rawDesc = []byte{
@@ -127,7 +135,7 @@ var file_models_model_origin_proto_rawDesc = []byte{
0x72, 0x69, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a,
0x22, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x65,
0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x22, 0xb8, 0x01, 0x0a, 0x06, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x0e,
0x6f, 0x74, 0x6f, 0x22, 0xd8, 0x01, 0x0a, 0x06, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12,
0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73,
0x4f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
@@ -138,7 +146,9 @@ var file_models_model_origin_proto_rawDesc = []byte{
0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e,
0x12, 0x18, 0x0a, 0x07, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28,
0x09, 0x52, 0x07, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f,
0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x42, 0x06,
0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x1e,
0x0a, 0x0a, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x08, 0x20, 0x01,
0x28, 0x08, 0x52, 0x0a, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x50, 0x6f, 0x72, 0x74, 0x42, 0x06,
0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}

View File

@@ -39,9 +39,9 @@ type Plan struct {
PriceType string `protobuf:"bytes,7,opt,name=priceType,proto3" json:"priceType,omitempty"`
TrafficPriceJSON []byte `protobuf:"bytes,8,opt,name=trafficPriceJSON,proto3" json:"trafficPriceJSON,omitempty"`
BandwidthPriceJSON []byte `protobuf:"bytes,12,opt,name=bandwidthPriceJSON,proto3" json:"bandwidthPriceJSON,omitempty"`
MonthlyPrice float32 `protobuf:"fixed32,9,opt,name=monthlyPrice,proto3" json:"monthlyPrice,omitempty"`
SeasonallyPrice float32 `protobuf:"fixed32,10,opt,name=seasonallyPrice,proto3" json:"seasonallyPrice,omitempty"`
YearlyPrice float32 `protobuf:"fixed32,11,opt,name=yearlyPrice,proto3" json:"yearlyPrice,omitempty"`
MonthlyPrice float64 `protobuf:"fixed64,9,opt,name=monthlyPrice,proto3" json:"monthlyPrice,omitempty"`
SeasonallyPrice float64 `protobuf:"fixed64,10,opt,name=seasonallyPrice,proto3" json:"seasonallyPrice,omitempty"`
YearlyPrice float64 `protobuf:"fixed64,11,opt,name=yearlyPrice,proto3" json:"yearlyPrice,omitempty"`
}
func (x *Plan) Reset() {
@@ -139,21 +139,21 @@ func (x *Plan) GetBandwidthPriceJSON() []byte {
return nil
}
func (x *Plan) GetMonthlyPrice() float32 {
func (x *Plan) GetMonthlyPrice() float64 {
if x != nil {
return x.MonthlyPrice
}
return 0
}
func (x *Plan) GetSeasonallyPrice() float32 {
func (x *Plan) GetSeasonallyPrice() float64 {
if x != nil {
return x.SeasonallyPrice
}
return 0
}
func (x *Plan) GetYearlyPrice() float32 {
func (x *Plan) GetYearlyPrice() float64 {
if x != nil {
return x.YearlyPrice
}
@@ -184,12 +184,12 @@ var file_models_model_plan_proto_rawDesc = []byte{
0x64, 0x74, 0x68, 0x50, 0x72, 0x69, 0x63, 0x65, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x0c, 0x20, 0x01,
0x28, 0x0c, 0x52, 0x12, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x50, 0x72, 0x69,
0x63, 0x65, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c,
0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0c, 0x6d, 0x6f,
0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0c, 0x6d, 0x6f,
0x6e, 0x74, 0x68, 0x6c, 0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x73, 0x65,
0x61, 0x73, 0x6f, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0a, 0x20,
0x01, 0x28, 0x02, 0x52, 0x0f, 0x73, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x50,
0x01, 0x28, 0x01, 0x52, 0x0f, 0x73, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x50,
0x72, 0x69, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x79, 0x65, 0x61, 0x72, 0x6c, 0x79, 0x50, 0x72,
0x69, 0x63, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x79, 0x65, 0x61, 0x72, 0x6c,
0x69, 0x63, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x79, 0x65, 0x61, 0x72, 0x6c,
0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}

View File

@@ -34,6 +34,9 @@ type RegionCity struct {
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Codes []string `protobuf:"bytes,3,rep,name=codes,proto3" json:"codes,omitempty"`
RegionProvinceId int64 `protobuf:"varint,4,opt,name=regionProvinceId,proto3" json:"regionProvinceId,omitempty"`
CustomName string `protobuf:"bytes,5,opt,name=customName,proto3" json:"customName,omitempty"`
CustomCodes []string `protobuf:"bytes,6,rep,name=customCodes,proto3" json:"customCodes,omitempty"`
DisplayName string `protobuf:"bytes,7,opt,name=displayName,proto3" json:"displayName,omitempty"`
RegionProvince *RegionProvince `protobuf:"bytes,30,opt,name=regionProvince,proto3" json:"regionProvince,omitempty"`
}
@@ -97,6 +100,27 @@ func (x *RegionCity) GetRegionProvinceId() int64 {
return 0
}
func (x *RegionCity) GetCustomName() string {
if x != nil {
return x.CustomName
}
return ""
}
func (x *RegionCity) GetCustomCodes() []string {
if x != nil {
return x.CustomCodes
}
return nil
}
func (x *RegionCity) GetDisplayName() string {
if x != nil {
return x.DisplayName
}
return ""
}
func (x *RegionCity) GetRegionProvince() *RegionProvince {
if x != nil {
return x.RegionProvince
@@ -111,19 +135,25 @@ var file_models_model_region_city_proto_rawDesc = []byte{
0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x12, 0x02, 0x70, 0x62, 0x1a, 0x22, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64,
0x65, 0x6c, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x6e,
0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xae, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x67,
0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x92, 0x02, 0x0a, 0x0a, 0x52, 0x65, 0x67,
0x69, 0x6f, 0x6e, 0x43, 0x69, 0x74, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63,
0x6f, 0x64, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65,
0x73, 0x12, 0x2a, 0x0a, 0x10, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69,
0x6e, 0x63, 0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x72, 0x65, 0x67,
0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x3a, 0x0a,
0x0e, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18,
0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x6f,
0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x52, 0x0e, 0x72, 0x65, 0x67, 0x69, 0x6f,
0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70,
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a,
0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a,
0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03,
0x28, 0x09, 0x52, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x12,
0x20, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x07,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d,
0x65, 0x12, 0x3a, 0x0a, 0x0e, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69,
0x6e, 0x63, 0x65, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x52,
0x65, 0x67, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x52, 0x0e, 0x72,
0x65, 0x67, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -25,15 +25,19 @@ const (
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
// 国家/地区
type RegionCountry struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Codes []string `protobuf:"bytes,3,rep,name=codes,proto3" json:"codes,omitempty"`
Pinyin []string `protobuf:"bytes,4,rep,name=pinyin,proto3" json:"pinyin,omitempty"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Codes []string `protobuf:"bytes,3,rep,name=codes,proto3" json:"codes,omitempty"`
Pinyin []string `protobuf:"bytes,4,rep,name=pinyin,proto3" json:"pinyin,omitempty"`
CustomName string `protobuf:"bytes,5,opt,name=customName,proto3" json:"customName,omitempty"`
CustomCodes []string `protobuf:"bytes,6,rep,name=customCodes,proto3" json:"customCodes,omitempty"`
DisplayName string `protobuf:"bytes,7,opt,name=displayName,proto3" json:"displayName,omitempty"`
}
func (x *RegionCountry) Reset() {
@@ -96,19 +100,46 @@ func (x *RegionCountry) GetPinyin() []string {
return nil
}
func (x *RegionCountry) GetCustomName() string {
if x != nil {
return x.CustomName
}
return ""
}
func (x *RegionCountry) GetCustomCodes() []string {
if x != nil {
return x.CustomCodes
}
return nil
}
func (x *RegionCountry) GetDisplayName() string {
if x != nil {
return x.DisplayName
}
return ""
}
var File_models_model_region_country_proto protoreflect.FileDescriptor
var file_models_model_region_country_proto_rawDesc = []byte{
0x0a, 0x21, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x72,
0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x61, 0x0a, 0x0d, 0x52, 0x65, 0x67, 0x69, 0x6f,
0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05,
0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64,
0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x69, 0x6e, 0x79, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x03,
0x28, 0x09, 0x52, 0x06, 0x70, 0x69, 0x6e, 0x79, 0x69, 0x6e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xc5, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x67, 0x69,
0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a,
0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f,
0x64, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x69, 0x6e, 0x79, 0x69, 0x6e, 0x18, 0x04, 0x20,
0x03, 0x28, 0x09, 0x52, 0x06, 0x70, 0x69, 0x6e, 0x79, 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x63,
0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63,
0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09,
0x52, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x20, 0x0a,
0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01,
0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x42,
0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -30,9 +30,12 @@ type RegionProvider struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Codes []string `protobuf:"bytes,3,rep,name=codes,proto3" json:"codes,omitempty"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Codes []string `protobuf:"bytes,3,rep,name=codes,proto3" json:"codes,omitempty"`
CustomName string `protobuf:"bytes,4,opt,name=customName,proto3" json:"customName,omitempty"`
CustomCodes []string `protobuf:"bytes,5,rep,name=customCodes,proto3" json:"customCodes,omitempty"`
DisplayName string `protobuf:"bytes,6,opt,name=displayName,proto3" json:"displayName,omitempty"`
}
func (x *RegionProvider) Reset() {
@@ -88,18 +91,45 @@ func (x *RegionProvider) GetCodes() []string {
return nil
}
func (x *RegionProvider) GetCustomName() string {
if x != nil {
return x.CustomName
}
return ""
}
func (x *RegionProvider) GetCustomCodes() []string {
if x != nil {
return x.CustomCodes
}
return nil
}
func (x *RegionProvider) GetDisplayName() string {
if x != nil {
return x.DisplayName
}
return ""
}
var File_models_model_region_provider_proto protoreflect.FileDescriptor
var file_models_model_region_provider_proto_rawDesc = []byte{
0x0a, 0x22, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x72,
0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x4a, 0x0a, 0x0e, 0x52, 0x65, 0x67, 0x69,
0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14,
0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x63,
0x6f, 0x64, 0x65, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xae, 0x01, 0x0a, 0x0e, 0x52, 0x65, 0x67,
0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05,
0x63, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e,
0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f,
0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43,
0x6f, 0x64, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x75, 0x73, 0x74,
0x6f, 0x6d, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c,
0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69,
0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70,
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -30,9 +30,13 @@ type RegionProvince struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Codes []string `protobuf:"bytes,3,rep,name=codes,proto3" json:"codes,omitempty"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Codes []string `protobuf:"bytes,3,rep,name=codes,proto3" json:"codes,omitempty"`
RegionCountryId int64 `protobuf:"varint,4,opt,name=regionCountryId,proto3" json:"regionCountryId,omitempty"`
CustomName string `protobuf:"bytes,5,opt,name=customName,proto3" json:"customName,omitempty"`
CustomCodes []string `protobuf:"bytes,6,rep,name=customCodes,proto3" json:"customCodes,omitempty"`
DisplayName string `protobuf:"bytes,7,opt,name=displayName,proto3" json:"displayName,omitempty"`
}
func (x *RegionProvince) Reset() {
@@ -88,18 +92,55 @@ func (x *RegionProvince) GetCodes() []string {
return nil
}
func (x *RegionProvince) GetRegionCountryId() int64 {
if x != nil {
return x.RegionCountryId
}
return 0
}
func (x *RegionProvince) GetCustomName() string {
if x != nil {
return x.CustomName
}
return ""
}
func (x *RegionProvince) GetCustomCodes() []string {
if x != nil {
return x.CustomCodes
}
return nil
}
func (x *RegionProvince) GetDisplayName() string {
if x != nil {
return x.DisplayName
}
return ""
}
var File_models_model_region_province_proto protoreflect.FileDescriptor
var file_models_model_region_province_proto_rawDesc = []byte{
0x0a, 0x22, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x72,
0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x4a, 0x0a, 0x0e, 0x52, 0x65, 0x67, 0x69,
0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14,
0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x63,
0x6f, 0x64, 0x65, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xd8, 0x01, 0x0a, 0x0e, 0x52, 0x65, 0x67,
0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05,
0x63, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x43,
0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f,
0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x49, 0x64, 0x12,
0x1e, 0x0a, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12,
0x20, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x06,
0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x64, 0x65,
0x73, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65,
0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e,
0x61, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (

Some files were not shown because too many files have changed in this diff Show More