Documentation
¶
Overview ¶
Package hits provides functionality for handling and processing tracking hits
Index ¶
Constants ¶
View Source
const HitProcessingTaskName = "process-hits"
HitProcessingTaskName is the name of the task used for processing hits
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientID ¶
type ClientID string
ClientID represents an ID stored client-side. Be it cookie or device ID.
type Hit ¶
type Hit struct {
// Random UUID of every hit.
ID string `cbor:"i"`
// AuthoritativeClientID is the ID of first hit of a proto-session the current hit belongs to.
// In normal cases this will be the same as ClientID, but if for example another client ID
// will be mappend by a session stamp, the AuthoritativeClientID will change to the ClientID of the hit
// that claimed the session stamp.
// This ID should not be used for reporting and is only internal detail of the tracker.
AuthoritativeClientID ClientID `cbor:"ai"`
ClientID ClientID `cbor:"ci"`
EventName string `cbor:"en"`
// PropertyID uses GA nomenclature. In other than GA protocols, it holds the analogous concept, like app, website, etc
PropertyID string `cbor:"pi"`
UserID *string `cbor:"uid"`
Metadata map[string]string `cbor:"md"`
Request *ParsedRequest `cbor:"sa"`
}
Hit stores information about a single `/collect` endpoint call
func NewWithServerAttributes ¶ added in v0.18.0
func NewWithServerAttributes(serverAttributes *ParsedRequest) *Hit
NewWithServerAttributes creates a new Hit with the given ServerAttributes
func (*Hit) MustParsedRequest ¶ added in v0.18.0
func (h *Hit) MustParsedRequest() *ParsedRequest
type HitProcessingTask ¶
type HitProcessingTask struct {
Hits []*Hit `cbor:"h"`
}
HitProcessingTask represents a task containing a batch of hits to be processed
type ParsedRequest ¶ added in v0.18.0
type ParsedRequest struct {
IP string `cbor:"ip"`
Host string `cbor:"h"`
ServerReceivedTime time.Time `cbor:"srt"`
QueryParams url.Values `cbor:"qp"`
Body []byte `cbor:"bd"`
Path string `cbor:"p"`
Method string `cbor:"m"`
Headers http.Header `cbor:"he"`
}
func (*ParsedRequest) Clone ¶ added in v0.18.0
func (s *ParsedRequest) Clone() *ParsedRequest
Click to show internal directories.
Click to hide internal directories.