mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-01-25 10:08:42 -06:00
24 lines
1022 B
Go
24 lines
1022 B
Go
package analytics
|
|
|
|
type Analytics interface {
|
|
// Enqueue queues an analytics event for processing.
|
|
// event is the name of the event to track.
|
|
// userId is the ID of the user performing the action.
|
|
// tenantId is an optional tenant ID to associate with this event.
|
|
// set contains key-value pairs to set on the user/group profile (e.g. email, name, etc.).
|
|
// metadata contains additional metadata to attach to the event.
|
|
Enqueue(event string, userId string, tenantId *string, set map[string]interface{}, metadata map[string]interface{})
|
|
|
|
// Tenant updates properties for a tenant group.
|
|
// tenantId is the ID of the tenant to update.
|
|
// data contains key-value pairs of properties to set on the tenant.
|
|
Tenant(tenantId string, data map[string]interface{})
|
|
}
|
|
|
|
type NoOpAnalytics struct{}
|
|
|
|
func (a NoOpAnalytics) Enqueue(event string, userId string, tenantId *string, set map[string]interface{}, metadata map[string]interface{}) {
|
|
}
|
|
|
|
func (a NoOpAnalytics) Tenant(tenantId string, data map[string]interface{}) {}
|