config

package
v0.0.0-...-a965f51 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SettingsFolder       = "."
	SettingsName         = "settings"
	SettingsOverrideName = "settings_local"
	SettingsEnvPrefix    = "app"
)

Variables

This section is empty.

Functions

func Load

func Load(cfg interface{}, onChanges ...func(e fsnotify.Event))

Load use viper to load config read settings.{yaml/json/toml} and unmarshal to interface cfg settings_local will override config in settings support auto reload when file change auto read config from env with prefix 'APP_' and will auto convert "_" to "." for example APP_TELEGRAM_TOKEN will map to telegram.token avoid to use "_" in config name for better env reading

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL