badger

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEBUG loggingLevel = iota
	INFO
	WARNING
	ERROR
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Iterator

type Iterator interface {
	Next() bool
	Key() []byte
	Val() []byte
	Close()
}

type Storage

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

func New

func New(pathname string) *Storage

func NewByVersion

func NewByVersion(pathname string, version uint32) (*Storage, error)

func (*Storage) Close

func (storage *Storage) Close() error

func (*Storage) CommitWriteBatch

func (storage *Storage) CommitWriteBatch(batch *StorageWriteBatch) error

func (*Storage) Del

func (storage *Storage) Del(key string) error

func (*Storage) DelData

func (storage *Storage) DelData(key []byte) error

func (*Storage) For

func (storage *Storage) For(fn func(k []byte, v []byte))

func (*Storage) ForIndex

func (storage *Storage) ForIndex(fn func(n int, k []byte, v []byte))

func (*Storage) ForIndexStar

func (storage *Storage) ForIndexStar(start int, fn func(n int, k []byte, v []byte))

func (*Storage) Foreach

func (storage *Storage) Foreach(fn func(k string, v []byte) error) error

func (*Storage) ForeachData

func (storage *Storage) ForeachData(fn func(k []byte, v []byte) error) error

func (*Storage) Get

func (storage *Storage) Get(key string) ([]byte, error)

func (*Storage) GetData

func (storage *Storage) GetData(key []byte) (val []byte, err error)

func (*Storage) GetVersion

func (storage *Storage) GetVersion() uint32

func (*Storage) NewIterator

func (storage *Storage) NewIterator() Iterator

func (*Storage) NewWriteBatch

func (storage *Storage) NewWriteBatch() *StorageWriteBatch

func (*Storage) PrefixForeach

func (storage *Storage) PrefixForeach(prefix string, fn func(k string, v []byte) error) error

func (*Storage) PrefixForeachData

func (storage *Storage) PrefixForeachData(prefix []byte, fn func(k []byte, v []byte) error) error

func (*Storage) Set

func (storage *Storage) Set(key string, val []byte) error

func (*Storage) SetData

func (storage *Storage) SetData(key []byte, val []byte) error

type StorageWriteBatch

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

func (*StorageWriteBatch) Clear

func (b *StorageWriteBatch) Clear()

func (*StorageWriteBatch) Count

func (b *StorageWriteBatch) Count() int

func (*StorageWriteBatch) Delete

func (b *StorageWriteBatch) Delete(key []byte) error

func (*StorageWriteBatch) Destroy

func (b *StorageWriteBatch) Destroy()

func (*StorageWriteBatch) Put

func (b *StorageWriteBatch) Put(key, value []byte) error

Jump to

Keyboard shortcuts

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