aboutsummaryrefslogtreecommitdiff
path: root/connector/xmpp
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-02-28 10:18:47 +0100
committerAlex Auvolat <alex@adnab.me>2020-02-28 10:18:47 +0100
commit30a5cdc2a3088995a6ab1521d6b97715ec0a36f5 (patch)
treefb6fe41d315ff46a9f764afc3524314cd2c0c6a9 /connector/xmpp
parent11963aaf3d7f681b27cd1e48f596cb1d5ca9d349 (diff)
downloadeasybridge-30a5cdc2a3088995a6ab1521d6b97715ec0a36f5.tar.gz
easybridge-30a5cdc2a3088995a6ab1521d6b97715ec0a36f5.zip
Refactor connector creation logic
Diffstat (limited to 'connector/xmpp')
-rw-r--r--connector/xmpp/config.go59
1 files changed, 31 insertions, 28 deletions
diff --git a/connector/xmpp/config.go b/connector/xmpp/config.go
index a5306b4..a6abfac 100644
--- a/connector/xmpp/config.go
+++ b/connector/xmpp/config.go
@@ -5,34 +5,37 @@ import (
)
func init() {
- Register("xmpp", ConfigSchema{
- &ConfigEntry{
- Name: "jid",
- Description: "JID",
- Required: true,
- },
- &ConfigEntry{
- Name: "password",
- Description: "Password",
- Required: true,
- IsPassword: true,
- },
- &ConfigEntry{
- Name: "nickname",
- Description: "Nickname in MUCs",
- Required: true,
- },
- &ConfigEntry{
- Name: "port",
- Description: "Port",
- IsNumeric: true,
- Default: "5222",
- },
- &ConfigEntry{
- Name: "ssl",
- Description: "Use SSL",
- IsBoolean: true,
- Default: "true",
+ Register("xmpp", Protocol{
+ NewConnector: func() Connector { return &XMPP{} },
+ Schema: ConfigSchema{
+ &ConfigEntry{
+ Name: "jid",
+ Description: "JID",
+ Required: true,
+ },
+ &ConfigEntry{
+ Name: "password",
+ Description: "Password",
+ Required: true,
+ IsPassword: true,
+ },
+ &ConfigEntry{
+ Name: "nickname",
+ Description: "Nickname in MUCs",
+ Required: true,
+ },
+ &ConfigEntry{
+ Name: "port",
+ Description: "Port",
+ IsNumeric: true,
+ Default: "5222",
+ },
+ &ConfigEntry{
+ Name: "ssl",
+ Description: "Use SSL",
+ IsBoolean: true,
+ Default: "true",
+ },
},
})
}