insights

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 9 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 {
	// contains filtered or unexported fields
}

Client provides methods to interact with the Algolia Insights API.

func NewClient

func NewClient(appID, apiKey string) *Client

NewClient instantiates a new client able to interact with the Algolia Insights API.

func NewClientWithConfig

func NewClientWithConfig(config _insights.Configuration) *Client

NewClientWithConfig instantiates a new client able to interact with the Algolia Insights API.

func (*Client) FetchEvents

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

FetchEvents retrieves 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"`
}

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