expr

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package expr provides a predicate expression parser and evaluator for the oq query language.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Expr

type Expr interface {
	Eval(row Row) Value
}

Expr is the interface for all expression nodes.

func Parse

func Parse(input string) (Expr, error)

Parse parses a predicate expression string into an Expr tree.

type Row

type Row interface {
	Field(name string) Value
}

Row provides field access for predicate evaluation.

type Value

type Value struct {
	Kind ValueKind
	Str  string
	Int  int
	Bool bool
}

Value represents a typed value in the expression system.

func BoolVal

func BoolVal(b bool) Value

BoolVal creates a bool Value.

func IntVal

func IntVal(n int) Value

IntVal creates an int Value.

func NullVal

func NullVal() Value

NullVal creates a null Value.

func StringVal

func StringVal(s string) Value

StringVal creates a string Value.

type ValueKind

type ValueKind int
const (
	KindString ValueKind = iota
	KindInt
	KindBool
	KindNull
)

Jump to

Keyboard shortcuts

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