txindex

package
v0.10.0-rc2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2017 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 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

View Source
var ErrorEmptyHash = errors.New("Transaction hash cannot be empty")

ErrorEmptyHash indicates empty hash

Functions

This section is empty.

Types

type Batch

type Batch struct {
	Ops []types.TxResult
}

A Batch groups together multiple Index operations you would like performed at the same time. The Batch structure is NOT thread-safe. You should only perform operations on a batch from a single thread at a time. Once batch execution has started, you may not modify it.

func NewBatch

func NewBatch(n int) *Batch

NewBatch creates a new Batch.

func (*Batch) Add

func (b *Batch) Add(result types.TxResult) error

Index adds or updates entry for the given result.Index.

func (*Batch) Size

func (b *Batch) Size() int

Size returns the total number of operations inside the batch.

type TxIndexer

type TxIndexer interface {

	// Batch analyzes, indexes or stores a batch of transactions.
	//
	// NOTE We do not specify Index method for analyzing a single transaction
	// here because it bears heavy perfomance loses. Almost all advanced indexers
	// support batching.
	AddBatch(b *Batch) error

	// Tx returns specified transaction or nil if the transaction is not indexed
	// or stored.
	Get(hash []byte) (*types.TxResult, error)
}

Indexer interface defines methods to index and search transactions.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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