Documentation
¶
Index ¶
- Variables
- func New(path string) (db.DB, error)
- func NewBatch(dbBatch *pebble.Batch, lock *sync.Mutex, listener db.EventListener) *batch
- func NewMem() (db.DB, error)
- func NewMemTest(t testing.TB) db.DB
- func NewSnapshot(dbSnapshot *pebble.Snapshot, listener db.EventListener) *snapshot
- func NewWithOptions(path string, cacheSizeMB uint, maxOpenFiles int, colouredLogger bool) (db.DB, error)
- type DB
- type Item
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDiscardedTransaction = errors.New("discarded transaction") ErrReadOnlyTransaction = errors.New("read-only transaction") )
Functions ¶
func NewMemTest ¶
NewMemTest opens a new in-memory database, panics on error
func NewSnapshot ¶ added in v0.12.3
func NewSnapshot(dbSnapshot *pebble.Snapshot, listener db.EventListener) *snapshot
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) NewTransaction ¶
func (d *DB) NewTransaction(update bool) (db.Transaction, error)
NewTransaction : see db.DB.NewTransaction Batch is used for read-write operations, while snapshot is used for read-only operations
func (*DB) Update ¶
func (d *DB) Update(fn func(txn db.Transaction) error) error
Update : see db.DB.Update
func (*DB) WithListener ¶ added in v0.7.0
func (d *DB) WithListener(listener db.EventListener) db.DB
WithListener registers an EventListener
Click to show internal directories.
Click to hide internal directories.