matchers

package
v1.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package matchers //

Package matchers //

Package matchers //

Package matchers //

Package matchers //

Package matchers //

Package matchers //

Package matchers //

Package matchers //

Index

Constants

View Source
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

func Register(name string, matcher Matcher)

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

func SemverEvaluator(cond entities.Condition, user entities.UserContext) (int, error)

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

Matcher type is used to evaluate audience conditional primitives

func Get added in v1.4.0

func Get(name string) (Matcher, bool)

Get an implementation of a Matcher function by its registered name

type SemanticVersion added in v1.4.0

type SemanticVersion struct {
	Condition string // condition is always a string here
}

SemanticVersion defines the class

Directories

Path Synopsis
Package utils //
Package utils //

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL