Files
scrap/internal/config/setup.go
2025-10-04 18:19:02 +02:00

27 lines
445 B
Go

package config
import (
"encoding/json"
"os"
)
type AppConfig struct {
SqlTablesDir string `json:"sql-tables-dir"`
SqlDatabaseName string `json:"sql-database-name"`
}
var appConfigInstance *AppConfig
func Setup() {
file, err := os.ReadFile("config.json")
if err != nil {
panic(err)
}
if err = json.Unmarshal(file, &appConfigInstance); err != nil {
panic(err)
}
}
func GetAppConfig() *AppConfig { return appConfigInstance }