blevestore

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name defines the internal name given to the bleve store
	Name = "gotinydb"
)

Variables

This section is empty.

Functions

func New

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

New returns a new store with the given options

func NewConfigMap added in v0.3.1

func NewConfigMap(ctx context.Context, path string, key [32]byte, prefix []byte, db *badger.DB, writeElementsChan chan *transaction.Transaction) map[string]interface{}

NewConfigMap returns the configuration as a map

Types

type Config added in v0.3.1

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

Config defines the different configurations needed to make the store work

func NewConfig added in v0.3.1

func NewConfig(ctx context.Context, key [32]byte, prefix []byte, db *badger.DB, writeElementsChan chan *transaction.Transaction) (config *Config)

NewConfig returns the configuration as an pointer

type Iterator

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

Iterator is self explained

func (*Iterator) Close

func (i *Iterator) Close() error

Close closes the iterator

func (*Iterator) Current

func (i *Iterator) Current() (key []byte, val []byte, valid bool)

Current returns the current stat of the pointer

func (*Iterator) Key

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

Key returns the key of the given position

func (*Iterator) Next

func (i *Iterator) Next()

Next moves to the next value

func (*Iterator) Seek

func (i *Iterator) Seek(k []byte)

Seek move to a specific location

func (*Iterator) Valid

func (i *Iterator) Valid() bool

Valid returns try if the value and the ID of the actual iterator position are both valid

func (*Iterator) Value

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

Value returns the values for the actual position

type Reader

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

Reader implement the reader interface

func (*Reader) Close

func (r *Reader) Close() error

Close closes the reader

func (*Reader) Get

func (r *Reader) Get(key []byte) (ret []byte, err error)

Get returns the content of the given ID or an error if any

func (*Reader) MultiGet

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

MultiGet returns multiple values of the given ID in on shot. It returns an error if any

func (*Reader) PrefixIterator

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

PrefixIterator builds a new iterator with the provided prefix

func (*Reader) RangeIterator

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

RangeIterator builds a new iterator which will start at start and automatically stop at end

type Store

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

Store implements the blevestore interface

func (*Store) Close

func (bs *Store) Close() error

Close is self explained

func (*Store) Reader

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

Reader open a new transaction but it needs to be closed

func (*Store) Writer

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

Writer returns a new writer interface

type Writer

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

Writer implement the blevestore writer interface

func (*Writer) Close

func (w *Writer) Close() error

Close is self explained

func (*Writer) ExecuteBatch

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

ExecuteBatch runs the batch

func (*Writer) NewBatch

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

NewBatch start a new batch operation

func (*Writer) NewBatchEx

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

NewBatchEx returns an object to keep all operations before run

Jump to

Keyboard shortcuts

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