Adds basic telegram notification config
This commit is contained in:
parent
a331a45cff
commit
12c74a0f74
2 changed files with 17 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue