15 lines
248 B
Go
15 lines
248 B
Go
|
package config
|
||
|
|
||
|
import "github.com/caarlos0/env"
|
||
|
|
||
|
type TelegramConfig struct {
|
||
|
TelegramKey string `env:"TELEGRAM_KEY,required"`
|
||
|
}
|
||
|
|
||
|
func (tc *TelegramConfig) LoadConfig() error {
|
||
|
if err := env.Parse(tc); err != nil {
|
||
|
return err
|
||
|
}
|
||
|
return nil
|
||
|
}
|