store

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestStore

func TestStore(t *testing.T, setup SetupDB)

TestStore tests a tracker store

Types

type Entry

type Entry interface {
	// LastIndex returns index of the last stored event
	LastIndex() (uint64, error)

	// StoreLogs stores the web3 logs of the event
	StoreLogs(logs []*web3.Log) error

	// RemoveLogs all the logs starting at index 'indx'
	RemoveLogs(indx uint64) error

	// GetLog returns the log at indx
	GetLog(indx uint64, log *web3.Log) error
}

Entry is a filter entry in the store

type SetupDB

type SetupDB func(t *testing.T) (Store, func())

SetupDB is a function that creates a backend

type Store

type Store interface {
	// Get gets a value
	Get(k string) (string, error)

	// ListPrefix lists values by prefix
	ListPrefix(prefix string) ([]string, error)

	// Set sets a value
	Set(k, v string) error

	// Close closes the store
	Close() error

	// GetEntry returns a specific entry
	GetEntry(hash string) (Entry, error)
}

Store is a datastore for the tracker

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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