Documentation ¶
Index ¶
Constants ¶
View Source
const CohortKeyName = "cohort"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Condition ¶
type Condition struct { Key string `json:"key"` Op ConditionOpType `json:"op"` LogicOperator LogicOperatorType `json:"logic_operator"` Value interface{} `json:"value"` Type ConditionValueType `json:"type"` Method StringCompareMethod `json:"method"` PropertyType string `json:"property_type"` }
func (*Condition) JudgeCohort ¶ added in v1.0.5
func (*Condition) JudgeExperimentCohort ¶
type ConditionOpType ¶
type ConditionOpType string
const ( GreaterThan ConditionOpType = ">" GreaterThanOrEqual ConditionOpType = ">=" LessThan ConditionOpType = "<" LessThanOrEqual ConditionOpType = "<=" IN ConditionOpType = "in" NotIn ConditionOpType = "ni" IsNull ConditionOpType = "is_null" IsNotNull ConditionOpType = "is_not_null" )
type ConditionValueType ¶
type ConditionValueType string
const ( INT ConditionValueType = "int" FLOAT ConditionValueType = "float" NUMBER ConditionValueType = "number" STRING ConditionValueType = "string" BOOL ConditionValueType = "boolean" )
type ConditionValueTyper ¶
type LogicOperatorType ¶
type LogicOperatorType = string
const ( AND LogicOperatorType = "&&" OR LogicOperatorType = "||" )
type MatcherFn ¶
type MatcherFn func(attrValue interface{}, condValue interface{}, method StringCompareMethod) bool
func MathFunc ¶
func MathFunc(op ConditionOpType) MatcherFn
type NumberTyper ¶
type NumberTyper struct { }
func (NumberTyper) AdaptValue ¶
func (n NumberTyper) AdaptValue(condValue, attrValue interface{}) (float64Cond, float64Attr interface{}, err error)
func (NumberTyper) EvaluateKind ¶
func (n NumberTyper) EvaluateKind(v reflect.Value) bool
type StringCompareMethod ¶
type StringCompareMethod = string
const ( DictCompare StringCompareMethod = "dict" SemverCompare StringCompareMethod = "version" )
type StringTyper ¶
type StringTyper struct { }
func (StringTyper) AdaptValue ¶
func (s StringTyper) AdaptValue(condValue, attrValue interface{}) (stringCond interface{}, stringAttr interface{}, err error)
func (StringTyper) EvaluateKind ¶
func (s StringTyper) EvaluateKind(v reflect.Value) bool
Click to show internal directories.
Click to hide internal directories.