Add samechannel gateway. See #35
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user