refactor: 启用 conf.UseEnv 并将 etc 配置统一为 env 占位
This commit is contained in:
@@ -22,7 +22,7 @@ func main() {
|
||||
flag.Parse()
|
||||
|
||||
var c config.Config
|
||||
conf.MustLoad(*configFile, &c)
|
||||
conf.MustLoad(*configFile, &c, conf.UseEnv())
|
||||
|
||||
server := rest.MustNewServer(c.RestConf)
|
||||
server.Use(middlewares.NewHeaderExtractorMiddleware().Handle)
|
||||
|
||||
@@ -7,13 +7,17 @@ Prometheus:
|
||||
Port: 4001
|
||||
Path: /metrics
|
||||
|
||||
# ===== DEV CONFIG =====
|
||||
DisputeRpcConf:
|
||||
Endpoints:
|
||||
- dispute-rpc:8080
|
||||
- "${DISPUTE_RPC_TARGET}"
|
||||
|
||||
OrderRpcConf:
|
||||
Endpoints:
|
||||
- order-rpc:8080
|
||||
- "${ORDER_RPC_TARGET}"
|
||||
|
||||
PlayerRpcConf:
|
||||
Endpoints:
|
||||
- player-rpc:8080
|
||||
- "${PLAYER_RPC_TARGET}"
|
||||
|
||||
Log:
|
||||
Level: debug
|
||||
|
||||
@@ -6,18 +6,18 @@ Prometheus:
|
||||
Port: 4001
|
||||
Path: /metrics
|
||||
|
||||
# ===== DEV CONF =====
|
||||
SnowflakeRpcConf:
|
||||
Endpoints:
|
||||
- snowflake:8080
|
||||
- "${SNOWFLAKE_RPC_TARGET}"
|
||||
|
||||
DB:
|
||||
Master: "postgresql://${PD_USERNAME}:${DB_PASSWORD}@postgres:${DB_PORT}/${DB_NAME}?sslmode=disable"
|
||||
Slaves: "postgresql://${PD_USERNAME}:${DB_PASSWORD}@postgres:${DB_PORT}/${DB_NAME}?sslmode=disable"
|
||||
Master: "postgresql://${PD_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}?sslmode=disable"
|
||||
Slaves: "postgresql://${PD_USERNAME}:${DB_PASSWORD}@${DB_HOST_RO}:${DB_PORT}/${DB_NAME}?sslmode=disable"
|
||||
|
||||
CacheConf:
|
||||
- Host: "${REDIS_HOST}:${REDIS_PORT}"
|
||||
Type: node
|
||||
Pass: "${REDIS_PASSWORD}"
|
||||
|
||||
Log:
|
||||
Level: debug
|
||||
|
||||
Reference in New Issue
Block a user