machine

package
v0.0.0-...-41f8e05 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddConversion

func AddConversion(m *Machine, conversion func(m *Machine) error, preLast bool)

func AddFloatToTimestamp

func AddFloatToTimestamp(m *Machine) error

AddFloatToTimestamp adds a float (seconds) to a timestamp

func AddFloats

func AddFloats(m *Machine) error

AddFloats adds two floats

func AddIntToTimestamp

func AddIntToTimestamp(m *Machine) error

AddIntToTimestamp adds an integer (seconds) to a timestamp

func AddInts

func AddInts(m *Machine) error

AddInts adds two integers

func AddPushAttribute

func AddPushAttribute(m *Machine, tableIx int, ix int)

func AddPushAttribute2

func AddPushAttribute2(m *Machine, tableIx int, ix int)

func AddPushConstant

func AddPushConstant(m *Machine, val Value)

func AddPushPlaceHolder

func AddPushPlaceHolder(m *Machine, ix int)

func AddSecondsToTime

func AddSecondsToTime(m *Machine) error

func AddStrings

func AddStrings(m *Machine) error

AddStrings concatenates two strings

func AndBooleans

func AndBooleans(m *Machine) error

AndBooleans performs logical AND on two booleans

func BoolEqual

func BoolEqual(m *Machine) error

func BoolGreaterThan

func BoolGreaterThan(m *Machine) error

func BoolGreaterThanOrEqual

func BoolGreaterThanOrEqual(m *Machine) error

func BoolLessThan

func BoolLessThan(m *Machine) error

Boolean comparisons

func BoolLessThanOrEqual

func BoolLessThanOrEqual(m *Machine) error

func BoolNotEqual

func BoolNotEqual(m *Machine) error

func BooleanToFloat

func BooleanToFloat(m *Machine) error

BooleanToFloat converts the top boolean to float64

func BooleanToInt

func BooleanToInt(m *Machine) error

BooleanToInt converts the top boolean to int

func BooleanToString

func BooleanToString(m *Machine) error

BooleanToString converts the top boolean to string

func CompareBool

func CompareBool(m *Machine) error

func CompareFloat64

func CompareFloat64(m *Machine) error

func CompareInt64

func CompareInt64(m *Machine) error

func CompareString

func CompareString(m *Machine) error

func CompareTimestamp

func CompareTimestamp(m *Machine) error

func ConvertFloat64ToTime

func ConvertFloat64ToTime(m *Machine) error

ConvertFloat64ToTime replaces the first element of the stack (expected to be *float64) with *time.Time

func ConvertInt64ToTime

func ConvertInt64ToTime(m *Machine) error

ConvertInt64ToTime replaces the first element of the stack (expected to be *int64) with *time.Time

func ConvertStringToTime

func ConvertStringToTime(m *Machine) error

func ConvertTimeToFloat64

func ConvertTimeToFloat64(m *Machine) error

func ConvertTimeToInt64

func ConvertTimeToInt64(m *Machine) error

func ConvertTimeToString

func ConvertTimeToString(m *Machine) error

func DivideFloats

func DivideFloats(m *Machine) error

DivideFloats divides two floats

func DivideInts

func DivideInts(m *Machine) error

DivideInts divides two integers

func Float64Equal

func Float64Equal(m *Machine) error

func Float64GreaterThan

func Float64GreaterThan(m *Machine) error

func Float64GreaterThanOrEqual

func Float64GreaterThanOrEqual(m *Machine) error

func Float64LessThan

func Float64LessThan(m *Machine) error

Float64 comparisons

func Float64LessThanOrEqual

func Float64LessThanOrEqual(m *Machine) error

func Float64NotEqual

func Float64NotEqual(m *Machine) error

func FloatToBoolean

func FloatToBoolean(m *Machine) error

FloatToBoolean converts the top float64 to boolean

func FloatToInt

func FloatToInt(m *Machine) error

FloatToInt converts the top float64 to int

func FloatToString

func FloatToString(m *Machine) error

FloatToString converts the top float64 to string

func FloatToTimestamp

func FloatToTimestamp(m *Machine) error

FloatToTimestamp converts the top float64 (Unix timestamp) to time.Time

func IntEqual

func IntEqual(m *Machine) error

func IntGreaterThan

func IntGreaterThan(m *Machine) error

func IntGreaterThanOrEqual

func IntGreaterThanOrEqual(m *Machine) error

func IntLessThan

func IntLessThan(m *Machine) error

Integer comparisons

func IntLessThanOrEqual

func IntLessThanOrEqual(m *Machine) error

func IntNotEqual

func IntNotEqual(m *Machine) error

func IntToBoolean

func IntToBoolean(m *Machine) error

IntToBoolean converts the top int to boolean

func IntToFloat

func IntToFloat(m *Machine) error

IntToFloat converts the top int to float64

func IntToString

func IntToString(m *Machine) error

IntToString converts the top int to string

func IntToTimestamp

func IntToTimestamp(m *Machine) error

IntToTimestamp converts the top int (Unix timestamp) to time.Time

func InvertTopBool

func InvertTopBool(m *Machine) error

func IsNotNullCommand

func IsNotNullCommand(m *Machine) error

func IsNullCommand

func IsNullCommand(m *Machine) error

func LikeStrings

func LikeStrings(m *Machine) error

LikeStrings performs a simple pattern matching (like SQL LIKE)

func ModuloFloats

func ModuloFloats(m *Machine) error

ModuloFloats performs modulo operation on two floats

func ModuloInts

func ModuloInts(m *Machine) error

ModuloInts performs modulo operation on two integers

func MultiplyFloats

func MultiplyFloats(m *Machine) error

MultiplyFloats multiplies two floats

func MultiplyInts

func MultiplyInts(m *Machine) error

MultiplyInts multiplies two integers

func OrBooleans

func OrBooleans(m *Machine) error

OrBooleans performs logical OR on two booleans

func ReturnIfNotEqualZero

func ReturnIfNotEqualZero(m *Machine) error

func ReturnInverseIfNotEqualZero

func ReturnInverseIfNotEqualZero(m *Machine) error

func StringEqual

func StringEqual(m *Machine) error

func StringGreaterThan

func StringGreaterThan(m *Machine) error

func StringGreaterThanOrEqual

func StringGreaterThanOrEqual(m *Machine) error

func StringLessThan

func StringLessThan(m *Machine) error

String comparisons

func StringLessThanOrEqual

func StringLessThanOrEqual(m *Machine) error

func StringNotEqual

func StringNotEqual(m *Machine) error

func StringToBoolean

func StringToBoolean(m *Machine) error

StringToBoolean converts the top string to a boolean

func StringToFloat

func StringToFloat(m *Machine) error

StringToFloat converts the top string to a float64

func StringToInt

func StringToInt(m *Machine) error

StringToInt converts the top string to an integer

func StringToTimestamp

func StringToTimestamp(m *Machine) error

StringToTimestamp converts the top string to a time.Time

func SubtractFloatFromTimestamp

func SubtractFloatFromTimestamp(m *Machine) error

SubtractFloatFromTimestamp Subtracts a float (seconds) From a timestamp

func SubtractFloats

func SubtractFloats(m *Machine) error

SubtractFloats subtracts two floats

func SubtractIntFromTimestamp

func SubtractIntFromTimestamp(m *Machine) error

SubtractIntToTimestamp Subtracts an integer (seconds) to a timestamp

func SubtractInts

func SubtractInts(m *Machine) error

SubtractInts subtracts two integers

func SubtractTimestamps

func SubtractTimestamps(m *Machine) error

SubtractTimestamps subtracts two timestamps

func TimeEqual

func TimeEqual(m *Machine) error

func TimeGreaterThan

func TimeGreaterThan(m *Machine) error

func TimeGreaterThanOrEqual

func TimeGreaterThanOrEqual(m *Machine) error

func TimeLessThan

func TimeLessThan(m *Machine) error

Time comparisons

func TimeLessThanOrEqual

func TimeLessThanOrEqual(m *Machine) error

func TimeNotEqual

func TimeNotEqual(m *Machine) error

func TimestampToFloat

func TimestampToFloat(m *Machine) error

TimestampToFloat converts the top time.Time to a float64 (Unix timestamp with fractional seconds)

func TimestampToInteger

func TimestampToInteger(m *Machine) error

TimestampToInteger converts the top time.Time to an integer (Unix timestamp)

func TimestampToString

func TimestampToString(m *Machine) error

TimestampToString converts the top time.Time to a string

Types

type Command

type Command func(m *Machine) error

type Machine

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

Machine represents our command evaluator

func NewMachine

func NewMachine(args []Value) *Machine

NewMachine creates a new Machine instance

func (*Machine) AddCommand

func (m *Machine) AddCommand(c Command)

func (*Machine) AddCommandBeforeLast

func (m *Machine) AddCommandBeforeLast(c Command)

func (*Machine) Execute

func (m *Machine) Execute(placeHolders []Value, record1 data.Tuple, record2 data.Tuple) (Value, error)

func (*Machine) ReturnPlaceHolder

func (m *Machine) ReturnPlaceHolder(ix int) (Value, error)

type Stack

type Stack interface {
	// Push adds an element to the top of the stack.
	Push(x interface{})

	// Pop removes and returns the top element of the stack.
	// It returns false as the second return value if the stack is empty.
	Pop() (interface{}, bool)

	// Peek returns the top element of the stack without removing it.
	// It returns false as the second return value if the stack is empty.
	Peek() (interface{}, bool)

	// IsEmpty returns true if the stack is empty, false otherwise.
	IsEmpty() bool

	// Size returns the number of elements in the stack.
	Size() int

	// Clear removes all elements from the stack.
	Clear()
}

Stack is an interface that defines the standard operations of a stack data structure.

func NewStack

func NewStack() Stack

Jump to

Keyboard shortcuts

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