decisionapi

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func APIKey

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

APIKey sets http client api key

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, 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, 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