Documentation
¶
Overview ¶
Package client has client definitions
Package client has client facing factories
Index ¶
- type OptimizelyClient
- func (o *OptimizelyClient) Close()
- func (o *OptimizelyClient) GetEnabledFeatures(userContext entities.UserContext) (enabledFeatures []string, err error)
- func (o *OptimizelyClient) GetFeatureVariableBoolean(featureKey, variableKey string, userContext entities.UserContext) (value bool, err error)
- func (o *OptimizelyClient) GetFeatureVariableDouble(featureKey, variableKey string, userContext entities.UserContext) (value float64, err error)
- func (o *OptimizelyClient) GetFeatureVariableInteger(featureKey, variableKey string, userContext entities.UserContext) (value int, err error)
- func (o *OptimizelyClient) GetFeatureVariableString(featureKey, variableKey string, userContext entities.UserContext) (value string, err error)
- func (o *OptimizelyClient) GetProjectConfig() (projectConfig optimizely.ProjectConfig, err error)
- func (o *OptimizelyClient) IsFeatureEnabled(featureKey string, userContext entities.UserContext) (result bool, err error)
- func (o *OptimizelyClient) Track(eventKey string, userContext entities.UserContext, ...) (err error)
- type OptimizelyFactory
- type Options
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) GetFeatureVariableBoolean ¶ added in v0.2.0
func (o *OptimizelyClient) GetFeatureVariableBoolean(featureKey, variableKey string, userContext entities.UserContext) (value bool, err error)
GetFeatureVariableBoolean returns boolean feature variable value
func (*OptimizelyClient) GetFeatureVariableDouble ¶ added in v0.2.0
func (o *OptimizelyClient) GetFeatureVariableDouble(featureKey, variableKey string, userContext entities.UserContext) (value float64, err error)
GetFeatureVariableDouble returns double feature variable value
func (*OptimizelyClient) GetFeatureVariableInteger ¶ added in v0.2.0
func (o *OptimizelyClient) GetFeatureVariableInteger(featureKey, variableKey string, userContext entities.UserContext) (value int, err error)
GetFeatureVariableInteger returns integer feature variable value
func (*OptimizelyClient) GetFeatureVariableString ¶ added in v0.2.0
func (o *OptimizelyClient) GetFeatureVariableString(featureKey, variableKey string, userContext entities.UserContext) (value string, err error)
GetFeatureVariableString returns string feature variable value
func (*OptimizelyClient) GetProjectConfig ¶ added in v0.2.0
func (o *OptimizelyClient) GetProjectConfig() (projectConfig optimizely.ProjectConfig, err error)
GetProjectConfig returns the current ProjectConfig or nil if the instance is not valid
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
func (*OptimizelyClient) Track ¶ added in v0.2.0
func (o *OptimizelyClient) Track(eventKey string, userContext entities.UserContext, eventTags map[string]interface{}) (err error)
Track take and event key with event tags and if the event is part of the config, send to events backend.
type OptimizelyFactory ¶
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 { ProjectConfigManager optimizely.ProjectConfigManager DecisionService decision.Service EventProcessor event.Processor }
Options are used to create an instance of the OptimizelyClient with custom configuration