Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentBrandVersion ¶
type Campaign ¶
type Campaign struct { Name string Source string Medium string CustomData CustomData }
type Context ¶
type Context struct { Active bool IP net.IP // Current user's IP address. Locale string // Locale string for the current user, for example en-US. Location *Location // Dictionary of information about the user’s current location. Page *Page // Dictionary of information about the current web page. UserAgent string UserAgentData *UserAgentData // User agent data returned by the Client Hints API Library *Library // the name of the library(sdk) and the version of it Traits *Traits Campaign *Campaign // Dictionary of information about the campaign that resulted in the API call, containing name, source, medium, term, content, and any other custom UTM parameter. Referrer *Referrer // Dictionary of information about the way the user was referred to the website or app. CustomData *CustomData }
This is an implementation of Context class similar to the `CoreExtraContext` in segment js SDK.
type CoreEvent ¶
type CoreEvent struct { MessageID string Type Type // track, page , ... // Category string // specific to page event Name string Properties *Properties Integration []*Integrations Ctx *Context SendAt time.Time ReceivedAt time.Time OriginalTimeStamp time.Time // TODO: don't know the difference between this and Timestamp example(2023-11-19T12:04:25.271Z) Timestamp time.Time // 2023-11-19T12:04:25.779Z AnonymousID string UserID string GroupID string PreviousID string Event string WriteKey string MetaData MetaData // TODO: all fields had ambiguity so did not added yet Options *Options }
type CustomData ¶
type Integrations ¶
type Integrations struct { All bool Config Properties // TODO: i don't think this is a proper name for this field but, didn't have a better name on my mind }
type Options ¶
type Options struct { Integrations *Integrations Timestamp time.Time Ctx *Context AnonymousID string UserID string Traits Traits CustomData *CustomData }
type Page ¶
type Page struct { Path string // academy/ Referrer url.URL // https://www.foo.com/ Search string // projectId=123 Title string // Analytics Academy URL url.URL // https://segment.com/academy/ }
type ProcessedEvent ¶
type ProcessedEvent struct { // required fields SourceID string // Write key or sourceID shows that which source, events coming from TracerCarrier map[string]string // use this for trace with OTel Integration entity.Integration MessageID string // Automatically collected by Segment, a unique identifier for each message EventType Type // Type of message, corresponding to the API method: 'identify', 'group', 'track', 'page', 'screen' or 'alias'. Version uint8 // The version of the Tracking API SentAt time.Time // Time on client device when call was sent or sentAt value manually passed in. ReceivedAt time.Time // Time on server clock when call was received OriginalTimestamp time.Time // Time on the client device when call was invoked Timestamp time.Time // Calculated by Server to correct client-device clock skew using the following formula: receivedAt - (sentAt - originalTimestamp) // optional fields UserID *string // Unique identifier for the user in your database. A userId or an anonymousId is required. AnonymousID *string // A uniqueID substitute for a User ID, for cases when you don’t have an absolutely unique identifier. Event *string // track Name *string // page | screen GroupID *string // group PreviousID *string // alias Context *Context // Dictionary of extra information that provides useful context about a message Properties *Properties // Custom information about the event Traits *Traits // identify | group }
func (ProcessedEvent) DestinationType ¶
func (e ProcessedEvent) DestinationType() entity.DestinationType
func (ProcessedEvent) ID ¶
func (e ProcessedEvent) ID() string
type Properties ¶
type Traits ¶
type Traits struct {
CustomTraits CustomData
}
type UserAgentData ¶
type UserAgentData struct { Mobile bool Platform string Architecture string Bitness string Model string PlatformVersion string WOW64 bool Brands []AgentBrandVersion FullVersionList []AgentBrandVersion // TODO: i don't know why this exists?? }
type UserTraits ¶
type UserTraits struct { Traits ID string // Unique ID in your database for a user Industry string // Industry a user works in FirstName string LastName string Name string // Full name of a user. If you only pass a first and last name Segment automatically fills in the full name for you. PhoneNumber string Username string Title string // Title of a user, usually related to their position at a specific company. Website url.URL // User's website Address Address Age int Avatar url.URL // URL to an avatar image for the user.\ Birthday time.Time Company Company Plan string // Plan that a user is in. example(enterprise) CreatedAt time.Time Description string // Description of user, such as bio. Email string Gender string }
Click to show internal directories.
Click to hide internal directories.