Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { Block string Operator ComparisonOperator }
Block is a primitive of KeyFilter that filters search in comparison to block number.
type Comparator ¶
type Comparator struct { Name string ValueComparators []ValueComparator }
Comparator is used to filter over values that belong to key data.
func (*Comparator) Accept ¶
func (f *Comparator) Accept(visitor Visitor)
type ComparisonOperator ¶
type ComparisonOperator int
const ( Eq ComparisonOperator = iota Neq Gt Lt Gte Lte )
func (ComparisonOperator) String ¶ added in v0.3.0
func (cmpOp ComparisonOperator) String() string
type Confidence ¶
type Confidence struct {
ConfidenceLevel
}
Confidence is a primitive of KeyFilter that filters search to results that have a certain level of finalization. Confidence maps to different concepts on different blockchains.
func (*Confidence) Accept ¶
func (f *Confidence) Accept(visitor Visitor)
type ConfidenceLevel ¶
type ConfidenceLevel string
const ( Finalized ConfidenceLevel = "finalized" Unconfirmed ConfidenceLevel = "unconfirmed" )
func ConfidenceLevelFromString ¶ added in v0.3.0
func ConfidenceLevelFromString(value string) (ConfidenceLevel, error)
type Primitive ¶
type Primitive interface {
Accept(visitor Visitor)
}
Primitive is the basic building block for KeyFilter.
type Timestamp ¶
type Timestamp struct { Timestamp uint64 Operator ComparisonOperator }
Timestamp is a primitive of KeyFilter that filters search in comparison to timestamp.
type TxHash ¶
type TxHash struct {
TxHash string
}
TxHash is a primitive of KeyFilter that filters search to results that contain txHash.
type ValueComparator ¶
type ValueComparator struct { Value any Operator ComparisonOperator }
type Visitor ¶
type Visitor interface { Comparator(primitive Comparator) Block(primitive Block) Confidence(primitive Confidence) Timestamp(primitive Timestamp) TxHash(primitive TxHash) }
Visitor should have a per chain per db type implementation that converts primitives to db queries.