Documentation ¶
Index ¶
- Constants
- type Client
- type ClientInterface
- type Configuration
- type Event
- type StatusMessageRes
- type UserClient
- func (c *UserClient) ClickedFilters(eventName string, indexName string, filters []string, opts ...interface{}) (res StatusMessageRes, err error)
- func (c *UserClient) ClickedObjectIDs(eventName string, indexName string, objectIDs []string, opts ...interface{}) (StatusMessageRes, error)
- func (c *UserClient) ClickedObjectIDsAfterSearch(eventName string, indexName string, objectIDs []string, positions []int, ...) (StatusMessageRes, error)
- func (c *UserClient) ConvertedFilters(eventName string, indexName string, filters []string, opts ...interface{}) (StatusMessageRes, error)
- func (c *UserClient) ConvertedObjectIDs(eventName string, indexName string, objectIDs []string, opts ...interface{}) (StatusMessageRes, error)
- func (c *UserClient) ConvertedObjectIDsAfterSearch(eventName string, indexName string, objectIDs []string, queryID string, ...) (StatusMessageRes, error)
- func (c *UserClient) ViewedFilters(eventName string, indexName string, filters []string, opts ...interface{}) (StatusMessageRes, error)
- func (c *UserClient) ViewedObjectIDs(eventName string, indexName string, objectIDs []string, opts ...interface{}) (StatusMessageRes, error)
- type UserClientInterface
Constants ¶
const ( EventTypeClick = "click" EventTypeConversion = "conversion" EventTypeView = "view" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides methods to interact with the Algolia Insights API.
func NewClient ¶
NewClient instantiates a new client able to interact with the Algolia Insights API.
func NewClientWithConfig ¶
func NewClientWithConfig(config Configuration) *Client
NewClientWithConfig instantiates a new client able to interact with the Algolia Insights API.
func (*Client) SendEvent ¶
func (c *Client) SendEvent(event Event, opts ...interface{}) (res StatusMessageRes, err error)
SendEvent sends a new raw event to the Algolia Insights API. This method should only be used to send a custom event to the API. To send more common and predefined events, please use methods from UserClient instead.
func (*Client) SendEvents ¶
func (c *Client) SendEvents(events []Event, opts ...interface{}) (res StatusMessageRes, err error)
SendEvents sends new raw events to the Algolia Insights API. This method should only be used to send custom events to the API. To send more common and predefined events, please use methods from UserClient instead.
func (*Client) User ¶
func (c *Client) User(userToken string) *UserClient
User instantiates a new client able to interact with the Algolia Insights API where all events will be sent with the userToken field preset according to the given userToken.
type ClientInterface ¶
type ClientInterface interface { User(userToken string) *UserClient SendEvent(event Event, opts ...interface{}) (res StatusMessageRes, err error) SendEvents(events []Event, opts ...interface{}) (res StatusMessageRes, err error) }
type Configuration ¶
type Configuration struct { AppID string APIKey string Hosts []string Requester transport.Requester ReadTimeout time.Duration WriteTimeout time.Duration Region region.Region Headers map[string]string ExtraUserAgent string }
Configuration contains all the different parameters one can change to instantiate a new client for the Insights API.
type Event ¶
type Event struct { EventType string `json:"eventType"` EventName string `json:"eventName"` Index string `json:"index"` UserToken string `json:"userToken"` Timestamp time.Time `json:"-"` ObjectIDs []string `json:"objectIDs,omitempty"` Positions []int `json:"positions,omitempty"` QueryID string `json:"queryID,omitempty"` Filters []string `json:"filters,omitempty"` }
func (Event) MarshalJSON ¶
type StatusMessageRes ¶
type UserClient ¶
func (*UserClient) ClickedFilters ¶
func (c *UserClient) ClickedFilters( eventName string, indexName string, filters []string, opts ...interface{}, ) (res StatusMessageRes, err error)
func (*UserClient) ClickedObjectIDs ¶
func (c *UserClient) ClickedObjectIDs( eventName string, indexName string, objectIDs []string, opts ...interface{}, ) (StatusMessageRes, error)
func (*UserClient) ClickedObjectIDsAfterSearch ¶
func (c *UserClient) ClickedObjectIDsAfterSearch( eventName string, indexName string, objectIDs []string, positions []int, queryID string, opts ...interface{}, ) (StatusMessageRes, error)
func (*UserClient) ConvertedFilters ¶
func (c *UserClient) ConvertedFilters( eventName string, indexName string, filters []string, opts ...interface{}, ) (StatusMessageRes, error)
func (*UserClient) ConvertedObjectIDs ¶
func (c *UserClient) ConvertedObjectIDs( eventName string, indexName string, objectIDs []string, opts ...interface{}, ) (StatusMessageRes, error)
func (*UserClient) ConvertedObjectIDsAfterSearch ¶
func (c *UserClient) ConvertedObjectIDsAfterSearch( eventName string, indexName string, objectIDs []string, queryID string, opts ...interface{}, ) (StatusMessageRes, error)
func (*UserClient) ViewedFilters ¶
func (c *UserClient) ViewedFilters( eventName string, indexName string, filters []string, opts ...interface{}, ) (StatusMessageRes, error)
func (*UserClient) ViewedObjectIDs ¶
func (c *UserClient) ViewedObjectIDs( eventName string, indexName string, objectIDs []string, opts ...interface{}, ) (StatusMessageRes, error)
type UserClientInterface ¶
type UserClientInterface interface { ClickedObjectIDs(eventName string, indexName string, objectIDs []string, opts ...interface{}) (StatusMessageRes, error) ClickedObjectIDsAfterSearch(eventName string, indexName string, objectIDs []string, positions []int, queryID string, opts ...interface{}) (StatusMessageRes, error) ClickedFilters(eventName string, indexName string, filters []string, opts ...interface{}) (res StatusMessageRes, err error) ConvertedObjectIDs(eventName string, indexName string, objectIDs []string, opts ...interface{}) (StatusMessageRes, error) ConvertedObjectIDsAfterSearch(eventName string, indexName string, objectIDs []string, queryID string, opts ...interface{}) (StatusMessageRes, error) ConvertedFilters(eventName string, indexName string, filters []string, opts ...interface{}) (StatusMessageRes, error) ViewedObjectIDs(eventName string, indexName string, objectIDs []string, opts ...interface{}) (StatusMessageRes, error) ViewedFilters(eventName string, indexName string, filters []string, opts ...interface{}) (StatusMessageRes, error) }