feat 初次提交
This commit is contained in:
28
config/config.go
Normal file
28
config/config.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package config
|
||||
|
||||
import "common/config"
|
||||
|
||||
const path = "./config"
|
||||
|
||||
type Config struct {
|
||||
App *config.AppConfig `yaml:"app"`
|
||||
Log *config.LogConfig `yaml:"log"`
|
||||
Client *struct {
|
||||
Count int32 `yaml:"count"`
|
||||
USN []int64 `yaml:"usn"`
|
||||
Websocket *config.AddressConfig `yaml:"websocket"`
|
||||
} `yaml:"client"`
|
||||
}
|
||||
|
||||
var cfg *Config
|
||||
|
||||
// LoadConfig 加载应用配置
|
||||
func LoadConfig() error {
|
||||
c, err := config.LoadConfig(path, cfg)
|
||||
cfg = c
|
||||
return err
|
||||
}
|
||||
|
||||
func Get() *Config {
|
||||
return cfg
|
||||
}
|
||||
Reference in New Issue
Block a user