26 lines
454 B
Go
26 lines
454 B
Go
package config
|
|
|
|
import "git.hlsq.asia/mmorpg/service-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
|
|
}
|