aboutsummaryrefslogtreecommitdiff
path: root/connector/irc
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/irc
parent11963aaf3d7f681b27cd1e48f596cb1d5ca9d349 (diff)
downloadeasybridge-30a5cdc2a3088995a6ab1521d6b97715ec0a36f5.tar.gz
easybridge-30a5cdc2a3088995a6ab1521d6b97715ec0a36f5.zip
Refactor connector creation logic
Diffstat (limited to 'connector/irc')
-rw-r--r--connector/irc/config.go47
1 files changed, 25 insertions, 22 deletions
diff --git a/connector/irc/config.go b/connector/irc/config.go
index 26d9a63..33469ed 100644
--- a/connector/irc/config.go
+++ b/connector/irc/config.go
@@ -5,28 +5,31 @@ import (
)
func init() {
- Register("irc", ConfigSchema{
- &ConfigEntry{
- Name: "nick",
- Description: "Nickname",
- Required: true,
- },
- &ConfigEntry{
- Name: "server",
- Description: "Server",
- Required: true,
- },
- &ConfigEntry{
- Name: "port",
- Description: "Port",
- IsNumeric: true,
- Default: "6667",
- },
- &ConfigEntry{
- Name: "ssl",
- Description: "Use SSL",
- IsBoolean: true,
- Default: "false",
+ Register("irc", Protocol{
+ NewConnector: func() Connector { return &IRC{} },
+ Schema: ConfigSchema{
+ &ConfigEntry{
+ Name: "nick",
+ Description: "Nickname",
+ Required: true,
+ },
+ &ConfigEntry{
+ Name: "server",
+ Description: "Server",
+ Required: true,
+ },
+ &ConfigEntry{
+ Name: "port",
+ Description: "Port",
+ IsNumeric: true,
+ Default: "6667",
+ },
+ &ConfigEntry{
+ Name: "ssl",
+ Description: "Use SSL",
+ IsBoolean: true,
+ Default: "false",
+ },
},
})
}