summaryrefslogtreecommitdiffstats
path: root/matterbridge.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-07-25 20:11:52 +0200
committerWim <wim@42.be>2017-07-25 20:11:52 +0200
commit83ef61287e34aaf35e52eb5e18b87364294144da (patch)
tree138c3ec9738ec0ad8169887d247d7afdb0a4c274 /matterbridge.go
parent3527e09bc5a6d4704f1445d35f90b33e859c23c2 (diff)
downloadmatterbridge-msglm-83ef61287e34aaf35e52eb5e18b87364294144da.tar.gz
matterbridge-msglm-83ef61287e34aaf35e52eb5e18b87364294144da.tar.bz2
matterbridge-msglm-83ef61287e34aaf35e52eb5e18b87364294144da.zip
Refactor. Add tests
Diffstat (limited to 'matterbridge.go')
-rw-r--r--matterbridge.go21
1 files changed, 6 insertions, 15 deletions
diff --git a/matterbridge.go b/matterbridge.go
index a84fd9b3..735b7427 100644
--- a/matterbridge.go
+++ b/matterbridge.go
@@ -5,14 +5,14 @@ import (
"fmt"
"github.com/42wim/matterbridge/bridge/config"
"github.com/42wim/matterbridge/gateway"
- "github.com/42wim/matterbridge/gateway/samechannel"
+ //"github.com/42wim/matterbridge/gateway/samechannel"
log "github.com/Sirupsen/logrus"
"github.com/google/gops/agent"
"strings"
)
var (
- version = "0.16.3"
+ version = "1.0.0-dev"
githash string
)
@@ -43,20 +43,11 @@ func main() {
log.Println("WARNING: THIS IS A DEVELOPMENT VERSION. Things may break.")
}
cfg := config.NewConfig(*flagConfig)
-
- g := gateway.New(cfg)
- sgw := samechannelgateway.New(cfg)
- gwconfigs := sgw.GetConfig()
- for _, gw := range append(gwconfigs, cfg.Gateway...) {
- if !gw.Enable {
- continue
- }
- err := g.AddConfig(&gw)
- if err != nil {
- log.Fatalf("Starting gateway failed: %s", err)
- }
+ r, err := gateway.NewRouter(cfg)
+ if err != nil {
+ log.Fatalf("Starting gateway failed: %s", err)
}
- err := g.Start()
+ err = r.Start()
if err != nil {
log.Fatalf("Starting gateway failed: %s", err)
}