summaryrefslogtreecommitdiffstats
path: root/gateway/router.go
diff options
context:
space:
mode:
authorPatrick Connolly <patrick.c.connolly@gmail.com>2018-12-01 06:53:00 +0800
committerWim <wim@42.be>2018-11-30 23:53:00 +0100
commitf2088a687edd53e9e797f3b8941210ca3650cc45 (patch)
tree7a2adb7522e9696873fd734e4abb255759ba3b5e /gateway/router.go
parentfaeeee29482ffd23d26398bcaddea8dc885bc468 (diff)
downloadmatterbridge-msglm-f2088a687edd53e9e797f3b8941210ca3650cc45.tar.gz
matterbridge-msglm-f2088a687edd53e9e797f3b8941210ca3650cc45.tar.bz2
matterbridge-msglm-f2088a687edd53e9e797f3b8941210ca3650cc45.zip
Extract bridgeMap into own package to improve testability (#601)
Diffstat (limited to 'gateway/router.go')
-rw-r--r--gateway/router.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/gateway/router.go b/gateway/router.go
index 13e8ddd8..e4478d84 100644
--- a/gateway/router.go
+++ b/gateway/router.go
@@ -12,14 +12,16 @@ import (
type Router struct {
config.Config
+ BridgeMap map[string]bridge.Factory
Gateways map[string]*Gateway
Message chan config.Message
MattermostPlugin chan config.Message
}
-func NewRouter(cfg config.Config) (*Router, error) {
+func NewRouter(cfg config.Config, bridgeMap map[string]bridge.Factory) (*Router, error) {
r := &Router{
Config: cfg,
+ BridgeMap: bridgeMap,
Message: make(chan config.Message),
MattermostPlugin: make(chan config.Message),
Gateways: make(map[string]*Gateway),