Exemplo n.º 1
0
func main() {
	flag.Parse()

	// Instantiates the CoreRoller updater to check periodically for version update.
	if updater, err := updater.New(30*time.Second, syscall.SIGTERM); err == nil {
		go updater.Start()
	}

	awsAuth, err := aws.GetAuth(config.awsAccessKey, config.awsSecretKey)
	if err != nil {
		log.Println(err)
	}

	manager := &Manager{
		configPath: config.etcdPath,
		etcdClient: etcd.NewClient(strings.Split(config.etcdHost, ",")),
		awsAuth:    awsAuth,
	}

	log.Println("Running load balancers manager...")
	go manager.Start()

	// Wait for signal to terminate
	signalsCh := make(chan os.Signal, 1)
	signal.Notify(signalsCh, os.Interrupt, syscall.SIGTERM)
	<-signalsCh
}
Exemplo n.º 2
0
func main() {
	// Instantiates the CoreRoller updater to check periodically for version update.
	if updater, err := updater.New(30*time.Second, syscall.SIGTERM); err == nil {
		go updater.Start()
	}

	// Your app code
	// ...

	// Wait for signal to terminate
	signalsCh := make(chan os.Signal, 1)
	signal.Notify(signalsCh, os.Interrupt, syscall.SIGTERM)
	<-signalsCh
}