Telegram pusher.

This commit is contained in:
2017-10-31 22:50:14 +05:00
parent 1cd99829e8
commit c9a111c832
7 changed files with 372 additions and 102 deletions

View File

@@ -19,41 +19,48 @@ package configstruct
// Config's root.
type ConfigStruct struct {
SlackHandler ConfigSlackHandler `yaml:"slackhandler"`
Webhooks map[string]ConfigWebhook `yaml:"webhooks"`
Matrix map[string]ConfigMatrix `yaml:"matrix"`
SlackHandler ConfigSlackHandler `yaml:"slackhandler"`
Webhooks map[string]ConfigWebhook `yaml:"webhooks"`
Matrix map[string]ConfigMatrix `yaml:"matrix"`
Telegram map[string]ConfigTelegram `yaml:"telegram"`
}
// Slack handler configuration.
type ConfigSlackHandler struct {
Listener ConfigSlackHandlerListener `yaml:"listener"`
Listener ConfigSlackHandlerListener `yaml:"listener"`
}
type ConfigSlackHandlerListener struct {
Address string `yaml:"address"`
Address string `yaml:"address"`
}
// Webhook configuration.
type ConfigWebhook struct {
Slack ConfigWebhookSlack `yaml:"slack"`
Remote ConfigWebhookRemote `yaml:"remote"`
Slack ConfigWebhookSlack `yaml:"slack"`
Remote ConfigWebhookRemote `yaml:"remote"`
}
type ConfigWebhookSlack struct {
Random1 string `yaml:"random1"`
Random2 string `yaml:"random2"`
LongRandom string `yaml:"longrandom"`
Random1 string `yaml:"random1"`
Random2 string `yaml:"random2"`
LongRandom string `yaml:"longrandom"`
}
type ConfigWebhookRemote struct {
Pusher string `yaml:"pusher"`
PushTo string `yaml:"push_to"`
Pusher string `yaml:"pusher"`
PushTo string `yaml:"push_to"`
}
// Matrix pusher configuration.
type ConfigMatrix struct {
ApiRoot string `yaml:"api_root"`
User string `yaml:"user"`
Password string `yaml:"password"`
Room string `yaml:"room"`
ApiRoot string `yaml:"api_root"`
User string `yaml:"user"`
Password string `yaml:"password"`
Room string `yaml:"room"`
}
// Telegram pusher configuration
type ConfigTelegram struct {
BotID string `yaml:"bot_id"`
ChatID string `yaml:"chat_id"`
}