func AdHandlerKafka(w http.ResponseWriter, r *http.Request, s *kafka.Server) { topic := "ad" value := r.URL.Path[4:] s.KafkaSend(w, topic, value) //fmt.Fprintf(w, "Ad: %s", r.URL.Path[4:]) }
func ClickHandlerKafka(w http.ResponseWriter, r *http.Request, s *kafka.Server) { topic := "click" value := r.URL.Path[7:] s.KafkaSend(w, topic, value) //fmt.Fprintf(w, "click: %s", r.URL.Path[7:]) }
func WinHandlerKafka(w http.ResponseWriter, r *http.Request, s *kafka.Server) { topic := "win" value := r.URL.Path[5:] s.KafkaSend(w, topic, value) //fmt.Fprintf(w, "win: %s", r.URL.Path[5:]) }
//win handler - calls avro to encode value func WinHandlerKafkaAvro(w http.ResponseWriter, r *http.Request, s *kafka.Server) { topic := "win" value := myAvro.MyEncode(r.URL.Path[5:]) s.KafkaSendAvro(w, topic, value) }