-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
41 lines (31 loc) · 815 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
package main
import (
"flag"
"fmt"
"os"
"os/signal"
"syscall"
"github.com/cyops-se/safe-import/si-engine/web/admin"
"github.com/cyops-se/safe-import/si-engine/web/admin/routes"
"github.com/cyops-se/safe-import/usvc"
)
var GitVersion string
var GitCommit string
func main() {
version := flag.Bool("v", false, "Prints the commit hash and exits")
flag.Parse()
routes.SysInfo.GitVersion = GitVersion
routes.SysInfo.GitCommit = GitCommit
if *version {
fmt.Printf("si-engine version %s, commit %s\n", routes.SysInfo.GitVersion, routes.SysInfo.GitCommit)
return
}
broker := &usvc.UsvcBroker{}
broker.Initialize()
broker.SetTimeout(30)
go admin.Run(broker)
c := make(chan os.Signal)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
<-c
// fmt.Println("Exit signal received... exiting")
}