Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KVDB ¶
type KVDB interface { // Get returns the value for a key. Get(key []byte) ([]byte, error) // Put stores the value for a key. Put(key []byte, value []byte) error // Delete removes the value for a key. Delete(key []byte) error // Iterate iterates through a range of key-value pairs. Iterate(keyLB, keyUB []byte, done chan struct{}, callback func(key, value []byte)) error // Close gracefully shuts down the database. Close() }
KVDB is the (thin) abstraction layer of an implementation-agnostic key-value store.
type Memory ¶ added in v0.3.0
type Memory struct {
// contains filtered or unexported fields
}
Memory contains an in-memory KVDB.
func NewMemoryDB ¶ added in v0.3.0
func NewMemoryDB() *Memory
NewMemoryDB creates a new in-memory KVDB.
func (*Memory) Close ¶ added in v0.3.0
func (db *Memory) Close()
Close gracefully shuts down the database.
type RocksDB ¶
type RocksDB struct {
// contains filtered or unexported fields
}
RocksDB implements the KVStore interface with a thinly wrapped RocksDB instance.
func NewRocksDB ¶
NewRocksDB creates a new RocksDB instance with default read and write options.
func NewTempDirRocksDB ¶
NewTempDirRocksDB creates a new RocksDB instance (used mostly for local testing) in a local temporary directory.
Click to show internal directories.
Click to hide internal directories.