config重构
This commit is contained in:
1 parent
0810383afc
commit
5f873914e0
14 files changed
+134
-208
No files matched your search
@@ -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)
|
||||
Reference in new issue
Block a user