feat 改名
This commit is contained in:
29
Server/gateway/config/config.dev.yaml
Normal file
29
Server/gateway/config/config.dev.yaml
Normal file
@@ -0,0 +1,29 @@
|
||||
app:
|
||||
name: "gateway-dev"
|
||||
|
||||
log:
|
||||
debug: true
|
||||
level: "debug"
|
||||
maxSize: 10
|
||||
maxBackups: 100
|
||||
maxAge: 7
|
||||
|
||||
db:
|
||||
etcd:
|
||||
address: [ "10.0.40.9:2379" ]
|
||||
|
||||
serve:
|
||||
grpc:
|
||||
address: "127.0.0.1"
|
||||
port: 8500
|
||||
ttl: 20
|
||||
socket:
|
||||
web:
|
||||
address: "127.0.0.1"
|
||||
port: 8501
|
||||
raw:
|
||||
address: "127.0.0.1"
|
||||
port: 8502
|
||||
http:
|
||||
address: "127.0.0.1"
|
||||
port: 8503
|
||||
25
Server/gateway/config/config.go
Normal file
25
Server/gateway/config/config.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package config
|
||||
|
||||
import "common/config"
|
||||
|
||||
const path = "./config"
|
||||
|
||||
type Config struct {
|
||||
App *config.AppConfig `yaml:"app"`
|
||||
Log *config.LogConfig `yaml:"log"`
|
||||
DB *config.DBConfig `yaml:"db"`
|
||||
Serve *config.ServeConfig `yaml:"serve"`
|
||||
}
|
||||
|
||||
var cfg *Config
|
||||
|
||||
// LoadConfig 加载应用配置
|
||||
func LoadConfig() error {
|
||||
c, err := config.LoadConfig(path, cfg)
|
||||
cfg = c
|
||||
return err
|
||||
}
|
||||
|
||||
func Get() *Config {
|
||||
return cfg
|
||||
}
|
||||
29
Server/gateway/config/config.prod.yaml
Normal file
29
Server/gateway/config/config.prod.yaml
Normal file
@@ -0,0 +1,29 @@
|
||||
app:
|
||||
name: "gateway-prod"
|
||||
|
||||
log:
|
||||
debug: false
|
||||
level: "debug"
|
||||
maxSize: 10
|
||||
maxBackups: 100
|
||||
maxAge: 7
|
||||
|
||||
db:
|
||||
etcd:
|
||||
address: [ "172.18.28.0:2379" ]
|
||||
|
||||
serve:
|
||||
grpc:
|
||||
address: "172.18.28.0"
|
||||
port: 8500
|
||||
ttl: 20
|
||||
socket:
|
||||
web:
|
||||
address: "172.18.28.0"
|
||||
port: 8501
|
||||
raw:
|
||||
address: "172.18.28.0"
|
||||
port: 8502
|
||||
http:
|
||||
address: "172.18.28.0"
|
||||
port: 8503
|
||||
Reference in New Issue
Block a user