client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OptimizelyClient

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

OptimizelyClient is the entry point to the Optimizely SDK

func (*OptimizelyClient) Close

func (o *OptimizelyClient) Close()

Close closes the Optimizely instance and stops any ongoing tasks from its children components

func (*OptimizelyClient) GetEnabledFeatures

func (o *OptimizelyClient) GetEnabledFeatures(userContext entities.UserContext) (enabledFeatures []string, err error)

GetEnabledFeatures returns an array containing the keys of all features in the project that are enabled for the given user.

func (*OptimizelyClient) IsFeatureEnabled

func (o *OptimizelyClient) IsFeatureEnabled(featureKey string, userContext entities.UserContext) (result bool, err error)

IsFeatureEnabled returns true if the feature is enabled for the given user

type OptimizelyFactory

type OptimizelyFactory struct {
	SDKKey   string
	Datafile []byte
}

OptimizelyFactory is used to construct an instance of the OptimizelyClient

func (OptimizelyFactory) Client

func (f OptimizelyFactory) Client() (*OptimizelyClient, error)

Client returns a client initialized with the defaults

func (OptimizelyFactory) ClientWithOptions

func (f OptimizelyFactory) ClientWithOptions(clientOptions Options) (*OptimizelyClient, error)

ClientWithOptions returns a client initialized with the given configuration options

func (OptimizelyFactory) StaticClient

func (f OptimizelyFactory) StaticClient() (*OptimizelyClient, error)

StaticClient returns a client initialized with a static project config

type Options

type Options struct {
	Context              context.Context
	ProjectConfigManager optimizely.ProjectConfigManager
	DecisionService      decision.DecisionService
}

Options are used to create an instance of the OptimizelyClient with custom configuration

Jump to

Keyboard shortcuts

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