Add samechannel gateway. See #35

This commit is contained in:
Wim
2016-09-30 23:19:47 +02:00
parent 0e527a4252
commit fff6f08cb6
3 changed files with 113 additions and 7 deletions

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"github.com/42wim/matterbridge/bridge/config"
"github.com/42wim/matterbridge/gateway"
"github.com/42wim/matterbridge/gateway/samechannel"
log "github.com/Sirupsen/logrus"
)
@@ -30,6 +31,19 @@ func main() {
}
fmt.Println("running version", version)
cfg := config.NewConfig(*flagConfig)
for _, gw := range cfg.SameChannelGateway {
if !gw.Enable {
continue
}
fmt.Printf("starting samechannel gateway %#v\n", gw.Name)
go func(gw config.SameChannelGateway) {
err := samechannelgateway.New(cfg, &gw)
if err != nil {
log.Debugf("starting gateway failed %#v", err)
}
}(gw)
}
for _, gw := range cfg.Gateway {
if !gw.Enable {
continue