forked from gianarb/orbiter
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.go
35 lines (29 loc) · 735 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
package main
import (
"os"
"github.com/mitchellh/cli"
"github.com/sarkk0x0/orbiter/cmd"
"github.com/sarkk0x0/orbiter/utils/hook"
"github.com/sirupsen/logrus"
)
func main() {
eventChannel := make(chan *logrus.Entry)
logrus.AddHook(hook.NewChannelHook(eventChannel))
c := cli.NewCLI("orbiter", "0.0.0")
c.Args = os.Args[1:]
c.Commands = map[string]cli.CommandFactory{
"daemon": func() (cli.Command, error) {
return &cmd.DaemonCmd{
EventChannel: eventChannel,
}, nil
},
"autoscaler ls": func() (cli.Command, error) {
return &cmd.AutoscalerListCmd{}, nil
},
"system events": func() (cli.Command, error) {
return &cmd.SystemEventsCmd{}, nil
},
}
exitStatus, _ := c.Run()
os.Exit(exitStatus)
}