Exemple #1
0
func main() {

	flag.Parse()
	logging.LogInit()

	debug := logging.Debug.Println

	debug("app started") // message will not appear unless run with -debug switch

	hwm := hello.NewHelloWorldModule()

	http.HandleFunc("/hello", hwm.SayHelloWorld)
	go logging.StatsLog()

	log.Fatal(grace.Serve(":9000", nil))
}
Exemple #2
0
func main() {
	logging.LogInit()
	port := 6379

	dyn := store.NewDynamoModule(mapper)
	server, err := redis.NewRedamoServer(port, dyn)
	if err != nil {
		panic(err)
	}

	log.Println("Redamo listening on port", port)

	if err := server.ListenAndServe(); err != nil {
		if syserr, ok := err.(syscall.Errno); ok {
			if syserr == syscall.EADDRINUSE {
				log.Println(syserr)
				os.Exit(1)
			}
		}
		panic(err)
	}
}