-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.go
45 lines (36 loc) · 925 Bytes
/
app.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
package main
import (
"flag"
"fmt"
mesosaws "github.com/AVENTER-UG/mesos-autoscale/aws"
"github.com/AVENTER-UG/mesos-autoscale/mesos"
"github.com/AVENTER-UG/mesos-autoscale/redis"
util "github.com/AVENTER-UG/util/util"
"github.com/sirupsen/logrus"
)
// BuildVersion of m3s
var BuildVersion string
// GitVersion is the revision and commit number
var GitVersion string
func main() {
// Prints out current version
var version bool
flag.BoolVar(&version, "v", false, "Prints current version")
flag.Parse()
if version {
fmt.Print(GitVersion)
return
}
util.SetLogging(config.LogLevel, config.EnableSyslog, config.AppName)
logrus.Println(config.AppName + " build " + BuildVersion + " git " + GitVersion)
// connect to redis db
r := redis.New(&config)
r.ConnectRedis()
// connect to aws
a := mesosaws.New(&config)
e := mesos.New(&config)
e.Redis = r
e.AWS = a
go e.HealthCheck()
e.EventLoop()
}