match

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

View Source
var Definitions map[Type]Def

Definitions contains data for known definitions

Functions

func Count

func Count() int

Count return total count of match operators

Types

type Def

type Def struct {
	Name    string
	Aliases []string
	Math    []string
	Args    int
}

Def contains addition definitions for rule match type

func (Def) Names

func (d Def) Names() []string

Names returns full list of string names (including math symbols), that can be used to identify rule type

type Type

type Type byte

Type describes matcher type and uses primarily in rules

const (
	Unknown Type = 0

	IsNil     Type = 1 // Alias
	IsNull    Type = 1
	NotIsNil  Type = 2 // Alias
	NotIsNull Type = 2
	IsNotNull Type = 2 // Alias
	IsNotNil  Type = 2 // Alias

	Eq        Type = 3 // Alias
	Equals    Type = 3
	Neq       Type = 4 // Alias
	NotEquals Type = 4

	In    Type = 5
	NotIn Type = 6

	Gt               Type = 7 // Alias
	GreaterThan      Type = 7
	Lte              Type = 8 // Alias
	LesserThanEquals Type = 8 // Alias
	LowerThanEquals  Type = 8

	Gte               Type = 9 // Alias
	GreaterThanEquals Type = 9
	Lt                Type = 10 // Alias
	LesserThan        Type = 10 // Alias
	LowerThan         Type = 10

	Contains Type = 11
	Like     Type = 11 // Alias
)

List of supported rule operations

func All

func All() []Type

All returns full list of rule operations, except Unknown Used in tests primarily

func Not

func Not(operation Type) Type

Not reverses match condition

func (Type) Invert

func (t Type) Invert() Type

Invert returns inverted match

func (Type) IsCustom

func (t Type) IsCustom() bool

IsCustom returns true if type is custom type

func (Type) IsStandard

func (t Type) IsStandard() bool

IsStandard returns true if operation is in standard operations pool

func (Type) Names

func (t Type) Names() []string

Names returns full list of string names (including math symbols), that can be used to identify rule type

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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