teststore

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2019 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Items      []storage.ListItem
	ForceError int

	CallCount struct {
		Get         int
		Put         int
		List        int
		GetAll      int
		ReverseList int
		Delete      int
		Close       int
		Iterate     int
	}
	// contains filtered or unexported fields
}

Client implements in-memory key value store

func New

func New() *Client

New creates a new in-memory key-value store

func (*Client) Close

func (store *Client) Close() error

Close closes the store

func (*Client) Delete

func (store *Client) Delete(key storage.Key) error

Delete deletes key and the value

func (*Client) Get

func (store *Client) Get(key storage.Key) (storage.Value, error)

Get gets a value to store

func (*Client) GetAll

func (store *Client) GetAll(keys storage.Keys) (storage.Values, error)

GetAll gets all values from the store

func (*Client) Iterate

func (store *Client) Iterate(opts storage.IterateOptions, fn func(storage.Iterator) error) error

Iterate iterates over items based on opts

func (*Client) List

func (store *Client) List(first storage.Key, limit int) (storage.Keys, error)

List lists all keys starting from start and upto limit items

func (*Client) Put

func (store *Client) Put(key storage.Key, value storage.Value) error

Put adds a value to store

Jump to

Keyboard shortcuts

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