recombee

package module
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: MIT Imports: 11 Imported by: 0

README

Recombee

A Recombee API client written in Go.

GoDoc

Features

Is capable of managing:

  • Items
    • Add item
    • Delete item
    • List items
    • Delete more items
  • Item Properties
    • Add item property
    • Delete item property
    • Get item property info
    • List item properties
    • Set item values
    • Get item values
    • Update more items
  • Users
    • Add user
    • Delete user
    • Merge users
    • List users
  • User Properties
    • Add user property
    • Delete user property
    • Get user property info
    • List user properties
    • Set user values
    • Get user values
  • User-Item Interactions
    • Add detail view
    • Delete detail view
    • List item detail views
    • List user detail views
    • Add purchase
    • Delete purchase
    • List item purchases
    • List user purchases
    • Add rating
    • Delete rating
    • List item ratings
    • List user ratings
    • Add cart addition
    • Delete cart addition
    • List item cart additions
    • List user cart additions
    • Add bookmark
    • Delete bookmark
    • List item bookmarks
    • List user bookmarks
    • Set view portion
    • Delete view portion
    • List item view portions
    • List user view portions
  • Recommendations
    • Recommending items
    • Recommending item segments
    • Recommending users
  • Search
    • Search items
    • Search items segments
    • Synonyms
  • Series
    • Add series
    • Delete series
    • List series
    • List series items
    • Insert to series
    • Remove from series
  • Segmentations definition
    • General
    • Property based
    • Manual ReQL
    • Auto ReQL
  • Miscellaneous
    • Reset database
    • Batch

Uses batch mode by default to send requests to the API.

Basic usage

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"net/http"
	
	"github.com/moderntv/recombee"
)

const (
	apiUri     = "https://rapi.recombee.com"
	databaseId = "dev"
	token      = "api-token"
)

func main() {
	userID := "23"
	seriesID := "6821"
	rating := 0.8
	myRequests := []recombee.Request{
		recombee.AddItem("1215"),
		recombee.AddRating(
			userID,
			seriesID,
			rating,
			recombee.WithCascadeCreate(),
		),
	}

	client := recombee.NewClient(apiUri, databaseId, token)
	responses, err := client.Request(context.Background(), myRequests...)
	if err != nil {
		panic(err)
	}

	for _, resp := range responses {
		if resp.Code != http.StatusCreated && resp.Code != http.StatusConflict {
			fmt.Printf("%s: %s\n", http.StatusText(resp.Code), resp.Json)
		}
	}

	// Ask for single recommendation
	resp, err := client.Request(context.Background(), recombee.RecommendItemsToUser(
		userID,
		1,
	))
	if err != nil {
		panic(err)
	}

	var recommendations recombee.Recommendations
	err = json.Unmarshal(resp[0].Json, &recommendations)
	if err != nil {
		return
	}

	fmt.Printf("%#v\n", recommendations)
}

Documentation

Overview

Package recombee implements a client for Recombee API. The client uses batch endpoint to send requests to the API.

For detailed documentation please see Recombee's API reference: https://docs.recombee.com/api.html.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth added in v0.6.0

type Auth interface {
	Authenticate(request *http.Request) error
}

type BatchRequest

type BatchRequest struct {
	Requests []Request `json:"requests"`
}

type BatchResponse

type BatchResponse []struct {
	Code int             `json:"code"`
	Json json.RawMessage `json:"json"`
}

BatchResponse represents a message returned by Recombee Batch API.

type BearerTokenAuth added in v0.6.0

type BearerTokenAuth struct {
	// contains filtered or unexported fields
}

func NewBearerTokenAuth added in v0.6.0

func NewBearerTokenAuth(token string) *BearerTokenAuth

func (*BearerTokenAuth) Authenticate added in v0.6.0

func (a *BearerTokenAuth) Authenticate(request *http.Request) error

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(baseURI string, databaseID string, auth Auth, opts ...ClientOption) (c *Client)

NewClient returns new Recombee API client.

func (*Client) Request

func (c *Client) Request(ctx context.Context, requests ...Request) (responses BatchResponse, err error)

Request creates batch request which requests appropriate entity/entities that is/are given by requests.

type ClientOption

type ClientOption func(c *Client)

ClientOption for http client to be configured.

func WithDistinctRecomms

func WithDistinctRecomms(v bool) ClientOption

WithDistinctRecomms makes all the recommended items for a certain user distinct among multiple recommendation requests in the batch.

func WithMaxBatchSize

func WithMaxBatchSize(max int) ClientOption

WithMaxBatchSize sets max batch size that is sent to the API in a single request.

func WithMaxIdleConnections added in v0.6.1

func WithMaxIdleConnections(total int, perHost int) ClientOption

func WithRequestTimeout

func WithRequestTimeout(t time.Duration) ClientOption

WithRequestTimeout sets request timeout.

type HmacSignatureAuth added in v0.6.0

type HmacSignatureAuth struct {
	// contains filtered or unexported fields
}

func NewHmacSignatureAuth added in v0.6.0

func NewHmacSignatureAuth(secret []byte) *HmacSignatureAuth

NewHmacSignatureAuth creates authentication using token created in Recombee admin for the HMAC signature.

func (*HmacSignatureAuth) Authenticate added in v0.6.0

func (a *HmacSignatureAuth) Authenticate(request *http.Request) error

type Recommendations added in v0.2.0

type Recommendations struct {
	RecommID string `json:"recommId"`
	Recomms  []struct {
		ID string `json:"id"`
	} `json:"recomms"`
	NumberNextRecommsCalls int `json:"numberNextRecommsCalls"`
}

type Request

type Request struct {
	Path   string                 `json:"path"`
	Method string                 `json:"method"`
	Params map[string]interface{} `json:"params,omitempty"`
}

Request is a request to Recombee API.

func AddBookmark added in v0.4.0

func AddBookmark(userId string, itemId string, opts ...RequestOption) Request

AddBookmark adds a bookmark of the given item made by the given user.

func AddCartAddition added in v0.5.0

func AddCartAddition(userId string, itemId string, opts ...RequestOption) Request

AddCartAddition adds a cart addition of the given item made by the given user.

func AddDetailView

func AddDetailView(userId string, itemId string, opts ...RequestOption) Request

AddDetailView adds a detail view of the given item made by the given user.

func AddItem

func AddItem(itemId string) Request

AddItem adds new item of the given itemId to the items catalog.

All the item properties for the newly created items are set to null.

func AddItemProperty

func AddItemProperty(propertyName string, typ string) Request

AddItemProperty adds item property.

Adding an item property is somehow equivalent to adding a column to the table of items. The items may be characterized by various properties of different types.

func AddManualReQLSegment added in v0.5.0

func AddManualReQLSegment(segmentationId, segmentId, filter string, opts ...RequestOption) Request

AddManualReQLSegment adds a new Segment into a Manual ReQL Segmentation.

The new Segment is defined by a ReQL filter that returns true for an item in case that this item belongs to the segment.

func AddPurchase

func AddPurchase(userId string, itemId string, opts ...RequestOption) Request

AddPurchase adds a purchase of the given item made by the given user.

func AddRating

func AddRating(userId string, itemId string, rating float64, opts ...RequestOption) Request

AddRating adds a rating of the given item made by the given user.

func AddSearchSynonym added in v0.5.0

func AddSearchSynonym(term, synonym string, opts ...RequestOption) Request

AddSearchSynonym adds a new synonym for the Search items.

When the term is used in the search query, the synonym is also used for the full-text search. Unless oneWay=true, it works also in the opposite way (synonym -> term).

func AddSeries

func AddSeries(seriesId string) Request

AddSeries creates a new series in the database.

func AddUser

func AddUser(userId string) Request

AddUser adds a new user to the database.

func AddUserProperty added in v0.5.0

func AddUserProperty(propertyName string, typ string) Request

AddUserProperty is somehow equivalent to adding a column to the table of users. The users may be characterized by various properties of different types.

func Batch added in v0.5.0

func Batch(requests []Request, opts ...RequestOption) Request

Batch processing allows you to submit arbitrary sequence of requests within a single HTTPS request.

Any type of request from the above documentation may be used in the Batch, and the Batch may combine different types of requests arbitrarily as well.

func CreateAutoReQLSegmentation added in v0.5.0

func CreateAutoReQLSegmentation(segmentationId, sourceType, expression string, opts ...RequestOption) Request

CreateAutoReQLSegmentation Segment the items using a ReQL expression.

For each item, the expression should return a set that contains IDs of segments to which the item belongs to.

func CreateManualReQLSegmentation added in v0.5.0

func CreateManualReQLSegmentation(segmentationId, sourceType string, opts ...RequestOption) Request

CreateManualReQLSegmentation segments the items using multiple ReQL filters.

Use the Add Manual ReQL Items Segment endpoint to create the individual segments.

func CreatePropertyBasedSegmentation added in v0.5.0

func CreatePropertyBasedSegmentation(segmentationId, sourceType, propertyName string, opts ...RequestOption) Request

CreatePropertyBasedSegmentation creates a Segmentation that splits the items into segments based on values of a particular item property.

A segment is created for each unique value of the property. In case of set properties, a segment is created for each value in the set. Item belongs to all these segments.

func DeleteAllSearchSynonyms added in v0.5.0

func DeleteAllSearchSynonyms() Request

DeleteAllSearchSynonyms deletes all synonyms defined in the database.

func DeleteBookmark added in v0.4.0

func DeleteBookmark(userId string, itemId string, opts ...RequestOption) Request

DeleteBookmark deletes a bookmark uniquely specified by `userId`, `itemId`, and `timestamp` or all the bookmarks with the given `userId` and `itemId` if `timestamp` is omitted.

func DeleteCartAddition added in v0.5.0

func DeleteCartAddition(userId string, itemId string, opts ...RequestOption) Request

DeleteCartAddition deletes an existing cart addition uniquely specified by userId, itemId, and timestamp or all the cart additions with the given userId and itemId if timestamp is omitted.

func DeleteDetailView

func DeleteDetailView(userId string, itemId string, opts ...RequestOption) Request

DeleteDetailView deletes an existing detail view uniquely specified by (userId, itemId, and timestamp) or all the detail views with the given userId and itemId if timestamp is omitted.

func DeleteItem

func DeleteItem(itemId string) Request

DeleteItem deletes an item of the given itemId from the catalog.

If there are any purchases, ratings, bookmarks, cart additions, or detail views of the item present in the database, they will be deleted in cascade as well. Also, if the item is present in some series, it will be removed from all the series where present.

func DeleteItemProperty

func DeleteItemProperty(propertyName string) Request

DeleteItemProperty deletes item property.

Deleting an item property is roughly equivalent to removing a column from the table of items.

func DeleteManualReQLSegment added in v0.5.0

func DeleteManualReQLSegment(segmentationId, segmentId string) Request

DeleteManualReQLSegment deletes a Segment from a Manual ReQL Segmentation.

func DeleteMoreItems added in v0.5.0

func DeleteMoreItems(filter string) Request

DeleteMoreItems deletes all the items that pass the filter.

If an item becomes obsolete/no longer available, it is meaningful to keep it in the catalog (along with all the interaction data, which are very useful) and only exclude the item from recommendations. In such a case, use ReQL filter instead of deleting the item completely.

func DeletePurchase

func DeletePurchase(userId string, itemId string, opts ...RequestOption) Request

DeletePurchase deletes an existing purchase uniquely specified by userId, itemId, and timestamp or all the purchases with the given userId and itemId if timestamp is omitted.

func DeleteRating

func DeleteRating(userId string, itemId string, opts ...RequestOption) Request

DeleteRating deletes an existing rating specified by (userId, itemId, timestamp) from the database or all the ratings with the given userId and itemId if timestamp is omitted.

func DeleteSearchSynonym added in v0.5.0

func DeleteSearchSynonym(id string) Request

DeleteSearchSynonym deletes synonym of the given id. This synonym is no longer taken into account in the Search items.

func DeleteSegmentation added in v0.5.0

func DeleteSegmentation(segmentationId string) Request

DeleteSegmentation deletes existing Segmentation.

func DeleteSeries

func DeleteSeries(seriesId string) Request

DeleteSeries deletes the series of the given seriesId from the database.

Deleting a series will only delete assignment of items to it, not the items themselves!

func DeleteUser

func DeleteUser(userId string) Request

DeleteUser deletes a user of the given userId from the database.

If there are any purchases, ratings, bookmarks, cart additions or detail views made by the user present in the database, they will be deleted in cascade as well.

func DeleteUserProperty added in v0.5.0

func DeleteUserProperty(propertyName string) Request

DeleteUserProperty is roughly equivalent to removing a column from the table of users.

func DeleteViewPortion

func DeleteViewPortion(userId string, itemId string, opts ...RequestOption) Request

DeleteViewPortion deletes an existing view portion specified by (userId, itemId, sessionId) from the database.

func GetItemPropertyInfo

func GetItemPropertyInfo(propertyName string) Request

GetItemPropertyInfo gets information about specified item property.

func GetItemValues

func GetItemValues(itemId string) Request

GetItemValues gets all the current property values of the given item.

func GetSegmentation added in v0.5.0

func GetSegmentation(segmentationId string) Request

GetSegmentation gets existing Segmentation.

func GetUserPropertyInfo added in v0.5.0

func GetUserPropertyInfo(propertyName string) Request

GetUserPropertyInfo gets information about specified user property.

func GetUserValues added in v0.5.0

func GetUserValues(userId string) Request

GetUserValues gets all the current property values of the given user.

func InsertToSeries

func InsertToSeries(seriesId string, itemType string, itemId string, time_ float64, opts ...RequestOption) Request

InsertToSeries inserts an existing item/series into a series of the given seriesId at a position determined by time.

func ListItemBookmarks added in v0.4.0

func ListItemBookmarks(itemId string) Request

ListItemBookmarks lists all the ever-made bookmarks of the given item.

func ListItemCartAddition added in v0.5.0

func ListItemCartAddition(itemId string) Request

ListItemCartAddition lists all the ever-made cart additions of the given item.

func ListItemDetailViews

func ListItemDetailViews(itemId string) Request

ListItemDetailViews lists all the detail views of the given item ever made by different users.

func ListItemProperties added in v0.5.0

func ListItemProperties() Request

ListItemProperties gets the list of all the item properties in your database.

func ListItemPurchases

func ListItemPurchases(itemId string) Request

ListItemPurchases lists all the ever-made purchases of the given item.

func ListItemRatings

func ListItemRatings(itemId string) Request

ListItemRatings lists all the ratings of an item ever submitted by different users.

func ListItemViewPortions

func ListItemViewPortions(itemId string) Request

ListItemViewPortions lists all the view portions of an item ever submitted by different users.

func ListItems

func ListItems(opts ...RequestOption) Request

ListItems gets a list of IDs of items currently present in the catalog.

func ListSearchSynonyms added in v0.5.0

func ListSearchSynonyms(opts ...RequestOption) Request

ListSearchSynonyms gives the list of synonyms defined in the database.

func ListSegmentations added in v0.5.0

func ListSegmentations(sourceType string) Request

ListSegmentations return all existing items Segmentations.

func ListSeries

func ListSeries() Request

ListSeries gets the list of all the series currently present in the database.

func ListSeriesItems

func ListSeriesItems(seriesId string) Request

ListSeriesItems lists all the items present in the given series, sorted according to their time index values.

func ListUserBookmarks added in v0.4.0

func ListUserBookmarks(userId string) Request

ListUserBookmarks lists all the bookmarks ever made by the given user.

func ListUserCartAddition added in v0.5.0

func ListUserCartAddition(userId string) Request

ListUserCartAddition lists all the cart additions ever made by the given user.

func ListUserDetailViews

func ListUserDetailViews(userId string) Request

ListUserDetailViews lists all the detail views of different items ever made by the given user.

func ListUserProperties added in v0.5.0

func ListUserProperties() Request

ListUserProperties gets the list of all the user properties in your database.

func ListUserPurchases

func ListUserPurchases(userId string) Request

ListUserPurchases lists all the purchases ever made by the given user.

func ListUserRatings

func ListUserRatings(userId string) Request

ListUserRatings lists all the ratings ever submitted by the given user.

func ListUserViewPortions

func ListUserViewPortions(userId string) Request

ListUserViewPortions lists all the view portions ever submitted by the given user.

func ListUsers

func ListUsers(opts ...RequestOption) Request

ListUsers gets a list of IDs of users currently present in the catalog.

func MergeUsers

func MergeUsers(targetUserId string, sourceUserId string, opts ...RequestOption) Request

MergeUsers merges interactions (purchases, ratings, bookmarks, detail views …) of two different users under a single user ID. This is especially useful for online e-commerce applications working with anonymous users identified by unique tokens such as the session ID. In such applications, it may often happen that a user owns a persistent account, yet accesses the system anonymously while, e.g., putting items into a shopping cart. At some point in time, such as when the user wishes to confirm the purchase, (s)he logs into the system using his/her username and password. The interactions made under anonymous session ID then become connected with the persistent account, and merging these two becomes desirable.

Merging happens between two users referred to as the target and the source. After the merge, all the interactions of the source user are attributed to the target user, and the source user is deleted.

func RecommendItemSegmentsToItem added in v0.5.0

func RecommendItemSegmentsToItem(itemId string, targetUserId string, count int, opts ...RequestOption) Request

RecommendItemSegmentsToItem recommends Segments from a Segmentation that are the most relevant to a particular item.

Based on the used Segmentation, this endpoint can be used for example for:

  • Recommending the related categories
  • Recommending the related genres
  • Recommending the related brands
  • Recommending the related artists

func RecommendItemSegmentsToItemSegment added in v0.5.0

func RecommendItemSegmentsToItemSegment(
	contextSegmentId string,
	targetUserId string,
	count int,
	opts ...RequestOption,
) Request

RecommendItemSegmentsToItemSegment recommends Segments from a result Segmentation that are the most relevant to a particular Segment from a context Segmentation.

Based on the used Segmentations, this endpoint can be used for example for:

  • Recommending the related brands to particular brand
  • Recommending the related brands to particular category
  • Recommending the related artists to a particular genre (assuming songs are the Items)

func RecommendItemSegmentsToUser added in v0.5.0

func RecommendItemSegmentsToUser(userId string, count int, opts ...RequestOption) Request

RecommendItemSegmentsToUser recommends the top Segments from a Segmentation for a particular user, based on the user’s past interactions.

Based on the used Segmentation, this endpoint can be used for example for:

  • Recommending the top categories for the user
  • Recommending the top genres for the user
  • Recommending the top brands for the user
  • Recommending the top artists for the user

func RecommendItemsToItem

func RecommendItemsToItem(itemId string, targetUserId string, count int, opts ...RequestOption) Request

RecommendItemsToItem recommends a set of items that are somehow related to one given item, X. A typical scenario is when the user A is viewing X. Then you may display items to the user that he might also be interested in. Recommend items to item request gives you Top-N such items, optionally taking the target user A into account.

The returned items are sorted by relevance (the first item being the most relevant).

Besides the recommended items, also a unique recommId is returned in the response. It can be used to:

  • Let Recombee know that this recommendation was successful (e.g., user clicked one of the recommended items). See Reported metrics.

  • Get subsequent recommended items when the user scrolls down (infinite scroll) or goes to the next page. See Recommend Next Items.

func RecommendItemsToUser

func RecommendItemsToUser(userId string, count int, opts ...RequestOption) Request

RecommendItemsToUser recommends top-N items that are most likely to be of high value for the given user.

The most typical use cases are recommendations on the homepage, in some “Picked just for you” section, or in email.

The returned items are sorted by relevance (the first item being the most relevant).

Besides the recommended items, also a unique recommId is returned in the response. It can be used to:

  • Let Recombee know that this recommendation was successful (e.g., user clicked one of the recommended items).

  • Get subsequent recommended items when the user scrolls down (infinite scroll) or goes to the next page.

func RecommendNextItems added in v0.5.0

func RecommendNextItems(recommId string, count int, opts ...RequestOption) Request

RecommendNextItems returns items that shall be shown to a user as next recommendations when the user e.g. scrolls the page down (infinite scroll) or goes to the next page.

It accepts recommId of a base recommendation request (e.g., request from the first page) and the number of items that shall be returned (count).

func RecommendUsersToItem added in v0.5.0

func RecommendUsersToItem(itemId string, count int, opts ...RequestOption) Request

RecommendUsersToItem recommends users that are likely to be interested in the given item.

It is also possible to use POST HTTP method (for example in the case of a very long ReQL filter) - query parameters then become body parameters.

The returned users are sorted by predicted interest in the item (the first user being the most interested).

func RecommendUsersToUser added in v0.5.0

func RecommendUsersToUser(userId string, count int, opts ...RequestOption) Request

RecommendUsersToUser gets users similar to the given user, based on the user’s past interactions (purchases, ratings, etc.) and values of properties.

It is also possible to use POST HTTP method (for example in the case of a very long ReQL filter) - query parameters then become body parameters.

The returned users are sorted by similarity (the first user being the most similar).

func RemoveFromSeries

func RemoveFromSeries(seriesId string, itemType string, itemId string, time_ float64) Request

RemoveFromSeries removes an existing series item from the series.

func ResetDatabase added in v0.5.0

func ResetDatabase() Request

ResetDatabase completely erases all your data, including items, item properties, series, user database, purchases, ratings, detail views, and bookmarks. Make sure the request is never executed in the production environment! Resetting your database is irreversible.

func SearchItemSegments added in v0.5.0

func SearchItemSegments(userId string, searchQuery string, count int, opts ...RequestOption) Request

SearchItemSegments performs a full-text personalized search that returns Segments from a Segmentation. The results are based on the provided searchQuery and also on the user’s past interactions (purchases, ratings, etc.).

func SearchItems added in v0.5.0

func SearchItems(userId string, searchQuery string, count int, opts ...RequestOption) Request

SearchItems performs a full-text personalized search.

func SetItemValues added in v0.5.0

func SetItemValues(itemId string, opts ...RequestOption) Request

SetItemValues sets or updates (some) property values of the given item. The properties (columns) must be previously created by AddItemProperty.

func SetUserValues added in v0.5.0

func SetUserValues(userId string, opts ...RequestOption) Request

SetUserValues sets or updates (some) property values of the given user. The properties (columns) must be previously created by Add user property.

func SetViewPortion

func SetViewPortion(userId string, itemId string, portion float64, opts ...RequestOption) Request

SetViewPortion sets viewed portion of an item (for example a video or article) by a user (at a session). If you send a new request with the same (userId, itemId, sessionId), the portion gets updated.

func UpdateAutoReQLSegmentation added in v0.5.0

func UpdateAutoReQLSegmentation(segmentationId string, opts ...RequestOption) Request

UpdateAutoReQLSegmentation updates an existing Segmentation.

func UpdateManualReQLSegment added in v0.5.0

func UpdateManualReQLSegment(segmentationId, segmentId, filter string, opts ...RequestOption) Request

UpdateManualReQLSegment update definition of the Segment.

func UpdateManualReQLSegmentation added in v0.5.0

func UpdateManualReQLSegmentation(segmentationId string, opts ...RequestOption) Request

UpdateManualReQLSegmentation updates an existing Segmentation.

func UpdateMoreItems added in v0.5.0

func UpdateMoreItems(filter string, changes interface{}) Request

UpdateMoreItems updates (some) property values of all the items that pass the filter.

func UpdatePropertyBasedSegmentation added in v0.5.0

func UpdatePropertyBasedSegmentation(segmentationId string, opts ...RequestOption) Request

UpdatePropertyBasedSegmentation updates a Property Based Segmentation

type RequestOption

type RequestOption = func(map[string]interface{})

func WithAmount

func WithAmount(amount float64) RequestOption

func WithBooster

func WithBooster(booster string) RequestOption

func WithCascadeCreate

func WithCascadeCreate() RequestOption

func WithCount

func WithCount(count int) RequestOption

func WithDescription added in v0.5.1

func WithDescription(description string) RequestOption

func WithDuration

func WithDuration(dur time.Duration) RequestOption

func WithExpression added in v0.5.1

func WithExpression(expression string) RequestOption

func WithFilter

func WithFilter(filter string) RequestOption

func WithIncludedProperties

func WithIncludedProperties(enable bool) RequestOption

func WithKeyValue

func WithKeyValue(k string, v interface{}) RequestOption

func WithLogic

func WithLogic(logic interface{}) RequestOption

func WithMinRelevance

func WithMinRelevance(min string) RequestOption

WithMinRelevance is relevance of recommended item. Possible values are "low", "medium", "high". Default is "low, meaning that the recombee system attempts to recommend a number of items to count at any cost.

func WithOffset

func WithOffset(offset int) RequestOption

func WithPrice

func WithPrice(price float64) RequestOption

func WithProfit

func WithProfit(profit float64) RequestOption

func WithRecommId

func WithRecommId(id string) RequestOption

func WithReturnProperties

func WithReturnProperties(enable bool) RequestOption

func WithRotationRate

func WithRotationRate(rate float64) RequestOption

func WithRotationTime

func WithRotationTime(t float64) RequestOption

func WithScenario

func WithScenario(scenario string) RequestOption

func WithSessionId

func WithSessionId(id string) RequestOption

func WithTimestamp

func WithTimestamp(ts time.Time) RequestOption

func WithTitle added in v0.5.1

func WithTitle(title string) RequestOption

func WithUserImpact

func WithUserImpact(impact float64) RequestOption

type Response

type Response struct {
	StatusCode int    `json:"statusCode"`
	Message    string `json:"message"`
}

Jump to

Keyboard shortcuts

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