Files
scrap/internal/config/setup.go
2025-10-04 15:11:20 +02:00

26 lines
391 B
Go

package config
import (
"encoding/json"
"os"
)
type AppConfig struct {
SqlTablesDir string `json:"sql-tables-dir"`
}
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 }