Documentation ¶
Index ¶
- func JoinPrefixes(firstPrefix, secondPrefix []byte) []byte
- func MakePrefix(prefix []byte) []byte
- func PrefixKey(prefix, key []byte) []byte
- type Database
- func (db *Database) Close() 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) Has(key []byte) (bool, error)
- func (db *Database) HealthCheck(ctx context.Context) (interface{}, 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JoinPrefixes ¶
func MakePrefix ¶
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database partitions a database into a sub-database by prefixing all keys with a unique value.
func (*Database) Delete ¶
Assumes that it is OK for the argument to db.db.Delete to be modified after db.db.Delete returns. [key] may be modified after this method returns.
func (*Database) Get ¶
Assumes that it is OK for the argument to db.db.Get to be modified after db.db.Get returns. [key] may be modified after this method returns.
func (*Database) Has ¶
Assumes that it is OK for the argument to db.db.Has to be modified after db.db.Has returns [key] may be modified after this method returns.
func (*Database) HealthCheck ¶
func (*Database) NewIterator ¶
func (*Database) NewIteratorWithPrefix ¶
func (*Database) NewIteratorWithStart ¶
func (*Database) NewIteratorWithStartAndPrefix ¶
Assumes it is safe to modify the arguments to db.db.NewIteratorWithStartAndPrefix after it returns. It is safe to modify [start] and [prefix] after this method returns.