tracking

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	EnableTracking bool   `json:"enableTracking"` // 是否开启跟踪 默认不开启
	Dsn            string `json:"dsn"`            // 数据库连接地址
	MaxOpen        int    `json:"maxOpen"`        // 数据库最大连接数
	GeoCity        string `json:"geoCity"`        // GeoCity2 city 数据库地址
}

type Tracker

type Tracker struct {
	IsCanTracker bool
	// contains filtered or unexported fields
}

func NewTracker

func NewTracker(VisitorId model.Vid) *Tracker

func (*Tracker) Action

func (this *Tracker) Action(group, name string, data ...interface{}) *Tracker

func (*Tracker) App

func (this *Tracker) App(appName, appVersion string) *Tracker

func (*Tracker) Begin

func (this *Tracker) Begin() *Tracker

func (*Tracker) Channel

func (this *Tracker) Channel(channelName string) *Tracker

func (*Tracker) CustomData added in v1.0.5

func (this *Tracker) CustomData(data ...interface{}) *Tracker

func (*Tracker) Device

func (this *Tracker) Device(id, os, osVersion, brand string) *Tracker

func (*Tracker) End

func (this *Tracker) End()

func (*Tracker) Event

func (this *Tracker) Event(name string, data ...interface{}) *Tracker

func (*Tracker) Ip

func (this *Tracker) Ip(ip string) *Tracker

func (*Tracker) Page

func (this *Tracker) Page(pageName string, data ...interface{}) *Tracker

func (*Tracker) SetFirstVisitTime

func (this *Tracker) SetFirstVisitTime(tm time.Time) *Tracker

type Tracking

type Tracking struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func Track

func Track() *Tracking

func (*Tracking) Config

func (this *Tracking) Config(config *Config) *Tracking

*

稍微封装下。

func (*Tracking) DisableTracking

func (this *Tracking) DisableTracking() *Tracking

func (*Tracking) EnableTracking

func (this *Tracking) EnableTracking() *Tracking

func (*Tracking) ExitVisitor

func (this *Tracking) ExitVisitor(visitorId int64)

func (*Tracking) Init

func (this *Tracking) Init()

*

关注配置。

func (*Tracking) Stop

func (this *Tracking) Stop()

*

func (*Tracking) Visitor

func (this *Tracking) Visitor(visitorId int64) *Tracker

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL