expressions

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Index

Constants

View Source
const DefaultWaitTimeout = 5000

Variables

This section is empty.

Functions

func NewForInIterableExpression added in v0.13.0

func NewForInIterableExpression(
	src core.SourceMap,
	valVariable,
	keyVariable string,
	exp core.Expression,
) (collections.Iterable, error)

func NewForWhileIterableExpression added in v0.13.0

func NewForWhileIterableExpression(
	src core.SourceMap,
	mode collections.WhileMode,
	valVariable string,
	condition core.Expression,
) (collections.Iterable, error)

func SuppressErrors added in v0.16.0

func SuppressErrors(exp core.Expression) (core.Expression, error)

Types

type BlockExpression

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

func NewBlockExpression

func NewBlockExpression(values collections.Iterable) (*BlockExpression, error)

func (*BlockExpression) Add

func (exp *BlockExpression) Add(stmt core.Expression)

func (*BlockExpression) Exec

func (exp *BlockExpression) Exec(ctx context.Context, scope *core.Scope) (core.Value, error)

func (*BlockExpression) Iterate added in v0.5.0

func (exp *BlockExpression) Iterate(ctx context.Context, scope *core.Scope) (collections.Iterator, error)

type BodyExpression added in v0.5.0

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

func NewBodyExpression added in v0.5.0

func NewBodyExpression(size int) *BodyExpression

func (*BodyExpression) Add added in v0.5.0

func (b *BodyExpression) Add(exp core.Expression) error

func (*BodyExpression) Exec added in v0.5.0

func (b *BodyExpression) Exec(ctx context.Context, scope *core.Scope) (core.Value, error)

type ConditionExpression

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

func NewConditionExpression

func NewConditionExpression(
	src core.SourceMap,
	test core.Expression,
	consequent core.Expression,
	alternate core.Expression,
) (*ConditionExpression, error)

func (*ConditionExpression) Exec

func (e *ConditionExpression) Exec(ctx context.Context, scope *core.Scope) (core.Value, error)

type ForExpression

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

func NewForExpression

func NewForExpression(
	src core.SourceMap,
	dataSource collections.Iterable,
	predicate core.Expression,
	distinct,
	spread,
	passThrough bool,
) (*ForExpression, error)

func (*ForExpression) AddCollect added in v0.4.0

func (e *ForExpression) AddCollect(src core.SourceMap, params *clauses.Collect) error

func (*ForExpression) AddFilter

func (e *ForExpression) AddFilter(src core.SourceMap, exp core.Expression) error

func (*ForExpression) AddLimit

func (e *ForExpression) AddLimit(src core.SourceMap, size, count core.Expression) error

func (*ForExpression) AddSort

func (e *ForExpression) AddSort(src core.SourceMap, sorters ...*clauses.SorterExpression) error

func (*ForExpression) AddStatement added in v0.5.0

func (e *ForExpression) AddStatement(stmt core.Expression) error

func (*ForExpression) Exec

func (e *ForExpression) Exec(ctx context.Context, scope *core.Scope) (core.Value, error)

type ForInIterableExpression added in v0.13.0

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

func (*ForInIterableExpression) Iterate added in v0.13.0

func (iterable *ForInIterableExpression) Iterate(ctx context.Context, scope *core.Scope) (collections.Iterator, error)

type ForResult added in v0.16.0

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

func NewForResult added in v0.16.0

func NewForResult(capacity int) *ForResult

func (*ForResult) Distinct added in v0.16.0

func (f *ForResult) Distinct(distinct bool) *ForResult

func (*ForResult) PassThrough added in v0.16.0

func (f *ForResult) PassThrough(passThrough bool) *ForResult

func (*ForResult) Push added in v0.16.0

func (f *ForResult) Push(value core.Value)

func (*ForResult) Spread added in v0.16.0

func (f *ForResult) Spread(spread bool) *ForResult

func (*ForResult) ToArray added in v0.16.0

func (f *ForResult) ToArray() *values.Array

type ForWhileIterableExpression added in v0.13.0

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

func (*ForWhileIterableExpression) Iterate added in v0.13.0

type FunctionCallExpression

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

func NewFunctionCallExpression

func NewFunctionCallExpression(
	src core.SourceMap,
	fun core.Function,
	args []core.Expression,
) (*FunctionCallExpression, error)

func NewFunctionCallExpressionWith added in v0.16.0

func NewFunctionCallExpressionWith(
	src core.SourceMap,
	fun core.Function,
	args ...core.Expression,
) (*FunctionCallExpression, error)

func (*FunctionCallExpression) Arguments added in v0.4.0

func (e *FunctionCallExpression) Arguments() []core.Expression

func (*FunctionCallExpression) Exec

func (e *FunctionCallExpression) Exec(ctx context.Context, scope *core.Scope) (core.Value, error)

func (*FunctionCallExpression) Function added in v0.4.0

func (e *FunctionCallExpression) Function() core.Function

type MemberExpression

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

func NewMemberExpression

func NewMemberExpression(src core.SourceMap, source core.Expression, path []*MemberPathSegment, preCompiledPath []core.Value) (*MemberExpression, error)

func (*MemberExpression) Exec

func (e *MemberExpression) Exec(ctx context.Context, scope *core.Scope) (core.Value, error)

type MemberPathSegment added in v0.16.0

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

func NewMemberPathSegment added in v0.16.0

func NewMemberPathSegment(source core.Expression, optional bool) (*MemberPathSegment, error)

type ParameterExpression

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

func NewParameterExpression

func NewParameterExpression(src core.SourceMap, name string) (*ParameterExpression, error)

func (*ParameterExpression) Exec

type ReturnExpression

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

func NewReturnExpression

func NewReturnExpression(
	src core.SourceMap,
	predicate core.Expression,
) (*ReturnExpression, error)

func (*ReturnExpression) Exec

func (e *ReturnExpression) Exec(ctx context.Context, scope *core.Scope) (core.Value, error)

func (*ReturnExpression) Predicate added in v0.16.0

func (e *ReturnExpression) Predicate() core.Expression

type SuppressibleExpression added in v0.16.0

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

func (*SuppressibleExpression) Exec added in v0.16.0

func (exp *SuppressibleExpression) Exec(ctx context.Context, scope *core.Scope) (core.Value, error)

func (*SuppressibleExpression) Maybe added in v0.16.0

func (exp *SuppressibleExpression) Maybe(value core.Value, err error) (core.Value, error)

type VariableDeclarationExpression

type VariableDeclarationExpression struct {
	*VariableExpression
	// contains filtered or unexported fields
}

func NewVariableDeclarationExpression

func NewVariableDeclarationExpression(src core.SourceMap, name string, init core.Expression) (*VariableDeclarationExpression, error)

func (*VariableDeclarationExpression) Exec

type VariableExpression

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

func NewVariableExpression

func NewVariableExpression(src core.SourceMap, name string) (*VariableExpression, error)

func (*VariableExpression) Exec

func (e *VariableExpression) Exec(_ context.Context, scope *core.Scope) (core.Value, error)

type Vector added in v0.16.0

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

Vector TODO: Finish and add unit tests

func NewVector added in v0.16.0

func NewVector(capacity int) *Vector

func (*Vector) ForEach added in v0.16.0

func (vec *Vector) ForEach(predicate func(item core.Value, index int))

func (*Vector) Get added in v0.16.0

func (vec *Vector) Get(index int) core.Value

func (*Vector) Push added in v0.16.0

func (vec *Vector) Push(value core.Value) *Vector

func (*Vector) ToSlice added in v0.16.0

func (vec *Vector) ToSlice() []core.Value

type WaitForEventExpression added in v0.16.0

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

func NewWaitForEventExpression added in v0.16.0

func NewWaitForEventExpression(
	src core.SourceMap,
	eventName core.Expression,
	eventSource core.Expression,
) (*WaitForEventExpression, error)

func (*WaitForEventExpression) Exec added in v0.16.0

func (e *WaitForEventExpression) Exec(ctx context.Context, scope *core.Scope) (core.Value, error)

func (*WaitForEventExpression) SetFilter added in v0.16.0

func (e *WaitForEventExpression) SetFilter(src core.SourceMap, variable string, exp core.Expression) error

func (*WaitForEventExpression) SetOptions added in v0.16.0

func (e *WaitForEventExpression) SetOptions(options core.Expression) error

func (*WaitForEventExpression) SetTimeout added in v0.16.0

func (e *WaitForEventExpression) SetTimeout(timeout core.Expression) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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