Documentation ¶
Index ¶
- Variables
- func NewTable(db database.Database, prefix string) database.Database
- func NewTableBatch(db database.Database, prefix string) database.Batch
- type LDBDatabase
- func (db *LDBDatabase) Begin(writable bool) (database.Tx, error)
- func (db *LDBDatabase) Close() error
- func (db *LDBDatabase) Delete(key []byte) error
- func (db *LDBDatabase) Get(key []byte) ([]byte, error)
- func (db *LDBDatabase) Has(key []byte) (bool, error)
- func (db *LDBDatabase) LDB() *leveldb.DB
- func (db *LDBDatabase) Meter(prefix string)
- func (db *LDBDatabase) NewBatch() database.Batch
- func (db *LDBDatabase) NewIterator() iterator.Iterator
- func (db *LDBDatabase) NewIteratorWithPrefix(prefix []byte) iterator.Iterator
- func (db *LDBDatabase) Path() string
- func (db *LDBDatabase) Put(key []byte, value []byte) error
- func (db *LDBDatabase) Type() string
- func (db *LDBDatabase) Update(fn func(tx database.Tx) error) error
- func (db *LDBDatabase) View(fn func(tx database.Tx) error) error
- type MemDatabase
- func (db *MemDatabase) Begin(writable bool) (database.Tx, error)
- func (db *MemDatabase) Close() error
- func (db *MemDatabase) Delete(key []byte) error
- func (db *MemDatabase) Get(key []byte) ([]byte, error)
- func (db *MemDatabase) Has(key []byte) (bool, error)
- func (db *MemDatabase) Keys() [][]byte
- func (db *MemDatabase) Len() int
- func (db *MemDatabase) NewBatch() database.Batch
- func (db *MemDatabase) Put(key []byte, value []byte) error
- func (db *MemDatabase) Type() string
- func (db *MemDatabase) Update(fn func(tx database.Tx) error) error
- func (db *MemDatabase) View(fn func(tx database.Tx) error) error
Constants ¶
This section is empty.
Variables ¶
View Source
var OpenFileLimit = 64
Functions ¶
Types ¶
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 (db *LDBDatabase) Close() error
func (*LDBDatabase) Delete ¶
func (db *LDBDatabase) Delete(key []byte) error
Delete deletes the key from the queue and database
func (*LDBDatabase) Get ¶
func (db *LDBDatabase) Get(key []byte) ([]byte, error)
Get returns the given key if it's present.
func (*LDBDatabase) LDB ¶
func (db *LDBDatabase) LDB() *leveldb.DB
func (*LDBDatabase) Meter ¶
func (db *LDBDatabase) Meter(prefix string)
Meter configures the database metrics collectors and
func (*LDBDatabase) NewBatch ¶
func (db *LDBDatabase) NewBatch() database.Batch
func (*LDBDatabase) NewIterator ¶
func (db *LDBDatabase) NewIterator() iterator.Iterator
func (*LDBDatabase) NewIteratorWithPrefix ¶
func (db *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 (db *LDBDatabase) Path() string
Path returns the path to the database directory.
func (*LDBDatabase) Put ¶
func (db *LDBDatabase) Put(key []byte, value []byte) error
Put puts the given key / value to the queue
func (*LDBDatabase) Type ¶
func (db *LDBDatabase) Type() string
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
func NewMemDatabaseWithCap ¶
func NewMemDatabaseWithCap(size int) *MemDatabase
func (*MemDatabase) Close ¶
func (db *MemDatabase) Close() error
func (*MemDatabase) Delete ¶
func (db *MemDatabase) Delete(key []byte) error
func (*MemDatabase) Keys ¶
func (db *MemDatabase) Keys() [][]byte
func (*MemDatabase) Len ¶
func (db *MemDatabase) Len() int
func (*MemDatabase) NewBatch ¶
func (db *MemDatabase) NewBatch() database.Batch
func (*MemDatabase) Type ¶
func (db *MemDatabase) Type() string
Click to show internal directories.
Click to hide internal directories.