overflow_discovery/main.go
crusader c59c3ed31b ing
2017-12-15 14:58:30 +09:00

61 lines
750 B
Go

package main
import (
"flag"
"fmt"
"log"
"os"
"os/signal"
"syscall"
"git.loafle.net/commons_go/logging"
"git.loafle.net/overflow/overflow_discovery/server"
)
var (
pidPath *string
)
func init() {
pidPath = flag.String("pid-path", "/tmp/discovery-container.pid", "The path of pid file")
flag.Parse()
}
func main() {
defer logging.Logger().Sync()
s := server.New(*pidPath)
stop := make(chan os.Signal)
signal.Notify(stop, syscall.SIGINT)
go func() {
if err := s.Start(); nil != err {
log.Printf("Server: Start error %v", err)
return
}
}()
select {
case signal := <-stop:
fmt.Printf("Got signal: %v\n", signal)
}
s.Stop()
}
/**
azure
consul
dns
ec2
file
gce
kubernetes
marathon
openstack
triton
zookeeper
*/