Exemple #1
0
func main() {
	// Arguments
	flag.Usage = usage
	flag.Parse()
	if *showVersion {
		fmt.Fprintln(os.Stdout, version.Version)
		os.Exit(1)
	}
	// Init
	initLog()
	initConfig()
	initDB()
	initFilter()

	// Service
	health.Init(db)
	go health.Start()

	cleaner := cleaner.New(cfg, db)
	go cleaner.Start()

	alerter := alerter.New(cfg, db)
	alerter.Start()

	go webapp.Start(cfg, db)

	detector := detector.New(cfg, db, flt)
	detector.Out(alerter.In)
	detector.Start()
}
Exemple #2
0
func main() {
	health.Init(db)
	go health.Start()

	alerter := alerter.New(cfg, db)
	alerter.Start()

	go webapp.Start(cfg, db, flt)

	detector := detector.New(cfg, db, flt)
	detector.Out(alerter.In)
	detector.Start()
}