db

package
v1.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBadgerStore

func NewBadgerStore(dir string) (storage.Store, error)

NewBadgerStore initializes/opens a badger database in the given directory.

Types

type BadgerStore

type BadgerStore struct {
	// contains filtered or unexported fields
}

func (*BadgerStore) Action

func (b *BadgerStore) Action(at storage.ActionType) (interface{}, error)

func (*BadgerStore) Batch

func (b *BadgerStore) Batch(canRead bool) storage.Batch

func (*BadgerStore) BatchWrite

func (b *BadgerStore) BatchWrite(canRead bool, fn func(batch storage.Batch) error) error

func (*BadgerStore) Close

func (b *BadgerStore) Close() error

func (*BadgerStore) Count

func (t *BadgerStore) Count(prefix []byte) (uint64, error)

func (*BadgerStore) Delete

func (b *BadgerStore) Delete(k []byte) error

func (*BadgerStore) Drop

func (b *BadgerStore) Drop(prefix []byte) error

func (*BadgerStore) Get

func (b *BadgerStore) Get(k []byte) ([]byte, error)

func (*BadgerStore) Has

func (b *BadgerStore) Has(k []byte) (bool, error)

func (*BadgerStore) Iterator

func (b *BadgerStore) Iterator(prefix []byte, end []byte, fn func(k, v []byte) error) error

func (*BadgerStore) Purge

func (b *BadgerStore) Purge() error

func (*BadgerStore) Put

func (b *BadgerStore) Put(k, v []byte) error

func (*BadgerStore) PutBatch

func (b *BadgerStore) PutBatch(batch storage.Batch) error

func (*BadgerStore) Upgrade

func (b *BadgerStore) Upgrade(version int) error

type BadgerTransaction

type BadgerTransaction struct {
	// contains filtered or unexported fields
}

func (*BadgerTransaction) Delete

func (b *BadgerTransaction) Delete(k []byte) error

func (*BadgerTransaction) Discard

func (b *BadgerTransaction) Discard()

func (*BadgerTransaction) Drop

func (b *BadgerTransaction) Drop(prefix []byte) error

func (*BadgerTransaction) Get

func (b *BadgerTransaction) Get(k []byte) (interface{}, error)

func (*BadgerTransaction) Iterator

func (b *BadgerTransaction) Iterator(prefix []byte, end []byte, fn func(k, v []byte) error) error

func (*BadgerTransaction) Put

func (b *BadgerTransaction) Put(k []byte, v interface{}) error

type BadgerWriteBatch

type BadgerWriteBatch struct {
	// contains filtered or unexported fields
}

func (*BadgerWriteBatch) Delete

func (b *BadgerWriteBatch) Delete(k []byte) error

func (*BadgerWriteBatch) Discard

func (b *BadgerWriteBatch) Discard()

func (*BadgerWriteBatch) Drop

func (b *BadgerWriteBatch) Drop(prefix []byte) error

func (*BadgerWriteBatch) Get

func (b *BadgerWriteBatch) Get([]byte) (interface{}, error)

func (*BadgerWriteBatch) Iterator

func (b *BadgerWriteBatch) Iterator(prefix []byte, end []byte, f func(k, v []byte) error) error

func (*BadgerWriteBatch) Put

func (b *BadgerWriteBatch) Put(k []byte, v interface{}) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL