Documentation
¶
Overview ¶
Package config loads GoForge's project configuration from goforge.yaml, a .env file and the process environment.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DotEnvPath ¶
DotEnvPath returns the .env path Load() reads relative to configPath: the same directory, named ".env".
func ResolveEnvPath ¶
ResolveEnvPath returns the .env path to use: override if non-empty, otherwise DotEnvPath(configPath). Callers that need to know where .env lives (init, doctor) without going through Load should use this instead of duplicating the fallback rule.
Types ¶
type Config ¶
type Config struct {
Database struct {
Driver string `yaml:"driver"`
URL string `yaml:"url"`
} `yaml:"database"`
Migrations struct {
Path string `yaml:"path"`
} `yaml:"migrations"`
// Language is the optional UI language ("en"/"es") for human-facing CLI
// output. --lang and GOFORGE_LANG take precedence over it.
Language string `yaml:"language"`
}
Config is the parsed content of goforge.yaml, with ${VAR} references expanded against the environment (after .env has been loaded into it).
func Load ¶
Load reads goforge.yaml from path, first loading a .env file into the process environment so ${VAR} references in the YAML resolve. It does not overwrite variables already set in the environment.
envPath picks which .env to load. An empty string falls back to DotEnvPath(path): the same directory as path, named ".env".