db

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: BSD-2-Clause Imports: 14 Imported by: 14

Documentation

Index

Constants

View Source
const (
	DbCoin       byte = 'C'
	DbCoins      byte = 'c'
	DbBlockFiles byte = 'f'
	DbTxIndex    byte = 't'
	DbBlockIndex byte = 'b'

	DbBestBlock   byte = 'B'
	DbFlag        byte = 'F'
	DbReindexFlag byte = 'R'
	DbLastBlock   byte = 'l'

	DbWalletKey      byte = 'W'
	DbWalletScript   byte = 'S'
	DbWalletAddrBook byte = 'A'
	DbWalletTx       byte = 'X'
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchWrapper

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

func NewBatchWrapper

func NewBatchWrapper(parent *DBWrapper) *BatchWrapper

func (*BatchWrapper) Clear

func (bw *BatchWrapper) Clear()

func (*BatchWrapper) Erase

func (bw *BatchWrapper) Erase(key []byte)

func (*BatchWrapper) SizeEstimate

func (bw *BatchWrapper) SizeEstimate() int

func (*BatchWrapper) Write

func (bw *BatchWrapper) Write(key, val []byte)

type DBOption

type DBOption struct {
	FilePath       string
	CacheSize      int
	Wipe           bool
	DontObfuscate  bool
	ForceCompactdb bool
	UseMemStore    bool
}

type DBWrapper

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

func NewDBWrapper

func NewDBWrapper(do *DBOption) (*DBWrapper, error)

func (*DBWrapper) Close

func (dbw *DBWrapper) Close()

func (*DBWrapper) CompactRange

func (dbw *DBWrapper) CompactRange(begin, end []byte) error

func (*DBWrapper) Erase

func (dbw *DBWrapper) Erase(key []byte, sync bool) error

func (*DBWrapper) EstimateSize

func (dbw *DBWrapper) EstimateSize(begin, end []byte) uint64

func (*DBWrapper) Exists

func (dbw *DBWrapper) Exists(key []byte) bool

func (*DBWrapper) GetObfuscateKey

func (dbw *DBWrapper) GetObfuscateKey() []byte

func (*DBWrapper) IsEmpty

func (dbw *DBWrapper) IsEmpty() bool

func (*DBWrapper) Iterator

func (dbw *DBWrapper) Iterator(slice *util.Range) *IterWrapper

func (*DBWrapper) Prefix

func (dbw *DBWrapper) Prefix(prefix []byte) *IterWrapper

func (*DBWrapper) Read

func (dbw *DBWrapper) Read(key []byte) ([]byte, error)

func (*DBWrapper) Reset

func (dbw *DBWrapper) Reset()

func (*DBWrapper) Sync

func (dbw *DBWrapper) Sync() error

func (*DBWrapper) Write

func (dbw *DBWrapper) Write(key, val []byte, sync bool) error

func (*DBWrapper) WriteBatch

func (dbw *DBWrapper) WriteBatch(bw *BatchWrapper, sync bool) error

type IterWrapper

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

func NewIterWrapper

func NewIterWrapper(parent *DBWrapper, iter iterator.Iterator) *IterWrapper

func (*IterWrapper) Close

func (iw *IterWrapper) Close()

func (*IterWrapper) GetKey

func (iw *IterWrapper) GetKey() []byte

func (*IterWrapper) GetKeySize

func (iw *IterWrapper) GetKeySize() int

func (*IterWrapper) GetVal

func (iw *IterWrapper) GetVal() []byte

func (*IterWrapper) GetValSize

func (iw *IterWrapper) GetValSize() int

func (*IterWrapper) Next

func (iw *IterWrapper) Next()

func (*IterWrapper) Seek

func (iw *IterWrapper) Seek(key []byte)

func (*IterWrapper) SeekToFirst

func (iw *IterWrapper) SeekToFirst()

func (*IterWrapper) Valid

func (iw *IterWrapper) Valid() bool

Jump to

Keyboard shortcuts

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