stream

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidResult = errors.New("expression must evaluate to a document")

ErrInvalidResult is returned when an expression supposed to evaluate to a document returns something else.

View Source
var ErrStreamClosed = errors.New("stream closed")

ErrStreamClosed is used to indicate that a stream must be closed.

Functions

This section is empty.

Types

type Costable

type Costable interface {
	Cost() int
}

type DistinctOperator

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

A DistinctOperator filters duplicate documents.

func Distinct

func Distinct() *DistinctOperator

Distinct filters duplicate documents based on one or more expressions.

func (*DistinctOperator) GetNext

func (op *DistinctOperator) GetNext() Operator

func (*DistinctOperator) GetPrev

func (op *DistinctOperator) GetPrev() Operator

func (*DistinctOperator) Iterate

func (op *DistinctOperator) Iterate(in *expr.Environment, f func(out *expr.Environment) error) error

Iterate implements the Operator interface.

func (*DistinctOperator) SetNext

func (op *DistinctOperator) SetNext(o Operator)

func (*DistinctOperator) SetPrev

func (op *DistinctOperator) SetPrev(o Operator)

func (*DistinctOperator) String

func (op *DistinctOperator) String() string

type DocumentsOperator

type DocumentsOperator struct {
	Docs []document.Document
	// contains filtered or unexported fields
}

func Documents

func Documents(documents ...document.Document) *DocumentsOperator

Documents creates a DocumentsOperator that iterates over the given values.

func (*DocumentsOperator) GetNext

func (op *DocumentsOperator) GetNext() Operator

func (*DocumentsOperator) GetPrev

func (op *DocumentsOperator) GetPrev() Operator

func (*DocumentsOperator) Iterate

func (op *DocumentsOperator) Iterate(in *expr.Environment, fn func(out *expr.Environment) error) error

func (*DocumentsOperator) SetNext

func (op *DocumentsOperator) SetNext(o Operator)

func (*DocumentsOperator) SetPrev

func (op *DocumentsOperator) SetPrev(o Operator)

func (*DocumentsOperator) String

func (op *DocumentsOperator) String() string

type ExprsOperator

type ExprsOperator struct {
	Exprs []expr.Expr
	// contains filtered or unexported fields
}

func Expressions

func Expressions(exprs ...expr.Expr) *ExprsOperator

Expressions creates an operator that iterates over the given expressions. Each expression must evaluate to a document.

func (*ExprsOperator) GetNext

func (op *ExprsOperator) GetNext() Operator

func (*ExprsOperator) GetPrev

func (op *ExprsOperator) GetPrev() Operator

func (*ExprsOperator) Iterate

func (op *ExprsOperator) Iterate(in *expr.Environment, fn func(out *expr.Environment) error) error

func (*ExprsOperator) SetNext

func (op *ExprsOperator) SetNext(o Operator)

func (*ExprsOperator) SetPrev

func (op *ExprsOperator) SetPrev(o Operator)

func (*ExprsOperator) String

func (op *ExprsOperator) String() string

type FilterOperator

type FilterOperator struct {
	E expr.Expr
	// contains filtered or unexported fields
}

A FilterOperator filters values based on a given expression.

func Filter

func Filter(e expr.Expr) *FilterOperator

Filter evaluates e for each incoming value and filters any value whose result is not truthy.

func (*FilterOperator) GetNext

func (op *FilterOperator) GetNext() Operator

func (*FilterOperator) GetPrev

func (op *FilterOperator) GetPrev() Operator

func (*FilterOperator) Iterate

func (op *FilterOperator) Iterate(in *expr.Environment, f func(out *expr.Environment) error) error

Iterate implements the Operator interface.

func (*FilterOperator) SetNext

func (op *FilterOperator) SetNext(o Operator)

func (*FilterOperator) SetPrev

func (op *FilterOperator) SetPrev(o Operator)

func (*FilterOperator) String

func (op *FilterOperator) String() string

type GroupByOperator

type GroupByOperator struct {
	E expr.Expr
	// contains filtered or unexported fields
}

A GroupByOperator applies an expression on each value of the stream and stores the result in the _group variable in the output stream.

func GroupBy

func GroupBy(e expr.Expr) *GroupByOperator

GroupBy applies e on each value of the stream and stores the result in the _group variable in the output stream.

func (*GroupByOperator) GetNext

func (op *GroupByOperator) GetNext() Operator

func (*GroupByOperator) GetPrev

func (op *GroupByOperator) GetPrev() Operator

func (*GroupByOperator) Iterate

func (op *GroupByOperator) Iterate(in *expr.Environment, f func(out *expr.Environment) error) error

Iterate implements the Operator interface.

func (*GroupByOperator) SetNext

func (op *GroupByOperator) SetNext(o Operator)

func (*GroupByOperator) SetPrev

func (op *GroupByOperator) SetPrev(o Operator)

func (*GroupByOperator) String

func (op *GroupByOperator) String() string

type HashAggregateOperator

type HashAggregateOperator struct {
	Builders []expr.AggregatorBuilder
	// contains filtered or unexported fields
}

A HashAggregateOperator consumes the given stream and outputs one value per group. It reads the _group variable from the environment to determine witch group to assign each value. If no _group variable is available, it will assume all values are part of the same group and aggregate them into one value.

func HashAggregate

func HashAggregate(builders ...expr.AggregatorBuilder) *HashAggregateOperator

HashAggregate consumes the incoming stream and outputs one value per group. It reads the _group variable from the environment to determine whitch group to assign each value. If no _group variable is available, it will assume all values are part of the same group and aggregate them into one value. HashAggregate assumes that the stream is not sorted per group and uses a hash map to group aggregates per _group value.

func (*HashAggregateOperator) GetNext

func (op *HashAggregateOperator) GetNext() Operator

func (*HashAggregateOperator) GetPrev

func (op *HashAggregateOperator) GetPrev() Operator

func (*HashAggregateOperator) Iterate

func (op *HashAggregateOperator) Iterate(in *expr.Environment, f func(out *expr.Environment) error) error

func (*HashAggregateOperator) SetNext

func (op *HashAggregateOperator) SetNext(o Operator)

func (*HashAggregateOperator) SetPrev

func (op *HashAggregateOperator) SetPrev(o Operator)

func (*HashAggregateOperator) String

func (op *HashAggregateOperator) String() string

type IndexRange

type IndexRange struct {
	Min, Max *document.ValueBuffer

	// Exclude Min and Max from the results.
	// By default, min and max are inclusive.
	// Exclusive and Exact cannot be set to true at the same time.
	Exclusive bool
	// Used to match an exact value equal to Min.
	// If set to true, Max will be ignored for comparison
	// and for determining the global upper bound.
	Exact bool

	// IndexArity is the underlying index arity, which can be greater
	// than the boundaries of this range.
	IndexArity int
	// contains filtered or unexported fields
}

IndexRange represents a range to select indexed values after or before a given boundary. Because indexes can be composites, IndexRange boundaries are composite as well.

func (*IndexRange) IsEqual

func (r *IndexRange) IsEqual(other *IndexRange) bool

func (*IndexRange) IsInRange

func (r *IndexRange) IsInRange(value []byte) bool

func (*IndexRange) String

func (r *IndexRange) String() string

type IndexRanges

type IndexRanges []IndexRange

func (IndexRanges) Append

func (r IndexRanges) Append(rng IndexRange) IndexRanges

Append rng to r and return the new slice. Duplicate ranges are ignored.

func (IndexRanges) Cost

func (r IndexRanges) Cost() int

Cost is a best effort function to determine the cost of a range lookup.

func (IndexRanges) EncodeBuffer

func (r IndexRanges) EncodeBuffer(encoder ValueBufferEncoder, env *expr.Environment) error

Encode each range using the given value encoder.

func (IndexRanges) String

func (r IndexRanges) String() string

type IndexScanOperator

type IndexScanOperator struct {

	// IndexName references the index that will be used to perform the scan
	IndexName string
	// Ranges defines the boundaries of the scan, each corresponding to one value of the group of values
	// being indexed in the case of a composite index.
	Ranges IndexRanges
	// Reverse indicates the direction used to traverse the index.
	Reverse bool
	// contains filtered or unexported fields
}

A IndexScanOperator iterates over the documents of an index.

func IndexScan

func IndexScan(name string, ranges ...IndexRange) *IndexScanOperator

IndexScan creates an iterator that iterates over each document of the given table.

func IndexScanReverse

func IndexScanReverse(name string, ranges ...IndexRange) *IndexScanOperator

IndexScanReverse creates an iterator that iterates over each document of the given table in reverse order.

func (*IndexScanOperator) GetNext

func (op *IndexScanOperator) GetNext() Operator

func (*IndexScanOperator) GetPrev

func (op *IndexScanOperator) GetPrev() Operator

func (*IndexScanOperator) Iterate

func (it *IndexScanOperator) Iterate(in *expr.Environment, fn func(out *expr.Environment) error) error

Iterate over the documents of the table. Each document is stored in the environment that is passed to the fn function, using SetCurrentValue.

func (*IndexScanOperator) SetNext

func (op *IndexScanOperator) SetNext(o Operator)

func (*IndexScanOperator) SetPrev

func (op *IndexScanOperator) SetPrev(o Operator)

func (*IndexScanOperator) String

func (it *IndexScanOperator) String() string

type IterRenameOperator

type IterRenameOperator struct {
	FieldNames []string
	// contains filtered or unexported fields
}

An IterRenameOperator iterates over all fields of the incoming document in order and renames them.

func IterRename

func IterRename(fieldNames ...string) *IterRenameOperator

IterRename iterates over all fields of the incoming document in order and renames them. If the number of fields of the incoming document doesn't match the number of expected fields, it returns an error.

func (*IterRenameOperator) GetNext

func (op *IterRenameOperator) GetNext() Operator

func (*IterRenameOperator) GetPrev

func (op *IterRenameOperator) GetPrev() Operator

func (*IterRenameOperator) Iterate

func (op *IterRenameOperator) Iterate(in *expr.Environment, f func(out *expr.Environment) error) error

Iterate implements the Operator interface.

func (*IterRenameOperator) SetNext

func (op *IterRenameOperator) SetNext(o Operator)

func (*IterRenameOperator) SetPrev

func (op *IterRenameOperator) SetPrev(o Operator)

func (*IterRenameOperator) String

func (op *IterRenameOperator) String() string

type MapOperator

type MapOperator struct {
	E expr.Expr
	// contains filtered or unexported fields
}

A MapOperator applies an expression on each value of the stream and returns a new value.

func Map

func Map(e expr.Expr) *MapOperator

Map evaluates e on each value of the stream and outputs the result.

func (*MapOperator) GetNext

func (op *MapOperator) GetNext() Operator

func (*MapOperator) GetPrev

func (op *MapOperator) GetPrev() Operator

func (*MapOperator) Iterate

func (op *MapOperator) Iterate(in *expr.Environment, f func(out *expr.Environment) error) error

Iterate implements the Operator interface.

func (*MapOperator) SetNext

func (op *MapOperator) SetNext(o Operator)

func (*MapOperator) SetPrev

func (op *MapOperator) SetPrev(o Operator)

func (*MapOperator) String

func (op *MapOperator) String() string

type MaskDocument

type MaskDocument struct {
	Env   *expr.Environment
	Exprs []expr.Expr
}

func (*MaskDocument) GetByField

func (d *MaskDocument) GetByField(field string) (v document.Value, err error)

func (*MaskDocument) Iterate

func (d *MaskDocument) Iterate(fn func(field string, value document.Value) error) error

func (*MaskDocument) MarshalJSON

func (d *MaskDocument) MarshalJSON() ([]byte, error)

func (*MaskDocument) String

func (d *MaskDocument) String() string

type Operator

type Operator interface {
	Iterate(in *expr.Environment, fn func(out *expr.Environment) error) error
	SetPrev(prev Operator)
	SetNext(next Operator)
	GetNext() Operator
	GetPrev() Operator
	String() string
}

An Operator is used to modify a stream. It takes an environment containing the current value as well as any other metadata created by other operatorsand returns a new environment which will be passed to the next operator. If it returns a nil environment, the env will be ignored. If it returns an error, the stream will be interrupted and that error will bubble up and returned by this function, unless that error is ErrStreamClosed, in which case the Iterate method will stop the iteration and return nil. Stream operators can be reused, and thus, any state or side effect should be kept within the Op closure unless the nature of the operator prevents that.

func InsertAfter

func InsertAfter(op, newOp Operator) Operator

func InsertBefore

func InsertBefore(op, newOp Operator) Operator

func Pipe

func Pipe(ops ...Operator) Operator

type OperatorFunc

type OperatorFunc func(func(env *expr.Environment) error) error

An OperatorFunc is the function that will receive each value of the stream.

type PkScanOperator

type PkScanOperator struct {
	TableName string
	Ranges    ValueRanges
	Reverse   bool
	// contains filtered or unexported fields
}

A PkScanOperator iterates over the documents of a table.

func PkScan

func PkScan(tableName string, ranges ...ValueRange) *PkScanOperator

PkScan creates an iterator that iterates over each document of the given table.

func PkScanReverse

func PkScanReverse(tableName string, ranges ...ValueRange) *PkScanOperator

PkScanReverse creates an iterator that iterates over each document of the given table in reverse order.

func (*PkScanOperator) GetNext

func (op *PkScanOperator) GetNext() Operator

func (*PkScanOperator) GetPrev

func (op *PkScanOperator) GetPrev() Operator

func (*PkScanOperator) Iterate

func (it *PkScanOperator) Iterate(in *expr.Environment, fn func(out *expr.Environment) error) error

Iterate over the documents of the table. Each document is stored in the environment that is passed to the fn function, using SetCurrentValue.

func (*PkScanOperator) SetNext

func (op *PkScanOperator) SetNext(o Operator)

func (*PkScanOperator) SetPrev

func (op *PkScanOperator) SetPrev(o Operator)

func (*PkScanOperator) String

func (it *PkScanOperator) String() string

type ProjectOperator

type ProjectOperator struct {
	Exprs []expr.Expr
	// contains filtered or unexported fields
}

A ProjectOperator applies an expression on each value of the stream and returns a new value.

func Project

func Project(exprs ...expr.Expr) *ProjectOperator

Project creates a ProjectOperator.

func (*ProjectOperator) GetNext

func (op *ProjectOperator) GetNext() Operator

func (*ProjectOperator) GetPrev

func (op *ProjectOperator) GetPrev() Operator

func (*ProjectOperator) Iterate

func (op *ProjectOperator) Iterate(in *expr.Environment, f func(out *expr.Environment) error) error

Iterate implements the Operator interface.

func (*ProjectOperator) SetNext

func (op *ProjectOperator) SetNext(o Operator)

func (*ProjectOperator) SetPrev

func (op *ProjectOperator) SetPrev(o Operator)

func (*ProjectOperator) String

func (op *ProjectOperator) String() string

type SeqScanOperator

type SeqScanOperator struct {
	TableName string
	Reverse   bool
	// contains filtered or unexported fields
}

A SeqScanOperator iterates over the documents of a table.

func SeqScan

func SeqScan(tableName string) *SeqScanOperator

SeqScan creates an iterator that iterates over each document of the given table.

func SeqScanReverse

func SeqScanReverse(tableName string) *SeqScanOperator

SeqScanReverse creates an iterator that iterates over each document of the given table in reverse order.

func (*SeqScanOperator) GetNext

func (op *SeqScanOperator) GetNext() Operator

func (*SeqScanOperator) GetPrev

func (op *SeqScanOperator) GetPrev() Operator

func (*SeqScanOperator) Iterate

func (it *SeqScanOperator) Iterate(in *expr.Environment, fn func(out *expr.Environment) error) error

func (*SeqScanOperator) SetNext

func (op *SeqScanOperator) SetNext(o Operator)

func (*SeqScanOperator) SetPrev

func (op *SeqScanOperator) SetPrev(o Operator)

func (*SeqScanOperator) String

func (it *SeqScanOperator) String() string

type SetOperator

type SetOperator struct {
	Path document.Path
	E    expr.Expr
	// contains filtered or unexported fields
}

A SetOperator filters duplicate documents.

func Set

func Set(path document.Path, e expr.Expr) *SetOperator

Set filters duplicate documents based on one or more expressions.

func (*SetOperator) GetNext

func (op *SetOperator) GetNext() Operator

func (*SetOperator) GetPrev

func (op *SetOperator) GetPrev() Operator

func (*SetOperator) Iterate

func (op *SetOperator) Iterate(in *expr.Environment, f func(out *expr.Environment) error) error

Iterate implements the Operator interface.

func (*SetOperator) SetNext

func (op *SetOperator) SetNext(o Operator)

func (*SetOperator) SetPrev

func (op *SetOperator) SetPrev(o Operator)

func (*SetOperator) String

func (op *SetOperator) String() string

type SkipOperator

type SkipOperator struct {
	N int64
	// contains filtered or unexported fields
}

A SkipOperator skips the n first values of the stream.

func Skip

func Skip(n int64) *SkipOperator

Skip ignores the first n values of the stream.

func (*SkipOperator) GetNext

func (op *SkipOperator) GetNext() Operator

func (*SkipOperator) GetPrev

func (op *SkipOperator) GetPrev() Operator

func (*SkipOperator) Iterate

func (op *SkipOperator) Iterate(in *expr.Environment, f func(out *expr.Environment) error) error

Iterate implements the Operator interface.

func (*SkipOperator) SetNext

func (op *SkipOperator) SetNext(o Operator)

func (*SkipOperator) SetPrev

func (op *SkipOperator) SetPrev(o Operator)

func (*SkipOperator) String

func (op *SkipOperator) String() string

type SortOperator

type SortOperator struct {
	Expr expr.Expr
	Desc bool
	// contains filtered or unexported fields
}

A SortOperator consumes every value of the stream and outputs them in order.

func Sort

func Sort(e expr.Expr) *SortOperator

Sort consumes every value of the stream and outputs them in order. It operates a partial sort on the iterator using a heap. This ensures a O(k+n log n) time complexity, where k is the sum of Take() + Skip() operators, if provided, otherwise k = n. If the sorting is in ascending order, a min-heap will be used otherwise a max-heap will be used instead. Once the heap is filled entirely with the content of the incoming stream, a stream is returned. During iteration, the stream will pop the k-smallest or k-largest elements, depending on the chosen sorting order (ASC or DESC). This function is not memory efficient as it is loading the entire stream in memory before returning the k-smallest or k-largest elements.

func SortReverse

func SortReverse(e expr.Expr) *SortOperator

SortReverse does the same as Sort but in descending order.

func (*SortOperator) GetNext

func (op *SortOperator) GetNext() Operator

func (*SortOperator) GetPrev

func (op *SortOperator) GetPrev() Operator

func (*SortOperator) Iterate

func (op *SortOperator) Iterate(in *expr.Environment, f func(out *expr.Environment) error) error

func (*SortOperator) SetNext

func (op *SortOperator) SetNext(o Operator)

func (*SortOperator) SetPrev

func (op *SortOperator) SetPrev(o Operator)

func (*SortOperator) String

func (op *SortOperator) String() string

type Stream

type Stream struct {
	Op Operator
}

func New

func New(op Operator) *Stream

func (*Stream) Clone

func (s *Stream) Clone() *Stream

func (*Stream) First

func (s *Stream) First() Operator

func (*Stream) Iterate

func (s *Stream) Iterate(in *expr.Environment, fn func(out *expr.Environment) error) error

func (*Stream) Pipe

func (s *Stream) Pipe(op Operator) *Stream

func (*Stream) Remove

func (s *Stream) Remove(op Operator)

func (*Stream) String

func (s *Stream) String() string

type TableDeleteOperator

type TableDeleteOperator struct {
	Name string
	// contains filtered or unexported fields
}

A TableDeleteOperator replaces documents in the table

func TableDelete

func TableDelete(tableName string) *TableDeleteOperator

TableDelete deletes documents from the table. Incoming documents must implement the document.Keyer interface.

func (*TableDeleteOperator) GetNext

func (op *TableDeleteOperator) GetNext() Operator

func (*TableDeleteOperator) GetPrev

func (op *TableDeleteOperator) GetPrev() Operator

func (*TableDeleteOperator) Iterate

func (op *TableDeleteOperator) Iterate(in *expr.Environment, f func(out *expr.Environment) error) error

Iterate implements the Operator interface.

func (*TableDeleteOperator) SetNext

func (op *TableDeleteOperator) SetNext(o Operator)

func (*TableDeleteOperator) SetPrev

func (op *TableDeleteOperator) SetPrev(o Operator)

func (*TableDeleteOperator) String

func (op *TableDeleteOperator) String() string

type TableInsertOperator

type TableInsertOperator struct {
	Name string
	// contains filtered or unexported fields
}

A TableInsertOperator inserts incoming documents to the table.

func TableInsert

func TableInsert(tableName string) *TableInsertOperator

TableInsert inserts incoming documents to the table.

func (*TableInsertOperator) GetNext

func (op *TableInsertOperator) GetNext() Operator

func (*TableInsertOperator) GetPrev

func (op *TableInsertOperator) GetPrev() Operator

func (*TableInsertOperator) Iterate

func (op *TableInsertOperator) Iterate(in *expr.Environment, f func(out *expr.Environment) error) error

Iterate implements the Operator interface.

func (*TableInsertOperator) SetNext

func (op *TableInsertOperator) SetNext(o Operator)

func (*TableInsertOperator) SetPrev

func (op *TableInsertOperator) SetPrev(o Operator)

func (*TableInsertOperator) String

func (op *TableInsertOperator) String() string

type TableReplaceOperator

type TableReplaceOperator struct {
	Name string
	// contains filtered or unexported fields
}

A TableReplaceOperator replaces documents in the table

func TableReplace

func TableReplace(tableName string) *TableReplaceOperator

TableReplace replaces documents in the table. Incoming documents must implement the document.Keyer interface.

func (*TableReplaceOperator) GetNext

func (op *TableReplaceOperator) GetNext() Operator

func (*TableReplaceOperator) GetPrev

func (op *TableReplaceOperator) GetPrev() Operator

func (*TableReplaceOperator) Iterate

func (op *TableReplaceOperator) Iterate(in *expr.Environment, f func(out *expr.Environment) error) error

Iterate implements the Operator interface.

func (*TableReplaceOperator) SetNext

func (op *TableReplaceOperator) SetNext(o Operator)

func (*TableReplaceOperator) SetPrev

func (op *TableReplaceOperator) SetPrev(o Operator)

func (*TableReplaceOperator) String

func (op *TableReplaceOperator) String() string

type TakeOperator

type TakeOperator struct {
	N int64
	// contains filtered or unexported fields
}

A TakeOperator closes the stream after a certain number of values.

func Take

func Take(n int64) *TakeOperator

Take closes the stream after n values have passed through the operator.

func (*TakeOperator) GetNext

func (op *TakeOperator) GetNext() Operator

func (*TakeOperator) GetPrev

func (op *TakeOperator) GetPrev() Operator

func (*TakeOperator) Iterate

func (op *TakeOperator) Iterate(in *expr.Environment, f func(out *expr.Environment) error) error

Iterate implements the Operator interface.

func (*TakeOperator) SetNext

func (op *TakeOperator) SetNext(o Operator)

func (*TakeOperator) SetPrev

func (op *TakeOperator) SetPrev(o Operator)

func (*TakeOperator) String

func (op *TakeOperator) String() string

type UnsetOperator

type UnsetOperator struct {
	Field string
	// contains filtered or unexported fields
}

A UnsetOperator filters duplicate documents.

func Unset

func Unset(field string) *UnsetOperator

Unset filters duplicate documents based on one or more expressions.

func (*UnsetOperator) GetNext

func (op *UnsetOperator) GetNext() Operator

func (*UnsetOperator) GetPrev

func (op *UnsetOperator) GetPrev() Operator

func (*UnsetOperator) Iterate

func (op *UnsetOperator) Iterate(in *expr.Environment, f func(out *expr.Environment) error) error

Iterate implements the Operator interface.

func (*UnsetOperator) SetNext

func (op *UnsetOperator) SetNext(o Operator)

func (*UnsetOperator) SetPrev

func (op *UnsetOperator) SetPrev(o Operator)

func (*UnsetOperator) String

func (op *UnsetOperator) String() string

type ValueBufferEncoder

type ValueBufferEncoder interface {
	EncodeValueBuffer(vb *document.ValueBuffer) ([]byte, error)
}

type ValueEncoder

type ValueEncoder interface {
	EncodeValue(v document.Value) ([]byte, error)
}

type ValueRange

type ValueRange struct {
	Min, Max document.Value
	// Exclude Min and Max from the results.
	// By default, min and max are inclusive.
	// Exclusive and Exact cannot be set to true at the same time.
	Exclusive bool
	// Used to match an exact value equal to Min.
	// If set to true, Max will be ignored for comparison
	// and for determining the global upper bound.
	Exact bool
	// contains filtered or unexported fields
}

func (*ValueRange) IsEqual

func (r *ValueRange) IsEqual(other *ValueRange) bool

func (*ValueRange) IsInRange

func (r *ValueRange) IsInRange(value []byte) bool

func (*ValueRange) String

func (r *ValueRange) String() string

type ValueRanges

type ValueRanges []ValueRange

func (ValueRanges) Append

func (r ValueRanges) Append(rng ValueRange) ValueRanges

Append rng to r and return the new slice. Duplicate ranges are ignored.

func (ValueRanges) Cost

func (r ValueRanges) Cost() int

Cost is a best effort function to determine the cost of a range lookup.

func (ValueRanges) Encode

func (r ValueRanges) Encode(encoder ValueEncoder, env *expr.Environment) error

Encode each range using the given value encoder.

func (ValueRanges) String

func (r ValueRanges) String() string

Jump to

Keyboard shortcuts

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