Documentation
¶
Overview ¶
Package heapanalytics provides a go client for the heap analytics server-side API. See https://heapanalytics.com for more details
Index ¶
Constants ¶
View Source
const ( // DefaultHost is the default host to use DefaultURL = "https://heapanalytics.com" //DefaultPathTrack is the default path to use for track events DefaultPathTrack = "/api/track" //DefaultPathUserProperties is the default path to use for add user properties DefaultPathUserProperties = "/api/add_user_properties" //ContentType is the type of data to send the API ContentType = "application/json" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a client for the heap API
func NewClient ¶
func NewClient(appID string, options ...ClientOption) *Client
NewClient returns a pointer to a new API client
func (*Client) AddUserProperties ¶
Identify posts an API request to the "add user properties" API
type ClientOption ¶
type ClientOption func(*Client)
ClientOption defines the format of an optional parameter for NewClient
func HttpClient ¶
func HttpClient(client *http.Client) ClientOption
HttpClient is a ClientOption that can be passed into NewClient to change the httpclient used from default
func URL ¶
func URL(url string) ClientOption
Host is an ClientOption that can be passed into NewClient to change the hostname from default
type Event ¶
type Event struct { AppID string `json:"app_id"` Identity string `json:"identity"` Event string `json:"event,omitempty"` // properties is an interface as it could be a string or int Properties map[string]interface{} `json:"properties,omitempty"` }
Event represents an individual heap event that can be sent to the heap API
Click to show internal directories.
Click to hide internal directories.