feat 单元测试
This commit is contained in:
@@ -19,10 +19,12 @@ type Config struct {
|
||||
Metric *config.MetricConfig `yaml:"metric"`
|
||||
DB *config.DBConfig `yaml:"db"`
|
||||
Serve *config.ServeConfig `yaml:"serve"`
|
||||
Auth *struct {
|
||||
Secret string `yaml:"secret"`
|
||||
Expire int64 `yaml:"expire"`
|
||||
}
|
||||
Auth *AuthConfig `yaml:"auth"`
|
||||
}
|
||||
|
||||
type AuthConfig struct {
|
||||
Secret string `yaml:"secret"`
|
||||
Expire int64 `yaml:"expire"`
|
||||
}
|
||||
|
||||
var cfg *Config
|
||||
@@ -37,3 +39,7 @@ func LoadConfig() error {
|
||||
func Get() *Config {
|
||||
return cfg
|
||||
}
|
||||
|
||||
func Set(c *Config) {
|
||||
cfg = c
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user