Documentation
¶
Overview ¶
Package matchers //
Package matchers //
Package matchers //
Package matchers //
Package matchers //
Package matchers //
Package matchers //
Package matchers //
Package matchers //
Index ¶
- Constants
- func ExactMatcher(condition entities.Condition, user entities.UserContext, ...) (bool, error)
- func ExistsMatcher(condition entities.Condition, user entities.UserContext, ...) (bool, error)
- func GeMatcher(condition entities.Condition, user entities.UserContext, ...) (bool, error)
- func GtMatcher(condition entities.Condition, user entities.UserContext, ...) (bool, error)
- func LeMatcher(condition entities.Condition, user entities.UserContext, ...) (bool, error)
- func LtMatcher(condition entities.Condition, user entities.UserContext, ...) (bool, error)
- func Register(name string, matcher Matcher)
- func SemverEqMatcher(condition entities.Condition, user entities.UserContext, ...) (bool, error)
- func SemverEvaluator(cond entities.Condition, user entities.UserContext) (int, error)
- func SemverGeMatcher(condition entities.Condition, user entities.UserContext, ...) (bool, error)
- func SemverGtMatcher(condition entities.Condition, user entities.UserContext, ...) (bool, error)
- func SemverLeMatcher(condition entities.Condition, user entities.UserContext, ...) (bool, error)
- func SemverLtMatcher(condition entities.Condition, user entities.UserContext, ...) (bool, error)
- func SubstringMatcher(condition entities.Condition, user entities.UserContext, ...) (bool, error)
- type Matcher
- type SemanticVersion
Constants ¶
const ( // ExactMatchType name for the "exact" matcher ExactMatchType = "exact" // ExistsMatchType name for the "exists" matcher ExistsMatchType = "exists" // LtMatchType name for the "lt" matcher LtMatchType = "lt" // LeMatchType name for the "le" matcher LeMatchType = "le" // GtMatchType name for the "gt" matcher GtMatchType = "gt" // GeMatchType name for the "ge" matcher GeMatchType = "ge" // SubstringMatchType name for the "substring" matcher SubstringMatchType = "substring" // SemverEqMatchType name for the semver_eq matcher SemverEqMatchType = "semver_eq" // SemverLtMatchType name for the semver_eq matcher SemverLtMatchType = "semver_lt" // SemverLeMatchType name for the semver_eq matcher SemverLeMatchType = "semver_le" // SemverGtMatchType name for the semver_eq matcher SemverGtMatchType = "semver_gt" // SemverGeMatchType name for the semver_eq matcher SemverGeMatchType = "semver_ge" )
Variables ¶
This section is empty.
Functions ¶
func ExactMatcher ¶
func ExactMatcher(condition entities.Condition, user entities.UserContext, logger logging.OptimizelyLogProducer) (bool, error)
ExactMatcher matches against the "exact" match type
func ExistsMatcher ¶
func ExistsMatcher(condition entities.Condition, user entities.UserContext, logger logging.OptimizelyLogProducer) (bool, error)
ExistsMatcher matches against the "exists" match type
func GeMatcher ¶ added in v1.4.0
func GeMatcher(condition entities.Condition, user entities.UserContext, logger logging.OptimizelyLogProducer) (bool, error)
GeMatcher matches against the "ge" match type
func GtMatcher ¶
func GtMatcher(condition entities.Condition, user entities.UserContext, logger logging.OptimizelyLogProducer) (bool, error)
GtMatcher matches against the "gt" match type
func LeMatcher ¶ added in v1.4.0
func LeMatcher(condition entities.Condition, user entities.UserContext, logger logging.OptimizelyLogProducer) (bool, error)
LeMatcher matches against the "le" match type
func LtMatcher ¶
func LtMatcher(condition entities.Condition, user entities.UserContext, logger logging.OptimizelyLogProducer) (bool, error)
LtMatcher matches against the "lt" match type
func Register ¶ added in v1.4.0
Register new matchers by providing a name and a Matcher implementation
func SemverEqMatcher ¶ added in v1.4.0
func SemverEqMatcher(condition entities.Condition, user entities.UserContext, logger logging.OptimizelyLogProducer) (bool, error)
SemverEqMatcher returns true if the user's semver attribute is equal to the semver condition value
func SemverEvaluator ¶ added in v1.4.0
SemverEvaluator is a help function to wrap a common evaluation code
func SemverGeMatcher ¶ added in v1.4.0
func SemverGeMatcher(condition entities.Condition, user entities.UserContext, logger logging.OptimizelyLogProducer) (bool, error)
SemverGeMatcher returns true if the user's semver attribute is greater or equal to the semver condition value
func SemverGtMatcher ¶ added in v1.4.0
func SemverGtMatcher(condition entities.Condition, user entities.UserContext, logger logging.OptimizelyLogProducer) (bool, error)
SemverGtMatcher returns true if the user's semver attribute is greater than the semver condition value
func SemverLeMatcher ¶ added in v1.4.0
func SemverLeMatcher(condition entities.Condition, user entities.UserContext, logger logging.OptimizelyLogProducer) (bool, error)
SemverLeMatcher returns true if the user's semver attribute is less than or equal to the semver condition value
func SemverLtMatcher ¶ added in v1.4.0
func SemverLtMatcher(condition entities.Condition, user entities.UserContext, logger logging.OptimizelyLogProducer) (bool, error)
SemverLtMatcher returns true if the user's semver attribute is less than the semver condition value
func SubstringMatcher ¶
func SubstringMatcher(condition entities.Condition, user entities.UserContext, logger logging.OptimizelyLogProducer) (bool, error)
SubstringMatcher matches against the "substring" match type
Types ¶
type Matcher ¶
type Matcher func(entities.Condition, entities.UserContext, logging.OptimizelyLogProducer) (bool, error)
Matcher type is used to evaluate audience conditional primitives
type SemanticVersion ¶ added in v1.4.0
type SemanticVersion struct {
Condition string // condition is always a string here
}
SemanticVersion defines the class