Wire everything together, config and transaction implementation

This commit is contained in:
2026-06-04 23:43:07 +02:00
parent c7ac17559d
commit e19e5bf3c3
5 changed files with 374 additions and 0 deletions

29
internal/config/config.go Normal file
View File

@@ -0,0 +1,29 @@
package config
import (
"encoding/json"
"os"
)
type Config struct {
DB_URL string `json:"db_url"`
LISTEN_ON string `json:"listen_on"`
TRUSTED_PROXIES []string `json:"trusted_proxies"`
OTLP_ENDPOINT string `json:"otlp_endpoint"`
ALLOWED_ORIGINS []string `json:"allowed_origins"`
}
func Read() *Config {
file, err := os.ReadFile("./settings.json")
if err != nil {
panic(err)
}
var config Config
err = json.Unmarshal(file, &config)
if err != nil {
panic(err)
}
return &config
}