updaye database , and model
This commit is contained in:
+5
-21
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user