byteair

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultPredictScene  = "default"
	DefaultCallbackScene = "default"
)

Variables

View Source
var (
	TooManyItemsErr = errors.New(fmt.Sprintf(errMsgFormat, MaxImportItemCount))
)

Functions

This section is empty.

Types

type Client

type Client interface {
	common.Client

	// Release
	// release resources
	Release()

	// WriteData
	//
	// Writes at most 100 data at a time. Exceeding 100 in a request results in
	// a rejection. One can use this to upload new data, or update existing
	// data (by providing all the fields, some data type not support update, e.g. user event).
	WriteData(dataList []map[string]interface{}, topic string,
		opts ...option.Option) (*WriteResponse, error)

	// Predict
	//
	// Gets the list of products (ranked).
	// The updated user data will take effect in 24 hours.
	// The updated product data will take effect in 30 mins.
	// Depending how (realtime or batch) the UserEvents are sent back, it will
	// be fed into the models and take effect after that.
	Predict(request *PredictRequest, opts ...option.Option) (*PredictResponse, error)

	// Callback
	//
	// Sends back the actual product list shown to the users based on the
	// customized changes from `PredictResponse`.
	// example: our Predict call returns the list of items [1, 2, 3, 4].
	// Your custom logic have decided that product 3 has been sold out and
	// product 10 needs to be inserted before 2 based on some promotion rules,
	// the AckServerImpressionsRequest content items should looks like
	// [
	//   {id:1, extra: "{\"reason\": \"kept\"}", pos:1},
	//   {id:10, extra: "{\"reason\": \"inserted\"}", pos:2},
	//   {id:2, extra: "{\"reason\": \"kept\"}", pos:3},
	//   {id:4, extra: "{\"reason\": \"kept\"}", pos:4},
	//   {id:3, extra: "{\"reason\": \"filtered\"}", pos:0},
	// ].
	Callback(request *CallbackRequest, opts ...option.Option) (*CallbackResponse, error)
}

type ClientBuilder

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

func (*ClientBuilder) AK

func (receiver *ClientBuilder) AK(ak string) *ClientBuilder

func (*ClientBuilder) ApplicationId

func (receiver *ClientBuilder) ApplicationId(applicationId string) *ClientBuilder

func (*ClientBuilder) Build

func (receiver *ClientBuilder) Build() (Client, error)

func (*ClientBuilder) Headers

func (receiver *ClientBuilder) Headers(headers map[string]string) *ClientBuilder

func (*ClientBuilder) HostHeader

func (receiver *ClientBuilder) HostHeader(hostHeader string) *ClientBuilder

func (*ClientBuilder) Hosts

func (receiver *ClientBuilder) Hosts(hosts []string) *ClientBuilder

func (*ClientBuilder) Region

func (receiver *ClientBuilder) Region(region core.Region) *ClientBuilder

func (*ClientBuilder) SK

func (receiver *ClientBuilder) SK(sk string) *ClientBuilder

func (*ClientBuilder) Schema

func (receiver *ClientBuilder) Schema(schema string) *ClientBuilder

func (*ClientBuilder) TenantId

func (receiver *ClientBuilder) TenantId(tenantId string) *ClientBuilder

func (*ClientBuilder) Token

func (receiver *ClientBuilder) Token(token string) *ClientBuilder

func (*ClientBuilder) UseAirAuth

func (receiver *ClientBuilder) UseAirAuth() *ClientBuilder

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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