예제 #1
0
func main() {
	// Flag parameters parsing
	flag.Parse()
	// Metrics server
	sock, err := net.Listen("tcp", "localhost:8123")
	checkErr(err)
	go func() {
		if *DEBUG == true {
			fmt.Println("Metrics server now available at localhost:8123/debug/vars")
		}
		http.Serve(sock, nil)
	}()
	// Rabbitmq listener
	go rabbit.Listen(*amqp_host, *amqp_port, counts, func(body []byte) {
		MessageRead(body)
	})
	// Redis
	NewClient()
	BucketCheck()
}
예제 #2
0
func main() {
	// Flag parameters parsing
	flag.Parse()
	// Metrics server
	sock, err := net.Listen("tcp", "localhost:8123")
	checkErr(err)
	go func() {
		if *DEBUG == true {
			fmt.Println("Metrics server now available at localhost:8123/debug/vars")
		}
		http.Serve(sock, nil)
	}()
	// Postgresql
	db := NewPsql()
	InitPsql(db)
	// Rabbitmq listener
	rabbit.Listen(*amqp_host, *amqp_port, counts, func(body []byte) {
		MessageRead(body, db)
	})
}