mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-07-02 10:26:18 +00:00
Extract bridgeMap into own package to improve testability (#601)
This commit is contained in:
@ -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),
|
||||
|
Reference in New Issue
Block a user