Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ServiceSettings serviceSettings
ServiceSettings holds the process-wide service configuration, populated from SERVICE_-prefixed environment variables during package init.
Functions ¶
func GetSettings ¶
GetSettings Initialize settings, example:
type tg struct {
Token string `env:"TOKEN,required"`
}
type serviceSettings struct {
TG tg `env:"TG" envPrefix:"TG__"`
}
func init() {
Settings = settingsutils.MustGetSetting[serviceSettings]("TEAS_")
}
var Settings serviceSettings
Returns error if dotEnv file found, but corrupted.
func MustGetSetting ¶
MustGetSetting is like GetSettings but panics on error; use it at startup (e.g. in package init) where invalid configuration should abort the process.
Types ¶
This section is empty.