上传测试代码

This commit is contained in:
liwei1dao 2022-05-30 10:54:39 +08:00
parent e98230033f
commit 4adce7d536
4 changed files with 44 additions and 9 deletions

17
.vscode/launch.json vendored
View File

@ -5,12 +5,25 @@
"version": "0.2.0",
"configurations": [
{
"name": "gate",
"name": "gate_1",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/services/gate", //Gomain.go,${workspaceRoot}, /bin /pkg /src
"args": ["-conf","./conf/gate.yaml"],
"args": ["-conf","./conf/gate_1.yaml"],
"cwd": "${workspaceFolder}/bin", //
"internalConsoleOptions": "openOnSessionStart",
"output": "${workspaceFolder}/bin/vsdebug_gate", //vscode
"showGlobalVariables": true,
"env": {}, //,gopathgopath:gopath
},
{
"name": "gate_2",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/services/gate", //Gomain.go,${workspaceRoot}, /bin /pkg /src
"args": ["-conf","./conf/gate_2.yaml"],
"cwd": "${workspaceFolder}/bin", //
"internalConsoleOptions": "openOnSessionStart",
"output": "${workspaceFolder}/bin/vsdebug_gate", //vscode

22
bin/conf/gate_2.yaml Normal file
View File

@ -0,0 +1,22 @@
id : "gate_1" #服务的唯一id 在集群服务下不能重复即可 建议配置文件名与服务id一致
ip : "172.0.0.1" #运行主机Ip 集群通信中 按ip节点通行的查询字段 此字段可以注释掉 注释后取当前运行主机公网ip地址
tag : "demo" #服务集群标签 相同标签 且sys.registry 和 sys.rpc 配置一致 即可互相发现和通信
type : "console" #服务类型 相同服务类型相同 如 多个login 服务 相同服务多开 服务类型一致
category : "BusinessService" #服务类别 例如 网关服务器 或者 游戏服务器 以及普通业务服务器
version : 1.0 #服务版本 多服务器相同的服务类型 高版本比低版本拥有更高的访问优先级 使用场景 热更新机制
#系统配置
sys:
log:
FileName: "./log/gate_1.log" #日志文件存放地址
Loglevel: 0 #日志文件输出级别
LogMaxSize: 128 #日志文件最大Size
LogMaxAge: 7 #日志文件最多保留天数
cache:
Redis_Addr: ["10.0.0.9:9001","10.0.0.9:9002","10.0.0.9:9003","10.0.1.45:9004","10.0.1.45:9005","10.0.1.45:9006"]
Redis_Password: ""
#模块配置
modules:
SM_GateModule:
WSAddr: ":7891"

View File

@ -1,7 +1,7 @@
2022/05/30 10:33:39.990 info single/service.go:44 init sys.log success!
2022/05/30 10:33:40.007 info single/service.go:49 init sys.event success!
2022/05/30 10:33:42.708 info services/servicebase.go:20 init sys.cache success!
2022/05/30 10:33:42.708 info cbase/servicebase.go:58 服务[gate_1] 初始化完成!
2022/05/30 10:33:42.708 info cbase/servicebase.go:80 服务[gate_1:1.0.0.0] 启动完成!
2022/05/30 10:33:42.708 debug gate/module.go:32 Module.Gate Init
2022/05/30 10:33:42.708 debug gate/module.go:38 Module.Gate Start
2022/05/30 10:36:15.600 info single/service.go:44 init sys.log success!
2022/05/30 10:36:15.617 info single/service.go:49 init sys.event success!
2022/05/30 10:36:15.622 info services/servicebase.go:20 init sys.cache success!
2022/05/30 10:36:15.622 info cbase/servicebase.go:58 服务[gate_1] 初始化完成!
2022/05/30 10:36:15.622 info cbase/servicebase.go:80 服务[gate_1:1.0.0.0] 启动完成!
2022/05/30 10:36:15.622 debug gate/module.go:32 Module.Gate Init
2022/05/30 10:36:15.622 debug gate/module.go:38 Module.Gate Start