memstore

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2020 License: Apache-2.0 Imports: 1 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) Get

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

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

func (*MemStore) Put

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

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

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) OpenStore

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

OpenStore opens and returns a store for the given name.

Jump to

Keyboard shortcuts

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