2024-09-12 16:40:31 -05:00
|
|
|
package config
|
|
|
|
|
|
|
|
|
|
type Config struct {
|
2024-09-14 23:07:28 -05:00
|
|
|
Name string `toml:"name"`
|
|
|
|
|
Env Env `toml:"env"`
|
|
|
|
|
BaseURL string `toml:"base_url"`
|
|
|
|
|
Conn ConnSettings `toml:"conn"`
|
2024-09-14 20:37:51 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ConnSettings struct {
|
2024-09-14 23:07:28 -05:00
|
|
|
Store string `toml:"store"`
|
|
|
|
|
DSN string `toml:"dsn"`
|
|
|
|
|
Settings map[string]any `toml:"settings"`
|
2024-09-12 16:40:31 -05:00
|
|
|
}
|
2024-09-13 13:38:30 -05:00
|
|
|
|
|
|
|
|
func (c Config) Environment() Env {
|
|
|
|
|
return ValidEnvOrDev(c.Env)
|
|
|
|
|
}
|