Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) Dispose() (err error)
- func (c *Client) GetCacheManager() cache.Manager
- func (c *Client) GetDecisionMode() DecisionMode
- func (c *Client) GetEnvID() string
- func (c *Client) GetStatus() string
- func (c *Client) NewVisitor(visitorID string, context model.Context, options ...VisitorOptionBuilder) (visitor *Visitor, err error)
- func (c *Client) SendHit(visitorID string, anonymousID *string, hit model.HitInterface) (err error)
- type DecisionMode
- type ModificationInfo
- type OptionBuilder
- func WithBucketing(options ...func(*bucketing.Engine)) OptionBuilder
- func WithDecisionAPI(options ...func(*decisionapi.APIClient)) OptionBuilder
- func WithTrackingAPIClient(trackingAPIClient tracking.APIClientInterface) OptionBuilder
- func WithVisitorCache(options ...cache.OptionBuilder) OptionBuilder
- type Options
- type Visitor
- func (v *Visitor) ActivateCacheModification(key string) (err error)
- func (v *Visitor) ActivateModification(key string) (err error)
- func (v *Visitor) Authenticate(newID string, newContext map[string]interface{}, sync bool) (err error)
- func (v *Visitor) GetAllModifications() (flagInfos map[string]model.FlagInfos)
- func (v *Visitor) GetDecisionResponse() *model.APIClientResponse
- func (v *Visitor) GetModificationArray(key string, defaultValue []interface{}, activate bool) (castVal []interface{}, err error)
- func (v *Visitor) GetModificationBool(key string, defaultValue bool, activate bool) (castVal bool, err error)
- func (v *Visitor) GetModificationInfo(key string) (modifInfo *ModificationInfo, err error)
- func (v *Visitor) GetModificationNumber(key string, defaultValue float64, activate bool) (castVal float64, err error)
- func (v *Visitor) GetModificationObject(key string, defaultValue map[string]interface{}, activate bool) (castVal map[string]interface{}, err error)
- func (v *Visitor) GetModificationString(key string, defaultValue string, activate bool) (castVal string, err error)
- func (v *Visitor) SendHit(hit model.HitInterface) (err error)
- func (v *Visitor) SynchronizeModifications() (err error)
- func (v *Visitor) Unauthenticate(newContext map[string]interface{}, sync bool) (err error)
- func (v *Visitor) UpdateContext(newContext model.Context) (err error)
- func (v *Visitor) UpdateContextKey(key string, value interface{}) (err error)
- type VisitorOptionBuilder
- type VisitorOptions
Constants ¶
const ( STATUS_INITIALIZING = "INITIALIZING" STATUS_READY = "READY" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represent the Flagship SDK client object
func (*Client) GetCacheManager ¶
GetCacheManager returns the current cache manager
func (*Client) GetDecisionMode ¶
func (c *Client) GetDecisionMode() DecisionMode
GetDecisionMode returns the current decision mode
func (*Client) NewVisitor ¶
func (c *Client) NewVisitor(visitorID string, context model.Context, options ...VisitorOptionBuilder) (visitor *Visitor, err error)
NewVisitor returns a new Visitor from ID and context
type DecisionMode ¶
type DecisionMode string
DecisionMode represents the decision mode of the Client engine
const ( API DecisionMode = "API" Bucketing DecisionMode = "Bucketing" )
The different decision modes
type ModificationInfo ¶
type ModificationInfo struct { CampaignID string VariationGroupID string VariationID string IsReference bool Value interface{} }
ModificationInfo represents additional info linked to the modification key, for third party services
type OptionBuilder ¶
type OptionBuilder func(*Options)
OptionBuilder is a func type to set options to the FlagshipOption.
func WithBucketing ¶
func WithBucketing(options ...func(*bucketing.Engine)) OptionBuilder
WithBucketing enables the bucketing decision mode for the SDK
func WithDecisionAPI ¶
func WithDecisionAPI(options ...func(*decisionapi.APIClient)) OptionBuilder
WithDecisionAPI changes the decision API options
func WithTrackingAPIClient ¶ added in v2.0.12
func WithTrackingAPIClient(trackingAPIClient tracking.APIClientInterface) OptionBuilder
WithTrackingAPIClient changes the tracking api client used by the SDK
func WithVisitorCache ¶
func WithVisitorCache(options ...cache.OptionBuilder) OptionBuilder
WithVisitorCache enables visitor assignment caching with options
type Options ¶
Options represent the options passed to the Flagship SDK client
func (*Options) BuildOptions ¶
func (f *Options) BuildOptions(clientOptions ...OptionBuilder)
BuildOptions fill out the FlagshipOption struct from option builders
type Visitor ¶
type Visitor struct { ID string AnonymousID *string Context model.Context // contains filtered or unexported fields }
Visitor represents a visitor instance of the Flagship SDK
func (*Visitor) ActivateCacheModification ¶
ActivateCacheModification activates a modification from the cache of assigned visitor campaigns
func (*Visitor) ActivateModification ¶
ActivateModification notifies Flagship that the visitor has seen to modification
func (*Visitor) Authenticate ¶ added in v2.0.12
func (v *Visitor) Authenticate(newID string, newContext map[string]interface{}, sync bool) (err error)
Authenticate set the authenticated ID for the visitor, along with optional new context and re-synchronize flag
func (*Visitor) GetAllModifications ¶
GetAllModifications return all the modifications
func (*Visitor) GetDecisionResponse ¶
func (v *Visitor) GetDecisionResponse() *model.APIClientResponse
GetDecisionResponse return the decision response
func (*Visitor) GetModificationArray ¶
func (v *Visitor) GetModificationArray(key string, defaultValue []interface{}, activate bool) (castVal []interface{}, err error)
GetModificationArray get a modification array as []interface{} by its key
func (*Visitor) GetModificationBool ¶
func (v *Visitor) GetModificationBool(key string, defaultValue bool, activate bool) (castVal bool, err error)
GetModificationBool get a modification bool by its key
func (*Visitor) GetModificationInfo ¶
func (v *Visitor) GetModificationInfo(key string) (modifInfo *ModificationInfo, err error)
GetModificationInfo returns a modification info by its key
func (*Visitor) GetModificationNumber ¶
func (v *Visitor) GetModificationNumber(key string, defaultValue float64, activate bool) (castVal float64, err error)
GetModificationNumber get a modification number as float64 by its key
func (*Visitor) GetModificationObject ¶
func (v *Visitor) GetModificationObject(key string, defaultValue map[string]interface{}, activate bool) (castVal map[string]interface{}, err error)
GetModificationObject get a modification object as map[string]interface{} by its key
func (*Visitor) GetModificationString ¶
func (v *Visitor) GetModificationString(key string, defaultValue string, activate bool) (castVal string, err error)
GetModificationString get a modification string by its key
func (*Visitor) SendHit ¶
func (v *Visitor) SendHit(hit model.HitInterface) (err error)
SendHit sends a tracking hit to the Data Collect API
func (*Visitor) SynchronizeModifications ¶
SynchronizeModifications updates the latest campaigns and modifications for the visitor
func (*Visitor) Unauthenticate ¶ added in v2.0.12
Unauthenticate unset the authenticated ID for the visitor
func (*Visitor) UpdateContext ¶
UpdateContext updates the Visitor context with new value
func (*Visitor) UpdateContextKey ¶
UpdateContextKey updates a single Visitor context key with new value
type VisitorOptionBuilder ¶ added in v2.0.12
type VisitorOptionBuilder func(*VisitorOptions)
VisitorOptionBuilder is a func type to set options to the VisitorOptions.
func WithAuthenticated ¶ added in v2.0.12
func WithAuthenticated(isAuthenticated bool) VisitorOptionBuilder
WithAuthenticated sets the is authenticated options of the visitor
type VisitorOptions ¶ added in v2.0.12
type VisitorOptions struct {
IsAuthenticated bool
}
VisitorOptions represents the visitor options of the Flagship SDK
func (*VisitorOptions) BuildVisitorOptions ¶ added in v2.0.12
func (f *VisitorOptions) BuildVisitorOptions(visitorOptions ...VisitorOptionBuilder)
BuildVisitorOptions fill out the FlagshipOption struct from option builders