memstorage

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2019 License: GPL-3.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

package memstorage provides a simple in-memory key store designed for use in test cases, particularly to isolate them from the filesystem, concurrency, and cleanup issues.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemStore

type MemStore map[string]data

func New

func New() MemStore

New creates an instance of file-based key storage with tight permissions

func (MemStore) Delete

func (s MemStore) Delete(name string) error

Delete removes the named key from the MemStore, raising an error if it wasn't present yet.

func (MemStore) Get

func (s MemStore) Get(name string) ([]byte, keys.Info, error)

Get returns the key stored under the name, or returns an error if not present

func (MemStore) List

func (s MemStore) List() (keys.Infos, error)

List returns the public info of all keys in the MemStore in unsorted order

func (MemStore) Put

func (s MemStore) Put(name string, key []byte, info keys.Info) error

Put adds the given key, returns an error if it another key is already stored under this name

Jump to

Keyboard shortcuts

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