insights

package
v1.6.11 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MIT Imports: 9 Imported by: 0

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