ethdb

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2015 License: GPL-3.0 Imports: 15 Imported by: 0

README

ethdb

The ethdb package contains the ethereum database interfaces

Installation

go get github.com/ethereum/ethdb-go

Usage

Todo :-)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OpenFileLimit = 64

Functions

This section is empty.

Types

type Batch

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

type Database

type Database interface {
	Put(key []byte, value []byte) error
	Get(key []byte) ([]byte, error)
	Delete(key []byte) error
	Close()
	NewBatch() Batch
}

type LDBDatabase

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

func NewLDBDatabase

func NewLDBDatabase(file string, cache int) (*LDBDatabase, error)

NewLDBDatabase returns a LevelDB wrapped object.

func (*LDBDatabase) Close

func (self *LDBDatabase) Close()

func (*LDBDatabase) Delete

func (self *LDBDatabase) Delete(key []byte) error

Delete deletes the key from the queue and database

func (*LDBDatabase) Get

func (self *LDBDatabase) Get(key []byte) ([]byte, error)

Get returns the given key if it's present.

func (*LDBDatabase) LDB

func (self *LDBDatabase) LDB() *leveldb.DB

func (*LDBDatabase) Meter

func (self *LDBDatabase) Meter(prefix string)

Meter configures the database metrics collectors and

func (*LDBDatabase) NewBatch

func (db *LDBDatabase) NewBatch() Batch

func (*LDBDatabase) NewIterator

func (self *LDBDatabase) NewIterator() iterator.Iterator

func (*LDBDatabase) Put

func (self *LDBDatabase) Put(key []byte, value []byte) error

Put puts the given key / value to the queue

type MemDatabase

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

* This is a test memory database. Do not use for any production it does not get persisted

func NewMemDatabase

func NewMemDatabase() (*MemDatabase, error)

func (*MemDatabase) Close

func (db *MemDatabase) Close()

func (*MemDatabase) Delete

func (db *MemDatabase) Delete(key []byte) error

func (*MemDatabase) Get

func (db *MemDatabase) Get(key []byte) ([]byte, error)

func (*MemDatabase) Keys

func (db *MemDatabase) Keys() [][]byte

func (*MemDatabase) LastKnownTD added in v0.7.10

func (db *MemDatabase) LastKnownTD() []byte

func (*MemDatabase) NewBatch

func (db *MemDatabase) NewBatch() Batch

func (*MemDatabase) Print added in v0.7.10

func (db *MemDatabase) Print()

func (*MemDatabase) Put

func (db *MemDatabase) Put(key []byte, value []byte) error

func (*MemDatabase) Set added in v0.7.10

func (db *MemDatabase) Set(key []byte, value []byte)

Jump to

Keyboard shortcuts

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