conditional

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conditional

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

func NewConditional

func NewConditional(mainBranch string, dataQuery map[string]interface{}) *Conditional

func (Conditional) Data

func (r Conditional) Data() map[string]interface{}

func (Conditional) Run

func (r Conditional) Run(leafNode *LeafNode, setResultTo string) (res bool, err error)

type ConditionalRule

type ConditionalRule struct {
}

func (ConditionalRule) Id

func (a ConditionalRule) Id() string

func (ConditionalRule) Initialize

func (a ConditionalRule) Initialize(ctx context.Context, options map[string]interface{}) error

func (ConditionalRule) Run

func (a ConditionalRule) Run(ctx context.Context, subscribeQueueInput func(ctx context.Context, callback queue.SubscribeFunction[*data.InputEngine]) error, pushQueueOutput func(ctx context.Context, input *data.OutputEngine) error)

func (ConditionalRule) Stop

func (a ConditionalRule) Stop(ctx context.Context) error

type DataType

type DataType string
const (
	ValueType    DataType = "val"
	NumberType   DataType = "number"
	OperatorType DataType = "operator"
	NoneType     DataType = "none"
)

type LeafNode

type LeafNode struct {
	Left     *LeafNode `json:"left"`
	Right    *LeafNode `json:"right"`
	Type     DataType  `json:"type"`
	Operator Operator  `json:"operator"`
	Value    string    `json:"value"`
}

type Operator

type Operator string
const (
	Equal              Operator = "=="
	Difference         Operator = "<>"
	LessThanOrEqual    Operator = "<="
	LessThan           Operator = "<"
	GreaterThan        Operator = ">"
	GreaterThanOrEqual Operator = ">="
	And                Operator = "&&"
	Or                 Operator = "||"
)

type Option

type Option struct {
	Operator         *LeafNode `json:"operator"`
	SetParamResultTo string    `json:"set_param_result_to"`
	NextError        string    `json:"next_error"`
	NextTrue         string    `json:"next_true"`
	NextFalse        string    `json:"next_false"`
	Debug            bool      `json:"debug"`
}

type Result

type Result struct {
	End     bool
	Result  bool
	IsValue bool
	Type    daq.TypeData
	Value   interface{}
}

type ResultCompare

type ResultCompare struct {
	IsString bool

	LeftNumber  float64
	RightNumber float64
	LeftString  string
	RightString string

	IsResult    bool
	LeftResult  bool
	RightResult bool
}

Jump to

Keyboard shortcuts

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