* feat(config): enhance config file and data dir retrieval - Add xdg package for XDG base directory support - Update RetrieveConfigFile to search in XDG_CONFIG_HOME and /etc - Add RetrieveDataDir to find data directory in XDG_DATA_HOME and /var/lib - Improve comments for better understanding of search order * add unit tests
19 lines
336 B
Go
19 lines
336 B
Go
package config
|
|
|
|
// 默认配置文件名
|
|
var CONF_DEFAULT_FILENAMES = []string{
|
|
"artalk.yml",
|
|
"artalk-go.yml", // for 向下兼容
|
|
"config.yml",
|
|
"conf.yml",
|
|
|
|
// .yaml extension
|
|
"artalk.yaml",
|
|
"artalk-go.yaml",
|
|
"config.yml",
|
|
"conf.yml",
|
|
}
|
|
|
|
// 图片上传目录路由重写路径
|
|
const IMG_UPLOAD_PUBLIC_PATH = "/static/images"
|