Documentation ¶
Index ¶
- Variables
- type LDBDatabase
- func (self *LDBDatabase) Close()
- func (self *LDBDatabase) Delete(key []byte) error
- func (self *LDBDatabase) Flush() error
- func (self *LDBDatabase) Get(key []byte) ([]byte, error)
- func (self *LDBDatabase) LDB() *leveldb.DB
- func (self *LDBDatabase) NewIterator() iterator.Iterator
- func (self *LDBDatabase) Put(key []byte, value []byte) error
- type MemDatabase
- func (db *MemDatabase) Close()
- func (db *MemDatabase) Delete(key []byte) error
- func (db *MemDatabase) Flush() error
- func (db *MemDatabase) Get(key []byte) ([]byte, error)
- func (db *MemDatabase) LastKnownTD() []byte
- func (db *MemDatabase) Print()
- func (db *MemDatabase) Put(key []byte, value []byte) error
- func (db *MemDatabase) Set(key []byte, value []byte)
Constants ¶
This section is empty.
Variables ¶
View Source
var OpenFileLimit = 64
Functions ¶
This section is empty.
Types ¶
type LDBDatabase ¶
type LDBDatabase struct { GetTimer metrics.Timer // Timer for measuring the database get request counts and latencies PutTimer metrics.Timer // Timer for measuring the database put request counts and latencies DelTimer metrics.Timer // Timer for measuring the database delete request counts and latencies MissMeter metrics.Meter // Meter for measuring the missed database get requests ReadMeter metrics.Meter // Meter for measuring the database get request data usage WriteMeter metrics.Meter // Meter for measuring the database put request data usage CompTimeMeter metrics.Meter // Meter for measuring the total time spent in database compaction CompReadMeter metrics.Meter // Meter for measuring the data read during compaction CompWriteMeter metrics.Meter // Meter for measuring the data written during compaction // contains filtered or unexported fields }
func NewLDBDatabase ¶
func NewLDBDatabase(file string) (*LDBDatabase, error)
NewLDBDatabase returns a LevelDB wrapped object. LDBDatabase does not persist data by it self but requires a background poller which syncs every X. `Flush` should be called when data needs to be stored and written to disk.
func (*LDBDatabase) Close ¶
func (self *LDBDatabase) Close()
func (*LDBDatabase) Delete ¶
func (self *LDBDatabase) Delete(key []byte) error
Delete deletes the key from the queue and database
func (*LDBDatabase) Flush ¶ added in v0.9.17
func (self *LDBDatabase) Flush() error
Flush flushes out the queue to leveldb
func (*LDBDatabase) Get ¶
func (self *LDBDatabase) Get(key []byte) ([]byte, error)
Get returns the given key if it's present.
func (*LDBDatabase) LDB ¶
func (self *LDBDatabase) LDB() *leveldb.DB
func (*LDBDatabase) NewIterator ¶
func (self *LDBDatabase) NewIterator() iterator.Iterator
type MemDatabase ¶
type MemDatabase struct {
// contains filtered or unexported fields
}
* This is a test memory database. Do not use for any production it does not get persisted
func NewMemDatabase ¶
func NewMemDatabase() (*MemDatabase, error)
func (*MemDatabase) Close ¶
func (db *MemDatabase) Close()
func (*MemDatabase) Delete ¶
func (db *MemDatabase) Delete(key []byte) error
func (*MemDatabase) Flush ¶ added in v0.9.17
func (db *MemDatabase) Flush() error
func (*MemDatabase) LastKnownTD ¶ added in v0.7.10
func (db *MemDatabase) LastKnownTD() []byte
func (*MemDatabase) Print ¶ added in v0.7.10
func (db *MemDatabase) Print()
func (*MemDatabase) Set ¶ added in v0.7.10
func (db *MemDatabase) Set(key []byte, value []byte)
Click to show internal directories.
Click to hide internal directories.