leveldb

package
v1.0.0-pre5 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

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

Storage implements the db.Storage interface

func NewLevelDbStorage

func NewLevelDbStorage(path string, errorIfMissing bool) (*Storage, error)

NewLevelDbStorage returns a new Storage

func (*Storage) Close

func (l *Storage) Close()

Close implements the method Close of the interface db.Storage

func (*Storage) Get

func (l *Storage) Get(key []byte) ([]byte, error)

Get retrieves a value from a key in the db.Storage

func (*Storage) Iterate

func (l *Storage) Iterate(f func([]byte, []byte) (bool, error)) error

Iterate implements the method Iterate of the interface db.Storage

func (*Storage) LevelDB

func (l *Storage) LevelDB() *leveldb.DB

LevelDB is an extra method that returns the *leveldb.DB

func (*Storage) List

func (l *Storage) List(limit int) ([]merkletree.KV, error)

List implements the method List of the interface db.Storage

func (*Storage) NewTx

func (l *Storage) NewTx() (merkletree.Tx, error)

NewTx implements the method NewTx of the interface db.Storage

func (*Storage) WithPrefix

func (l *Storage) WithPrefix(prefix []byte) merkletree.Storage

WithPrefix implements the method WithPrefix of the interface db.Storage

type StorageTx

type StorageTx struct {
	*Storage
	// contains filtered or unexported fields
}

StorageTx implements the db.Tx interface

func (*StorageTx) Add

func (tx *StorageTx) Add(atx merkletree.Tx) error

Add implements the method Add of the interface db.Tx

func (*StorageTx) Close

func (tx *StorageTx) Close()

Close implements the method Close of the interface db.Tx

func (*StorageTx) Commit

func (tx *StorageTx) Commit() error

Commit implements the method Commit of the interface db.Tx

func (*StorageTx) Get

func (tx *StorageTx) Get(key []byte) ([]byte, error)

Get retreives a value from a key in the interface db.Tx

func (*StorageTx) Put

func (tx *StorageTx) Put(k, v []byte) error

Put saves a key:value into the db.Storage

Jump to

Keyboard shortcuts

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