Documentation
¶
Index ¶
- Variables
- func End()
- func RegisterImplementation(name string, constructor Constructor)
- func Start()
- type Badger
- func (b *Badger) Close() error
- func (b *Badger) CountPrefix(prefix []byte) int
- func (b *Badger) End()
- func (b *Badger) ForPrefix(prefix []byte, fetchValues bool, fn func([]byte, []byte) (bool, error)) error
- func (b *Badger) GetBytes(key []byte) ([]byte, error)
- func (b *Badger) HasKey(key []byte) bool
- func (b *Badger) Lock()
- func (b *Badger) NewTransaction(update bool) Transaction
- func (b *Badger) PutBytes(key, value []byte) error
- func (b *Badger) Remove(key []byte) error
- func (b *Badger) RemovePrefix(prefix []byte) error
- func (b *Badger) Unlock()
- func (b *Badger) Update(fn func(Transaction) error) error
- func (b *Badger) View(fn func(Transaction) error) error
- type BadgerTransaction
- func (bt *BadgerTransaction) Commit() error
- func (bt *BadgerTransaction) CountPrefix(prefix []byte) int
- func (bt *BadgerTransaction) Discard()
- func (bt *BadgerTransaction) ForPrefix(prefix []byte, fetchValues bool, fn func([]byte, []byte) (bool, error)) error
- func (bt *BadgerTransaction) GetBytes(key []byte) ([]byte, error)
- func (bt *BadgerTransaction) HasKey(key []byte) bool
- func (bt *BadgerTransaction) PutBytes(key, value []byte) error
- func (bt *BadgerTransaction) Remove(key []byte) error
- func (bt *BadgerTransaction) RemovePrefix(prefix []byte) error
- type Constructor
- type Interface
- type Manipulator
- type Transaction
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTransactionConflict = errors.New("transaction conflict")
View Source
var ErrTransactionTooBig = errors.New("transaction too big")
Functions ¶
func RegisterImplementation ¶
func RegisterImplementation(name string, constructor Constructor)
Types ¶
type Badger ¶
type Badger struct {
// contains filtered or unexported fields
}
func (*Badger) Close ¶
Close locks the database. Should be called before exiting. This is useful to allow running database processes to finished, but deny locking of new tasks.
func (*Badger) CountPrefix ¶
func (*Badger) NewTransaction ¶
func (b *Badger) NewTransaction(update bool) Transaction
func (*Badger) RemovePrefix ¶
type BadgerTransaction ¶
type BadgerTransaction struct {
// contains filtered or unexported fields
}
func (*BadgerTransaction) Commit ¶
func (bt *BadgerTransaction) Commit() error
func (*BadgerTransaction) CountPrefix ¶
func (bt *BadgerTransaction) CountPrefix(prefix []byte) int
func (*BadgerTransaction) Discard ¶
func (bt *BadgerTransaction) Discard()
func (*BadgerTransaction) GetBytes ¶
func (bt *BadgerTransaction) GetBytes(key []byte) ([]byte, error)
func (*BadgerTransaction) HasKey ¶
func (bt *BadgerTransaction) HasKey(key []byte) bool
func (*BadgerTransaction) PutBytes ¶
func (bt *BadgerTransaction) PutBytes(key, value []byte) error
func (*BadgerTransaction) Remove ¶
func (bt *BadgerTransaction) Remove(key []byte) error
func (*BadgerTransaction) RemovePrefix ¶
func (bt *BadgerTransaction) RemovePrefix(prefix []byte) error
type Constructor ¶
type Interface ¶
type Interface interface { Manipulator Lock() Unlock() NewTransaction(update bool) Transaction Update(func(Transaction) error) error View(func(Transaction) error) error Close() error End() }
var (
Singleton Interface
)
type Manipulator ¶
type Manipulator interface { GetBytes(key []byte) ([]byte, error) PutBytes(key []byte, bytes []byte) error HasKey(key []byte) bool Remove(key []byte) error RemovePrefix(prefix []byte) error CountPrefix(prefix []byte) int ForPrefix(prefix []byte, fetchValues bool, fn func([]byte, []byte) (bool, error)) error }
type Transaction ¶
type Transaction interface { Manipulator Discard() Commit() error }
Click to show internal directories.
Click to hide internal directories.