storage

package
v0.0.0-...-c227437 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Badger

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

Badger implements wrapper for badger database

func NewBadger

func NewBadger(storageDir string) *Badger

NewBadger returns new instance of badger wrapper

func (*Badger) Close

func (storage *Badger) Close() error

Close properly closes badger database

func (*Badger) Del

func (storage *Badger) Del(key string) (err error)

Del deletes a key

func (*Badger) DeleteByPrefix

func (storage *Badger) DeleteByPrefix(prefix []byte)

Iterate iterates over keys with prefix

func (*Badger) Get

func (storage *Badger) Get(key string) (value []byte, err error)

Get returns value by key

func (*Badger) Iterate

func (storage *Badger) Iterate(fn func(key []byte, value []byte))

Iterate iterates over all keys

func (*Badger) IterateByPrefix

func (storage *Badger) IterateByPrefix(prefix []byte, limit uint64, fn func(key []byte, value []byte)) uint64

Iterate iterates over keys with prefix

func (*Badger) IterateByPrefixFrom

func (storage *Badger) IterateByPrefixFrom(prefix []byte, from []byte, limit uint64, fn func(key []byte, value []byte)) uint64

Iterate iterates over keys with prefix

func (*Badger) KeysByPrefixCount

func (storage *Badger) KeysByPrefixCount(prefix []byte) uint64

func (*Badger) ProcessBatch

func (storage *Badger) ProcessBatch(batch []*interfaces.Operation) (err error)

ProcessBatch process batch of operations

func (*Badger) Set

func (storage *Badger) Set(key string, value []byte) (err error)

Set adds a key-value pair to the database

type BuntDB

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

BuntDB implements wrapper for BuntDB database

func NewBuntDB

func NewBuntDB(storagePath string) *BuntDB

NewBuntDB returns new instance of BuntDB wrapper

func (*BuntDB) Close

func (storage *BuntDB) Close() error

Close properly closes BuntDB database

func (*BuntDB) Del

func (storage *BuntDB) Del(key string) (err error)

Del deletes a key

func (*BuntDB) DeleteByPrefix

func (storage *BuntDB) DeleteByPrefix(prefix []byte)

func (*BuntDB) Get

func (storage *BuntDB) Get(key string) (value []byte, err error)

Get returns value by key

func (*BuntDB) Iterate

func (storage *BuntDB) Iterate(fn func(key []byte, value []byte))

Iterate iterates over all keys

func (*BuntDB) IterateByPrefix

func (storage *BuntDB) IterateByPrefix(prefix []byte, limit uint64, fn func(key []byte, value []byte)) uint64

Iterate iterates over keys with prefix

func (*BuntDB) IterateByPrefixFrom

func (storage *BuntDB) IterateByPrefixFrom(prefix []byte, from []byte, limit uint64, fn func(key []byte, value []byte)) uint64

func (*BuntDB) KeysByPrefixCount

func (storage *BuntDB) KeysByPrefixCount(prefix []byte) uint64

func (*BuntDB) ProcessBatch

func (storage *BuntDB) ProcessBatch(batch []*interfaces.Operation) (err error)

ProcessBatch process batch of operations

func (*BuntDB) Set

func (storage *BuntDB) Set(key string, value []byte) (err error)

Set adds a key-value pair to the database

Jump to

Keyboard shortcuts

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