2020-04-11 21:01:14 +00:00
|
|
|
package config
|
|
|
|
|
|
|
|
import "github.com/caarlos0/env"
|
|
|
|
|
|
|
|
type TelegramConfig struct {
|
2020-04-11 21:27:24 +00:00
|
|
|
TelegramKey string `env:"TELEGRAM_KEY,required"`
|
|
|
|
TelegramDebug bool `env:"TELEGRAM_DEBUG" envDefault:"false"`
|
2020-04-11 21:01:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (tc *TelegramConfig) LoadConfig() error {
|
|
|
|
if err := env.Parse(tc); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|