Compare commits

..

336 Commits

Author SHA1 Message Date
刘祥超
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
刘祥超
20469e0487 修复源站设置专属域名导致其他源站不可用的Bug 2022-06-20 07:46:41 +08:00
刘祥超
4834cb2886 增加统计服务某日、某月流量API 2022-06-18 14:25:33 +08:00
刘祥超
1f33bcfee7 创建IPList时可以指定服务ID 2022-06-15 19:22:56 +08:00
刘祥超
8f8e769ead 优化缓存任务Key状态增加执行中状态 2022-06-15 15:18:22 +08:00
刘祥超
03296c7530 城市API增加省份信息 2022-06-14 17:37:32 +08:00
刘祥超
fecfb0f888 WAF规则中增加${requestURL}参数 2022-06-09 19:43:52 +08:00
刘祥超
5e277de82b API相关提示更详细 2022-06-08 15:17:21 +08:00
刘祥超
de4366bbc3 节点状态中增加时间戳字段 2022-06-07 11:45:45 +08:00
刘祥超
a8d38937e3 可以设置用户每天执行缓存任务的额度 2022-06-05 21:15:44 +08:00
刘祥超
0ea04c9883 增加刷新、预热缓存任务管理 2022-06-05 17:14:14 +08:00
刘祥超
85553bf5d9 优化源站有专属域名情况下的算法 2022-05-23 19:59:05 +08:00
刘祥超
24f8ccb166 NodeService.FindAllEnabledNodesWithNodeClusterIdRequest()增加参数includeSecondary 2022-05-23 19:56:11 +08:00
刘祥超
fb0b1d42ef 增加LICENSE和README 2022-05-22 11:36:49 +08:00
刘祥超
38005406b0 WAF默认验证码页面显示请求ID 2022-05-21 20:00:34 +08:00
刘祥超
6aee09b22b 新创建WAF时增加默认选项 2022-05-21 18:57:59 +08:00
刘祥超
8c450a9b43 WAF策略中增加验证码相关定制设置 2022-05-20 22:10:58 +08:00
刘祥超
a660815df7 健康检查增加是否记录访问日志选项 2022-05-19 17:13:26 +08:00
刘祥超
2b6d749566 实现基础的DDoS防护 2022-05-18 21:02:58 +08:00
刘祥超
dd900700e9 增加通过IP删除IP名单中IP参数 2022-05-10 15:12:03 +08:00
刘祥超
032b171025 增加注释 2022-05-08 19:33:33 +08:00
刘祥超
ab005caa4a DNS服务商增加厂家筛选 2022-05-07 20:41:28 +08:00
刘祥超
8e91af92ae 路由规则可以单独设置UAM(仅企业版可用) 2022-05-04 20:32:03 +08:00
刘祥超
97575e29a1 节点增加DNS解析库类型设置 2022-05-04 16:40:43 +08:00
刘祥超
146b57216a WebP判断内容长度时,忽略ChunkEncoding传输的内容 2022-04-29 10:50:04 +08:00
刘祥超
2cdb0b9758 API节点增加主节点概念 2022-04-24 15:25:08 +08:00
刘祥超
a6355914b2 集群概要信息中增加系统服务状态 2022-04-22 22:04:25 +08:00
刘祥超
fdcb83cc5f IP地址信息中增加isHealthy字段 2022-04-22 21:56:41 +08:00
刘祥超
57bffa2cda 访问日志策略增加只记录WAF访问日志选项 2022-04-22 17:14:17 +08:00
刘祥超
e7189948f2 节点状态中增加本地防火墙名称 2022-04-22 14:58:50 +08:00
刘祥超
59a3a90d99 增加WAF日志配置 2022-04-21 19:44:33 +08:00
刘祥超
5619d0e026 节点状态记录是否检查到本地防火墙 2022-04-21 18:14:58 +08:00
刘祥超
21d58764cc IP列表增加名单类型筛选 2022-04-21 15:09:11 +08:00
刘祥超
2e17fc4368 WAF策略默认开启记录日志 2022-04-21 09:38:56 +08:00
刘祥超
4e921330db 服务修改所属集群时可以选择是否保留旧的配置 2022-04-18 21:11:52 +08:00
刘祥超
83423c1450 访问日志可以使用分表查询 2022-04-17 16:18:58 +08:00
刘祥超
9d011f4982 服务列表增加下行带宽 2022-04-15 12:14:42 +08:00
刘祥超
6369458877 将“HTTP反向代理”改为“CDN加速”/调整部分文字描述 2022-04-14 15:59:21 +08:00
刘祥超
f855996d53 改进单元测试 2022-04-14 15:21:20 +08:00
刘祥超
e75248ad6b 服务列表中分组信息中增加UserId字段 2022-04-13 15:01:55 +08:00
刘祥超
8ccbe99fbc 按天统计流量接口可以预估某日同时间流量 2022-04-10 21:25:29 +08:00
刘祥超
977358a3ab 增加当日统计接口 2022-04-07 19:46:54 +08:00
刘祥超
67154237fb 优化节点列表 2022-04-07 18:31:51 +08:00
刘祥超
d71b545971 增加Sendfile相关选项 2022-04-04 19:45:26 +08:00
刘祥超
7908d70750 优化代码 2022-04-04 19:44:45 +08:00
刘祥超
8722c8a34a 优化代码 2022-04-04 16:42:56 +08:00
刘祥超
7488d0b334 支持L2节点配置 2022-04-04 16:42:11 +08:00
刘祥超
d86f2bc1a4 集群可以设置WebP策略 2022-04-01 16:20:36 +08:00
刘祥超
6c1514cad7 用户权限增加5秒盾、WebP 2022-03-31 15:52:23 +08:00
刘祥超
c132bd9c1e 优化代码 2022-03-31 15:19:13 +08:00
刘祥超
f733282b48 可以用域名搜索DNS账号 2022-03-30 11:15:42 +08:00
刘祥超
4396b0fe74 IP列表可以使用级别筛选 2022-03-30 09:39:21 +08:00
刘祥超
04ab37ce23 商业版增加UAM功能 2022-03-29 21:24:36 +08:00
刘祥超
01ca35f6a9 可以自行设定指标数据保留时间 2022-03-28 09:36:56 +08:00
刘祥超
1c337ec40e 按日统计的指标数据保留时间改为8个周期 2022-03-28 09:03:01 +08:00
刘祥超
aebafacda2 优化代码 2022-03-28 08:48:35 +08:00
刘祥超
59b93bfbe1 优化看板打开速度 2022-03-27 16:39:41 +08:00
刘祥超
eccc56369b 时区增加UTC 2022-03-26 10:32:56 +08:00
刘祥超
75221eb855 管理界面和用户界面增加时区设置 2022-03-26 10:26:24 +08:00
刘祥超
b8d45ab42e 增加脚本相关配置和RPC接口 2022-03-25 14:12:12 +08:00
刘祥超
bc2c6a56ed CA证书支持只有一级证书 2022-03-24 09:25:48 +08:00
刘祥超
1becfdcd67 可以修复单页或者全部服务日志 2022-03-23 17:31:11 +08:00
刘祥超
b90e684580 更新相关库 2022-03-20 10:43:52 +08:00
刘祥超
a3bd4b1b0a 改进SQL注入检测 2022-03-19 15:41:25 +08:00
刘祥超
b6f4e5ce13 OCSP支持过期时间 2022-03-18 20:20:28 +08:00
刘祥超
5fd12b809a 动态更新OCSP 2022-03-18 17:04:53 +08:00
刘祥超
573f1fe22f 源站支持自定义回源主机名 2022-03-17 15:48:16 +08:00
刘祥超
024f30ec36 增加置顶集群功能 2022-03-17 11:13:04 +08:00
刘祥超
87a3df3645 IPSet支持IPv6 2022-03-16 20:48:00 +08:00
刘祥超
470314c32e 节点可以单独设置缓存目录 2022-03-16 15:24:56 +08:00
刘祥超
6bf49e4532 初始化文件缓存选项时同时也初始化内存策略 2022-03-15 21:34:12 +08:00
刘祥超
b7dfd4390a 缓存策略可以使用存储类型筛选 2022-03-14 15:42:20 +08:00
刘祥超
454e2ad4fe 实现回源跟随功能 2022-03-14 15:07:33 +08:00
刘祥超
9d859f3c27 增加证书OCSP错误日志管理 2022-03-11 20:27:57 +08:00
刘祥超
25061495d0 增加OCSP Stapling功能 2022-03-10 11:54:58 +08:00
刘祥超
8eca3165df 支持使用小时筛选访问日志 2022-03-09 11:01:00 +08:00
刘祥超
97690f4dfd 增加对访问日志自动分表配置 2022-03-09 10:01:29 +08:00
刘祥超
757d316a53 当缓存条件状态码为206时,自动支持区间缓存 2022-03-04 17:00:37 +08:00
刘祥超
1d681d5029 更新protoc版本 2022-03-04 15:44:39 +08:00
刘祥超
9a8dc8b73e 更新TeaGo 2022-03-04 15:11:58 +08:00
刘祥超
ff6b526747 添加 yaml.v3 2022-03-04 12:28:09 +08:00
刘祥超
4c8081c52b 更新相关依赖库 2022-03-04 12:21:23 +08:00
刘祥超
d93f9b84b5 增加206 partial content相关缓存配置 2022-03-03 19:36:58 +08:00
刘祥超
c9ae4c4289 管理界面设置增加每页显示数设置 2022-02-26 21:02:34 +08:00
刘祥超
274c4fe122 缓存可以设置是否使用系统默认设置 2022-02-24 20:39:17 +08:00
刘祥超
6be39294d0 增加是否同步写入压缩缓存设置 2022-02-24 20:13:16 +08:00
刘祥超
08b9db2f96 URL跳转可以设置是否保留参数 2022-02-20 09:17:38 +08:00
刘祥超
5a781d8d17 支持默认价格设置 2022-01-23 20:16:11 +08:00
刘祥超
690ddb99b8 实现带宽计费套餐 2022-01-23 19:16:58 +08:00
刘祥超
9ef1882a79 支持单个服务更新 2022-01-19 22:15:52 +08:00
刘祥超
dc001cc06c 增加API方法调用耗时统计 2022-01-19 16:54:03 +08:00
刘祥超
487ecbc1a5 源站支持客户端证书 2022-01-16 19:51:30 +08:00
刘祥超
406d5dcc63 CAPTCHA增加多个选项 2022-01-16 16:53:34 +08:00
刘祥超
89e8ef41fc 实现open file cache 2022-01-12 21:09:23 +08:00
刘祥超
fa4ba857bd 可以使用集群搜索WAF策略、缓存策略 2022-01-11 15:46:21 +08:00
刘祥超
b52dd3a2dc 运行日志可以使用集群、节点筛选 2022-01-11 14:59:45 +08:00
刘祥超
94d2867129 访问日志可以使用集群和节点搜索 2022-01-11 12:02:40 +08:00
刘祥超
86f10b8ec2 增加读取当日拦截数API 2022-01-11 09:47:05 +08:00
刘祥超
7aff314e72 增加默认的SYN Flood配置 2022-01-10 20:07:43 +08:00
刘祥超
b2d477345f 实现自动SYN Flood防护 2022-01-10 19:54:18 +08:00
刘祥超
b4f5f28102 WAF模板--爬虫工具默认不封禁搜索引擎 2022-01-10 10:56:08 +08:00
刘祥超
1ddb90ef74 WAF模板--爬虫工具增加白名单 2022-01-10 10:27:08 +08:00
刘祥超
78456d2205 WAF模板中特殊目录增加.env 2022-01-09 20:29:46 +08:00
刘祥超
e6aa738435 WAF策略增加是否使用本地防火墙设置 2022-01-09 17:05:24 +08:00
刘祥超
7f53af08e6 节点配置增加产品信息 2022-01-09 10:44:26 +08:00
刘祥超
8517eec344 IP名单增加未读状态 2022-01-08 16:48:01 +08:00
刘祥超
5fcdc76b8c 增加geo、isp、browser相关变量说明 2022-01-06 17:05:24 +08:00
刘祥超
23830c977c 增加城市/ISP查询接口;WAF增加国家/地区、省份、城市、ISP等参数 2022-01-06 16:24:33 +08:00
刘祥超
572d41985a 用户创建服务时刻自动添加到分组、自动添加统计功能、设置是否需要绑定套餐 2022-01-05 15:55:25 +08:00
刘祥超
b03970f578 用户列表可以使用待审核、关键词搜索 2022-01-05 11:11:54 +08:00
刘祥超
36974e3eb4 实现用户审核功能 2022-01-05 10:44:58 +08:00
刘祥超
6eec55f3c3 优化脚本代码配置 2022-01-03 21:51:24 +08:00
刘祥超
d5e21f2c95 尝试自动在firewalld中开放端口 2022-01-03 16:28:02 +08:00
刘祥超
94e9ab5a0e 节点日志可以使用标签筛选 2022-01-03 11:03:43 +08:00
刘祥超
30f53d50f0 增加边缘脚本相关配置 2022-01-01 21:51:15 +08:00
刘祥超
2bf0c40328 增加常量 2021-12-22 16:43:26 +08:00
刘祥超
4c2156a4ac 增加自动检查系统更新设置 2021-12-21 15:17:04 +08:00
刘祥超
a913996000 优化内置WAF模板 2021-12-21 12:08:49 +08:00
刘祥超
a74f930d42 访问日志限制字段 2021-12-19 20:39:27 +08:00
刘祥超
4e22f4954e 修改相关域名 2021-12-17 14:19:43 +08:00
刘祥超
73d049b380 增加stale cache配置 2021-12-16 17:28:02 +08:00
刘祥超
9171242c37 HTTP Header:实现请求方法、域名、状态码等限制,实现内容替换功能 2021-12-14 21:26:43 +08:00
刘祥超
12985e1bd9 定义访问日志队列 2021-12-14 12:42:47 +08:00
刘祥超
d5af0a740a 优化代码 2021-12-13 15:36:46 +08:00
刘祥超
28e93c05a2 优化代码 2021-12-13 15:31:03 +08:00
刘祥超
173175a248 优化代码 2021-12-13 14:58:45 +08:00
刘祥超
abd5c6dbb1 WAF策略:可以修改分组代号/导入时可以根据名称合并 2021-12-12 20:24:41 +08:00
刘祥超
b333a90532 服务分组可以设置请求限制 2021-12-12 17:07:12 +08:00
刘祥超
309f0ea85b 路由规则增加专属域名设置 2021-12-12 16:38:18 +08:00
刘祥超
f080088e19 请求条件增加不区分大小写选项 2021-12-12 16:11:11 +08:00
刘祥超
15c952e6eb 实现请求连接数等限制 2021-12-12 11:44:58 +08:00
刘祥超
31a04b32b1 支持设置单节点最大线程数、单节点TCP最大连接数 2021-12-09 18:49:44 +08:00
刘祥超
252b8af422 可以在缓存条件里设置Expires Header 2021-12-08 17:40:27 +08:00
刘祥超
00e46c6e3d 增加批量增加节点IP接口 2021-12-07 18:21:39 +08:00
刘祥超
fe000f23bd 访问日志实现记录requestBody 2021-12-07 14:57:33 +08:00
刘祥超
fe9a942f4c 访问日志暂时去除响应Body字段 2021-12-07 14:57:14 +08:00
刘祥超
50893b34c6 缓存默认支持所有请求方法 2021-12-07 10:48:11 +08:00
刘祥超
01c7f2b714 缓存支持请求方法设置 2021-12-07 10:43:34 +08:00
刘祥超
50bd3fd1a9 增加${isArgs}变量说明 2021-12-07 10:04:03 +08:00
刘祥超
709e499de6 SSH认证支持sudo 2021-12-06 19:23:18 +08:00
刘祥超
d56b1c2f83 SSL证书自动设置Leaf字段以提升性能 2021-12-06 10:54:43 +08:00
刘祥超
0c2215ec74 自动将API节点的IP加入到白名单,防止误封 2021-12-06 10:09:44 +08:00
刘祥超
acffd92fad 服务看板增加区域地图 2021-12-06 09:16:12 +08:00
刘祥超
b2af030559 商业版WAF看板增加地图 2021-12-05 19:38:23 +08:00
刘祥超
effd44c53b 国家/地区统计时上传流量、攻击量等信息 2021-12-05 18:57:42 +08:00
刘祥超
6545dfa3e3 优化看板 2021-12-03 15:49:10 +08:00
刘祥超
ac8752ec4f 优化指标统计数据清理 2021-12-03 15:49:04 +08:00
刘祥超
c396a8e7f8 支持规则集忽略局域网IP 2021-12-02 16:08:29 +08:00
刘祥超
6a22ee94d5 反向代理如果只有一个源站时,则快速返回,避免因为状态的改变而不停地转换 2021-12-02 15:04:39 +08:00
刘祥超
9184986717 多个提示页面增加请求ID 2021-12-02 14:44:56 +08:00
刘祥超
b90115ba2e 缓存配置增加是否支持Cache-Control: max-age=... 2021-12-02 10:17:55 +08:00
刘祥超
fefe52a56f 增加AddAgeHeader 2021-12-02 10:03:14 +08:00
刘祥超
f0d3cc7d4d 查询源站时加互斥锁 2021-12-01 21:20:42 +08:00
刘祥超
06523bf61f 增加是否记录499选项 2021-12-01 21:14:07 +08:00
刘祥超
615711924a 审核中服务增加提交审核时间 2021-12-01 17:06:32 +08:00
刘祥超
211d3c5067 服务分模块加载,防止某个模块加载失败时相互受影响 2021-12-01 15:59:15 +08:00
刘祥超
545aa771bf 节点配置初始化时返回服务相关错误 2021-12-01 15:51:05 +08:00
刘祥超
99af79c9c2 优化节点日志 2021-11-30 16:42:27 +08:00
刘祥超
02420aacc5 优化代码 2021-11-29 20:36:02 +08:00
刘祥超
f7e8345f88 用户账单增加多个API 2021-11-29 14:34:05 +08:00
刘祥超
5bd21861ab 增加对map进行base64编解码的函数 2021-11-29 10:49:56 +08:00
刘祥超
01d575edb0 完善套餐 2021-11-28 20:11:54 +08:00
刘祥超
557576cafc 节点任务查询时增加排除的任务类型 2021-11-27 17:07:06 +08:00
刘祥超
12a2dde2e6 优化检查端口是否已被使用API 2021-11-24 19:47:48 +08:00
刘祥超
ccb326603c 优化API命名 2021-11-24 12:01:00 +08:00
刘祥超
c5d47ae35d 优化RPC相关错误的文字提示 2021-11-21 15:55:52 +08:00
刘祥超
d2c99b4db4 增加批量从IP名单中删除IP的API 2021-11-21 09:42:39 +08:00
刘祥超
561150ab28 增加获取当前API节点信息API/增加修改节点API节点地址消息类型 2021-11-21 09:41:38 +08:00
刘祥超
d60e0164db IP地址“健康检查失败”阈值改为“健康检查结果” 2021-11-18 14:47:34 +08:00
刘祥超
886969f4ee 节点IP阈值增加节点健康检查失败 2021-11-18 14:30:58 +08:00
刘祥超
422b71d9b1 修复查找域名对应服务时可能造成的死锁 2021-11-17 21:57:03 +08:00
刘祥超
89fa27a883 IP名单增加是否只显示自动拦截名单选项 2021-11-17 20:25:40 +08:00
刘祥超
a67cf6b596 增加全局查看、检索IP功能 2021-11-17 19:51:04 +08:00
刘祥超
80b21ea362 IP名单增加是否全局 2021-11-17 16:15:01 +08:00
刘祥超
35b69141c1 IP名单中IP创建时保存相关节点、服务、WAF策略信息 2021-11-16 16:10:52 +08:00
刘祥超
f4edd45886 提升通过域名查找服务的性能,轻松支持海量域名 2021-11-15 16:56:31 +08:00
刘祥超
a95fe17ebc IP名单API增加IP添加时间 2021-11-15 11:31:20 +08:00
刘祥超
f178c19348 缓存策略增加若干选项 2021-11-14 16:21:31 +08:00
刘祥超
a46ba472bb 缓存策略增加若干选项 2021-11-13 21:02:09 +08:00
刘祥超
3c10fa6b0a 节点配置支持压缩传输 2021-11-11 14:17:45 +08:00
刘祥超
2d9bb319fe 增加账单、套餐相关配置 2021-11-11 08:31:32 +08:00
刘祥超
698d1b697c 改进流量限制 2021-11-10 14:39:13 +08:00
刘祥超
fd4dbb6fe6 将带宽限制改为流量限制 2021-11-09 17:36:34 +08:00
刘祥超
a1ac68ccf0 支持套餐相关操作 2021-11-09 15:36:31 +08:00
刘祥超
d92e987f7a 支持购买套餐/续费套餐/用户账户操作等 2021-11-08 20:52:21 +08:00
刘祥超
b82732af42 增加删除/恢复DNS域名API 2021-11-06 16:23:06 +08:00
刘祥超
2fff7568b9 SSH登录支持Passphrase 2021-11-06 15:31:11 +08:00
刘祥超
9c4c6cc660 增加多个API/规范命名 2021-11-05 17:56:30 +08:00
刘祥超
ae4a8dfa5f 增加APINodeService.CountAllEnabledAndOnAPINodes()/规范命名 2021-11-05 15:35:35 +08:00
刘祥超
f90c8db556 增加套餐相关代码 2021-10-29 14:02:49 +08:00
刘祥超
81a17aaad9 增加在IP名单中使用ipFrom和ipTo查找IP的API 2021-10-26 09:17:13 +08:00
刘祥超
9b709515da WAF增加显示网页动作 2021-10-25 19:40:22 +08:00
刘祥超
f502309198 WAF模板增加防盗链 2021-10-25 19:02:44 +08:00
刘祥超
f5c3affc5f WAF模板中增加空Agent和随机字符拦截规则 2021-10-25 11:57:25 +08:00
刘祥超
3a30a65264 HTTP客户端IP获取方式增加是否自定义 2021-10-22 14:40:14 +08:00
刘祥超
b040e966ca 可以在IP名单中搜索IP 2021-10-22 12:18:58 +08:00
刘祥超
36bf9e2fab 实现单个服务的带宽限制(商业版) 2021-10-21 17:09:59 +08:00
刘祥超
5c896bbf22 修改Edge-Health-Check-Key为X-Edge-Health-Check-Key 2021-10-19 16:41:28 +08:00
刘祥超
4d57a12a29 健康检查支持UserAgent和是否基础请求设置 2021-10-19 16:31:33 +08:00
刘祥超
cc42217c0c 增加防盗链规则参数 2021-10-19 11:38:39 +08:00
刘祥超
286174202e WAF各个动作增加作用范围 2021-10-19 10:28:18 +08:00
刘祥超
c708d83af0 内容压缩支持对已压缩内容重新压缩 2021-10-18 16:49:24 +08:00
刘祥超
1044cfc17c 默认压缩算法改为brotli优先 2021-10-18 11:56:58 +08:00
刘祥超
6d99535850 增加PURGE某个URL缓存功能 2021-10-17 20:22:01 +08:00
刘祥超
3a798f09ed 增加清除服务缓存API 2021-10-17 17:12:36 +08:00
刘祥超
e41ce4bb4c 增加服务CNAME相关配置和服务 2021-10-16 12:03:44 +08:00
刘祥超
226051e555 运行日志显示未读的日志数量 2021-10-15 12:54:38 +08:00
刘祥超
887a83cf9d 节点日志增加是否已读标记 2021-10-14 17:29:58 +08:00
刘祥超
be5c54d903 支持PROXY Protocol 2021-10-12 20:18:02 +08:00
刘祥超
90d71811dc 可以在集群中指定节点时区 2021-10-12 11:45:28 +08:00
刘祥超
3b20cea1b8 TCP、TLS、UDP支持端口范围 2021-10-10 16:30:09 +08:00
刘祥超
98b20164a9 服务分组增加特殊页面设置 2021-10-10 10:53:09 +08:00
刘祥超
cc7a64189b 特殊页面可以直接使用HTML 2021-10-10 10:35:09 +08:00
刘祥超
b5ef0d33b5 智能DNS记录的TTL增加多个秒、分钟、年等档位 2021-10-09 16:13:02 +08:00
刘祥超
e61e81b485 WAF看板增加节点拦截排行和域名拦截排行 2021-10-09 16:01:42 +08:00
刘祥超
4220913c28 增加查看单个服务附近服务API 2021-10-08 14:36:22 +08:00
刘祥超
491ad3ae44 支持更多的分组全局设置功能 2021-10-07 16:47:31 +08:00
刘祥超
48678e9533 WAF模式从pass改为bypass 2021-10-07 13:51:35 +08:00
刘祥超
45921f4b50 服务支持自定义访客IP地址获取方式 2021-10-06 11:42:52 +08:00
刘祥超
a95ac1599f 优化WebP+缓存 2021-10-03 18:01:12 +08:00
刘祥超
30f84532b7 ACME使用EAB申请的账号只能绑定一个用户 2021-10-03 14:43:00 +08:00
刘祥超
4da092eb2b ACME证书增加ZeroSSL支持 2021-10-03 13:09:55 +08:00
刘祥超
f01a45a746 支持自动转换图像文件为WebP 2021-10-01 16:25:31 +08:00
刘祥超
702c631460 WAF策略增加观察模式和通过模式 2021-09-30 11:30:16 +08:00
刘祥超
bfa672dd37 压缩匹配条件时也检查请求条件 2021-09-29 20:11:54 +08:00
刘祥超
04f47fe8ed 支持brotli和deflate压缩方式 2021-09-29 19:37:32 +08:00
刘祥超
b488c76204 CC超时时间默认为600秒 2021-09-29 11:17:18 +08:00
刘祥超
0e8ad10f61 看板增加离线节点数字 2021-09-27 09:23:30 +08:00
刘祥超
d660258bb6 缓存条件增加最小内容尺寸配置 2021-09-26 15:02:03 +08:00
刘祥超
bb20773f2a ReadMe增加reporterconfigs说明 2021-09-26 10:10:20 +08:00
刘祥超
3a5ef923f4 优化WAF规则错误提示 2021-09-25 19:58:17 +08:00
刘祥超
f2a91018f6 WAF规则校验错误不阻断执行 2021-09-25 19:41:10 +08:00
刘祥超
16c729085e 调整CC2参数,增加单IP请求数限制 2021-09-23 15:01:12 +08:00
刘祥超
6b33fb52e0 修复负载均衡算法中可能因参数缺失而崩溃的Bug 2021-09-23 11:43:21 +08:00
刘祥超
96ddf1ded8 可以使用服务ID来查询服务分组配置信息 2021-09-22 22:40:38 +08:00
刘祥超
7c530680c0 增加配置分组配置 2021-09-22 19:39:55 +08:00
刘祥超
e8429b8f74 域名解析任务可以使用集群ID筛选 2021-09-21 10:56:47 +08:00
刘祥超
175dfd06a0 可以设置集群的DNS记录TTL 2021-09-20 20:01:27 +08:00
刘祥超
b770713a28 在集群中可以设置自动加入DNS的CNAME记录 2021-09-20 16:38:00 +08:00
刘祥超
1f6be53d3d 反向代理源站实现使用域名分组 2021-09-20 11:54:21 +08:00
刘祥超
bf57bc5a1c 实现连通性变化发送通知功能 2021-09-18 14:22:17 +08:00
刘祥超
728061c66c 增加商业版认证校验API 2021-09-16 10:34:00 +08:00
刘祥超
1392dce1c5 增加查找区域监控对象相关结果 2021-09-15 17:53:26 +08:00
刘祥超
4a79878dde 节点IP地址可以修改在线状态 2021-09-15 11:47:15 +08:00
刘祥超
c3bdacbf3d 调整部分命名 2021-09-14 19:38:24 +08:00
刘祥超
fe59c6850d IP阈值动作增加WebHook 2021-09-14 15:27:59 +08:00
刘祥超
d17d1a8ffd IP阈值增加节点分组和集群相关统计项目 2021-09-14 11:36:14 +08:00
刘祥超
c73b8cef16 优化节点设置交互 2021-09-13 16:47:46 +08:00
刘祥超
ff5dc41db3 IP地址支持手动上线和从备用IP中恢复 2021-09-13 13:46:32 +08:00
刘祥超
1e41e3b65b 实现节点自动切换到备用IP 2021-09-13 10:51:09 +08:00
刘祥超
3c8c4e6747 实现基础的IP地址阈值 2021-09-12 20:21:27 +08:00
刘祥超
699ed00e40 WAF中添加正则相关规则时校验正则表达式 2021-09-10 10:31:56 +08:00
刘祥超
6284db1bc8 实现基本的监控终端管理 2021-09-08 19:35:28 +08:00
刘祥超
8e49d4a5f3 区域监控可以上传监控数据 2021-09-06 09:16:41 +08:00
刘祥超
fad5f16abf 实现基本的区域监控终端管理功能 2021-09-05 11:11:04 +08:00
刘祥超
72369199e1 增加独立的IP地址管理功能 2021-08-31 17:24:41 +08:00
刘祥超
dba446a651 企业认证信息中增加节点数显示 2021-08-30 18:56:56 +08:00
刘祥超
d64f8cdf0f 优化数据库节点管理 2021-08-30 10:57:03 +08:00
刘祥超
0c014ced0c DNS服务商支持搜索 2021-08-25 18:47:06 +08:00
刘祥超
2acdb9349d 节点如果没有设置DNS线路就使用默认线路 2021-08-25 17:16:43 +08:00
刘祥超
61cb2f8cf8 Admin看板增加默认集群ID 2021-08-25 11:41:13 +08:00
刘祥超
4afe12cd46 增加忽略相似消息周期设置 2021-08-24 20:45:16 +08:00
刘祥超
0b91e9d084 媒介可以设置发送频率/消息接收人可以设置接收消息时间段 2021-08-24 17:46:48 +08:00
刘祥超
ae85d39275 通知媒介增加任务队列查看功能 2021-08-24 14:23:21 +08:00
刘祥超
66af31330e 消息接收者区分角色 2021-08-23 16:46:34 +08:00
刘祥超
663c3dfbd4 阶段性提交 2021-08-23 09:59:43 +08:00
刘祥超
503c177a29 DNS访问日志显示匹配的线路 2021-08-20 11:27:22 +08:00
刘祥超
5edfd9e4c9 添加DNS账号时自动读取DNS服务商下域名 2021-08-19 14:26:19 +08:00
刘祥超
433df9dddb 增加configutils/ParseCIDR()函数 2021-08-19 10:50:40 +08:00
刘祥超
ca85f71f2b 节点IP可以设置阈值 2021-08-18 17:09:34 +08:00
刘祥超
928d8c3ace 节点IP增加是否启用、是否在线状态 2021-08-18 09:25:03 +08:00
刘祥超
9c8e740a1e 增加通过IP来搜索IP名单的API 2021-08-15 15:42:26 +08:00
刘祥超
e18b3a01bb 增加SSH认证建议接口 2021-08-14 21:33:26 +08:00
刘祥超
1bee81bbab 增加SSH登录建议端口接口 2021-08-14 18:06:46 +08:00
刘祥超
45c63a5831 可以远程停止和启动DNS节点 2021-08-12 11:47:47 +08:00
刘祥超
7172ca84d6 实现DNS节点远程安装 2021-08-11 21:00:35 +08:00
刘祥超
29b25f968d 安全设置中增加允许记住登录选项 2021-08-11 09:36:21 +08:00
刘祥超
ae0bd85ecc 访问日志显示节点信息 2021-08-10 11:14:46 +08:00
刘祥超
4291cf1b30 自建DNS增加解析测试 2021-08-09 18:42:06 +08:00
刘祥超
618d1060bf EdgeDNS支持内置线路 2021-08-09 13:59:55 +08:00
刘祥超
7d604a0ed7 DNS节点增加在线状态通知 2021-08-08 10:29:27 +08:00
刘祥超
f4f68ae13c 将grpc.sh改为build.sh 2021-08-08 08:48:26 +08:00
刘祥超
9644ec0ff8 访问日志搜索增加域名和IP搜索 2021-08-07 22:02:18 +08:00
刘祥超
473b7432e8 自建DNS增加全局配置 2021-08-07 20:40:36 +08:00
刘祥超
d2527abd17 优化源站调度 2021-08-01 21:56:15 +08:00
刘祥超
7caf0c2f68 WAF策略和缓存策略跟随集群 2021-08-01 14:52:10 +08:00
刘祥超
9a037680cf 服务配置增加集群ID 2021-08-01 11:14:13 +08:00
刘祥超
b908a8de60 初步实现多集群共享节点 2021-07-31 22:23:16 +08:00
刘祥超
c49ec306d4 实现基本的访问日志策略 2021-07-29 16:51:11 +08:00
刘祥超
f405e42d39 指标图表可以设置忽略空值和其他对象值 2021-07-26 16:44:39 +08:00
刘祥超
5413a792d5 增加referer.host请求变量 2021-07-26 15:37:38 +08:00
刘祥超
01a1690720 修改文字 2021-07-26 14:34:02 +08:00
刘祥超
5ae053965b 自动跳转到HTTPS可以设置允许和排除的域名 2021-07-26 11:23:39 +08:00
刘祥超
f14f5f0606 修复一处指标变量说明错误 2021-07-26 10:59:10 +08:00
刘祥超
32d542aa6c DNS支持TSIG 2021-07-25 15:08:38 +08:00
刘祥超
f1da942189 DNS服务支持密钥管理 2021-07-25 09:43:47 +08:00
刘祥超
2b1483f857 DNS节点自动升级 2021-07-22 18:45:36 +08:00
刘祥超
5ae86305f9 域名记录增加停用/启用 2021-07-20 19:03:56 +08:00
刘祥超
f83be52482 增加API令牌相关API 2021-07-20 17:15:51 +08:00
刘祥超
a241b9a9df 在各个地方支持IPv6 2021-07-20 10:55:52 +08:00
刘祥超
b9e01b7738 Dashboard增加指标图表 2021-07-19 17:58:09 +08:00
刘祥超
587cd4484a 实现公用的统计指标 2021-07-19 15:22:49 +08:00
刘祥超
8fd93ffbbe 修改一处文字 2021-07-19 14:28:56 +08:00
刘祥超
616b855d61 将WAF模板中的cc修改为cc2 2021-07-19 11:01:43 +08:00
刘祥超
3a12813da3 WAF增加多个动作 2021-07-18 16:26:45 +08:00
刘祥超
66f04de8c1 WAF支持更多动作 2021-07-14 22:46:31 +08:00
刘祥超
b4c72dc8f4 修复绑定的IP名单无法生效的Bug 2021-07-13 15:50:02 +08:00
刘祥超
4e84c7b376 优化看板 2021-07-13 15:49:34 +08:00
刘祥超
50d8a575a6 实现数据看板--WAF 2021-07-12 16:57:06 +08:00
刘祥超
499ec2306c 管理界面可以切换风格 2021-07-12 10:21:45 +08:00
刘祥超
aa150a1ae1 实现数据看板-DNS 2021-07-11 21:43:59 +08:00
刘祥超
0ad1782d42 实现数据看板--用户 2021-07-11 18:06:07 +08:00
刘祥超
4ceac4d9c9 节点看板增加缓存目录用量 2021-07-08 19:43:20 +08:00
刘祥超
30f8bfe703 实现服务看板(企业版) 2021-07-07 19:55:52 +08:00
刘祥超
be9bde507a 实现集群看板 2021-07-05 11:37:10 +08:00
刘祥超
53ee50fa38 指标增加一些易读的名称等信息 2021-07-03 18:05:45 +08:00
刘祥超
8cde433c37 实现基本的图表管理 2021-07-03 15:45:16 +08:00
刘祥超
fe88c581c7 指标数据增加占比数据 2021-07-01 10:39:19 +08:00
刘祥超
32cb66db4c 实现基础的统计指标 2021-06-30 20:50:17 +08:00
625 changed files with 94884 additions and 10309 deletions

29
LICENSE Normal file
View File

@@ -0,0 +1,29 @@
BSD 3-Clause License
Copyright (c) 2020, LiuXiangChao
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

25
README.md Normal file
View File

@@ -0,0 +1,25 @@
GoEdge公共配置项。
目录结构:
~~~
pkg/
dnsconfigs - 域名解析和NameServer相关配置
messageconfigs - 消息通知相关配置
monitorconfigs - 监控相关配置
nodeconfigs - 边缘节点相关配置
nodeutils - 边缘节点相关函数
serverconfigs - 网站服务相关配置
systemconfigs - 系统全局配置
reporterconfigs - 区域监控终端配置
userconfigs - 用户相关配置
configutils/ - 配置公共函数等
errors/ - 错误处理
rpc/ - RPC通讯
protos/ RPC数据和接口定义
sevice_*.proto RPC接口定义
models/
model_*.proto RPC数据定义
~~~
开发时需要将 `rpc/protos/``rpc/protos/models/` 两个目录放入到Proto Buffer检查工具可以找到的位置。

View File

@@ -1 +1,3 @@
每次 `.proto` 文件有更新的时候,请运行 `grpc.sh` 重新生成相应的源代码。
每次 `.proto` 文件有更新的时候,请运行 `build.sh` 重新生成相应的源代码。
如果文件名有更改,请清空 `pkg/rpc/pb/*.go` 文件,然后再次运行 `build.sh`

23
build/build.sh Executable file
View File

@@ -0,0 +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
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"

View File

@@ -1,5 +0,0 @@
#!/usr/bin/env bash
#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

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

13409
build/rpc.json Normal file

File diff suppressed because it is too large Load Diff

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

@@ -0,0 +1,229 @@
// 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/types"
"io/ioutil"
"path/filepath"
"regexp"
)
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"`
}
type MessageInfo struct {
Name string `json:"name"`
Code string `json:"code"`
Doc string `json:"doc"`
}
type RPCList struct {
Services []*ServiceInfo `json:"services"`
Messages []*MessageInfo `json:"messages"`
}
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'})))
}
// 生成JSON格式API列表
func main() {
var quiet = false
flag.BoolVar(&quiet, "quiet", false, "")
flag.Parse()
var dirs = []string{Tea.Root + "/../pkg/rpc/protos/", Tea.Root + "/../pkg/rpc/protos/models"}
var services = []*ServiceInfo{}
var messages = []*MessageInfo{}
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
}
for _, path := range files {
func(path string) {
data, err := ioutil.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(`rpc\s+(\w+)\s*\(\s*(\w+)\s*\)\s*returns\s*\(\s*(\w+)\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]
methods = append(methods, &MethodInfo{
Name: string(methodPieces[1]),
RequestMessageName: string(methodPieces[2]),
ResponseMessageName: string(methodPieces[3]),
Code: string(methodData),
Doc: readComments(serviceData[:methodCodePosition[0]]),
})
}
services = append(services, &ServiceInfo{
Name: serviceName,
Methods: methods,
Filename: filepath.Base(path),
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 rpcList = &RPCList{
Services: services,
Messages: messages,
}
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 = ioutil.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")
}
}

21
go.mod
View File

@@ -1,13 +1,18 @@
module github.com/TeaOSLab/EdgeCommon
go 1.15
go 1.18
require (
github.com/cespare/xxhash/v2 v2.1.1
github.com/go-yaml/yaml v2.1.0+incompatible
github.com/golang/protobuf v1.4.2
github.com/iwind/TeaGo v0.0.0-20210411134150-ddf57e240c2f
google.golang.org/grpc v1.32.0
google.golang.org/protobuf v1.25.0
gopkg.in/yaml.v2 v2.4.0 // indirect
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
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.0.0-20220319134239-a9b59b0215f8 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/genproto v0.0.0-20220317150908-0efb43f6373e // indirect
)

76
go.sum
View File

@@ -1,28 +1,35 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/DataDog/sketches-go v0.0.0-20190923095040-43f19ad77ff7/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60=
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=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgryski/go-rendezvous v0.0.0-20200624174652-8d2f3be8b2d9/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-redis/redis/v8 v8.0.0-beta.7/go.mod h1:FGJAWDWFht1sQ4qxyJHZZbVyvnVcKQN0E3u5/5lRz+g=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-yaml/yaml v2.1.0+incompatible h1:RYi2hDdss1u4YE7GwixGzWwVo47T8UQwnTLB6vQiq+o=
github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
@@ -34,18 +41,24 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/iwind/TeaGo v0.0.0-20210411134150-ddf57e240c2f h1:r2O8PONj/KiuZjJHVHn7KlCePUIjNtgAmvLfgRafQ8o=
github.com/iwind/TeaGo v0.0.0-20210411134150-ddf57e240c2f/go.mod h1:KU4mS7QNiZ7QWEuDBk1zw0/Q2LrAPZv3tycEFBsuUwc=
github.com/iwind/TeaGo v0.0.0-20220304043459-0dd944a5b475 h1:EseyfFaQOjWanGiby9KMw7PjDBMg/95tLDgIw/ns0Cw=
github.com/iwind/TeaGo v0.0.0-20220304043459-0dd944a5b475/go.mod h1:HRHK0zoC/og3c9/hKosD9yYVMTnnzm3PgXUdhRYHaLc=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
@@ -66,12 +79,17 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y
github.com/opentracing/opentracing-go v1.1.1-0.20190913142402-a7454ce5950e/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
go.opentelemetry.io/otel v0.7.0/go.mod h1:aZMyHG5TqDOXEgH2tyLiXSUKly1jT3yqE9PmrzIeCdo=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20200513190911-00229845015e/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw=
@@ -86,16 +104,22 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 h1:AeiKBIuRw3UomYXSbLy0Mc2dDLfdtbT/IVn4keq83P0=
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/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=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -108,11 +132,19 @@ golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 h1:DYfZAGf2WMFjMxbgTjaC+2HC7NkNAQs+6Q8b9WEB/F4=
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
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-20220319134239-a9b59b0215f8 h1:OH54vjqzRWmbJ62fjuhxy7AxFFgoHN0/DPc/UrL8cAs=
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
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/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=
@@ -120,22 +152,27 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20191009194640-548a555dbc03/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20220317150908-0efb43f6373e h1:fNKDNuUyC4WH+inqDMpfXDdfvwfYILbsX+oskGZ8hxg=
google.golang.org/genproto v0.0.0-20220317150908-0efb43f6373e/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0=
google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M=
google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
@@ -144,8 +181,11 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
@@ -153,11 +193,13 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

View File

@@ -4,7 +4,7 @@ import (
"reflect"
)
// 拷贝同类型struct指针对象中的字段
// CopyStructObject 拷贝同类型struct指针对象中的字段
func CopyStructObject(destPtr, sourcePtr interface{}) {
value := reflect.ValueOf(destPtr)
value2 := reflect.ValueOf(sourcePtr)

View File

@@ -6,7 +6,7 @@ import (
"strings"
)
// 从一组规则中匹配域名
// MatchDomains 从一组规则中匹配域名
// 支持的格式example.com, www.example.com, .example.com, *.example.com, ~(\d+).example.com
// 更多参考http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name
func MatchDomains(patterns []string, domain string) (isMatched bool) {
@@ -14,19 +14,27 @@ func MatchDomains(patterns []string, domain string) (isMatched bool) {
return
}
for _, pattern := range patterns {
if matchDomain(pattern, domain) {
if MatchDomain(pattern, domain) {
return true
}
}
return
}
// 匹配单个域名规则
func matchDomain(pattern string, domain string) (isMatched bool) {
// MatchDomain 匹配单个域名规则
func MatchDomain(pattern string, domain string) (isMatched bool) {
if len(pattern) == 0 {
return
}
if pattern == domain {
return true
}
if pattern == "*" {
return true
}
// 正则表达式
if pattern[0] == '~' {
reg, err := stringutil.RegexpCompile(strings.TrimSpace(pattern[1:]))
@@ -57,3 +65,19 @@ func matchDomain(pattern string, domain string) (isMatched bool) {
}
return isMatched
}
// IsFuzzyDomain 判断是否为特殊域名
func IsFuzzyDomain(domain string) bool {
if len(domain) == 0 {
return true
}
if domain[0] == '.' || domain[0] == '~' {
return true
}
for _, c := range domain {
if c == '*' {
return true
}
}
return false
}

View File

@@ -76,4 +76,25 @@ func TestMatchDomain(t *testing.T) {
ok := MatchDomains([]string{"~^\\d+.example.com$"}, "123.example.com")
a.IsTrue(ok)
}
{
ok := MatchDomains([]string{"*"}, "example.com")
a.IsTrue(ok)
}
// port
{
ok := MatchDomains([]string{"example.com:8001"}, "example.com:8001")
a.IsTrue(ok)
}
}
func TestIsSpecialDomain(t *testing.T) {
var a = assert.NewAssertion(t)
a.IsTrue(IsFuzzyDomain(""))
a.IsTrue(IsFuzzyDomain(".hello.com"))
a.IsTrue(IsFuzzyDomain("*.hello.com"))
a.IsTrue(IsFuzzyDomain("hello.*.com"))
a.IsTrue(IsFuzzyDomain("~^hello\\.com"))
a.IsFalse(IsFuzzyDomain("hello.com"))
}

View File

@@ -2,25 +2,105 @@ 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最大值
func ParseCIDR(cidr string) (ipFrom string, ipTo string, err error) {
_, ipNet, err := net.ParseCIDR(cidr)
if err != nil {
return "", "", err
}
ipFrom = ipNet.IP.String()
Loop:
for i := len(ipNet.Mask) - 1; i >= 0; i-- {
for j := 7; j >= 0; j-- {
var m = ipNet.Mask[i] >> (7 - j) & 1 // 读取某位bit
if m == 0 {
ipNet.IP[i] |= 1 << j // 将此位置为1
} else {
break Loop
}
}
}
ipTo = ipNet.IP.String()
return
}
// QuoteIP 为IPv6加上括号
func QuoteIP(ip string) string {
if len(ip) == 0 {
return ip
}
if !strings.Contains(ip, ":") {
return ip
}
if ip[0] != '[' {
return "[" + ip + "]"
}
return ip
}

View File

@@ -0,0 +1,41 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package configutils_test
import (
"fmt"
"github.com/TeaOSLab/EdgeCommon/pkg/configutils"
"github.com/iwind/TeaGo/assert"
"net"
"testing"
)
func TestParseCIDR(t *testing.T) {
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

@@ -12,10 +12,20 @@ type VariableHolders = []interface{}
var variableMapping = map[string][]interface{}{} // source => [holder1, ...]
var variableLocker = sync.RWMutex{}
var regexpNamedVariable = regexp.MustCompile("\\${[\\w.-]+}")
var regexpNamedVariable = regexp.MustCompile(`\${[\w.-]+}`)
var stringBuilderPool = sync.Pool{
New: func() interface{} {
return &strings.Builder{}
},
}
// ParseVariables 分析变量
func ParseVariables(source string, replacer func(varName string) (value string)) string {
if len(source) == 0 {
return ""
}
variableLocker.RLock()
holders, found := variableMapping[source]
variableLocker.RUnlock()
@@ -31,17 +41,29 @@ func ParseVariables(source string, replacer func(varName string) (value string))
return source
}
// replace
result := strings.Builder{}
// 只有一个占位时,我们快速返回
if len(holders) == 1 {
var h = holders[0]
holder, ok := h.(VariableHolder)
if ok {
return replacer(string(holder))
}
return source
}
// 多个占位时使用Builder
var builder = stringBuilderPool.Get().(*strings.Builder)
builder.Reset()
defer stringBuilderPool.Put(builder)
for _, h := range holders {
holder, ok := h.(VariableHolder)
if ok {
result.WriteString(replacer(string(holder)))
builder.WriteString(replacer(string(holder)))
} else {
result.Write(h.([]byte))
builder.Write(h.([]byte))
}
}
return result.String()
return builder.String()
}
// ParseVariablesFromHolders 从占位中分析变量
@@ -82,5 +104,8 @@ func ParseHolders(source string) (holders VariableHolders) {
// HasVariables 判断是否有变量
func HasVariables(source string) bool {
if len(source) == 0 {
return false
}
return regexpNamedVariable.MatchString(source)
}

View File

@@ -1,17 +1,31 @@
package configutils
import (
"fmt"
"github.com/iwind/TeaGo/types"
"runtime"
"strconv"
"testing"
)
func TestParseVariables(t *testing.T) {
v := ParseVariables("hello, ${name}, world", func(s string) string {
return "Lu"
})
t.Log(v)
{
v := ParseVariables("hello, ${name}, world", func(s string) string {
return "Lu"
})
t.Log(v)
}
{
v := ParseVariables("hello, world", func(s string) string {
return "Lu"
})
t.Log(v)
}
{
v := ParseVariables("${name}", func(s string) string {
return "Lu"
})
t.Log(v)
}
}
func TestParseNoVariables(t *testing.T) {
@@ -39,6 +53,8 @@ func BenchmarkParseVariables(b *testing.B) {
return "Lu"
})
b.ResetTimer()
for i := 0; i < b.N; i++ {
_ = ParseVariables("hello, ${name}, ${age}, ${gender}, ${home}, world", func(s string) string {
return "Lu"
@@ -58,7 +74,17 @@ func BenchmarkParseVariablesFromHolders(b *testing.B) {
func BenchmarkParseVariablesUnique(b *testing.B) {
for i := 0; i < b.N; i++ {
_ = ParseVariables("hello, ${name} "+strconv.Itoa(i%1000), func(s string) string {
_ = ParseVariables("hello, ${name} "+strconv.Itoa(i), func(s string) string {
return "Lu"
})
}
}
func BenchmarkParseVariablesUnique_Single(b *testing.B) {
runtime.GOMAXPROCS(1)
for i := 0; i < b.N; i++ {
_ = ParseVariables("${name}", func(s string) string {
return "Lu"
})
}
@@ -66,7 +92,15 @@ func BenchmarkParseVariablesUnique(b *testing.B) {
func BenchmarkParseNoVariables(b *testing.B) {
for i := 0; i < b.N; i++ {
_ = ParseVariables("hello, world, "+fmt.Sprintf("%d", i%1000), func(s string) string {
_ = ParseVariables("hello, world", func(s string) string {
return "Lu"
})
}
}
func BenchmarkParseEmpty(b *testing.B) {
for i := 0; i < b.N; i++ {
_ = ParseVariables("", func(s string) string {
return "Lu"
})
}

View File

@@ -1,7 +1,7 @@
package configutils
import (
"github.com/go-yaml/yaml"
"gopkg.in/yaml.v3"
"io/ioutil"
)

View File

@@ -1,12 +0,0 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package dnsconfigs
type AccessLogRef struct {
IsPrior bool `yaml:"isPrior" json:"isPrior"` // 是否覆盖
IsOn bool `yaml:"isOn" json:"isOn"` // 是否启用
}
func (this *AccessLogRef) Init() error {
return nil
}

View File

@@ -2,6 +2,10 @@ package dnsconfigs
// ClusterDNSConfig 集群的DNS设置
type ClusterDNSConfig struct {
CNameRecords []string `yaml:"cnameRecords" json:"cnameRecords"` // 自动加入的CNAME
TTL int32 `yaml:"ttl" json:"ttl"` // 默认TTL各个DNS服务商对记录的TTL的限制各有不同
CNameAsDomain bool `yaml:"cnameAsDomain" json:"cnameAsDomain"` // 是否可以像域名一样直接访问CNAME
NodesAutoSync bool `yaml:"nodesAutoSync" json:"nodesAutoSync"` // 是否自动同步节点状态
ServersAutoSync bool `yaml:"serversAutoSync" json:"serversAutoSync"` // 是否自动同步服务状态
}

View File

@@ -0,0 +1,13 @@
// 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

@@ -0,0 +1,69 @@
// 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

@@ -5,9 +5,12 @@ package dnsconfigs
import "fmt"
type NSNodeConfig struct {
Id int64 `json:"id"`
ClusterId int64 `json:"clusterId"`
AccessLogRef *AccessLogRef `json:"accessLogRef"`
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
}

View File

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

View File

@@ -9,6 +9,30 @@ type RecordTTL struct {
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,
@@ -29,5 +53,13 @@ func FindAllRecordTTL() []*RecordTTL {
Name: "1天",
Value: 86400,
},
{
Name: "30天",
Value: 30 * 86400,
},
{
Name: "一年",
Value: 365 * 86400,
},
}
}

View File

@@ -0,0 +1,18 @@
// 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

@@ -2,31 +2,107 @@
package dnsconfigs
import "github.com/TeaOSLab/EdgeCommon/pkg/configutils"
import (
"encoding/json"
"errors"
"github.com/TeaOSLab/EdgeCommon/pkg/configutils"
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
"github.com/iwind/TeaGo/maps"
"net"
)
type RouteRangeType = string
const (
RouteRangeTypeIP RouteRangeType = "ipRange"
RouteRangeTypeIP RouteRangeType = "ipRange" // IP范围
RouteRangeTypeCIDR RouteRangeType = "cidr" // CIDR
RouteRangeTypeRegion RouteRangeType = "region" // 区域
)
func AllRouteRangeTypes() []*shared.Definition {
return []*shared.Definition{
{
Name: "IP范围",
Code: RouteRangeTypeIP,
},
{
Name: "CIDR",
Code: RouteRangeTypeCIDR,
},
{
Name: "区域",
Code: RouteRangeTypeRegion,
},
}
}
// RouteRegionResolver 解析IP接口
type RouteRegionResolver interface {
Resolve(ip net.IP) (countryId int64, provinceId int64, cityId int64, providerId int64)
}
// RouteRangeInterface 线路范围接口
type RouteRangeInterface interface {
// Init 初始化
Init() error
Contains(ip uint64) bool
// Contains 判断是否包含
Contains(ip net.IP) bool
// SetRegionResolver 设置IP解析接口
SetRegionResolver(resolver RouteRegionResolver)
// IsExcluding 是否为排除
IsExcluding() bool
}
type BaseRouteRange struct {
IsReverse bool `json:"isReverse"`
routeRegionResolver RouteRegionResolver
}
func (this *BaseRouteRange) SetRegionResolver(resolver RouteRegionResolver) {
this.routeRegionResolver = resolver
}
func (this *BaseRouteRange) IsExcluding() bool {
return this.IsReverse
}
// RouteRangeIPRange IP范围配置
// IPv4和IPv6不能混用
type RouteRangeIPRange struct {
BaseRouteRange
IPFrom string `json:"ipFrom"`
IPTo string `json:"ipTo"`
ipFromLong uint64
ipToLong uint64
ipVersion int // 4|6
}
func (this *RouteRangeIPRange) Init() error {
this.ipFromLong = configutils.IP2Long(this.IPFrom)
this.ipToLong = configutils.IP2Long(this.IPTo)
var ipFrom = net.ParseIP(this.IPFrom)
var ipTo = net.ParseIP(this.IPTo)
if ipFrom == nil {
return errors.New("invalid ipFrom '" + this.IPFrom + "'")
}
if ipTo == nil {
return errors.New("invalid ipTo '" + this.IPTo + "'")
}
var ipFromVersion = configutils.IPVersion(ipFrom)
var ipToVersion = configutils.IPVersion(ipTo)
if ipFromVersion != ipToVersion {
return errors.New("ipFrom and ipTo version are not same")
}
this.ipVersion = ipFromVersion
this.ipFromLong = configutils.IP2Long(ipFrom)
this.ipToLong = configutils.IP2Long(ipTo)
if this.ipFromLong > this.ipToLong {
this.ipFromLong, this.ipToLong = this.ipToLong, this.ipFromLong
@@ -35,6 +111,152 @@ func (this *RouteRangeIPRange) Init() error {
return nil
}
func (this *RouteRangeIPRange) Contains(ip uint64) bool {
return this.ipFromLong <= ip && this.ipToLong >= ip
func (this *RouteRangeIPRange) Contains(netIP net.IP) bool {
if len(netIP) == 0 {
return false
}
var version = configutils.IPVersion(netIP)
if version != this.ipVersion {
return false
}
var ipLong = configutils.IP2Long(netIP)
return ipLong >= this.ipFromLong && ipLong <= this.ipToLong
}
// RouteRangeCIDR CIDR范围配置
type RouteRangeCIDR struct {
BaseRouteRange
CIDR string `json:"cidr"`
cidr *net.IPNet
}
func (this *RouteRangeCIDR) Init() error {
_, ipNet, err := net.ParseCIDR(this.CIDR)
if err != nil {
return errors.New("parse cidr failed: " + err.Error())
}
this.cidr = ipNet
return nil
}
func (this *RouteRangeCIDR) Contains(netIP net.IP) bool {
if netIP == nil {
return false
}
if this.cidr == nil {
return false
}
return this.cidr.Contains(netIP)
}
// RouteRangeRegion 区域范围
// country:ID, province:ID, city:ID, isp:ID
type RouteRangeRegion struct {
BaseRouteRange
Regions []*routeRegion `json:"regions"`
}
func (this *RouteRangeRegion) Init() error {
return nil
}
func (this *RouteRangeRegion) Contains(netIP net.IP) bool {
if this.routeRegionResolver == nil {
return false
}
if len(this.Regions) == 0 {
return false
}
countryId, provinceId, cityId, providerId := this.routeRegionResolver.Resolve(netIP)
if countryId <= 0 && provinceId <= 0 && cityId <= 0 && providerId <= 0 {
return false
}
for _, region := range this.Regions {
if region.Id <= 0 {
continue
}
switch region.Type {
case "country":
if region.Id == countryId {
return true
}
case "province":
if region.Id == provinceId {
return true
}
case "city":
if region.Id == cityId {
return true
}
case "isp":
if region.Id == providerId {
return true
}
}
}
return false
}
type routeRegion struct {
Type string `json:"type"` // country|province|city|isp
Id int64 `json:"id"`
Name string `json:"name"`
}
// InitRangesFromJSON 从JSON中初始化线路范围
func InitRangesFromJSON(rangesJSON []byte) (ranges []RouteRangeInterface, err error) {
if len(rangesJSON) == 0 {
return
}
var rangeMaps = []maps.Map{}
err = json.Unmarshal(rangesJSON, &rangeMaps)
if err != nil {
return nil, err
}
for _, rangeMap := range rangeMaps {
var rangeType = rangeMap.GetString("type")
paramsJSON, err := json.Marshal(rangeMap.Get("params"))
if err != nil {
return nil, err
}
var r RouteRangeInterface
switch rangeType {
case RouteRangeTypeIP:
r = &RouteRangeIPRange{}
case RouteRangeTypeCIDR:
r = &RouteRangeCIDR{}
case RouteRangeTypeRegion:
r = &RouteRangeRegion{}
default:
return nil, errors.New("invalid route line type '" + rangeType + "'")
}
err = json.Unmarshal(paramsJSON, r)
if err != nil {
return nil, err
}
err = r.Init()
if err != nil {
return nil, err
}
ranges = append(ranges, r)
}
return
}

View File

@@ -0,0 +1,100 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package dnsconfigs
import (
"github.com/iwind/TeaGo/assert"
"net"
"testing"
)
func TestRouteRangeIPRange_Contains(t *testing.T) {
var a = assert.NewAssertion(t)
// ipv4
{
var r = &RouteRangeIPRange{
IPFrom: "192.168.1.100",
IPTo: "192.168.3.200",
}
err := r.Init()
if err != nil {
t.Fatal(err)
}
a.IsFalse(r.Contains(net.ParseIP("aaa")))
a.IsTrue(r.Contains(net.ParseIP("192.168.1.200")))
a.IsTrue(r.Contains(net.ParseIP("192.168.3.200")))
a.IsFalse(r.Contains(net.ParseIP("192.168.4.1")))
a.IsFalse(r.Contains(net.ParseIP("::1")))
}
// ipv6
{
var prefix = "1:2:3:4:5:6"
var r = &RouteRangeIPRange{
IPFrom: prefix + ":1:8",
IPTo: prefix + ":5:10",
}
err := r.Init()
if err != nil {
t.Fatal(err)
}
a.IsFalse(r.Contains(net.ParseIP("aaa")))
a.IsTrue(r.Contains(net.ParseIP(prefix + ":3:4")))
a.IsTrue(r.Contains(net.ParseIP(prefix + ":5:9")))
a.IsTrue(r.Contains(net.ParseIP(prefix + ":5:10")))
a.IsTrue(r.Contains(net.ParseIP(prefix + ":4:8")))
a.IsFalse(r.Contains(net.ParseIP(prefix + ":5:11")))
}
{
var r = &RouteRangeCIDR{
CIDR: "192.168.2.1/24",
}
err := r.Init()
if err != nil {
t.Fatal(err)
}
a.IsFalse(r.Contains(net.ParseIP("aaa")))
a.IsTrue(r.Contains(net.ParseIP("192.168.2.1")))
a.IsTrue(r.Contains(net.ParseIP("192.168.2.254")))
a.IsTrue(r.Contains(net.ParseIP("192.168.2.100")))
a.IsFalse(r.Contains(net.ParseIP("192.168.3.1")))
a.IsFalse(r.Contains(net.ParseIP("192.168.1.1")))
}
// reverse ipv4
{
var r = &RouteRangeIPRange{
IPFrom: "192.168.1.100",
IPTo: "192.168.3.200",
IsReverse: true,
}
err := r.Init()
if err != nil {
t.Fatal(err)
}
a.IsFalse(r.Contains(net.ParseIP("aaa")))
a.IsFalse(r.Contains(net.ParseIP("192.168.1.200")))
a.IsFalse(r.Contains(net.ParseIP("192.168.3.200")))
a.IsTrue(r.Contains(net.ParseIP("192.168.4.1")))
}
// reverse cidr
{
var r = &RouteRangeCIDR{
CIDR: "192.168.2.1/24",
IsReverse: true,
}
err := r.Init()
if err != nil {
t.Fatal(err)
}
a.IsFalse(r.Contains(net.ParseIP("aaa")))
a.IsFalse(r.Contains(net.ParseIP("192.168.2.1")))
a.IsFalse(r.Contains(net.ParseIP("192.168.2.254")))
a.IsFalse(r.Contains(net.ParseIP("192.168.2.100")))
a.IsTrue(r.Contains(net.ParseIP("192.168.3.1")))
a.IsTrue(r.Contains(net.ParseIP("192.168.1.1")))
}
}

1490
pkg/dnsconfigs/routes.go Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,86 @@
// 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

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

View File

@@ -7,19 +7,19 @@ const (
MessageCodeWriteCache MessageCode = "writeCache" // 写入缓存
MessageCodeReadCache MessageCode = "readCache" // 读取缓存
MessageCodeStatCache MessageCode = "statCache" // 统计缓存
MessageCodePurgeCache MessageCode = "purgeCache" // 删除缓存
MessageCodeCleanCache MessageCode = "cleanCache" // 清理缓存
MessageCodePreheatCache MessageCode = "preheatCache" // 预热缓存
MessageCodeCheckSystemdService MessageCode = "checkSystemdService" // 检查Systemd服务
MessageCodeNewNodeTask MessageCode = "NewNodeTask" // 有新的节点任务产生
MessageCodeCheckLocalFirewall MessageCode = "checkLocalFirewall" // 检查本地防火墙
MessageCodeNewNodeTask MessageCode = "newNodeTask" // 有新的节点任务产生
MessageCodeChangeAPINode MessageCode = "changeAPINode" // 改变新的API节点
)
// 连接API节点成功
// ConnectedAPINodeMessage 连接API节点成功
type ConnectedAPINodeMessage struct {
APINodeId int64 `json:"apiNodeId"`
}
// 写入缓存
// WriteCacheMessage 写入缓存
type WriteCacheMessage struct {
CachePolicyJSON []byte `json:"cachePolicyJSON"`
Key string `json:"key"`
@@ -27,13 +27,13 @@ type WriteCacheMessage struct {
LifeSeconds int64 `json:"lifeSeconds"`
}
// 读取缓存
// ReadCacheMessage 读取缓存
type ReadCacheMessage struct {
CachePolicyJSON []byte `json:"cachePolicyJSON"`
Key string `json:"key"`
}
// 统计缓存
// StatCacheMessage 统计缓存
type StatCacheMessage struct {
CachePolicyJSON []byte `json:"cachePolicyJSON"`
}
@@ -44,30 +44,20 @@ type CleanCacheMessage struct {
CachePolicyJSON []byte `json:"cachePolicyJSON"`
}
// 删除缓存
type PurgeCacheMessageType = string
const (
PurgeCacheMessageTypeFile PurgeCacheMessageType = "file"
PurgeCacheMessageTypeDir PurgeCacheMessageType = "dir"
)
type PurgeCacheMessage struct {
CachePolicyJSON []byte `json:"cachePolicyJSON"`
Keys []string `json:"keys"`
Type PurgeCacheMessageType `json:"type"` // 清理类型
}
// 预热缓存
type PreheatCacheMessage struct {
CachePolicyJSON []byte `json:"cachePolicyJSON"`
Keys []string `json:"keys"`
}
// Systemd服务
// CheckSystemdServiceMessage Systemd服务
type CheckSystemdServiceMessage struct {
}
// 有新的节点任务
// CheckLocalFirewallMessage 检查本地防火墙
type CheckLocalFirewallMessage struct {
Name string `json:"name"`
}
// NewNodeTaskMessage 有新的节点任务
type NewNodeTaskMessage struct {
}
// ChangeAPINodeMessage 修改API地址
type ChangeAPINodeMessage struct {
Addr string `json:"addr"`
}

View File

@@ -0,0 +1,23 @@
package messageconfigs
type NSMessageCode = string
// NS节点相关消息
const (
NSMessageCodeConnectedAPINode NSMessageCode = "connectedAPINode" // NS节点连接API节点成功
NSMessageCodeCheckSystemdService NSMessageCode = "checkSystemdService" // 检查Systemd服务
NSMessageCodeNewNodeTask NSMessageCode = "newNodeTask" // 有新的节点任务产生
)
// NSConnectedAPINodeMessage 连接API节点成功
type NSConnectedAPINodeMessage struct {
APINodeId int64 `json:"apiNodeId"`
}
// NSCheckSystemdServiceMessage Systemd服务
type NSCheckSystemdServiceMessage struct {
}
// NewNSNodeTaskMessage 有新的节点任务
type NewNSNodeTaskMessage struct {
}

View File

@@ -0,0 +1,8 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package monitorconfigs
type RateConfig struct {
Minutes int32 `json:"minutes"` // 周期分钟
Count int32 `json:"count"` // 数量
}

View File

@@ -0,0 +1,11 @@
package nodeconfigs
import "github.com/TeaOSLab/EdgeCommon/pkg/reporterconfigs"
// Connectivity 连通性状态
type Connectivity struct {
CostMs float64 `json:"costMs"` // 平均耗时
Level reporterconfigs.ReportLevel `json:"level"` // 级别
Percent float64 `json:"percent"` // 连通的百分比是一个0到100之间的小数
UpdatedAt int64 `json:"updatedAt"` // 更新时间
}

View File

@@ -0,0 +1,30 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package nodeconfigs
import "github.com/iwind/TeaGo/maps"
// 一组系统默认值
// 修改单个IP相关限制值时要考虑到NAT中每个IP会代表很多个主机并非1对1的关系
const (
DefaultMaxThreads = 20000 // 单节点最大线程数
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握手超时时间
)
var DefaultConfigs = maps.Map{
"tcpMaxConnections": DefaultTCPMaxConnections,
"tcpMaxConnectionsPerIP": DefaultTCPMaxConnectionsPerIP,
"tcpMinConnectionsPerIP": DefaultTCPMinConnectionsPerIP,
"tcpNewConnectionsRate": DefaultTCPNewConnectionsRate,
"tcpNewConnectionsMinRate": DefaultTCPNewConnectionsMinRate,
}

View File

@@ -0,0 +1,25 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package nodeconfigs
type DNSResolverType = string
const (
DNSResolverTypeDefault = "default"
DNSResolverTypeGoNative = "goNative"
DNSResolverTypeCGO = "cgo"
)
func DefaultDNSResolverConfig() *DNSResolverConfig {
return &DNSResolverConfig{
Type: DNSResolverTypeDefault,
}
}
type DNSResolverConfig struct {
Type string `yaml:"type" json:"type"` // 使用Go语言内置的DNS解析器
}
func (this *DNSResolverConfig) Init() error {
return nil
}

View File

@@ -0,0 +1,46 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package nodeconfigs
import "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
func init() {
_ = DefaultWebPImagePolicy.Init()
}
var DefaultWebPImagePolicy = &WebPImagePolicy{
IsOn: true,
RequireCache: true,
MinLength: shared.NewSizeCapacity(0, shared.SizeCapacityUnitKB),
MaxLength: shared.NewSizeCapacity(128, shared.SizeCapacityUnitMB),
}
// WebPImagePolicy WebP策略
type WebPImagePolicy struct {
IsOn bool `yaml:"isOn" json:"isOn"` // 是否启用
RequireCache bool `yaml:"requireCache" json:"requireCache"` // 需要在缓存条件下进行
MinLength *shared.SizeCapacity `yaml:"minLength" json:"minLength"` // 最小压缩对象比如4m, 24k
MaxLength *shared.SizeCapacity `yaml:"maxLength" json:"maxLength"` // 最大压缩对象
minLength int64
maxLength int64
}
func (this *WebPImagePolicy) Init() error {
if this.MinLength != nil {
this.minLength = this.MinLength.Bytes()
}
if this.MaxLength != nil {
this.maxLength = this.MaxLength.Bytes()
}
return nil
}
func (this *WebPImagePolicy) MinLengthBytes() int64 {
return this.minLength
}
func (this *WebPImagePolicy) MaxLengthBytes() int64 {
return this.maxLength
}

View File

@@ -1,48 +1,107 @@
package nodeconfigs
import (
"crypto/sha256"
"encoding/json"
"errors"
"fmt"
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/ddosconfigs"
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/firewallconfigs"
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
"github.com/iwind/TeaGo/Tea"
"github.com/iwind/TeaGo/logs"
"github.com/iwind/TeaGo/maps"
"io/ioutil"
"reflect"
"strconv"
)
var sharedNodeConfig *NodeConfig = nil
type ServerError struct {
Id int64
Message string
}
func NewServerError(serverId int64, message string) *ServerError {
return &ServerError{Id: serverId, Message: message}
}
// NodeConfig 边缘节点配置
type NodeConfig struct {
Id int64 `yaml:"id" json:"id"`
NodeId string `yaml:"nodeId" json:"nodeId"`
IsOn bool `yaml:"isOn" json:"isOn"`
Servers []*serverconfigs.ServerConfig `yaml:"servers" json:"servers"`
Version int64 `yaml:"version" json:"version"`
Name string `yaml:"name" json:"name"`
Id int64 `yaml:"id" json:"id"`
NodeId string `yaml:"nodeId" json:"nodeId"`
Secret string `yaml:"secret" json:"secret"`
IsOn bool `yaml:"isOn" json:"isOn"`
Servers []*serverconfigs.ServerConfig `yaml:"servers" json:"servers"`
SupportCNAME bool `yaml:"supportCNAME" json:"supportCNAME"`
Version int64 `yaml:"version" json:"version"`
Name string `yaml:"name" json:"name"`
GroupId int64 `yaml:"groupId" json:"groupId"`
RegionId int64 `yaml:"regionId" json:"regionId"`
OCSPVersion int64 `yaml:"ocspVersion" json:"ocspVersion"`
// 性能
MaxCPU int32 `yaml:"maxCPU" json:"maxCPU"`
RegionId int64 `yaml:"regionId" json:"regionId"`
MaxCacheDiskCapacity *shared.SizeCapacity `yaml:"maxCacheDiskCapacity" json:"maxCacheDiskCapacity"`
MaxCacheMemoryCapacity *shared.SizeCapacity `yaml:"maxCacheMemoryCapacity" json:"maxCacheMemoryCapacity"`
CacheDiskDir string `yaml:"cacheDiskDir" json:"cacheDiskDir"` // 文件缓存目录
MaxCacheDiskCapacity *shared.SizeCapacity `yaml:"maxCacheDiskCapacity" json:"maxCacheDiskCapacity"` // 文件缓存容量
MaxCacheMemoryCapacity *shared.SizeCapacity `yaml:"maxCacheMemoryCapacity" json:"maxCacheMemoryCapacity"` // 内容缓存容量
MaxThreads int `yaml:"maxThreads" json:"maxThreads"` // 最大线程数
DDoSProtection *ddosconfigs.ProtectionConfig `yaml:"ddosProtection" json:"ddosProtection"`
// 级别
Level int32 `yaml:"level" json:"level"`
ParentNodes map[int64][]*ParentNodeConfig `yaml:"parentNodes" json:"parentNodes"` // clusterId => []*ParentNodeConfig
// 全局配置
GlobalConfig *serverconfigs.GlobalConfig `yaml:"globalConfig" json:"globalConfig"` // 全局配置
GlobalConfig *serverconfigs.GlobalConfig `yaml:"globalConfig" json:"globalConfig"` // 全局配置
ProductConfig *ProductConfig `yaml:"productConfig" json:"productConfig"`
// 集群统一配置
HTTPFirewallPolicy *firewallconfigs.HTTPFirewallPolicy `yaml:"httpFirewallPolicy" json:"httpFirewallPolicy"`
HTTPCachePolicy *serverconfigs.HTTPCachePolicy `yaml:"httpCachePolicy" json:"httpCachePolicy"`
TOA *TOAConfig `yaml:"toa" json:"toa"`
SystemServices map[string]maps.Map `yaml:"systemServices" json:"systemServices"` // 系统服务配置 type => params
FirewallActions []*firewallconfigs.FirewallActionConfig `yaml:"firewallActions" json:"firewallActions"`
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"`
// 指标
MetricItems []*serverconfigs.MetricItemConfig `yaml:"metricItems" json:"metricItems"`
// 自动白名单
AllowedIPs []string `yaml:"allowedIPs" json:"allowedIPs"`
// 脚本
CommonScripts []*serverconfigs.CommonScript `yaml:"commonScripts" json:"commonScripts"`
// 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"`
paddedId string
// firewall
firewallPolicies []*firewallconfigs.HTTPFirewallPolicy
// metrics
hasHTTPConnectionMetrics bool
// 源站集合
originMap map[int64]*serverconfigs.OriginConfig
// 自动白名单
allowedIPMap map[string]bool
// syn flood
synFlood *firewallconfigs.SYNFloodConfig
secretHash string
}
// SharedNodeConfig 取得当前节点配置单例
@@ -76,87 +135,237 @@ func ResetNodeConfig(nodeConfig *NodeConfig) {
shared.Locker.Unlock()
}
// CloneNodeConfig 复制节点配置
func CloneNodeConfig(nodeConfig *NodeConfig) (*NodeConfig, error) {
if nodeConfig == nil {
return nil, errors.New("node config should not be nil")
}
var newConfigValue = reflect.Indirect(reflect.ValueOf(&NodeConfig{}))
var oldValue = reflect.Indirect(reflect.ValueOf(nodeConfig))
var valueType = oldValue.Type()
for i := 0; i < valueType.NumField(); i++ {
var field = valueType.Field(i)
var fieldName = field.Name
if !field.IsExported() {
continue
}
if fieldName == "Servers" {
continue
}
newConfigValue.FieldByName(fieldName).Set(oldValue.FieldByName(fieldName))
}
var newConfig = newConfigValue.Interface().(NodeConfig)
newConfig.Servers = append([]*serverconfigs.ServerConfig{}, nodeConfig.Servers...)
return &newConfig, nil
}
// Init 初始化
func (this *NodeConfig) Init() error {
func (this *NodeConfig) Init() (err error, serverErrors []*ServerError) {
this.secretHash = fmt.Sprintf("%x", sha256.Sum256([]byte(this.NodeId+"@"+this.Secret)))
this.paddedId = fmt.Sprintf("%08d", this.Id)
// servers
for _, server := range this.Servers {
err := server.Init()
if err != nil {
// 初始化
errs := server.Init()
if len(errs) > 0 {
// 这里不返回错误,而是继续往下,防止单个服务错误而影响其他服务
logs.Println("[INIT]server '" + strconv.FormatInt(server.Id, 10) + "' init failed: " + err.Error())
for _, serverErr := range errs {
serverErrors = append(serverErrors, NewServerError(server.Id, "server '"+strconv.FormatInt(server.Id, 10)+"' init failed: "+serverErr.Error()))
}
}
// 检查ACME支持
if server.IsOn && server.SupportCNAME {
this.SupportCNAME = true
}
}
// global config
if this.GlobalConfig != nil {
err := this.GlobalConfig.Init()
err = this.GlobalConfig.Init()
if err != nil {
return err
return
}
}
// cache policy
if this.HTTPCachePolicy != nil {
err := this.HTTPCachePolicy.Init()
if err != nil {
return err
if len(this.HTTPCachePolicies) > 0 {
for _, policy := range this.HTTPCachePolicies {
err = policy.Init()
if err != nil {
return
}
}
}
// firewall policy
if this.HTTPFirewallPolicy != nil {
err := this.HTTPFirewallPolicy.Init()
if err != nil {
return err
if len(this.HTTPFirewallPolicies) > 0 {
for _, policy := range this.HTTPFirewallPolicies {
err = policy.Init()
if err != nil {
return
}
}
}
// TOA
if this.TOA != nil {
err := this.TOA.Init()
err = this.TOA.Init()
if err != nil {
return err
return
}
}
// 源站
this.originMap = map[int64]*serverconfigs.OriginConfig{}
// 查找FirewallPolicy
this.synFlood = nil
this.firewallPolicies = []*firewallconfigs.HTTPFirewallPolicy{}
if this.HTTPFirewallPolicy != nil && this.HTTPFirewallPolicy.IsOn {
this.firewallPolicies = append(this.firewallPolicies, this.HTTPFirewallPolicy)
for _, policy := range this.HTTPFirewallPolicies {
if policy.IsOn {
this.firewallPolicies = append(this.firewallPolicies, policy)
if policy.SYNFlood != nil && policy.SYNFlood.IsOn {
this.synFlood = policy.SYNFlood
}
}
}
for _, server := range this.Servers {
if !server.IsOk() || !server.IsOn {
continue
}
// WAF策略
if server.HTTPFirewallPolicyId > 0 {
for _, policy := range this.HTTPFirewallPolicies {
if server.HTTPFirewallPolicyId == policy.Id {
server.HTTPFirewallPolicy = policy
break
}
}
}
// 缓存策略
if server.HTTPCachePolicyId > 0 {
for _, policy := range this.HTTPCachePolicies {
if server.HTTPCachePolicyId == policy.Id {
server.HTTPCachePolicy = policy
}
}
}
// 源站
if server.ReverseProxyRef != nil && server.ReverseProxyRef.IsOn && server.ReverseProxy != nil && server.ReverseProxy.IsOn {
for _, origin := range server.ReverseProxy.PrimaryOrigins {
if origin.IsOn {
this.originMap[origin.Id] = origin
}
}
for _, origin := range server.ReverseProxy.BackupOrigins {
if origin.IsOn {
this.originMap[origin.Id] = origin
}
}
}
if server.Web != nil {
this.lookupWeb(server.Web)
this.lookupWeb(server, server.Web)
}
}
// firewall actions
for _, action := range this.FirewallActions {
err := action.Init()
err = action.Init()
if err != nil {
return err
return
}
}
// metric items
this.hasHTTPConnectionMetrics = false
for _, item := range this.MetricItems {
err := item.Init()
err = item.Init()
if err != nil {
return err
return
}
if item.IsOn && item.HasHTTPConnectionValue() {
this.hasHTTPConnectionMetrics = true
}
}
return nil
// 自动白名单
this.allowedIPMap = map[string]bool{}
for _, allowIP := range this.AllowedIPs {
this.allowedIPMap[allowIP] = true
}
// webp image policy
if this.WebPImagePolicies != nil {
for _, policy := range this.WebPImagePolicies {
err = policy.Init()
if err != nil {
return
}
}
}
// 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()
if err != nil {
return
}
}
return
}
// AddServer 添加服务
func (this *NodeConfig) AddServer(server *serverconfigs.ServerConfig) {
if server == nil {
return
}
var found = false
for index, oldServer := range this.Servers {
if oldServer.Id == server.Id {
this.Servers[index] = server
found = true
break
}
}
if !found {
this.Servers = append(this.Servers, server)
}
}
// RemoveServer 删除服务
func (this *NodeConfig) RemoveServer(serverId int64) {
for index, oldServer := range this.Servers {
if oldServer.Id == serverId {
this.Servers = append(this.Servers[:index], this.Servers[index+1:]...)
break
}
}
}
// AvailableGroups 根据网络地址和协议分组
func (this *NodeConfig) AvailableGroups() []*serverconfigs.ServerGroup {
groupMapping := map[string]*serverconfigs.ServerGroup{} // protocol://addr => Server Group
func (this *NodeConfig) AvailableGroups() []*serverconfigs.ServerAddressGroup {
groupMapping := map[string]*serverconfigs.ServerAddressGroup{} // protocol://addr => Server Group
for _, server := range this.Servers {
if !server.IsOk() || !server.IsOn {
continue
@@ -166,13 +375,13 @@ func (this *NodeConfig) AvailableGroups() []*serverconfigs.ServerGroup {
if ok {
group.Add(server)
} else {
group = serverconfigs.NewServerGroup(addr)
group = serverconfigs.NewServerAddressGroup(addr)
group.Add(server)
}
groupMapping[addr] = group
}
}
result := []*serverconfigs.ServerGroup{}
result := []*serverconfigs.ServerAddressGroup{}
for _, group := range groupMapping {
result = append(result, group)
}
@@ -202,23 +411,125 @@ func (this *NodeConfig) PaddedId() string {
return this.paddedId
}
// HasHTTPConnectionMetrics 是否含有HTTP连接数的指标
func (this *NodeConfig) HasHTTPConnectionMetrics() bool {
return this.hasHTTPConnectionMetrics
}
// FindOrigin 读取源站配置
func (this *NodeConfig) FindOrigin(originId int64) *serverconfigs.OriginConfig {
if this.originMap == nil {
return nil
}
config, ok := this.originMap[originId]
if ok {
return config
}
return nil
}
// 搜索WAF策略
func (this *NodeConfig) lookupWeb(web *serverconfigs.HTTPWebConfig) {
func (this *NodeConfig) lookupWeb(server *serverconfigs.ServerConfig, web *serverconfigs.HTTPWebConfig) {
if web == nil || !web.IsOn {
return
}
if web.FirewallPolicy != nil && web.FirewallPolicy.IsOn {
// 复用节点的拦截选项设置
if web.FirewallPolicy.BlockOptions == nil && this.HTTPFirewallPolicy != nil && this.HTTPFirewallPolicy.BlockOptions != nil {
web.FirewallPolicy.BlockOptions = this.HTTPFirewallPolicy.BlockOptions
// 复用节点的选项设置
if server.HTTPFirewallPolicy != nil {
if (web.FirewallPolicy.BlockOptions == nil || !web.FirewallPolicy.BlockOptions.IsPrior) && server.HTTPFirewallPolicy.BlockOptions != nil {
web.FirewallPolicy.BlockOptions = server.HTTPFirewallPolicy.BlockOptions
}
if (web.FirewallPolicy.CaptchaOptions == nil || !web.FirewallPolicy.CaptchaOptions.IsPrior) && server.HTTPFirewallPolicy.CaptchaOptions != nil {
web.FirewallPolicy.CaptchaOptions = server.HTTPFirewallPolicy.CaptchaOptions
}
if (web.FirewallPolicy.SYNFlood == nil || !web.FirewallPolicy.SYNFlood.IsPrior) && server.HTTPFirewallPolicy.SYNFlood != nil {
web.FirewallPolicy.SYNFlood = server.HTTPFirewallPolicy.SYNFlood
}
if (web.FirewallPolicy.Log == nil || !web.FirewallPolicy.Log.IsPrior) && server.HTTPFirewallPolicy.Log != nil {
web.FirewallPolicy.Log = server.HTTPFirewallPolicy.Log
}
web.FirewallPolicy.Mode = server.HTTPFirewallPolicy.Mode
web.FirewallPolicy.UseLocalFirewall = server.HTTPFirewallPolicy.UseLocalFirewall
}
this.firewallPolicies = append(this.firewallPolicies, web.FirewallPolicy)
}
if len(web.Locations) > 0 {
for _, location := range web.Locations {
// 源站
if location.IsOn && location.ReverseProxyRef != nil && location.ReverseProxyRef.IsOn && location.ReverseProxy != nil && location.ReverseProxy.IsOn {
for _, origin := range location.ReverseProxy.PrimaryOrigins {
if origin.IsOn {
this.originMap[origin.Id] = origin
}
}
for _, origin := range location.ReverseProxy.BackupOrigins {
if origin.IsOn {
this.originMap[origin.Id] = origin
}
}
}
// Web
if location.Web != nil && location.Web.IsOn {
this.lookupWeb(location.Web)
this.lookupWeb(server, location.Web)
}
}
}
}
// IPIsAutoAllowed 检查是否自动允许某个IP
func (this *NodeConfig) IPIsAutoAllowed(ip string) bool {
_, ok := this.allowedIPMap[ip]
return ok
}
// SYNFloodConfig 获取SYN Flood配置
func (this *NodeConfig) SYNFloodConfig() *firewallconfigs.SYNFloodConfig {
return this.synFlood
}
// UpdateCertOCSP 修改证书OCSP
func (this *NodeConfig) UpdateCertOCSP(certId int64, ocsp []byte, expiresAt int64) {
shared.Locker.Lock()
defer shared.Locker.Unlock()
var servers = this.Servers
for _, server := range servers {
if server.HTTPS != nil &&
server.HTTPS.SSLPolicy != nil &&
server.HTTPS.SSLPolicy.OCSPIsOn &&
server.HTTPS.SSLPolicy.ContainsCert(certId) {
server.HTTPS.SSLPolicy.UpdateCertOCSP(certId, ocsp, expiresAt)
}
if server.TLS != nil &&
server.TLS.SSLPolicy != nil &&
server.TLS.SSLPolicy.OCSPIsOn &&
server.TLS.SSLPolicy.ContainsCert(certId) {
server.TLS.SSLPolicy.UpdateCertOCSP(certId, ocsp, expiresAt)
}
}
}
// FindWebPImagePolicyWithClusterId 使用集群ID查找WebP策略
func (this *NodeConfig) FindWebPImagePolicyWithClusterId(clusterId int64) *WebPImagePolicy {
if this.WebPImagePolicies == nil {
return nil
}
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

@@ -5,6 +5,7 @@ import (
_ "github.com/iwind/TeaGo/bootstrap"
"github.com/iwind/TeaGo/logs"
"testing"
"time"
)
func TestSharedNodeConfig(t *testing.T) {
@@ -64,3 +65,37 @@ func TestNodeConfig_Groups(t *testing.T) {
}
logs.PrintAsJSON(config.AvailableGroups(), t)
}
func TestCloneNodeConfig(t *testing.T) {
var config = &NodeConfig{Id: 1, NodeId: "1", IsOn: true}
for i := 0; i < 100_000; i++ {
config.Servers = append(config.Servers, &serverconfigs.ServerConfig{})
}
var before = time.Now()
newConfig, err := CloneNodeConfig(config)
t.Log(time.Since(before))
if err != nil {
t.Fatal(err)
}
newConfig.Servers = []*serverconfigs.ServerConfig{}
logs.PrintAsJSON(newConfig, t)
}
func TestNodeConfig_AddServer(t *testing.T) {
var config = &NodeConfig{Id: 1, NodeId: "1", IsOn: true}
config.AddServer(&serverconfigs.ServerConfig{Id: 1})
config.AddServer(&serverconfigs.ServerConfig{Id: 2})
t.Log("===before===")
for _, s := range config.Servers {
t.Log(s.Id)
}
t.Log("===after===")
config.AddServer(&serverconfigs.ServerConfig{Id: 3})
config.RemoveServer(2)
for _, s := range config.Servers {
t.Log(s.Id)
}
}

View File

@@ -0,0 +1,12 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package nodeconfigs
type NodeIPAddr struct {
Id int64 `json:"id"`
Name string `json:"name"`
IP string `json:"ip"`
IsOn bool `json:"isOn"`
IsUp bool `json:"isUp"`
CanAccess bool `json:"canAccess"`
}

View File

@@ -0,0 +1,37 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package nodeconfigs
type NodeLevel struct {
Name string `yaml:"name" json:"name"`
Code int `yaml:"code" json:"code"`
Description string `yaml:"description" json:"description"`
}
func FindAllNodeLevels() []*NodeLevel {
return []*NodeLevel{
{
Name: "边缘节点",
Code: 1,
Description: "普通的边缘节点。",
},
{
Name: "L2节点",
Code: 2,
Description: "特殊的边缘节点,同时负责同组上一级节点的回源。",
},
}
}
func FindNodeLevel(level int) *NodeLevel {
level--
var levels = FindAllNodeLevels()
if level < 0 {
return levels[0]
}
if level < len(levels) {
return levels[level]
}
return levels[0]
}

View File

@@ -0,0 +1,12 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package nodeconfigs
type NodeLogType = string
const (
NodeLogTypeListenAddressFailed NodeLogType = "listenAddressFailed"
NodeLogTypeServerConfigInitFailed NodeLogType = "serverConfigInitFailed"
NodeLogTypeRunScriptFailed NodeLogType = "runScriptFailed"
NodeLogTypeScriptConsoleLog NodeLogType = "scriptConsoleLog"
)

View File

@@ -0,0 +1,10 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package nodeconfigs
// ParentNodeConfig 父级节点配置
type ParentNodeConfig struct {
Id int64 `yaml:"id" json:"id"`
Addrs []string `yaml:"addrs" json:"addrs"`
SecretHash string `yaml:"secretHash" json:"secretHash"`
}

View File

@@ -14,4 +14,5 @@ const (
NodeRoleNode NodeRole = "node"
NodeRoleCluster NodeRole = "cluster"
NodeRoleAuthority NodeRole = "authority"
NodeRoleReport NodeRole = "report"
)

View File

@@ -20,14 +20,20 @@ type NodeStatus struct {
DiskMaxUsagePartition string `json:"diskMaxUsagePartition"`
DiskTotal uint64 `json:"diskTotal"`
UpdatedAt int64 `json:"updatedAt"`
Timestamp int64 `json:"timestamp"` // 当前节点时间戳
Load1m float64 `json:"load1m"`
Load5m float64 `json:"load5m"`
Load15m float64 `json:"load15m"`
ConnectionCount int `json:"connectionCount"` // 连接数
TrafficInBytes uint64 `json:"trafficInBytes"`
TrafficOutBytes uint64 `json:"trafficOutBytes"`
CacheTotalDiskSize int64 `json:"cacheTotalDiskSize"`
CacheTotalMemorySize int64 `json:"cacheTotalMemorySize"`
LocalFirewallName string `json:"localFirewallName"`
IsActive bool `json:"isActive"`
Error string `json:"error"`
}

View File

@@ -2,19 +2,24 @@
package nodeconfigs
import "encoding/json"
import (
"encoding/json"
)
// NodeValueItem 监控项
type NodeValueItem = string
const (
NodeValueItemCPU NodeValueItem = "cpu" // CPU
NodeValueItemMemory NodeValueItem = "memory" // 内存
NodeValueItemLoad NodeValueItem = "load" // 负载
NodeValueItemTrafficIn NodeValueItem = "trafficIn" // 上行流量
NodeValueItemTrafficOut NodeValueItem = "trafficOut" // 下行流量
NodeValueItemConnections NodeValueItem = "connections" // 连接数
NodeValueItemDisk NodeValueItem = "disk" // 磁盘
NodeValueItemCPU NodeValueItem = "cpu" // CPU
NodeValueItemMemory NodeValueItem = "memory" // 内存
NodeValueItemLoad NodeValueItem = "load" // 负载
NodeValueItemTrafficIn NodeValueItem = "trafficIn" // 上行流量
NodeValueItemTrafficOut NodeValueItem = "trafficOut" // 下行流量
NodeValueItemConnections NodeValueItem = "connections" // 连接数
NodeValueItemRequests NodeValueItem = "requests" // 请求访问量
NodeValueItemAttackRequests NodeValueItem = "attackRequests" // 攻击请求访问量
NodeValueItemDisk NodeValueItem = "disk" // 磁盘
NodeValueItemCacheDir NodeValueItem = "cacheDir" // 缓存目录
)
type nodeValueItemDefinition struct {
@@ -109,6 +114,28 @@ var nodeValueItemDefinitions = []*nodeValueItemDefinition{
},
},
},
{
Code: NodeValueItemRequests,
Name: "请求数",
Params: []*nodeValueItemParamDefinition{
{
Code: "total",
Name: "总数",
Description: "请求总数",
},
},
},
{
Code: NodeValueItemAttackRequests,
Name: "攻击请求数",
Params: []*nodeValueItemParamDefinition{
{
Code: "total",
Name: "总数",
Description: "攻击请求总数",
},
},
},
{
Code: NodeValueItemDisk,
Name: "硬盘空间",

View File

@@ -0,0 +1,160 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package nodeconfigs
import "github.com/iwind/TeaGo/maps"
type IPAddressThresholdItem = string
const (
IPAddressThresholdItemNodeAvgRequests IPAddressThresholdItem = "nodeAvgRequests" // 个
IPAddressThresholdItemNodeAvgTrafficOut IPAddressThresholdItem = "nodeAvgTrafficOut" // 节点下行流量 M
IPAddressThresholdItemNodeAvgTrafficIn IPAddressThresholdItem = "nodeAvgTrafficIn" // 节点上行流量 M
IPAddressThresholdItemNodeHealthCheck IPAddressThresholdItem = "nodeHealthCheck" // 节点健康检查结果
IPAddressThresholdItemGroupAvgRequests IPAddressThresholdItem = "groupAvgRequests" // 个
IPAddressThresholdItemGroupAvgTrafficIn IPAddressThresholdItem = "groupAvgTrafficIn" // 分组上行流量 M
IPAddressThresholdItemGroupAvgTrafficOut IPAddressThresholdItem = "groupAvgTrafficOut" // 分组下行流量 M
IPAddressThresholdItemClusterAvgRequests IPAddressThresholdItem = "clusterAvgRequests" // 个
IPAddressThresholdItemClusterAvgTrafficIn IPAddressThresholdItem = "clusterAvgTrafficIn" // 集群上行流量 M
IPAddressThresholdItemClusterAvgTrafficOut IPAddressThresholdItem = "clusterAvgTrafficOut" // 集群下行流量 M
IPAddressThresholdItemConnectivity IPAddressThresholdItem = "connectivity" // 0-100
)
// FindAllIPAddressThresholdItems IP相关阈值项目
func FindAllIPAddressThresholdItems() []maps.Map {
return []maps.Map{
{
"name": "节点平均请求数",
"code": IPAddressThresholdItemNodeAvgRequests,
"description": "当前节点在单位时间内接收到的平均请求数。",
"unit": "个",
},
{
"name": "节点平均下行流量",
"code": IPAddressThresholdItemNodeAvgTrafficOut,
"description": "当前节点在单位时间内发送的下行流量。",
"unit": "M",
},
{
"name": "节点平均上行流量",
"code": IPAddressThresholdItemNodeAvgTrafficIn,
"description": "当前节点在单位时间内接收的上行流量。",
"unit": "M",
},
{
"name": "节点健康检查结果",
"code": IPAddressThresholdItemNodeHealthCheck,
"description": "当前节点健康检查结果。",
"unit": "",
},
{
"name": "IP连通性",
"code": IPAddressThresholdItemConnectivity,
"description": "通过区域监控得到的当前IP地址的连通性数值取值在0和100之间。",
"unit": "%",
},
{
"name": "分组平均请求数",
"code": IPAddressThresholdItemGroupAvgRequests,
"description": "当前节点所在分组在单位时间内接收到的平均请求数。",
"unit": "个",
},
{
"name": "分组平均下行流量",
"code": IPAddressThresholdItemGroupAvgTrafficOut,
"description": "当前节点所在分组在单位时间内发送的下行流量。",
"unit": "M",
},
{
"name": "分组平均上行流量",
"code": IPAddressThresholdItemGroupAvgTrafficIn,
"description": "当前节点所在分组在单位时间内接收的上行流量。",
"unit": "M",
},
{
"name": "集群平均请求数",
"code": IPAddressThresholdItemClusterAvgRequests,
"description": "当前节点所在集群在单位时间内接收到的平均请求数。",
"unit": "个",
},
{
"name": "集群平均下行流量",
"code": IPAddressThresholdItemClusterAvgTrafficOut,
"description": "当前节点所在集群在单位时间内发送的下行流量。",
"unit": "M",
},
{
"name": "集群平均上行流量",
"code": IPAddressThresholdItemClusterAvgTrafficIn,
"description": "当前节点所在集群在单位时间内接收的上行流量。",
"unit": "M",
},
}
}
// IPAddressThresholdConfig 阈值列表
type IPAddressThresholdConfig struct {
Id int64 `json:"id"`
Items []*IPAddressThresholdItemConfig `json:"items"`
Actions []*IPAddressThresholdActionConfig `json:"actions"`
}
// IPAddressThresholdItemConfig 阈值项目
type IPAddressThresholdItemConfig struct {
Item IPAddressThresholdItem `json:"item"`
Operator NodeValueOperator `json:"operator"`
Value float64 `json:"value"`
Duration int `json:"duration"`
DurationUnit NodeValueDurationUnit `json:"durationUnit"`
Options maps.Map `json:"options"` // 附加选项
}
type IPAddressThresholdActionConfig struct {
Action string `json:"action"`
Options maps.Map `json:"options"`
}
// IPAddressThresholdAction 动作
type IPAddressThresholdAction = string
const (
IPAddressThresholdActionUp IPAddressThresholdAction = "up" // 上线
IPAddressThresholdActionDown IPAddressThresholdAction = "down" // 下线
IPAddressThresholdActionNotify IPAddressThresholdAction = "notify" // 通知
IPAddressThresholdActionSwitch IPAddressThresholdAction = "switch" // 切换到备用IP
IPAddressThresholdActionWebHook IPAddressThresholdAction = "webHook" // 调用外部Webhook
)
// FindAllIPAddressThresholdActions IP相关阈值动作
func FindAllIPAddressThresholdActions() []maps.Map {
return []maps.Map{
{
"name": "上线",
"code": IPAddressThresholdActionUp,
"description": "上线当前IP。",
},
{
"name": "下线",
"code": IPAddressThresholdActionDown,
"description": "下线当前IP。",
},
{
"name": "通知",
"code": IPAddressThresholdActionNotify,
"description": "发送已达到阈值通知。",
},
{
"name": "切换",
"code": IPAddressThresholdActionSwitch,
"description": "在DNS中记录中将IP切换到指定的备用IP。",
},
{
"name": "WebHook",
"code": IPAddressThresholdActionWebHook,
"description": "调用外部的WebHook。",
},
}
}

View File

@@ -0,0 +1,11 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package nodeconfigs
const DefaultProductName = "GoEdge"
// ProductConfig 产品相关设置
type ProductConfig struct {
Name string `yaml:"name" json:"name"`
Version string `yaml:"version" json:"version"`
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,17 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package nodeconfigs
import (
"github.com/iwind/TeaGo/logs"
"testing"
"time"
)
func TestFindAllTimeZoneLocations(t *testing.T) {
var before = time.Now()
var locations = FindAllTimeZoneLocations()
t.Log(len(locations), "locations")
t.Logf("%.2f %s", time.Since(before).Seconds()*1000, "ms")
logs.PrintAsJSON(locations, t)
}

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
}

72
pkg/nodeutils/aes_256.go Normal file
View File

@@ -0,0 +1,72 @@
package nodeutils
import (
"bytes"
"crypto/aes"
"crypto/cipher"
)
type AES256CFBMethod struct {
block cipher.Block
iv []byte
}
func (this *AES256CFBMethod) Init(key, iv []byte) error {
// 判断key是否为32长度
l := len(key)
if l > 32 {
key = key[:32]
} else if l < 32 {
key = append(key, bytes.Repeat([]byte{' '}, 32-l)...)
}
block, err := aes.NewCipher(key)
if err != nil {
return err
}
this.block = block
// 判断iv长度
l2 := len(iv)
if l2 > aes.BlockSize {
iv = iv[:aes.BlockSize]
} else if l2 < aes.BlockSize {
iv = append(iv, bytes.Repeat([]byte{' '}, aes.BlockSize-l2)...)
}
this.iv = iv
return nil
}
func (this *AES256CFBMethod) Encrypt(src []byte) (dst []byte, err error) {
if len(src) == 0 {
return
}
defer func() {
_ = recover()
}()
dst = make([]byte, len(src))
encrypter := cipher.NewCFBEncrypter(this.block, this.iv)
encrypter.XORKeyStream(dst, src)
return
}
func (this *AES256CFBMethod) Decrypt(dst []byte) (src []byte, err error) {
if len(dst) == 0 {
return
}
defer func() {
_ = recover()
}()
src = make([]byte, len(dst))
decrypter := cipher.NewCFBDecrypter(this.block, this.iv)
decrypter.XORKeyStream(src, dst)
return
}

View File

@@ -0,0 +1,75 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package nodeutils
import (
"encoding/base64"
"encoding/json"
"errors"
"github.com/iwind/TeaGo/maps"
"time"
)
// EncryptData 加密
func EncryptData(nodeUniqueId string, nodeSecret string, data maps.Map, timeout int32) (string, error) {
if data == nil {
data = maps.Map{}
}
var expiresAt int64
if timeout > 0 {
expiresAt = time.Now().Unix() + int64(timeout)
}
dataJSON, err := json.Marshal(maps.Map{
"expiresAt": expiresAt,
"data": data,
})
if err != nil {
return "", errors.New("marshal data to json failed: " + err.Error())
}
var method = &AES256CFBMethod{}
err = method.Init([]byte(nodeUniqueId), []byte(nodeSecret))
if err != nil {
return "", err
}
result, err := method.Encrypt(dataJSON)
if err != nil {
return "", err
}
return base64.StdEncoding.EncodeToString(result), nil
}
// DecryptData 解密
func DecryptData(nodeUniqueId string, nodeSecret string, encodedString string) (maps.Map, error) {
var method = &AES256CFBMethod{}
err := method.Init([]byte(nodeUniqueId), []byte(nodeSecret))
if err != nil {
return nil, err
}
encodedData, err := base64.StdEncoding.DecodeString(encodedString)
if err != nil {
return nil, errors.New("base64 decode failed: " + err.Error())
}
dataJSON, err := method.Decrypt(encodedData)
if err != nil {
return nil, err
}
var result = maps.Map{}
err = json.Unmarshal(dataJSON, &result)
if err != nil {
return nil, errors.New("unmarshal data failed: " + err.Error())
}
var expiresAt = result.GetInt64("expiresAt")
if expiresAt > 0 && expiresAt < time.Now().Unix() {
return nil, errors.New("data is expired")
}
return result.GetMap("data"), nil
}

View File

@@ -0,0 +1,32 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package nodeutils
import (
"github.com/iwind/TeaGo/maps"
"testing"
)
func TestEncryptData(t *testing.T) {
e, err := EncryptData("a", "b", maps.Map{
"c": 1,
}, 5)
if err != nil {
t.Fatal(err)
}
t.Log("e:", e)
s, err := DecryptData("a", "b", e)
if err != nil {
t.Fatal(err)
}
t.Log("s:", s)
}
func BenchmarkEncryptData(b *testing.B) {
for i := 0; i < b.N; i++ {
_, _ = EncryptData("a", "b", maps.Map{
"c": 1,
}, 5)
}
}

View File

@@ -0,0 +1,37 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package nodeutils
import (
"encoding/base64"
"encoding/json"
"github.com/iwind/TeaGo/maps"
)
// Base64EncodeMap 对Map进行Base64编码
func Base64EncodeMap(m maps.Map) (string, error) {
if m == nil {
m = maps.Map{}
}
data, err := json.Marshal(m)
if err != nil {
return "", err
}
var result = base64.StdEncoding.EncodeToString(data)
return result, nil
}
// Base64DecodeMap 对Map进行Base64解码
func Base64DecodeMap(encodedString string) (maps.Map, error) {
data, err := base64.StdEncoding.DecodeString(encodedString)
if err != nil {
return nil, err
}
var result = maps.Map{}
err = json.Unmarshal(data, &result)
if err != nil {
return nil, err
}
return result, nil
}

View File

@@ -0,0 +1,55 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package nodeutils
import (
"github.com/iwind/TeaGo/maps"
"testing"
)
func TestBase64EncodeMap(t *testing.T) {
{
var m maps.Map
encodedString, err := Base64EncodeMap(m)
if err != nil {
t.Fatal(err)
}
t.Log("encoded string:", encodedString)
m, err = Base64DecodeMap(encodedString)
if err != nil {
t.Fatal(err)
}
t.Logf("%#v", m)
}
{
var m = maps.Map{}
encodedString, err := Base64EncodeMap(m)
if err != nil {
t.Fatal(err)
}
t.Log("encoded string:", encodedString)
m, err = Base64DecodeMap(encodedString)
if err != nil {
t.Fatal(err)
}
t.Logf("%#v", m)
}
{
var m = maps.Map{"userId": 1, "name": "李白"}
encodedString, err := Base64EncodeMap(m)
if err != nil {
t.Fatal(err)
}
t.Log("encoded string:", encodedString)
m, err = Base64DecodeMap(encodedString)
if err != nil {
t.Fatal(err)
}
t.Logf("%#v", m)
}
}

View File

@@ -0,0 +1,15 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package reporterconfigs
// GlobalSetting 全局设置
type GlobalSetting struct {
MinNotifyConnectivity float64 `json:"minNotifyConnectivity"` // 需要通知的最小连通值
NotifyWebHookURL string `json:"notifyWebHookURL"` // WebHook通知地址
}
func DefaultGlobalSetting() *GlobalSetting {
return &GlobalSetting{
MinNotifyConnectivity: 100,
}
}

View File

@@ -0,0 +1,23 @@
package reporterconfigs
type MessageCode = string
// 节点相关消息
const (
MessageCodeConnectedAPINode MessageCode = "connectedAPINode" // 节点连接API节点成功
MessageCodeCheckSystemdService MessageCode = "checkSystemdService" // 检查Systemd服务
MessageCodeNewNodeTask MessageCode = "newNodeTask" // 有新的节点任务产生
)
// ConnectedAPINodeMessage 连接API节点成功
type ConnectedAPINodeMessage struct {
APINodeId int64 `json:"apiNodeId"`
}
// CheckSystemdServiceMessage Systemd服务
type CheckSystemdServiceMessage struct {
}
// NewNodeTaskMessage 有新的节点任务
type NewNodeTaskMessage struct {
}

View File

@@ -0,0 +1,11 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package reporterconfigs
type NodeConfig struct {
Id int64 `json:"id"`
}
func (this *NodeConfig) Init() error {
return nil
}

View File

@@ -0,0 +1,46 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package reporterconfigs
import (
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
)
type ReportLevel = string
const (
ReportLevelGood ReportLevel = "good"
ReportLevelNormal ReportLevel = "normal"
ReportLevelBad ReportLevel = "bad"
ReportLevelBroken ReportLevel = "broken"
)
func FindAllReportLevels() []*shared.Definition {
return []*shared.Definition{
{
Name: "良好",
Code: ReportLevelGood,
},
{
Name: "正常",
Code: ReportLevelNormal,
},
{
Name: "不良",
Code: ReportLevelBad,
},
{
Name: "错误",
Code: ReportLevelBroken,
},
}
}
func FindReportLevelName(level ReportLevel) string {
for _, def := range FindAllReportLevels() {
if def.Code == level {
return def.Name
}
}
return ""
}

View File

@@ -0,0 +1,16 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package reporterconfigs
type Status struct {
IP string `json:"ip"`
OS string `json:"os"`
OSName string `json:"osName"`
Username string `json:"username"`
BuildVersion string `json:"buildVersion"` // 编译版本
BuildVersionCode uint32 `json:"buildVersionCode"` // 版本数字
UpdatedAt int64 `json:"updatedAt"` // 更新时间
Location string `json:"location"` // 从IP查询到的Location
ISP string `json:"isp"` // 从IP查询到的ISP
}

View File

@@ -0,0 +1,23 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package reporterconfigs
type TaskType = string
const (
TaskTypeIPAddr TaskType = "ipAddr"
)
type IPTask struct {
AddrId int64 `json:"addrId"`
IP string `json:"ip"`
Port int `json:"port"`
}
func FindTaskTypeName(taskType TaskType) string {
switch taskType {
case TaskTypeIPAddr:
return "IP地址"
}
return ""
}

View File

@@ -7,16 +7,17 @@ import (
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/firewallconfigs"
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/ipconfigs"
"github.com/iwind/TeaGo/maps"
)
var SharedHTTPFirewallPolicyDAO = new(HTTPFirewallPolicyDAO)
// WAF策略相关
// HTTPFirewallPolicyDAO WAF策略相关
type HTTPFirewallPolicyDAO struct {
BaseDAO
}
// 查找WAF策略基本信息
// FindEnabledHTTPFirewallPolicy 查找WAF策略基本信息
func (this *HTTPFirewallPolicyDAO) FindEnabledHTTPFirewallPolicy(ctx context.Context, policyId int64) (*pb.HTTPFirewallPolicy, error) {
resp, err := this.RPC().HTTPFirewallPolicyRPC().FindEnabledHTTPFirewallPolicy(ctx, &pb.FindEnabledHTTPFirewallPolicyRequest{HttpFirewallPolicyId: policyId})
if err != nil {
@@ -25,7 +26,7 @@ func (this *HTTPFirewallPolicyDAO) FindEnabledHTTPFirewallPolicy(ctx context.Con
return resp.HttpFirewallPolicy, nil
}
// 查找WAF策略配置
// FindEnabledHTTPFirewallPolicyConfig 查找WAF策略配置
func (this *HTTPFirewallPolicyDAO) FindEnabledHTTPFirewallPolicyConfig(ctx context.Context, policyId int64) (*firewallconfigs.HTTPFirewallPolicy, error) {
resp, err := this.RPC().HTTPFirewallPolicyRPC().FindEnabledHTTPFirewallPolicyConfig(ctx, &pb.FindEnabledHTTPFirewallPolicyConfigRequest{HttpFirewallPolicyId: policyId})
if err != nil {
@@ -42,7 +43,7 @@ func (this *HTTPFirewallPolicyDAO) FindEnabledHTTPFirewallPolicyConfig(ctx conte
return firewallPolicy, nil
}
// 查找WAF的Inbound
// FindEnabledHTTPFirewallPolicyInboundConfig 查找WAF的Inbound
func (this *HTTPFirewallPolicyDAO) FindEnabledHTTPFirewallPolicyInboundConfig(ctx context.Context, policyId int64) (*firewallconfigs.HTTPFirewallInboundConfig, error) {
config, err := this.FindEnabledHTTPFirewallPolicyConfig(ctx, policyId)
if err != nil {
@@ -54,7 +55,7 @@ func (this *HTTPFirewallPolicyDAO) FindEnabledHTTPFirewallPolicyInboundConfig(ct
return config.Inbound, nil
}
// 根据类型查找WAF的IP名单
// FindEnabledPolicyIPListIdWithType 根据类型查找WAF的IP名单
func (this *HTTPFirewallPolicyDAO) FindEnabledPolicyIPListIdWithType(ctx context.Context, policyId int64, listType ipconfigs.IPListType) (int64, error) {
switch listType {
case ipconfigs.IPListTypeWhite:
@@ -66,7 +67,7 @@ func (this *HTTPFirewallPolicyDAO) FindEnabledPolicyIPListIdWithType(ctx context
}
}
// 查找WAF的白名单
// FindEnabledPolicyWhiteIPListId 查找WAF的白名单
func (this *HTTPFirewallPolicyDAO) FindEnabledPolicyWhiteIPListId(ctx context.Context, policyId int64) (int64, error) {
config, err := this.FindEnabledHTTPFirewallPolicyConfig(ctx, policyId)
if err != nil {
@@ -110,7 +111,7 @@ func (this *HTTPFirewallPolicyDAO) FindEnabledPolicyWhiteIPListId(ctx context.Co
return config.Inbound.AllowListRef.ListId, nil
}
// 查找WAF的黑名单
// FindEnabledPolicyBlackIPListId 查找WAF的黑名单
func (this *HTTPFirewallPolicyDAO) FindEnabledPolicyBlackIPListId(ctx context.Context, policyId int64) (int64, error) {
config, err := this.FindEnabledHTTPFirewallPolicyConfig(ctx, policyId)
if err != nil {
@@ -154,7 +155,7 @@ func (this *HTTPFirewallPolicyDAO) FindEnabledPolicyBlackIPListId(ctx context.Co
return config.Inbound.DenyListRef.ListId, nil
}
// 根据服务Id查找WAF策略
// FindEnabledHTTPFirewallPolicyWithServerId 根据服务Id查找WAF策略
func (this *HTTPFirewallPolicyDAO) FindEnabledHTTPFirewallPolicyWithServerId(ctx context.Context, serverId int64) (*pb.HTTPFirewallPolicy, error) {
serverResp, err := this.RPC().ServerRPC().FindEnabledServer(ctx, &pb.FindEnabledServerRequest{ServerId: serverId})
if err != nil {
@@ -180,3 +181,72 @@ func (this *HTTPFirewallPolicyDAO) FindEnabledHTTPFirewallPolicyWithServerId(ctx
}
return SharedHTTPFirewallPolicyDAO.FindEnabledHTTPFirewallPolicy(ctx, cluster.HttpFirewallPolicyId)
}
// FindHTTPFirewallActionConfigs 查找动作相关信息
func (this *HTTPFirewallPolicyDAO) FindHTTPFirewallActionConfigs(ctx context.Context, actions []*firewallconfigs.HTTPFirewallActionConfig) ([]maps.Map, error) {
var actionConfigs = []maps.Map{}
for _, action := range actions {
def := firewallconfigs.FindActionDefinition(action.Code)
if def == nil {
continue
}
if action.Options == nil {
action.Options = maps.Map{}
}
switch action.Code {
case firewallconfigs.HTTPFirewallActionRecordIP:
listId := action.Options.GetInt64("ipListId")
listResp, err := this.RPC().IPListRPC().FindEnabledIPList(ctx, &pb.FindEnabledIPListRequest{IpListId: listId})
if err != nil {
return nil, err
}
if listResp.IpList != nil {
action.Options["ipListName"] = listResp.IpList.Name
} else {
action.Options["ipListName"] = action.Options.GetString("ipListName") + "(已删除)"
}
case firewallconfigs.HTTPFirewallActionGoGroup:
groupId := action.Options.GetInt64("groupId")
groupResp, err := this.RPC().HTTPFirewallRuleGroupRPC().FindEnabledHTTPFirewallRuleGroup(ctx, &pb.FindEnabledHTTPFirewallRuleGroupRequest{FirewallRuleGroupId: groupId})
if err != nil {
return nil, err
}
if groupResp.FirewallRuleGroup != nil {
action.Options["groupName"] = groupResp.FirewallRuleGroup.Name
} else {
action.Options["groupName"] = action.Options.GetString("groupName") + "(已删除)"
}
case firewallconfigs.HTTPFirewallActionGoSet:
groupId := action.Options.GetInt64("groupId")
groupResp, err := this.RPC().HTTPFirewallRuleGroupRPC().FindEnabledHTTPFirewallRuleGroup(ctx, &pb.FindEnabledHTTPFirewallRuleGroupRequest{FirewallRuleGroupId: groupId})
if err != nil {
return nil, err
}
if groupResp.FirewallRuleGroup != nil {
action.Options["groupName"] = groupResp.FirewallRuleGroup.Name
} else {
action.Options["groupName"] = action.Options.GetString("groupName") + "(已删除)"
}
setId := action.Options.GetInt64("setId")
setResp, err := this.RPC().HTTPFirewallRuleSetRPC().FindEnabledHTTPFirewallRuleSet(ctx, &pb.FindEnabledHTTPFirewallRuleSetRequest{FirewallRuleSetId: setId})
if err != nil {
return nil, err
}
if setResp.FirewallRuleSet != nil {
action.Options["setName"] = setResp.FirewallRuleSet.Name
} else {
action.Options["setName"] = action.Options.GetString("setName") + "(已删除)"
}
}
actionConfigs = append(actionConfigs, maps.Map{
"name": def.Name,
"code": def.Code,
"category": def.Category,
"options": action.Options,
})
}
return actionConfigs, nil
}

View File

@@ -15,7 +15,7 @@ type HTTPWebDAO struct {
BaseDAO
}
// 根据ServerId查找Web配置
// FindWebConfigWithServerId 根据ServerId查找Web配置
func (this *HTTPWebDAO) FindWebConfigWithServerId(ctx context.Context, serverId int64) (*serverconfigs.HTTPWebConfig, error) {
resp, err := this.RPC().ServerRPC().FindAndInitServerWebConfig(ctx, &pb.FindAndInitServerWebConfigRequest{ServerId: serverId})
if err != nil {
@@ -29,7 +29,7 @@ func (this *HTTPWebDAO) FindWebConfigWithServerId(ctx context.Context, serverId
return config, nil
}
// 根据LocationId查找Web配置
// FindWebConfigWithLocationId 根据LocationId查找Web配置
func (this *HTTPWebDAO) FindWebConfigWithLocationId(ctx context.Context, locationId int64) (*serverconfigs.HTTPWebConfig, error) {
resp, err := this.RPC().HTTPLocationRPC().FindAndInitHTTPLocationWebConfig(ctx, &pb.FindAndInitHTTPLocationWebConfigRequest{LocationId: locationId})
if err != nil {
@@ -43,9 +43,9 @@ func (this *HTTPWebDAO) FindWebConfigWithLocationId(ctx context.Context, locatio
return config, nil
}
// 根据WebId查找Web配置
func (this *HTTPWebDAO) FindWebConfigWithId(ctx context.Context, webId int64) (*serverconfigs.HTTPWebConfig, error) {
resp, err := this.RPC().HTTPWebRPC().FindEnabledHTTPWebConfig(ctx, &pb.FindEnabledHTTPWebConfigRequest{WebId: webId})
// FindWebConfigWithServerGroupId 根据ServerGroupId查找Web配置
func (this *HTTPWebDAO) FindWebConfigWithServerGroupId(ctx context.Context, serverGroupId int64) (*serverconfigs.HTTPWebConfig, error) {
resp, err := this.RPC().ServerGroupRPC().FindAndInitServerGroupWebConfig(ctx, &pb.FindAndInitServerGroupWebConfigRequest{ServerGroupId: serverGroupId})
if err != nil {
return nil, err
}
@@ -57,14 +57,29 @@ func (this *HTTPWebDAO) FindWebConfigWithId(ctx context.Context, webId int64) (*
return config, nil
}
// 初始化防火墙设
func (this *HTTPWebDAO) InitEmptyHTTPFirewallPolicy(ctx context.Context, serverId int64, webId int64, isOn bool) (int64, error) {
// FindWebConfigWithId 根据WebId查找Web配
func (this *HTTPWebDAO) FindWebConfigWithId(ctx context.Context, webId int64) (*serverconfigs.HTTPWebConfig, error) {
resp, err := this.RPC().HTTPWebRPC().FindEnabledHTTPWebConfig(ctx, &pb.FindEnabledHTTPWebConfigRequest{HttpWebId: webId})
if err != nil {
return nil, err
}
config := &serverconfigs.HTTPWebConfig{}
err = json.Unmarshal(resp.HttpWebJSON, config)
if err != nil {
return nil, err
}
return config, nil
}
// InitEmptyHTTPFirewallPolicy 初始化防火墙设置
func (this *HTTPWebDAO) InitEmptyHTTPFirewallPolicy(ctx context.Context, serverGroupId int64, serverId int64, webId int64, isOn bool) (int64, error) {
// 创建FirewallPolicy
firewallPolicyIdResp, err := this.RPC().HTTPFirewallPolicyRPC().CreateEmptyHTTPFirewallPolicy(ctx, &pb.CreateEmptyHTTPFirewallPolicyRequest{
ServerId: serverId,
IsOn: true,
Name: "用户自定义",
Description: "",
ServerGroupId: serverGroupId,
ServerId: serverId,
IsOn: true,
Name: "用户自定义",
Description: "",
})
if err != nil {
return 0, errors.Wrap(err)
@@ -83,7 +98,7 @@ func (this *HTTPWebDAO) InitEmptyHTTPFirewallPolicy(ctx context.Context, serverI
}
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebFirewall(ctx, &pb.UpdateHTTPWebFirewallRequest{
WebId: webId,
HttpWebId: webId,
FirewallJSON: firewallRefJSON,
})
if err != nil {

View File

@@ -15,7 +15,7 @@ type IPListDAO struct {
BaseDAO
}
// 查找服务的允许IP列表
// FindAllowIPListIdWithServerId 查找服务的允许IP列表
func (this *IPListDAO) FindAllowIPListIdWithServerId(ctx context.Context, serverId int64) (int64, error) {
webConfig, err := SharedHTTPWebDAO.FindWebConfigWithServerId(ctx, serverId)
if err != nil {
@@ -30,7 +30,7 @@ func (this *IPListDAO) FindAllowIPListIdWithServerId(ctx context.Context, server
return webConfig.FirewallPolicy.Inbound.AllowListRef.ListId, nil
}
// 查找服务的禁止IP列表
// FindDenyIPListIdWithServerId 查找服务的禁止IP列表
func (this *IPListDAO) FindDenyIPListIdWithServerId(ctx context.Context, serverId int64) (int64, error) {
webConfig, err := SharedHTTPWebDAO.FindWebConfigWithServerId(ctx, serverId)
if err != nil {
@@ -45,7 +45,7 @@ func (this *IPListDAO) FindDenyIPListIdWithServerId(ctx context.Context, serverI
return webConfig.FirewallPolicy.Inbound.DenyListRef.ListId, nil
}
// 为服务创建IP名单
// CreateIPListForServerId 为服务创建IP名单
func (this *IPListDAO) CreateIPListForServerId(ctx context.Context, serverId int64, listType string) (int64, error) {
webConfig, err := SharedHTTPWebDAO.FindWebConfigWithServerId(ctx, serverId)
if err != nil {
@@ -56,7 +56,7 @@ func (this *IPListDAO) CreateIPListForServerId(ctx context.Context, serverId int
}
if webConfig.FirewallPolicy == nil || webConfig.FirewallPolicy.Id == 0 {
isOn := webConfig.FirewallRef != nil && webConfig.FirewallRef.IsOn
_, err = SharedHTTPWebDAO.InitEmptyHTTPFirewallPolicy(ctx, serverId, webConfig.Id, isOn)
_, err = SharedHTTPWebDAO.InitEmptyHTTPFirewallPolicy(ctx, 0, serverId, webConfig.Id, isOn)
if err != nil {
return 0, errors.Wrap(err)
}
@@ -102,6 +102,7 @@ func (this *IPListDAO) CreateIPListForServerId(ctx context.Context, serverId int
Type: listType,
Name: "IP名单",
Code: listType,
ServerId: serverId,
TimeoutJSON: nil,
})
if err != nil {

View File

@@ -13,7 +13,7 @@ type ServerDAO struct {
BaseDAO
}
// 查找服务配置
// FindEnabledServerConfig 查找服务配置
func (this *ServerDAO) FindEnabledServerConfig(ctx context.Context, serverId int64) (*serverconfigs.ServerConfig, error) {
resp, err := this.RPC().ServerRPC().FindEnabledServerConfig(ctx, &pb.FindEnabledServerConfigRequest{ServerId: serverId})
if err != nil {
@@ -30,7 +30,7 @@ func (this *ServerDAO) FindEnabledServerConfig(ctx context.Context, serverId int
return config, nil
}
// 查找服务
// FindEnabledServer 查找服务
func (this *ServerDAO) FindEnabledServer(ctx context.Context, serverId int64) (*pb.Server, error) {
resp, err := this.RPC().ServerRPC().FindEnabledServer(ctx, &pb.FindEnabledServerRequest{ServerId: serverId})
if err != nil {

View File

@@ -6,27 +6,28 @@ import (
"errors"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"strings"
)
// HumanError 格式化GRPC相关错误
func HumanError(err error) error {
func HumanError(err error, endpoints []string, configFile string) (resultErr error, isConnError bool) {
if err == nil {
return err
return err, false
}
errStatus, ok := status.FromError(err)
if !ok {
return err
return err, false
}
switch errStatus.Code() {
case codes.InvalidArgument:
return errors.New("错误的RPC参数" + err.Error())
return errors.New("错误的RPC参数" + err.Error()), false
case codes.DeadlineExceeded:
return errors.New("RPC操作超时请重试" + err.Error())
return errors.New("RPC操作超时请重试" + err.Error()), false
case codes.Unimplemented:
return errors.New("请求的RPC服务或方法不存在可能是没有升级API节点或者当前节点没有升级" + err.Error())
return errors.New("请求的RPC服务或方法不存在可能是没有升级API节点或者当前节点没有升级" + err.Error()), false
case codes.Unavailable:
return errors.New("RPC当前不可用请确保API节点已启动并检查当前节点和API节点之间的网络连接是正常的" + err.Error())
return errors.New("RPC当前不可用<br/>1、请确认当前节点的api.yaml<em>" + configFile + "</em>)配置中的地址(<em>" + strings.Join(endpoints, ", ") + "</em>)是否已填写正确;<br/>2、请确保API节点已启动并检查当前节点和API节点之间的网络连接是正常的。<hr/>错误信息" + err.Error()), true
}
return err
return err, false
}

View File

@@ -0,0 +1,430 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.19.4
// source: api_method_stat_service.proto
package pb
import (
context "context"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
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 FindAPIMethodStatsWithDayRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Day string `protobuf:"bytes,1,opt,name=day,proto3" json:"day,omitempty"` // YYYYMMDD
}
func (x *FindAPIMethodStatsWithDayRequest) Reset() {
*x = FindAPIMethodStatsWithDayRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_method_stat_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *FindAPIMethodStatsWithDayRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FindAPIMethodStatsWithDayRequest) ProtoMessage() {}
func (x *FindAPIMethodStatsWithDayRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_method_stat_service_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 FindAPIMethodStatsWithDayRequest.ProtoReflect.Descriptor instead.
func (*FindAPIMethodStatsWithDayRequest) Descriptor() ([]byte, []int) {
return file_api_method_stat_service_proto_rawDescGZIP(), []int{0}
}
func (x *FindAPIMethodStatsWithDayRequest) GetDay() string {
if x != nil {
return x.Day
}
return ""
}
type FindAPIMethodStatsWithDayResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ApiMethodStats []*APIMethodStat `protobuf:"bytes,1,rep,name=apiMethodStats,proto3" json:"apiMethodStats,omitempty"`
}
func (x *FindAPIMethodStatsWithDayResponse) Reset() {
*x = FindAPIMethodStatsWithDayResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_method_stat_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *FindAPIMethodStatsWithDayResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FindAPIMethodStatsWithDayResponse) ProtoMessage() {}
func (x *FindAPIMethodStatsWithDayResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_method_stat_service_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 FindAPIMethodStatsWithDayResponse.ProtoReflect.Descriptor instead.
func (*FindAPIMethodStatsWithDayResponse) Descriptor() ([]byte, []int) {
return file_api_method_stat_service_proto_rawDescGZIP(), []int{1}
}
func (x *FindAPIMethodStatsWithDayResponse) GetApiMethodStats() []*APIMethodStat {
if x != nil {
return x.ApiMethodStats
}
return nil
}
// 检查是否有统计数据
type CountAPIMethodStatsWithDayRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Day string `protobuf:"bytes,1,opt,name=day,proto3" json:"day,omitempty"` // YYYYMMDD
}
func (x *CountAPIMethodStatsWithDayRequest) Reset() {
*x = CountAPIMethodStatsWithDayRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_method_stat_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CountAPIMethodStatsWithDayRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CountAPIMethodStatsWithDayRequest) ProtoMessage() {}
func (x *CountAPIMethodStatsWithDayRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_method_stat_service_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 CountAPIMethodStatsWithDayRequest.ProtoReflect.Descriptor instead.
func (*CountAPIMethodStatsWithDayRequest) Descriptor() ([]byte, []int) {
return file_api_method_stat_service_proto_rawDescGZIP(), []int{2}
}
func (x *CountAPIMethodStatsWithDayRequest) GetDay() string {
if x != nil {
return x.Day
}
return ""
}
var File_api_method_stat_service_proto protoreflect.FileDescriptor
var file_api_method_stat_service_proto_rawDesc = []byte{
0x0a, 0x1d, 0x61, 0x70, 0x69, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x73, 0x74, 0x61,
0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 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, 0x61, 0x70, 0x69, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x73, 0x74, 0x61,
0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f,
0x72, 0x70, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x22, 0x34, 0x0a, 0x20, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x50, 0x49, 0x4d, 0x65, 0x74,
0x68, 0x6f, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x57, 0x69, 0x74, 0x68, 0x44, 0x61, 0x79, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x61, 0x79, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x61, 0x79, 0x22, 0x5e, 0x0a, 0x21, 0x46, 0x69, 0x6e, 0x64,
0x41, 0x50, 0x49, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x57, 0x69,
0x74, 0x68, 0x44, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a,
0x0e, 0x61, 0x70, 0x69, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x18,
0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x50, 0x49, 0x4d, 0x65,
0x74, 0x68, 0x6f, 0x64, 0x53, 0x74, 0x61, 0x74, 0x52, 0x0e, 0x61, 0x70, 0x69, 0x4d, 0x65, 0x74,
0x68, 0x6f, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x22, 0x35, 0x0a, 0x21, 0x43, 0x6f, 0x75, 0x6e,
0x74, 0x41, 0x50, 0x49, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x57,
0x69, 0x74, 0x68, 0x44, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a,
0x03, 0x64, 0x61, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x61, 0x79, 0x32,
0xdb, 0x01, 0x0a, 0x14, 0x41, 0x50, 0x49, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x53, 0x74, 0x61,
0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x68, 0x0a, 0x19, 0x66, 0x69, 0x6e, 0x64,
0x41, 0x50, 0x49, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x57, 0x69,
0x74, 0x68, 0x44, 0x61, 0x79, 0x12, 0x24, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41,
0x50, 0x49, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x57, 0x69, 0x74,
0x68, 0x44, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x62,
0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x50, 0x49, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x53, 0x74,
0x61, 0x74, 0x73, 0x57, 0x69, 0x74, 0x68, 0x44, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x59, 0x0a, 0x1a, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x50, 0x49, 0x4d, 0x65,
0x74, 0x68, 0x6f, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x57, 0x69, 0x74, 0x68, 0x44, 0x61, 0x79,
0x12, 0x25, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x50, 0x49, 0x4d, 0x65,
0x74, 0x68, 0x6f, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x57, 0x69, 0x74, 0x68, 0x44, 0x61, 0x79,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43,
0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_api_method_stat_service_proto_rawDescOnce sync.Once
file_api_method_stat_service_proto_rawDescData = file_api_method_stat_service_proto_rawDesc
)
func file_api_method_stat_service_proto_rawDescGZIP() []byte {
file_api_method_stat_service_proto_rawDescOnce.Do(func() {
file_api_method_stat_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_method_stat_service_proto_rawDescData)
})
return file_api_method_stat_service_proto_rawDescData
}
var file_api_method_stat_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_api_method_stat_service_proto_goTypes = []interface{}{
(*FindAPIMethodStatsWithDayRequest)(nil), // 0: pb.FindAPIMethodStatsWithDayRequest
(*FindAPIMethodStatsWithDayResponse)(nil), // 1: pb.FindAPIMethodStatsWithDayResponse
(*CountAPIMethodStatsWithDayRequest)(nil), // 2: pb.CountAPIMethodStatsWithDayRequest
(*APIMethodStat)(nil), // 3: pb.APIMethodStat
(*RPCCountResponse)(nil), // 4: pb.RPCCountResponse
}
var file_api_method_stat_service_proto_depIdxs = []int32{
3, // 0: pb.FindAPIMethodStatsWithDayResponse.apiMethodStats:type_name -> pb.APIMethodStat
0, // 1: pb.APIMethodStatService.findAPIMethodStatsWithDay:input_type -> pb.FindAPIMethodStatsWithDayRequest
2, // 2: pb.APIMethodStatService.countAPIMethodStatsWithDay:input_type -> pb.CountAPIMethodStatsWithDayRequest
1, // 3: pb.APIMethodStatService.findAPIMethodStatsWithDay:output_type -> pb.FindAPIMethodStatsWithDayResponse
4, // 4: pb.APIMethodStatService.countAPIMethodStatsWithDay:output_type -> pb.RPCCountResponse
3, // [3:5] is the sub-list for method output_type
1, // [1:3] 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_api_method_stat_service_proto_init() }
func file_api_method_stat_service_proto_init() {
if File_api_method_stat_service_proto != nil {
return
}
file_models_model_api_method_stat_proto_init()
file_models_rpc_messages_proto_init()
if !protoimpl.UnsafeEnabled {
file_api_method_stat_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FindAPIMethodStatsWithDayRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_api_method_stat_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FindAPIMethodStatsWithDayResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_api_method_stat_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CountAPIMethodStatsWithDayRequest); 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_api_method_stat_service_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_api_method_stat_service_proto_goTypes,
DependencyIndexes: file_api_method_stat_service_proto_depIdxs,
MessageInfos: file_api_method_stat_service_proto_msgTypes,
}.Build()
File_api_method_stat_service_proto = out.File
file_api_method_stat_service_proto_rawDesc = nil
file_api_method_stat_service_proto_goTypes = nil
file_api_method_stat_service_proto_depIdxs = nil
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
// APIMethodStatServiceClient is the client API for APIMethodStatService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type APIMethodStatServiceClient interface {
// 查找某天的统计
FindAPIMethodStatsWithDay(ctx context.Context, in *FindAPIMethodStatsWithDayRequest, opts ...grpc.CallOption) (*FindAPIMethodStatsWithDayResponse, error)
// 检查是否有统计数据
CountAPIMethodStatsWithDay(ctx context.Context, in *CountAPIMethodStatsWithDayRequest, opts ...grpc.CallOption) (*RPCCountResponse, error)
}
type aPIMethodStatServiceClient struct {
cc grpc.ClientConnInterface
}
func NewAPIMethodStatServiceClient(cc grpc.ClientConnInterface) APIMethodStatServiceClient {
return &aPIMethodStatServiceClient{cc}
}
func (c *aPIMethodStatServiceClient) FindAPIMethodStatsWithDay(ctx context.Context, in *FindAPIMethodStatsWithDayRequest, opts ...grpc.CallOption) (*FindAPIMethodStatsWithDayResponse, error) {
out := new(FindAPIMethodStatsWithDayResponse)
err := c.cc.Invoke(ctx, "/pb.APIMethodStatService/findAPIMethodStatsWithDay", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *aPIMethodStatServiceClient) CountAPIMethodStatsWithDay(ctx context.Context, in *CountAPIMethodStatsWithDayRequest, opts ...grpc.CallOption) (*RPCCountResponse, error) {
out := new(RPCCountResponse)
err := c.cc.Invoke(ctx, "/pb.APIMethodStatService/countAPIMethodStatsWithDay", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// APIMethodStatServiceServer is the server API for APIMethodStatService service.
type APIMethodStatServiceServer interface {
// 查找某天的统计
FindAPIMethodStatsWithDay(context.Context, *FindAPIMethodStatsWithDayRequest) (*FindAPIMethodStatsWithDayResponse, error)
// 检查是否有统计数据
CountAPIMethodStatsWithDay(context.Context, *CountAPIMethodStatsWithDayRequest) (*RPCCountResponse, error)
}
// UnimplementedAPIMethodStatServiceServer can be embedded to have forward compatible implementations.
type UnimplementedAPIMethodStatServiceServer struct {
}
func (*UnimplementedAPIMethodStatServiceServer) FindAPIMethodStatsWithDay(context.Context, *FindAPIMethodStatsWithDayRequest) (*FindAPIMethodStatsWithDayResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindAPIMethodStatsWithDay not implemented")
}
func (*UnimplementedAPIMethodStatServiceServer) CountAPIMethodStatsWithDay(context.Context, *CountAPIMethodStatsWithDayRequest) (*RPCCountResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CountAPIMethodStatsWithDay not implemented")
}
func RegisterAPIMethodStatServiceServer(s *grpc.Server, srv APIMethodStatServiceServer) {
s.RegisterService(&_APIMethodStatService_serviceDesc, srv)
}
func _APIMethodStatService_FindAPIMethodStatsWithDay_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FindAPIMethodStatsWithDayRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(APIMethodStatServiceServer).FindAPIMethodStatsWithDay(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.APIMethodStatService/FindAPIMethodStatsWithDay",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(APIMethodStatServiceServer).FindAPIMethodStatsWithDay(ctx, req.(*FindAPIMethodStatsWithDayRequest))
}
return interceptor(ctx, in, info, handler)
}
func _APIMethodStatService_CountAPIMethodStatsWithDay_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CountAPIMethodStatsWithDayRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(APIMethodStatServiceServer).CountAPIMethodStatsWithDay(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.APIMethodStatService/CountAPIMethodStatsWithDay",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(APIMethodStatServiceServer).CountAPIMethodStatsWithDay(ctx, req.(*CountAPIMethodStatsWithDayRequest))
}
return interceptor(ctx, in, info, handler)
}
var _APIMethodStatService_serviceDesc = grpc.ServiceDesc{
ServiceName: "pb.APIMethodStatService",
HandlerType: (*APIMethodStatServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "findAPIMethodStatsWithDay",
Handler: _APIMethodStatService_FindAPIMethodStatsWithDay_Handler,
},
{
MethodName: "countAPIMethodStatsWithDay",
Handler: _APIMethodStatService_CountAPIMethodStatsWithDay_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api_method_stat_service.proto",
}

View File

@@ -0,0 +1,197 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.19.4
// source: models/model_acme_provider.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 ACMEProvider struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
ApiURL string `protobuf:"bytes,5,opt,name=apiURL,proto3" json:"apiURL,omitempty"`
RequireEAB bool `protobuf:"varint,6,opt,name=requireEAB,proto3" json:"requireEAB,omitempty"`
EabDescription string `protobuf:"bytes,7,opt,name=eabDescription,proto3" json:"eabDescription,omitempty"`
}
func (x *ACMEProvider) Reset() {
*x = ACMEProvider{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_acme_provider_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ACMEProvider) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ACMEProvider) ProtoMessage() {}
func (x *ACMEProvider) ProtoReflect() protoreflect.Message {
mi := &file_models_model_acme_provider_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 ACMEProvider.ProtoReflect.Descriptor instead.
func (*ACMEProvider) Descriptor() ([]byte, []int) {
return file_models_model_acme_provider_proto_rawDescGZIP(), []int{0}
}
func (x *ACMEProvider) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ACMEProvider) GetCode() string {
if x != nil {
return x.Code
}
return ""
}
func (x *ACMEProvider) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
func (x *ACMEProvider) GetApiURL() string {
if x != nil {
return x.ApiURL
}
return ""
}
func (x *ACMEProvider) GetRequireEAB() bool {
if x != nil {
return x.RequireEAB
}
return false
}
func (x *ACMEProvider) GetEabDescription() string {
if x != nil {
return x.EabDescription
}
return ""
}
var File_models_model_acme_provider_proto protoreflect.FileDescriptor
var file_models_model_acme_provider_proto_rawDesc = []byte{
0x0a, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x61,
0x63, 0x6d, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xb8, 0x01, 0x0a, 0x0c, 0x41, 0x43, 0x4d, 0x45, 0x50,
0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63,
0x6f, 0x64, 0x65, 0x18, 0x02, 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, 0x61, 0x70, 0x69, 0x55, 0x52, 0x4c, 0x18, 0x05, 0x20, 0x01, 0x28,
0x09, 0x52, 0x06, 0x61, 0x70, 0x69, 0x55, 0x52, 0x4c, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x71,
0x75, 0x69, 0x72, 0x65, 0x45, 0x41, 0x42, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x72,
0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x41, 0x42, 0x12, 0x26, 0x0a, 0x0e, 0x65, 0x61, 0x62,
0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0e, 0x65, 0x61, 0x62, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f,
0x6e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
file_models_model_acme_provider_proto_rawDescOnce sync.Once
file_models_model_acme_provider_proto_rawDescData = file_models_model_acme_provider_proto_rawDesc
)
func file_models_model_acme_provider_proto_rawDescGZIP() []byte {
file_models_model_acme_provider_proto_rawDescOnce.Do(func() {
file_models_model_acme_provider_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_acme_provider_proto_rawDescData)
})
return file_models_model_acme_provider_proto_rawDescData
}
var file_models_model_acme_provider_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_acme_provider_proto_goTypes = []interface{}{
(*ACMEProvider)(nil), // 0: pb.ACMEProvider
}
var file_models_model_acme_provider_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_acme_provider_proto_init() }
func file_models_model_acme_provider_proto_init() {
if File_models_model_acme_provider_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_models_model_acme_provider_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ACMEProvider); 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_acme_provider_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_models_model_acme_provider_proto_goTypes,
DependencyIndexes: file_models_model_acme_provider_proto_depIdxs,
MessageInfos: file_models_model_acme_provider_proto_msgTypes,
}.Build()
File_models_model_acme_provider_proto = out.File
file_models_model_acme_provider_proto_rawDesc = nil
file_models_model_acme_provider_proto_goTypes = nil
file_models_model_acme_provider_proto_depIdxs = nil
}

View File

@@ -0,0 +1,221 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.19.4
// source: models/model_acme_provider_account.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 ACMEProviderAccount 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"`
ProviderCode string `protobuf:"bytes,4,opt,name=providerCode,proto3" json:"providerCode,omitempty"`
EabKid string `protobuf:"bytes,5,opt,name=eabKid,proto3" json:"eabKid,omitempty"`
EabKey string `protobuf:"bytes,6,opt,name=eabKey,proto3" json:"eabKey,omitempty"`
Error string `protobuf:"bytes,7,opt,name=error,proto3" json:"error,omitempty"`
AcmeProvider *ACMEProvider `protobuf:"bytes,30,opt,name=acmeProvider,proto3" json:"acmeProvider,omitempty"`
}
func (x *ACMEProviderAccount) Reset() {
*x = ACMEProviderAccount{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_acme_provider_account_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ACMEProviderAccount) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ACMEProviderAccount) ProtoMessage() {}
func (x *ACMEProviderAccount) ProtoReflect() protoreflect.Message {
mi := &file_models_model_acme_provider_account_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 ACMEProviderAccount.ProtoReflect.Descriptor instead.
func (*ACMEProviderAccount) Descriptor() ([]byte, []int) {
return file_models_model_acme_provider_account_proto_rawDescGZIP(), []int{0}
}
func (x *ACMEProviderAccount) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *ACMEProviderAccount) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ACMEProviderAccount) GetIsOn() bool {
if x != nil {
return x.IsOn
}
return false
}
func (x *ACMEProviderAccount) GetProviderCode() string {
if x != nil {
return x.ProviderCode
}
return ""
}
func (x *ACMEProviderAccount) GetEabKid() string {
if x != nil {
return x.EabKid
}
return ""
}
func (x *ACMEProviderAccount) GetEabKey() string {
if x != nil {
return x.EabKey
}
return ""
}
func (x *ACMEProviderAccount) GetError() string {
if x != nil {
return x.Error
}
return ""
}
func (x *ACMEProviderAccount) GetAcmeProvider() *ACMEProvider {
if x != nil {
return x.AcmeProvider
}
return nil
}
var File_models_model_acme_provider_account_proto protoreflect.FileDescriptor
var file_models_model_acme_provider_account_proto_rawDesc = []byte{
0x0a, 0x28, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x61,
0x63, 0x6d, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x63, 0x63,
0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x20,
0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x61, 0x63, 0x6d,
0x65, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x22, 0xed, 0x01, 0x0a, 0x13, 0x41, 0x43, 0x4d, 0x45, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,
0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 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,
0x69, 0x73, 0x4f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e,
0x12, 0x22, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x64, 0x65,
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72,
0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x61, 0x62, 0x4b, 0x69, 0x64, 0x18, 0x05,
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x61, 0x62, 0x4b, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06,
0x65, 0x61, 0x62, 0x4b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x61,
0x62, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x07, 0x20,
0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x34, 0x0a, 0x0c, 0x61, 0x63,
0x6d, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x43, 0x4d, 0x45, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64,
0x65, 0x72, 0x52, 0x0c, 0x61, 0x63, 0x6d, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72,
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_models_model_acme_provider_account_proto_rawDescOnce sync.Once
file_models_model_acme_provider_account_proto_rawDescData = file_models_model_acme_provider_account_proto_rawDesc
)
func file_models_model_acme_provider_account_proto_rawDescGZIP() []byte {
file_models_model_acme_provider_account_proto_rawDescOnce.Do(func() {
file_models_model_acme_provider_account_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_acme_provider_account_proto_rawDescData)
})
return file_models_model_acme_provider_account_proto_rawDescData
}
var file_models_model_acme_provider_account_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_acme_provider_account_proto_goTypes = []interface{}{
(*ACMEProviderAccount)(nil), // 0: pb.ACMEProviderAccount
(*ACMEProvider)(nil), // 1: pb.ACMEProvider
}
var file_models_model_acme_provider_account_proto_depIdxs = []int32{
1, // 0: pb.ACMEProviderAccount.acmeProvider:type_name -> pb.ACMEProvider
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_acme_provider_account_proto_init() }
func file_models_model_acme_provider_account_proto_init() {
if File_models_model_acme_provider_account_proto != nil {
return
}
file_models_model_acme_provider_proto_init()
if !protoimpl.UnsafeEnabled {
file_models_model_acme_provider_account_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ACMEProviderAccount); 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_acme_provider_account_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_models_model_acme_provider_account_proto_goTypes,
DependencyIndexes: file_models_model_acme_provider_account_proto_depIdxs,
MessageInfos: file_models_model_acme_provider_account_proto_msgTypes,
}.Build()
File_models_model_acme_provider_account_proto = out.File
file_models_model_acme_provider_account_proto_rawDesc = nil
file_models_model_acme_provider_account_proto_goTypes = nil
file_models_model_acme_provider_account_proto_depIdxs = nil
}

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_acme_task.proto
package pb

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_acme_task_log.proto
package pb

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_acme_user.proto
package pb
@@ -30,10 +30,13 @@ type ACMEUser struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
CreatedAt int64 `protobuf:"varint,4,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
CreatedAt int64 `protobuf:"varint,4,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
AcmeProviderCode string `protobuf:"bytes,5,opt,name=acmeProviderCode,proto3" json:"acmeProviderCode,omitempty"`
AcmeProvider *ACMEProvider `protobuf:"bytes,30,opt,name=acmeProvider,proto3" json:"acmeProvider,omitempty"`
AcmeProviderAccount *ACMEProviderAccount `protobuf:"bytes,31,opt,name=acmeProviderAccount,proto3" json:"acmeProviderAccount,omitempty"`
}
func (x *ACMEUser) Reset() {
@@ -96,20 +99,56 @@ func (x *ACMEUser) GetCreatedAt() int64 {
return 0
}
func (x *ACMEUser) GetAcmeProviderCode() string {
if x != nil {
return x.AcmeProviderCode
}
return ""
}
func (x *ACMEUser) GetAcmeProvider() *ACMEProvider {
if x != nil {
return x.AcmeProvider
}
return nil
}
func (x *ACMEUser) GetAcmeProviderAccount() *ACMEProviderAccount {
if x != nil {
return x.AcmeProviderAccount
}
return nil
}
var File_models_model_acme_user_proto protoreflect.FileDescriptor
var file_models_model_acme_user_proto_rawDesc = []byte{
0x0a, 0x1c, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x61,
0x63, 0x6d, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02,
0x70, 0x62, 0x22, 0x70, 0x0a, 0x08, 0x41, 0x43, 0x4d, 0x45, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14,
0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65,
0x6d, 0x61, 0x69, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72,
0x69, 0x70, 0x74, 0x69, 0x6f, 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, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
0x70, 0x62, 0x1a, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
0x5f, 0x61, 0x63, 0x6d, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x28, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64,
0x65, 0x6c, 0x5f, 0x61, 0x63, 0x6d, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72,
0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9d,
0x02, 0x0a, 0x08, 0x41, 0x43, 0x4d, 0x45, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65,
0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69,
0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x69, 0x6f, 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, 0x2a, 0x0a, 0x10, 0x61, 0x63, 0x6d, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,
0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x63, 0x6d,
0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x34, 0x0a,
0x0c, 0x61, 0x63, 0x6d, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x1e, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x43, 0x4d, 0x45, 0x50, 0x72, 0x6f,
0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x61, 0x63, 0x6d, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69,
0x64, 0x65, 0x72, 0x12, 0x49, 0x0a, 0x13, 0x61, 0x63, 0x6d, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69,
0x64, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x43, 0x4d, 0x45, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64,
0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x13, 0x61, 0x63, 0x6d, 0x65, 0x50,
0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x06,
0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -126,14 +165,18 @@ func file_models_model_acme_user_proto_rawDescGZIP() []byte {
var file_models_model_acme_user_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_acme_user_proto_goTypes = []interface{}{
(*ACMEUser)(nil), // 0: pb.ACMEUser
(*ACMEUser)(nil), // 0: pb.ACMEUser
(*ACMEProvider)(nil), // 1: pb.ACMEProvider
(*ACMEProviderAccount)(nil), // 2: pb.ACMEProviderAccount
}
var file_models_model_acme_user_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
1, // 0: pb.ACMEUser.acmeProvider:type_name -> pb.ACMEProvider
2, // 1: pb.ACMEUser.acmeProviderAccount:type_name -> pb.ACMEProviderAccount
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_acme_user_proto_init() }
@@ -141,6 +184,8 @@ func file_models_model_acme_user_proto_init() {
if File_models_model_acme_user_proto != nil {
return
}
file_models_model_acme_provider_proto_init()
file_models_model_acme_provider_account_proto_init()
if !protoimpl.UnsafeEnabled {
file_models_model_acme_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ACMEUser); i {

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_admin.proto
package pb

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_admin_list.proto
package pb
@@ -34,6 +34,7 @@ type AdminModuleList struct {
IsSuper bool `protobuf:"varint,2,opt,name=isSuper,proto3" json:"isSuper,omitempty"`
Modules []*AdminModule `protobuf:"bytes,3,rep,name=Modules,proto3" json:"Modules,omitempty"`
Fullname string `protobuf:"bytes,4,opt,name=fullname,proto3" json:"fullname,omitempty"`
Theme string `protobuf:"bytes,5,opt,name=theme,proto3" json:"theme,omitempty"`
}
func (x *AdminModuleList) Reset() {
@@ -96,6 +97,13 @@ func (x *AdminModuleList) GetFullname() string {
return ""
}
func (x *AdminModuleList) GetTheme() string {
if x != nil {
return x.Theme
}
return ""
}
var File_models_model_admin_list_proto protoreflect.FileDescriptor
var file_models_model_admin_list_proto_rawDesc = []byte{
@@ -103,7 +111,7 @@ var file_models_model_admin_list_proto_rawDesc = []byte{
0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x69, 0x73, 0x74, 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, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8c, 0x01, 0x0a, 0x0f, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4d, 0x6f,
0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa2, 0x01, 0x0a, 0x0f, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4d, 0x6f,
0x64, 0x75, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x6d, 0x69,
0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x61, 0x64, 0x6d, 0x69, 0x6e,
0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, 0x18, 0x02, 0x20,
@@ -112,8 +120,9 @@ var file_models_model_admin_list_proto_rawDesc = []byte{
0x70, 0x62, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x07,
0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x6e,
0x61, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x74, 0x68, 0x65, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70,
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_admin_module.proto
package pb

View File

@@ -0,0 +1,220 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.19.4
// source: models/model_api_method_stat.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 APIMethodStat struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
ApiNodeId int64 `protobuf:"varint,2,opt,name=apiNodeId,proto3" json:"apiNodeId,omitempty"`
Method string `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"`
Tag string `protobuf:"bytes,4,opt,name=tag,proto3" json:"tag,omitempty"`
CostMs float32 `protobuf:"fixed32,5,opt,name=costMs,proto3" json:"costMs,omitempty"`
PeekMs float32 `protobuf:"fixed32,6,opt,name=peekMs,proto3" json:"peekMs,omitempty"`
CountCalls int64 `protobuf:"varint,7,opt,name=countCalls,proto3" json:"countCalls,omitempty"`
ApiNode *APINode `protobuf:"bytes,30,opt,name=apiNode,proto3" json:"apiNode,omitempty"`
}
func (x *APIMethodStat) Reset() {
*x = APIMethodStat{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_api_method_stat_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *APIMethodStat) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*APIMethodStat) ProtoMessage() {}
func (x *APIMethodStat) ProtoReflect() protoreflect.Message {
mi := &file_models_model_api_method_stat_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 APIMethodStat.ProtoReflect.Descriptor instead.
func (*APIMethodStat) Descriptor() ([]byte, []int) {
return file_models_model_api_method_stat_proto_rawDescGZIP(), []int{0}
}
func (x *APIMethodStat) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *APIMethodStat) GetApiNodeId() int64 {
if x != nil {
return x.ApiNodeId
}
return 0
}
func (x *APIMethodStat) GetMethod() string {
if x != nil {
return x.Method
}
return ""
}
func (x *APIMethodStat) GetTag() string {
if x != nil {
return x.Tag
}
return ""
}
func (x *APIMethodStat) GetCostMs() float32 {
if x != nil {
return x.CostMs
}
return 0
}
func (x *APIMethodStat) GetPeekMs() float32 {
if x != nil {
return x.PeekMs
}
return 0
}
func (x *APIMethodStat) GetCountCalls() int64 {
if x != nil {
return x.CountCalls
}
return 0
}
func (x *APIMethodStat) GetApiNode() *APINode {
if x != nil {
return x.ApiNode
}
return nil
}
var File_models_model_api_method_stat_proto protoreflect.FileDescriptor
var file_models_model_api_method_stat_proto_rawDesc = []byte{
0x0a, 0x22, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x61,
0x70, 0x69, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 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, 0x22, 0xde, 0x01, 0x0a, 0x0d, 0x41, 0x50, 0x49, 0x4d, 0x65, 0x74,
0x68, 0x6f, 0x64, 0x53, 0x74, 0x61, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x70, 0x69, 0x4e, 0x6f,
0x64, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x70, 0x69, 0x4e,
0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18,
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x10, 0x0a,
0x03, 0x74, 0x61, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12,
0x16, 0x0a, 0x06, 0x63, 0x6f, 0x73, 0x74, 0x4d, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x52,
0x06, 0x63, 0x6f, 0x73, 0x74, 0x4d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x65, 0x65, 0x6b, 0x4d,
0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x70, 0x65, 0x65, 0x6b, 0x4d, 0x73, 0x12,
0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x18, 0x07, 0x20,
0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x12,
0x25, 0x0a, 0x07, 0x61, 0x70, 0x69, 0x4e, 0x6f, 0x64, 0x65, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x61,
0x70, 0x69, 0x4e, 0x6f, 0x64, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_models_model_api_method_stat_proto_rawDescOnce sync.Once
file_models_model_api_method_stat_proto_rawDescData = file_models_model_api_method_stat_proto_rawDesc
)
func file_models_model_api_method_stat_proto_rawDescGZIP() []byte {
file_models_model_api_method_stat_proto_rawDescOnce.Do(func() {
file_models_model_api_method_stat_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_api_method_stat_proto_rawDescData)
})
return file_models_model_api_method_stat_proto_rawDescData
}
var file_models_model_api_method_stat_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_api_method_stat_proto_goTypes = []interface{}{
(*APIMethodStat)(nil), // 0: pb.APIMethodStat
(*APINode)(nil), // 1: pb.APINode
}
var file_models_model_api_method_stat_proto_depIdxs = []int32{
1, // 0: pb.APIMethodStat.apiNode:type_name -> pb.APINode
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_api_method_stat_proto_init() }
func file_models_model_api_method_stat_proto_init() {
if File_models_model_api_method_stat_proto != nil {
return
}
file_models_model_api_node_proto_init()
if !protoimpl.UnsafeEnabled {
file_models_model_api_method_stat_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*APIMethodStat); 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_api_method_stat_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_models_model_api_method_stat_proto_goTypes,
DependencyIndexes: file_models_model_api_method_stat_proto_depIdxs,
MessageInfos: file_models_model_api_method_stat_proto_msgTypes,
}.Build()
File_models_model_api_method_stat_proto = out.File
file_models_model_api_method_stat_proto_rawDesc = nil
file_models_model_api_method_stat_proto_goTypes = nil
file_models_model_api_method_stat_proto_depIdxs = nil
}

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_api_node.proto
package pb
@@ -45,6 +45,8 @@ type APINode struct {
AccessAddrsJSON []byte `protobuf:"bytes,10,opt,name=accessAddrsJSON,proto3" json:"accessAddrsJSON,omitempty"`
AccessAddrs []string `protobuf:"bytes,11,rep,name=accessAddrs,proto3" json:"accessAddrs,omitempty"`
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"`
}
func (x *APINode) Reset() {
@@ -184,12 +186,26 @@ func (x *APINode) GetStatusJSON() []byte {
return nil
}
func (x *APINode) GetIsPrimary() bool {
if x != nil {
return x.IsPrimary
}
return false
}
func (x *APINode) GetDebug() bool {
if x != nil {
return x.Debug
}
return false
}
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, 0xc9, 0x03, 0x0a, 0x07, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a,
0x62, 0x22, 0xfd, 0x03, 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,
@@ -217,8 +233,12 @@ var file_models_model_api_node_proto_rawDesc = []byte{
0x63, 0x63, 0x65, 0x73, 0x73, 0x41, 0x64, 0x64, 0x72, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09,
0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x41, 0x64, 0x64, 0x72, 0x73, 0x12, 0x1e, 0x0a,
0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x0c, 0x20, 0x01, 0x28,
0x0c, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x0c, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x1c, 0x0a,
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,
}
var (

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_api_token.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
// API令牌
type APIToken struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
NodeId string `protobuf:"bytes,2,opt,name=nodeId,proto3" json:"nodeId,omitempty"`
Secret string `protobuf:"bytes,3,opt,name=secret,proto3" json:"secret,omitempty"`
Role string `protobuf:"bytes,4,opt,name=role,proto3" json:"role,omitempty"`
}
func (x *APIToken) Reset() {
*x = APIToken{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_api_token_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *APIToken) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*APIToken) ProtoMessage() {}
func (x *APIToken) ProtoReflect() protoreflect.Message {
mi := &file_models_model_api_token_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 APIToken.ProtoReflect.Descriptor instead.
func (*APIToken) Descriptor() ([]byte, []int) {
return file_models_model_api_token_proto_rawDescGZIP(), []int{0}
}
func (x *APIToken) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *APIToken) GetNodeId() string {
if x != nil {
return x.NodeId
}
return ""
}
func (x *APIToken) GetSecret() string {
if x != nil {
return x.Secret
}
return ""
}
func (x *APIToken) GetRole() string {
if x != nil {
return x.Role
}
return ""
}
var File_models_model_api_token_proto protoreflect.FileDescriptor
var file_models_model_api_token_proto_rawDesc = []byte{
0x0a, 0x1c, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x61,
0x70, 0x69, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02,
0x70, 0x62, 0x22, 0x5e, 0x0a, 0x08, 0x41, 0x50, 0x49, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16,
0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x12,
0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f,
0x6c, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
}
var (
file_models_model_api_token_proto_rawDescOnce sync.Once
file_models_model_api_token_proto_rawDescData = file_models_model_api_token_proto_rawDesc
)
func file_models_model_api_token_proto_rawDescGZIP() []byte {
file_models_model_api_token_proto_rawDescOnce.Do(func() {
file_models_model_api_token_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_api_token_proto_rawDescData)
})
return file_models_model_api_token_proto_rawDescData
}
var file_models_model_api_token_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_api_token_proto_goTypes = []interface{}{
(*APIToken)(nil), // 0: pb.APIToken
}
var file_models_model_api_token_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_api_token_proto_init() }
func file_models_model_api_token_proto_init() {
if File_models_model_api_token_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_models_model_api_token_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*APIToken); 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_api_token_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_models_model_api_token_proto_goTypes,
DependencyIndexes: file_models_model_api_token_proto_depIdxs,
MessageInfos: file_models_model_api_token_proto_msgTypes,
}.Build()
File_models_model_api_token_proto = out.File
file_models_model_api_token_proto_rawDesc = nil
file_models_model_api_token_proto_goTypes = nil
file_models_model_api_token_proto_depIdxs = nil
}

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_authority_key.proto
package pb
@@ -38,6 +38,8 @@ type AuthorityKey struct {
MacAddresses []string `protobuf:"bytes,5,rep,name=macAddresses,proto3" json:"macAddresses,omitempty"`
UpdatedAt int64 `protobuf:"varint,6,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"`
Company string `protobuf:"bytes,7,opt,name=company,proto3" json:"company,omitempty"`
Nodes int32 `protobuf:"varint,8,opt,name=nodes,proto3" json:"nodes,omitempty"`
Components []string `protobuf:"bytes,9,rep,name=components,proto3" json:"components,omitempty"`
}
func (x *AuthorityKey) Reset() {
@@ -121,12 +123,26 @@ func (x *AuthorityKey) GetCompany() string {
return ""
}
func (x *AuthorityKey) GetNodes() int32 {
if x != nil {
return x.Nodes
}
return 0
}
func (x *AuthorityKey) GetComponents() []string {
if x != nil {
return x.Components
}
return nil
}
var File_models_model_authority_key_proto protoreflect.FileDescriptor
var file_models_model_authority_key_proto_rawDesc = []byte{
0x0a, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x61,
0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x6b, 0x65, 0x79, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xcc, 0x01, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, 0x6f,
0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x82, 0x02, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, 0x6f,
0x72, 0x69, 0x74, 0x79, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a,
0x07, 0x64, 0x61, 0x79, 0x46, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
@@ -139,8 +155,11 @@ var file_models_model_authority_key_proto_rawDesc = []byte{
0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03,
0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63,
0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f,
0x6d, 0x70, 0x61, 0x6e, 0x79, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
0x6d, 0x70, 0x61, 0x6e, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x08,
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x63,
0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52,
0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e,
0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_authority_node.proto
package pb

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_client_browser.proto
package pb

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_client_system.proto
package pb

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_db_node.proto
package pb
@@ -157,9 +157,10 @@ type DBNodeStatus struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
IsOk bool `protobuf:"varint,1,opt,name=isOk,proto3" json:"isOk,omitempty"`
Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"`
IsOk bool `protobuf:"varint,1,opt,name=isOk,proto3" json:"isOk,omitempty"`
Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"`
Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"`
}
func (x *DBNodeStatus) Reset() {
@@ -215,6 +216,13 @@ func (x *DBNodeStatus) GetError() string {
return ""
}
func (x *DBNodeStatus) GetVersion() string {
if x != nil {
return x.Version
}
return ""
}
var File_models_model_db_node_proto protoreflect.FileDescriptor
var file_models_model_db_node_proto_rawDesc = []byte{
@@ -238,13 +246,14 @@ var file_models_model_db_node_proto_rawDesc = []byte{
0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x12, 0x28, 0x0a, 0x06, 0x73,
0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62,
0x2e, 0x44, 0x42, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73,
0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x4c, 0x0a, 0x0c, 0x44, 0x42, 0x4e, 0x6f, 0x64, 0x65, 0x53,
0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x66, 0x0a, 0x0c, 0x44, 0x42, 0x4e, 0x6f, 0x64, 0x65, 0x53,
0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x18, 0x01, 0x20,
0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a,
0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72,
0x72, 0x6f, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_db_table.proto
package pb

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_dns_domain.proto
package pb
@@ -44,6 +44,8 @@ type DNSDomain struct {
Routes []*DNSRoute `protobuf:"bytes,10,rep,name=routes,proto3" json:"routes,omitempty"`
ProviderId int64 `protobuf:"varint,11,opt,name=providerId,proto3" json:"providerId,omitempty"`
CountNodeClusters int64 `protobuf:"varint,12,opt,name=countNodeClusters,proto3" json:"countNodeClusters,omitempty"`
IsUp bool `protobuf:"varint,15,opt,name=isUp,proto3" json:"isUp,omitempty"`
IsDeleted bool `protobuf:"varint,16,opt,name=isDeleted,proto3" json:"isDeleted,omitempty"`
}
func (x *DNSDomain) Reset() {
@@ -176,6 +178,20 @@ func (x *DNSDomain) GetCountNodeClusters() int64 {
return 0
}
func (x *DNSDomain) GetIsUp() bool {
if x != nil {
return x.IsUp
}
return false
}
func (x *DNSDomain) GetIsDeleted() bool {
if x != nil {
return x.IsDeleted
}
return false
}
var File_models_model_dns_domain_proto protoreflect.FileDescriptor
var file_models_model_dns_domain_proto_rawDesc = []byte{
@@ -183,7 +199,7 @@ var file_models_model_dns_domain_proto_rawDesc = []byte{
0x6e, 0x73, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x02, 0x70, 0x62, 0x1a, 0x1c, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65,
0x6c, 0x5f, 0x64, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x22, 0xf3, 0x03, 0x0a, 0x09, 0x44, 0x4e, 0x53, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12,
0x6f, 0x22, 0xa5, 0x04, 0x0a, 0x09, 0x44, 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,
@@ -214,8 +230,11 @@ var file_models_model_dns_domain_proto_rawDesc = []byte{
0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x63, 0x6f, 0x75,
0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x18, 0x0c,
0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x43,
0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x55, 0x70, 0x18,
0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x55, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x69,
0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09,
0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70,
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -0,0 +1,202 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.19.4
// source: models/model_dns_issue.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 DNSIssue struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Target string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"`
TargetId int64 `protobuf:"varint,2,opt,name=targetId,proto3" json:"targetId,omitempty"`
Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
Params map[string]string `protobuf:"bytes,5,rep,name=params,proto3" json:"params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
MustFix bool `protobuf:"varint,6,opt,name=mustFix,proto3" json:"mustFix,omitempty"` // 是否必须修复
}
func (x *DNSIssue) Reset() {
*x = DNSIssue{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_dns_issue_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DNSIssue) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DNSIssue) ProtoMessage() {}
func (x *DNSIssue) ProtoReflect() protoreflect.Message {
mi := &file_models_model_dns_issue_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 DNSIssue.ProtoReflect.Descriptor instead.
func (*DNSIssue) Descriptor() ([]byte, []int) {
return file_models_model_dns_issue_proto_rawDescGZIP(), []int{0}
}
func (x *DNSIssue) GetTarget() string {
if x != nil {
return x.Target
}
return ""
}
func (x *DNSIssue) GetTargetId() int64 {
if x != nil {
return x.TargetId
}
return 0
}
func (x *DNSIssue) GetType() string {
if x != nil {
return x.Type
}
return ""
}
func (x *DNSIssue) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
func (x *DNSIssue) GetParams() map[string]string {
if x != nil {
return x.Params
}
return nil
}
func (x *DNSIssue) GetMustFix() bool {
if x != nil {
return x.MustFix
}
return false
}
var File_models_model_dns_issue_proto protoreflect.FileDescriptor
var file_models_model_dns_issue_proto_rawDesc = []byte{
0x0a, 0x1c, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x64,
0x6e, 0x73, 0x5f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02,
0x70, 0x62, 0x22, 0xfb, 0x01, 0x0a, 0x08, 0x44, 0x4e, 0x53, 0x49, 0x73, 0x73, 0x75, 0x65, 0x12,
0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65,
0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65,
0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 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, 0x30, 0x0a, 0x06, 0x70, 0x61, 0x72,
0x61, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x44,
0x4e, 0x53, 0x49, 0x73, 0x73, 0x75, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e,
0x74, 0x72, 0x79, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d,
0x75, 0x73, 0x74, 0x46, 0x69, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6d, 0x75,
0x73, 0x74, 0x46, 0x69, 0x78, 0x1a, 0x39, 0x0a, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 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,
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_models_model_dns_issue_proto_rawDescOnce sync.Once
file_models_model_dns_issue_proto_rawDescData = file_models_model_dns_issue_proto_rawDesc
)
func file_models_model_dns_issue_proto_rawDescGZIP() []byte {
file_models_model_dns_issue_proto_rawDescOnce.Do(func() {
file_models_model_dns_issue_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_dns_issue_proto_rawDescData)
})
return file_models_model_dns_issue_proto_rawDescData
}
var file_models_model_dns_issue_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_models_model_dns_issue_proto_goTypes = []interface{}{
(*DNSIssue)(nil), // 0: pb.DNSIssue
nil, // 1: pb.DNSIssue.ParamsEntry
}
var file_models_model_dns_issue_proto_depIdxs = []int32{
1, // 0: pb.DNSIssue.params:type_name -> pb.DNSIssue.ParamsEntry
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_dns_issue_proto_init() }
func file_models_model_dns_issue_proto_init() {
if File_models_model_dns_issue_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_models_model_dns_issue_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DNSIssue); 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_dns_issue_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_models_model_dns_issue_proto_goTypes,
DependencyIndexes: file_models_model_dns_issue_proto_depIdxs,
MessageInfos: file_models_model_dns_issue_proto_msgTypes,
}.Build()
File_models_model_dns_issue_proto = out.File
file_models_model_dns_issue_proto_rawDesc = nil
file_models_model_dns_issue_proto_goTypes = nil
file_models_model_dns_issue_proto_depIdxs = nil
}

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_dns_provider.proto
package pb

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_dns_record.proto
package pb

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_dns_route.proto
package pb

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_dns_task.proto
package pb

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_file.proto
package pb

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_file_chunk.proto
package pb

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_http_access_log.proto
package pb
@@ -47,6 +47,7 @@ type HTTPAccessLog struct {
RequestTime float64 `protobuf:"fixed64,13,opt,name=requestTime,proto3" json:"requestTime,omitempty"`
RequestMethod string `protobuf:"bytes,14,opt,name=requestMethod,proto3" json:"requestMethod,omitempty"`
RequestFilename string `protobuf:"bytes,15,opt,name=requestFilename,proto3" json:"requestFilename,omitempty"`
RequestBody []byte `protobuf:"bytes,51,opt,name=requestBody,proto3" json:"requestBody,omitempty"`
Scheme string `protobuf:"bytes,16,opt,name=scheme,proto3" json:"scheme,omitempty"`
Proto string `protobuf:"bytes,17,opt,name=proto,proto3" json:"proto,omitempty"`
BytesSent int64 `protobuf:"varint,18,opt,name=bytesSent,proto3" json:"bytesSent,omitempty"`
@@ -78,10 +79,14 @@ type HTTPAccessLog struct {
// 扩展
Attrs map[string]string `protobuf:"bytes,43,rep,name=attrs,proto3" json:"attrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// WAF相关
FirewallPolicyId int64 `protobuf:"varint,44,opt,name=firewallPolicyId,proto3" json:"firewallPolicyId,omitempty"`
FirewallRuleGroupId int64 `protobuf:"varint,45,opt,name=firewallRuleGroupId,proto3" json:"firewallRuleGroupId,omitempty"`
FirewallRuleSetId int64 `protobuf:"varint,46,opt,name=firewallRuleSetId,proto3" json:"firewallRuleSetId,omitempty"`
FirewallRuleId int64 `protobuf:"varint,47,opt,name=firewallRuleId,proto3" json:"firewallRuleId,omitempty"`
FirewallPolicyId int64 `protobuf:"varint,44,opt,name=firewallPolicyId,proto3" json:"firewallPolicyId,omitempty"`
FirewallRuleGroupId int64 `protobuf:"varint,45,opt,name=firewallRuleGroupId,proto3" json:"firewallRuleGroupId,omitempty"`
FirewallRuleSetId int64 `protobuf:"varint,46,opt,name=firewallRuleSetId,proto3" json:"firewallRuleSetId,omitempty"`
FirewallRuleId int64 `protobuf:"varint,47,opt,name=firewallRuleId,proto3" json:"firewallRuleId,omitempty"`
FirewallActions []string `protobuf:"bytes,49,rep,name=firewallActions,proto3" json:"firewallActions,omitempty"`
Tags []string `protobuf:"bytes,50,rep,name=tags,proto3" json:"tags,omitempty"`
// 详情
Node *Node `protobuf:"bytes,100,opt,name=node,proto3" json:"node,omitempty"`
}
func (x *HTTPAccessLog) Reset() {
@@ -228,6 +233,13 @@ func (x *HTTPAccessLog) GetRequestFilename() string {
return ""
}
func (x *HTTPAccessLog) GetRequestBody() []byte {
if x != nil {
return x.RequestBody
}
return nil
}
func (x *HTTPAccessLog) GetScheme() string {
if x != nil {
return x.Scheme
@@ -445,6 +457,27 @@ func (x *HTTPAccessLog) GetFirewallRuleId() int64 {
return 0
}
func (x *HTTPAccessLog) GetFirewallActions() []string {
if x != nil {
return x.FirewallActions
}
return nil
}
func (x *HTTPAccessLog) GetTags() []string {
if x != nil {
return x.Tags
}
return nil
}
func (x *HTTPAccessLog) GetNode() *Node {
if x != nil {
return x.Node
}
return nil
}
type Strings struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -497,128 +530,138 @@ var File_models_model_http_access_log_proto protoreflect.FileDescriptor
var file_models_model_http_access_log_proto_rawDesc = []byte{
0x0a, 0x22, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x68,
0x74, 0x74, 0x70, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xdf, 0x0e, 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, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76,
0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x02,
0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a,
0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03,
0x52, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09,
0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52,
0x09, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x72,
0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6f, 0x72,
0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65,
0x41, 0x64, 0x64, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x6d, 0x6f,
0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x72, 0x61, 0x77, 0x52, 0x65, 0x6d,
0x6f, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72,
0x61, 0x77, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x12, 0x1e, 0x0a, 0x0a,
0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05,
0x52, 0x0a, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1e, 0x0a, 0x0a,
0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09,
0x52, 0x0a, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a,
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, 0x52, 0x49, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09,
0x52, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, 0x52, 0x49, 0x12, 0x20, 0x0a, 0x0b,
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x74, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x74, 0x68, 0x12, 0x24,
0x0a, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18,
0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x65,
0x6e, 0x67, 0x74, 0x68, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54,
0x69, 0x6d, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x28, 0x0a, 0x0f,
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18,
0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x46, 0x69,
0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65,
0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x14,
0x0a, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x79, 0x74, 0x65, 0x73, 0x53, 0x65, 0x6e,
0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x62, 0x79, 0x74, 0x65, 0x73, 0x53, 0x65,
0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x62, 0x6f, 0x64, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, 0x53,
0x65, 0x6e, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x62, 0x6f, 0x64, 0x79, 0x42,
0x79, 0x74, 0x65, 0x73, 0x53, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74,
0x75, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
0x12, 0x24, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x41, 0x0a, 0x0a, 0x73, 0x65, 0x6e, 0x74, 0x48, 0x65,
0x61, 0x64, 0x65, 0x72, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x62, 0x2e,
0x48, 0x54, 0x54, 0x50, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x6f, 0x67, 0x2e, 0x53, 0x65,
0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x73,
0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x69, 0x6d,
0x65, 0x49, 0x53, 0x4f, 0x38, 0x36, 0x30, 0x31, 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
0x74, 0x69, 0x6d, 0x65, 0x49, 0x53, 0x4f, 0x38, 0x36, 0x30, 0x31, 0x12, 0x1c, 0x0a, 0x09, 0x74,
0x69, 0x6d, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x18, 0x18, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
0x74, 0x69, 0x6d, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x73, 0x65,
0x63, 0x18, 0x19, 0x20, 0x01, 0x28, 0x01, 0x52, 0x04, 0x6d, 0x73, 0x65, 0x63, 0x12, 0x1c, 0x0a,
0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x03,
0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x68,
0x6f, 0x73, 0x74, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12,
0x18, 0x0a, 0x07, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x72, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x09,
0x52, 0x07, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65,
0x72, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x73,
0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65,
0x18, 0x1f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54,
0x79, 0x70, 0x65, 0x12, 0x35, 0x0a, 0x06, 0x63, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x18, 0x20, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x41, 0x63, 0x63,
0x65, 0x73, 0x73, 0x4c, 0x6f, 0x67, 0x2e, 0x43, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x45, 0x6e, 0x74,
0x72, 0x79, 0x52, 0x06, 0x63, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72,
0x67, 0x73, 0x18, 0x22, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x20,
0x0a, 0x0b, 0x71, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x23, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0b, 0x71, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67,
0x12, 0x35, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x24, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73,
0x4c, 0x6f, 0x67, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52,
0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65,
0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x25, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65,
0x72, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x26, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x65,
0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x27, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12,
0x1a, 0x0a, 0x08, 0x68, 0x6f, 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, 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,
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,
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,
0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a,
0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e,
0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65,
0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74,
0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x18,
0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x12,
0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x18, 0x06, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x12,
0x24, 0x0a, 0x0d, 0x72, 0x61, 0x77, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72,
0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x61, 0x77, 0x52, 0x65, 0x6d, 0x6f, 0x74,
0x65, 0x41, 0x64, 0x64, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50,
0x6f, 0x72, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x65, 0x6d, 0x6f, 0x74,
0x65, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x55,
0x73, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x6d, 0x6f, 0x74,
0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x55, 0x52, 0x49, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x55, 0x52, 0x49, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x50, 0x61, 0x74, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x50, 0x61, 0x74, 0x68, 0x12, 0x24, 0x0a, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d,
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x20, 0x0a,
0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0d, 0x20, 0x01,
0x28, 0x01, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12,
0x24, 0x0a, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64,
0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d,
0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x46, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f,
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12,
0x20, 0x0a, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x18, 0x33,
0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6f, 0x64,
0x79, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28,
0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x1c, 0x0a, 0x09, 0x62, 0x79, 0x74, 0x65, 0x73, 0x53, 0x65, 0x6e, 0x74, 0x18, 0x12, 0x20, 0x01,
0x28, 0x03, 0x52, 0x09, 0x62, 0x79, 0x74, 0x65, 0x73, 0x53, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x0a,
0x0d, 0x62, 0x6f, 0x64, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, 0x53, 0x65, 0x6e, 0x74, 0x18, 0x13,
0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x62, 0x6f, 0x64, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, 0x53,
0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x14, 0x20,
0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x73,
0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x15, 0x20, 0x01,
0x28, 0x09, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x12, 0x41, 0x0a, 0x0a, 0x73, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18,
0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x41,
0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x6f, 0x67, 0x2e, 0x53, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61,
0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x73, 0x65, 0x6e, 0x74, 0x48, 0x65,
0x61, 0x64, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x53, 0x4f, 0x38,
0x36, 0x30, 0x31, 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x49,
0x53, 0x4f, 0x38, 0x36, 0x30, 0x31, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x4c, 0x6f,
0x63, 0x61, 0x6c, 0x18, 0x18, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x4c,
0x6f, 0x63, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x73, 0x65, 0x63, 0x18, 0x19, 0x20, 0x01,
0x28, 0x01, 0x52, 0x04, 0x6d, 0x73, 0x65, 0x63, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65,
0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d,
0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x1b,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65,
0x66, 0x65, 0x72, 0x65, 0x72, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x66,
0x65, 0x72, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e,
0x74, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x41, 0x67, 0x65,
0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x1e, 0x20,
0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b,
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x35,
0x0a, 0x06, 0x63, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x18, 0x20, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d,
0x2e, 0x70, 0x62, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x6f,
0x67, 0x2e, 0x43, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63,
0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x22, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x71, 0x75, 0x65,
0x72, 0x79, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x23, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
0x71, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x35, 0x0a, 0x06, 0x68,
0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x24, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x62,
0x2e, 0x48, 0x54, 0x54, 0x50, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x6f, 0x67, 0x2e, 0x48,
0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64,
0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65,
0x18, 0x25, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61,
0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x6f, 0x72, 0x74,
0x18, 0x26, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x6f,
0x72, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74,
0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x27, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x65, 0x72, 0x76,
0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f,
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, 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,
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 (
@@ -641,19 +684,21 @@ var file_models_model_http_access_log_proto_goTypes = []interface{}{
nil, // 3: pb.HTTPAccessLog.CookieEntry
nil, // 4: pb.HTTPAccessLog.HeaderEntry
nil, // 5: pb.HTTPAccessLog.AttrsEntry
(*Node)(nil), // 6: pb.Node
}
var file_models_model_http_access_log_proto_depIdxs = []int32{
2, // 0: pb.HTTPAccessLog.sentHeader:type_name -> pb.HTTPAccessLog.SentHeaderEntry
3, // 1: pb.HTTPAccessLog.cookie:type_name -> pb.HTTPAccessLog.CookieEntry
4, // 2: pb.HTTPAccessLog.header:type_name -> pb.HTTPAccessLog.HeaderEntry
5, // 3: pb.HTTPAccessLog.attrs:type_name -> pb.HTTPAccessLog.AttrsEntry
1, // 4: pb.HTTPAccessLog.SentHeaderEntry.value:type_name -> pb.Strings
1, // 5: pb.HTTPAccessLog.HeaderEntry.value:type_name -> pb.Strings
6, // [6:6] is the sub-list for method output_type
6, // [6:6] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
6, // [6:6] is the sub-list for extension extendee
0, // [0:6] is the sub-list for field type_name
6, // 4: pb.HTTPAccessLog.node:type_name -> pb.Node
1, // 5: pb.HTTPAccessLog.SentHeaderEntry.value:type_name -> pb.Strings
1, // 6: pb.HTTPAccessLog.HeaderEntry.value:type_name -> pb.Strings
7, // [7:7] is the sub-list for method output_type
7, // [7:7] is the sub-list for method input_type
7, // [7:7] is the sub-list for extension type_name
7, // [7:7] is the sub-list for extension extendee
0, // [0:7] is the sub-list for field type_name
}
func init() { file_models_model_http_access_log_proto_init() }
@@ -661,6 +706,7 @@ func file_models_model_http_access_log_proto_init() {
if File_models_model_http_access_log_proto != nil {
return
}
file_models_model_node_proto_init()
if !protoimpl.UnsafeEnabled {
file_models_model_http_access_log_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HTTPAccessLog); i {

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_http_access_log_policy.proto
package pb
@@ -30,12 +30,14 @@ type HTTPAccessLogPolicy 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"`
Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"`
OptionsJSON []byte `protobuf:"bytes,5,opt,name=optionsJSON,proto3" json:"optionsJSON,omitempty"`
CondsJSON []byte `protobuf:"bytes,6,opt,name=condsJSON,proto3" json:"condsJSON,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"`
Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"`
OptionsJSON []byte `protobuf:"bytes,5,opt,name=optionsJSON,proto3" json:"optionsJSON,omitempty"`
CondsJSON []byte `protobuf:"bytes,6,opt,name=condsJSON,proto3" json:"condsJSON,omitempty"`
IsPublic bool `protobuf:"varint,7,opt,name=isPublic,proto3" json:"isPublic,omitempty"`
FirewallOnly bool `protobuf:"varint,8,opt,name=firewallOnly,proto3" json:"firewallOnly,omitempty"`
}
func (x *HTTPAccessLogPolicy) Reset() {
@@ -112,13 +114,27 @@ func (x *HTTPAccessLogPolicy) GetCondsJSON() []byte {
return nil
}
func (x *HTTPAccessLogPolicy) GetIsPublic() bool {
if x != nil {
return x.IsPublic
}
return false
}
func (x *HTTPAccessLogPolicy) GetFirewallOnly() bool {
if x != nil {
return x.FirewallOnly
}
return false
}
var File_models_model_http_access_log_policy_proto protoreflect.FileDescriptor
var file_models_model_http_access_log_policy_proto_rawDesc = []byte{
0x0a, 0x29, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x68,
0x74, 0x74, 0x70, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x70,
0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22,
0xa1, 0x01, 0x0a, 0x13, 0x48, 0x54, 0x54, 0x50, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x6f,
0xe1, 0x01, 0x0a, 0x13, 0x48, 0x54, 0x54, 0x50, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x6f,
0x67, 0x50, 0x6f, 0x6c, 0x69, 0x63, 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,
@@ -128,7 +144,11 @@ var file_models_model_http_access_log_policy_proto_rawDesc = []byte{
0x4f, 0x4e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x4a, 0x53,
0x4f, 0x4e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x4a,
0x53, 0x4f, 0x4e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x53, 0x4f, 0x4e, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18,
0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12,
0x22, 0x0a, 0x0c, 0x66, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x4f, 0x6e, 0x6c, 0x79, 0x18,
0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x66, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x4f,
0x6e, 0x6c, 0x79, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_http_auth_policy.proto
package pb

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// protoc v3.19.4
// source: models/model_http_cache_policy.proto
package pb

View File

@@ -0,0 +1,256 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.19.4
// source: models/model_http_cache_task.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 HTTPCacheTask struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
UserId int64 `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"`
Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
KeyType string `protobuf:"bytes,4,opt,name=keyType,proto3" json:"keyType,omitempty"`
CreatedAt int64 `protobuf:"varint,5,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
DoneAt int64 `protobuf:"varint,6,opt,name=doneAt,proto3" json:"doneAt,omitempty"`
IsDone bool `protobuf:"varint,7,opt,name=isDone,proto3" json:"isDone,omitempty"`
IsOk bool `protobuf:"varint,8,opt,name=isOk,proto3" json:"isOk,omitempty"`
Description string `protobuf:"bytes,9,opt,name=description,proto3" json:"description,omitempty"`
User *User `protobuf:"bytes,30,opt,name=user,proto3" json:"user,omitempty"`
HttpCacheTaskKeys []*HTTPCacheTaskKey `protobuf:"bytes,31,rep,name=httpCacheTaskKeys,proto3" json:"httpCacheTaskKeys,omitempty"`
}
func (x *HTTPCacheTask) Reset() {
*x = HTTPCacheTask{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_http_cache_task_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *HTTPCacheTask) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HTTPCacheTask) ProtoMessage() {}
func (x *HTTPCacheTask) ProtoReflect() protoreflect.Message {
mi := &file_models_model_http_cache_task_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 HTTPCacheTask.ProtoReflect.Descriptor instead.
func (*HTTPCacheTask) Descriptor() ([]byte, []int) {
return file_models_model_http_cache_task_proto_rawDescGZIP(), []int{0}
}
func (x *HTTPCacheTask) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *HTTPCacheTask) GetUserId() int64 {
if x != nil {
return x.UserId
}
return 0
}
func (x *HTTPCacheTask) GetType() string {
if x != nil {
return x.Type
}
return ""
}
func (x *HTTPCacheTask) GetKeyType() string {
if x != nil {
return x.KeyType
}
return ""
}
func (x *HTTPCacheTask) GetCreatedAt() int64 {
if x != nil {
return x.CreatedAt
}
return 0
}
func (x *HTTPCacheTask) GetDoneAt() int64 {
if x != nil {
return x.DoneAt
}
return 0
}
func (x *HTTPCacheTask) GetIsDone() bool {
if x != nil {
return x.IsDone
}
return false
}
func (x *HTTPCacheTask) GetIsOk() bool {
if x != nil {
return x.IsOk
}
return false
}
func (x *HTTPCacheTask) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
func (x *HTTPCacheTask) GetUser() *User {
if x != nil {
return x.User
}
return nil
}
func (x *HTTPCacheTask) GetHttpCacheTaskKeys() []*HTTPCacheTaskKey {
if x != nil {
return x.HttpCacheTaskKeys
}
return nil
}
var File_models_model_http_cache_task_proto protoreflect.FileDescriptor
var file_models_model_http_cache_task_proto_rawDesc = []byte{
0x0a, 0x22, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x68,
0x74, 0x74, 0x70, 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x74, 0x61, 0x73, 0x6b, 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, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x1a, 0x26, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f,
0x68, 0x74, 0x74, 0x70, 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x5f,
0x6b, 0x65, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcb, 0x02, 0x0a, 0x0d, 0x48, 0x54,
0x54, 0x50, 0x43, 0x61, 0x63, 0x68, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75,
0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65,
0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79,
0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70,
0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x05,
0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12,
0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6e, 0x65, 0x41, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52,
0x06, 0x64, 0x6f, 0x6e, 0x65, 0x41, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x44, 0x6f, 0x6e,
0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x44, 0x6f, 0x6e, 0x65, 0x12,
0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69,
0x73, 0x4f, 0x6b, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69,
0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x1e, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75,
0x73, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x11, 0x68, 0x74, 0x74, 0x70, 0x43, 0x61, 0x63, 0x68, 0x65,
0x54, 0x61, 0x73, 0x6b, 0x4b, 0x65, 0x79, 0x73, 0x18, 0x1f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14,
0x2e, 0x70, 0x62, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x43, 0x61, 0x63, 0x68, 0x65, 0x54, 0x61, 0x73,
0x6b, 0x4b, 0x65, 0x79, 0x52, 0x11, 0x68, 0x74, 0x74, 0x70, 0x43, 0x61, 0x63, 0x68, 0x65, 0x54,
0x61, 0x73, 0x6b, 0x4b, 0x65, 0x79, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_models_model_http_cache_task_proto_rawDescOnce sync.Once
file_models_model_http_cache_task_proto_rawDescData = file_models_model_http_cache_task_proto_rawDesc
)
func file_models_model_http_cache_task_proto_rawDescGZIP() []byte {
file_models_model_http_cache_task_proto_rawDescOnce.Do(func() {
file_models_model_http_cache_task_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_http_cache_task_proto_rawDescData)
})
return file_models_model_http_cache_task_proto_rawDescData
}
var file_models_model_http_cache_task_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_http_cache_task_proto_goTypes = []interface{}{
(*HTTPCacheTask)(nil), // 0: pb.HTTPCacheTask
(*User)(nil), // 1: pb.User
(*HTTPCacheTaskKey)(nil), // 2: pb.HTTPCacheTaskKey
}
var file_models_model_http_cache_task_proto_depIdxs = []int32{
1, // 0: pb.HTTPCacheTask.user:type_name -> pb.User
2, // 1: pb.HTTPCacheTask.httpCacheTaskKeys:type_name -> pb.HTTPCacheTaskKey
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_http_cache_task_proto_init() }
func file_models_model_http_cache_task_proto_init() {
if File_models_model_http_cache_task_proto != nil {
return
}
file_models_model_user_proto_init()
file_models_model_http_cache_task_key_proto_init()
if !protoimpl.UnsafeEnabled {
file_models_model_http_cache_task_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HTTPCacheTask); 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_http_cache_task_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_models_model_http_cache_task_proto_goTypes,
DependencyIndexes: file_models_model_http_cache_task_proto_depIdxs,
MessageInfos: file_models_model_http_cache_task_proto_msgTypes,
}.Build()
File_models_model_http_cache_task_proto = out.File
file_models_model_http_cache_task_proto_rawDesc = nil
file_models_model_http_cache_task_proto_goTypes = nil
file_models_model_http_cache_task_proto_depIdxs = nil
}

View File

@@ -0,0 +1,225 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.19.4
// source: models/model_http_cache_task_key.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 HTTPCacheTaskKey struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
TaskId int64 `protobuf:"varint,2,opt,name=taskId,proto3" json:"taskId,omitempty"`
Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"`
KeyType string `protobuf:"bytes,5,opt,name=keyType,proto3" json:"keyType,omitempty"`
IsDone bool `protobuf:"varint,6,opt,name=isDone,proto3" json:"isDone,omitempty"` // 是否已完成
IsDoing bool `protobuf:"varint,9,opt,name=isDoing,proto3" json:"isDoing,omitempty"` // 是否执行中
ErrorsJSON []byte `protobuf:"bytes,7,opt,name=errorsJSON,proto3" json:"errorsJSON,omitempty"`
NodeClusterId int64 `protobuf:"varint,8,opt,name=nodeClusterId,proto3" json:"nodeClusterId,omitempty"`
}
func (x *HTTPCacheTaskKey) Reset() {
*x = HTTPCacheTaskKey{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_http_cache_task_key_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *HTTPCacheTaskKey) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HTTPCacheTaskKey) ProtoMessage() {}
func (x *HTTPCacheTaskKey) ProtoReflect() protoreflect.Message {
mi := &file_models_model_http_cache_task_key_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 HTTPCacheTaskKey.ProtoReflect.Descriptor instead.
func (*HTTPCacheTaskKey) Descriptor() ([]byte, []int) {
return file_models_model_http_cache_task_key_proto_rawDescGZIP(), []int{0}
}
func (x *HTTPCacheTaskKey) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *HTTPCacheTaskKey) GetTaskId() int64 {
if x != nil {
return x.TaskId
}
return 0
}
func (x *HTTPCacheTaskKey) GetKey() string {
if x != nil {
return x.Key
}
return ""
}
func (x *HTTPCacheTaskKey) GetType() string {
if x != nil {
return x.Type
}
return ""
}
func (x *HTTPCacheTaskKey) GetKeyType() string {
if x != nil {
return x.KeyType
}
return ""
}
func (x *HTTPCacheTaskKey) GetIsDone() bool {
if x != nil {
return x.IsDone
}
return false
}
func (x *HTTPCacheTaskKey) GetIsDoing() bool {
if x != nil {
return x.IsDoing
}
return false
}
func (x *HTTPCacheTaskKey) GetErrorsJSON() []byte {
if x != nil {
return x.ErrorsJSON
}
return nil
}
func (x *HTTPCacheTaskKey) GetNodeClusterId() int64 {
if x != nil {
return x.NodeClusterId
}
return 0
}
var File_models_model_http_cache_task_key_proto protoreflect.FileDescriptor
var file_models_model_http_cache_task_key_proto_rawDesc = []byte{
0x0a, 0x26, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x68,
0x74, 0x74, 0x70, 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6b,
0x65, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xf2, 0x01, 0x0a,
0x10, 0x48, 0x54, 0x54, 0x50, 0x43, 0x61, 0x63, 0x68, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x4b, 0x65,
0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69,
0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
0x03, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74,
0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12,
0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x44,
0x6f, 0x6e, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x44, 0x6f, 0x6e,
0x65, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x44, 0x6f, 0x69, 0x6e, 0x67, 0x18, 0x09, 0x20, 0x01,
0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x44, 0x6f, 0x69, 0x6e, 0x67, 0x12, 0x1e, 0x0a, 0x0a, 0x65,
0x72, 0x72, 0x6f, 0x72, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52,
0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x24, 0x0a, 0x0d, 0x6e,
0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01,
0x28, 0x03, 0x52, 0x0d, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49,
0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
file_models_model_http_cache_task_key_proto_rawDescOnce sync.Once
file_models_model_http_cache_task_key_proto_rawDescData = file_models_model_http_cache_task_key_proto_rawDesc
)
func file_models_model_http_cache_task_key_proto_rawDescGZIP() []byte {
file_models_model_http_cache_task_key_proto_rawDescOnce.Do(func() {
file_models_model_http_cache_task_key_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_http_cache_task_key_proto_rawDescData)
})
return file_models_model_http_cache_task_key_proto_rawDescData
}
var file_models_model_http_cache_task_key_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_http_cache_task_key_proto_goTypes = []interface{}{
(*HTTPCacheTaskKey)(nil), // 0: pb.HTTPCacheTaskKey
}
var file_models_model_http_cache_task_key_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_http_cache_task_key_proto_init() }
func file_models_model_http_cache_task_key_proto_init() {
if File_models_model_http_cache_task_key_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_models_model_http_cache_task_key_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HTTPCacheTaskKey); 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_http_cache_task_key_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_models_model_http_cache_task_key_proto_goTypes,
DependencyIndexes: file_models_model_http_cache_task_key_proto_depIdxs,
MessageInfos: file_models_model_http_cache_task_key_proto_msgTypes,
}.Build()
File_models_model_http_cache_task_key_proto = out.File
file_models_model_http_cache_task_key_proto_rawDesc = nil
file_models_model_http_cache_task_key_proto_goTypes = nil
file_models_model_http_cache_task_key_proto_depIdxs = nil
}

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