matchers

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 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 //

Package matchers //

Index

Constants

View Source
const (
	// QualifiedMatchType name for the "qualified" matcher
	QualifiedMatchType = "qualified"
	// 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

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

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 QualifiedMatcher

func QualifiedMatcher(condition entities.Condition, user entities.UserContext, logger logging.OptimizelyLogProducer) (bool, error)

QualifiedMatcher matches against the "qualified" match type

func Register

func Register(name string, matcher Matcher)

Register new matchers by providing a name and a Matcher implementation

func SemverEqMatcher

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

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

SemverEvaluator is a help function to wrap a common evaluation code

func SemverGeMatcher

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

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

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

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

func Get(name string) (Matcher, bool)

Get an implementation of a Matcher function by its registered name

type SemanticVersion

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