model

package
v0.0.0-...-a749b47 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2018 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// And is the Logical Operator And
	And = "and"
	// Or is the Logical Operator Or
	Or = "or"
	//Equal is the Equal value comparator
	Equal = "="
	//Regexp is the Equal value comparator
	Regexp = "regexp"
	// Greater is the Greater value comparator
	Greater = ">"
	// Lesser is the Lesser value comparator
	Less = "<"
	// Nil is the Greater value comparator
	Nil = "nil"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	JSON string
}

Action TBD

type Condition

type Condition interface {
	IsMet(currentEntityJSON *string) (bool, error)
}

Condition needs to be implemented

type LogicalCondition

type LogicalCondition struct {
	Operator   string
	Conditions []Condition
}

LogicalCondition

func (*LogicalCondition) Add

func (comparator *LogicalCondition) Add(condition Condition)

Add func implements interface, byt adding condition

func (*LogicalCondition) IsMet

func (comparator *LogicalCondition) IsMet(currentEntityJSON *string) (bool, error)

IsMet func implements IsMet

func (*LogicalCondition) Remove

func (comparator *LogicalCondition) Remove(condition Condition)

Remove func implements interface, by Removing condition

type NumberComparatorCondition

type NumberComparatorCondition struct {
	Path     string
	Operator string
	Value    float64
}

NumberComparatorCondition compares number

func (*NumberComparatorCondition) IsMet

func (comparator *NumberComparatorCondition) IsMet(currentEntityJSON *string) (bool, error)

IsMet verifies whether the condition is met

type Rule

type Rule struct {
	ID        string
	Name      string
	Entity    string
	Condition Condition
	Actions   interface{}
}

Rule compare

type StringComparatorCondition

type StringComparatorCondition struct {
	Path     string
	Operator string
	Value    string
}

StringComparatorCondition compares string

func (*StringComparatorCondition) IsMet

func (comparator *StringComparatorCondition) IsMet(currentEntityJSON *string) (bool, error)

IsMet verifies whether the condition is met

Jump to

Keyboard shortcuts

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