Commit 69909ab5 by 孙龙

up

parent 5e573699
...@@ -75,6 +75,52 @@ go run ./cmd/task/main.go -config=./config/dev/ -logdir=./logs/ ...@@ -75,6 +75,52 @@ go run ./cmd/task/main.go -config=./config/dev/ -logdir=./logs/
├── go.mod ├── 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 xorm:https://www.kancloud.cn/xormplus/xorm/413729
......
...@@ -10,7 +10,7 @@ func Init(configPath string,logPath string)(err error){ ...@@ -10,7 +10,7 @@ func Init(configPath string,logPath string)(err error){
if err != nil{ if err != nil{
panic(err) panic(err)
} }
xlog.Init(logPath,"http") xlog.Init(logPath,"http","request")
//初始化数据库 //初始化数据库
http.Init() http.Init()
......
...@@ -11,7 +11,7 @@ micro_service_name = "golang_async_task_http" ...@@ -11,7 +11,7 @@ micro_service_name = "golang_async_task_http"
#注册到etcd中的ip 端口 权重信息 #注册到etcd中的ip 端口 权重信息
[etcd_regist] [etcd_regist]
ip = "192.168.1.168" ip = "192.168.1.252"
port = 60020 port = 60020
weight = 10 weight = 10
...@@ -23,7 +23,7 @@ micro_service_name = "golang_async_task_http" ...@@ -23,7 +23,7 @@ micro_service_name = "golang_async_task_http"
time_location="Asia/Chongqing" time_location="Asia/Chongqing"
[http] [http]
addr ="192.168.1.168:8700" # 监听地址, default ":8700" addr =":8700" # 监听地址, default ":8700"
read_timeout = 10 # 读取超时时长 read_timeout = 10 # 读取超时时长
write_timeout = 10 # 写入超时时长 write_timeout = 10 # 写入超时时长
max_header_bytes = 20 # 最大的header大小,二进制位长度 max_header_bytes = 20 # 最大的header大小,二进制位长度
...@@ -23,8 +23,8 @@ func HttpServerRun() { ...@@ -23,8 +23,8 @@ func HttpServerRun() {
gin.SetMode(cfg.Instance("proxy").GetString("base.debug_mode")) gin.SetMode(cfg.Instance("proxy").GetString("base.debug_mode"))
r := InitRouter( r := InitRouter(
//middleware.RequestLog(), middleware.RequestLog(),
middleware.AuthMiddleware(), //middleware.AuthMiddleware(),
middleware.RecoveryMiddleware(), 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