mirror of
https://github.com/watn3y/steamsalty.git
synced 2025-10-28 01:21:07 +01:00
refactor!: change config structure to be more readable
This commit is contained in:
parent
f17601c470
commit
038d375ae7
7 changed files with 31 additions and 22 deletions
|
|
@ -1,19 +1,27 @@
|
|||
package config
|
||||
|
||||
type config struct {
|
||||
LogLevel int `env:"STEAMSALTY_LOGLEVEL" default:"1"`
|
||||
LogLevel int `env:"STEAMSALTY_LOGLEVEL, default=1"`
|
||||
|
||||
ChatID int64 `env:"STEAMSALTY_CHATID, required`
|
||||
Watchers []uint64 `env:"STEAMSALTY_WATCHERS, required`
|
||||
SleepInterval int `env:"STEAMSALTY_SLEEPINTERVAL, default=60"`
|
||||
|
||||
Translate struct {
|
||||
Enabled bool `env:"STEAMSALTY_TRANSLATE_ENABLED, default=False"`
|
||||
Language string `env:"STEAMSALTY_TRANSLATE_LANGUAGE, default=EN-US"`
|
||||
}
|
||||
|
||||
Telegram struct {
|
||||
APIToken string `env:"STEAMSALTY_TELEGRAM_APITOKEN, required"`
|
||||
}
|
||||
|
||||
Steam struct {
|
||||
APIKey string `env:"STEAMSALTY_STEAMAPIKEY, required`
|
||||
}
|
||||
|
||||
SleepInterval int `env:"STEAMSALTY_SLEEPINTERVAL" default:"60"`
|
||||
ChatID int64 `env:"STEAMSALTY_CHATID" required:"true"`
|
||||
Watchers []uint64 `env:"STEAMSALTY_WATCHERS" required:"true"`
|
||||
TranslateEnabled bool `env:"STEAMSALTY_TRANSLATE_ENABLED" default:"false"`
|
||||
TranslateLanguage string `env:"STEAMSALTY_TRANSLATE_LANGUAGE" default:"EN-US"`
|
||||
TelegramAPIToken string `env:"STEAMSALTY_TELEGRAMAPITOKEN" required:"true"`
|
||||
SteamAPIKey string `env:"STEAMSALTY_STEAMAPIKEY" required:"true"`
|
||||
|
||||
DeepL struct {
|
||||
APIKey string `env:"STEAMSALTY_DEEPL_APIKEY"`
|
||||
FreeTier bool `env:"STEAMSALTY_DEEPL_FREETIER" default:"true"`
|
||||
}
|
||||
APIKey string `env:"STEAMSALTY_DEEPL_APIKEY"`
|
||||
FreeTier bool `env:"STEAMSALTY_DEEPL_FREETIER, default=True"`
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue