filter

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	Root *Node
}

func New

func New(rootOp FilterOp) *Filter

func (Filter) Encode

func (f Filter) Encode() []byte

type FilterKV

type FilterKV struct {
	Key   string `json:"Key,omitempty"`
	Value []byte `json:"Value"`
}

func (FilterKV) String

func (kv FilterKV) String() string

type FilterOp

type FilterOp func(*Filter, *Node)

func And

func And(ops ...FilterOp) FilterOp

Operators

func From

func From(from string) FilterOp

func MethodID

func MethodID(id string) FilterOp

func Or

func Or(ops ...FilterOp) FilterOp

func To

func To(to string) FilterOp

Operands

func ValueEq added in v1.5.1

func ValueEq(v *big.Int) FilterOp

func ValueGte added in v1.5.1

func ValueGte(v *big.Int) FilterOp

func ValueLte added in v1.5.1

func ValueLte(v *big.Int) FilterOp

type Node

type Node struct {
	Operand  *FilterKV `json:"Operand,omitempty"`
	Operator Operator  `json:"Operator,omitempty"`
	Children []*Node   `json:"Children,omitempty"`
}

type Operator

type Operator = int
const (
	AND Operator = 1
	OR  Operator = 2
)

Jump to

Keyboard shortcuts

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