Versions in this module Expand all Collapse all v2 v2.0.1 Feb 20, 2024 Changes in this version + const DATE_FORMAT + const DefaultBatchSize + const DefaultCacheCapacity + const DefaultInterval + const DefaultTimeOut + const KEY_PATTERN + const LibName + const MaxBatchSize + const SDK_LOG_PREFIX + const SdkVersion + const Track + const TrackOverwrite + const TrackUpdate + const UserAdd + const UserAppend + const UserDel + const UserSet + const UserSetOnce + const UserUniqAppend + const UserUnset + func SetCustomLogger(logger TDLogger) + func SetLogLevel(level TDLogLevel) + func SetLoggerConfig(config LoggerConfig) + type Consumer interface + type Data struct + AccountId string + AppId string + DistinctId string + EventId string + EventName string + FirstCheckId string + Ip string + IsComplex bool + Properties map[string]interface{} + Time string + Type string + UUID string + type LogConfig struct + type LogConsumer struct + type LogType int32 + const LoggerTypeOff + const LoggerTypePrint + const LoggerTypePrintAndWriteFile + const LoggerTypeWriteFile + type LoggerConfig struct + Path string + Type LogType + type RotateMode int32 + const DefaultChannelSize + const ROTATE_DAILY + const ROTATE_HOURLY + type TDAnalytics struct + func New(c TDConsumer) TDAnalytics + func (ta *TDAnalytics) ClearSuperProperties() + func (ta *TDAnalytics) Close() error + func (ta *TDAnalytics) Flush() error + func (ta *TDAnalytics) GetDynamicSuperProperties() map[string]interface{} + func (ta *TDAnalytics) GetSuperProperties() map[string]interface{} + func (ta *TDAnalytics) SetDynamicSuperProperties(action func() map[string]interface{}) + func (ta *TDAnalytics) SetSuperProperties(superProperties map[string]interface{}) + func (ta *TDAnalytics) Track(accountId, distinctId, eventName string, properties map[string]interface{}) error + func (ta *TDAnalytics) TrackFirst(accountId, distinctId, eventName, firstCheckId string, ...) error + func (ta *TDAnalytics) TrackOverwrite(accountId, distinctId, eventName, eventId string, ...) error + func (ta *TDAnalytics) TrackUpdate(accountId, distinctId, eventName, eventId string, ...) error + func (ta *TDAnalytics) UserAdd(accountId string, distinctId string, properties map[string]interface{}) error + func (ta *TDAnalytics) UserAppend(accountId string, distinctId string, properties map[string]interface{}) error + func (ta *TDAnalytics) UserDelete(accountId string, distinctId string) error + func (ta *TDAnalytics) UserSet(accountId string, distinctId string, properties map[string]interface{}) error + func (ta *TDAnalytics) UserSetOnce(accountId string, distinctId string, properties map[string]interface{}) error + func (ta *TDAnalytics) UserUniqAppend(accountId string, distinctId string, properties map[string]interface{}) error + func (ta *TDAnalytics) UserUnset(accountId string, distinctId string, s []string) error + type TDBatchConfig struct + AppId string + AutoFlush bool + BatchSize int + CacheCapacity int + Compress bool + Interval int + ServerUrl string + Timeout int + type TDBatchConsumer struct + func (c *TDBatchConsumer) Add(d Data) error + func (c *TDBatchConsumer) Close() error + func (c *TDBatchConsumer) Flush() error + func (c *TDBatchConsumer) FlushAll() error + func (c *TDBatchConsumer) IsStringent() bool + type TDConsumer interface + Add func(d Data) error + Close func() error + Flush func() error + IsStringent func() bool + func NewBatchConsumer(serverUrl string, appId string) (TDConsumer, error) + func NewBatchConsumerWithBatchSize(serverUrl string, appId string, batchSize int) (TDConsumer, error) + func NewBatchConsumerWithCompress(serverUrl string, appId string, compress bool) (TDConsumer, error) + func NewBatchConsumerWithConfig(config TDBatchConfig) (TDConsumer, error) + func NewDebugConsumer(serverUrl string, appId string) (TDConsumer, error) + func NewDebugConsumerWithDeviceId(serverUrl string, appId string, writeData bool, deviceId string) (TDConsumer, error) + func NewDebugConsumerWithWriter(serverUrl string, appId string, writeData bool) (TDConsumer, error) + func NewLogConsumer(directory string, r RotateMode) (TDConsumer, error) + func NewLogConsumerWithConfig(config TDLogConsumerConfig) (TDConsumer, error) + func NewLogConsumerWithFileSize(directory string, r RotateMode, size int) (TDConsumer, error) + type TDDebugConsumer struct + func (c *TDDebugConsumer) Add(d Data) error + func (c *TDDebugConsumer) Close() error + func (c *TDDebugConsumer) Flush() error + func (c *TDDebugConsumer) IsStringent() bool + type TDLogConsumer struct + func (c *TDLogConsumer) Add(d Data) error + func (c *TDLogConsumer) Close() error + func (c *TDLogConsumer) Flush() error + func (c *TDLogConsumer) IsStringent() bool + type TDLogConsumerConfig struct + ChannelSize int + Directory string + FileNamePrefix string + FileSize int + RotateMode RotateMode + type TDLogLevel int32 + const TDLogLevelDebug + const TDLogLevelError + const TDLogLevelInfo + const TDLogLevelOff + const TDLogLevelWarning + type TDLogger interface + Print func(message string)