memDatabase

package
v0.0.0-...-b70f362 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseDB

func CloseDB()

func Init

func Init()

Types

type AnyBlockchainDB

type AnyBlockchainDB interface {
	Close()
	Put(k []byte, v []byte) error
	LoadAllKeys(prefix []byte) ([][]byte, error)
	LoadAll(prefix []byte) ([][]byte, error)
	Get(k []byte) ([]byte, error)
	IsKey(key []byte) (bool, error)
	Delete(key []byte) error
	GetLdb() *gorocksdb.DB
	GetNode(common.Hash) ([]byte, error)
}

func GetDBPermanentInstance

func GetDBPermanentInstance() AnyBlockchainDB

func NewInMemoryDB

func NewInMemoryDB() AnyBlockchainDB

type BlockchainDB

type BlockchainDB struct {
	// contains filtered or unexported fields
}
var MainDB *BlockchainDB

func (*BlockchainDB) Close

func (d *BlockchainDB) Close()

func (*BlockchainDB) Delete

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

func (*BlockchainDB) Get

func (db *BlockchainDB) Get(k []byte) ([]byte, error)

func (*BlockchainDB) GetLdb

func (db *BlockchainDB) GetLdb() *gorocksdb.DB

func (*BlockchainDB) GetNode

func (db *BlockchainDB) GetNode(hash commoneth.Hash) ([]byte, error)

func (*BlockchainDB) InitInMemory

func (db *BlockchainDB) InitInMemory() (*BlockchainDB, error)

func (*BlockchainDB) InitPermanent

func (db *BlockchainDB) InitPermanent() (*BlockchainDB, error)

func (*BlockchainDB) IsKey

func (db *BlockchainDB) IsKey(key []byte) (bool, error)

func (*BlockchainDB) LoadAll

func (db *BlockchainDB) LoadAll(prefix []byte) ([][]byte, error)

func (*BlockchainDB) LoadAllKeys

func (db *BlockchainDB) LoadAllKeys(prefix []byte) ([][]byte, error)

func (*BlockchainDB) Put

func (db *BlockchainDB) Put(k []byte, v []byte) error

type InMemoryDBReader

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

func (*InMemoryDBReader) Get

func (r *InMemoryDBReader) Get(key []byte) ([]byte, error)

func (*InMemoryDBReader) Node

func (r *InMemoryDBReader) Node(owner common.Hash, path []byte, hash common.Hash) ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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