memory

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package memory provides an in-memory key value store. This is useful for testing purposes when you don't want use a persistent backend

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Iter

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

Iter provides a way to iterate through all of the items in the store

func (*Iter) Current

func (i *Iter) Current(v interface{}) error

Current unmarshals the current byte slice into your object

func (*Iter) Err

func (i *Iter) Err() error

Err is here to implement memzy.Iter, but it won't be used

func (*Iter) Next

func (i *Iter) Next() bool

Next moves along to the next item in the Iter

type Store

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

Store provides a key-value store in memory.

func NewStore

func NewStore(key string) *Store

NewStore returns a pointer to a Store that uses key as the PrimaryKey

func (*Store) GetItem

func (s *Store) GetItem(v interface{}, key map[string]interface{}) error

GetItem retrieves an item from the Store

func (*Store) NewIter

func (s *Store) NewIter(args ...interface{}) memzy.Iter

NewIter returns a pointer to an Iter

func (*Store) PutItem

func (s *Store) PutItem(v interface{}) error

PutItem stores an item

Jump to

Keyboard shortcuts

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