-
Notifications
You must be signed in to change notification settings - Fork 12
/
main.go
47 lines (34 loc) · 916 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package main
import (
co "github.com/flipkart-incubator/go-dmux/config"
"github.com/flipkart-incubator/go-dmux/metrics"
"log"
"os"
"github.com/flipkart-incubator/go-dmux/logging"
)
//
// **************** Bootstrap ***********
func main() {
args := os.Args[1:]
sz := len(args)
var path string
if sz == 1 {
path = args[0]
}
dconf := co.DMuxConfigSetting{
FilePath: path,
}
conf := dconf.GetDmuxConf()
dmuxLogging := new(logging.DMuxLogging)
dmuxLogging.Start(conf.Logging)
log.Printf("config: %v \n", conf)
//start showing metrics at the endpoint
metrics.Start(conf.MetricPort)
for _, item := range conf.DMuxItems {
go func(connType co.ConnectionType, connConf interface{}, logDebug bool) {
connType.Start(connConf, logDebug, nil)
}(item.ConnType, item.Connection, dmuxLogging.EnableDebug)
}
//main thread halts. TODO make changes to listen to kill and reboot
select {}
}