Documentation ¶
Index ¶
- Constants
- type BeforePlugin
- type Config
- type DestinationPlugin
- type EnrichmentPlugin
- type Event
- type EventOptions
- type EventStorage
- type ExecuteResult
- type ExtendedDestinationPlugin
- type Identify
- func (i *Identify) Add(property string, value interface{}) *Identify
- func (i *Identify) Append(property string, value interface{}) *Identify
- func (i *Identify) ClearAll() *Identify
- func (i *Identify) PostInsert(property string, value interface{}) *Identify
- func (i *Identify) PreInsert(property string, value interface{}) *Identify
- func (i *Identify) Prepend(property string, value interface{}) *Identify
- func (i *Identify) Remove(property string, value interface{}) *Identify
- func (i *Identify) Set(property string, value interface{}) *Identify
- func (i *Identify) SetOnce(property string, value interface{}) *Identify
- func (i *Identify) Unset(property string) *Identify
- func (i *Identify) Validate() ([]string, []string)
- type IdentityOp
- type IngestionMetadata
- type Logger
- type Plan
- type Plugin
- type PluginType
- type Revenue
- type ServerZone
- type StorageEvent
Constants ¶
const ( IdentityOpAdd IdentityOp = "$add" IdentityOpAppend IdentityOp = "$append" IdentityOpClearAll IdentityOp = "$clearAll" IdentityOpPrepend IdentityOp = "$prepend" IdentityOpSet IdentityOp = "$set" IdentityOpSetOnce IdentityOp = "$setOnce" IdentityOpUnset IdentityOp = "$unset" IdentityOpPreInsert IdentityOp = "$preInsert" IdentityOpPostInsert IdentityOp = "$postInsert" IdentityOpRemove IdentityOp = "$remove" UnsetValue string = "-" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BeforePlugin ¶ added in v0.0.6
type Config ¶
type Config struct { APIKey string FlushInterval time.Duration FlushQueueSize int FlushSizeDivider int FlushMaxRetries int Logger Logger MinIDLength int ExecuteCallback func(result ExecuteResult) ServerZone ServerZone UseBatch bool StorageFactory func() EventStorage OptOut bool Plan *Plan IngestionMetadata *IngestionMetadata ServerURL string ConnectionTimeout time.Duration MaxStorageCapacity int RetryBaseInterval time.Duration RetryThrottledInterval time.Duration }
type DestinationPlugin ¶
type EnrichmentPlugin ¶
type Event ¶
type Event struct { EventType string `json:"event_type"` EventOptions EventProperties map[string]interface{} `json:"event_properties,omitempty"` UserProperties map[IdentityOp]map[string]interface{} `json:"user_properties,omitempty"` Groups map[string][]string `json:"groups,omitempty"` GroupProperties map[IdentityOp]map[string]interface{} `json:"group_properties,omitempty"` // UserID is a user identifier. The value is ignored if EventOptions.UserID is set. UserID string `json:"-"` // DeviceID is a device-specific identifier. The value is ignored if EventOptions.DeviceID is set. DeviceID string `json:"-"` }
type EventOptions ¶
type EventOptions struct { UserID string `json:"user_id,omitempty"` DeviceID string `json:"device_id,omitempty"` Time int64 `json:"time,omitempty"` InsertID string `json:"insert_id,omitempty"` Library string `json:"library,omitempty"` LocationLat float64 `json:"location_lat,omitempty"` LocationLng float64 `json:"location_lng,omitempty"` AppVersion string `json:"app_version,omitempty"` VersionName string `json:"version_name,omitempty"` Platform string `json:"platform,omitempty"` OSName string `json:"os_name,omitempty"` OSVersion string `json:"os_version,omitempty"` DeviceBrand string `json:"device_brand,omitempty"` DeviceManufacturer string `json:"device_manufacturer,omitempty"` DeviceModel string `json:"device_model,omitempty"` Carrier string `json:"carrier,omitempty"` Country string `json:"country,omitempty"` Region string `json:"region,omitempty"` City string `json:"city,omitempty"` DMA string `json:"dma,omitempty"` IDFA string `json:"idfa,omitempty"` IDFV string `json:"idfv,omitempty"` ADID string `json:"adid,omitempty"` AndroidID string `json:"android_id,omitempty"` Language string `json:"language,omitempty"` IP string `json:"ip,omitempty"` Price float64 `json:"price,omitempty"` Quantity int `json:"quantity,omitempty"` Revenue float64 `json:"revenue,omitempty"` ProductID string `json:"productId,omitempty"` RevenueType string `json:"revenueType,omitempty"` EventID int `json:"event_id,omitempty"` SessionID int `json:"session_id,omitempty"` PartnerID string `json:"partner_id,omitempty"` Plan *Plan `json:"plan,omitempty"` IngestionMetadata *IngestionMetadata `json:"ingestion_metadata,omitempty"` }
func (*EventOptions) Clone ¶ added in v0.0.13
func (eo *EventOptions) Clone() *EventOptions
func (*EventOptions) SetTime ¶
func (eo *EventOptions) SetTime(time time.Time)
type EventStorage ¶
type EventStorage interface { PushNew(event *StorageEvent) ReturnBack(events ...*StorageEvent) Pull(count int, before time.Time) []*StorageEvent Count(before time.Time) int }
type ExecuteResult ¶ added in v0.0.5
type ExtendedDestinationPlugin ¶
type ExtendedDestinationPlugin interface { DestinationPlugin Flush() Shutdown() }
type Identify ¶
type Identify struct { PropertiesSet map[string]struct{} Properties map[IdentityOp]map[string]interface{} // contains filtered or unexported fields }
func (*Identify) Add ¶
Add increments a user property by some numerical value. If the user property does not have a value set yet, it will be initialized to 0 before being incremented.
func (*Identify) Append ¶
Append appends a value or values to a user property array. If the user property does not have a value set yet, it will be initialized to an empty list before the new values are prepended.
func (*Identify) PostInsert ¶
PostInsert post-inserts a value or values to a user property, if it does not exist in the user property yet. Post-insert means inserting the value(s) at the end of a given list. If the user property does not have a value set yet, it will be initialized to an empty list before the new values are post-inserted. If the user property has an existing value, it will be no operation.
func (*Identify) PreInsert ¶
PreInsert pre-inserts a value or values to a user property, if it does not exist in the user property yet. Pre-insert means inserting the value(s) at the beginning of a given list. If the user property does not have a value set yet, it will be initialized to an empty list before the new values are pre-inserted. If the user property has an existing value, it will be no operation.
func (*Identify) Prepend ¶
Prepend prepends a value or values to a user property array. If the user property does not have a value set yet, it will be initialized to an empty list before the new values are prepended.
func (*Identify) Remove ¶
Remove removes a value or values to a user property, if it exists in the user property. Remove means remove the existing value(s) from the given list. If the item does not exist in the user property, it will be no operation.
func (*Identify) SetOnce ¶
SetOnce sets the value of user property only once. Subsequent calls using SetOnce will be ignored.
type IdentityOp ¶
type IdentityOp string
type IngestionMetadata ¶ added in v0.0.9
type Plugin ¶
type Plugin interface { Name() string Type() PluginType Setup(config Config) }
type PluginType ¶
type PluginType int
const ( PluginTypeBefore PluginType = iota PluginTypeEnrichment PluginTypeDestination )
type Revenue ¶
type ServerZone ¶
type ServerZone string
const ( ServerZoneUS ServerZone = "US" ServerZoneEU ServerZone = "EU" )