Documentation ¶
Overview ¶
Package decide has error definitions for decide api
Package decide has option definitions and helper methods for decide api ¶
Package decide //
Package decide //
Index ¶
Constants ¶
const ( // SDKNotReady when sdk is not ready SDKNotReady decideMessage = "Optimizely SDK not configured properly yet." // FlagKeyInvalid when invalid flag key is provided FlagKeyInvalid decideMessage = `No flag was found for key "%s".` // VariableValueInvalid when invalid variable value is provided VariableValueInvalid decideMessage = `Variable value for key "%s" is invalid or wrong type.` )
Variables ¶
This section is empty.
Functions ¶
func GetDecideError ¶
func GetDecideError(messageType decideMessage, arguments ...interface{}) error
GetDecideError returns error for decide type
func GetDecideMessage ¶
func GetDecideMessage(messageType decideMessage, arguments ...interface{}) string
GetDecideMessage returns message for decide type
Types ¶
type DecisionReasons ¶
type DecisionReasons interface { AddError(format string, arguments ...interface{}) AddInfo(format string, arguments ...interface{}) string Append(reasons DecisionReasons) ToReport() []string }
DecisionReasons defines the reasons for which the decision was made.
type DefaultDecisionReasons ¶
type DefaultDecisionReasons struct {
// contains filtered or unexported fields
}
DefaultDecisionReasons provides the default implementation of DecisionReasons.
func NewDecisionReasons ¶
func NewDecisionReasons(options *Options) *DefaultDecisionReasons
NewDecisionReasons returns a new instance of DecisionReasons.
func (*DefaultDecisionReasons) AddError ¶
func (o *DefaultDecisionReasons) AddError(format string, arguments ...interface{})
AddError appends given message to the error list.
func (*DefaultDecisionReasons) AddInfo ¶
func (o *DefaultDecisionReasons) AddInfo(format string, arguments ...interface{}) string
AddInfo appends given info message to the info list after formatting.
func (*DefaultDecisionReasons) Append ¶
func (o *DefaultDecisionReasons) Append(reasons DecisionReasons)
Append appends given reasons.
func (*DefaultDecisionReasons) ToReport ¶
func (o *DefaultDecisionReasons) ToReport() []string
ToReport returns reasons to be reported.
type OptimizelyDecideOptions ¶
type OptimizelyDecideOptions string
OptimizelyDecideOptions controlling flag decisions.
const ( // DisableDecisionEvent when set, disables decision event tracking. DisableDecisionEvent OptimizelyDecideOptions = "DISABLE_DECISION_EVENT" // EnabledFlagsOnly when set, returns decisions only for flags which are enabled. EnabledFlagsOnly OptimizelyDecideOptions = "ENABLED_FLAGS_ONLY" // IgnoreUserProfileService when set, skips user profile service for decision. IgnoreUserProfileService OptimizelyDecideOptions = "IGNORE_USER_PROFILE_SERVICE" // IncludeReasons when set, includes info and debug messages in the decision reasons. IncludeReasons OptimizelyDecideOptions = "INCLUDE_REASONS" // ExcludeVariables when set, excludes variable values from the decision result. ExcludeVariables OptimizelyDecideOptions = "EXCLUDE_VARIABLES" )
func TranslateOptions ¶
func TranslateOptions(options []string) ([]OptimizelyDecideOptions, error)
TranslateOptions converts string options array to array of OptimizelyDecideOptions