结构调整添加cmd
This commit is contained in:
1 parent
f2829bfd98
commit
a2f4c00246
72 files changed
+838
-597
No files matched your search
@@ -0,0 +1,25 @@
|
||||
package config
|
||||
|
||||
import "github.com/spf13/viper"
|
||||
|
||||
type Database struct {
|
||||
Dbtype string
|
||||
Host string
|
||||
Port int
|
||||
Name string
|
||||
Username string
|
||||
Password string
|
||||
}
|
||||
|
||||
func InitDatabase(cfg *viper.Viper) *Database {
|
||||
return &Database{
|
||||
Port: cfg.GetInt("port"),
|
||||
Dbtype: cfg.GetString("dbType"),
|
||||
Host: cfg.GetString("host"),
|
||||
Name: cfg.GetString("name"),
|
||||
Username: cfg.GetString("username"),
|
||||
Password: cfg.GetString("password"),
|
||||
}
|
||||
}
|
||||
|
||||
var DatabaseConfig = new(Database)
|
||||
Reference in new issue
Block a user