Documentation ¶
Index ¶
- type Commitable
- type Database
- func (db *Database) Abort()
- func (db *Database) Close() error
- func (db *Database) Commit() error
- func (db *Database) CommitBatch() (database.Batch, error)
- func (db *Database) Compact(start, limit []byte) error
- func (db *Database) Delete(key []byte) error
- func (db *Database) Get(key []byte) ([]byte, error)
- func (db *Database) GetDatabase() database.Database
- func (db *Database) Has(key []byte) (bool, error)
- func (db *Database) NewBatch() database.Batch
- func (db *Database) NewIterator() database.Iterator
- func (db *Database) NewIteratorWithPrefix(prefix []byte) database.Iterator
- func (db *Database) NewIteratorWithStart(start []byte) database.Iterator
- func (db *Database) NewIteratorWithStartAndPrefix(start, prefix []byte) database.Iterator
- func (db *Database) Put(key, value []byte) error
- func (db *Database) SetDatabase(newDB database.Database) error
- func (db *Database) Stat(stat string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commitable ¶
type Commitable interface { // Commit writes all the queued operations to the underlying data structure. Commit() error }
Commitable defines the interface that specifies that something may be committed.
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database implements the Database interface by living on top of another database, writing changes to the underlying database only when commit is called.
func (*Database) Commit ¶
Commit writes all the operations of this database to the underlying database
func (*Database) CommitBatch ¶
CommitBatch returns a batch that contains all uncommitted puts/deletes. Calling Write() on the returned batch causes the puts/deletes to be written to the underlying database. The returned batch should be written before future calls to this DB unless the batch will never be written.
func (*Database) GetDatabase ¶
GetDatabase returns the underlying database
func (*Database) NewIterator ¶
func (*Database) NewIteratorWithPrefix ¶
func (*Database) NewIteratorWithStart ¶
func (*Database) NewIteratorWithStartAndPrefix ¶
func (*Database) SetDatabase ¶
SetDatabase changes the underlying database to the specified database