primitives

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: MIT Imports: 0 Imported by: 5 modules, 16 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

func (*Block) Accept

func (f *Block) Accept(visitor Visitor)

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
)

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"
)

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.

func (*Timestamp) Accept

func (f *Timestamp) Accept(visitor Visitor)

type TxHash

type TxHash struct {
	TxHash string
}

TxHash is a primitive of KeyFilter that filters search to results that contain txHash.

func (*TxHash) Accept

func (f *TxHash) Accept(visitor Visitor)

type ValueComparator

type ValueComparator struct {
	Value    string
	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.

Jump to

Keyboard shortcuts

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