From e4845277ec438dafd06ccfbad6db4a7922a7219b Mon Sep 17 00:00:00 2001 From: Brendan Playford <34052452+teslashibe@users.noreply.github.com> Date: Sun, 18 Aug 2024 18:19:50 -0700 Subject: [PATCH] chore: upadte event_library and add todos --- pkg/event/event_library.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/event/event_library.go b/pkg/event/event_library.go index 7f75cdb9..5b4f073d 100644 --- a/pkg/event/event_library.go +++ b/pkg/event/event_library.go @@ -1,14 +1,27 @@ package event +import "fmt" + +// TODO: Define our events properly. These are placeholders and should be replaced with actual event definitions. + func (a *EventTracker) TrackUserLogin(userID string, client *EventClient) error { + if a == nil { + return fmt.Errorf("EventTracker is nil") + } return a.TrackAndSendEvent("user_login", map[string]interface{}{"user_id": userID}, client) } func (a *EventTracker) TrackPageView(pageURL string, client *EventClient) error { + if a == nil { + return fmt.Errorf("EventTracker is nil") + } return a.TrackAndSendEvent("page_view", map[string]interface{}{"url": pageURL}, client) } func (a *EventTracker) TrackPurchase(productID string, amount float64, client *EventClient) error { + if a == nil { + return fmt.Errorf("EventTracker is nil") + } return a.TrackAndSendEvent("purchase", map[string]interface{}{ "product_id": productID, "amount": amount,