insights

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*algoliaInsights.APIClient
}

Client wraps the default Insights API client so that we can declare methods on it

func NewClient

func NewClient(appID, apiKey string, region algoliaInsights.Region) (*Client, error)

NewClient instantiates a new Insights API client

func (*Client) GetEvents added in v1.7.0

func (c *Client) GetEvents(startDate, endDate time.Time, limit int) (*EventsRes, error)

GetEvents retrieves a number of events from the Algolia Insights API.

type Event

type Event struct {
	EventType string    `json:"eventType"`
	EventName string    `json:"eventName"`
	Index     string    `json:"index"`
	UserToken string    `json:"userToken"`
	Timestamp Timestamp `json:"timestamp"`
	ObjectIDs []string  `json:"objectIDs,omitempty"`
	Positions []int     `json:"positions,omitempty"`
	QueryID   string    `json:"queryID,omitempty"`
	Filters   []string  `json:"filters,omitempty"`
}

TODO: Replace this with a type from the API.

type EventWrapper

type EventWrapper struct {
	Event     Event    `json:"event"`
	RequestID string   `json:"requestID"`
	Status    int      `json:"status"`
	Errors    []string `json:"errors"`
	Headers   map[string][]string
}

type EventsRes

type EventsRes struct {
	Events []EventWrapper `json:"events"`
}

type Timestamp

type Timestamp struct {
	time.Time
}

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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