data

package
v0.0.0-...-3f61646 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2019 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

Close the kafka collector.

func Collect

func Collect(ctx echo.Context, event string, extra map[string]string) error

Collect send events to kafka.

func CollectUserEvent

func CollectUserEvent(ctx echo.Context, event string, resourceType string, resourceID string, extra map[string]string) error

CollectUserEvent send user events to kafka.

func Collector

func Collector() ec.EventCollector

Collector returns the event collector.

func Init

func Init(config *ec.Config)

Init initializes the event collector.

Types

type Payload

type Payload struct {
	Timestamp int64             `json:"timestamp"`
	Event     string            `json:"event"`
	Extra     map[string]string `json:"extra"`
}

Payload wraps the event message.

type UserEventPayload

type UserEventPayload struct {
	AppType        string            `json:"app_type"`
	AppName        string            `json:"app_name"`
	AppID          string            `json:"app_id"`
	Backend        string            `json:"backend"`
	AppVersion     string            `json:"app_version"`
	Time           int64             `json:"time"`
	IP             string            `json:"ip"`
	Environment    string            `json:"environment"`
	Referer        string            `json:"referer"`
	UID            int64             `json:"uid"`
	Event          string            `json:"event"`
	OSName         string            `json:"os_name"`
	OSVersion      string            `json:"os_version"`
	Resolution     string            `json:"resolution"`
	ConnectionType string            `json:"connection_type"`
	DeviceBrand    string            `json:"device_brand"`
	DeviceModel    string            `json:"device_model"`
	DeviceID       string            `json:"device_id"`
	LegacyDeviceID string            `json:"legacy_device_id"`
	Carrier        string            `json:"carrier"`
	Locale         string            `json:"locale"`
	Orientation    string            `json:"orientation"`
	ResourceType   string            `json:"resource_type"`
	ResourceID     string            `json:"resource_id"`
	Extra          map[string]string `json:"extra"`
}

UserEventPayload wraps the user event message.

Jump to

Keyboard shortcuts

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