forked from jshiffer/matterbridge
Add support for build tags (#1054)
By default all bridges are available. You can turn off certain bridges by providing e.g. "nodiscord" as a build tag. go build -tags nomsteams,noapi
This commit is contained in:
parent
0e4973e15c
commit
2b7eab629d
11
gateway/bridgemap/api.go
Normal file
11
gateway/bridgemap/api.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// +build !noapi
|
||||||
|
|
||||||
|
package bridgemap
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/42wim/matterbridge/bridge/api"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
FullMap["api"] = api.New
|
||||||
|
}
|
12
gateway/bridgemap/bdiscord.go
Normal file
12
gateway/bridgemap/bdiscord.go
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
// +build !nodiscord
|
||||||
|
|
||||||
|
package bridgemap
|
||||||
|
|
||||||
|
import (
|
||||||
|
bdiscord "github.com/42wim/matterbridge/bridge/discord"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
FullMap["discord"] = bdiscord.New
|
||||||
|
UserTypingSupport["discord"] = struct{}{}
|
||||||
|
}
|
11
gateway/bridgemap/bgitter.go
Normal file
11
gateway/bridgemap/bgitter.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// +build !nogitter
|
||||||
|
|
||||||
|
package bridgemap
|
||||||
|
|
||||||
|
import (
|
||||||
|
bgitter "github.com/42wim/matterbridge/bridge/gitter"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
FullMap["gitter"] = bgitter.New
|
||||||
|
}
|
11
gateway/bridgemap/birc.go
Normal file
11
gateway/bridgemap/birc.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// +build !noirc
|
||||||
|
|
||||||
|
package bridgemap
|
||||||
|
|
||||||
|
import (
|
||||||
|
birc "github.com/42wim/matterbridge/bridge/irc"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
FullMap["irc"] = birc.New
|
||||||
|
}
|
11
gateway/bridgemap/bkeybase.go
Normal file
11
gateway/bridgemap/bkeybase.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// +build !nokeybase
|
||||||
|
|
||||||
|
package bridgemap
|
||||||
|
|
||||||
|
import (
|
||||||
|
bkeybase "github.com/42wim/matterbridge/bridge/keybase"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
FullMap["keybase"] = bkeybase.New
|
||||||
|
}
|
11
gateway/bridgemap/bmatrix.go
Normal file
11
gateway/bridgemap/bmatrix.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// +build !nomatrix
|
||||||
|
|
||||||
|
package bridgemap
|
||||||
|
|
||||||
|
import (
|
||||||
|
bmatrix "github.com/42wim/matterbridge/bridge/matrix"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
FullMap["matrix"] = bmatrix.New
|
||||||
|
}
|
11
gateway/bridgemap/bmattermost.go
Normal file
11
gateway/bridgemap/bmattermost.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// +build !nomattermost
|
||||||
|
|
||||||
|
package bridgemap
|
||||||
|
|
||||||
|
import (
|
||||||
|
bmattermost "github.com/42wim/matterbridge/bridge/mattermost"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
FullMap["mattermost"] = bmattermost.New
|
||||||
|
}
|
11
gateway/bridgemap/bmsteams.go
Normal file
11
gateway/bridgemap/bmsteams.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// +build !nomsteams
|
||||||
|
|
||||||
|
package bridgemap
|
||||||
|
|
||||||
|
import (
|
||||||
|
bmsteams "github.com/42wim/matterbridge/bridge/msteams"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
FullMap["msteams"] = bmsteams.New
|
||||||
|
}
|
@ -2,47 +2,9 @@ package bridgemap
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/42wim/matterbridge/bridge"
|
"github.com/42wim/matterbridge/bridge"
|
||||||
"github.com/42wim/matterbridge/bridge/api"
|
|
||||||
bdiscord "github.com/42wim/matterbridge/bridge/discord"
|
|
||||||
bgitter "github.com/42wim/matterbridge/bridge/gitter"
|
|
||||||
birc "github.com/42wim/matterbridge/bridge/irc"
|
|
||||||
bkeybase "github.com/42wim/matterbridge/bridge/keybase"
|
|
||||||
bmatrix "github.com/42wim/matterbridge/bridge/matrix"
|
|
||||||
bmattermost "github.com/42wim/matterbridge/bridge/mattermost"
|
|
||||||
bmsteams "github.com/42wim/matterbridge/bridge/msteams"
|
|
||||||
brocketchat "github.com/42wim/matterbridge/bridge/rocketchat"
|
|
||||||
bslack "github.com/42wim/matterbridge/bridge/slack"
|
|
||||||
bsshchat "github.com/42wim/matterbridge/bridge/sshchat"
|
|
||||||
bsteam "github.com/42wim/matterbridge/bridge/steam"
|
|
||||||
btelegram "github.com/42wim/matterbridge/bridge/telegram"
|
|
||||||
bwhatsapp "github.com/42wim/matterbridge/bridge/whatsapp"
|
|
||||||
bxmpp "github.com/42wim/matterbridge/bridge/xmpp"
|
|
||||||
bzulip "github.com/42wim/matterbridge/bridge/zulip"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
FullMap = map[string]bridge.Factory{
|
FullMap = map[string]bridge.Factory{}
|
||||||
"api": api.New,
|
UserTypingSupport = map[string]struct{}{}
|
||||||
"discord": bdiscord.New,
|
|
||||||
"gitter": bgitter.New,
|
|
||||||
"irc": birc.New,
|
|
||||||
"mattermost": bmattermost.New,
|
|
||||||
"matrix": bmatrix.New,
|
|
||||||
"rocketchat": brocketchat.New,
|
|
||||||
"slack-legacy": bslack.NewLegacy,
|
|
||||||
"slack": bslack.New,
|
|
||||||
"sshchat": bsshchat.New,
|
|
||||||
"steam": bsteam.New,
|
|
||||||
"telegram": btelegram.New,
|
|
||||||
"whatsapp": bwhatsapp.New,
|
|
||||||
"xmpp": bxmpp.New,
|
|
||||||
"zulip": bzulip.New,
|
|
||||||
"keybase": bkeybase.New,
|
|
||||||
"msteams": bmsteams.New,
|
|
||||||
}
|
|
||||||
|
|
||||||
UserTypingSupport = map[string]struct{}{
|
|
||||||
"slack": {},
|
|
||||||
"discord": {},
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
11
gateway/bridgemap/brocketchat.go
Normal file
11
gateway/bridgemap/brocketchat.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// +build !norocketchat
|
||||||
|
|
||||||
|
package bridgemap
|
||||||
|
|
||||||
|
import (
|
||||||
|
brocketchat "github.com/42wim/matterbridge/bridge/rocketchat"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
FullMap["rocketchat"] = brocketchat.New
|
||||||
|
}
|
13
gateway/bridgemap/bslack.go
Normal file
13
gateway/bridgemap/bslack.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// +build !noslack
|
||||||
|
|
||||||
|
package bridgemap
|
||||||
|
|
||||||
|
import (
|
||||||
|
bslack "github.com/42wim/matterbridge/bridge/slack"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
FullMap["slack-legacy"] = bslack.NewLegacy
|
||||||
|
FullMap["slack"] = bslack.New
|
||||||
|
UserTypingSupport["slack"] = struct{}{}
|
||||||
|
}
|
11
gateway/bridgemap/bsshchat.go
Normal file
11
gateway/bridgemap/bsshchat.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// +build !nosshchat
|
||||||
|
|
||||||
|
package bridgemap
|
||||||
|
|
||||||
|
import (
|
||||||
|
bsshchat "github.com/42wim/matterbridge/bridge/sshchat"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
FullMap["sshchat"] = bsshchat.New
|
||||||
|
}
|
11
gateway/bridgemap/bsteam.go
Normal file
11
gateway/bridgemap/bsteam.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// +build !nosteam
|
||||||
|
|
||||||
|
package bridgemap
|
||||||
|
|
||||||
|
import (
|
||||||
|
bsteam "github.com/42wim/matterbridge/bridge/steam"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
FullMap["steam"] = bsteam.New
|
||||||
|
}
|
11
gateway/bridgemap/btelegram.go
Normal file
11
gateway/bridgemap/btelegram.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// +build !notelegram
|
||||||
|
|
||||||
|
package bridgemap
|
||||||
|
|
||||||
|
import (
|
||||||
|
btelegram "github.com/42wim/matterbridge/bridge/telegram"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
FullMap["telegram"] = btelegram.New
|
||||||
|
}
|
11
gateway/bridgemap/bwhatsapp.go
Normal file
11
gateway/bridgemap/bwhatsapp.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// +build !nowhatsapp
|
||||||
|
|
||||||
|
package bridgemap
|
||||||
|
|
||||||
|
import (
|
||||||
|
bwhatsapp "github.com/42wim/matterbridge/bridge/whatsapp"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
FullMap["whatsapp"] = bwhatsapp.New
|
||||||
|
}
|
11
gateway/bridgemap/bxmpp.go
Normal file
11
gateway/bridgemap/bxmpp.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// +build !noxmpp
|
||||||
|
|
||||||
|
package bridgemap
|
||||||
|
|
||||||
|
import (
|
||||||
|
bxmpp "github.com/42wim/matterbridge/bridge/xmpp"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
FullMap["xmpp"] = bxmpp.New
|
||||||
|
}
|
11
gateway/bridgemap/bzulip.go
Normal file
11
gateway/bridgemap/bzulip.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// +build !nozulip
|
||||||
|
|
||||||
|
package bridgemap
|
||||||
|
|
||||||
|
import (
|
||||||
|
bzulip "github.com/42wim/matterbridge/bridge/zulip"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
FullMap["zulip"] = bzulip.New
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user