topicsdb

package
v1.0.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const MaxCount = 0xff

Variables

View Source
var ErrTooManyTopics = fmt.Errorf("Too many topics")

Functions

This section is empty.

Types

type ID

type ID [logrecKeySize]byte

ID of log record

func NewID

func NewID(block uint64, tx common.Hash, logIndex uint) (id ID)

func (*ID) BlockNumber

func (id *ID) BlockNumber() uint64

func (*ID) Bytes

func (id *ID) Bytes() []byte

func (*ID) Index

func (id *ID) Index() uint

func (*ID) TxHash

func (id *ID) TxHash() (tx common.Hash)

type Index

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

Index is a specialized indexes for log records storing and fetching.

func New

func New(db kvdb.KeyValueStore) *Index

New TopicsDb instance.

func (*Index) Find

func (tt *Index) Find(topics [][]common.Hash) ([]*types.Log, error)

Find log records by conditions.

func (*Index) MustPush

func (tt *Index) MustPush(recs ...*types.Log)

MustPush calls Push() and panics if error.

func (*Index) Push

func (tt *Index) Push(recs ...*types.Log) error

Push log record to database.

Jump to

Keyboard shortcuts

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