feat 单元测试

This commit is contained in:
2026-01-05 00:32:23 +08:00
parent 887cb242e3
commit 8289e2b4d9
9 changed files with 283 additions and 63 deletions

View File

@@ -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
}