database

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB encapsulates a leveldb.DB storage.

func New

func New(path string) (*DB, error)

New creates an instance of DB.

func (*DB) Clear

func (db *DB) Clear() error

Clear all information from the database.

func (*DB) Close

func (db *DB) Close() error

Close the storage.

func (*DB) Delete

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

Delete an entry identified by the specified key.

func (*DB) FetchTxRecords

func (db *DB) FetchTxRecords() ([]txrecords.TxRecord, error)

FetchTxRecords transaction records.

func (*DB) Get

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

Get a value using a key.

func (*DB) Put

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

Put inserts a key and a value in the storage.

func (*DB) PutTxRecord

func (db *DB) PutTxRecord(tx transactions.ContractCall, height uint64, direction txrecords.Direction) error

PutTxRecord saves the transaction record on the DB.

Jump to

Keyboard shortcuts

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