updaye database , and model

This commit is contained in:
Jay
2019-07-02 10:05:26 +00:00
parent 462804ed07
commit 30d38d6d20
5 changed files with 95 additions and 34 deletions
+5 -21
View File
@@ -12,15 +12,11 @@ import (
// Database struct
type Database struct {
DBName string `yaml:"dbname"`
Host string `yaml:"host"`
Port int `yaml:"port"`
User string `yaml:"user"`
Pass string `yaml:"pass"`
SSLCa string `yaml:"ssl_ca"`
SSLCrt string `yaml:"ssl_crt"`
SSLKey string `yaml:"ssl_key"`
SSLMode string `yaml:"ssl_mode"`
DBName string `yaml:"dbname"`
Host string `yaml:"host"`
Port int `yaml:"port"`
User string `yaml:"user"`
Pass string `yaml:"pass"`
}
// Discord struct
@@ -76,17 +72,5 @@ func LoadConfig(p ...string) (err error) {
return err
}
if exists := utils.CheckExists(conf.Database.SSLCa, false); !exists {
return errors.New("ssl ca file not exists")
}
if exists := utils.CheckExists(conf.Database.SSLCrt, false); !exists {
return errors.New("ssl crt file not exists")
}
if exists := utils.CheckExists(conf.Database.SSLKey, false); !exists {
return errors.New("ssl key file not exists")
}
return
}