badger

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2022 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

View Source
const (
	Name = "badger"
)

Variables

This section is empty.

Functions

func OpenPath

func OpenPath(path string) (flat.KV, error)

Types

type DB

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

func New

func New(d *badger.DB) *DB

func Open

func Open(opt badger.Options) (*DB, error)

func (*DB) Close

func (db *DB) Close() error

func (*DB) DB

func (db *DB) DB() *badger.DB

func (*DB) Tx

func (db *DB) Tx(rw bool) (flat.Tx, error)

func (*DB) Update

func (db *DB) Update(ctx context.Context, fn func(tx flat.Tx) error) error

func (*DB) View

func (db *DB) View(ctx context.Context, fn func(tx flat.Tx) error) error

type Iterator

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

func (*Iterator) Close

func (it *Iterator) Close() error

func (*Iterator) Err

func (it *Iterator) Err() error

func (*Iterator) Key

func (it *Iterator) Key() flat.Key

func (*Iterator) Next

func (it *Iterator) Next(ctx context.Context) bool

func (*Iterator) Val

func (it *Iterator) Val() kv.Value

type Tx

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

func (*Tx) Close

func (tx *Tx) Close() error

func (*Tx) Commit

func (tx *Tx) Commit(ctx context.Context) error

func (*Tx) Del

func (tx *Tx) Del(k flat.Key) error

func (*Tx) Get

func (tx *Tx) Get(ctx context.Context, key flat.Key) (flat.Value, error)

func (*Tx) GetBatch

func (tx *Tx) GetBatch(ctx context.Context, keys []flat.Key) ([]flat.Value, error)

func (*Tx) Put

func (tx *Tx) Put(k flat.Key, v flat.Value) error

func (*Tx) Scan

func (tx *Tx) Scan(pref flat.Key) flat.Iterator

Jump to

Keyboard shortcuts

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