db

package
v0.0.0-...-8ad0a2a Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IdHash

type IdHash struct {
	Id   common.Hash `json:"id"`
	Hash common.Hash `json:"hash"`
}

type LDBDatabase

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

func NewLDBDatabase

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

NewLDBDatabase returns a LevelDB wrapped object.

func (*LDBDatabase) Close

func (ldb *LDBDatabase) Close()

func (*LDBDatabase) Delete

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

Delete deletes the key from the queue and database

func (*LDBDatabase) Get

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

Get returns the given key if it's present.

func (*LDBDatabase) GetHashId

func (ldb *LDBDatabase) GetHashId(hash []byte) (common.Hash, error)

func (*LDBDatabase) GetTxId

func (ldb *LDBDatabase) GetTxId(w http.ResponseWriter, r *http.Request)

func (*LDBDatabase) Has

func (ldb *LDBDatabase) Has(key []byte) (bool, error)

func (*LDBDatabase) InsertHash

func (ldb *LDBDatabase) InsertHash(hash []byte, id common.Hash) error

func (*LDBDatabase) LDB

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

func (*LDBDatabase) NewIterator

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

func (*LDBDatabase) NewIteratorWithPrefix

func (ldb *LDBDatabase) NewIteratorWithPrefix(prefix []byte) iterator.Iterator

NewIteratorWithPrefix returns a iterator to iterate over subset of database content with a particular prefix.

func (*LDBDatabase) Path

func (ldb *LDBDatabase) Path() string

Path returns the path to the database directory.

func (*LDBDatabase) Put

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

Put puts the given key / value to the queue

type RequestParm

type RequestParm struct {
	Hash string
}

Jump to

Keyboard shortcuts

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