Versions in this module Expand all Collapse all v1 v1.0.0 Apr 9, 2022 Changes in this version + var ErrClauseValuesCannotBeEmpty = errors.New("clause values cannot be empty") + var ErrEvaluationFlag = errors.New("error while evaluating flag") + var ErrOperatorCannotBeEmpty = errors.New("operator cannot be empty") + var ErrQueryProviderMissing = errors.New("query field is missing in evaluator") + var ErrTargetAttributeCannotBeEmpty = errors.New("attribute cannot be empty") + var ErrVariationNotFound = errors.New("variation not found") + var ErrWrongTypeAssertion = errors.New("wrong type assertion") + func SetLogger(logger Logger) + type Boolean bool + func NewBoolean(value interface{}) (*Boolean, error) + func (b Boolean) Contains([]interface{}) bool + func (b Boolean) EndsWith([]interface{}) bool + func (b Boolean) Equal(value []interface{}) bool + func (b Boolean) EqualSensitive([]interface{}) bool + func (b Boolean) GreaterThan([]interface{}) bool + func (b Boolean) GreaterThanEqual([]interface{}) bool + func (b Boolean) In([]interface{}) bool + func (b Boolean) LessThan([]interface{}) bool + func (b Boolean) LessThanEqual([]interface{}) bool + func (b Boolean) Match([]interface{}) bool + func (b Boolean) StartsWith([]interface{}) bool + type Clause struct + Attribute string + Negate bool + Operator string + Values []interface{} + type Configuration struct + DefaultServe Serve + Deprecated bool + Environment string + Identifier string + OffVariation string + On bool + Organization string + Prerequisites []Prerequisite + Project string + Rules []ServingRule + TargetRules []TargetRule + Variations map[string]Variation + Version uint + type Configurations []Configuration + type DataProvider interface + GetFlag func(identifier interface{}) (Configuration, error) + GetTargetGroup func(identifier interface{}) (TargetGroup, error) + type Distribution struct + BucketBy string + Variations []WeightedVariation + func (d Distribution) IsEmpty() bool + type Evaluation struct + Environment string + Identifier string + Organization string + Project string + Value interface{} + type Evaluations []Evaluation + type Evaluator struct + func NewEvaluator(provider DataProvider) (Evaluator, error) + func (e Evaluator) Evaluate(key interface{}, target *Target) Variation + type Integer int64 + func NewInteger(value interface{}) (Integer, error) + func (n Integer) Contains([]interface{}) bool + func (n Integer) EndsWith([]interface{}) bool + func (n Integer) Equal(value []interface{}) bool + func (n Integer) EqualSensitive([]interface{}) bool + func (n Integer) GreaterThan(values []interface{}) bool + func (n Integer) GreaterThanEqual(values []interface{}) bool + func (n Integer) In(values []interface{}) bool + func (n Integer) LessThan(values []interface{}) bool + func (n Integer) LessThanEqual(values []interface{}) bool + func (n Integer) Match([]interface{}) bool + func (n Integer) StartsWith([]interface{}) bool + type Logger interface + Debug func(args ...interface{}) + Debugf func(template string, args ...interface{}) + Error func(args ...interface{}) + Errorf func(template string, args ...interface{}) + Fatal func(args ...interface{}) + Fatalf func(template string, args ...interface{}) + Info func(args ...interface{}) + Infof func(template string, args ...interface{}) + Panic func(args ...interface{}) + Panicf func(template string, args ...interface{}) + Warn func(args ...interface{}) + Warnf func(template string, args ...interface{}) + type Number float64 + func NewNumber(value interface{}) (Number, error) + func (n Number) Contains([]interface{}) bool + func (n Number) EndsWith(values []interface{}) bool + func (n Number) Equal(values []interface{}) bool + func (n Number) EqualSensitive(values []interface{}) bool + func (n Number) GreaterThan(values []interface{}) bool + func (n Number) GreaterThanEqual(values []interface{}) bool + func (n Number) In(values []interface{}) bool + func (n Number) LessThan(values []interface{}) bool + func (n Number) LessThanEqual(values []interface{}) bool + func (n Number) Match(values []interface{}) bool + func (n Number) StartsWith(values []interface{}) bool + type Prerequisite struct + Feature string + Variations []string + type Serve struct + Distribution *Distribution + Variation *string + func (s Serve) IsEmpty() bool + type ServingRule struct + Clauses []Clause + Priority int + Serve Serve + type Slice struct + func NewSlice(value interface{}) Slice + func (s Slice) Contains(values []interface{}) bool + func (s Slice) EndsWith(value []interface{}) bool + func (s Slice) Equal(value []interface{}) bool + func (s Slice) EqualSensitive(value []interface{}) bool + func (s Slice) GreaterThan(value []interface{}) bool + func (s Slice) GreaterThanEqual(value []interface{}) bool + func (s Slice) In(values []interface{}) bool + func (s Slice) LessThan(value []interface{}) bool + func (s Slice) LessThanEqual(value []interface{}) bool + func (s Slice) Match(value []interface{}) bool + func (s Slice) StartsWith(value []interface{}) bool + type String string + func NewString(value interface{}) (String, error) + func (s String) Contains(values []interface{}) bool + func (s String) EndsWith(values []interface{}) bool + func (s String) Equal(values []interface{}) bool + func (s String) EqualSensitive(values []interface{}) bool + func (s String) GreaterThan(values []interface{}) bool + func (s String) GreaterThanEqual(values []interface{}) bool + func (s String) In(values []interface{}) bool + func (s String) LessThan(values []interface{}) bool + func (s String) LessThanEqual(values []interface{}) bool + func (s String) Match(values []interface{}) bool + func (s String) StartsWith(values []interface{}) bool + func (s String) String() string + type Target struct + Attributes map[string]interface{} + Identifier string + Name string + func (t *Target) GetAttrType(attr string) (ValueType, error) + func (t *Target) GetAttrValue(attr string) reflect.Value + type TargetGroup struct + Excluded []string + Identifier string + Included []string + Name string + Rules []Clause + Version uint + type TargetGroups []TargetGroup + type TargetRule struct + Groups []string + Serve Serve + Targets []string + type Value interface + type ValueType interface + Contains func(values []interface{}) bool + EndsWith func(values []interface{}) bool + Equal func(values []interface{}) bool + EqualSensitive func(values []interface{}) bool + GreaterThan func(values []interface{}) bool + GreaterThanEqual func(values []interface{}) bool + In func(values []interface{}) bool + LessThan func(values []interface{}) bool + LessThanEqual func(values []interface{}) bool + Match func(values []interface{}) bool + StartsWith func(values []interface{}) bool + type Variation struct + Description *string + Identifier string + Name string + Value interface{} + func (v Variation) Bool(defaultValue bool) bool + func (v Variation) Int(defaultValue int) int + func (v Variation) IsNone() bool + func (v Variation) Map(defaultValue map[string]interface{}) map[string]interface{} + func (v Variation) Number(defaultValue float64) float64 + func (v Variation) String(defaultValue string) string + type WeightedVariation struct + Variation string + Weight int