decisionapi

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// V1 is Decision API V1
	V1 = iota + 1
	// V2 is Decision API V2
	V2
)

Variables

This section is empty.

Functions

func APIKey

func APIKey(apiKey string) func(r *APIClient)

APIKey sets http client api key

func APIUrl added in v2.1.0

func APIUrl(apiURL string) func(r *APIClient)

APIUrl sets http client URL

func APIVersion

func APIVersion(version APIVersionNumber) func(r *APIClient)

APIVersion sets http client base URL

func Retries

func Retries(retries int) func(r *APIClient)

Retries sets max number of retries for failed calls

func Timeout

func Timeout(timeout time.Duration) func(r *APIClient)

Timeout sets http client timeout

Types

type APIClient

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

APIClient represents the Decision API client informations

func NewAPIClient

func NewAPIClient(envID string, apiKey string, params ...func(*APIClient)) (*APIClient, error)

NewAPIClient creates a Decision API client from the environment ID and option builders

func (*APIClient) ActivateCampaign

func (r *APIClient) ActivateCampaign(request model.ActivationHit) error

ActivateCampaign activate a campaign / variation id to the Decision API

func (*APIClient) GetModifications

func (r *APIClient) GetModifications(visitorID string, anonymousID *string, context map[string]interface{}) (*model.APIClientResponse, error)

GetModifications gets modifications from Decision API

func (*APIClient) SendEvent

func (r *APIClient) SendEvent(request model.Event) error

SendEvent sends an event to flagship Event endpoint

type APIVersionNumber

type APIVersionNumber int

APIVersionNumber specifies the version of the Decision API to use

Jump to

Keyboard shortcuts

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