evaluator

package
v1.3.0-beta3 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package evaluator //

Package evaluator //

Package evaluator //

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AudienceConditionEvaluator

type AudienceConditionEvaluator struct{}

AudienceConditionEvaluator evaluates conditions with audience condition

func (AudienceConditionEvaluator) Evaluate

func (c AudienceConditionEvaluator) Evaluate(audienceID string, condTreeParams *entities.TreeParameters) (bool, error)

Evaluate returns true if the given user's attributes match the condition

type AudienceEvaluator

type AudienceEvaluator interface {
	Evaluate(audience entities.Audience, condTreeParams *entities.TreeParameters) bool
}

AudienceEvaluator evaluates an audience against the given user's attributes

type CustomAttributeConditionEvaluator

type CustomAttributeConditionEvaluator struct{}

CustomAttributeConditionEvaluator evaluates conditions with custom attributes

func (CustomAttributeConditionEvaluator) Evaluate

func (c CustomAttributeConditionEvaluator) Evaluate(condition entities.Condition, condTreeParams *entities.TreeParameters) (bool, error)

Evaluate returns true if the given user's attributes match the condition

type ItemEvaluator

type ItemEvaluator interface {
	Evaluate(interface{}, *entities.TreeParameters) (bool, error)
}

ItemEvaluator evaluates a condition against the given user's attributes

type MixedTreeEvaluator

type MixedTreeEvaluator struct {
}

MixedTreeEvaluator evaluates a tree of mixed node types (condition node or audience nodes)

func NewMixedTreeEvaluator

func NewMixedTreeEvaluator() *MixedTreeEvaluator

NewMixedTreeEvaluator creates a condition tree evaluator with the out-of-the-box condition evaluators

func (MixedTreeEvaluator) Evaluate

func (c MixedTreeEvaluator) Evaluate(node *entities.TreeNode, condTreeParams *entities.TreeParameters) (evalResult, isValid bool)

Evaluate returns whether the userAttributes satisfy the given condition tree and the evaluation of the condition is valid or not (to handle null bubbling)

type TreeEvaluator

type TreeEvaluator interface {
	Evaluate(*entities.TreeNode, *entities.TreeParameters) (evalResult, isValid bool)
}

TreeEvaluator evaluates a tree

type TypedAudienceEvaluator

type TypedAudienceEvaluator struct {
	// contains filtered or unexported fields
}

TypedAudienceEvaluator evaluates typed audiences

func NewTypedAudienceEvaluator

func NewTypedAudienceEvaluator() *TypedAudienceEvaluator

NewTypedAudienceEvaluator creates a new instance of the TypedAudienceEvaluator

func (TypedAudienceEvaluator) Evaluate

func (a TypedAudienceEvaluator) Evaluate(audience entities.Audience, condTreeParams *entities.TreeParameters) (evalResult, isValid bool)

Evaluate evaluates the typed audience against the given user's attributes

Directories

Path Synopsis
Package matchers // Package matchers // Package matchers // Package matchers // Package matchers // Package matchers //
Package matchers // Package matchers // Package matchers // Package matchers // Package matchers // Package matchers //
utils
Package utils //
Package utils //

Jump to

Keyboard shortcuts

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