Browse Source

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

gitlink
Sydonian 2 years ago
parent
commit
3def5f08a7
3 changed files with 4 additions and 21 deletions
  1. +3
    -3
      Makefile
  2. +0
    -17
      assets/config/config.json
  3. +1
    -1
      internal/config/config.go

+ 3
- 3
Makefile View File

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


ASSETS_DIR_NAME = "assets"
@@ -7,7 +7,7 @@ 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



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

@@ -1,17 +0,0 @@
{
"id": 0,
"grpcListenAddress": "127.0.0.1:5010",
"localIP": "localhost",
"ipfsPort": 5001,
"storageBaseDir": ".",
"logger": {
"outputFileName": "cloud-agent",
"outputDirectory": "log",
"level": "debug"
},
"rabbitMQ": {
"address": "127.0.0.1:5672",
"account": "guest",
"password": "guest"
}
}

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

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

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

func Cfg() *Config {


Loading…
Cancel
Save