mem

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package mem implements an in-memory key-value store.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store added in v0.7.0

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

Store is an in-memory key-value store. Its zero value is ready to use.

func (*Store) Create added in v0.7.0

func (s *Store) Create(_ context.Context, name string, k key.Key) error

Create adds the given key to the store if and only if no entry for the given name exists. If an entry already exists it returns kes.ErrKeyExists.

func (*Store) Delete added in v0.7.0

func (s *Store) Delete(_ context.Context, name string) error

Delete removes the key with the given value, if it exists.

func (*Store) Get added in v0.7.0

func (s *Store) Get(_ context.Context, name string) (key.Key, error)

Get returns the key associated with the given name. If no entry for this name exists it returns kes.ErrKeyNotFound.

func (*Store) List added in v0.13.0

func (s *Store) List(ctx context.Context) (key.Iterator, error)

List returns a new iterator over the metadata of all stored keys.

Jump to

Keyboard shortcuts

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