Commit 69909ab5 by 孙龙

up

parent 5e573699
......@@ -75,6 +75,52 @@ go run ./cmd/task/main.go -config=./config/dev/ -logdir=./logs/
├── go.mod
启动须知:
修改config/proxy.toml
修改启动端口:
[http]
addr =":8700" # 监听地址, default ":8700"
read_timeout = 10 # 读取超时时长
write_timeout = 10 # 写入超时时长
max_header_bytes = 20 # 最大的header大小,二进制位长度
微服务注册相关信息修改
#服务注册名称
micro_service_name = "golang_async_task_http"
#etcd配置信息 etcd服务的ip端口用户密码
[etcd_config]
addrs = [
"192.168.1.252:2379"
]
username = ""
password = ""
#注册到etcd中的ip 端口 权重信息
[etcd_regist]
ip = "192.168.1.252"
port = 60020
weight = 10
参考文献:
xorm:https://www.kancloud.cn/xormplus/xorm/413729
......
......@@ -10,7 +10,7 @@ func Init(configPath string,logPath string)(err error){
if err != nil{
panic(err)
}
xlog.Init(logPath,"http")
xlog.Init(logPath,"http","request")
//初始化数据库
http.Init()
......
......@@ -11,7 +11,7 @@ micro_service_name = "golang_async_task_http"
#注册到etcd中的ip 端口 权重信息
[etcd_regist]
ip = "192.168.1.168"
ip = "192.168.1.252"
port = 60020
weight = 10
......@@ -23,7 +23,7 @@ micro_service_name = "golang_async_task_http"
time_location="Asia/Chongqing"
[http]
addr ="192.168.1.168:8700" # 监听地址, default ":8700"
addr =":8700" # 监听地址, default ":8700"
read_timeout = 10 # 读取超时时长
write_timeout = 10 # 写入超时时长
max_header_bytes = 20 # 最大的header大小,二进制位长度
......@@ -23,8 +23,8 @@ func HttpServerRun() {
gin.SetMode(cfg.Instance("proxy").GetString("base.debug_mode"))
r := InitRouter(
//middleware.RequestLog(),
middleware.AuthMiddleware(),
middleware.RequestLog(),
//middleware.AuthMiddleware(),
middleware.RecoveryMiddleware(),
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment