postgres working

This commit is contained in:
afeiszli
2021-10-08 13:11:31 -04:00
parent 638e139389
commit b61d415e9d
7 changed files with 223 additions and 2 deletions
+12
View File
@@ -30,6 +30,7 @@ var Config *EnvironmentConfig
// EnvironmentConfig :
type EnvironmentConfig struct {
Server ServerConfig `yaml:"server"`
SQL SQLConfig `yaml:"sql"`
}
// ServerConfig :
@@ -61,6 +62,17 @@ type ServerConfig struct {
Verbosity int32 `yaml:"verbosity"`
}
// Generic SQL Config
type SQLConfig struct {
Host string `yaml:"host"`
Port int32 `yaml:"port"`
Username string `yaml:"username"`
Password string `yaml:"password"`
DB string `yaml:"db"`
SSLMode string `yaml:"sslmode"`
}
//reading in the env file
func readConfig() *EnvironmentConfig {
file := fmt.Sprintf("config/environments/%s.yaml", getEnv())