config重构

This commit is contained in:
linwenxiang committed 2020-12-08 20:28:26 +08:00
1 parent 0810383afc
commit 5f873914e0
14 files changed
+134 -208

No files matched your search

-11
View File
@@ -1,19 +1,8 @@
package config
import "github.com/spf13/viper"
type Database struct {
Driver string
Source string
}
func InitDatabase(cfg *viper.Viper) *Database {
db := &Database{
Driver: cfg.GetString("driver"),
Source: cfg.GetString("source"),
}
return db
}
var DatabaseConfig = new(Database)