Switching to SQLite and creating the tables
This commit is contained in:
@@ -8,11 +8,7 @@ import (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Host string `json:"host"`
|
||||
Port string `json:"port"`
|
||||
User string `json:"user"`
|
||||
Password string `json:"password"`
|
||||
Database string `json:"database"`
|
||||
DBPath string `json:"db_path"`
|
||||
RedisHost string `json:"redis_host"`
|
||||
RedisPassword string `json:"redis_password"`
|
||||
}
|
||||
@@ -49,16 +45,8 @@ func GetConfig() *Config {
|
||||
// TODO: Better error checking if values are missing
|
||||
// TODO: Default values
|
||||
for key, value := range envMap {
|
||||
if strings.Contains(key, "host") {
|
||||
conf.Host = value
|
||||
} else if strings.Contains(key, "port") {
|
||||
conf.Port = value
|
||||
} else if strings.Contains(key, "user") {
|
||||
conf.User = value
|
||||
} else if strings.Contains(key, "password") {
|
||||
conf.Password = value
|
||||
} else if strings.Contains(key, "database") {
|
||||
conf.Database = value
|
||||
if strings.Contains(key, "db_path") {
|
||||
conf.DBPath = value
|
||||
} else if strings.Contains(key, "redis_host") {
|
||||
conf.RedisHost = value
|
||||
} else if strings.Contains(key, "redis_password") {
|
||||
|
||||
Reference in New Issue
Block a user