Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Headers = struct { Accept string ContentType string }{ Accept: "Accept", ContentType: "Content-Type", } MimeTypes = struct { TextPlain string ApplicationJSON string XWWWFormURLEncoded string }{ TextPlain: "text/plain", ApplicationJSON: "application/json", XWWWFormURLEncoded: "application/x-www-form-urlencoded", } )
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { EventsAPI }
API is a collection of simple methods to interact with the mixpanel API.
type ApiUrlOption ¶
type ApiUrlOption struct {
// contains filtered or unexported fields
}
func (ApiUrlOption) Apply ¶
func (o ApiUrlOption) Apply(c *Config)
type Config ¶
type Config struct { ApiUrl string Token string ServiceAccount *ServiceAccount ProjectID string }
type Event ¶
type Event struct { // Name of the event being tracked. Name string // DistinctID of the entity that produced this event. (usually a user) DistinctID string // InsertID is a unique identifier for the event, used for duplication. Leave blank to have one generated. InsertID string // IPV4Address of the user when they created the event. Only provide one of IPV4Address or Location. IPV4Address *string // Location is an optional field to specify where this event occurred. Only provide one of IPV4Address or Location. Location *EventLocation // Time the event occurred. Set to nil to use the current time. Time *time.Time // CustomProperties that wished to be tracked as fields of the event CustomProperties map[string]interface{} }
Event A mixpanel event
type EventLocation ¶
type MockClient ¶
type MockClient struct {
// contains filtered or unexported fields
}
MockClient Mocked version of Mixpanel intended for unit tests only
func NewMockClient ¶
func NewMockClient() *MockClient
func (*MockClient) Import ¶
func (m *MockClient) Import(es []Event) error
func (*MockClient) String ¶
func (m *MockClient) String() string
func (*MockClient) Track ¶
func (m *MockClient) Track(e Event) error
type Option ¶
type Option interface {
Apply(*Config)
}
func WithApiUrl ¶
func WithProjectID ¶
func WithServiceAccount ¶
type ProjectIDOption ¶
type ProjectIDOption struct {
// contains filtered or unexported fields
}
func (ProjectIDOption) Apply ¶
func (o ProjectIDOption) Apply(c *Config)
type SecretOption ¶
type SecretOption struct {
// contains filtered or unexported fields
}
func (SecretOption) Apply ¶
func (o SecretOption) Apply(c *Config)
type ServiceAccount ¶
type TokenOption ¶
type TokenOption struct {
// contains filtered or unexported fields
}
func (TokenOption) Apply ¶
func (o TokenOption) Apply(c *Config)
Click to show internal directories.
Click to hide internal directories.