mem

package
v0.0.0-...-a355528 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStore

func NewStore(prefix string) store.KV

NewStore returns a store

Types

type Mem

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

Mem stores the kv pairs with key by a prefix set at construct time. This is used for dev, learning mostly

func (*Mem) Close

func (s *Mem) Close() error

Close implements io.Closer

func (*Mem) Delete

func (s *Mem) Delete(key interface{}) error

Delete deletes the object by id

func (*Mem) Entries

func (s *Mem) Entries() (<-chan store.Pair, error)

Entries returns the entries

func (*Mem) Exists

func (s *Mem) Exists(key interface{}) (bool, error)

Exists checks for existence

func (*Mem) Key

func (s *Mem) Key(key interface{}) string

Key returns an id given the key. The id contains type, etc.

func (*Mem) Read

func (s *Mem) Read(key interface{}) ([]byte, error)

Read loads the object

func (*Mem) Write

func (s *Mem) Write(key interface{}, object []byte) error

Write writes the object and returns an id or error.

Jump to

Keyboard shortcuts

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