@@ -1,8 +1,10 @@
|
||||
package models
|
||||
|
||||
import "github.com/mitchellh/mapstructure"
|
||||
|
||||
var Configs map[string]interface{}
|
||||
|
||||
var Wed_configs map[string]interface{}
|
||||
var Wed_configs Wed_configs_t
|
||||
|
||||
var Database_configs map[string]interface{}
|
||||
|
||||
@@ -25,7 +27,11 @@ func init() {
|
||||
|
||||
func All_config_init() {
|
||||
//读取web配置
|
||||
Wed_configs = Configs["web"].(map[string]interface{})
|
||||
|
||||
err := mapstructure.Decode(Configs["web"].(map[string]interface{}), &Wed_configs)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
//初始化数据库
|
||||
Database_init()
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package models
|
||||
|
||||
type Wed_configs_t struct {
|
||||
Host string `mapstructure:"host"`
|
||||
Port string `mapstructure:"port"`
|
||||
Tls bool `mapstructure:"tls"`
|
||||
Cert_private_path string `mapstructure:"cert_private_path"`
|
||||
Cert_public_path string `mapstructure:"cert_public_path"`
|
||||
}
|
||||
Reference in New Issue
Block a user