Documentation
¶
Index ¶
- Variables
- func New(path string, options ...Option) (db.KeyValueStore, error)
- func NewBatch(dbBatch *pebble.Batch, db *DB, listener db.EventListener) *batch
- func NewSnapshot(db *pebble.DB, listener db.EventListener) *snapshot
- type DB
- func (d *DB) Close() error
- func (d *DB) Delete(key []byte) error
- func (d *DB) DeleteRange(start, end []byte) error
- func (d *DB) Get(key []byte, cb func(value []byte) error) error
- func (d *DB) Has(key []byte) (bool, error)
- func (d *DB) Impl() any
- func (d *DB) NewBatch() db.Batch
- func (d *DB) NewBatchWithSize(size int) db.Batch
- func (d *DB) NewIndexedBatch() db.IndexedBatch
- func (d *DB) NewIndexedBatchWithSize(size int) db.IndexedBatch
- func (d *DB) NewIterator(prefix []byte, withUpperBound bool) (db.Iterator, error)
- func (d *DB) NewSnapshot() db.Snapshot
- func (d *DB) Put(key, val []byte) error
- func (d *DB) Update(fn func(w db.IndexedBatch) error) error
- func (d *DB) View(fn func(r db.Snapshot) error) error
- func (d *DB) WithListener(listener db.EventListener) db.KeyValueStore
- type Item
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDiscardedTransaction = errors.New("discarded transaction") ErrReadOnlyTransaction = errors.New("read-only transaction") )
Functions ¶
func New ¶
func New(path string, options ...Option) (db.KeyValueStore, error)
New opens a new database at the given path with default options
func NewBatch ¶ added in v0.12.3
func NewBatch(dbBatch *pebble.Batch, db *DB, listener db.EventListener) *batch
func NewSnapshot ¶ added in v0.12.3
func NewSnapshot(db *pebble.DB, listener db.EventListener) *snapshot
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) DeleteRange ¶ added in v0.14.4
func (*DB) NewIndexedBatch ¶ added in v0.14.4
func (d *DB) NewIndexedBatch() db.IndexedBatch
func (*DB) NewIndexedBatchWithSize ¶ added in v0.14.4
func (d *DB) NewIndexedBatchWithSize(size int) db.IndexedBatch
func (*DB) NewIterator ¶ added in v0.14.4
func (*DB) NewSnapshot ¶ added in v0.14.4
func (*DB) WithListener ¶ added in v0.7.0
func (d *DB) WithListener(listener db.EventListener) db.KeyValueStore
type Option ¶ added in v0.15.11
func WithCacheSize ¶ added in v0.15.11
func WithLogger ¶ added in v0.15.11
func WithMaxOpenFiles ¶ added in v0.15.11
Click to show internal directories.
Click to hide internal directories.