Documentation ¶
Overview ¶
Package bboltpack implements the kvpack drivers using Bolt.
Index ¶
- func Open(path string, mode os.FileMode, opts *bbolt.Options) (*kvpack.Database, error)
- type DB
- type Tx
- func (tx *Tx) Commit() error
- func (tx *Tx) DeletePrefix(prefix []byte) error
- func (tx *Tx) Get(k []byte) ([]byte, error)
- func (tx *Tx) Iterate(prefix []byte, fn func(k, v []byte) error) error
- func (tx *Tx) NamespaceBucket() *bbolt.Bucket
- func (tx *Tx) Put(k, v []byte) error
- func (tx *Tx) Rollback() error
- Bugs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
Tx implements driver.Transaction.
func (*Tx) Commit ¶
Commit commits the current transaction. Calling Commit multiple times does nothing and will return nil.
func (*Tx) DeletePrefix ¶
DeletePrefix deletes all keys with the given prefix.
func (*Tx) NamespaceBucket ¶
NamespaceBucket returns the current namespace's bucket inside the transaction. If the transaction is read-only and no keys have been put before, then nil is returned.
Notes ¶
Bugs ¶
Iterate seems to have a bug if a new transaction is created every GetKVPack benchmark iteration; the workaround was to change it so that all iterations are done inside a transaction, but this doesn't fix the root issue.
Click to show internal directories.
Click to hide internal directories.