MCPcopy Create free account
hub / github.com/MMadmer/EpicAssetsNotifyBot / Load

Function Load

internal/config/config.go:42–54  ·  view source on GitHub ↗

Load resolves all runtime settings relative to projectRoot.

(projectRoot string)

Source from the content-addressed store, hash-verified

40
41// Load resolves all runtime settings relative to projectRoot.
42func Load(projectRoot string) Settings {
43 root := cleanProjectRoot(projectRoot)
44 dataDir := dataDir()
45 return Settings{
46 ProjectRoot: root,
47 Token: strings.TrimSpace(os.Getenv(EnvBotToken)),
48 Locale: envOrDefault(EnvBotLocale, DefaultLocale),
49 DataDir: dataDir,
50 DatabaseURL: databaseURL(dataDir),
51 LocalesDir: filepath.Join(root, "locales"),
52 LogPath: filepath.Join(root, DefaultLogName),
53 }
54}
55
56// LoadLegacySnapshot reads the legacy JSON backups if they exist and normalizes
57// them into the current runtime model.

Callers 2

NewFunction · 0.92
mainFunction · 0.92

Calls 4

cleanProjectRootFunction · 0.85
dataDirFunction · 0.85
envOrDefaultFunction · 0.85
databaseURLFunction · 0.85

Tested by

no test coverage detected