Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HeaderPrefix = []byte{0x01} TxPrefix = []byte{0x02} HeightPrefix = []byte{0x03} TxIDPrefix = []byte{0x04} KeyImagePrefix = []byte{0x05} StatePrefix = []byte{0x06} OutputKeyPrefix = []byte{0x07} BidValuesPrefix = []byte{0x08} )
View Source
var (
// DriverName is the unique identifier for the heavy driver
DriverName = "heavy_v0.1.0"
)
Functions ¶
func NewDatabase ¶
NewDatabase create or open backend storage (goleveldb) located at the specified path. Readonly option is pseudo read-only mode implemented by heavy.Database. Not to be confused with read-only goleveldb mode
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB on top of underlying storage syndtr/goleveldb/leveldb
func (DB) Begin ¶
func (db DB) Begin(writable bool) (database.Transaction, error)
Begin builds read-only or read-write Transaction
func (DB) Close ¶
Close does not close the underlying storage as we need to reuse it within another DB instances. Note that we rely on the Finalizer that goleveldb is setting at the point of leveldb.DB.openDB to call leveldb.DB.Close() when the process is terminating
func (DB) GetSnapshot ¶
GetSnapshot returns current storage snapshot. To be used only by database/testing pkg
Click to show internal directories.
Click to hide internal directories.