arithmetic

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 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 Arithmetic

type Arithmetic struct {
}

func (Arithmetic) Id

func (a Arithmetic) Id() string

func (Arithmetic) Initialize

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

func (Arithmetic) Run

func (a Arithmetic) 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 (Arithmetic) Stop

func (a Arithmetic) 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 Math

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

func NewMath

func NewMath(mainBranch string, dataQuery map[string]interface{}) *Math

func (Math) Data

func (m Math) Data() map[string]interface{}

func (Math) Run

func (m Math) Run(leafNodes map[string]*LeafNode) error

type Operator

type Operator string
const (
	Add            Operator = "add"
	Subtract       Operator = "subtract"
	Multiplication Operator = "multiplication"
	Division       Operator = "division"
)

type Option

type Option struct {
	List        map[string]*LeafNode `json:"list"`
	NextError   string               `json:"next_error"`
	NextSuccess string               `json:"next_success"`
	Debug       bool                 `json:"debug"`
}

Jump to

Keyboard shortcuts

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