opensaps/config/struct/struct.go

79 lines
2.3 KiB
Go
Raw Normal View History

// 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/>.
package configstruct
// ConfigStruct is a config's root.
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"`
}
// Slack handler configuration.
type ConfigSlackHandler struct {
2017-10-31 22:50:14 +05:00
Listener ConfigSlackHandlerListener `yaml:"listener"`
}
type ConfigSlackHandlerListener struct {
2017-10-31 22:50:14 +05:00
Address string `yaml:"address"`
}
// Webhook configuration.
type ConfigWebhook struct {
2017-10-31 22:50:14 +05:00
Slack ConfigWebhookSlack `yaml:"slack"`
Remote ConfigWebhookRemote `yaml:"remote"`
}
type ConfigWebhookSlack struct {
2017-10-31 22:50:14 +05:00
Random1 string `yaml:"random1"`
Random2 string `yaml:"random2"`
LongRandom string `yaml:"longrandom"`
}
type ConfigWebhookRemote struct {
2017-10-31 22:50:14 +05:00
Pusher string `yaml:"pusher"`
PushTo string `yaml:"push_to"`
}
// Matrix pusher configuration.
type ConfigMatrix struct {
2017-10-31 22:50:14 +05:00
ApiRoot string `yaml:"api_root"`
User string `yaml:"user"`
Password string `yaml:"password"`
Room string `yaml:"room"`
}
// ConfigTelegram is a telegram pusher configuration
2017-10-31 22:50:14 +05:00
type ConfigTelegram struct {
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"`
}