Documentation ¶
Index ¶
- Variables
- func SetLogger(logger Logger)
- type Boolean
- 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
- type Configuration
- type Configurations
- type DataProvider
- type Distribution
- type Evaluation
- type Evaluations
- type Evaluator
- type Integer
- 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
- type Number
- 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
- type Serve
- type ServingRule
- type 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
- 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
- type TargetGroup
- type TargetGroups
- type TargetRule
- type Value
- type ValueType
- type Variation
- 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
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Boolean ¶
type Boolean bool
Boolean type for clause attribute evaluation
func NewBoolean ¶
NewBoolean creates a Boolean instance with the object value
func (Boolean) EqualSensitive ¶
EqualSensitive always return false
func (Boolean) GreaterThan ¶
GreaterThan always return false
func (Boolean) GreaterThanEqual ¶
GreaterThanEqual always return false
func (Boolean) LessThanEqual ¶
LessThanEqual always return false
func (Boolean) StartsWith ¶
StartsWith always return false
type Configuration ¶
type Configuration struct { Organization string `json:"organization"` Project string `json:"project"` Environment string `json:"environment"` Identifier string `json:"identifier"` Deprecated bool `json:"deprecated"` On bool `json:"on"` OffVariation string `json:"offVariation"` Rules []ServingRule `json:"rules"` TargetRules []TargetRule `json:"targetRules"` Prerequisites []Prerequisite `json:"prerequisites"` DefaultServe Serve `json:"defaultServe"` Variations map[string]Variation `json:"variations"` Version uint `json:"version"` } // @name Configuration
type Configurations ¶
type Configurations []Configuration // @name Configurations
type DataProvider ¶
type DataProvider interface { GetTargetGroup(identifier interface{}) (TargetGroup, error) GetFlag(identifier interface{}) (Configuration, error) }
DataProvider provides methods for segment and flag retrieval
type Distribution ¶
type Distribution struct { BucketBy string `json:"bucketBy" validate:"required"` Variations []WeightedVariation `json:"variations" validate:"required"` } // @name Distribution
func (Distribution) IsEmpty ¶
func (d Distribution) IsEmpty() bool
type Evaluation ¶
type Evaluations ¶
type Evaluations []Evaluation // @name Evaluations
type Evaluator ¶
type Evaluator struct {
// contains filtered or unexported fields
}
Evaluator engine evaluates flag from provided query
func NewEvaluator ¶
func NewEvaluator(provider DataProvider) (Evaluator, error)
NewEvaluator constructs evaluator with query instance
type Integer ¶
type Integer int64
Integer type for clause attribute evaluation
func NewInteger ¶
NewInteger creates a Integer instance with the object value
func (Integer) EqualSensitive ¶
EqualSensitive always return false
func (Integer) GreaterThan ¶
GreaterThan checks if the number is greater than the value
func (Integer) GreaterThanEqual ¶
GreaterThanEqual checks if the number is greater or equal than the value
func (Integer) LessThanEqual ¶
LessThanEqual checks if the number is less or equal than the value
func (Integer) StartsWith ¶
StartsWith always return false
type Logger ¶
type Logger interface { Debug(args ...interface{}) Debugf(template string, args ...interface{}) Info(args ...interface{}) Infof(template string, args ...interface{}) Warn(args ...interface{}) Warnf(template string, args ...interface{}) Error(args ...interface{}) Errorf(template string, args ...interface{}) Panic(args ...interface{}) Panicf(template string, args ...interface{}) Fatal(args ...interface{}) Fatalf(template string, args ...interface{}) }
type Number ¶
type Number float64
Number type for clause attribute evaluation
func (Number) EqualSensitive ¶
EqualSensitive always return false
func (Number) GreaterThan ¶
GreaterThan checks if the number is greater than the value
func (Number) GreaterThanEqual ¶
GreaterThanEqual checks if the number is greater or equal than the value
func (Number) LessThanEqual ¶
LessThanEqual checks if the number is less or equal than the value
func (Number) StartsWith ¶
StartsWith always return false
type Prerequisite ¶
type Serve ¶
type Serve struct { Distribution *Distribution `json:"distribution,omitempty"` Variation *string `json:"variation,omitempty"` } // @name Serve
type ServingRule ¶
type Slice ¶
type Slice struct {
// contains filtered or unexported fields
}
Slice type for clause attribute evaluation
func NewSlice ¶
func NewSlice(value interface{}) Slice
NewSlice creates a Slice instance with the object value
func (Slice) EqualSensitive ¶
EqualSensitive always return false
func (Slice) GreaterThan ¶
GreaterThan always return false
func (Slice) GreaterThanEqual ¶
GreaterThanEqual always return false
func (Slice) In ¶
In compares the attributes held by the slice with the input values. it will first determine what type of slice this is, before casting values to the appropriate type.
func (Slice) LessThanEqual ¶
LessThanEqual always return false
func (Slice) StartsWith ¶
StartsWith always return false
type String ¶
type String string
String type for clause attribute evaluation
func (String) EqualSensitive ¶
EqualSensitive check if the string and value are equal (case sensitive)
func (String) GreaterThan ¶
GreaterThan checks if the string is greater than the value
func (String) GreaterThanEqual ¶
GreaterThanEqual checks if the string is greater or equal than the value
func (String) LessThanEqual ¶
LessThanEqual checks if the string is less or equal than the value
func (String) StartsWith ¶
StartsWith check if the string starts with the value
type Target ¶
type Target struct { Identifier string `json:"identifier" validate:"required"` Name string `json:"name" validate:"required"` Attributes map[string]interface{} `json:"attributes"` } // @name Target
func (*Target) GetAttrType ¶
GetAttrType returns interface based on attribute value
type TargetGroup ¶
type TargetGroup struct { Identifier string `json:"identifier" validate:"required"` Name string `json:"name,omitempty"` Included []string `json:"included,omitempty"` Excluded []string `json:"excluded,omitempty"` Rules []Clause `json:"rules,omitempty"` Version uint `json:"version"` } // @name TargetGroup
type TargetGroups ¶
type TargetGroups []TargetGroup // @name TargetGroups
type TargetRule ¶
type ValueType ¶
type ValueType interface { StartsWith(values []interface{}) bool EndsWith(values []interface{}) bool Match(values []interface{}) bool Contains(values []interface{}) bool EqualSensitive(values []interface{}) bool Equal(values []interface{}) bool GreaterThan(values []interface{}) bool GreaterThanEqual(values []interface{}) bool LessThan(values []interface{}) bool LessThanEqual(values []interface{}) bool In(values []interface{}) bool }
ValueType interface used for different clause types
type Variation ¶
type Variation struct { Identifier string `json:"identifier"` Name string `json:"name"` Description *string `json:"description,omitempty"` Value interface{} `json:"value"` // contains filtered or unexported fields } // @name Variation