Documentation ¶
Overview ¶
Package ec is an interface for event tracker
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveAppInfo ¶
ResolveAppInfo resolves appID into package id and app type
Types ¶
type Config ¶
type Config struct { Enabled bool `yaml:"enabled" json:"enabled"` Type string `yaml:"type" json:"type"` Addrs []string `yaml:"addrs" json:"addrs"` Topic string `yaml:"topic" json:"topic"` Encoding string `yaml:"encoding" json:"encoding"` Compression string `yaml:"compression" json:"compression"` }
Config sets event collector.
type ConfigType ¶
type ConfigType int
ConfigType represents the event collector's type.
const ( // KafkaConfig is kafka configuration. KafkaConfig ConfigType = iota )
type EventCollector ¶
type EventCollector interface { Collect(*Event) error CollectByTopic(string, *Event) error Close() error }
EventCollector collects the event message.
type Options ¶
type Options struct { // Addrs stores the collector's addresses, like kafka server `127.0.0.1:9092`. Addrs []string // Topic represents the collector's topic to receive event, like kafka server, optional. Topic string // Other options for implementations of the interface // can be stored in a context Context context.Context }
Options configures the event collector.
type TrackInfoHeader ¶
type TrackInfoHeader struct { AppID string `json:"appId"` AppVersion string `json:"appVersion"` ConnectionType string `json:"connectionType"` Locale string `json:"locale"` Carrier string `json:"carrier"` DeviceBrand string `json:"deviceBrand"` DeviceModel string `json:"deviceModel"` OSName string `json:"osName"` OSVersion string `json:"osVersion"` Resolution string `json:"resolution"` Orientation string `json:"orientation"` }
TrackInfoHeader includes the device info
func GetTrackInfo ¶
func GetTrackInfo(req *http.Request) *TrackInfoHeader
GetTrackInfo extracts the device track info from header
Click to show internal directories.
Click to hide internal directories.