【文件属性】:
文件名称:env_json:读取 env 配置文件并将数据构建到 json
文件大小:6KB
文件格式:ZIP
更新时间:2021-06-08 15:55:10
Go
环境 JSON
这个包基于github.com/gogap/env_strings
从配置中读取 Env 并将值编译到 json 文件中。
关于 ENV JSON
有时我们需要配置文件如下:
db.conf {
" host " : " 127.0.0.1 " ,
" password " : " 3306 " ,
" timeout " : 1000
}
但是,当我们管理越来越多的服务器和服务时,如果我们需要更改密码或IP,那就是一场灾难。
所以,我们只想使用这样的配置。
db.conf {
" host " : " {{.host}} " ,
" password " : " {{.password}} " ,
" timeout " :{ {.timeout }}
}
当我们读取 json 文件 configs.xml 时,我们使用 golang 的模板将
【文件预览】:
env_json-master
----env_json.go(1KB)
----LICENSE(11KB)
----README.md(2KB)
----.gitignore(266B)