ethdb

package
v0.0.0-...-caec882 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2018 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IdealBatchSize = 100 * 1024
)

Code using batches should try to add this much data to the batch. The value was determined empirically.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch interface {
	Putter
	Deleter
	ValueSize() int // amount of data in the batch
	Write() error
	// Reset resets the batch for reuse
	Reset()
}

Batch is a write-only database that commits changes to its host database when Write is called. Batch cannot be used concurrently.

type Database

type Database interface {
	Putter
	Deleter
	Get(key []byte) ([]byte, error)
	Has(key []byte) (bool, error)
	Close()
	NewBatch() eth.Batch
}

Database wraps all database operations. All methods are safe for concurrent use.

func New

func New(raw raw.Interface) Database

type Deleter

type Deleter interface {
	Delete(key []byte) error
}

Deleter wraps the database delete operation supported by both batches and regular databases.

type Putter

type Putter interface {
	Put(key []byte, value []byte) error
}

Putter wraps the database write operation supported by both batches and regular databases.

Jump to

Keyboard shortcuts

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