Mixpanel Proxy library in Go (as a http.Handler)
- Extract the Token and the DistinctId
- Support Events and People endpoints
- Passthrough for other endpoints
- Custom Director to implement the proxy logic
- Fully functional dummy (successful) response
- Test coverage
package main
import (
"github.com/cenkalti/log"
"github.com/pior/mixpanelproxy"
"net/http"
)
func main() {
director := func(m *mixpanelproxy.MixpanelRequest) (err error) {
log.Infof("Received: %s", m)
return nil
}
url := "http://api.mixpanel.com"
http.Handle("/", mixpanelproxy.NewProxy(&url, director))
log.Fatal(http.ListenAndServe(":8080", nil))
}
MixpanelProxy use github.com/cenkalti/log for logging