2017-08-28 01:13:45 +05:00
|
|
|
// OpenSAPS - Open Slack API server for everyone.
|
|
|
|
//
|
|
|
|
// Copyright (c) 2017, Stanislav N. aka pztrn.
|
|
|
|
// All rights reserved.
|
|
|
|
//
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2019-03-05 18:32:34 +05:00
|
|
|
|
2017-08-28 01:13:45 +05:00
|
|
|
package configstruct
|
|
|
|
|
2019-03-05 18:32:34 +05:00
|
|
|
// ConfigStruct is a config's root.
|
2017-08-28 01:13:45 +05:00
|
|
|
type ConfigStruct struct {
|
2017-10-31 22:50:14 +05:00
|
|
|
SlackHandler ConfigSlackHandler `yaml:"slackhandler"`
|
|
|
|
Webhooks map[string]ConfigWebhook `yaml:"webhooks"`
|
|
|
|
Matrix map[string]ConfigMatrix `yaml:"matrix"`
|
|
|
|
Telegram map[string]ConfigTelegram `yaml:"telegram"`
|
2017-08-28 01:13:45 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Slack handler configuration.
|
|
|
|
type ConfigSlackHandler struct {
|
2017-10-31 22:50:14 +05:00
|
|
|
Listener ConfigSlackHandlerListener `yaml:"listener"`
|
2017-08-28 01:13:45 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
type ConfigSlackHandlerListener struct {
|
2017-10-31 22:50:14 +05:00
|
|
|
Address string `yaml:"address"`
|
2017-08-28 01:13:45 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Webhook configuration.
|
|
|
|
type ConfigWebhook struct {
|
2017-10-31 22:50:14 +05:00
|
|
|
Slack ConfigWebhookSlack `yaml:"slack"`
|
|
|
|
Remote ConfigWebhookRemote `yaml:"remote"`
|
2017-08-28 01:13:45 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
type ConfigWebhookSlack struct {
|
2017-10-31 22:50:14 +05:00
|
|
|
Random1 string `yaml:"random1"`
|
|
|
|
Random2 string `yaml:"random2"`
|
|
|
|
LongRandom string `yaml:"longrandom"`
|
2017-08-28 01:13:45 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
type ConfigWebhookRemote struct {
|
2017-10-31 22:50:14 +05:00
|
|
|
Pusher string `yaml:"pusher"`
|
|
|
|
PushTo string `yaml:"push_to"`
|
2017-08-28 01:13:45 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Matrix pusher configuration.
|
|
|
|
type ConfigMatrix struct {
|
2019-12-15 22:17:01 +05:00
|
|
|
APIRoot string `yaml:"api_root"`
|
2017-10-31 22:50:14 +05:00
|
|
|
User string `yaml:"user"`
|
|
|
|
Password string `yaml:"password"`
|
|
|
|
Room string `yaml:"room"`
|
|
|
|
}
|
|
|
|
|
2019-03-05 18:32:34 +05:00
|
|
|
// ConfigTelegram is a telegram pusher configuration
|
2017-10-31 22:50:14 +05:00
|
|
|
type ConfigTelegram struct {
|
2019-03-05 18:32:34 +05:00
|
|
|
BotID string `yaml:"bot_id"`
|
|
|
|
ChatID string `yaml:"chat_id"`
|
|
|
|
Proxy ConfigProxy `yaml:"proxy"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// ConfigProxy represents proxy server configuration.
|
|
|
|
type ConfigProxy struct {
|
|
|
|
// ProxyType is a proxy type. Currently ignored.
|
|
|
|
Enabled bool `yaml:"enabled"`
|
|
|
|
ProxyType string `yaml:"proxy_type"`
|
|
|
|
Address string `yaml:"address"`
|
|
|
|
User string `yaml:"user"`
|
|
|
|
Password string `yaml:"password"`
|
2017-08-28 01:13:45 +05:00
|
|
|
}
|