Adds basic telegram notification config

This commit is contained in:
Miguel de la Cruz 2023-07-01 17:48:10 +02:00
parent a331a45cff
commit 12c74a0f74
2 changed files with 17 additions and 1 deletions

View file

@ -21,6 +21,11 @@ func main() {
os.Exit(1)
}
if err := config.IsValid(); err != nil {
log.Error("invalid config", "configPath", *configFlag, "error", err)
os.Exit(1)
}
srv, err := server.New(config)
if err != nil {
log.Error("error creating server", "error", err)

View file

@ -8,6 +8,17 @@ import (
type Config struct {
BirthdayFile string `yaml:"birthday_file"`
TelegramNotifications *TelegramNotificationsConfig `yaml:"telegram_notifications"`
}
type TelegramNotificationsConfig struct {
BotToken string `yaml:"bot_token"`
ChannelID string `yaml:"channel_id"`
}
// ToDo: to be implemented
func (c *Config) IsValid() error {
return nil
}
func ReadConfig(path string) (*Config, error) {