memstore

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemStore

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

MemStore is a simple DB that's stored in memory. Useful for demos or testing. Not designed to be performant.

func (*MemStore) CreateIndex added in v0.1.3

func (m *MemStore) CreateIndex(createIndexRequest storage.CreateIndexRequest) error

CreateIndex is not supported in memstore, and calling it will always return an error.

func (*MemStore) Get

func (m *MemStore) Get(k string) ([]byte, error)

Get retrieves the value in the store associated with the given key.

func (*MemStore) Put

func (m *MemStore) Put(k string, v []byte) error

Put stores the given key-value pair in the store.

func (*MemStore) Query added in v0.1.3

func (m *MemStore) Query(query string) (storage.ResultsIterator, error)

Query is not supported in memstore, and calling it will always return an error.

type Provider

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

Provider represents an MemStore implementation of the storage.Provider interface

func NewProvider

func NewProvider() *Provider

NewProvider instantiates Provider

func (*Provider) Close

func (p *Provider) Close() error

Close closes the provider.

func (*Provider) CloseStore

func (p *Provider) CloseStore(name string) error

CloseStore closes a previously opened store.

func (*Provider) CreateStore added in v0.1.2

func (p *Provider) CreateStore(name string) error

CreateStore creates a new store with the given name.

func (*Provider) OpenStore

func (p *Provider) OpenStore(name string) (storage.Store, error)

OpenStore opens an existing store with the given name and returns it.

Jump to

Keyboard shortcuts

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