一、前言
二、相关地址
三、配置文件详情
1、base.toml
为了能够正确的编写配置文件的参数,我把配置文件的格式在这里展示一下。
# This is base config
[base]
debug_mode="debug"
time_location="Asia/Chongqing"
[log]
log_level = "trace" #日志打印最低级别
[log.file_writer] #文件写入配置
on = true
log_path = "./golang_common.inf.log"
rotate_log_path = "./golang_common.inf.log"
wf_log_path = "./golang_common.wf.log"
rotate_wf_log_path = "./golang_common.wf.log"
[log.console_writer] #工作台输出
on = true
color = true
2、mysql_map.toml
# this is mysql config
[list]
[list.default]
driver_name = "mysql"
data_source_name = "root:123456@tcp(127.0.0.1:3306)/test?charset=utf8&parseTime=true&loc=Asia%2FChongqing"
max_open_conn = 20
max_idle_conn = 10
max_conn_life_time = 100
3、redis_map.toml
# this is redis config file
[list]
[list.default]
proxy_list = ["127.0.0.1:6379"]
password = ""
db = 0
conn_timeout = 50
read_timeout = 100
write_timeout = 100
4、test.toml
# This is profile config
server_addr = ":8031" #server地址
read_timeout = 10 #server读超时时间
write_timeout = 10 #server写超时时间
max_header_bytes = 20 #最大header头长度
allow_host = [ #白名单ip
"127.0.0.1",
"..."
]