forked from Tapjoy/dynamiq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdynamiq.go
34 lines (26 loc) · 826 Bytes
/
dynamiq.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
package main
import (
"flag"
"github.com/Sirupsen/logrus"
"github.com/Tapjoy/dynamiq/app"
)
func main() {
//Get some Command line options
config_file := flag.String("c", "./lib/config.gcfg", "location of config file")
flag.Parse()
if *config_file == "" {
logrus.Warn("Empty value provided for config file location from flag -c : Falling back to default location './lib/config.gcfg'")
*config_file = "./lib/config.gcfg"
}
//setup the config file
cfg, err := app.GetCoreConfig(config_file)
topics := app.InitTopics(cfg, cfg.Queues)
cfg.Topics = &topics
if err != nil {
logrus.Fatal(err)
}
logrus.SetLevel(cfg.Core.LogLevel)
list, _, err := app.InitMemberList(cfg.Core.Name, cfg.Core.Port, cfg.Core.SeedServers, cfg.Core.SeedPort)
http_api := app.HTTP_API_V1{}
http_api.InitWebserver(list, cfg)
}