badger

package
v0.0.0-...-f4e3eaa Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name is the name of this engine in blevesearch
	Name = "badger"
)

Variables

This section is empty.

Functions

func New

func New(mo store.MergeOperator, config map[string]interface{}) (store.KVStore, error)

New creates a new store instance

Types

type PrefixIterator

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

PrefixIterator blevesearch prefix-iterator implementation

func (*PrefixIterator) Close

func (i *PrefixIterator) Close() error

Close closes the current iterator and commit its transaction

func (*PrefixIterator) Current

func (i *PrefixIterator) Current() ([]byte, []byte, bool)

Current returns the key & value of the current step

func (*PrefixIterator) Key

func (i *PrefixIterator) Key() []byte

Key return the key of the current step

func (*PrefixIterator) Next

func (i *PrefixIterator) Next()

Next advance the iterator to the next step

func (*PrefixIterator) Seek

func (i *PrefixIterator) Seek(key []byte)

Seek advance the iterator to the specified key

func (*PrefixIterator) Valid

func (i *PrefixIterator) Valid() bool

Valid whether the current iterator step is valid or not

func (*PrefixIterator) Value

func (i *PrefixIterator) Value() []byte

Value returns the value of the current step

type RangeIterator

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

RangeIterator implements blevesearch store iterator

func (*RangeIterator) Close

func (i *RangeIterator) Close() error

Close closes the current iterator and commit its transaction

func (*RangeIterator) Current

func (i *RangeIterator) Current() ([]byte, []byte, bool)

Current returns the key & value of the current step

func (*RangeIterator) Key

func (i *RangeIterator) Key() []byte

Key return the key of the current step

func (*RangeIterator) Next

func (i *RangeIterator) Next()

Next advance the iterator to the next step

func (*RangeIterator) Seek

func (i *RangeIterator) Seek(key []byte)

Seek advance the iterator to the specified key

func (*RangeIterator) Valid

func (i *RangeIterator) Valid() bool

Valid whether the current iterator step is valid or not

func (*RangeIterator) Value

func (i *RangeIterator) Value() []byte

Value returns the value of the current step

type Reader

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

Reader implements bleve/Store/Reader interface

func (*Reader) Close

func (r *Reader) Close() error

Close closes the current reader and do some cleanup

func (*Reader) Get

func (r *Reader) Get(k []byte) ([]byte, error)

Get fetch the value of the specified key from the store

func (*Reader) MultiGet

func (r *Reader) MultiGet(keys [][]byte) ([][]byte, error)

MultiGet returns multiple values for the specified keys

func (*Reader) PrefixIterator

func (r *Reader) PrefixIterator(k []byte) store.KVIterator

PrefixIterator initialize a new prefix iterator

func (*Reader) RangeIterator

func (r *Reader) RangeIterator(start, end []byte) store.KVIterator

RangeIterator initialize a new range iterator

type Store

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

Store implements blevesearch store

func (*Store) Close

func (s *Store) Close() error

Close cleanup and close the current store

func (*Store) Reader

func (s *Store) Reader() (store.KVReader, error)

Reader initialize a new store.Reader

func (*Store) Writer

func (s *Store) Writer() (store.KVWriter, error)

Writer initialize a new store.Writer

type Writer

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

Writer bleve.search/store/Writer implementation I (alash3al) adopted it from bleve/store/boltdb

func (*Writer) Close

func (w *Writer) Close() error

Close closes the current writer

func (*Writer) ExecuteBatch

func (w *Writer) ExecuteBatch(batch store.KVBatch) (err error)

ExecuteBatch implements bleve ExecuteBatch

func (*Writer) NewBatch

func (w *Writer) NewBatch() store.KVBatch

NewBatch implements NewBatch

func (*Writer) NewBatchEx

func (w *Writer) NewBatchEx(options store.KVBatchOptions) ([]byte, store.KVBatch, error)

NewBatchEx implements bleve NewBatchEx

Jump to

Keyboard shortcuts

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