query

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package query implements the custom query format used to filter event subscriptions in CometBFT.

abci.invoice.number=22 AND abci.invoice.owner=Ivan

Query expressions can handle attribute values encoding numbers, strings, dates, and timestamps. The complete query grammar is described in the query/syntax package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandEvents

func ExpandEvents(flattenedEvents map[string][]string) []types.Event

Types

type Query

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

A Query is the compiled form of a query.

var All *Query

All is a query that matches all events.

func Compile

func Compile(ast syntax.Query) (*Query, error)

Compile compiles the given query AST so it can be used to match events.

func MustCompile

func MustCompile(query string) *Query

MustCompile compiles the query expression into an executable query. In case of error, MustCompile will panic.

This is intended for use in program initialization; use query.New if you need to check errors.

func New

func New(query string) (*Query, error)

New parses and compiles the query expression into an executable query.

func (*Query) Matches

func (q *Query) Matches(events map[string][]string) (bool, error)

Matches satisfies part of the pubsub.Query interface. This implementation never reports an error. A nil *Query matches all events.

func (*Query) String

func (q *Query) String() string

String matches part of the pubsub.Query interface.

func (*Query) Syntax

func (q *Query) Syntax() syntax.Query

Syntax returns the syntax tree representation of q.

Directories

Path Synopsis
Package syntax defines a scanner and parser for the CometBFT event filter query language.
Package syntax defines a scanner and parser for the CometBFT event filter query language.

Jump to

Keyboard shortcuts

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