Пример #1
0
func setupServer(redisUrl string) {
	conn, _ := bitmap.Open(redisUrl)
	metrics = &Metrics{
		bitmap.NewBitmap(conn),
	}

	// HTTP endpoints
	//http.HandleFunc("/api/1.0/track/", trackHandle)
	router = mux.NewRouter()
	router.HandleFunc("/api/1.0/track/", trackHandle).Methods("POST").Name("track")
	router.HandleFunc("/api/1.0/retention/", retentionHandle).Methods("GET").Name("retention")
	router.StrictSlash(false)
	http.Handle("/", router)
}
Пример #2
0
func emptyDb() {
	c, _ := bitmap.Open(redisUrl)
	bitmap.NewBitmap(c).DeleteAllEvents()
}