diff --git a/cmd/birthdaybot/main.go b/cmd/birthdaybot/main.go index 9b6e35e..4d7056d 100644 --- a/cmd/birthdaybot/main.go +++ b/cmd/birthdaybot/main.go @@ -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) diff --git a/model/config.go b/model/config.go index c15434f..b43191b 100644 --- a/model/config.go +++ b/model/config.go @@ -7,7 +7,18 @@ import ( ) type Config struct { - BirthdayFile string `yaml:"birthday_file"` + 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) {