mirror of
https://github.com/hanzoai/insights-go.git
synced 2026-09-30 22:46:12 +00:00
fix(build): unify package name to insights (rename stray package posthog); fix leftover posthog. qualifiers in examples + sdk_compliance_adapter
Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
@@ -39,14 +39,14 @@ func TestErrorTrackingThroughEnqueueing(projectAPIKey, endpoint string) {
|
||||
return
|
||||
}
|
||||
|
||||
exceptionWithProps := posthog.Exception{
|
||||
exceptionWithProps := insights.Exception{
|
||||
DistinctId: "distinct-id",
|
||||
Timestamp: time.Now(),
|
||||
Properties: posthog.Properties{
|
||||
Properties: insights.Properties{
|
||||
"environment": "production",
|
||||
"retry_count": 3,
|
||||
},
|
||||
ExceptionList: []posthog.ExceptionItem{
|
||||
ExceptionList: []insights.ExceptionItem{
|
||||
{Type: "Enqueued error with custom props", Value: "Error Description"},
|
||||
},
|
||||
}
|
||||
@@ -73,7 +73,7 @@ func TestErrorTrackingThroughLogHandler(projectAPIKey, endpoint string) {
|
||||
// for demo purposes, real applications should likely pull this value from the context.
|
||||
return "my-user-id"
|
||||
}),
|
||||
posthog.WithPropertiesFn(posthog.SlogAttrsAsProperties),
|
||||
insights.WithPropertiesFn(insights.SlogAttrsAsProperties),
|
||||
))
|
||||
|
||||
done := time.After(3 * time.Second)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package posthog
|
||||
package insights
|
||||
|
||||
import (
|
||||
"sort"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package posthog
|
||||
package insights
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package posthog
|
||||
package insights
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
@@ -4,6 +4,7 @@ go 1.26.4
|
||||
|
||||
require (
|
||||
github.com/goccy/go-json v0.10.6
|
||||
github.com/google/go-cmp v0.7.0
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7
|
||||
github.com/joho/godotenv v1.5.1
|
||||
|
||||
@@ -6,6 +6,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/goccy/go-json v0.10.6 h1:p8HrPJzOakx/mn/bQtjgNjdTcN+/S6FcG2CTtQOrHVU=
|
||||
github.com/goccy/go-json v0.10.6/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package posthog
|
||||
package insights
|
||||
|
||||
import "context"
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
//go:build darwin
|
||||
|
||||
package posthog
|
||||
package insights
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
//go:build linux
|
||||
|
||||
package posthog
|
||||
package insights
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
//go:build !linux && !darwin && !windows
|
||||
|
||||
package posthog
|
||||
package insights
|
||||
|
||||
import "runtime"
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
//go:build windows
|
||||
|
||||
package posthog
|
||||
package insights
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package posthog
|
||||
package insights
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package posthog
|
||||
package insights
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
|
||||
@@ -363,25 +363,25 @@ func featureFlagHandler(w http.ResponseWriter, r *http.Request) {
|
||||
_ = req.DisableGeoIP
|
||||
|
||||
// Convert groups/properties to SDK types
|
||||
var groups posthog.Groups
|
||||
var groups insights.Groups
|
||||
if req.Groups != nil {
|
||||
groups = posthog.Groups(req.Groups)
|
||||
groups = insights.Groups(req.Groups)
|
||||
}
|
||||
|
||||
var personProperties posthog.Properties
|
||||
var personProperties insights.Properties
|
||||
if req.PersonProperties != nil {
|
||||
personProperties = posthog.Properties(req.PersonProperties)
|
||||
personProperties = insights.Properties(req.PersonProperties)
|
||||
}
|
||||
|
||||
var groupProperties map[string]posthog.Properties
|
||||
var groupProperties map[string]insights.Properties
|
||||
if req.GroupProperties != nil {
|
||||
groupProperties = make(map[string]posthog.Properties, len(req.GroupProperties))
|
||||
groupProperties = make(map[string]insights.Properties, len(req.GroupProperties))
|
||||
for k, v := range req.GroupProperties {
|
||||
groupProperties[k] = posthog.Properties(v)
|
||||
groupProperties[k] = insights.Properties(v)
|
||||
}
|
||||
}
|
||||
|
||||
value, err := client.GetFeatureFlag(posthog.FeatureFlagPayload{
|
||||
value, err := client.GetFeatureFlag(insights.FeatureFlagPayload{
|
||||
Key: req.Key,
|
||||
DistinctId: req.DistinctID,
|
||||
Groups: groups,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package posthog
|
||||
package insights
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package posthog
|
||||
package insights
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
Reference in New Issue
Block a user