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)
|
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)
|
srv, err := server.New(config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("error creating server", "error", err)
|
log.Error("error creating server", "error", err)
|
||||||
|
|
|
@ -7,7 +7,18 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
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) {
|
func ReadConfig(path string) (*Config, error) {
|
||||||
|
|
Loading…
Reference in a new issue