Documentation
¶
Index ¶
- type Config
- type EventOptions
- type Options
- type Tracker
- func (tracker *Tracker) Event(r *http.Request, clientID uint64, eventOptions EventOptions, options Options)
- func (tracker *Tracker) ExtendSession(r *http.Request, clientID uint64, options Options)
- func (tracker *Tracker) Flush()
- func (tracker *Tracker) PageView(r *http.Request, clientID uint64, options Options)
- func (tracker *Tracker) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Store db.Store
Salt string
FingerprintKey0 uint64
FingerprintKey1 uint64
Worker int
WorkerBufferSize int
WorkerTimeout time.Duration
SessionCache session.Cache
HeaderParser []ip.HeaderParser
AllowedProxySubnets []net.IPNet
MaxPageViews uint16
GeoDB *geodb.GeoDB
IPFilter ip.Filter
Logger *log.Logger
}
Config is the configuration for the Tracker.
type EventOptions ¶
type EventOptions struct {
// Name is the name of the event (required).
Name string
// Duration is an optional duration that is used to calculate an average time on the dashboard.
Duration uint32
// Meta are optional fields used to break down the events that were send for a name.
Meta map[string]string
}
EventOptions are the options to save a new event. The name is required. All other fields are optional.
type Options ¶
type Options struct {
URL string
Hostname string
Path string
Title string
Referrer string
ScreenWidth uint16
ScreenHeight uint16
Time time.Time
}
Options are optional parameters for page views and events.
func OptionsFromRequest ¶
OptionsFromRequest returns Options for the client request.
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker tracks page views, events, and updates sessions.
func NewTracker ¶
NewTracker creates a new tracker for given client, salt and config.
func (*Tracker) Event ¶
func (tracker *Tracker) Event(r *http.Request, clientID uint64, eventOptions EventOptions, options Options)
Event tracks an event.
func (*Tracker) ExtendSession ¶
ExtendSession extends an existing session.
Click to show internal directories.
Click to hide internal directories.