Switching to SQLite and creating the tables

This commit is contained in:
2025-11-04 13:59:11 -05:00
parent 47310997ec
commit 13e0efb67c
6 changed files with 79 additions and 35 deletions

View File

@@ -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") {