query

package
v0.1.0-test Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteFilter

type ByteFilter struct {
	Offset     uint // byte offset within the cell data (0-based)
	Size       uint
	Conditions []Condition
}

ByteFilter defines a query for direct byte-level filtering on a log's cell data. This is an internal struct created by the QueryBuilder.

func (*ByteFilter) Matches

func (f *ByteFilter) Matches(payload []byte) bool

Matches checks if payload matches a single byte filter

type Condition

type Condition struct {
	Operator operator
	Value    []byte
}

Condition represents a single comparison to be applied to a slice of bytes. It is created via helper functions like EQ, GT, etc.

func EQ

func EQ(val []byte) Condition

EQ creates a condition for an equality check (==).

func GT

func GT(val []byte) Condition

GT creates a condition for a greater-than check (>).

func GTE

func GTE(val []byte) Condition

GTE creates a condition for a greater-than-or-equal check (>=).

func LT

func LT(val []byte) Condition

LT creates a condition for a less-than check (<).

func LTE

func LTE(val []byte) Condition

LTE creates a condition for a less-than-or-equal check (<=).

func NEQ

func NEQ(val []byte) Condition

NEQ creates a condition for a non-equality check (!=).

type Options

type Options struct {
	Limit  int
	Offset int
	SortBy []SortBy
}

Options specifies pagination and sorting for log queries.

type Result

type Result[T any] struct {
	Logs    []types.TypedLog[T]
	HasMore bool
	Total   int
	Offset  int
	Limit   int
}

Result provides a unified return type for all query methods. It contains parsed logs with pagination metadata.

type SortBy

type SortBy struct {
	Field SortField
	Order SortOrder
}

SortBy defines sorting criteria for query results.

type SortField

type SortField string

SortField defines the available fields for sorting.

const (
	SortByTxLT SortField = "tx_lt"
)

type SortOrder

type SortOrder string

SortOrder defines the sort direction.

const (
	ASC  SortOrder = "ASC"
	DESC SortOrder = "DESC"
)

Jump to

Keyboard shortcuts

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