bbadger: github.com/alash3al/bbadger Index | Files

package bbadger

import "github.com/alash3al/bbadger"

Index

Package Files

bleve.go prefix_iterator.go range_iterator.go reader.go store.go writer.go

Constants

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

func BleveIndex Uses

func BleveIndex(path string, mapping mapping.IndexMapping) (bleve.Index, error)

BleveIndex a helper function that open (creates if not exists a new) bleve index

func New Uses

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

New creates a new store instance

type PrefixIterator Uses

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

PrefixIterator blevesearch prefix-iterator implementation

func (*PrefixIterator) Close Uses

func (i *PrefixIterator) Close() error

Close closes the current iterator and commit its transaction

func (*PrefixIterator) Current Uses

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

Current returns the key & value of the current step

func (*PrefixIterator) Key Uses

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

Key return the key of the current step

func (*PrefixIterator) Next Uses

func (i *PrefixIterator) Next()

Next advance the iterator to the next step

func (*PrefixIterator) Seek Uses

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

Seek advance the iterator to the specified key

func (*PrefixIterator) Valid Uses

func (i *PrefixIterator) Valid() bool

Valid whether the current iterator step is valid or not

func (*PrefixIterator) Value Uses

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

Value returns the value of the current step

type RangeIterator Uses

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

RangeIterator implements blevesearch store iterator

func (*RangeIterator) Close Uses

func (i *RangeIterator) Close() error

Close closes the current iterator and commit its transaction

func (*RangeIterator) Current Uses

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

Current returns the key & value of the current step

func (*RangeIterator) Key Uses

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

Key return the key of the current step

func (*RangeIterator) Next Uses

func (i *RangeIterator) Next()

Next advance the iterator to the next step

func (*RangeIterator) Seek Uses

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

Seek advance the iterator to the specified key

func (*RangeIterator) Valid Uses

func (i *RangeIterator) Valid() bool

Valid whether the current iterator step is valid or not

func (*RangeIterator) Value Uses

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

Value returns the value of the current step

type Reader Uses

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

Reader implements bleve/Store/Reader interface

func (*Reader) Close Uses

func (r *Reader) Close() error

Close closes the current reader and do some cleanup

func (*Reader) Get Uses

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

Get fetch the value of the specified key from the store

func (*Reader) MultiGet Uses

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

MultiGet returns multiple values for the specified keys

func (*Reader) PrefixIterator Uses

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

PrefixIterator initialize a new prefix iterator

func (*Reader) RangeIterator Uses

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

RangeIterator initialize a new range iterator

type Store Uses

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

Store implements blevesearch store

func (*Store) Close Uses

func (s *Store) Close() error

Close cleanup and close the current store

func (*Store) Reader Uses

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

Reader initialize a new store.Reader

func (*Store) Writer Uses

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

Writer initialize a new store.Writer

type Writer Uses

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 Uses

func (w *Writer) Close() error

Close closes the current writer

func (*Writer) ExecuteBatch Uses

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

ExecuteBatch implements bleve ExecuteBatch

func (*Writer) NewBatch Uses

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

NewBatch implements NewBatch

func (*Writer) NewBatchEx Uses

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

NewBatchEx implements bleve NewBatchEx

Package bbadger imports 9 packages (graph). Updated 2018-11-16. Refresh now. Tools for package owners.