Documentation ¶
Index ¶
- type Client
- type DecisionMode
- type ModificationInfo
- type OptionBuilder
- type Options
- type Visitor
- func (v *Visitor) ActivateCacheModification(key string) (err error)
- func (v *Visitor) ActivateModification(key string) (err error)
- func (v *Visitor) GetAllModifications() (flagInfos map[string]model.FlagInfos)
- 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) 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) UpdateContext(newContext model.Context) (err error)
- func (v *Visitor) UpdateContextKey(key string, value interface{}) (err error)
Constants ¶
This section is empty.
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) NewVisitor ¶
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 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 WithVisitorCache ¶
func WithVisitorCache(options ...cache.OptionBuilder) OptionBuilder
WithVisitorCache enables visitor assignment caching with options
type Options ¶
type Options struct { EnvID string // contains filtered or unexported fields }
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 Context map[string]interface{} // 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) GetAllModifications ¶
GetAllModifications return all the modifications
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) 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) UpdateContext ¶
UpdateContext updates the Visitor context with new value
func (*Visitor) UpdateContextKey ¶
UpdateContextKey updates a single Visitor context key with new value