Browse Source

将所有配置文件移动到conf文件夹

gitlink
Sydonian 3 years ago
parent
commit
987accebad
3 changed files with 5 additions and 22 deletions
  1. +4
    -3
      Makefile
  2. +0
    -18
      assets/config/config.json
  3. +1
    -1
      internal/config/config.go

+ 4
- 3
Makefile View File

@@ -1,5 +1,5 @@
OUTPUT_BINARY_NAME = "cloud-coordinator"
OUTPUT_DIR_NAME = "cloud-coordinator"
OUTPUT_BINARY_NAME = "coordinator"
OUTPUT_DIR_NAME = "coordinator"


ASSETS_DIR_NAME = "assets"
@@ -7,8 +7,9 @@ BUILD_DIR = "../../build"

build:
go build -o ${BUILD_DIR}/${OUTPUT_DIR_NAME}/${OUTPUT_BINARY_NAME}
@if [ -d ${ASSETS_DIR_NAME} ];then \
@if [ -d ${ASSETS_DIR_NAME} ] && [ -n "`ls -A ${ASSETS_DIR_NAME}`" ] ;then \
cp -r ${ASSETS_DIR_NAME}/* ${BUILD_DIR}/${OUTPUT_DIR_NAME}/; \
fi
clean:
rm -f ${BUILD_DIR}/${OUTPUT_DIR_NAME}/${OUTPUT_BINARY_NAME}

+ 0
- 18
assets/config/config.json View File

@@ -1,18 +0,0 @@
{
"logger": {
"outputFileName": "cloud-coordinator",
"outputDirectory": "log",
"level": "debug"
},
"db": {
"account": "root",
"password": "123456",
"port": 3306,
"databaseName": "kx"
},
"rabbitMQ": {
"address": "127.0.0.1:5672",
"account": "guest",
"password": "guest"
}
}

+ 1
- 1
internal/config/config.go View File

@@ -16,7 +16,7 @@ type Config struct {
var cfg Config

func Init() error {
return c.DefaultLoad(&cfg)
return c.DefaultLoad("coordinator", &cfg)
}

func Cfg() *Config {


Loading…
Cancel
Save