conditions

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountRules

func CountRules(c query.Condition) (out int)

CountRules returns amount of rules without condition

func ForAllRules

func ForAllRules(rules ...query.Rule) query.Condition

ForAllRules returns conditions built for all rules with logic AND

func ForAnyRule

func ForAnyRule(rules ...query.Rule) query.Condition

ForAnyRule returns conditions built for all rules with logic OR

func IsEmpty

func IsEmpty(c query.Condition) bool

IsEmpty returns true if given condition nil or contains no rules or nested conditions

func Map

Map applies mapping function to all rules (including nested) within given condition.

func New

func New(logic query.Logic, rules []query.Rule, conditions []query.Condition) query.Condition

New builds and returns new condition

func VisitRules

func VisitRules(c query.Condition, f func(query.Rule))

VisitRules applies callback function to every rule within condition and nested conditions.

func VisitRulesUntil

func VisitRulesUntil(c query.Condition, f func(query.Rule) bool) bool

VisitRulesUntil applies callback function to every rule within condition and nested conditions until at least callback function returns false. VisitRulesUntil returns true only if given callback function is not nil and all invocations of callback function (if any) also returns true.

Types

This section is empty.

Jump to

Keyboard shortcuts

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