contexts

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ContextAction event.ContextType = "action"
View Source
const ContextAlias event.ContextType = "alias"
View Source
const ContextApp event.ContextType = "app"
View Source
const ContextBrowser event.ContextType = "browser"
View Source
const ContextCampaign event.ContextType = "campaign"
View Source
const ContextConnectivity event.ContextType = "connectivity"
View Source
const ContextDevice event.ContextType = "device"
View Source
const ContextExtra event.ContextType = "extra"
View Source
const ContextGroup event.ContextType = "group"
View Source
const ContextLibrary event.ContextType = "library"
View Source
const ContextLocation event.ContextType = "location"
View Source
const ContextNetwork event.ContextType = "network"
View Source
const ContextOS event.ContextType = "os"
View Source
const ContextPage event.ContextType = "page"
View Source
const ContextReferrer event.ContextType = "referrer"
View Source
const ContextScreen event.ContextType = "screen"
View Source
const ContextSession event.ContextType = "session"
View Source
const ContextTiming event.ContextType = "timing"
View Source
const ContextUser event.ContextType = "user"
View Source
const ContextViewport event.ContextType = "viewport"

Variables

This section is empty.

Functions

func NewAction

func NewAction(cat, action string) event.Context

func NewAlias

func NewAlias(from, to string) event.Context

func NewApp

func NewApp(n string) event.Context

func NewBrowser

func NewBrowser(n string) event.Context

func NewDeviceContext

func NewDeviceContext(id string) event.Context

func NewOSContext

func NewOSContext(name string) event.Context

Types

type Action

type Action struct {
	Category string      `json:"category" structs:"category" mapstructure:"category"`
	Action   string      `json:"action" structs:"action" mapstructure:"action"`
	Label    string      `json:"label,omitempty" structs:"label,omitempty" mapstructure:"label,omitempty"`
	Property string      `json:"property,omitempty" structs:"property,omitempty" mapstructure:"property,omitempty"`
	Value    interface{} `json:"value,omitempty" structs:"value,omitempty" mapstructure:"value,omitempty"`
}

func (*Action) Interface

func (ctx *Action) Interface() interface{}

func (*Action) Type

func (ctx *Action) Type() event.ContextType

func (*Action) Validate

func (ctx *Action) Validate() bool

func (*Action) Values

func (ctx *Action) Values() map[string]interface{}

type Alias

type Alias struct {
	From string
	To   string
}

func (*Alias) Interface

func (ctx *Alias) Interface() interface{}

func (*Alias) Type

func (ctx *Alias) Type() event.ContextType

func (*Alias) Validate

func (ctx *Alias) Validate() bool

func (*Alias) Values

func (ctx *Alias) Values() map[string]interface{}

type App

type App struct {
	Name       string                 `json:"name" structs:"name" mapstructure:"name"`
	Version    string                 `json:"version,omitempty" structs:"version,omitempty" mapstructure:"version,omitempty"`
	Build      string                 `json:"build,omitempty" structs:"build,omitempty" mapstructure:"build,omitempty"`
	Namespace  string                 `json:"namespace,omitempty" structs:"namespace,omitempty" mapstructure:"namespace,omitempty"`
	Properties map[string]interface{} `json:"properties,omitempty" structs:"properties,omitempty" mapstructure:"properties,omitempty"`
}

func (*App) Interface

func (ctx *App) Interface() interface{}

func (*App) Type

func (ctx *App) Type() event.ContextType

func (*App) Validate

func (ctx *App) Validate() bool

func (*App) Values

func (ctx *App) Values() map[string]interface{}

type Browser

type Browser struct {
	Name      string `json:"name,omitempty" structs:"name,omitempty" mapstructure:"name,omitempty"`
	Version   string `json:"version,omitempty" structs:"version,omitempty" mapstructure:"version,omitempty"`
	UserAgent string `json:"userAgent,omitempty" structs:"userAgent,omitempty" mapstructure:"userAgent,omitempty"`
}

func (*Browser) Interface

func (ctx *Browser) Interface() interface{}

func (*Browser) Type

func (ctx *Browser) Type() event.ContextType

func (*Browser) Validate

func (ctx *Browser) Validate() bool

func (*Browser) Values

func (ctx *Browser) Values() map[string]interface{}

type Campaign

type Campaign struct {
	Name    string `json:"name" structs:"name" mapstructure:"name"`
	Source  string `json:"source,omitempty" structs:"source,omitempty" mapstructure:"source,omitempty"`
	Medium  string `json:"medium,omitempty" structs:"medium,omitempty" mapstructure:"medium,omitempty"`
	Term    string `json:"term,omitempty" structs:"term,omitempty" mapstructure:"term,omitempty"`
	Content string `json:"content,omitempty" structs:"content,omitempty" mapstructure:"content,omitempty"`
}

func (*Campaign) Interface

func (ctx *Campaign) Interface() interface{}

func (*Campaign) Type

func (ctx *Campaign) Type() event.ContextType

func (*Campaign) Validate

func (ctx *Campaign) Validate() bool

func (*Campaign) Values

func (ctx *Campaign) Values() map[string]interface{}

type Connectivity

type Connectivity struct {
	Bluetooth bool   `json:"bluetooth,omitempty" structs:"bluetooth,omitempty" mapstructure:"bluetooth,omitempty"`
	Cellular  bool   `json:"cellular,omitempty" structs:"cellular,omitempty" mapstructure:"cellular,omitempty"`
	WIFI      bool   `json:"wifi,omitempty" structs:"wifi,omitempty" mapstructure:"wifi,omitempty"`
	Ethernet  bool   `json:"ethernet,omitempty" structs:"ethernet,omitempty" mapstructure:"ethernet,omitempty"`
	Carrier   string `json:"carrier,omitempty" structs:"carrier,omitempty" mapstructure:"carrier,omitempty"`
	ISP       string `json:"isp,omitempty" structs:"isp,omitempty" mapstructure:"isp,omitempty"`
}

func (*Connectivity) Interface

func (ctx *Connectivity) Interface() interface{}

func (*Connectivity) Type

func (ctx *Connectivity) Type() event.ContextType

func (*Connectivity) Validate

func (ctx *Connectivity) Validate() bool

func (*Connectivity) Values

func (ctx *Connectivity) Values() map[string]interface{}

type Device

type Device struct {
	ID           string                 `json:"id,omitempty" structs:"id,omitempty" mapstructure:"id,omitempty"`
	Manufacturer string                 `json:"manufacturer,omitempty" structs:"manufacturer,omitempty" mapstructure:"manufacturer,omitempty"`
	Model        string                 `json:"model,omitempty" structs:"model,omitempty" mapstructure:"model,omitempty"`
	Name         string                 `json:"name,omitempty" structs:"name,omitempty" mapstructure:"name,omitempty"`
	Kind         string                 `json:"type,omitempty" structs:"type,omitempty" mapstructure:"type,omitempty"`
	Version      string                 `json:"version,omitempty" structs:"version,omitempty" mapstructure:"version,omitempty"`
	Mobile       bool                   `json:"mobile,omitempty" structs:"mobile,omitempty" mapstructure:"mobile,omitempty"`
	Tablet       bool                   `json:"tablet,omitempty" structs:"tablet,omitempty" mapstructure:"tablet,omitempty"`
	Desktop      bool                   `json:"desktop,omitempty" structs:"desktop,omitempty" mapstructure:"desktop,omitempty"`
	Properties   map[string]interface{} `json:"properties,omitempty" structs:"properties,omitempty" mapstructure:"properties,omitempty"`
}

func (*Device) Interface

func (ctx *Device) Interface() interface{}

func (*Device) Type

func (ctx *Device) Type() event.ContextType

func (*Device) Validate

func (ctx *Device) Validate() bool

func (*Device) Values

func (ctx *Device) Values() map[string]interface{}

type Extra

type Extra map[string]interface{}

func (*Extra) Interface

func (ctx *Extra) Interface() interface{}

func (*Extra) Type

func (ctx *Extra) Type() event.ContextType

func (*Extra) Validate

func (ctx *Extra) Validate() bool

func (*Extra) Values

func (ctx *Extra) Values() map[string]interface{}

type Group

type Group struct {
	ID   string `json:"id,omitempty" structs:"id,omitempty" mapstructure:"id,omitempty"`
	Name string `json:"name,omitempty" structs:"name,omitempty" mapstructure:"name,omitempty"`
}

func (*Group) Interface

func (ctx *Group) Interface() interface{}

func (*Group) Type

func (ctx *Group) Type() event.ContextType

func (*Group) Validate

func (ctx *Group) Validate() bool

func (*Group) Values

func (ctx *Group) Values() map[string]interface{}

type Library

type Library struct {
	Name    string `json:"name" structs:"name" mapstructure:"name"`
	Version string `json:"version,omitempty" structs:"version,omitempty" mapstructure:"version,omitempty"`
}

func (*Library) Interface

func (ctx *Library) Interface() interface{}

func (*Library) Type

func (ctx *Library) Type() event.ContextType

func (*Library) Validate

func (ctx *Library) Validate() bool

func (*Library) Values

func (ctx *Library) Values() map[string]interface{}

type Location

type Location struct {
	Street     string  `json:"street,omitempty" structs:"street,omitempty" mapstructure:"street,omitempty"`
	City       string  `json:"city,omitempty" structs:"city,omitempty" mapstructure:"city,omitempty"`
	State      string  `json:"state,omitempty" structs:"state,omitempty" mapstructure:"state,omitempty"`
	PostalCode string  `json:"postalCode,omitempty" structs:"postalCode,omitempty" mapstructure:"postalCode,omitempty"`
	Region     string  `json:"region,omitempty" structs:"region,omitempty" mapstructure:"region,omitempty"`
	Locale     string  `json:"locale,omitempty" structs:"locale,omitempty" mapstructure:"locale,omitempty"`
	Country    string  `json:"country,omitempty" structs:"country,omitempty" mapstructure:"country,omitempty"`
	Longitude  float64 `json:"longitude,omitempty" structs:"longitude,omitempty" mapstructure:"longitude,omitempty"`
	Latitude   float64 `json:"latitude,omitempty" structs:"latitude,omitempty" mapstructure:"latitude,omitempty"`
	Timezone   string  `json:"timezone,omitempty" structs:"timezone,omitempty" mapstructure:"timezone,omitempty"`
}

func (*Location) Interface

func (ctx *Location) Interface() interface{}

func (*Location) Type

func (ctx *Location) Type() event.ContextType

func (*Location) Validate

func (ctx *Location) Validate() bool

func (*Location) Values

func (ctx *Location) Values() map[string]interface{}

type Network

type Network struct {
	IP        net.IP `json:"ip,omitempty" structs:"ip,omitempty" mapstructure:"ip,omitempty"`
	UserAgent string `json:"userAgent,omitempty" structs:"userAgent,omitempty" mapstructure:"userAgent,omitempty"`
}

func NewNetwork

func NewNetwork(ip string) *Network

func (*Network) Interface

func (ctx *Network) Interface() interface{}

func (*Network) MarshalJSON

func (ctx *Network) MarshalJSON() ([]byte, error)

func (*Network) Type

func (ctx *Network) Type() event.ContextType

func (*Network) UnmarshalJSON

func (ctx *Network) UnmarshalJSON(b []byte) error

func (*Network) Validate

func (ctx *Network) Validate() bool

func (*Network) Values

func (ctx *Network) Values() map[string]interface{}

type OS

type OS struct {
	Name     string `json:"name" structs:"name" mapstructure:"name"`
	Family   string `json:"family,omitempty" structs:"family,omitempty" mapstructure:"family,omitempty"`
	Platform string `json:"platform,omitempty" structs:"platform,omitempty" mapstructure:"platform,omitempty"`
	Version  string `json:"version,omitempty" structs:"version,omitempty" mapstructure:"version,omitempty"`
}

func (*OS) Interface

func (ctx *OS) Interface() interface{}

func (*OS) Type

func (ctx *OS) Type() event.ContextType

func (*OS) Validate

func (ctx *OS) Validate() bool

func (*OS) Values

func (ctx *OS) Values() map[string]interface{}

type Page

type Page struct {
	Hash     string `json:"hash,omitempty" structs:"hash,omitempty" mapstructure:"hash,omitempty"`
	Path     string `json:"path,omitempty" structs:"path,omitempty" mapstructure:"path,omitempty"`
	Referrer string `json:"referrer,omitempty" structs:"referrer,omitempty" mapstructure:"referrer,omitempty"`
	Search   string `json:"search,omitempty" structs:"search,omitempty" mapstructure:"search,omitempty"`
	Title    string `json:"title,omitempty" structs:"title,omitempty" mapstructure:"title,omitempty"`
	Hostname string `json:"hostname" structs:"hostname" mapstructure:"hostname"`
}

func (*Page) Interface

func (ctx *Page) Interface() interface{}

func (*Page) Type

func (ctx *Page) Type() event.ContextType

func (*Page) Validate

func (ctx *Page) Validate() bool

func (*Page) Values

func (ctx *Page) Values() map[string]interface{}

type Referrer

type Referrer struct {
	RefType  string `json:"type,omitempty" structs:"type,omitempty" mapstructure:"type,omitempty"`
	Name     string `json:"name,omitempty" structs:"name,omitempty" mapstructure:"name,omitempty"`
	Hostname string `json:"hostname,omitempty" structs:"hostname,omitempty" mapstructure:"hostname,omitempty"`
	Link     string `json:"link,omitempty" structs:"link,omitempty" mapstructure:"link,omitempty"`
}

func (*Referrer) Interface

func (ctx *Referrer) Interface() interface{}

func (*Referrer) Type

func (ctx *Referrer) Type() event.ContextType

func (*Referrer) Validate

func (ctx *Referrer) Validate() bool

func (*Referrer) Values

func (ctx *Referrer) Values() map[string]interface{}

type Screen

type Screen struct {
	Name     string `json:"name" structs:"name" mapstructure:"name"`
	Category string `json:"category,omitempty" structs:"category,omitempty" mapstructure:"category,omitempty"`
}

func (*Screen) Interface

func (ctx *Screen) Interface() interface{}

func (*Screen) Type

func (ctx *Screen) Type() event.ContextType

func (*Screen) Validate

func (ctx *Screen) Validate() bool

func (*Screen) Values

func (ctx *Screen) Values() map[string]interface{}

type Session

type Session struct {
	ID string `json:"id" structs:"id" mapstructure:"id"`
}

func (*Session) Interface

func (ctx *Session) Interface() interface{}

func (*Session) Type

func (ctx *Session) Type() event.ContextType

func (*Session) Validate

func (ctx *Session) Validate() bool

func (*Session) Values

func (ctx *Session) Values() map[string]interface{}

type Timing

type Timing struct {
	Category string  `json:"category,omitempty" structs:"category,omitempty" mapstructure:"category,omitempty"`
	Label    string  `json:"label,omitempty" structs:"label,omitempty" mapstructure:"label,omitempty"`
	Unit     string  `json:"unit,omitempty" structs:"unit,omitempty" mapstructure:"unit,omitempty"`
	Variable string  `json:"variable,omitempty" structs:"variable,omitempty" mapstructure:"variable,omitempty"`
	Value    float64 `json:"value,omitempty" structs:"value,omitempty" mapstructure:"value,omitempty"`
}

func (*Timing) Interface

func (ctx *Timing) Interface() interface{}

func (*Timing) Type

func (ctx *Timing) Type() event.ContextType

func (*Timing) Validate

func (ctx *Timing) Validate() bool

func (*Timing) Values

func (ctx *Timing) Values() map[string]interface{}

type Traits

type Traits struct {
	Age         int                    `json:"age,omitempty" structs:"age,omitempty" mapstructure:"age,omitempty"`
	Birthday    string                 `json:"birthday,omitempty" structs:"birthday,omitempty" mapstructure:"birthday,omitempty"`
	Description string                 `json:"description,omitempty" structs:"description,omitempty" mapstructure:"description,omitempty"`
	Email       string                 `json:"email,omitempty" structs:"email,omitempty" mapstructure:"email,omitempty"`
	FirstName   string                 `json:"firstName,omitempty" structs:"firstName,omitempty" mapstructure:"firstName,omitempty"`
	LastName    string                 `json:"lastName,omitempty" structs:"lastName,omitempty" mapstructure:"lastName,omitempty"`
	Gender      string                 `json:"gender,omitempty" structs:"gender,omitempty" mapstructure:"gender,omitempty"`
	Phone       string                 `json:"phone,omitempty" structs:"phone,omitempty" mapstructure:"phone,omitempty"`
	Title       string                 `json:"title,omitempty" structs:"title,omitempty" mapstructure:"title,omitempty"`
	Username    string                 `json:"username,omitempty" structs:"username,omitempty" mapstructure:"username,omitempty"`
	Website     string                 `json:"website,omitempty" structs:"website,omitempty" mapstructure:"website,omitempty"`
	Extra       map[string]interface{} `json:"extra,omitempty" structs:"extra,omitempty" mapstructure:"extra,omitempty"`
}

type User

type User struct {
	UserID string `json:"userID" structs:"userID" mapstructure:"userID"`
	AnonID string `json:"anonID" structs:"anonID" mapstructure:"anonID"`
	Name   string `json:"name,omitempty" structs:"name,omitempty" mapstructure:"name,omitempty"`
	Traits Traits `json:"traits,omitempty" structs:"traits,omitempty" mapstructure:"traits,omitempty"`
}

func (*User) Interface

func (ctx *User) Interface() interface{}

func (*User) Type

func (ctx *User) Type() event.ContextType

func (*User) Validate

func (ctx *User) Validate() bool

func (*User) Values

func (ctx *User) Values() map[string]interface{}

type Viewport

type Viewport struct {
	Density int `json:"density,omitempty" structs:"density,omitempty" mapstructure:"density,omitempty"`
	Width   int `json:"width,omitempty" structs:"width,omitempty" mapstructure:"width,omitempty"`
	Height  int `json:"height,omitempty" structs:"height,omitempty" mapstructure:"height,omitempty"`
}

func (*Viewport) Interface

func (ctx *Viewport) Interface() interface{}

func (*Viewport) Type

func (ctx *Viewport) Type() event.ContextType

func (*Viewport) Validate

func (ctx *Viewport) Validate() bool

func (*Viewport) Values

func (ctx *Viewport) Values() map[string]interface{}

Jump to

Keyboard shortcuts

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